From a708d06955c063e0dc79cf7e98ccd0456390ed4a Mon Sep 17 00:00:00 2001 From: red031000 Date: Sun, 29 Sep 2024 16:26:57 +0100 Subject: [PATCH] apply clang-format --- .clang-format | 120 +- .clang-format-ignore | 6 + .githooks/pre-commit | 9 + arm9/lib/NitroSDK/include/PAD_pad.h | 1 + arm9/lib/NitroSDK/include/RTC_api.h | 2 + arm9/overlays/01/src/overlay_01.c | 1 + arm9/overlays/05/include/ov05_021E72FC.h | 6 +- arm9/overlays/05/include/overlay_05.h | 6 +- arm9/overlays/05/src/ov05_021E72FC.c | 164 +- arm9/overlays/06/include/overlay_06.h | 7 +- arm9/overlays/11/src/ov11_0222D5C0_2.c | 10 +- arm9/overlays/19/include/overlay_19.h | 8 +- arm9/overlays/19/src/overlay_19.c | 40 +- arm9/overlays/21/include/ov21_02254854.h | 19 +- arm9/overlays/21/include/ov21_02254A6C.h | 10 +- arm9/overlays/21/src/ov21_02254854.c | 166 +- arm9/overlays/21/src/ov21_02254A6C.c | 119 +- arm9/overlays/22/src/overlay_22_sinit.c | 3 +- arm9/overlays/23/src/overlay_23_sinit.c | 3 +- arm9/overlays/24/include/overlay_24.h | 15 +- arm9/overlays/24/src/ov24_02254840.c | 120 +- arm9/overlays/24/src/ov24_02254CA0.c | 131 +- arm9/overlays/25/src/overlay_25_sinit.c | 3 +- arm9/overlays/26/src/overlay_26_sinit.c | 3 +- arm9/overlays/27/src/overlay_27_sinit.c | 3 +- arm9/overlays/28/src/overlay_28_sinit.c | 3 +- arm9/overlays/29/src/overlay_29_sinit.c | 3 +- arm9/overlays/30/src/overlay_30_sinit.c | 3 +- arm9/overlays/31/src/overlay_31_sinit.c | 3 +- arm9/overlays/32/src/overlay_32_sinit.c | 3 +- arm9/overlays/33/src/overlay_33_sinit.c | 3 +- arm9/overlays/34/src/overlay_34_sinit.c | 3 +- arm9/overlays/35/src/overlay_35_sinit.c | 3 +- arm9/overlays/36/src/overlay_36_sinit.c | 3 +- arm9/overlays/37/src/overlay_37_sinit.c | 3 +- arm9/overlays/38/src/overlay_38_sinit.c | 3 +- arm9/overlays/39/src/overlay_39_sinit.c | 3 +- arm9/overlays/40/src/overlay_40_sinit.c | 3 +- arm9/overlays/41/src/overlay_41_sinit.c | 3 +- arm9/overlays/42/src/overlay_42_sinit.c | 3 +- arm9/overlays/43/src/overlay_43_sinit.c | 3 +- arm9/overlays/44/src/overlay_44_sinit.c | 3 +- arm9/overlays/45/src/overlay_45_sinit.c | 3 +- arm9/overlays/46/src/overlay_46_sinit.c | 3 +- arm9/overlays/47/src/overlay_47_sinit.c | 3 +- arm9/overlays/48/src/overlay_48_sinit.c | 3 +- arm9/overlays/49/src/overlay_49_sinit.c | 3 +- arm9/overlays/50/src/overlay_50_sinit.c | 3 +- arm9/overlays/52/include/overlay_52.h | 7 +- arm9/overlays/52/src/overlay_52.c | 408 ++- arm9/overlays/59/include/ov59_Intro.h | 36 +- arm9/overlays/59/include/ov59_TV.h | 6 +- arm9/overlays/59/src/ov59_Intro.c | 3311 ++++++++++------------ arm9/overlays/59/src/ov59_TV.c | 464 ++- arm9/overlays/62/src/overlay_62_sinit.c | 6 +- arm9/overlays/63/include/ov63_021DB450.h | 27 +- arm9/overlays/63/src/ov63_021DB450.c | 222 +- arm9/src/ascii_util.c | 7 +- arm9/src/bag.c | 260 +- arm9/src/bag_view.c | 68 +- arm9/src/bg_window.c | 1809 ++++++------ arm9/src/blackout.c | 217 +- arm9/src/brightness.c | 24 +- arm9/src/camera.c | 119 +- arm9/src/coins.c | 5 +- arm9/src/communication_error.c | 118 +- arm9/src/daycare.c | 15 +- arm9/src/easy_chat.c | 80 +- arm9/src/encounter.c | 701 ++--- arm9/src/error_handling.c | 4 +- arm9/src/error_message_reset.c | 105 +- arm9/src/field_system_rtc_weather.c | 2201 +++++++++++--- arm9/src/filesystem.c | 100 +- arm9/src/font.c | 153 +- arm9/src/game_init.c | 386 ++- arm9/src/gf_gfx_loader.c | 264 +- arm9/src/gf_gfx_planes.c | 65 +- arm9/src/gf_rtc.c | 140 +- arm9/src/hall_of_fame.c | 135 +- arm9/src/heap.c | 248 +- arm9/src/igt.c | 35 +- arm9/src/itemtool.c | 1127 ++++---- arm9/src/list_menu.c | 368 +-- arm9/src/list_menu_items.c | 76 +- arm9/src/mail.c | 207 +- arm9/src/mail_message.c | 143 +- arm9/src/main.c | 185 +- arm9/src/map_header.c | 1319 +++++---- arm9/src/map_matrix.c | 126 +- arm9/src/map_object.c | 162 +- arm9/src/math_util.c | 167 +- arm9/src/message_format.c | 566 ++-- arm9/src/move_relearner.c | 12 +- arm9/src/msgdata.c | 269 +- arm9/src/nutdata.c | 47 +- arm9/src/oam.c | 73 +- arm9/src/options.c | 68 +- arm9/src/overlay_manager.c | 61 +- arm9/src/palette.c | 502 ++-- arm9/src/party.c | 72 +- arm9/src/play_timer.c | 26 +- arm9/src/player_data.c | 150 +- arm9/src/poke_overlay.c | 110 +- arm9/src/pokedex.c | 555 ++-- arm9/src/pokemon.c | 2051 ++++++-------- arm9/src/pokemon_storage_system.c | 243 +- arm9/src/poketch.c | 178 +- arm9/src/render_text.c | 559 ++-- arm9/src/render_window.c | 267 +- arm9/src/rs_migrate_string.c | 525 ++-- arm9/src/sav_chatot.c | 64 +- arm9/src/save.c | 633 ++--- arm9/src/save_arrays.c | 97 +- arm9/src/save_data_read_error.c | 96 +- arm9/src/save_data_write_error.c | 84 +- arm9/src/save_system_info.c | 82 +- arm9/src/save_vars_flags.c | 7 +- arm9/src/scrcmd.c | 2646 +++++++++-------- arm9/src/scrcmd_13.c | 86 +- arm9/src/scrcmd_25.c | 9 +- arm9/src/scrcmd_amity_square.c | 234 +- arm9/src/scrcmd_berry_trees.c | 70 +- arm9/src/scrcmd_coins.c | 97 +- arm9/src/scrcmd_daycare.c | 169 +- arm9/src/scrcmd_flags.c | 211 +- arm9/src/scrcmd_fossils.c | 48 +- arm9/src/scrcmd_items.c | 57 +- arm9/src/scrcmd_mart.c | 129 +- arm9/src/scrcmd_money.c | 69 +- arm9/src/scrcmd_move_relearner.c | 106 +- arm9/src/scrcmd_names.c | 355 +-- arm9/src/scrcmd_party.c | 591 ++-- arm9/src/scrcmd_prizes.c | 52 +- arm9/src/scrcmd_sound.c | 113 +- arm9/src/scrcmd_underground.c | 159 +- arm9/src/scrcmd_union.c | 63 +- arm9/src/script.c | 100 +- arm9/src/script_pokemon_util.c | 169 +- arm9/src/seal_case.c | 33 +- arm9/src/sound.c | 145 +- arm9/src/sound_chatot.c | 94 +- arm9/src/string_control_code.c | 15 +- arm9/src/string_util.c | 54 +- arm9/src/task.c | 114 +- arm9/src/text.c | 315 +- arm9/src/text_02054590.c | 58 +- arm9/src/timer3.c | 35 +- arm9/src/trainer_data.c | 339 +-- arm9/src/unk_020040F4.c | 949 +++---- arm9/src/unk_020051F4.c | 524 ++-- arm9/src/unk_020061E8.c | 27 +- arm9/src/unk_02006D98.c | 1479 +++++----- arm9/src/unk_02008AA4.c | 117 +- arm9/src/unk_02008DEC.c | 454 ++- arm9/src/unk_0200BA78.c | 26 +- arm9/src/unk_0200BB14.c | 562 ++-- arm9/src/unk_0200CA44.c | 20 +- arm9/src/unk_0200E1D0.c | 3 +- arm9/src/unk_02015CC0.c | 16 +- arm9/src/unk_0201CBEC.c | 7 +- arm9/src/unk_02021590.c | 158 +- arm9/src/unk_02021934.c | 220 +- arm9/src/unk_02021FF8.c | 96 +- arm9/src/unk_020222E8.c | 23 +- arm9/src/unk_02022450.c | 44 +- arm9/src/unk_02022504.c | 22 +- arm9/src/unk_02024E64.c | 33 +- arm9/src/unk_02025484.c | 16 +- arm9/src/unk_020254B8.c | 76 +- arm9/src/unk_020286F8.c | 119 +- arm9/src/unk_02029FB0.c | 146 +- arm9/src/unk_0202A1E0.c | 525 ++-- arm9/src/unk_0202A8F4.c | 15 +- arm9/src/unk_0202ABBC.c | 36 +- arm9/src/unk_0202C0E0.c | 25 +- arm9/src/unk_0202C144.c | 20 +- arm9/src/unk_0202D858.c | 134 +- arm9/src/unk_0202E29C.c | 559 ++-- arm9/src/unk_0202F150.c | 1174 +++----- arm9/src/unk_02031480.c | 115 +- arm9/src/unk_02031734.c | 1227 +++----- arm9/src/unk_02033778.c | 24 +- arm9/src/unk_020337E8.c | 31 +- arm9/src/unk_0204AEA8.c | 55 +- arm9/src/unk_0204AF24.c | 123 +- arm9/src/unk_0204B0A0.c | 128 +- arm9/src/unk_0205EC84.c | 257 +- arm9/src/unk_0205FA2C.c | 219 +- arm9/src/unk_0206015C.c | 69 +- arm9/src/unk_0206439C.c | 13 +- arm9/src/unk_02064E20.c | 18 +- arm9/src/unk_02064E4C.c | 19 +- arm9/src/unk_0206B688.c | 158 +- arm9/src/unk_0206BB28.c | 19 +- arm9/src/unk_0207FC5C.c | 586 +--- arm9/src/unk_020851B8.c | 26 +- arm9/src/unk_02085338.c | 113 +- arm9/src/unk_02087A1C.c | 78 +- arm9/src/unk_0208890C.c | 43 +- arm9/src/unk_02088AAC.c | 91 +- arm9/src/unk_0208A300.c | 24 +- arm9/src/use_item_on_mon.c | 516 ++-- arm9/src/waza.c | 29 +- arm9/src/wfc_user_info_warning.c | 91 +- format.sh | 4 + include/ascii_util.h | 2 + include/bag.h | 4 +- include/bag_cursor.h | 1 + include/bag_view.h | 7 +- include/battle_setup.h | 3 +- include/bg_window.h | 51 +- include/blackout.h | 3 +- include/brightness.h | 4 +- include/camera.h | 5 +- include/coins.h | 4 +- include/config.h | 14 +- include/constants/abilities.h | 250 +- include/constants/accessories.h | 22 +- include/constants/battle.h | 605 ++-- include/constants/charcode.h | 508 ++-- include/constants/decorations.h | 280 +- include/constants/easy_chat.h | 832 +++--- include/constants/flags.h | 10 +- include/constants/game_stats.h | 14 +- include/constants/global.h | 6 +- include/constants/global_fieldmap.h | 22 +- include/constants/items.h | 1224 ++++---- include/constants/map_sections.h | 226 +- include/constants/maps.h | 1120 ++++---- include/constants/moves.h | 204 +- include/constants/pokemon.h | 722 +++-- include/constants/rgb.h | 2 +- include/constants/ribbons.h | 85 + include/constants/roamer.h | 58 +- include/constants/save_arrays.h | 18 +- include/constants/script_pokemon_util.h | 8 +- include/constants/seal_constants.h | 164 +- include/constants/sinnoh_dex.h | 204 +- include/constants/sndseq.h | 1666 +++++------ include/constants/species.h | 1000 +++---- include/constants/sprites.h | 4 +- include/constants/trainer_classes.h | 214 +- include/constants/trainers.h | 1700 +++++------ include/constants/trdata.h | 2 +- include/constants/vars.h | 6 +- include/constants/weather.h | 64 +- include/daycare.h | 4 +- include/easy_chat.h | 5 +- include/encounter.h | 2 +- include/error_handling.h | 2 +- include/error_message_reset.h | 6 +- include/fashion_case.h | 6 +- include/field_player_avatar.h | 5 +- include/field_system.h | 22 +- include/field_system_rtc_weather.h | 3 +- include/filesystem.h | 243 +- include/font.h | 7 +- include/game_init.h | 21 +- include/gf_gfx_loader.h | 26 +- include/gf_gfx_planes.h | 8 +- include/gf_rtc.h | 21 +- include/global.h | 22 +- include/hall_of_fame.h | 34 +- include/heap.h | 25 +- include/igt.h | 15 +- include/itemtool.h | 107 +- include/list_menu.h | 90 +- include/list_menu_cursor.h | 5 +- include/list_menu_items.h | 21 +- include/mail.h | 80 +- include/mail_message.h | 39 +- include/main.h | 29 +- include/map_header.h | 17 +- include/map_matrix.h | 13 +- include/map_object.h | 74 +- include/math_util.h | 4 +- include/message_format.h | 58 +- include/misc.h | 10 +- include/move_data.h | 9 +- include/move_relearner.h | 2 +- include/msgdata.h | 37 +- include/nutdata.h | 31 +- include/oam.h | 4 +- include/options.h | 48 +- include/overlay_manager.h | 28 +- include/palette.h | 37 +- include/party.h | 26 +- include/play_timer.h | 3 +- include/player_data.h | 91 +- include/poke_overlay.h | 8 +- include/pokedex.h | 128 +- include/pokemon.h | 244 +- include/pokemon_storage_system.h | 63 +- include/poketch.h | 90 +- include/proto.h | 6 +- include/render_text.h | 30 +- include/render_window.h | 15 +- include/rs_migrate_string.h | 10 +- include/safari_zone.h | 4 +- include/sav_chatot.h | 23 +- include/save.h | 134 +- include/save_data_read_error.h | 2 + include/save_data_write_error.h | 4 + include/save_local_field_data.h | 4 +- include/save_system_info.h | 47 +- include/save_vars_flags.h | 5 +- include/scrcmd.h | 396 ++- include/script.h | 45 +- include/script_pokemon_util.h | 28 +- include/seal.h | 23 +- include/sections.h | 8 +- include/sinit.h | 2 +- include/sound.h | 21 +- include/sound_chatot.h | 1 + include/string16.h | 41 +- include/string_control_code.h | 6 +- include/string_util.h | 2 +- include/task.h | 19 +- include/text.h | 81 +- include/text_02054590.h | 8 +- include/timer3.h | 4 +- include/trainer_data.h | 43 +- include/unk_020040F4.h | 10 +- include/unk_020051F4.h | 3 +- include/unk_020061E8.h | 1 + include/unk_02006D98.h | 49 +- include/unk_02008AA4.h | 7 +- include/unk_02008DEC.h | 34 +- include/unk_0200BA78.h | 1 + include/unk_0200BB14.h | 22 +- include/unk_0200CA44.h | 14 +- include/unk_02015CC0.h | 4 +- include/unk_0201B4E8.h | 4 +- include/unk_0201CBEC.h | 4 +- include/unk_02021590.h | 48 +- include/unk_02021FF8.h | 30 +- include/unk_020222E8.h | 10 +- include/unk_02022450.h | 6 +- include/unk_02022504.h | 6 +- include/unk_02024E64.h | 1 + include/unk_02025484.h | 6 +- include/unk_020254B8.h | 24 +- include/unk_020286F8.h | 46 +- include/unk_02029FB0.h | 32 +- include/unk_0202A1E0.h | 89 +- include/unk_0202A8F4.h | 7 +- include/unk_0202ABBC.h | 23 +- include/unk_0202AC20.h | 5 +- include/unk_0202C0E0.h | 7 +- include/unk_0202C144.h | 6 +- include/unk_0202E29C.h | 28 +- include/unk_0202F150.h | 10 +- include/unk_02031480.h | 1 + include/unk_02031734.h | 13 +- include/unk_02033778.h | 2 +- include/unk_020337E8.h | 8 +- include/unk_020377F0.h | 11 +- include/unk_0204AF24.h | 1 + include/unk_0204B0A0.h | 10 +- include/unk_0205EC84.h | 104 +- include/unk_0205FA2C.h | 15 +- include/unk_0206015C.h | 31 +- include/unk_0206439C.h | 16 +- include/unk_02064E20.h | 2 +- include/unk_02064E4C.h | 4 +- include/unk_0206B688.h | 12 +- include/unk_0206BB28.h | 8 +- include/unk_0207FC5C.h | 87 +- include/unk_020851B8.h | 2 + include/unk_02085338.h | 57 +- include/unk_02087A1C.h | 4 +- include/unk_0208890C.h | 16 +- include/unk_02088AAC.h | 3 +- include/unk_0208A300.h | 19 +- include/use_item_on_mon.h | 27 +- include/wfc_user_info_warning.h | 2 + 376 files changed, 27048 insertions(+), 30670 deletions(-) create mode 100644 .clang-format-ignore create mode 100644 .githooks/pre-commit create mode 100644 format.sh create mode 100644 include/constants/ribbons.h diff --git a/.clang-format b/.clang-format index 6f287c3ca..ebd606a69 100644 --- a/.clang-format +++ b/.clang-format @@ -1,25 +1,103 @@ -BasedOnStyle: LLVM -AllowShortFunctionsOnASingleLine: None -BreakBeforeBraces: Allman -ColumnLimit: 100 -UseTab: Never -IndentWidth: 4 -TabWidth: 4 +--- +BasedOnStyle: WebKit +Language: Cpp +LineEnding: LF +ColumnLimit: 0 + AlignAfterOpenBracket: DontAlign -Cpp11BracedListStyle: false -BreakStringLiterals: false -IndentCaseLabels: true +AlignConsecutiveAssignments: + Enabled: true +AlignConsecutiveBitFields: + Enabled: true +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: Consecutive +AlignTrailingComments: true +AlignArrayOfStructures: Left + +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false + BinPackArguments: false BinPackParameters: false -AlignTrailingComments: false +BitFieldColonSpacing: Both + +InsertBraces: true +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterStruct: false + AfterUnion: false + BeforeElse: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: false + +AlwaysBreakAfterReturnType: None +BreakBeforeBinaryOperators: All +BreakBeforeTernaryOperators: true +BreakStringLiterals: true + +DerivePointerAlignment: false +PointerAlignment: Right +ReferenceAlignment: Right + +ContinuationIndentWidth: 4 +IndentCaseBlocks: false +IndentCaseLabels: false +IndentGotoLabels: false +IndentPPDirectives: None +IndentWidth: 4 + +SortIncludes: CaseSensitive +IncludeBlocks: Regroup IncludeCategories: - - Regex: '^"nitro/types\.h"$' - Priority: -4 - - Regex: '^"global\.h"$' - Priority: -3 - - Regex: '^"nitro/nitro\.h"$' - Priority: -2 - - Regex: '^"nitro/' - Priority: -1 - - Regex: '.\*' - Priority: 1 + - Regex: '((<.+>)|("nitro/.*\.h"))' + Priority: 1 + - Regex: '"global\.h"' + Priority: 2 + - Regex: '"(consts|constants)/.*\.h"' + Priority: 3 + - Regex: '"(struct_(decls|defs))/.*\.h"' + Priority: 4 + - Regex: '"(constdata|res)/.*\.(h|naix)"' + Priority: 7 + - Regex: '"[[:alnum:]_]+/.*\.(h|naix)"' + Priority: 5 + - Regex: '"[[:alnum:]_]+\.(h|naix)"' + Priority: 6 + - Regex: '.*' + Priority: 8 + +InsertTrailingCommas: Wrapped +InsertNewlineAtEOF: true +KeepEmptyLinesAtEOF: false +MaxEmptyLinesToKeep: 1 +RemoveParentheses: ReturnStatement +RemoveSemicolon: true + +# QualifierAlignment: Custom +# QualifierOrder: [static, inline, const, volatile, type] + +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAroundPointerQualifiers: Default +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeParens: ControlStatements +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesInContainerLiterals: true +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParens: Never diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 000000000..aa41a971e --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1,6 @@ +**/*.s +**/*.inc +**/*.json +arm9/lib/ +arm7/lib/ +include/nitro/ \ No newline at end of file diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100644 index 000000000..c065e5754 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,9 @@ +#!/bin/sh +# Redirect output to stderr. +exec 1>&2 + +# Run clang-format on staged files; abort the commit if any files are changed +if ! git clang-format --extensions c,cpp,h,hpp ; then + echo "linting made changes to source files; aborting commit" + exit 1 +fi diff --git a/arm9/lib/NitroSDK/include/PAD_pad.h b/arm9/lib/NitroSDK/include/PAD_pad.h index f3de4198c..2ec2156b9 100644 --- a/arm9/lib/NitroSDK/include/PAD_pad.h +++ b/arm9/lib/NitroSDK/include/PAD_pad.h @@ -2,6 +2,7 @@ #define NITRO_PAD_PAD_H_ #include "registers.h" +#include "mmap.h" //================================================================================ // BUTTONS diff --git a/arm9/lib/NitroSDK/include/RTC_api.h b/arm9/lib/NitroSDK/include/RTC_api.h index 09efde7e5..5c10e9423 100644 --- a/arm9/lib/NitroSDK/include/RTC_api.h +++ b/arm9/lib/NitroSDK/include/RTC_api.h @@ -1,6 +1,8 @@ #ifndef NITRO_RTC_API_H_ #define NITRO_RTC_API_H_ +#include "nitro/types.h" + typedef enum RTCAlarmChan { RTC_ALARM_CHAN_1 = 0, diff --git a/arm9/overlays/01/src/overlay_01.c b/arm9/overlays/01/src/overlay_01.c index 86ff69029..bfe81f271 100644 --- a/arm9/overlays/01/src/overlay_01.c +++ b/arm9/overlays/01/src/overlay_01.c @@ -1,4 +1,5 @@ #include "global.h" + #include "sinit.h" static void NitroStaticInit(void) { diff --git a/arm9/overlays/05/include/ov05_021E72FC.h b/arm9/overlays/05/include/ov05_021E72FC.h index 819f6a326..40f064c49 100644 --- a/arm9/overlays/05/include/ov05_021E72FC.h +++ b/arm9/overlays/05/include/ov05_021E72FC.h @@ -2,11 +2,11 @@ #define POKEDIAMOND_ov05_021E72FC_H #include "nitro/types.h" + #include "field_system.h" #include "task.h" -typedef struct UnkStruct021E7358 -{ +typedef struct UnkStruct021E7358 { u32 Unk00; u32 Unk04; u32 Unk08; @@ -22,4 +22,4 @@ BOOL ov05_021E73B4(TaskManager *taskManager); UnkStruct021E7358 *ov05_021E74D4(u32 param0); void ov05_021E74F8(UnkStruct021E7358 *param0); -#endif //POKEDIAMOND_ov05_021E72FC_H +#endif // POKEDIAMOND_ov05_021E72FC_H diff --git a/arm9/overlays/05/include/overlay_05.h b/arm9/overlays/05/include/overlay_05.h index bc7408f8f..e3ed90e3a 100644 --- a/arm9/overlays/05/include/overlay_05.h +++ b/arm9/overlays/05/include/overlay_05.h @@ -1,10 +1,10 @@ #ifndef POKEDIAMOND_OVERLAY_05_H #define POKEDIAMOND_OVERLAY_05_H -//todo: remove this file +// todo: remove this file #include "pokemon.h" -void ov05_SetEggStats(struct Pokemon * mon, u16 species, int a1, PlayerProfile * data, int a2, int metLoc); +void ov05_SetEggStats(struct Pokemon *mon, u16 species, int a1, PlayerProfile *data, int a2, int metLoc); -#endif //POKEDIAMOND_OVERLAY_05_H +#endif // POKEDIAMOND_OVERLAY_05_H diff --git a/arm9/overlays/05/src/ov05_021E72FC.c b/arm9/overlays/05/src/ov05_021E72FC.c index 26ca3c27b..19a46c295 100644 --- a/arm9/overlays/05/src/ov05_021E72FC.c +++ b/arm9/overlays/05/src/ov05_021E72FC.c @@ -1,6 +1,9 @@ -#include "global.h" #include "ov05_021E72FC.h" + +#include "global.h" + #include "constants/sndseq.h" + #include "heap.h" #include "map_object.h" #include "unk_020051F4.h" @@ -19,27 +22,19 @@ extern void sub_02055304(u32 param0, u32 param1); extern BOOL sub_02056B74(u32 param0, LocalMapObject *object, u32 param2); extern void MapObject_ClearFlagsBits(LocalMapObject *object, u32 bits); -BOOL ov05_021E72FC(FieldSystem *fieldSystem, u32 param1) -{ +BOOL ov05_021E72FC(FieldSystem *fieldSystem, u32 param1) { u8 res = (u8)sub_02058720(PlayerAvatar_GetMapObject(param1)); u32 r2; - if (sub_02054B30(res) == TRUE) - { + if (sub_02054B30(res) == TRUE) { r2 = 3; goto label; - } - else if (sub_02054B3C(res) == TRUE) - { + } else if (sub_02054B3C(res) == TRUE) { r2 = 2; goto label; - } - else if (sub_02054B48(res) == TRUE) - { + } else if (sub_02054B48(res) == TRUE) { r2 = 0; goto label; - } - else if (sub_02054B54(res) == TRUE) - { + } else if (sub_02054B54(res) == TRUE) { r2 = 1; goto label; } @@ -49,110 +44,89 @@ BOOL ov05_021E72FC(FieldSystem *fieldSystem, u32 param1) return TRUE; } -void ov05_021E7358(FieldSystem *fieldSystem, u32 param1, u32 param2) -{ +void ov05_021E7358(FieldSystem *fieldSystem, u32 param1, u32 param2) { UnkStruct021E7358 *res = ov05_021E74D4(24); - res->fieldSystem = fieldSystem; - res->Unk10 = param1; - res->Unk00 = param2; + res->fieldSystem = fieldSystem; + res->Unk10 = param1; + res->Unk00 = param2; PlaySE(SEQ_SE_DP_F209); FieldSystem_CreateTask(fieldSystem, ov05_021E73B4, res); } -u32 ov05_021E7388(u32 param0) -{ - switch (param0) - { - case 0: - return 2; - case 2: - return 1; - case 1: - return 3; - case 3: - return 0; +u32 ov05_021E7388(u32 param0) { + switch (param0) { + case 0: + return 2; + case 2: + return 1; + case 1: + return 3; + case 3: + return 0; } return 0; } -BOOL ov05_021E73B4(TaskManager *taskManager) -{ - UnkStruct021E7358 *strct = TaskManager_GetEnvironment(taskManager); +BOOL ov05_021E73B4(TaskManager *taskManager) { + UnkStruct021E7358 *strct = TaskManager_GetEnvironment(taskManager); LocalMapObject *playerObject = PlayerAvatar_GetMapObject(strct->Unk10); - u8 res2 = (u8)sub_02058720(playerObject); - switch (strct->Unk08) - { - case 0: - MapObject_SetFlagsBits(playerObject, MAPOBJECTFLAG_UNK8); - strct->Unk08++; + u8 res2 = (u8)sub_02058720(playerObject); + switch (strct->Unk08) { + case 0: + MapObject_SetFlagsBits(playerObject, MAPOBJECTFLAG_UNK8); + strct->Unk08++; + break; + case 1: + if (!sub_02057254(strct->Unk10)) { break; - case 1: - if (!sub_02057254(strct->Unk10)) - { - break; - } - sub_02057260(strct->Unk10, sub_0205AFDC(strct->Unk00, 12)); + } + sub_02057260(strct->Unk10, sub_0205AFDC(strct->Unk00, 12)); + sub_02055304(strct->Unk10, strct->Unk00); + strct->Unk08++; + strct->Unk04 = 7; + break; + case 2: + if (strct->Unk04 == 2 || strct->Unk04 == 4 || strct->Unk04 == 6) { + strct->Unk00 = ov05_021E7388(strct->Unk00); sub_02055304(strct->Unk10, strct->Unk00); - strct->Unk08++; - strct->Unk04 = 7; + } + if (--(strct->Unk04)) { break; - case 2: - if (strct->Unk04 == 2 || strct->Unk04 == 4 || strct->Unk04 == 6) - { - strct->Unk00 = ov05_021E7388(strct->Unk00); - sub_02055304(strct->Unk10, strct->Unk00); - } - if (--(strct->Unk04)) - { - break; - } - if (sub_02054B30(res2) == TRUE) - { - strct->Unk00 = 3; - } - else if (sub_02054B3C(res2) == TRUE) - { - strct->Unk00 = 2; - } - else if (sub_02054B48(res2) == TRUE) - { - strct->Unk00 = 0; - } - else if (sub_02054B54(res2) == TRUE) - { - strct->Unk00 = 1; - } - else - { - strct->Unk00 = ov05_021E7388(strct->Unk00); - } - if (sub_02056B74(strct->Unk10, playerObject, strct->Unk00) == FALSE) - { - strct->Unk08 = 1; - break; - } - MapObject_ClearFlagsBits(playerObject, MAPOBJECTFLAG_UNK7); - MapObject_ClearFlagsBits(playerObject, MAPOBJECTFLAG_UNK8); - sub_02055304(strct->Unk10, strct->Unk00); - ov05_021E74F8(strct); - sub_020054F0(1624, 0); - return TRUE; + } + if (sub_02054B30(res2) == TRUE) { + strct->Unk00 = 3; + } else if (sub_02054B3C(res2) == TRUE) { + strct->Unk00 = 2; + } else if (sub_02054B48(res2) == TRUE) { + strct->Unk00 = 0; + } else if (sub_02054B54(res2) == TRUE) { + strct->Unk00 = 1; + } else { + strct->Unk00 = ov05_021E7388(strct->Unk00); + } + if (sub_02056B74(strct->Unk10, playerObject, strct->Unk00) == FALSE) { + strct->Unk08 = 1; + break; + } + MapObject_ClearFlagsBits(playerObject, MAPOBJECTFLAG_UNK7); + MapObject_ClearFlagsBits(playerObject, MAPOBJECTFLAG_UNK8); + sub_02055304(strct->Unk10, strct->Unk00); + ov05_021E74F8(strct); + sub_020054F0(1624, 0); + return TRUE; } return FALSE; } -UnkStruct021E7358 *ov05_021E74D4(u32 param0) -{ +UnkStruct021E7358 *ov05_021E74D4(u32 param0) { UnkStruct021E7358 *res = (UnkStruct021E7358 *)AllocFromHeapAtEnd(HEAP_ID_4, param0); - if (res == NULL) - { + if (res == NULL) { GF_AssertFail(); } memset((void *)res, 0, param0); return res; } -void ov05_021E74F8(UnkStruct021E7358 *param0) -{ +void ov05_021E74F8(UnkStruct021E7358 *param0) { FreeToHeapExplicit(HEAP_ID_4, param0); } diff --git a/arm9/overlays/06/include/overlay_06.h b/arm9/overlays/06/include/overlay_06.h index 5d099a1bc..b51884360 100644 --- a/arm9/overlays/06/include/overlay_06.h +++ b/arm9/overlays/06/include/overlay_06.h @@ -1,8 +1,9 @@ #ifndef POKEDIAMOND_OVERLAY_06_H #define POKEDIAMOND_OVERLAY_06_H -enum MartType -{ +#include "field_system.h" + +enum MartType { MART_ITEMS = 0, MART_GOODS, MART_SEALS, @@ -11,4 +12,4 @@ enum MartType void ov06_0223D3D0(struct TaskManager *, struct FieldSystem *, const u16 *, enum MartType, u32); -#endif //POKEDIAMOND_OVERLAY_06_H +#endif // POKEDIAMOND_OVERLAY_06_H diff --git a/arm9/overlays/11/src/ov11_0222D5C0_2.c b/arm9/overlays/11/src/ov11_0222D5C0_2.c index cefe983ce..dda868046 100644 --- a/arm9/overlays/11/src/ov11_0222D5C0_2.c +++ b/arm9/overlays/11/src/ov11_0222D5C0_2.c @@ -1,15 +1,13 @@ #include "global.h" -#include "poke_overlay.h" + #include "FS_overlay.h" +#include "poke_overlay.h" #include "unk_02031734.h" - FS_EXTERN_OVERLAY(OVERLAY_16); -static void ov11_0222F284(void) -{ - if (!sub_02033590()) - { +static void ov11_0222F284(void) { + if (!sub_02033590()) { HandleLoadOverlay(FS_OVERLAY_ID(OVERLAY_16), 2); } } diff --git a/arm9/overlays/19/include/overlay_19.h b/arm9/overlays/19/include/overlay_19.h index 9ed84b912..aa8b0842e 100644 --- a/arm9/overlays/19/include/overlay_19.h +++ b/arm9/overlays/19/include/overlay_19.h @@ -3,8 +3,8 @@ #include "bg_window.h" -void ov19_02252440(struct BgConfig * bgConfig); -void ov19_022524F4(struct BgConfig * bgConfig); -BOOL ov19_02252504(struct BgConfig * bgConfig); +void ov19_02252440(struct BgConfig *bgConfig); +void ov19_022524F4(struct BgConfig *bgConfig); +BOOL ov19_02252504(struct BgConfig *bgConfig); -#endif //POKEDIAMOND_OVERLAY_19_H +#endif // POKEDIAMOND_OVERLAY_19_H diff --git a/arm9/overlays/19/src/overlay_19.c b/arm9/overlays/19/src/overlay_19.c index 2f3d48fa2..05f53c2df 100644 --- a/arm9/overlays/19/src/overlay_19.c +++ b/arm9/overlays/19/src/overlay_19.c @@ -1,27 +1,29 @@ -#include "global.h" #include "overlay_19.h" -#include "heap.h" -#include "gx.h" -#include "gf_gfx_loader.h" -#include "bg_window.h" + +#include "global.h" + #include "graphic/poketch.naix" +#include "bg_window.h" +#include "gf_gfx_loader.h" +#include "gx.h" +#include "heap.h" + const struct BgTemplate ov19_02252508 = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0x000, - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GF_BG_CLR_4BPP, + .baseTile = 0x000, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GF_BG_CLR_4BPP, .screenBase = 12, - .charBase = 0, - .priority = 0, - .areaOver = 0, - .mosaic = 0 + .charBase = 0, + .priority = 0, + .areaOver = 0, + .mosaic = 0 }; -void ov19_02252440(struct BgConfig * bgConfig) -{ +void ov19_02252440(struct BgConfig *bgConfig) { CreateHeap(3, 8, 0x18000); GXS_SetGraphicsMode(GX_BGMODE_0); GX_SetBankForSubBG(0x80); @@ -35,14 +37,12 @@ void ov19_02252440(struct BgConfig * bgConfig) GXS_SetVisiblePlane(GX_PLANEMASK_BG0); } -void ov19_022524F4(struct BgConfig * bgConfig) -{ +void ov19_022524F4(struct BgConfig *bgConfig) { FreeBgTilemapBuffer(bgConfig, GF_BG_LYR_SUB_0); DestroyHeap(HEAP_ID_POKETCH_APP); } -BOOL ov19_02252504(struct BgConfig * bgConfig) -{ +BOOL ov19_02252504(struct BgConfig *bgConfig) { #pragma unused(bgConfig) return TRUE; } diff --git a/arm9/overlays/21/include/ov21_02254854.h b/arm9/overlays/21/include/ov21_02254854.h index fba521e79..ec72f0df2 100644 --- a/arm9/overlays/21/include/ov21_02254854.h +++ b/arm9/overlays/21/include/ov21_02254854.h @@ -2,17 +2,16 @@ #define POKEDIAMOND_ov21_02254854_H #include "nitro/types.h" + #include "ov21_02254A6C.h" #include "unk_0200CA44.h" -typedef struct Time -{ +typedef struct Time { u32 hour; u32 minute; } Time; -typedef struct UnkStruct02254854 -{ +typedef struct UnkStruct02254854 { u8 bytearray[8]; u8 padding0[8]; BOOL Unk10; @@ -28,10 +27,10 @@ BOOL ov21_0225489C(UnkStruct02254854 *param0, u32 param1, u32 param2, u32 param3 void ov21_02254918(UnkStruct02254854 *param0); void ov21_02254930(SysTask *task, UnkStruct02254854 *param1); void ov21_0225496C(UnkStruct02254854 *param0); -void ov21_02254974(u32 param0, u32 param1, u32 param2, UnkStruct02254854 * param3); -void ov21_02254990(UnkStruct02254854 * param0, u8 param1); -BOOL ov21_022549A4(UnkStruct02254854 * param0); -BOOL ov21_022549E4(UnkStruct02254854 * param0); -BOOL ov21_02254A38(UnkStruct02254854 * param0); +void ov21_02254974(u32 param0, u32 param1, u32 param2, UnkStruct02254854 *param3); +void ov21_02254990(UnkStruct02254854 *param0, u8 param1); +BOOL ov21_022549A4(UnkStruct02254854 *param0); +BOOL ov21_022549E4(UnkStruct02254854 *param0); +BOOL ov21_02254A38(UnkStruct02254854 *param0); -#endif //POKEDIAMOND_ov21_02254854_H +#endif // POKEDIAMOND_ov21_02254854_H diff --git a/arm9/overlays/21/include/ov21_02254A6C.h b/arm9/overlays/21/include/ov21_02254A6C.h index 9f6a33a74..035dc477e 100644 --- a/arm9/overlays/21/include/ov21_02254A6C.h +++ b/arm9/overlays/21/include/ov21_02254A6C.h @@ -5,8 +5,7 @@ typedef struct UnkStruct02254A6C UnkStruct02254A6C; -struct UnkStruct02254A6C -{ +struct UnkStruct02254A6C { UnkStruct02254A6C *Unk00; u32 Unk04; u32 Unk08[1]; @@ -15,12 +14,11 @@ struct UnkStruct02254A6C u32 Unk30[1]; }; -typedef struct UnkOverlayStruct1 -{ +typedef struct UnkOverlayStruct1 { u32 number; BOOL (*func)(u32 param0, void *param1); u32 Unk08; -} UnkOverlayStruct1; //todo should probably be in ov 20 header +} UnkOverlayStruct1; // todo should probably be in ov 20 header BOOL ov21_02254A6C(UnkStruct02254A6C *param0, void *param1); void ov21_02254AD4(void *param0, void *param1); @@ -35,4 +33,4 @@ BOOL ov21_02254C14(u32 param0, void *param1); BOOL ov21_02254C40(u32 param0, void *param1); void ov21_02254C5C(UnkStruct02254A6C *param0); -#endif //POKEDIAMOND_ov21_02254A6C_H +#endif // POKEDIAMOND_ov21_02254A6C_H diff --git a/arm9/overlays/21/src/ov21_02254854.c b/arm9/overlays/21/src/ov21_02254854.c index 37d8d26c8..29b1dec3a 100644 --- a/arm9/overlays/21/src/ov21_02254854.c +++ b/arm9/overlays/21/src/ov21_02254854.c @@ -1,7 +1,9 @@ +#include "ov21_02254854.h" + #include "global.h" + #include "heap.h" #include "unk_0200CA44.h" -#include "ov21_02254854.h" extern void GF_RTC_CopyTime(Time *param0); @@ -16,21 +18,17 @@ extern void ov20_0225298C(u32 param0); extern void Poketch_InitApp(void *func1, void *func2); -static void ov21_02254840(void) -{ +static void ov21_02254840(void) { Poketch_InitApp(ov21_02254854, ov21_0225496C); } #define NitroStaticInit ov21_02254840 #include "sinit.h" -BOOL ov21_02254854(UnkStruct02254854 **param0, u32 param1, u32 param2, u32 param3) -{ +BOOL ov21_02254854(UnkStruct02254854 **param0, u32 param1, u32 param2, u32 param3) { UnkStruct02254854 *alloced = (UnkStruct02254854 *)AllocFromHeap(HEAP_ID_POKETCH_APP, sizeof(UnkStruct02254854)); - if (alloced != NULL) - { - if (ov21_0225489C(alloced, param1, param2, param3) && SysTask_CreateOnMainQueue((SysTaskFunc)ov21_02254930, (void *)alloced, 1)) - { + if (alloced != NULL) { + if (ov21_0225489C(alloced, param1, param2, param3) && SysTask_CreateOnMainQueue((SysTaskFunc)ov21_02254930, (void *)alloced, 1)) { *param0 = alloced; return TRUE; } @@ -39,30 +37,26 @@ BOOL ov21_02254854(UnkStruct02254854 **param0, u32 param1, u32 param2, u32 param return FALSE; } -BOOL ov21_0225489C(UnkStruct02254854 *param0, u32 param1, u32 param2, u32 param3) -{ -#pragma unused (param2, param3) //not sure, please check - if (ov21_02254A6C((UnkStruct02254A6C *)¶m0->Unk24, ¶m0->time)) //todo fix +BOOL ov21_0225489C(UnkStruct02254854 *param0, u32 param1, u32 param2, u32 param3) { +#pragma unused(param2, param3) // not sure, please check + if (ov21_02254A6C((UnkStruct02254A6C *)¶m0->Unk24, ¶m0->time)) // todo fix { param0->bytearray[0] = 0; param0->bytearray[1] = 0; param0->bytearray[2] = 0; param0->bytearray[3] = 1; param0->bytearray[6] = 0; - param0->Unk20 = 0; + param0->Unk20 = 0; GF_RTC_CopyTime(¶m0->time); - if (param0->time.hour >= 0x18) - { + if (param0->time.hour >= 0x18) { param0->time.hour = param0->time.hour % 0x18; } - if (param0->time.minute >= 0x3c) - { + if (param0->time.minute >= 0x3c) { param0->time.hour = param0->time.hour % 0x3c; } param0->bytearray[5] = (u8)param0->time.minute; - param0->Unk10 = ov20_02254130((void *)ov21_02254D80, TRUE, ov21_02254974, param0, 8); - if (param0->Unk10 == FALSE) - { + param0->Unk10 = ov20_02254130((void *)ov21_02254D80, TRUE, ov21_02254974, param0, 8); + if (param0->Unk10 == FALSE) { return FALSE; } param0->Unk28 = param1; @@ -71,24 +65,20 @@ BOOL ov21_0225489C(UnkStruct02254854 *param0, u32 param1, u32 param2, u32 param3 return FALSE; } -BOOL (* const ov21_02254D84[])(UnkStruct02254854 *) = { ov21_022549A4, ov21_022549E4, ov21_02254A38 }; +BOOL (*const ov21_02254D84[])(UnkStruct02254854 *) = { ov21_022549A4, ov21_022549E4, ov21_02254A38 }; -void ov21_02254918(UnkStruct02254854 *param0) -{ +void ov21_02254918(UnkStruct02254854 *param0) { ov21_02254B04(param0->Unk24); ov20_02254198(param0->Unk10); FreeToHeap((void *)param0); } -void ov21_02254930(SysTask *task, UnkStruct02254854 *param1) -{ - if (param1->bytearray[0] >= 3) - { +void ov21_02254930(SysTask *task, UnkStruct02254854 *param1) { + if (param1->bytearray[0] >= 3) { return; } ov20_02252C14(param1->Unk28, param1->Unk10); - if (!ov21_02254D84[param1->bytearray[0]](param1)) - { + if (!ov21_02254D84[param1->bytearray[0]](param1)) { return; } ov21_02254918(param1); @@ -96,104 +86,86 @@ void ov21_02254930(SysTask *task, UnkStruct02254854 *param1) ov20_022529A0(param1->Unk28); } -void ov21_0225496C(UnkStruct02254854 *param0) -{ +void ov21_0225496C(UnkStruct02254854 *param0) { param0->bytearray[2] = 1; } -void ov21_02254974(u32 param0, u32 param1, u32 param2, UnkStruct02254854 * param3) -{ -#pragma unused (param0, param1) - switch (param2) - { - case 1: - param3->Unk20 = 1; - param3->bytearray[6] = 1; - return; - case 0: - param3->Unk20 = 0; - param3->bytearray[6] = 1; - return; - default: - return; +void ov21_02254974(u32 param0, u32 param1, u32 param2, UnkStruct02254854 *param3) { +#pragma unused(param0, param1) + switch (param2) { + case 1: + param3->Unk20 = 1; + param3->bytearray[6] = 1; + return; + case 0: + param3->Unk20 = 0; + param3->bytearray[6] = 1; + return; + default: + return; } } -void ov21_02254990(UnkStruct02254854 * param0, u8 param1) -{ - if (param0->bytearray[2] == 0) - { +void ov21_02254990(UnkStruct02254854 *param0, u8 param1) { + if (param0->bytearray[2] == 0) { param0->bytearray[0] = param1; - } - else - { + } else { param0->bytearray[0] = 2; } param0->bytearray[1] = 0; } -BOOL ov21_022549A4(UnkStruct02254854 * param0) -{ - switch (param0->bytearray[1]) - { - case 0: - ov21_02254B10(param0->Unk24, 0); - param0->bytearray[1]++; - break; - case 1: - if (ov21_02254B34(param0->Unk24, 0) == FALSE) - { - break; - } - ov20_0225298C(param0->Unk28); - ov21_02254990(param0, 1); - break; - default: +BOOL ov21_022549A4(UnkStruct02254854 *param0) { + switch (param0->bytearray[1]) { + case 0: + ov21_02254B10(param0->Unk24, 0); + param0->bytearray[1]++; + break; + case 1: + if (ov21_02254B34(param0->Unk24, 0) == FALSE) { break; + } + ov20_0225298C(param0->Unk28); + ov21_02254990(param0, 1); + break; + default: + break; } return FALSE; } -BOOL ov21_022549E4(UnkStruct02254854 * param0) -{ - if (param0->bytearray[2]) - { +BOOL ov21_022549E4(UnkStruct02254854 *param0) { + if (param0->bytearray[2]) { ov21_02254990(param0, 2); return FALSE; } - if (param0->bytearray[6]) - { + if (param0->bytearray[6]) { param0->bytearray[6] = 0; ov21_02254B10(param0->Unk24, 2); } - if (ov21_02254B34(param0->Unk24, 1)) - { + if (ov21_02254B34(param0->Unk24, 1)) { param0->bytearray[5] = (u8)param0->time.minute; GF_RTC_CopyTime(¶m0->time); - if (param0->bytearray[5] != param0->time.minute) - { + if (param0->bytearray[5] != param0->time.minute) { ov21_02254B10(param0->Unk24, 1); } } return FALSE; } -BOOL ov21_02254A38(UnkStruct02254854 * param0) -{ - switch (param0->bytearray[1]) - { - case 0: - ov21_02254B10(param0->Unk24, 3); - param0->bytearray[1]++; - break; - case 1: - if (ov21_02254B40(param0->Unk24)) - { - return TRUE; - } - break; - default: - break; +BOOL ov21_02254A38(UnkStruct02254854 *param0) { + switch (param0->bytearray[1]) { + case 0: + ov21_02254B10(param0->Unk24, 3); + param0->bytearray[1]++; + break; + case 1: + if (ov21_02254B40(param0->Unk24)) { + return TRUE; + } + break; + default: + break; } return FALSE; } diff --git a/arm9/overlays/21/src/ov21_02254A6C.c b/arm9/overlays/21/src/ov21_02254A6C.c index 0de0f5715..737733e38 100644 --- a/arm9/overlays/21/src/ov21_02254A6C.c +++ b/arm9/overlays/21/src/ov21_02254A6C.c @@ -1,9 +1,10 @@ #include "ov21_02254A6C.h" #include "global.h" + +#include "MI_memory.h" #include "heap.h" #include "registers.h" -#include "MI_memory.h" extern void ov20_022536F4(u32 *param0, u32 param1); extern u32 ov20_02252D34(void); @@ -11,11 +12,11 @@ extern void *GfGfxLoader_GetScrnData(u32 param0, u32 param1, u32 param2, void *p extern void ov20_022537E0(void *param0, u32 param1, void *param2, u32 param3, void *param4, u32 param5, u32 param6); UnkOverlayStruct1 const ov21_02254DAC[] = { - { 0, ov21_02254B60, 0 }, - { 1, ov21_02254BF4, 0 }, - { 2, ov21_02254C14, 0 }, - { 3, ov21_02254C40, 0 }, - { 0, NULL, 0 } + { 0, ov21_02254B60, 0 }, + { 1, ov21_02254BF4, 0 }, + { 2, ov21_02254C14, 0 }, + { 3, ov21_02254C40, 0 }, + { 0, NULL, 0 } }; extern BOOL ov20_02253794(void *param0, u32 param1); @@ -23,9 +24,8 @@ extern BOOL ov20_022537B8(void *param0); extern UnkStruct02254A6C *ov20_022538A0(void *param0); extern BOOL ov20_02253888(void *param0, void *param1); -//todo datatype -u8 const ov21_02254D90[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +// todo datatype +u8 const ov21_02254D90[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; extern void InitBgFromTemplate(u32 param0, u32 param1, void *param2, u32 param3); extern void GfGfxLoader_LoadCharData(u32 param0, u32 param1, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7); @@ -38,18 +38,15 @@ extern void CopyToBgTilemapRect(u32 param0, u32 param1, u32 param2, u32 param3, extern void ov11_02252DB4(u32 param0, u32 param1); -BOOL ov21_02254A6C(UnkStruct02254A6C *param0, void *param1) -{ +BOOL ov21_02254A6C(UnkStruct02254A6C *param0, void *param1) { UnkStruct02254A6C *strct = (UnkStruct02254A6C *)AllocFromHeap(HEAP_ID_POKETCH_APP, 3 << 8); u32 sp4; - if (strct != NULL) - { + if (strct != NULL) { ov20_022536F4(strct->Unk08, 8); strct->Unk00 = param1; strct->Unk04 = ov20_02252D34(); - void *res = GfGfxLoader_GetScrnData(12, 0x19, 1, &sp4, 8); - if (res == 0) - { + void *res = GfGfxLoader_GetScrnData(12, 0x19, 1, &sp4, 8); + if (res == 0) { FreeToHeap(strct); return FALSE; } @@ -61,11 +58,9 @@ BOOL ov21_02254A6C(UnkStruct02254A6C *param0, void *param1) return FALSE; } -void ov21_02254AD4(void *param0, void *param1) -{ +void ov21_02254AD4(void *param0, void *param1) { s32 i = 0; - for (u32 r6 = 9 << 6; i < 9; r6 -= 0x30) - { + for (u32 r6 = 9 << 6; i < 9; r6 -= 0x30) { MI_CpuCopy16(param0, param1, 0x40); MI_CpuCopy16((void *)((u32)param0 + r6), (void *)((u32)param1 + 0x40), 0x10); i++; @@ -74,37 +69,30 @@ void ov21_02254AD4(void *param0, void *param1) } } -void ov21_02254B04(void *param0) -{ - if (param0 != NULL) - { +void ov21_02254B04(void *param0) { + if (param0 != NULL) { FreeToHeap(param0); } } -void ov21_02254B10(u32 *param0, u32 param1) -{ +void ov21_02254B10(u32 *param0, u32 param1) { ov20_022537E0(ov21_02254DAC, param1, param0, *param0, (void *)(param0 + 2), 2, 8); } -BOOL ov21_02254B34(void *param0, u32 param1) -{ +BOOL ov21_02254B34(void *param0, u32 param1) { return ov20_02253794((void *)((u32)param0 + 8), param1); } -BOOL ov21_02254B40(void *param0) -{ +BOOL ov21_02254B40(void *param0) { return ov20_022537B8((void *)((u32)param0 + 8)); } -BOOL ov21_02254B4C(void *param0) -{ +BOOL ov21_02254B4C(void *param0) { return ov20_02253888((void *)((u32)ov20_022538A0(param0) + 8), param0); } -BOOL ov21_02254B60(u32 param0, void *param1) -{ -#pragma unused (param0) +BOOL ov21_02254B60(u32 param0, void *param1) { +#pragma unused(param0) UnkStruct02254A6C *strct = ov20_022538A0(param1); InitBgFromTemplate(strct->Unk04, 6, ov21_02254D90, 0); GfGfxLoader_LoadCharData(12, 23, strct->Unk04, 6, 0, 0, 1, 8); @@ -112,76 +100,69 @@ BOOL ov21_02254B60(u32 param0, void *param1) ov20_02252D7C(0, 0); ov21_02254C5C(strct); BgCommitTilemapBufferToVram(strct->Unk04, 6); - u32 r3 = reg_GXS_DB_DISPCNT; - u32 r2 = reg_GXS_DB_DISPCNT; - vu32 tmp = r3; //unused? wtf - u32 r0 = ~0x1F00 & r2; - r2 = r3 << 19; //cast with shift? can't replicate both though - r3 = r2 >> 27; - r2 = 4 | r3; + u32 r3 = reg_GXS_DB_DISPCNT; + u32 r2 = reg_GXS_DB_DISPCNT; + vu32 tmp = r3; // unused? wtf + u32 r0 = ~0x1F00 & r2; + r2 = r3 << 19; // cast with shift? can't replicate both though + r3 = r2 >> 27; + r2 = 4 | r3; r2 <<= 8; r0 |= r2; reg_GXS_DB_DISPCNT = r0; return ov21_02254B4C(param1); } -BOOL ov21_02254BF4(u32 param0, void *param1) -{ -#pragma unused (param0) +BOOL ov21_02254BF4(u32 param0, void *param1) { +#pragma unused(param0) UnkStruct02254A6C *strct = ov20_022538A0(param1); ov21_02254C5C(strct); BgCommitTilemapBufferToVram(strct->Unk04, 6); return ov21_02254B4C(param1); } -BOOL ov21_02254C14(u32 param0, void *param1) -{ -#pragma unused (param0) +BOOL ov21_02254C14(u32 param0, void *param1) { +#pragma unused(param0) UnkStruct02254A6C *strct = ov20_022538A0(param1); - if (strct->Unk00->Unk0C) - { + if (strct->Unk00->Unk0C) { ov11_02252DB4(0, 0); - } - else - { + } else { ov20_02252D7C(0, 0); } return ov21_02254B4C(param1); } -BOOL ov21_02254C40(u32 param0, void *param1) -{ -#pragma unused (param0) +BOOL ov21_02254C40(u32 param0, void *param1) { +#pragma unused(param0) UnkStruct02254A6C *strct = ov20_022538A0(param1); FreeBgTilemapBuffer(strct->Unk04, 6); return ov21_02254B4C(param1); } -void ov21_02254C5C(UnkStruct02254A6C *param0) -{ - u32 tmp = (u32)param0->Unk00->Unk00; - reg_CP_DIVCNT = 0; +void ov21_02254C5C(UnkStruct02254A6C *param0) { + u32 tmp = (u32)param0->Unk00->Unk00; + reg_CP_DIVCNT = 0; (*(vu32 *)REG_DIV_NUMER_ADDR) = tmp; - reg_CP_DIV_DENOM = 10; - while (reg_CP_DIVCNT & ((u32)®_CP_DIVCNT >> 0xb)) { } + reg_CP_DIV_DENOM = 10; + while (reg_CP_DIVCNT & ((u32)®_CP_DIVCNT >> 0xb)) {} - u32 regaddr = (u32)®_CP_DIV_RESULT_L; + u32 regaddr = (u32)®_CP_DIV_RESULT_L; u32 divResult = *(u32 *)regaddr; - while (reg_CP_DIVCNT & (regaddr >> 0xb)) { } + while (reg_CP_DIVCNT & (regaddr >> 0xb)) {} u32 divRemRes = reg_CP_DIVREM_RESULT_L; CopyToBgTilemapRect(param0->Unk04, 6, 3, 7, 4, 9, param0->Unk30, (u8)(divResult << 2), 0, 40, 9); CopyToBgTilemapRect(param0->Unk04, 6, 8, 7, 4, 9, param0->Unk30, (u8)(divRemRes << 2), 0, 40, 9); - tmp = param0->Unk00->Unk04; - reg_CP_DIVCNT = 0; + tmp = param0->Unk00->Unk04; + reg_CP_DIVCNT = 0; (*(vu32 *)REG_DIV_NUMER_ADDR) = tmp; - reg_CP_DIV_DENOM = 10; + reg_CP_DIV_DENOM = 10; - while (reg_CP_DIVCNT & ((u32)®_CP_DIVCNT >> 0xb)) { } + while (reg_CP_DIVCNT & ((u32)®_CP_DIVCNT >> 0xb)) {} divResult = *(u32 *)regaddr; - while (reg_CP_DIVCNT & (regaddr >> 0xb)) { } + while (reg_CP_DIVCNT & (regaddr >> 0xb)) {} divRemRes = reg_CP_DIVREM_RESULT_L; CopyToBgTilemapRect(param0->Unk04, 6, 15, 7, 4, 9, param0->Unk30, (u8)(divResult << 2), 0, 40, 9); diff --git a/arm9/overlays/22/src/overlay_22_sinit.c b/arm9/overlays/22/src/overlay_22_sinit.c index 2c94b9bac..27dcc6ad1 100644 --- a/arm9/overlays/22/src/overlay_22_sinit.c +++ b/arm9/overlays/22/src/overlay_22_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov22_02254854(); extern void ov22_022549D8(); -static void ov22_02254840(void) -{ +static void ov22_02254840(void) { Poketch_InitApp(ov22_02254854, ov22_022549D8); } diff --git a/arm9/overlays/23/src/overlay_23_sinit.c b/arm9/overlays/23/src/overlay_23_sinit.c index a2798392e..0b4c9951f 100644 --- a/arm9/overlays/23/src/overlay_23_sinit.c +++ b/arm9/overlays/23/src/overlay_23_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov23_02254854(); extern void ov23_022549A4(); -static void ov23_02254840(void) -{ +static void ov23_02254840(void) { Poketch_InitApp(ov23_02254854, ov23_022549A4); } diff --git a/arm9/overlays/24/include/overlay_24.h b/arm9/overlays/24/include/overlay_24.h index 355b87bc0..15b237328 100644 --- a/arm9/overlays/24/include/overlay_24.h +++ b/arm9/overlays/24/include/overlay_24.h @@ -3,16 +3,15 @@ typedef enum { TOUCH_TYPE_ERASE = 0, - TOUCH_TYPE_DRAW = 1, + TOUCH_TYPE_DRAW = 1, } TouchType; typedef enum { MEMO_PAD_PIXEL_TYPE_FILLED = 1, - MEMO_PAD_PIXEL_TYPE_EMPTY = 4, + MEMO_PAD_PIXEL_TYPE_EMPTY = 4, } MemoPadPixelType; -typedef struct MemoPadDrawState -{ +typedef struct MemoPadDrawState { TouchType touchType; u32 lastModifiedX; u32 lastModifiedY; @@ -21,8 +20,7 @@ typedef struct MemoPadDrawState u32 unk16E8; } MemoPadDrawState; -typedef struct MemoPadDisplayHandler -{ +typedef struct MemoPadDisplayHandler { MemoPadDrawState *drawState; BgConfig *config; u32 unk8; @@ -33,8 +31,7 @@ typedef struct MemoPadDisplayHandler Window *window; } MemoPadDisplayHandler; -typedef struct MemoPadAppHandler -{ +typedef struct MemoPadAppHandler { u8 unk0; u8 unk1; u8 unk2; @@ -75,4 +72,4 @@ void ov24_02255050(u32 arg0, void *arg1); void ov24_02255078(MemoPadDisplayHandler *displayHandler); void ov24_022550D4(MemoPadDisplayHandler *displayHandler); -#endif //POKEDIAMOND_OVERLAY_24_H +#endif // POKEDIAMOND_OVERLAY_24_H diff --git a/arm9/overlays/24/src/ov24_02254840.c b/arm9/overlays/24/src/ov24_02254840.c index f7ed16891..c554bbbac 100644 --- a/arm9/overlays/24/src/ov24_02254840.c +++ b/arm9/overlays/24/src/ov24_02254840.c @@ -1,8 +1,9 @@ #include "global.h" + #include "bg_window.h" -#include "unk_0200CA44.h" #include "gf_gfx_loader.h" #include "overlay_24.h" +#include "unk_0200CA44.h" extern void Poketch_InitApp(void *func1, void *func2); extern u32 ov20_02254130(void *arg0, u32 arg1, void *arg2, void *arg3, u32 arg4); @@ -13,8 +14,7 @@ extern void ov20_0225298C(u32 arg0); extern BOOL ov20_02252C08(u32 arg0); extern BOOL TouchScreen_GetTapState(u32 *arg0, u32 *arg1); -static void ov24_02254840(void) -{ +static void ov24_02254840(void) { Poketch_InitApp(ov24_02254854, ov24_02254990); } @@ -39,15 +39,15 @@ BOOL ov24_0225489C(MemoPadAppHandler *appHandler, u32 arg1, u32 arg2, u32 arg3) static const u8 ov24_022550F8[] = { 0x18, 0x58, 0xB4, 0xCC, 0x68, 0xA8, 0xB4, 0xCC }; - appHandler->drawState.unk16E8 = arg3; + appHandler->drawState.unk16E8 = arg3; appHandler->drawState.touchType = TOUCH_TYPE_DRAW; if (ov24_02254CA0(&(appHandler->displayHandler), &(appHandler->drawState))) { - appHandler->unk0 = 0; - appHandler->unk1 = 0; - appHandler->unk2 = 0; + appHandler->unk0 = 0; + appHandler->unk1 = 0; + appHandler->unk2 = 0; appHandler->touchHeld = FALSE; - appHandler->unk16FC = ov20_02254130(ov24_022550F8, 2, ov24_02254960, appHandler, 8); - appHandler->unk16F8 = arg1; + appHandler->unk16FC = ov20_02254130(ov24_022550F8, 2, ov24_02254960, appHandler, 8); + appHandler->unk16F8 = arg1; return TRUE; } return FALSE; @@ -60,7 +60,7 @@ void ov24_022548F4(MemoPadAppHandler *appHandler) { } void ov24_02254918(void *arg0, MemoPadAppHandler *appHandler) { - static BOOL (*const ov24_02255100[3])(MemoPadAppHandler*) = { + static BOOL (*const ov24_02255100[3])(MemoPadAppHandler *) = { ov24_022549AC, ov24_022549F8, ov24_02254C64 }; if (appHandler->unk0 < 3) { @@ -77,8 +77,7 @@ void ov24_02254960(s32 arg0, s32 arg1, s32 arg2, MemoPadAppHandler *appHandler) if (arg2 == 1) { if ( (appHandler->drawState.touchType == TOUCH_TYPE_DRAW && arg0 == 0) - || (appHandler->drawState.touchType == TOUCH_TYPE_ERASE && arg0 == 1) - ) { + || (appHandler->drawState.touchType == TOUCH_TYPE_ERASE && arg0 == 1)) { appHandler->drawState.touchType ^= 1; ov24_02254D8C(appHandler->displayHandler, 1); } @@ -92,8 +91,7 @@ void ov24_02254990(MemoPadAppHandler *appHandler) { void ov24_02254998(MemoPadAppHandler *appHandler, u8 arg1) { if (appHandler->unk2 == 0) { appHandler->unk0 = arg1; - } - else { + } else { appHandler->unk0 = 2; } appHandler->unk1 = 0; @@ -101,18 +99,18 @@ void ov24_02254998(MemoPadAppHandler *appHandler, u8 arg1) { BOOL ov24_022549AC(MemoPadAppHandler *appHandler) { switch (appHandler->unk1) { - case 0: - ov24_02254D8C(appHandler->displayHandler, 0); - appHandler->unk1++; - break; - case 1: - if (ov24_02254DB0(appHandler->displayHandler, 0)) { - ov20_0225298C(appHandler->unk16F8); - ov24_02254998(appHandler, 1); - } - break; - default: - break; + case 0: + ov24_02254D8C(appHandler->displayHandler, 0); + appHandler->unk1++; + break; + case 1: + if (ov24_02254DB0(appHandler->displayHandler, 0)) { + ov20_0225298C(appHandler->unk16F8); + ov24_02254998(appHandler, 1); + } + break; + default: + break; } return FALSE; } @@ -122,25 +120,25 @@ BOOL ov24_022549F8(MemoPadAppHandler *appHandler) { ov24_02254998(appHandler, 2); } switch (appHandler->unk1) { - case 0: - if (ov20_02252C08(appHandler->unk16F8)) { - break; - } - if (appHandler->touchHeld) { - u32 x = appHandler->drawState.lastModifiedX; - u32 y = appHandler->drawState.lastModifiedY; - if (ov24_02254AD4(appHandler)) { - ov24_02254B20(appHandler, x, y, appHandler->drawState.lastModifiedX, appHandler->drawState.lastModifiedY); - } else { - appHandler->touchHeld = FALSE; - } + case 0: + if (ov20_02252C08(appHandler->unk16F8)) { + break; + } + if (appHandler->touchHeld) { + u32 x = appHandler->drawState.lastModifiedX; + u32 y = appHandler->drawState.lastModifiedY; + if (ov24_02254AD4(appHandler)) { + ov24_02254B20(appHandler, x, y, appHandler->drawState.lastModifiedX, appHandler->drawState.lastModifiedY); } else { - if (ov24_02254A70(appHandler)) { - ov24_02254D8C(appHandler->displayHandler, 3); - appHandler->touchHeld = TRUE; - } + appHandler->touchHeld = FALSE; } - break; + } else { + if (ov24_02254A70(appHandler)) { + ov24_02254D8C(appHandler->displayHandler, 3); + appHandler->touchHeld = TRUE; + } + } + break; } return FALSE; } @@ -153,11 +151,11 @@ BOOL ov24_02254A70(MemoPadAppHandler *appHandler) { y = (y - 16) >> 1; if (appHandler->drawState.pixelData[x][y] != appHandler->drawState.touchType) { appHandler->drawState.pixelData[x][y] = appHandler->drawState.touchType; - appHandler->drawState.lastModifiedX = x; - appHandler->drawState.lastModifiedY = y; + appHandler->drawState.lastModifiedX = x; + appHandler->drawState.lastModifiedY = y; return TRUE; } - } + } } return FALSE; } @@ -166,8 +164,8 @@ BOOL ov24_02254AD4(MemoPadAppHandler *appHandler) { u32 x, y; if (TouchScreen_GetTapState(&x, &y)) { if (((x - 16) < 156) & ((y - 16) < 150)) { - x = (x - 16) >> 1; - y = (y - 16) >> 1; + x = (x - 16) >> 1; + y = (y - 16) >> 1; appHandler->drawState.lastModifiedX = x; appHandler->drawState.lastModifiedY = y; return TRUE; @@ -199,8 +197,8 @@ void ov24_02254B20(MemoPadAppHandler *appHandler, u32 x0, u32 y0, u32 x1, u32 y1 if ((x0 < 0x4e) && ((u32)offset < 0x4b)) { if (appHandler->drawState.touchType != appHandler->drawState.pixelData[x0][offset]) { appHandler->drawState.pixelData[x0][offset] = appHandler->drawState.touchType; - appHandler->drawState.lastModifiedX = x0; - appHandler->drawState.lastModifiedY = offset; + appHandler->drawState.lastModifiedX = x0; + appHandler->drawState.lastModifiedY = offset; ov24_02254D8C(appHandler->displayHandler, 3); } } @@ -222,8 +220,8 @@ void ov24_02254B20(MemoPadAppHandler *appHandler, u32 x0, u32 y0, u32 x1, u32 y1 if ((y0 < 0x4b) && ((u32)offset < 0x4e)) { if (appHandler->drawState.touchType != appHandler->drawState.pixelData[offset][y0]) { appHandler->drawState.pixelData[offset][y0] = appHandler->drawState.touchType; - appHandler->drawState.lastModifiedX = offset; - appHandler->drawState.lastModifiedY = y0; + appHandler->drawState.lastModifiedX = offset; + appHandler->drawState.lastModifiedY = y0; ov24_02254D8C(appHandler->displayHandler, 3); } } @@ -240,15 +238,15 @@ void ov24_02254B20(MemoPadAppHandler *appHandler, u32 x0, u32 y0, u32 x1, u32 y1 BOOL ov24_02254C64(MemoPadAppHandler *appHandler) { switch (appHandler->unk1) { - case 0: - ov24_02254D8C(appHandler->displayHandler, 5); - appHandler->unk1++; - break; - case 1: - if (ov24_02254DBC(appHandler->displayHandler)) { - return TRUE; - } - break; + case 0: + ov24_02254D8C(appHandler->displayHandler, 5); + appHandler->unk1++; + break; + case 1: + if (ov24_02254DBC(appHandler->displayHandler)) { + return TRUE; + } + break; } return FALSE; } diff --git a/arm9/overlays/24/src/ov24_02254CA0.c b/arm9/overlays/24/src/ov24_02254CA0.c index a3aedc5c8..ae3af749a 100644 --- a/arm9/overlays/24/src/ov24_02254CA0.c +++ b/arm9/overlays/24/src/ov24_02254CA0.c @@ -1,11 +1,14 @@ #include "global.h" + +#include "constants/sndseq.h" + +#include "graphic/poketch.naix" + +#include "SPI_pm.h" #include "bg_window.h" -#include "unk_0200CA44.h" #include "gf_gfx_loader.h" #include "overlay_24.h" -#include "SPI_pm.h" -#include "constants/sndseq.h" -#include "graphic/poketch.naix" +#include "unk_0200CA44.h" extern BOOL sub_0208946C(u32 arg0, void *arg1, u32 arg2); extern void sub_02089444(u32 arg0, void *arg1, u32 arg2); @@ -32,8 +35,8 @@ BOOL ov24_02254CA0(MemoPadDisplayHandler **displayHandlerOut, MemoPadDrawState * ov20_022536F4(&(displayHandler->unk8), 0x10); GF_ASSERT(GF_heap_c_dummy_return_true(HEAP_ID_POKETCH_MAIN)); displayHandler->drawState = drawState; - displayHandler->config = ov20_02252D34(); - displayHandler->unk50 = ov20_02252D24(); + displayHandler->config = ov20_02252D34(); + displayHandler->unk50 = ov20_02252D24(); GF_ASSERT(GF_heap_c_dummy_return_true(HEAP_ID_POKETCH_MAIN)); *displayHandlerOut = displayHandler; return TRUE; @@ -43,12 +46,12 @@ BOOL ov24_02254CA0(MemoPadDisplayHandler **displayHandlerOut, MemoPadDrawState * BOOL ov24_02254D00(MemoPadDisplayHandler *displayHandler) { static const WindowTemplate template = { - .bgId = GF_BG_LYR_SUB_3, - .left = 2, - .top = 2, - .width = 20, - .height = 19, - .palette = 0, + .bgId = GF_BG_LYR_SUB_3, + .left = 2, + .top = 2, + .width = 20, + .height = 19, + .palette = 0, .baseTile = 12, }; displayHandler->window = AllocWindows(HEAP_ID_POKETCH_APP, 1); @@ -77,13 +80,27 @@ void ov24_02254D48(MemoPadDisplayHandler *displayHandler) { void ov24_02254D8C(MemoPadDisplayHandler *displayHandler, u32 arg1) { // TODO: types static const u32 ov24_0225516C[] = { - 0x00, (u32)ov24_02254DDC, 0x00, - 0x01, (u32)ov24_02254EE0, 0x00, - 0x02, (u32)ov24_02254F28, 0x00, - 0x03, (u32)ov24_02254F40, 0x00, - 0x04, (u32)ov24_02255038, 0x00, - 0x05, (u32)ov24_02255050, 0x00, - 0x00, 0x00000000, 0x00, + 0x00, + (u32)ov24_02254DDC, + 0x00, + 0x01, + (u32)ov24_02254EE0, + 0x00, + 0x02, + (u32)ov24_02254F28, + 0x00, + 0x03, + (u32)ov24_02254F40, + 0x00, + 0x04, + (u32)ov24_02255038, + 0x00, + 0x05, + (u32)ov24_02255050, + 0x00, + 0x00, + 0x00000000, + 0x00, }; ov20_022537E0(ov24_0225516C, arg1, displayHandler, displayHandler->drawState, &(displayHandler->unk8), 2, 8); } @@ -97,49 +114,49 @@ BOOL ov24_02254DBC(MemoPadDisplayHandler *displayHandler) { } void ov24_02254DC8(void *arg0) { - ov20_02253888(&(((MemoPadDisplayHandler*)ov20_022538A0(arg0))->unk8), arg0); + ov20_02253888(&(((MemoPadDisplayHandler *)ov20_022538A0(arg0))->unk8), arg0); } void ov24_02254DDC(void *arg0, void *arg1) { static const BgTemplate template_7000 = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0, - .baseTile = 0, - .size = 1, - .colorMode = 0, + .baseTile = 0, + .size = 1, + .colorMode = 0, .screenBase = GX_BG_SCRBASE_0x7000, - .charBase = GX_BG_CHARBASE_0x00000, - .bgExtPltt = 0, - .priority = 2, - .areaOver = 0, - .dummy = 0, - .mosaic = 0, + .charBase = GX_BG_CHARBASE_0x00000, + .bgExtPltt = 0, + .priority = 2, + .areaOver = 0, + .dummy = 0, + .mosaic = 0, }; static const BgTemplate template_7800 = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0, - .size = 1, - .colorMode = 0, + .baseTile = 0, + .size = 1, + .colorMode = 0, .screenBase = GX_BG_SCRBASE_0x7800, - .charBase = GX_BG_CHARBASE_0x00000, - .bgExtPltt = 0, - .priority = 3, - .areaOver = 0, - .dummy = 0, - .mosaic = 0, + .charBase = GX_BG_CHARBASE_0x00000, + .bgExtPltt = 0, + .priority = 3, + .areaOver = 0, + .dummy = 0, + .mosaic = 0, }; GF_ASSERT(GF_heap_c_dummy_return_true(HEAP_ID_POKETCH_APP)); GXSDispCnt dispcnt; MemoPadDisplayHandler *displayHandler = ov20_022538A0(arg1); InitBgFromTemplate(displayHandler->config, GF_BG_LYR_SUB_2, &template_7000, 0); InitBgFromTemplate(displayHandler->config, GF_BG_LYR_SUB_3, &template_7800, 0); - GF_ASSERT(GF_heap_c_dummy_return_true(HEAP_ID_POKETCH_APP)); + GF_ASSERT(GF_heap_c_dummy_return_true(HEAP_ID_POKETCH_APP)); GfGfxLoader_LoadCharData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0030_bin, displayHandler->config, GF_BG_LYR_SUB_2, 0, 0, TRUE, HEAP_ID_POKETCH_APP); GfGfxLoader_LoadScrnData(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0031_NSCR, displayHandler->config, GF_BG_LYR_SUB_2, 0, 0, TRUE, HEAP_ID_POKETCH_APP); - ov20_02252D7C(0,0); + ov20_02252D7C(0, 0); GF_ASSERT(GF_heap_c_dummy_return_true(HEAP_ID_POKETCH_APP)); ov24_02254D00(displayHandler); CopyWindowToVram(displayHandler->window); @@ -174,12 +191,12 @@ void ov24_02254F28(s32 arg0, void *arg1) { void ov24_02254F40(u32 arg0, void *arg1) { MemoPadDisplayHandler *displayHandler = ov20_022538A0(arg1); - MemoPadDrawState *drawState = displayHandler->drawState; + MemoPadDrawState *drawState = displayHandler->drawState; if (drawState->touchType == TOUCH_TYPE_ERASE) { s32 width, height; width = height = 8; - s32 x = drawState->lastModifiedX * 2 - 4; - s32 y = drawState->lastModifiedY * 2 - 4; + s32 x = drawState->lastModifiedX * 2 - 4; + s32 y = drawState->lastModifiedY * 2 - 4; if (x < 0) { width += x; x = 0; @@ -193,17 +210,17 @@ void ov24_02254F40(u32 arg0, void *arg1) { s32 e = ((x + width - 1) >> 3) - (x >> 3) + 1; s32 b = ((y + height - 1) >> 3) - (y >> 3) + 1; while (b--) { - GXS_LoadBG3Char((u8*)(displayHandler->window->pixelBuffer) + (a * 0x20), (a + 0xc) * 0x20, e * 0x20); + GXS_LoadBG3Char((u8 *)(displayHandler->window->pixelBuffer) + (a * 0x20), (a + 0xc) * 0x20, e * 0x20); a += 0x14; } } else { s32 height = 2; - s32 width = 2; - s32 x = drawState->lastModifiedX * 2; - s32 y = drawState->lastModifiedY * 2; - s32 a = (x >> 3) + ((y >> 3) * 0x14); + s32 width = 2; + s32 x = drawState->lastModifiedX * 2; + s32 y = drawState->lastModifiedY * 2; + s32 a = (x >> 3) + ((y >> 3) * 0x14); FillWindowPixelRect(displayHandler->window, MEMO_PAD_PIXEL_TYPE_FILLED, x, y, width, height); - GXS_LoadBG3Char((u8*)(displayHandler->window->pixelBuffer) + a * 0x20, (a + 0xc) * 0x20, 0x20); + GXS_LoadBG3Char((u8 *)(displayHandler->window->pixelBuffer) + a * 0x20, (a + 0xc) * 0x20, 0x20); } ov24_02254DC8(arg1); } @@ -225,12 +242,8 @@ void ov24_02255050(u32 arg0, void *arg1) { void ov24_02255078(MemoPadDisplayHandler *displayHandler) { // TODO: types static const u32 ov24_0225514C[2][4] = { - { - 0xC0000, 0x38000, 0x2000000, 0x0 - }, - { - 0xC0000, 0x88000, 0x2000003, 0x0 - } + { 0xC0000, 0x38000, 0x2000000, 0x0 }, + { 0xC0000, 0x88000, 0x2000003, 0x0 } }; GfGfxLoader_LoadWholePalette(NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0032_bin, PM_LCD_BOTTOM, 0, 0, TRUE, HEAP_ID_POKETCH_APP); if (ov20_02253FBC(&(displayHandler->unk54), NARC_GRAPHIC_POKETCH, NARC_poketch_narc_0033_NCER, NARC_poketch_narc_0034_NANR, HEAP_ID_POKETCH_APP)) { diff --git a/arm9/overlays/25/src/overlay_25_sinit.c b/arm9/overlays/25/src/overlay_25_sinit.c index 4db2e720c..d18499925 100644 --- a/arm9/overlays/25/src/overlay_25_sinit.c +++ b/arm9/overlays/25/src/overlay_25_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov25_02254854(); extern void ov25_0225496C(); -static void ov25_02254840(void) -{ +static void ov25_02254840(void) { Poketch_InitApp(ov25_02254854, ov25_0225496C); } diff --git a/arm9/overlays/26/src/overlay_26_sinit.c b/arm9/overlays/26/src/overlay_26_sinit.c index f21002657..111251816 100644 --- a/arm9/overlays/26/src/overlay_26_sinit.c +++ b/arm9/overlays/26/src/overlay_26_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov26_02254854(); extern void ov26_02254A84(); -static void ov26_02254840(void) -{ +static void ov26_02254840(void) { Poketch_InitApp(ov26_02254854, ov26_02254A84); } diff --git a/arm9/overlays/27/src/overlay_27_sinit.c b/arm9/overlays/27/src/overlay_27_sinit.c index 4fa497a85..d844898e6 100644 --- a/arm9/overlays/27/src/overlay_27_sinit.c +++ b/arm9/overlays/27/src/overlay_27_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov27_02254854(); extern void ov27_0225492C(); -static void ov27_02254840(void) -{ +static void ov27_02254840(void) { Poketch_InitApp(ov27_02254854, ov27_0225492C); } diff --git a/arm9/overlays/28/src/overlay_28_sinit.c b/arm9/overlays/28/src/overlay_28_sinit.c index 246742799..147981c00 100644 --- a/arm9/overlays/28/src/overlay_28_sinit.c +++ b/arm9/overlays/28/src/overlay_28_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov28_02254854(); extern void ov28_022549F4(); -static void ov28_02254840(void) -{ +static void ov28_02254840(void) { Poketch_InitApp(ov28_02254854, ov28_022549F4); } diff --git a/arm9/overlays/29/src/overlay_29_sinit.c b/arm9/overlays/29/src/overlay_29_sinit.c index e8ea3d007..dddaffc73 100644 --- a/arm9/overlays/29/src/overlay_29_sinit.c +++ b/arm9/overlays/29/src/overlay_29_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov29_02254854(); extern void ov29_02254914(); -static void ov29_02254840(void) -{ +static void ov29_02254840(void) { Poketch_InitApp(ov29_02254854, ov29_02254914); } diff --git a/arm9/overlays/30/src/overlay_30_sinit.c b/arm9/overlays/30/src/overlay_30_sinit.c index 16fc8fb3f..a956198ef 100644 --- a/arm9/overlays/30/src/overlay_30_sinit.c +++ b/arm9/overlays/30/src/overlay_30_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov30_02254854(); extern void ov30_0225496C(); -static void ov30_02254840(void) -{ +static void ov30_02254840(void) { Poketch_InitApp(ov30_02254854, ov30_0225496C); } diff --git a/arm9/overlays/31/src/overlay_31_sinit.c b/arm9/overlays/31/src/overlay_31_sinit.c index 35bc0059a..445305b39 100644 --- a/arm9/overlays/31/src/overlay_31_sinit.c +++ b/arm9/overlays/31/src/overlay_31_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov31_02254854(); extern void ov31_02254954(); -static void ov31_02254840(void) -{ +static void ov31_02254840(void) { Poketch_InitApp(ov31_02254854, ov31_02254954); } diff --git a/arm9/overlays/32/src/overlay_32_sinit.c b/arm9/overlays/32/src/overlay_32_sinit.c index 488f6511b..7083f2610 100644 --- a/arm9/overlays/32/src/overlay_32_sinit.c +++ b/arm9/overlays/32/src/overlay_32_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov32_02254854(); extern void ov32_0225495C(); -static void ov32_02254840(void) -{ +static void ov32_02254840(void) { Poketch_InitApp(ov32_02254854, ov32_0225495C); } diff --git a/arm9/overlays/33/src/overlay_33_sinit.c b/arm9/overlays/33/src/overlay_33_sinit.c index 0c292c522..605812ef9 100644 --- a/arm9/overlays/33/src/overlay_33_sinit.c +++ b/arm9/overlays/33/src/overlay_33_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov33_02254854(); extern void ov33_02254908(); -static void ov33_02254840(void) -{ +static void ov33_02254840(void) { Poketch_InitApp(ov33_02254854, ov33_02254908); } diff --git a/arm9/overlays/34/src/overlay_34_sinit.c b/arm9/overlays/34/src/overlay_34_sinit.c index 7cea12827..8c8d741a0 100644 --- a/arm9/overlays/34/src/overlay_34_sinit.c +++ b/arm9/overlays/34/src/overlay_34_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov34_02254854(); extern void ov34_02254948(); -static void ov34_02254840(void) -{ +static void ov34_02254840(void) { Poketch_InitApp(ov34_02254854, ov34_02254948); } diff --git a/arm9/overlays/35/src/overlay_35_sinit.c b/arm9/overlays/35/src/overlay_35_sinit.c index 9f0e89429..e7c69c815 100644 --- a/arm9/overlays/35/src/overlay_35_sinit.c +++ b/arm9/overlays/35/src/overlay_35_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov35_02254854(); extern void ov35_02254924(); -static void ov35_02254840(void) -{ +static void ov35_02254840(void) { Poketch_InitApp(ov35_02254854, ov35_02254924); } diff --git a/arm9/overlays/36/src/overlay_36_sinit.c b/arm9/overlays/36/src/overlay_36_sinit.c index 5960116f0..ec5b9140f 100644 --- a/arm9/overlays/36/src/overlay_36_sinit.c +++ b/arm9/overlays/36/src/overlay_36_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov36_02254854(); extern void ov36_02254990(); -static void ov36_02254840(void) -{ +static void ov36_02254840(void) { Poketch_InitApp(ov36_02254854, ov36_02254990); } diff --git a/arm9/overlays/37/src/overlay_37_sinit.c b/arm9/overlays/37/src/overlay_37_sinit.c index cb838508c..2c2e6bf19 100644 --- a/arm9/overlays/37/src/overlay_37_sinit.c +++ b/arm9/overlays/37/src/overlay_37_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov37_02254854(); extern void ov37_02254934(); -static void ov37_02254840(void) -{ +static void ov37_02254840(void) { Poketch_InitApp(ov37_02254854, ov37_02254934); } diff --git a/arm9/overlays/38/src/overlay_38_sinit.c b/arm9/overlays/38/src/overlay_38_sinit.c index d2ecbf630..e86f9b101 100644 --- a/arm9/overlays/38/src/overlay_38_sinit.c +++ b/arm9/overlays/38/src/overlay_38_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov38_02254854(); extern void ov38_02254990(); -static void ov38_02254840(void) -{ +static void ov38_02254840(void) { Poketch_InitApp(ov38_02254854, ov38_02254990); } diff --git a/arm9/overlays/39/src/overlay_39_sinit.c b/arm9/overlays/39/src/overlay_39_sinit.c index 35debc34e..fb5bf41b9 100644 --- a/arm9/overlays/39/src/overlay_39_sinit.c +++ b/arm9/overlays/39/src/overlay_39_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov39_02254854(); extern void ov39_022549D4(); -static void ov39_02254840(void) -{ +static void ov39_02254840(void) { Poketch_InitApp(ov39_02254854, ov39_022549D4); } diff --git a/arm9/overlays/40/src/overlay_40_sinit.c b/arm9/overlays/40/src/overlay_40_sinit.c index bec3c6906..f38b10266 100644 --- a/arm9/overlays/40/src/overlay_40_sinit.c +++ b/arm9/overlays/40/src/overlay_40_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov40_02254854(); extern void ov40_022549D4(); -static void ov40_02254840(void) -{ +static void ov40_02254840(void) { Poketch_InitApp(ov40_02254854, ov40_022549D4); } diff --git a/arm9/overlays/41/src/overlay_41_sinit.c b/arm9/overlays/41/src/overlay_41_sinit.c index ee2c44af8..adb881399 100644 --- a/arm9/overlays/41/src/overlay_41_sinit.c +++ b/arm9/overlays/41/src/overlay_41_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov41_02254854(); extern void ov41_02254AD8(); -static void ov41_02254840(void) -{ +static void ov41_02254840(void) { Poketch_InitApp(ov41_02254854, ov41_02254AD8); } diff --git a/arm9/overlays/42/src/overlay_42_sinit.c b/arm9/overlays/42/src/overlay_42_sinit.c index 0fc5731e3..f37fe48d2 100644 --- a/arm9/overlays/42/src/overlay_42_sinit.c +++ b/arm9/overlays/42/src/overlay_42_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov42_02254854(); extern void ov42_02254A38(); -static void ov42_02254840(void) -{ +static void ov42_02254840(void) { Poketch_InitApp(ov42_02254854, ov42_02254A38); } diff --git a/arm9/overlays/43/src/overlay_43_sinit.c b/arm9/overlays/43/src/overlay_43_sinit.c index e9521558f..ff98f793a 100644 --- a/arm9/overlays/43/src/overlay_43_sinit.c +++ b/arm9/overlays/43/src/overlay_43_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov43_02254854(); extern void ov43_02254970(); -static void ov43_02254840(void) -{ +static void ov43_02254840(void) { Poketch_InitApp(ov43_02254854, ov43_02254970); } diff --git a/arm9/overlays/44/src/overlay_44_sinit.c b/arm9/overlays/44/src/overlay_44_sinit.c index 02e78f7d3..ea975b14e 100644 --- a/arm9/overlays/44/src/overlay_44_sinit.c +++ b/arm9/overlays/44/src/overlay_44_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov44_02254854(); extern void ov44_02254920(); -static void ov44_02254840(void) -{ +static void ov44_02254840(void) { Poketch_InitApp(ov44_02254854, ov44_02254920); } diff --git a/arm9/overlays/45/src/overlay_45_sinit.c b/arm9/overlays/45/src/overlay_45_sinit.c index 56bfe68de..5698e3a81 100644 --- a/arm9/overlays/45/src/overlay_45_sinit.c +++ b/arm9/overlays/45/src/overlay_45_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov45_02254854(); extern void ov45_02254A30(); -static void ov45_02254840(void) -{ +static void ov45_02254840(void) { Poketch_InitApp(ov45_02254854, ov45_02254A30); } diff --git a/arm9/overlays/46/src/overlay_46_sinit.c b/arm9/overlays/46/src/overlay_46_sinit.c index 6c374046d..c76f8ddbb 100644 --- a/arm9/overlays/46/src/overlay_46_sinit.c +++ b/arm9/overlays/46/src/overlay_46_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov46_02254854(); extern void ov46_02254908(); -static void ov46_02254840(void) -{ +static void ov46_02254840(void) { Poketch_InitApp(ov46_02254854, ov46_02254908); } diff --git a/arm9/overlays/47/src/overlay_47_sinit.c b/arm9/overlays/47/src/overlay_47_sinit.c index a583eb965..d849a8c8b 100644 --- a/arm9/overlays/47/src/overlay_47_sinit.c +++ b/arm9/overlays/47/src/overlay_47_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov47_02254854(); extern void ov47_0225491C(); -static void ov47_02254840(void) -{ +static void ov47_02254840(void) { Poketch_InitApp(ov47_02254854, ov47_0225491C); } diff --git a/arm9/overlays/48/src/overlay_48_sinit.c b/arm9/overlays/48/src/overlay_48_sinit.c index 3d9f193a1..474c6dc92 100644 --- a/arm9/overlays/48/src/overlay_48_sinit.c +++ b/arm9/overlays/48/src/overlay_48_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov48_02254854(); extern void ov48_0225498C(); -static void ov48_02254840(void) -{ +static void ov48_02254840(void) { Poketch_InitApp(ov48_02254854, ov48_0225498C); } diff --git a/arm9/overlays/49/src/overlay_49_sinit.c b/arm9/overlays/49/src/overlay_49_sinit.c index 7e202d1e8..438767c97 100644 --- a/arm9/overlays/49/src/overlay_49_sinit.c +++ b/arm9/overlays/49/src/overlay_49_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov49_02254854(); extern void ov49_02254974(); -static void ov49_02254840(void) -{ +static void ov49_02254840(void) { Poketch_InitApp(ov49_02254854, ov49_02254974); } diff --git a/arm9/overlays/50/src/overlay_50_sinit.c b/arm9/overlays/50/src/overlay_50_sinit.c index e8cf66e8e..546628ace 100644 --- a/arm9/overlays/50/src/overlay_50_sinit.c +++ b/arm9/overlays/50/src/overlay_50_sinit.c @@ -4,8 +4,7 @@ extern void Poketch_InitApp(void *func1, void *func2); extern void ov50_02254854(); extern void ov50_02254908(); -static void ov50_02254840(void) -{ +static void ov50_02254840(void) { Poketch_InitApp(ov50_02254854, ov50_02254908); } diff --git a/arm9/overlays/52/include/overlay_52.h b/arm9/overlays/52/include/overlay_52.h index af54f32c8..aeccf6d63 100644 --- a/arm9/overlays/52/include/overlay_52.h +++ b/arm9/overlays/52/include/overlay_52.h @@ -2,15 +2,16 @@ #define POKEDIAMOND_OVERLAY_52_H #include "global.h" -#include "save_vars_flags.h" + #include "main.h" #include "math_util.h" #include "options.h" #include "overlay_manager.h" #include "player_data.h" #include "poke_overlay.h" -#include "save_system_info.h" #include "save.h" +#include "save_system_info.h" +#include "save_vars_flags.h" #include "unk_02024E64.h" #include "unk_020286F8.h" @@ -34,4 +35,4 @@ void ov52_021D7604(HeapID heapId, struct SaveData *save, BOOL set_trainerid); void ov52_021D7688(u32 param0, struct SaveData *save); void ov52_021D769C(u32 param0, struct SaveData *save); -#endif // POKEDIAMOND_OVERLAY_52_H \ No newline at end of file +#endif // POKEDIAMOND_OVERLAY_52_H diff --git a/arm9/overlays/52/src/overlay_52.c b/arm9/overlays/52/src/overlay_52.c index 399c2f9cf..a0aa4f840 100644 --- a/arm9/overlays/52/src/overlay_52.c +++ b/arm9/overlays/52/src/overlay_52.c @@ -1,9 +1,10 @@ -#include "global.h" #include "overlay_52.h" + +#include "global.h" + #include "heap.h" -#include "unk_0205FA2C.h" #include "play_timer.h" - +#include "unk_0205FA2C.h" extern struct OverlayManagerTemplate UNK_020FD144; extern struct OverlayManagerTemplate UNK_020F2B7C; @@ -36,128 +37,245 @@ const struct OverlayManagerTemplate ov52_021D76C8 = { }; const u16 ov52_021D76F8[] = { - ITEM_ORAN_BERRY, 1, - ITEM_CHERI_BERRY, 1, - ITEM_CHESTO_BERRY, 1, - ITEM_PECHA_BERRY, 1, - ITEM_ORAN_BERRY, 1, - ITEM_PECHA_BERRY, 1, - ITEM_RAZZ_BERRY, 2, - ITEM_BLUK_BERRY, 2, - ITEM_CHERI_BERRY, 1, - ITEM_ORAN_BERRY, 2, - ITEM_SITRUS_BERRY, 1, - ITEM_WEPEAR_BERRY, 2, - ITEM_WEPEAR_BERRY, 2, - ITEM_KELPSY_BERRY, 1, - ITEM_CHERI_BERRY, 1, - ITEM_PECHA_BERRY, 1, - ITEM_ORAN_BERRY, 1, - ITEM_ORAN_BERRY, 1, - ITEM_RAWST_BERRY, 1, - ITEM_RAWST_BERRY, 1, - ITEM_RAZZ_BERRY, 1, - ITEM_RAZZ_BERRY, 1, - ITEM_CHERI_BERRY, 1, - ITEM_ORAN_BERRY, 1, - ITEM_ORAN_BERRY, 1, - ITEM_BLUK_BERRY, 1, - ITEM_NANAB_BERRY, 2, - ITEM_RAZZ_BERRY, 2, - ITEM_BLUK_BERRY, 2, - ITEM_PINAP_BERRY, 2, - ITEM_LEPPA_BERRY, 1, - ITEM_CHESTO_BERRY, 1, - ITEM_RAZZ_BERRY, 1, - ITEM_RAZZ_BERRY, 1, - ITEM_PERSIM_BERRY, 1, - ITEM_NANAB_BERRY, 1, - ITEM_NANAB_BERRY, 1, - ITEM_FIGY_BERRY, 1, - ITEM_ASPEAR_BERRY, 1, - ITEM_ASPEAR_BERRY, 1, - ITEM_RAZZ_BERRY, 1, - ITEM_PINAP_BERRY, 1, - ITEM_SITRUS_BERRY, 1, - ITEM_CHESTO_BERRY, 1, - ITEM_WIKI_BERRY, 1, - ITEM_AGUAV_BERRY, 1, - ITEM_PECHA_BERRY, 1, - ITEM_ASPEAR_BERRY, 1, - ITEM_IAPAPA_BERRY, 1, - ITEM_GREPA_BERRY, 1, - ITEM_SITRUS_BERRY, 1, - ITEM_ASPEAR_BERRY, 1, - ITEM_TAMATO_BERRY, 1, - ITEM_LUM_BERRY, 1, - ITEM_PECHA_BERRY, 1, - ITEM_PINAP_BERRY, 1, - ITEM_PINAP_BERRY, 1, - ITEM_PINAP_BERRY, 1, - ITEM_PERSIM_BERRY, 1, - ITEM_PERSIM_BERRY, 1, - ITEM_NANAB_BERRY, 1, - ITEM_NANAB_BERRY, 1, - ITEM_AGUAV_BERRY, 1, - ITEM_IAPAPA_BERRY, 1, - ITEM_RAWST_BERRY, 1, - ITEM_RAWST_BERRY, 1, - ITEM_CHERI_BERRY, 1, - ITEM_SITRUS_BERRY, 1, - ITEM_CHESTO_BERRY, 1, - ITEM_POMEG_BERRY, 1, - ITEM_PECHA_BERRY, 2, - ITEM_BLUK_BERRY, 2, - ITEM_WIKI_BERRY, 1, - ITEM_MAGO_BERRY, 1, - ITEM_RAWST_BERRY, 1, - ITEM_PERSIM_BERRY, 1, - ITEM_FIGY_BERRY, 1, - ITEM_PINAP_BERRY, 2, - ITEM_LEPPA_BERRY, 1, - ITEM_PECHA_BERRY, 1, - ITEM_MAGO_BERRY, 1, - ITEM_HONDEW_BERRY, 1, - ITEM_WIKI_BERRY, 2, - ITEM_MAGO_BERRY, 2, - ITEM_AGUAV_BERRY, 2, - ITEM_QUALOT_BERRY, 1, - ITEM_SITRUS_BERRY, 2, - ITEM_BLUK_BERRY, 3, - ITEM_NANAB_BERRY, 3, - ITEM_WEPEAR_BERRY, 3, - ITEM_POMEG_BERRY, 1, - ITEM_POMEG_BERRY, 1, - ITEM_HONDEW_BERRY, 2, - ITEM_HONDEW_BERRY, 2, - ITEM_KELPSY_BERRY, 1, - ITEM_KELPSY_BERRY, 1, - ITEM_TAMATO_BERRY, 1, - ITEM_TAMATO_BERRY, 1, - ITEM_QUALOT_BERRY, 1, - ITEM_QUALOT_BERRY, 1, - ITEM_POMEG_BERRY, 1, - ITEM_POMEG_BERRY, 1, - ITEM_HONDEW_BERRY, 1, - ITEM_HONDEW_BERRY, 1, - ITEM_TAMATO_BERRY, 1, - ITEM_TAMATO_BERRY, 1, - ITEM_GREPA_BERRY, 1, - ITEM_GREPA_BERRY, 1, - ITEM_QUALOT_BERRY, 1, - ITEM_QUALOT_BERRY, 1, - ITEM_LUM_BERRY, 1, - ITEM_LEPPA_BERRY, 1, - ITEM_QUALOT_BERRY, 2, - ITEM_GREPA_BERRY, 2, - ITEM_KELPSY_BERRY, 2, - ITEM_KELPSY_BERRY, 2, - ITEM_GREPA_BERRY, 1, - ITEM_GREPA_BERRY, 1, + ITEM_ORAN_BERRY, + 1, + ITEM_CHERI_BERRY, + 1, + ITEM_CHESTO_BERRY, + 1, + ITEM_PECHA_BERRY, + 1, + ITEM_ORAN_BERRY, + 1, + ITEM_PECHA_BERRY, + 1, + ITEM_RAZZ_BERRY, + 2, + ITEM_BLUK_BERRY, + 2, + ITEM_CHERI_BERRY, + 1, + ITEM_ORAN_BERRY, + 2, + ITEM_SITRUS_BERRY, + 1, + ITEM_WEPEAR_BERRY, + 2, + ITEM_WEPEAR_BERRY, + 2, + ITEM_KELPSY_BERRY, + 1, + ITEM_CHERI_BERRY, + 1, + ITEM_PECHA_BERRY, + 1, + ITEM_ORAN_BERRY, + 1, + ITEM_ORAN_BERRY, + 1, + ITEM_RAWST_BERRY, + 1, + ITEM_RAWST_BERRY, + 1, + ITEM_RAZZ_BERRY, + 1, + ITEM_RAZZ_BERRY, + 1, + ITEM_CHERI_BERRY, + 1, + ITEM_ORAN_BERRY, + 1, + ITEM_ORAN_BERRY, + 1, + ITEM_BLUK_BERRY, + 1, + ITEM_NANAB_BERRY, + 2, + ITEM_RAZZ_BERRY, + 2, + ITEM_BLUK_BERRY, + 2, + ITEM_PINAP_BERRY, + 2, + ITEM_LEPPA_BERRY, + 1, + ITEM_CHESTO_BERRY, + 1, + ITEM_RAZZ_BERRY, + 1, + ITEM_RAZZ_BERRY, + 1, + ITEM_PERSIM_BERRY, + 1, + ITEM_NANAB_BERRY, + 1, + ITEM_NANAB_BERRY, + 1, + ITEM_FIGY_BERRY, + 1, + ITEM_ASPEAR_BERRY, + 1, + ITEM_ASPEAR_BERRY, + 1, + ITEM_RAZZ_BERRY, + 1, + ITEM_PINAP_BERRY, + 1, + ITEM_SITRUS_BERRY, + 1, + ITEM_CHESTO_BERRY, + 1, + ITEM_WIKI_BERRY, + 1, + ITEM_AGUAV_BERRY, + 1, + ITEM_PECHA_BERRY, + 1, + ITEM_ASPEAR_BERRY, + 1, + ITEM_IAPAPA_BERRY, + 1, + ITEM_GREPA_BERRY, + 1, + ITEM_SITRUS_BERRY, + 1, + ITEM_ASPEAR_BERRY, + 1, + ITEM_TAMATO_BERRY, + 1, + ITEM_LUM_BERRY, + 1, + ITEM_PECHA_BERRY, + 1, + ITEM_PINAP_BERRY, + 1, + ITEM_PINAP_BERRY, + 1, + ITEM_PINAP_BERRY, + 1, + ITEM_PERSIM_BERRY, + 1, + ITEM_PERSIM_BERRY, + 1, + ITEM_NANAB_BERRY, + 1, + ITEM_NANAB_BERRY, + 1, + ITEM_AGUAV_BERRY, + 1, + ITEM_IAPAPA_BERRY, + 1, + ITEM_RAWST_BERRY, + 1, + ITEM_RAWST_BERRY, + 1, + ITEM_CHERI_BERRY, + 1, + ITEM_SITRUS_BERRY, + 1, + ITEM_CHESTO_BERRY, + 1, + ITEM_POMEG_BERRY, + 1, + ITEM_PECHA_BERRY, + 2, + ITEM_BLUK_BERRY, + 2, + ITEM_WIKI_BERRY, + 1, + ITEM_MAGO_BERRY, + 1, + ITEM_RAWST_BERRY, + 1, + ITEM_PERSIM_BERRY, + 1, + ITEM_FIGY_BERRY, + 1, + ITEM_PINAP_BERRY, + 2, + ITEM_LEPPA_BERRY, + 1, + ITEM_PECHA_BERRY, + 1, + ITEM_MAGO_BERRY, + 1, + ITEM_HONDEW_BERRY, + 1, + ITEM_WIKI_BERRY, + 2, + ITEM_MAGO_BERRY, + 2, + ITEM_AGUAV_BERRY, + 2, + ITEM_QUALOT_BERRY, + 1, + ITEM_SITRUS_BERRY, + 2, + ITEM_BLUK_BERRY, + 3, + ITEM_NANAB_BERRY, + 3, + ITEM_WEPEAR_BERRY, + 3, + ITEM_POMEG_BERRY, + 1, + ITEM_POMEG_BERRY, + 1, + ITEM_HONDEW_BERRY, + 2, + ITEM_HONDEW_BERRY, + 2, + ITEM_KELPSY_BERRY, + 1, + ITEM_KELPSY_BERRY, + 1, + ITEM_TAMATO_BERRY, + 1, + ITEM_TAMATO_BERRY, + 1, + ITEM_QUALOT_BERRY, + 1, + ITEM_QUALOT_BERRY, + 1, + ITEM_POMEG_BERRY, + 1, + ITEM_POMEG_BERRY, + 1, + ITEM_HONDEW_BERRY, + 1, + ITEM_HONDEW_BERRY, + 1, + ITEM_TAMATO_BERRY, + 1, + ITEM_TAMATO_BERRY, + 1, + ITEM_GREPA_BERRY, + 1, + ITEM_GREPA_BERRY, + 1, + ITEM_QUALOT_BERRY, + 1, + ITEM_QUALOT_BERRY, + 1, + ITEM_LUM_BERRY, + 1, + ITEM_LEPPA_BERRY, + 1, + ITEM_QUALOT_BERRY, + 2, + ITEM_GREPA_BERRY, + 2, + ITEM_KELPSY_BERRY, + 2, + ITEM_KELPSY_BERRY, + 2, + ITEM_GREPA_BERRY, + 1, + ITEM_GREPA_BERRY, + 1, }; -BOOL ov52_021D74E0(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D74E0(struct OverlayManager *manager, u32 *status) { #pragma unused(manager) #pragma unused(status) CreateHeap(3, 0x4d, 0x20000); @@ -166,8 +284,7 @@ BOOL ov52_021D74E0(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D74F8(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D74F8(struct OverlayManager *manager, u32 *status) { #pragma unused(status) struct SaveData *save = (struct SaveData *)OverlayManager_GetField18(manager)[2]; // weird @@ -176,8 +293,7 @@ BOOL ov52_021D74F8(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D750C(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D750C(struct OverlayManager *manager, u32 *status) { #pragma unused(manager) #pragma unused(status) DestroyHeap(HEAP_ID_77); @@ -186,8 +302,7 @@ BOOL ov52_021D750C(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D7528(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D7528(struct OverlayManager *manager, u32 *status) { #pragma unused(manager) #pragma unused(status) CreateHeap(3, 0x4d, 0x20000); @@ -196,8 +311,7 @@ BOOL ov52_021D7528(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D7540(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D7540(struct OverlayManager *manager, u32 *status) { #pragma unused(status) struct SaveData *save = (struct SaveData *)OverlayManager_GetField18(manager)[2]; // weird @@ -208,8 +322,7 @@ BOOL ov52_021D7540(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D7560(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D7560(struct OverlayManager *manager, u32 *status) { #pragma unused(manager) #pragma unused(status) DestroyHeap(HEAP_ID_77); @@ -218,8 +331,7 @@ BOOL ov52_021D7560(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D757C(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D757C(struct OverlayManager *manager, u32 *status) { #pragma unused(manager) #pragma unused(status) CreateHeap(3, 0x4d, 0x20000); @@ -228,8 +340,7 @@ BOOL ov52_021D757C(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D7594(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D7594(struct OverlayManager *manager, u32 *status) { #pragma unused(status) struct SaveData *save = (struct SaveData *)OverlayManager_GetField18(manager)[2]; // weird @@ -238,8 +349,7 @@ BOOL ov52_021D7594(struct OverlayManager *manager, u32 *status) ov52_021D7688(0x4d, save); Options_SetButtonModeOnMain(save, 0); - if (!Save_SysInfo_MacAddressIsMine(save_info) || !Save_SysInfo_RTCOffsetIsMine(save_info)) - { + if (!Save_SysInfo_MacAddressIsMine(save_info) || !Save_SysInfo_RTCOffsetIsMine(save_info)) { sub_020238A4(Save_SysInfo_RTC_Get(save)); Save_SysInfo_InitFromSystem(save_info); } @@ -249,8 +359,7 @@ BOOL ov52_021D7594(struct OverlayManager *manager, u32 *status) return TRUE; } -BOOL ov52_021D75E8(struct OverlayManager *manager, u32 *status) -{ +BOOL ov52_021D75E8(struct OverlayManager *manager, u32 *status) { #pragma unused(manager) #pragma unused(status) DestroyHeap(HEAP_ID_77); @@ -259,8 +368,7 @@ BOOL ov52_021D75E8(struct OverlayManager *manager, u32 *status) return 1; } -void ov52_021D7604(HeapID heapId, struct SaveData *save, BOOL set_trainerid) -{ +void ov52_021D7604(HeapID heapId, struct SaveData *save, BOOL set_trainerid) { Save_SysInfo_InitFromSystem(Save_SysInfo_Get(save)); Save_SysInfo_RTC_Init(Save_SysInfo_RTC_Get(save)); @@ -270,10 +378,9 @@ void ov52_021D7604(HeapID heapId, struct SaveData *save, BOOL set_trainerid) sub_0206007C(save); PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(save); - u32 trainerid = MTRandom(); + u32 trainerid = MTRandom(); - if (set_trainerid) - { + if (set_trainerid) { PlayerProfile_SetTrainerID(playerProfile, trainerid); } @@ -285,20 +392,17 @@ void ov52_021D7604(HeapID heapId, struct SaveData *save, BOOL set_trainerid) sub_020250C4(sub_02024ECC(save), heapId, ov52_021D76F8, NELEMS(ov52_021D76F8) / 2); } -void ov52_021D7688(u32 unused, struct SaveData *save) -{ +void ov52_021D7688(u32 unused, struct SaveData *save) { #pragma unused(unused) - if (sub_020226FC(save)) - { + if (sub_020226FC(save)) { return; } OS_ResetSystem(0); } -void ov52_021D769C(u32 unused, struct SaveData *save) -{ +void ov52_021D769C(u32 unused, struct SaveData *save) { #pragma unused(unused) Save_InitDynamicRegion(save); diff --git a/arm9/overlays/59/include/ov59_Intro.h b/arm9/overlays/59/include/ov59_Intro.h index f8541d96c..bea0e5ad4 100644 --- a/arm9/overlays/59/include/ov59_Intro.h +++ b/arm9/overlays/59/include/ov59_Intro.h @@ -2,24 +2,23 @@ #define POKEDIAMOND_ov59_INTRO_H #include "nitro/types.h" + #include "heap.h" -#include "options.h" -#include "save.h" +#include "list_menu.h" +#include "list_menu_items.h" #include "main.h" +#include "options.h" #include "player_data.h" -#include "list_menu_items.h" -#include "list_menu.h" +#include "save.h" -struct ov59_UnkPlayerStruct -{ +struct ov59_UnkPlayerStruct { u8 padding[0x4]; PlayerGender gender; u8 padding2[0x10]; struct String *name; }; -typedef struct ov59_IntroOverlayData -{ +typedef struct ov59_IntroOverlayData { HeapID heapId; struct SaveData *save; struct Options *options; @@ -65,40 +64,33 @@ typedef struct ov59_IntroOverlayData u32 unkB0; } ov59_IntroOverlayData; -struct ov59_ListStruct021D9E0C -{ +struct ov59_ListStruct021D9E0C { u32 msgNo; s32 val; }; -struct ov59_WindowTemplateGroup -{ +struct ov59_WindowTemplateGroup { struct WindowTemplate template1; struct WindowTemplate template2; }; -struct ov59_GraphicsPaletteMapSubstruct021D9F90 -{ +struct ov59_GraphicsPaletteMapSubstruct021D9F90 { u32 charNum; u32 palNum; }; -struct ov59_GraphicsPaletteMap021D9F90 -{ +struct ov59_GraphicsPaletteMap021D9F90 { struct ov59_GraphicsPaletteMapSubstruct021D9F90 map[11]; }; -struct ov59_UnkStruct021D9E30 -{ +struct ov59_UnkStruct021D9E30 { u32 scrnIds[5]; }; -struct ov59_CharStruct021D9DEC -{ +struct ov59_CharStruct021D9DEC { u32 narcId[4]; }; -struct ov59_CharStruct021D9E70 -{ +struct ov59_CharStruct021D9E70 { u32 charData[6]; }; diff --git a/arm9/overlays/59/include/ov59_TV.h b/arm9/overlays/59/include/ov59_TV.h index e71b36bc6..1125c3e1f 100644 --- a/arm9/overlays/59/include/ov59_TV.h +++ b/arm9/overlays/59/include/ov59_TV.h @@ -2,12 +2,12 @@ #define POKEDIAMOND_ov59_TV_H #include "nitro/types.h" -#include "main.h" + #include "bg_window.h" +#include "main.h" #include "msgdata.h" -typedef struct ov59_TVOverlayData2 -{ +typedef struct ov59_TVOverlayData2 { HeapID heapId; struct BgConfig *bgConfig; struct MsgData *msgData; diff --git a/arm9/overlays/59/src/ov59_Intro.c b/arm9/overlays/59/src/ov59_Intro.c index 1cc8565b2..826dcdc52 100644 --- a/arm9/overlays/59/src/ov59_Intro.c +++ b/arm9/overlays/59/src/ov59_Intro.c @@ -1,22 +1,26 @@ -#include "global.h" #include "ov59_Intro.h" -#include "gf_gfx_planes.h" -#include "PAD_pad.h" -#include "bg_window.h" -#include "brightness.h" + +#include "global.h" + #include "constants/rgb.h" #include "constants/sndseq.h" + #include "demo/intro/intro.naix" +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0341.h" + +#include "PAD_pad.h" +#include "bg_window.h" +#include "brightness.h" #include "game_init.h" #include "gf_gfx_loader.h" +#include "gf_gfx_planes.h" #include "heap.h" #include "list_menu_items.h" #include "message_format.h" +#include "msgdata.h" #include "ov59_TV.h" #include "overlay_52.h" -#include "msgdata.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0341.h" #include "overlay_manager.h" #include "player_data.h" #include "pokemon.h" @@ -31,338 +35,258 @@ extern void *sub_02077A84(HeapID heapId, u32 param1, u32 param2, u32 param3, str extern void sub_0200E3A0(PMLCDTarget, int); -const struct WindowTemplate ov59_021D9DB8 = - { - .bgId = GF_BG_LYR_MAIN_0, - .left = 2, - .top = 19, - .width = 27, - .height = 4, - .palette = 6, - .baseTile = 877, - }; - -const struct WindowTemplate ov59_021D9DA8 = - { - .bgId = GF_BG_LYR_MAIN_0, - .left = 2, - .top = 3, - .width = 6, - .height = 4, - .palette = 5, - .baseTile = 853, - }; - -const struct WindowTemplate ov59_021D9DB0 = - { - .bgId = GF_BG_LYR_MAIN_0, - .left = 1, - .top = 3, - .width = 16, - .height = 6, - .palette = 5, - .baseTile = 781, - }; - -const struct WindowTemplate ov59_021D9D90 = - { - .bgId = GF_BG_LYR_MAIN_0, - .left = 8, - .top = 0, - .width = 24, - .height = 24, - .palette = 5, - .baseTile = 301, - }; - -const struct WindowTemplate ov59_021D9D98 = - { - .bgId = GF_BG_LYR_MAIN_0, - .left = 4, - .top = 0, - .width = 24, - .height = 24, - .palette = 5, - .baseTile = 301, - }; - -const struct WindowTemplate ov59_021D9DA0 = - { - .bgId = GF_BG_LYR_MAIN_0, - .left = 2, - .top = 3, - .width = 14, - .height = 10, - .palette = 5, - .baseTile = 737, - }; +const struct WindowTemplate ov59_021D9DB8 = { + .bgId = GF_BG_LYR_MAIN_0, + .left = 2, + .top = 19, + .width = 27, + .height = 4, + .palette = 6, + .baseTile = 877, +}; + +const struct WindowTemplate ov59_021D9DA8 = { + .bgId = GF_BG_LYR_MAIN_0, + .left = 2, + .top = 3, + .width = 6, + .height = 4, + .palette = 5, + .baseTile = 853, +}; + +const struct WindowTemplate ov59_021D9DB0 = { + .bgId = GF_BG_LYR_MAIN_0, + .left = 1, + .top = 3, + .width = 16, + .height = 6, + .palette = 5, + .baseTile = 781, +}; + +const struct WindowTemplate ov59_021D9D90 = { + .bgId = GF_BG_LYR_MAIN_0, + .left = 8, + .top = 0, + .width = 24, + .height = 24, + .palette = 5, + .baseTile = 301, +}; + +const struct WindowTemplate ov59_021D9D98 = { + .bgId = GF_BG_LYR_MAIN_0, + .left = 4, + .top = 0, + .width = 24, + .height = 24, + .palette = 5, + .baseTile = 301, +}; + +const struct WindowTemplate ov59_021D9DA0 = { + .bgId = GF_BG_LYR_MAIN_0, + .left = 2, + .top = 3, + .width = 14, + .height = 10, + .palette = 5, + .baseTile = 737, +}; const u32 ov59_021D9DC0[3] = { NARC_intro_pokeball_button_2_NCGR, NARC_intro_pokeball_button_3_NCGR, 0xFFFF }; -const struct GraphicsModes ov59_021D9DCC = - { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, - ._2d3dMode = GX_BG0_AS_2D - }; - -const struct OverlayManagerTemplate ov59_021D9DDC = - { - .initFunc = ov59_TVInit, - .mainFunc = ov59_TVMain, - .exitFunc = ov59_TVExit, - .ovly = SDK_OVERLAY_INVALID_ID - }; - -const struct ov59_CharStruct021D9DEC ov59_021D9DEC = - { - .narcId = { NARC_intro_lucas_walk_1_NCGR, NARC_intro_lucas_walk_2_NCGR, NARC_intro_lucas_walk_3_NCGR, NARC_intro_lucas_walk_4_NCGR } - }; - -const struct ov59_CharStruct021D9DEC ov59_021D9DFC = - { - .narcId = { NARC_intro_dawn_walk_1_NCGR, NARC_intro_dawn_walk_2_NCGR, NARC_intro_dawn_walk_3_NCGR, NARC_intro_dawn_walk_4_NCGR } - }; - -const struct ov59_ListStruct021D9E0C ov59_021D9E0C[2] = - { - { - .msgNo = narc_0341_00034, //YES - .val = 1 - }, - { - .msgNo = narc_0341_00035, //NO - .val = 2 - } - }; - -const struct ov59_UnkStruct021D9E30 ov59_021D9E1C = - { - .scrnIds = { NARC_intro_main_background_NSCR, NARC_intro_control_info_padab_NSCR, NARC_intro_control_info_xy_NSCR, NARC_intro_control_info_touchscreen_NSCR, NARC_intro_adventure_info_NSCR } - }; - -const struct ov59_UnkStruct021D9E30 ov59_021D9E30 = - { - .scrnIds = { NARC_intro_sub_background_1_NSCR, NARC_intro_sub_background_2_NSCR, NARC_intro_sub_background_2_NSCR, NARC_intro_sub_background_3_NSCR, NARC_intro_sub_background_4_NSCR } - }; +const struct GraphicsModes ov59_021D9DCC = { + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, + ._2d3dMode = GX_BG0_AS_2D +}; + +const struct OverlayManagerTemplate ov59_021D9DDC = { + .initFunc = ov59_TVInit, + .mainFunc = ov59_TVMain, + .exitFunc = ov59_TVExit, + .ovly = SDK_OVERLAY_INVALID_ID +}; + +const struct ov59_CharStruct021D9DEC ov59_021D9DEC = { + .narcId = { NARC_intro_lucas_walk_1_NCGR, NARC_intro_lucas_walk_2_NCGR, NARC_intro_lucas_walk_3_NCGR, NARC_intro_lucas_walk_4_NCGR } +}; + +const struct ov59_CharStruct021D9DEC ov59_021D9DFC = { + .narcId = { NARC_intro_dawn_walk_1_NCGR, NARC_intro_dawn_walk_2_NCGR, NARC_intro_dawn_walk_3_NCGR, NARC_intro_dawn_walk_4_NCGR } +}; + +const struct ov59_ListStruct021D9E0C ov59_021D9E0C[2] = { + { .msgNo = narc_0341_00034, // YES + .val = 1 }, + { .msgNo = narc_0341_00035, // NO + .val = 2 } +}; + +const struct ov59_UnkStruct021D9E30 ov59_021D9E1C = { + .scrnIds = { NARC_intro_main_background_NSCR, NARC_intro_control_info_padab_NSCR, NARC_intro_control_info_xy_NSCR, NARC_intro_control_info_touchscreen_NSCR, NARC_intro_adventure_info_NSCR } +}; + +const struct ov59_UnkStruct021D9E30 ov59_021D9E30 = { + .scrnIds = { NARC_intro_sub_background_1_NSCR, NARC_intro_sub_background_2_NSCR, NARC_intro_sub_background_2_NSCR, NARC_intro_sub_background_3_NSCR, NARC_intro_sub_background_4_NSCR } +}; const u32 ov59_021D9E44[5] = { 0, 6, 1, 12, 2060 }; -const struct ov59_ListStruct021D9E0C ov59_021D9E58[3] = - { - { - .msgNo = narc_0341_00031, //CONTROL INFO - .val = 1 - }, - { - .msgNo = narc_0341_00032, //ADVENTURE INFO - .val = 2 - }, - { - .msgNo = narc_0341_00033, //NO INFO NEEDED - .val = 3 - } - }; - -const struct ov59_CharStruct021D9E70 ov59_021D9E70 = - { - .charData = { NARC_intro_dawn_walk_1_NCGR, NARC_intro_narc_0044_NCGR, NARC_intro_narc_0045_NCGR, NARC_intro_narc_0046_NCGR, NARC_intro_narc_0047_NCGR, 0xFF } - }; - -const struct ov59_CharStruct021D9E70 ov59_021D9E88 = - { - .charData = { NARC_intro_lucas_walk_1_NCGR, NARC_intro_narc_0040_NCGR, NARC_intro_narc_0041_NCGR, NARC_intro_narc_0042_NCGR, NARC_intro_narc_0043_NCGR, 0xFF } - }; - -const struct BgTemplate ov59_021D9EA0 = - { - .x = 0, - .y = 0, - .bufferSize = 2048, - .baseTile = 0, - - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, - .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x00000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE - }; - -const struct BgTemplate ov59_021D9EBC = - { - .x = 0, - .y = 0, - .bufferSize = 2048, - .baseTile = 0, - - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, - .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x00000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 0, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE - }; +const struct ov59_ListStruct021D9E0C ov59_021D9E58[3] = { + { .msgNo = narc_0341_00031, // CONTROL INFO + .val = 1 }, + { .msgNo = narc_0341_00032, // ADVENTURE INFO + .val = 2 }, + { .msgNo = narc_0341_00033, // NO INFO NEEDED + .val = 3 } +}; + +const struct ov59_CharStruct021D9E70 ov59_021D9E70 = { + .charData = { NARC_intro_dawn_walk_1_NCGR, NARC_intro_narc_0044_NCGR, NARC_intro_narc_0045_NCGR, NARC_intro_narc_0046_NCGR, NARC_intro_narc_0047_NCGR, 0xFF } +}; + +const struct ov59_CharStruct021D9E70 ov59_021D9E88 = { + .charData = { NARC_intro_lucas_walk_1_NCGR, NARC_intro_narc_0040_NCGR, NARC_intro_narc_0041_NCGR, NARC_intro_narc_0042_NCGR, NARC_intro_narc_0043_NCGR, 0xFF } +}; + +const struct BgTemplate ov59_021D9EA0 = { + .x = 0, + .y = 0, + .bufferSize = 2048, + .baseTile = 0, + + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, + .screenBase = GX_BG_SCRBASE_0x0000, + .charBase = GX_BG_CHARBASE_0x00000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE +}; + +const struct BgTemplate ov59_021D9EBC = { + .x = 0, + .y = 0, + .bufferSize = 2048, + .baseTile = 0, + + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, + .screenBase = GX_BG_SCRBASE_0x0000, + .charBase = GX_BG_CHARBASE_0x00000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 0, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE +}; const u16 ov59_021D9ED8[0x10] = { 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C, 0x6A3C }; -const struct ListMenuTemplate ov59_021D9EF8 = - { - .items = NULL, - .moveCursorFunc = NULL, - .itemPrintFunc = NULL, - .window = NULL, - .totalItems = 0, - .maxShowed = 0, - .header_X = 0, - .item_X = 12, - .cursor_X = 0, - .upText_Y = 0, - .cursorPal = 1, - .fillValue = 15, - .cursorShadowPal = 2, - .lettersSpacing = 0, - .itemVerticalPadding = 0, - .scrollMultiple = 0, - .fontId = 0, - .cursorKind = 0, - .unk_1C = 0 - }; - -const struct ov59_ListStruct021D9E0C ov59_021D9F40[5] = - { - { - .msgNo = narc_0341_00036, //New name! - .val = 1 - }, - { - .msgNo = narc_0341_00037, //Barry - .val = 2 - }, - { - .msgNo = narc_0341_00038, //Damion - .val = 3 - }, - { - .msgNo = narc_0341_00039, //Tyson - .val = 4 - }, - { - .msgNo = narc_0341_00040, //Markus - .val = 5 - } - }; - -const struct ov59_ListStruct021D9E0C ov59_021D9F68[5] = - { - { - .msgNo = narc_0341_00036, //New name! - .val = 1 - }, +const struct ListMenuTemplate ov59_021D9EF8 = { + .items = NULL, + .moveCursorFunc = NULL, + .itemPrintFunc = NULL, + .window = NULL, + .totalItems = 0, + .maxShowed = 0, + .header_X = 0, + .item_X = 12, + .cursor_X = 0, + .upText_Y = 0, + .cursorPal = 1, + .fillValue = 15, + .cursorShadowPal = 2, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 0, + .cursorKind = 0, + .unk_1C = 0 +}; + +const struct ov59_ListStruct021D9E0C ov59_021D9F40[5] = { + { .msgNo = narc_0341_00036, // New name! + .val = 1 }, + { .msgNo = narc_0341_00037, // Barry + .val = 2 }, + { .msgNo = narc_0341_00038, // Damion + .val = 3 }, + { .msgNo = narc_0341_00039, // Tyson + .val = 4 }, + { .msgNo = narc_0341_00040, // Markus + .val = 5 } +}; + +const struct ov59_ListStruct021D9E0C ov59_021D9F68[5] = { + { .msgNo = narc_0341_00036, // New name! + .val = 1 }, + { .msgNo = narc_0341_00041, // Clint + .val = 2 }, + { .msgNo = narc_0341_00042, // Ralph + .val = 3 }, + { .msgNo = narc_0341_00043, // Lewis + .val = 4 }, + { .msgNo = narc_0341_00044, // Tommy + .val = 5 } +}; + +const struct GraphicsBanks ov59_021D9F18 = { + .bg = GX_VRAM_BG_128_B, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_128_C, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_NONE, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_NONE, + .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, + .tex = GX_VRAM_TEX_NONE, + .texpltt = GX_VRAM_TEXPLTT_NONE +}; + +const struct ov59_GraphicsPaletteMap021D9F90 ov59_021D9F90 = { + .map = { + { .charNum = 0, + .palNum = 0 }, + // rowan sprite { - .msgNo = narc_0341_00041, //Clint - .val = 2 - }, + .charNum = NARC_intro_rowan_front_NCGR, + .palNum = NARC_intro_rowan_front_NCLR }, + // boy sprites { - .msgNo = narc_0341_00042, //Ralph - .val = 3 - }, + .charNum = NARC_intro_lucas_walk_1_NCGR, + .palNum = NARC_intro_lucas_walk_NCLR }, + { .charNum = NARC_intro_lucas_walk_2_NCGR, + .palNum = NARC_intro_lucas_walk_NCLR }, + { .charNum = NARC_intro_lucas_walk_3_NCGR, + .palNum = NARC_intro_lucas_walk_NCLR }, + { .charNum = NARC_intro_lucas_walk_4_NCGR, + .palNum = NARC_intro_lucas_walk_NCLR }, + // girl sprites { - .msgNo = narc_0341_00043, //Lewis - .val = 4 - }, + .charNum = NARC_intro_dawn_walk_1_NCGR, + .palNum = NARC_intro_dawn_walk_NCLR }, + { .charNum = NARC_intro_dawn_walk_2_NCGR, + .palNum = NARC_intro_dawn_walk_NCLR }, + { .charNum = NARC_intro_dawn_walk_3_NCGR, + .palNum = NARC_intro_dawn_walk_NCLR }, + { .charNum = NARC_intro_dawn_walk_4_NCGR, + .palNum = NARC_intro_dawn_walk_NCLR }, + // barry sprite { - .msgNo = narc_0341_00044, //Tommy - .val = 5 - } - }; - -const struct GraphicsBanks ov59_021D9F18 = - { - .bg = GX_VRAM_BG_128_B, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_128_C, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_NONE, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_NONE, - .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_NONE, - .texpltt = GX_VRAM_TEXPLTT_NONE - }; - -const struct ov59_GraphicsPaletteMap021D9F90 ov59_021D9F90 = - { - .map = - { - { - .charNum = 0, - .palNum = 0 - }, - //rowan sprite - { - .charNum = NARC_intro_rowan_front_NCGR, - .palNum = NARC_intro_rowan_front_NCLR - }, - //boy sprites - { - .charNum = NARC_intro_lucas_walk_1_NCGR, - .palNum = NARC_intro_lucas_walk_NCLR - }, - { - .charNum = NARC_intro_lucas_walk_2_NCGR, - .palNum = NARC_intro_lucas_walk_NCLR - }, - { - .charNum = NARC_intro_lucas_walk_3_NCGR, - .palNum = NARC_intro_lucas_walk_NCLR - }, - { - .charNum = NARC_intro_lucas_walk_4_NCGR, - .palNum = NARC_intro_lucas_walk_NCLR - }, - //girl sprites - { - .charNum = NARC_intro_dawn_walk_1_NCGR, - .palNum = NARC_intro_dawn_walk_NCLR - }, - { - .charNum = NARC_intro_dawn_walk_2_NCGR, - .palNum = NARC_intro_dawn_walk_NCLR - }, - { - .charNum = NARC_intro_dawn_walk_3_NCGR, - .palNum = NARC_intro_dawn_walk_NCLR - }, - { - .charNum = NARC_intro_dawn_walk_4_NCGR, - .palNum = NARC_intro_dawn_walk_NCLR - }, - //barry sprite - { - .charNum = NARC_intro_barry_front_NCGR, - .palNum = NARC_intro_barry_front_NCLR - } - } - }; + .charNum = NARC_intro_barry_front_NCGR, + .palNum = NARC_intro_barry_front_NCLR } } +}; -const u8 ov59_021D9FE8[0x64] = - { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x40, 0x41, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, - 0x0E, 0x0F, 0x42, 0x43, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x44, 0x45, 0x18, 0x19, - 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x46, 0x47, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x48, 0x49, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x4A, 0x4B, 0x30, 0x31, 0x32, 0x33, - 0x34, 0x35, 0x36, 0x37, 0x4C, 0x4D, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x4E, 0x4F, - 0x50, 0x51, 0x52, 0x53, 0x58, 0x59, 0x5A, 0x5B, 0x60, 0x61, 0x54, 0x55, 0x56, 0x57, 0x5C, 0x5D, - 0x5E, 0x5F, 0x62, 0x63 - }; +const u8 ov59_021D9FE8[0x64] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x40, 0x41, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x42, 0x43, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x44, 0x45, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x46, 0x47, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x48, 0x49, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x4A, 0x4B, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x4C, 0x4D, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x58, 0x59, 0x5A, 0x5B, 0x60, 0x61, 0x54, 0x55, 0x56, 0x57, 0x5C, 0x5D, 0x5E, 0x5F, 0x62, 0x63 +}; extern void BeginNormalPaletteFade(u32 pattern, u32 typeTop, u32 typeBottom, u16 colour, u32 duration, u32 framesPer, HeapID heapId); extern BOOL IsPaletteFadeFinished(void); @@ -386,137 +310,128 @@ extern void sub_020146C4(u32 param0); FS_EXTERN_OVERLAY(OVERLAY_52); -BOOL ov59_IntroInit(struct OverlayManager *overlayManager, u32 *status) -{ +BOOL ov59_IntroInit(struct OverlayManager *overlayManager, u32 *status) { #pragma unused(status) CreateHeap(3, HEAP_ID_INTRO, 0x40000); - ov59_IntroOverlayData *data = (ov59_IntroOverlayData *) OverlayManager_CreateAndGetData(overlayManager, sizeof(ov59_IntroOverlayData), HEAP_ID_INTRO); + ov59_IntroOverlayData *data = (ov59_IntroOverlayData *)OverlayManager_CreateAndGetData(overlayManager, sizeof(ov59_IntroOverlayData), HEAP_ID_INTRO); memset((void *)data, 0, sizeof(ov59_IntroOverlayData)); - data->heapId = HEAP_ID_INTRO; - s32 *field18 = OverlayManager_GetField18(overlayManager); - data->save = (struct SaveData *)field18[2]; //? - data->options = Save_PlayerData_GetOptionsAddr(data->save); + data->heapId = HEAP_ID_INTRO; + s32 *field18 = OverlayManager_GetField18(overlayManager); + data->save = (struct SaveData *)field18[2]; //? + data->options = Save_PlayerData_GetOptionsAddr(data->save); data->nextControllerCounter = data->controllerCounter = 0; - data->loadedOverlay = NULL; - data->playerStruct = (struct ov59_UnkPlayerStruct *)sub_02077A84(HEAP_ID_INTRO, 0, 0, 7, data->options); - data->rivalStruct = (struct ov59_UnkPlayerStruct *)sub_02077A84(HEAP_ID_INTRO, 3, 0, 7, data->options); - data->scrnDataIndexMain = 0; - data->spriteDataIndex0 = 0; - data->spriteDataIndex1 = 0; - data->scrnDataIndexSub = 0; - data->tickTimer = 0; + data->loadedOverlay = NULL; + data->playerStruct = (struct ov59_UnkPlayerStruct *)sub_02077A84(HEAP_ID_INTRO, 0, 0, 7, data->options); + data->rivalStruct = (struct ov59_UnkPlayerStruct *)sub_02077A84(HEAP_ID_INTRO, 3, 0, 7, data->options); + data->scrnDataIndexMain = 0; + data->spriteDataIndex0 = 0; + data->spriteDataIndex1 = 0; + data->scrnDataIndexSub = 0; + data->tickTimer = 0; return TRUE; } -BOOL ov59_IntroMain(struct OverlayManager *overlayManager, u32 *status) -{ - ov59_IntroOverlayData *data = (ov59_IntroOverlayData *) OverlayManager_GetData(overlayManager); - BOOL ret = FALSE; +BOOL ov59_IntroMain(struct OverlayManager *overlayManager, u32 *status) { + ov59_IntroOverlayData *data = (ov59_IntroOverlayData *)OverlayManager_GetData(overlayManager); + BOOL ret = FALSE; - switch (*status) - { - case 0: - sub_0200E3A0(PM_LCD_TOP, 0); - sub_0200E3A0(PM_LCD_BOTTOM, 0); + switch (*status) { + case 0: + sub_0200E3A0(PM_LCD_TOP, 0); + sub_0200E3A0(PM_LCD_BOTTOM, 0); - Main_SetVBlankIntrCB(NULL, NULL); - Main_SetHBlankIntrCB(NULL, NULL); + Main_SetVBlankIntrCB(NULL, NULL); + Main_SetHBlankIntrCB(NULL, NULL); - GfGfx_DisableEngineAPlanes(); - GfGfx_DisableEngineBPlanes(); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); - GX_SetVisiblePlane(0); - GXS_SetVisiblePlane(0); + GX_SetVisiblePlane(0); + GXS_SetVisiblePlane(0); - SetKeyRepeatTimers(4, 8); + SetKeyRepeatTimers(4, 8); - ov59_IntroSetupBg(data); - ov59_IntroSetupMsg(data); - ov59_021D7A4C(data); + ov59_IntroSetupBg(data); + ov59_IntroSetupMsg(data); + ov59_021D7A4C(data); - Main_SetVBlankIntrCB((void (*)(void *))ov59_IntroDoGpuBgUpdate, data); + Main_SetVBlankIntrCB((void (*)(void *))ov59_IntroDoGpuBgUpdate, data); - GfGfx_BothDispOn(); + GfGfx_BothDispOn(); - *status = 1; + *status = 1; - break; + break; - case 1: - if (ov59_MasterController(data) == TRUE) - { - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); - *status = 2; - } + case 1: + if (ov59_MasterController(data) == TRUE) { + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); + *status = 2; + } - if (data->loadedOverlay == NULL) - { - break; - } + if (data->loadedOverlay == NULL) { + break; + } - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); - *status = 3; + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); + *status = 3; + + break; + case 2: // wait for fade, cleanup + if (IsPaletteFadeFinished() != TRUE) { break; + } - case 2: //wait for fade, cleanup - if (IsPaletteFadeFinished() != TRUE) - { - break; - } + ov59_IntroDestroyMsg(data); + ov59_IntroDestroyBg(data); + ov59_021D7A5C(data); - ov59_IntroDestroyMsg(data); - ov59_IntroDestroyBg(data); - ov59_021D7A5C(data); + Main_SetVBlankIntrCB(NULL, NULL); - Main_SetVBlankIntrCB(NULL, NULL); + ret = TRUE; + break; - ret = TRUE; + case 3: // wait for fade, cleanup + if (IsPaletteFadeFinished() != TRUE) { break; + } - case 3: //wait for fade, cleanup - if (IsPaletteFadeFinished() != TRUE) - { - break; - } + ov59_IntroDestroyMsg(data); + ov59_IntroDestroyBg(data); + ov59_021D7A5C(data); - ov59_IntroDestroyMsg(data); - ov59_IntroDestroyBg(data); - ov59_021D7A5C(data); + Main_SetVBlankIntrCB(NULL, NULL); - Main_SetVBlankIntrCB(NULL, NULL); + *status = 4; - *status = 4; + break; + case 4: + if (OverlayManager_Run(data->loadedOverlay) != TRUE) { break; + } - case 4: - if (OverlayManager_Run(data->loadedOverlay) != TRUE) - { - break; - } - - OverlayManager_Delete(data->loadedOverlay); - data->loadedOverlay = NULL; + OverlayManager_Delete(data->loadedOverlay); + data->loadedOverlay = NULL; - *status = 5; + *status = 5; - break; + break; - case 5: - *status = 0; + case 5: + *status = 0; - break; + break; } return ret; } -BOOL ov59_IntroExit(struct OverlayManager *overlayManager, u32 *status) -{ +BOOL ov59_IntroExit(struct OverlayManager *overlayManager, u32 *status) { #pragma unused(status) - ov59_IntroOverlayData *data = (ov59_IntroOverlayData *) OverlayManager_GetData(overlayManager); + ov59_IntroOverlayData *data = (ov59_IntroOverlayData *)OverlayManager_GetData(overlayManager); HeapID heapId = data->heapId; PlayerName_StringToFlat(Save_PlayerData_GetProfileAddr(data->save), data->playerStruct->name); @@ -535,25 +450,21 @@ BOOL ov59_IntroExit(struct OverlayManager *overlayManager, u32 *status) return TRUE; } -void ov59_IntroDoGpuBgUpdate(ov59_IntroOverlayData *data) -{ +void ov59_IntroDoGpuBgUpdate(ov59_IntroOverlayData *data) { DoScheduledBgGpuUpdates(data->bgConfig); } -BOOL ov59_TestPokeballTouchLocation(void) -{ +BOOL ov59_TestPokeballTouchLocation(void) { BOOL ret = FALSE; - if (gSystem.touchNew != 0 && gSystem.touchX < 256 && gSystem.touchY < 192) - { + if (gSystem.touchNew != 0 && gSystem.touchX < 256 && gSystem.touchY < 192) { s32 distanceFromXCentre = gSystem.touchX < 128 ? (u16)(128 - gSystem.touchX) : (u16)(gSystem.touchX - 128); s32 distanceFromYCentre = gSystem.touchY < 100 ? (u16)(100 - gSystem.touchY) : (u16)(gSystem.touchY - 100); s32 distanceXSquare = distanceFromXCentre * distanceFromXCentre; s32 distanceYSquare = distanceFromYCentre * distanceFromYCentre; - if (distanceXSquare + distanceYSquare <= 256) - { + if (distanceXSquare + distanceYSquare <= 256) { ret = TRUE; } } @@ -561,8 +472,7 @@ BOOL ov59_TestPokeballTouchLocation(void) return ret; } -void ov59_IntroSetupBg(ov59_IntroOverlayData *data) -{ +void ov59_IntroSetupBg(ov59_IntroOverlayData *data) { struct GraphicsBanks graphicsBanks = ov59_021D9F18; GfGfx_SetBanks(&graphicsBanks); data->bgConfig = BgConfig_Alloc(data->heapId); @@ -571,23 +481,23 @@ void ov59_IntroSetupBg(ov59_IntroOverlayData *data) SetBothScreensModesAndDisable(&graphicsModes); struct BgTemplate bgTemplateMain = ov59_021D9EA0; - bgTemplateMain.screenBase = GX_BG_SCRBASE_0x7800; - bgTemplateMain.charBase = GX_BG_CHARBASE_0x18000; + bgTemplateMain.screenBase = GX_BG_SCRBASE_0x7800; + bgTemplateMain.charBase = GX_BG_CHARBASE_0x18000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_0, &bgTemplateMain, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); bgTemplateMain.screenBase = GX_BG_SCRBASE_0x7000; - bgTemplateMain.charBase = GX_BG_CHARBASE_0x14000; + bgTemplateMain.charBase = GX_BG_CHARBASE_0x14000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_1, &bgTemplateMain, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1); bgTemplateMain.screenBase = GX_BG_SCRBASE_0x6800; - bgTemplateMain.charBase = GX_BG_CHARBASE_0x10000; + bgTemplateMain.charBase = GX_BG_CHARBASE_0x10000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_2, &bgTemplateMain, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2); bgTemplateMain.screenBase = GX_BG_SCRBASE_0x6000; - bgTemplateMain.charBase = GX_BG_CHARBASE_0x0c000; + bgTemplateMain.charBase = GX_BG_CHARBASE_0x0c000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_3, &bgTemplateMain, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_3); @@ -597,23 +507,23 @@ void ov59_IntroSetupBg(ov59_IntroOverlayData *data) LoadFontPal1(GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_6_OFFSET, data->heapId); struct BgTemplate bgTemplateSub = ov59_021D9EBC; - bgTemplateSub.screenBase = GX_BG_SCRBASE_0x7800; - bgTemplateSub.charBase = GX_BG_CHARBASE_0x18000; + bgTemplateSub.screenBase = GX_BG_SCRBASE_0x7800; + bgTemplateSub.charBase = GX_BG_CHARBASE_0x18000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_SUB_0, &bgTemplateSub, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_SUB_0); bgTemplateSub.screenBase = GX_BG_SCRBASE_0x7000; - bgTemplateSub.charBase = GX_BG_CHARBASE_0x14000; + bgTemplateSub.charBase = GX_BG_CHARBASE_0x14000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_SUB_1, &bgTemplateSub, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_SUB_1); bgTemplateSub.screenBase = GX_BG_SCRBASE_0x6800; - bgTemplateSub.charBase = GX_BG_CHARBASE_0x10000; + bgTemplateSub.charBase = GX_BG_CHARBASE_0x10000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_SUB_2, &bgTemplateSub, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_SUB_2); bgTemplateSub.screenBase = GX_BG_SCRBASE_0x6000; - bgTemplateSub.charBase = GX_BG_CHARBASE_0x0c000; + bgTemplateSub.charBase = GX_BG_CHARBASE_0x0c000; InitBgFromTemplate(data->bgConfig, GF_BG_LYR_SUB_3, &bgTemplateSub, GF_BG_TYPE_TEXT); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_SUB_3); @@ -631,8 +541,7 @@ void ov59_IntroSetupBg(ov59_IntroOverlayData *data) data->fadeCounter = 0; } -void ov59_IntroDestroyBg(ov59_IntroOverlayData *data) -{ +void ov59_IntroDestroyBg(ov59_IntroOverlayData *data) { ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); @@ -656,8 +565,7 @@ void ov59_IntroDestroyBg(ov59_IntroOverlayData *data) FreeToHeap(data->bgConfig); } -void ov59_IntroSetupMsg(ov59_IntroOverlayData *data) -{ +void ov59_IntroSetupMsg(ov59_IntroOverlayData *data) { data->msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0341_bin, data->heapId); ResetAllTextPrinters(); @@ -666,365 +574,312 @@ void ov59_IntroSetupMsg(ov59_IntroOverlayData *data) data->messageFormat = MessageFormat_New(data->heapId); - data->displayMessageCounter = 0; + data->displayMessageCounter = 0; data->displayControlMessageCounter = 0; - data->createListCounter = 0; + data->createListCounter = 0; } -void ov59_IntroDestroyMsg(ov59_IntroOverlayData *data) -{ +void ov59_IntroDestroyMsg(ov59_IntroOverlayData *data) { MessageFormat_Delete(data->messageFormat); sub_020143D0(data->unk60); DestroyMsgData(data->msgData); } -void ov59_021D7A4C(ov59_IntroOverlayData *data) //ov59_Setup... something? +void ov59_021D7A4C(ov59_IntroOverlayData *data) // ov59_Setup... something? { data->unk68 = sub_02014590(data->heapId); } -void ov59_021D7A5C(ov59_IntroOverlayData *data) //ov59_Destroy... something? +void ov59_021D7A5C(ov59_IntroOverlayData *data) // ov59_Destroy... something? { sub_020145A8(data->unk68); } -BOOL ov59_FadeController(ov59_IntroOverlayData *data, u32 bgId, u32 param2) -{ +BOOL ov59_FadeController(ov59_IntroOverlayData *data, u32 bgId, u32 param2) { BOOL subScreen; GXBlendPlaneMask planeMask; BOOL ret = FALSE; - switch (bgId) - { - case GF_BG_LYR_MAIN_0: - case GF_BG_LYR_MAIN_3: - default: - planeMask = GX_BLEND_PLANEMASK_BG0; - subScreen = FALSE; - break; - case GF_BG_LYR_MAIN_1: - planeMask = GX_BLEND_PLANEMASK_BG1; - subScreen = FALSE; - break; - case GF_BG_LYR_MAIN_2: - planeMask = GX_BLEND_PLANEMASK_BG2; - subScreen = FALSE; - break; - case GF_BG_LYR_SUB_0: - planeMask = GX_BLEND_PLANEMASK_BG0; - subScreen = TRUE; - break; - case GF_BG_LYR_SUB_1: - planeMask = GX_BLEND_PLANEMASK_BG1; - subScreen = TRUE; - break; - case GF_BG_LYR_SUB_2: - planeMask = GX_BLEND_PLANEMASK_BG2; - subScreen = TRUE; - break; + switch (bgId) { + case GF_BG_LYR_MAIN_0: + case GF_BG_LYR_MAIN_3: + default: + planeMask = GX_BLEND_PLANEMASK_BG0; + subScreen = FALSE; + break; + case GF_BG_LYR_MAIN_1: + planeMask = GX_BLEND_PLANEMASK_BG1; + subScreen = FALSE; + break; + case GF_BG_LYR_MAIN_2: + planeMask = GX_BLEND_PLANEMASK_BG2; + subScreen = FALSE; + break; + case GF_BG_LYR_SUB_0: + planeMask = GX_BLEND_PLANEMASK_BG0; + subScreen = TRUE; + break; + case GF_BG_LYR_SUB_1: + planeMask = GX_BLEND_PLANEMASK_BG1; + subScreen = TRUE; + break; + case GF_BG_LYR_SUB_2: + planeMask = GX_BLEND_PLANEMASK_BG2; + subScreen = TRUE; + break; } - switch(data->fadeCounter) - { - case 0: - if (param2 == 0) - { - data->alphaBlend1 = 0; - data->alphaBlend2 = 16; - data->fadeCounter = 1; - if (!subScreen) - { - G2_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); - } - else - { - G2S_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); - } - ToggleBgLayer((u8)bgId, GX_PLANE_TOGGLE_ON); - } - else - { - data->alphaBlend1 = 16; - data->alphaBlend2 = 0; - data->fadeCounter = 2; - } - break; - case 1: - if (data->alphaBlend2 != 0) - { - data->alphaBlend1++; - data->alphaBlend2--; - if (!subScreen) - { - G2_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); - } - else - { - G2S_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); - } - } - else - { - data->fadeCounter = 3; - } - break; - case 2: - if (data->alphaBlend1 != 0) - { - data->alphaBlend1--; - data->alphaBlend2++; - if (!subScreen) - { - G2_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); - } - else - { - G2S_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); - } - } - else - { - data->fadeCounter = 3; - ToggleBgLayer((u8)bgId, GX_PLANE_TOGGLE_OFF); - } - break; - case 3: - reg_G2_BLDCNT = 0; - reg_G2S_DB_BLDCNT = 0; - data->fadeCounter = 0; - ret = TRUE; - break; + switch (data->fadeCounter) { + case 0: + if (param2 == 0) { + data->alphaBlend1 = 0; + data->alphaBlend2 = 16; + data->fadeCounter = 1; + if (!subScreen) { + G2_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); + } else { + G2S_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); + } + ToggleBgLayer((u8)bgId, GX_PLANE_TOGGLE_ON); + } else { + data->alphaBlend1 = 16; + data->alphaBlend2 = 0; + data->fadeCounter = 2; + } + break; + case 1: + if (data->alphaBlend2 != 0) { + data->alphaBlend1++; + data->alphaBlend2--; + if (!subScreen) { + G2_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); + } else { + G2S_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); + } + } else { + data->fadeCounter = 3; + } + break; + case 2: + if (data->alphaBlend1 != 0) { + data->alphaBlend1--; + data->alphaBlend2++; + if (!subScreen) { + G2_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); + } else { + G2S_SetBlendAlpha(planeMask, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1), data->alphaBlend1, data->alphaBlend2); + } + } else { + data->fadeCounter = 3; + ToggleBgLayer((u8)bgId, GX_PLANE_TOGGLE_OFF); + } + break; + case 3: + reg_G2_BLDCNT = 0; + reg_G2S_DB_BLDCNT = 0; + data->fadeCounter = 0; + ret = TRUE; + break; } return ret; } -BOOL ov59_Timer(ov59_IntroOverlayData *data, s32 timer) -{ - if (data->tickTimer < timer) - { +BOOL ov59_Timer(ov59_IntroOverlayData *data, s32 timer) { + if (data->tickTimer < timer) { data->tickTimer++; return FALSE; - } - else - { + } else { data->tickTimer = 0; return TRUE; } } -void ov59_TilemapChangePalette(ov59_IntroOverlayData *data, u32 layer, u32 paletteNum) -{ - //TODO: messy hack to trick compiler, fix +void ov59_TilemapChangePalette(ov59_IntroOverlayData *data, u32 layer, u32 paletteNum) { + // TODO: messy hack to trick compiler, fix BgTilemapRectChangePalette(data->bgConfig, layer & 0xFF, 0, 0, 32, 24, (u8)paletteNum); BgCommitTilemapBufferToVram(data->bgConfig, (u8)layer); } -BOOL ov59_DisplayMessage(ov59_IntroOverlayData *data, u32 msgNo, BOOL autoAdvance) -{ +BOOL ov59_DisplayMessage(ov59_IntroOverlayData *data, u32 msgNo, BOOL autoAdvance) { BOOL ret = FALSE; - switch(data->displayMessageCounter) - { - case 0: - AddWindow(data->bgConfig, &data->window, &ov59_021D9DB8); - FillWindowPixelRect(&data->window, 15, 0, 0, 216, 32); - DrawFrameAndWindow2(&data->window, FALSE, 994, 4); - - TextFlags_SetCanABSpeedUpPrint(TRUE); - sub_02002B7C(0); - - struct String* string = String_New(1024, data->heapId); - data->string = String_New(1024, data->heapId); - ReadMsgDataIntoString(data->msgData, msgNo, string); - BufferString(data->messageFormat, 0, data->playerStruct->name, data->selectedGender, 1, 2); - BufferString(data->messageFormat, 1, data->rivalStruct->name, 0, 1, 2); - StringExpandPlaceholders(data->messageFormat, data->string, string); - String_Delete(string); - - u32 delay = Options_GetTextFrameDelay(data->options); - data->minTextSpacing = AddTextPrinterParameterized(&data->window, 1, data->string, 0, 0, delay, NULL); - data->displayMessageCounter = 1; + switch (data->displayMessageCounter) { + case 0: + AddWindow(data->bgConfig, &data->window, &ov59_021D9DB8); + FillWindowPixelRect(&data->window, 15, 0, 0, 216, 32); + DrawFrameAndWindow2(&data->window, FALSE, 994, 4); + + TextFlags_SetCanABSpeedUpPrint(TRUE); + sub_02002B7C(0); + + struct String *string = String_New(1024, data->heapId); + data->string = String_New(1024, data->heapId); + ReadMsgDataIntoString(data->msgData, msgNo, string); + BufferString(data->messageFormat, 0, data->playerStruct->name, data->selectedGender, 1, 2); + BufferString(data->messageFormat, 1, data->rivalStruct->name, 0, 1, 2); + StringExpandPlaceholders(data->messageFormat, data->string, string); + String_Delete(string); + + u32 delay = Options_GetTextFrameDelay(data->options); + data->minTextSpacing = AddTextPrinterParameterized(&data->window, 1, data->string, 0, 0, delay, NULL); + data->displayMessageCounter = 1; + break; + case 1: + if (sub_0201BD70((u8)data->minTextSpacing)) { break; - case 1: - if (sub_0201BD70((u8)data->minTextSpacing)) - { - break; - } - String_Delete(data->string); - data->displayMessageCounter = 2; + } + String_Delete(data->string); + data->displayMessageCounter = 2; + break; + case 2: + if (autoAdvance != FALSE || (gSystem.newKeys & PAD_BUTTON_A) == 1) { + RemoveWindow(&data->window); + data->displayMessageCounter = 0; + ret = TRUE; break; - case 2: - if (autoAdvance != FALSE || (gSystem.newKeys & PAD_BUTTON_A) == 1) - { - RemoveWindow(&data->window); - data->displayMessageCounter = 0; - ret = TRUE; - break; - } + } } return ret; } -void ov59_PlaySelectSound(struct ListMenu *list, s32 index, u8 onInit) -{ +void ov59_PlaySelectSound(struct ListMenu *list, s32 index, u8 onInit) { #pragma unused(index) #pragma unused(list) - if (onInit == 0) - { + if (onInit == 0) { PlaySE(SEQ_SE_DP_SELECT); } } -BOOL ov59_CreateListWithText(ov59_IntroOverlayData *data, u32 param1, u32 param2) -{ +BOOL ov59_CreateListWithText(ov59_IntroOverlayData *data, u32 param1, u32 param2) { BOOL ret = FALSE; const struct WindowTemplate *windowTemplate; const struct ov59_ListStruct021D9E0C *listStruct; s32 i; // must be defined here to prevent a regswap s32 menuItemsCount = 0; - switch (data->createListCounter) - { + switch (data->createListCounter) { + case 0: + switch (param1) { + default: case 0: - switch (param1) - { - default: - case 0: - windowTemplate = &ov59_021D9DA8; - listStruct = ov59_021D9E0C; - menuItemsCount = 2; - break; - case 1: - windowTemplate = &ov59_021D9DB0; - listStruct = ov59_021D9E58; - menuItemsCount = 3; - break; - case 2: - windowTemplate = &ov59_021D9DA0; - if ((u8)gGameVersion == VERSION_DIAMOND) - { - listStruct = ov59_021D9F40; - menuItemsCount = 5; - } - else - { - listStruct = ov59_021D9F68; - menuItemsCount = 5; - } - break; - } - AddWindow(data->bgConfig, &data->listWindow, windowTemplate); - data->listMenuItem = ListMenuItems_New(menuItemsCount, data->heapId); - for (i = 0; i < menuItemsCount; i++) - { - ListMenuItems_AppendFromMsgData(data->listMenuItem, data->msgData, listStruct[i].msgNo, listStruct[i].val); - } - struct ListMenuTemplate template = ov59_021D9EF8; - template.items = data->listMenuItem; - template.totalItems = (u16)menuItemsCount; - template.maxShowed = (u16)menuItemsCount; - template.moveCursorFunc = ov59_PlaySelectSound; - template.window = &data->listWindow; - data->listMenu = ListMenuInit(&template, 0, 0, data->heapId); - DrawFrameAndWindow1(template.window, TRUE, 985, 3); - CopyWindowToVram(&data->listWindow); - data->createListCounter = 1; + windowTemplate = &ov59_021D9DA8; + listStruct = ov59_021D9E0C; + menuItemsCount = 2; break; case 1: - data->listMenuInput = ListMenu_ProcessInput(data->listMenu); - if(data->listMenuInput == ~0 || (data->listMenuInput == (~0 - 1) && param2 == 1)) - { - break; + windowTemplate = &ov59_021D9DB0; + listStruct = ov59_021D9E58; + menuItemsCount = 3; + break; + case 2: + windowTemplate = &ov59_021D9DA0; + if ((u8)gGameVersion == VERSION_DIAMOND) { + listStruct = ov59_021D9F40; + menuItemsCount = 5; + } else { + listStruct = ov59_021D9F68; + menuItemsCount = 5; } - ClearFrameAndWindow1(&data->listWindow, FALSE); - RemoveWindow(&data->listWindow); - DestroyListMenu(data->listMenu, 0, 0); - ListMenuItems_Delete(data->listMenuItem); - PlaySE(SEQ_SE_DP_SELECT); - data->createListCounter = 0; - ret = TRUE; + break; + } + AddWindow(data->bgConfig, &data->listWindow, windowTemplate); + data->listMenuItem = ListMenuItems_New(menuItemsCount, data->heapId); + for (i = 0; i < menuItemsCount; i++) { + ListMenuItems_AppendFromMsgData(data->listMenuItem, data->msgData, listStruct[i].msgNo, listStruct[i].val); + } + struct ListMenuTemplate template = ov59_021D9EF8; + template.items = data->listMenuItem; + template.totalItems = (u16)menuItemsCount; + template.maxShowed = (u16)menuItemsCount; + template.moveCursorFunc = ov59_PlaySelectSound; + template.window = &data->listWindow; + data->listMenu = ListMenuInit(&template, 0, 0, data->heapId); + DrawFrameAndWindow1(template.window, TRUE, 985, 3); + CopyWindowToVram(&data->listWindow); + data->createListCounter = 1; + break; + case 1: + data->listMenuInput = ListMenu_ProcessInput(data->listMenu); + if (data->listMenuInput == ~0 || (data->listMenuInput == (~0 - 1) && param2 == 1)) { + break; + } + ClearFrameAndWindow1(&data->listWindow, FALSE); + RemoveWindow(&data->listWindow); + DestroyListMenu(data->listMenu, 0, 0); + ListMenuItems_Delete(data->listMenuItem); + PlaySE(SEQ_SE_DP_SELECT); + data->createListCounter = 0; + ret = TRUE; } return ret; } -BOOL ov59_DisplayControlAdventureMessage(ov59_IntroOverlayData *data, u32 msgNo, u32 param2, u32 tilemapTop, u32 height) -{ +BOOL ov59_DisplayControlAdventureMessage(ov59_IntroOverlayData *data, u32 msgNo, u32 param2, u32 tilemapTop, u32 height) { BOOL ret = 0; - switch (data->displayControlMessageCounter) - { - case 0: - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); - data->string = String_New(1024, data->heapId); - ReadMsgDataIntoString(data->msgData, msgNo, data->string); - struct WindowTemplate template; - if (param2 == 1) - { - template = ov59_021D9D98; - u32 count = sub_02002F90(data->string); - template.top = (u8)(12 - count); - template.height = (u8)(count * 2); - AddWindow(data->bgConfig, &data->window, &template); - FillWindowPixelRect(&data->window, 0, 0, 0, 192, 192); - AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(1, 2, 0), NULL); - } - else - { - template = ov59_021D9D90; - template.top = (u8)tilemapTop; - template.height = (u8)height; - AddWindow(data->bgConfig, &data->window, &template); - FillWindowPixelRect(&data->window, 0, 0, 0, 192, 192); - AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(15, 2, 0), NULL); - } - String_Delete(data->string); - data->displayControlMessageCounter = 1; - break; - case 1: - CopyWindowToVram(&data->window); - data->displayControlMessageCounter = 2; - break; - case 2: - if (ov59_FadeController(data, GF_BG_LYR_MAIN_0, 0) == TRUE) - { - data->displayControlMessageCounter = 3; - } - break; - case 3: - if((gSystem.newKeys & PAD_BUTTON_A) != 1 && (gSystem.newKeys & PAD_BUTTON_B) != 2) - { - break; - } - PlaySE(SEQ_SE_DP_SELECT); - data->displayControlMessageCounter = 4; - break; - case 4: - if (ov59_FadeController(data, GF_BG_LYR_MAIN_0, 1) == TRUE) - { - data->displayControlMessageCounter = 5; - } + switch (data->displayControlMessageCounter) { + case 0: + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); + data->string = String_New(1024, data->heapId); + ReadMsgDataIntoString(data->msgData, msgNo, data->string); + struct WindowTemplate template; + if (param2 == 1) { + template = ov59_021D9D98; + u32 count = sub_02002F90(data->string); + template.top = (u8)(12 - count); + template.height = (u8)(count * 2); + AddWindow(data->bgConfig, &data->window, &template); + FillWindowPixelRect(&data->window, 0, 0, 0, 192, 192); + AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(1, 2, 0), NULL); + } else { + template = ov59_021D9D90; + template.top = (u8)tilemapTop; + template.height = (u8)height; + AddWindow(data->bgConfig, &data->window, &template); + FillWindowPixelRect(&data->window, 0, 0, 0, 192, 192); + AddTextPrinterParameterized2(&data->window, 0, data->string, 0, 0, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(15, 2, 0), NULL); + } + String_Delete(data->string); + data->displayControlMessageCounter = 1; + break; + case 1: + CopyWindowToVram(&data->window); + data->displayControlMessageCounter = 2; + break; + case 2: + if (ov59_FadeController(data, GF_BG_LYR_MAIN_0, 0) == TRUE) { + data->displayControlMessageCounter = 3; + } + break; + case 3: + if ((gSystem.newKeys & PAD_BUTTON_A) != 1 && (gSystem.newKeys & PAD_BUTTON_B) != 2) { break; - case 5: - RemoveWindow(&data->window); - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - data->displayControlMessageCounter = 0; - ret = TRUE; + } + PlaySE(SEQ_SE_DP_SELECT); + data->displayControlMessageCounter = 4; + break; + case 4: + if (ov59_FadeController(data, GF_BG_LYR_MAIN_0, 1) == TRUE) { + data->displayControlMessageCounter = 5; + } + break; + case 5: + RemoveWindow(&data->window); + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + data->displayControlMessageCounter = 0; + ret = TRUE; } return ret; } -void ov59_LoadInitialTilemap(ov59_IntroOverlayData *data) -{ +void ov59_LoadInitialTilemap(ov59_IntroOverlayData *data) { GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, NARC_intro_main_background_tileset_NCGR, data->bgConfig, GF_BG_LYR_MAIN_3, 0, 0, FALSE, data->heapId); BG_ClearCharDataRange(GF_BG_LYR_MAIN_0, 0x20, 0, data->heapId); GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, NARC_intro_sub_background_tileset_NCGR, data->bgConfig, GF_BG_LYR_SUB_3, 0, 0, FALSE, data->heapId); u32 mainPal; u32 subPal; - if ((u8)gGameVersion == VERSION_DIAMOND) - { + if ((u8)gGameVersion == VERSION_DIAMOND) { mainPal = NARC_intro_main_background_diamond_NCLR; - subPal = NARC_intro_sub_background_diamond_NCLR; - } - else - { + subPal = NARC_intro_sub_background_diamond_NCLR; + } else { mainPal = NARC_intro_main_background_pearl_NCLR; - subPal = NARC_intro_sub_background_pearl_NCLR; + subPal = NARC_intro_sub_background_pearl_NCLR; } GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, mainPal, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_0_OFFSET, 0x60, data->heapId); GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, subPal, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_0_OFFSET, 0xa0, data->heapId); @@ -1035,28 +890,23 @@ void ov59_LoadInitialTilemap(ov59_IntroOverlayData *data) BG_SetMaskColor(GF_BG_LYR_SUB_0, 0); } -void ov59_LoadMainScrnData(ov59_IntroOverlayData *data) -{ +void ov59_LoadMainScrnData(ov59_IntroOverlayData *data) { struct ov59_UnkStruct021D9E30 scrnData = ov59_021D9E1C; - if (data->scrnDataIndexMain >= 5) - { + if (data->scrnDataIndexMain >= 5) { return; } GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, scrnData.scrnIds[data->scrnDataIndexMain], data->bgConfig, GF_BG_LYR_MAIN_3, 0, 0, FALSE, data->heapId); } -void ov59_LoadCharDataFromIndex(ov59_IntroOverlayData *data) -{ +void ov59_LoadCharDataFromIndex(ov59_IntroOverlayData *data) { struct ov59_GraphicsPaletteMap021D9F90 graphicsPaletteMap = ov59_021D9F90; - if (data->spriteDataIndex0 != 0 && data->spriteDataIndex0 < 12) - { + if (data->spriteDataIndex0 != 0 && data->spriteDataIndex0 < 12) { GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex0].charNum, data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex0].palNum, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_7_OFFSET, 0x20, data->heapId); GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, NARC_intro_character_screen_NSCR, data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); ov59_TilemapChangePalette(data, GF_BG_LYR_MAIN_1, 7); } - if (data->spriteDataIndex1 != 0 && data->spriteDataIndex1 < 12) - { + if (data->spriteDataIndex1 != 0 && data->spriteDataIndex1 < 12) { GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex1].charNum, data->bgConfig, GF_BG_LYR_MAIN_2, 0, 0, FALSE, data->heapId); GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, graphicsPaletteMap.map[data->spriteDataIndex1].palNum, GF_PAL_LOCATION_MAIN_BG, GF_PAL_SLOT_8_OFFSET, 0x20, data->heapId); GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, NARC_intro_character_screen_NSCR, data->bgConfig, GF_BG_LYR_MAIN_2, 0, 0, FALSE, data->heapId); @@ -1064,32 +914,25 @@ void ov59_LoadCharDataFromIndex(ov59_IntroOverlayData *data) } } -void ov59_LoadSubScrnData(ov59_IntroOverlayData *data) -{ +void ov59_LoadSubScrnData(ov59_IntroOverlayData *data) { struct ov59_UnkStruct021D9E30 scrnData = ov59_021D9E30; - if (data->scrnDataIndexSub >= 5) - { + if (data->scrnDataIndexSub >= 5) { return; } GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, scrnData.scrnIds[data->scrnDataIndexSub], data->bgConfig, GF_BG_LYR_SUB_3, 0, 0, FALSE, data->heapId); - if (data->scrnDataIndexSub == 1) - { + if (data->scrnDataIndexSub == 1) { ov59_TilemapChangePalette(data, GF_BG_LYR_SUB_3, 3); - } - else if (data->scrnDataIndexSub == 2) - { + } else if (data->scrnDataIndexSub == 2) { ov59_TilemapChangePalette(data, GF_BG_LYR_SUB_3, 2); } } #ifdef NONMATCHING -void ov59_DrawMunchlax(ov59_IntroOverlayData *data) -{ +void ov59_DrawMunchlax(ov59_IntroOverlayData *data) { struct SomeDrawPokemonStruct drawStruct; sub_02068C00(&drawStruct, SPECIES_MUNCHLAX, MON_MALE, 2, FALSE, 0, 0); u16 *src = (u16 *)AllocFromHeap(data->heapId, 0x64 * sizeof(u16)); - for (s32 i = 0; i < 0x64; i++) - { + for (s32 i = 0; i < 0x64; i++) { src[i] = ov59_021D9FE8[i] + 1; } u32 *charData = sub_0201244C(drawStruct.unk0, drawStruct.unk2, data->heapId); @@ -1100,7 +943,7 @@ void ov59_DrawMunchlax(ov59_IntroOverlayData *data) ov59_TilemapChangePalette(data, GF_BG_LYR_MAIN_2, 9); BG_ClearCharDataRange(GF_BG_LYR_MAIN_2, 32, 0, data->heapId); BG_LoadCharTilesData(data->bgConfig, GF_BG_LYR_MAIN_2, charData, 0xc80, 1); - BG_LoadPlttData(GF_BG_LYR_MAIN_2, plttData, 32, GF_PAL_SLOT_8_OFFSET); //r2 and r3 regswap + BG_LoadPlttData(GF_BG_LYR_MAIN_2, plttData, 32, GF_PAL_SLOT_8_OFFSET); // r2 and r3 regswap BG_LoadPlttData(GF_BG_LYR_MAIN_2, ov59_021D9ED8, 32, GF_PAL_SLOT_9_OFFSET); FillBgTilemapRect(data->bgConfig, GF_BG_LYR_SUB_1, 0, 0, 0, 32, 24, 10); @@ -1115,9 +958,8 @@ void ov59_DrawMunchlax(ov59_IntroOverlayData *data) FreeToHeap(src); } #else -asm void ov59_DrawMunchlax(ov59_IntroOverlayData *data) -{ - //clang-tidy off +// clang-format off +asm void ov59_DrawMunchlax(ov59_IntroOverlayData *data) { push {r3, r4, r5, r6, r7, lr} sub sp, #0x20 mov r2, #0 @@ -1265,10 +1107,10 @@ asm void ov59_DrawMunchlax(ov59_IntroOverlayData *data) add sp, #0x20 pop {r3, r4, r5, r6, r7, pc} } +// clang-format on #endif -void ov59_LoadPokeballButton(ov59_IntroOverlayData *data) -{ +void ov59_LoadPokeballButton(ov59_IntroOverlayData *data) { GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO, NARC_intro_narc_0038_NSCR, data->bgConfig, GF_BG_LYR_SUB_2, 0, 0, FALSE, data->heapId); ov59_TilemapChangePalette(data, GF_BG_LYR_SUB_2, 9); GfGfxLoader_GXLoadPal(NARC_DEMO_INTRO_INTRO, NARC_intro_narc_0039_NCLR, GF_PAL_LOCATION_SUB_BG, GF_PAL_SLOT_7_OFFSET, 0x60, data->heapId); @@ -1276,74 +1118,50 @@ void ov59_LoadPokeballButton(ov59_IntroOverlayData *data) GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, NARC_intro_pokeball_button_1_NCGR, data->bgConfig, GF_BG_LYR_SUB_2, 0x20, 0, FALSE, data->heapId); } -BOOL ov59_MoveSprite(ov59_IntroOverlayData *data, enum GFBgLayer layer, u32 param2) -{ +BOOL ov59_MoveSprite(ov59_IntroOverlayData *data, enum GFBgLayer layer, u32 param2) { BOOL ret = FALSE; - if (param2 == 0) - { + if (param2 == 0) { fx32 xPos = Bg_GetXpos(data->bgConfig, layer); - if (xPos != 0) - { - if (xPos > 0) - { + if (xPos != 0) { + if (xPos > 0) { BgSetPosTextAndCommit(data->bgConfig, (u8)layer, BG_POS_OP_SUB_X, 4); - } - else - { + } else { BgSetPosTextAndCommit(data->bgConfig, (u8)layer, BG_POS_OP_ADD_X, 4); } - } - else - { + } else { ret = TRUE; } - } - else if (param2 == 1) - { + } else if (param2 == 1) { fx32 xPos = Bg_GetXpos(data->bgConfig, layer); - if (xPos != -48) - { + if (xPos != -48) { BgSetPosTextAndCommit(data->bgConfig, (u8)layer, BG_POS_OP_SUB_X, 4); - } - else - { + } else { ret = TRUE; } - } - else if (param2 == 2) - { + } else if (param2 == 2) { fx32 xPos = Bg_GetXpos(data->bgConfig, layer); - if (xPos != 0) - { + if (xPos != 0) { BgSetPosTextAndCommit(data->bgConfig, (u8)layer, BG_POS_OP_ADD_X, 4); - } - else - { + } else { ret = TRUE; } } return ret; } -void ov59_ResetPlayerAnimation(ov59_IntroOverlayData *data) -{ - data->maleAnimCounter = 0; - data->maleAnimTimer = 0; +void ov59_ResetPlayerAnimation(ov59_IntroOverlayData *data) { + data->maleAnimCounter = 0; + data->maleAnimTimer = 0; data->femaleAnimCounter = 0; - data->femaleAnimTimer = 0; + data->femaleAnimTimer = 0; } -void ov59_AnimatePlayerSprite(ov59_IntroOverlayData *data) -{ +void ov59_AnimatePlayerSprite(ov59_IntroOverlayData *data) { u32 timer; - if (data->selectedGender == PLAYER_GENDER_MALE) - { - if (data->maleAnimTimer != 0) - { + if (data->selectedGender == PLAYER_GENDER_MALE) { + if (data->maleAnimTimer != 0) { timer = data->maleAnimTimer - 1; - } - else - { + } else { data->maleAnimCounter++; data->maleAnimCounter &= 3; timer = 4; @@ -1352,15 +1170,10 @@ void ov59_AnimatePlayerSprite(ov59_IntroOverlayData *data) G2_SetBlendAlpha(GX_BLEND_PLANEMASK_BG2, GX_BLEND_PLANEMASK_BG3, 6, 10); struct ov59_CharStruct021D9DEC charStruct = ov59_021D9DEC; GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, charStruct.narcId[data->maleAnimCounter], data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); - } - else - { - if(data->femaleAnimTimer != 0) - { + } else { + if (data->femaleAnimTimer != 0) { timer = data->femaleAnimTimer - 1; - } - else - { + } else { data->femaleAnimCounter++; data->femaleAnimCounter &= 3; timer = 4; @@ -1372,28 +1185,22 @@ void ov59_AnimatePlayerSprite(ov59_IntroOverlayData *data) } } -void ov59_DisableBlend(ov59_IntroOverlayData *data) -{ +void ov59_DisableBlend(ov59_IntroOverlayData *data) { #pragma unused(data) reg_G2_BLDCNT = 0; } -void ov59_ResetPlayerShrinkAnimation(ov59_IntroOverlayData *data) -{ +void ov59_ResetPlayerShrinkAnimation(ov59_IntroOverlayData *data) { data->spriteDataIndex2 = 0; data->spriteData2Timer = 0; } -BOOL ov59_PlayerShrinkAnimation(ov59_IntroOverlayData *data) -{ +BOOL ov59_PlayerShrinkAnimation(ov59_IntroOverlayData *data) { BOOL ret = FALSE; u32 timer; - if (data->spriteData2Timer != 0) - { + if (data->spriteData2Timer != 0) { timer = data->spriteData2Timer - 1; - } - else - { + } else { data->spriteDataIndex2++; timer = 8; } @@ -1401,151 +1208,129 @@ BOOL ov59_PlayerShrinkAnimation(ov59_IntroOverlayData *data) struct ov59_CharStruct021D9E70 charStruct; struct ov59_CharStruct021D9E70 charStruct2; const struct ov59_CharStruct021D9E70 *addr; - if (data->selectedGender == PLAYER_GENDER_MALE) - { + if (data->selectedGender == PLAYER_GENDER_MALE) { charStruct = ov59_021D9E88; - addr = &charStruct; - } - else - { + addr = &charStruct; + } else { charStruct2 = ov59_021D9E70; - addr = &charStruct2; + addr = &charStruct2; } - if (addr->charData[data->spriteDataIndex2] == 0xFF) - { + if (addr->charData[data->spriteDataIndex2] == 0xFF) { ret = TRUE; - } - else - { + } else { GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, addr->charData[data->spriteDataIndex2], data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); } return ret; } #ifdef NONMATCHING -BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) -{ +BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) { BOOL ret = FALSE; u32 b0; u32 ac; - switch (*param1) - { - case 0: - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 0); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, -104); - SetBgPriority(GF_BG_LYR_MAIN_2, 0); - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_ON); + switch (*param1) { + case 0: + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 0); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, -104); + SetBgPriority(GF_BG_LYR_MAIN_2, 0); + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_ON); + data->unkA8 = 0; + data->unkAC = 8; + data->unkB0 = 0; + *param1 = 1; + break; + case 1: + Bg_GetXpos(data->bgConfig, GF_BG_LYR_MAIN_2); // result discarded? + fx32 pos = Bg_GetYpos(data->bgConfig, GF_BG_LYR_SUB_1); + + b0 = data->unkB0; + ac = data->unkAC; + u32 unk = b0 * (ac + ac * 8); + s32 unk2 = b0 * (b0 + b0 * 8); + + s32 unk3 = unk - unk2 / 2; // some kind of Y coordinate + + if (pos < 88) { + data->unkB0++; + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_ADD_X, 2); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_SUB_1, BG_POS_OP_ADD_X, 2); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_SUB_1, BG_POS_OP_SET_Y, unk3); + } else { + ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_OFF); + data->unkB0 = 30; + *param1 = 2; + } + break; + case 2: + if (data->unkB0 != 0) { + data->unkB0--; + } else { + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); data->unkA8 = 0; - data->unkAC = 8; + data->unkAC = 9; data->unkB0 = 0; - *param1 = 1; - break; - case 1: - Bg_GetXpos(data->bgConfig, GF_BG_LYR_MAIN_2); //result discarded? - fx32 pos = Bg_GetYpos(data->bgConfig, GF_BG_LYR_SUB_1); - - b0 = data->unkB0; - ac = data->unkAC; - u32 unk = b0 * (ac + ac * 8); - s32 unk2 = b0 * (b0 + b0 * 8); - - s32 unk3 = unk - unk2 / 2; //some kind of Y coordinate - - if (pos < 88) - { - data->unkB0++; - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_ADD_X, 2); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_SUB_1, BG_POS_OP_ADD_X, 2); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_SUB_1, BG_POS_OP_SET_Y, unk3); - } - else - { - ToggleBgLayer(GF_BG_LYR_SUB_1, GX_PLANE_TOGGLE_OFF); - data->unkB0 = 30; - *param1 = 2; - } - break; - case 2: - if (data->unkB0 != 0) - { - data->unkB0--; - } - else - { - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); - data->unkA8 = 0; - data->unkAC = 9; - data->unkB0 = 0; - *param1 = 3; - } - break; - case 3: - Bg_GetXpos(data->bgConfig, GF_BG_LYR_MAIN_2); //result discarded? - fx32 pos2 = Bg_GetYpos(data->bgConfig, GF_BG_LYR_MAIN_2); - - b0 = data->unkB0; - ac = data->unkAC; - u32 unk4 = b0 * (ac + ac * 8); - s32 unk5 = b0 * (b0 + b0 * 8); - - s32 unk6 = (unk4 - 104) - unk5 / 2; - - if (data->unkA8 > 0 && unk6 <= 0) - { - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, 0); - data->unkA8 = 0; - data->unkAC = 1; - data->unkB0 = 0; - *param1 = 4; - } - else - { - data->unkB0++; - data->unkA8 = unk6; - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_ADD_X, 1); - s32 unk7 = unk6 >> 1; - if (unk7 > 0x90) - { - unk7 = 0x90; - } - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, unk7); - } - break; - case 4: - Bg_GetXpos(data->bgConfig, GF_BG_LYR_MAIN_2); //result discarded? - fx32 pos3 = Bg_GetYpos(data->bgConfig, GF_BG_LYR_MAIN_2); + *param1 = 3; + } + break; + case 3: + Bg_GetXpos(data->bgConfig, GF_BG_LYR_MAIN_2); // result discarded? + fx32 pos2 = Bg_GetYpos(data->bgConfig, GF_BG_LYR_MAIN_2); - b0 = data->unkB0; - ac = data->unkAC; - u32 unk8 = b0 * (ac + ac * 8); - s32 unk9 = b0 * (b0 + b0 * 8); + b0 = data->unkB0; + ac = data->unkAC; + u32 unk4 = b0 * (ac + ac * 8); + s32 unk5 = b0 * (b0 + b0 * 8); - s32 unk10 = unk8 - unk9 / 2; + s32 unk6 = (unk4 - 104) - unk5 / 2; - if (data->unkA8 > 0 && unk10 <= 0) - { - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, 0); - *param1 = 5; - } - else - { - data->unkB0++; - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_ADD_X, 2); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, unk10); - data->unkA8 = unk10; - } - break; - case 5: - sub_02005578(SPECIES_MUNCHLAX); - ov59_TilemapChangePalette(data, GF_BG_LYR_MAIN_2, 8); - ret = TRUE; + if (data->unkA8 > 0 && unk6 <= 0) { + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, 0); + data->unkA8 = 0; + data->unkAC = 1; + data->unkB0 = 0; + *param1 = 4; + } else { + data->unkB0++; + data->unkA8 = unk6; + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_ADD_X, 1); + s32 unk7 = unk6 >> 1; + if (unk7 > 0x90) { + unk7 = 0x90; + } + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, unk7); + } + break; + case 4: + Bg_GetXpos(data->bgConfig, GF_BG_LYR_MAIN_2); // result discarded? + fx32 pos3 = Bg_GetYpos(data->bgConfig, GF_BG_LYR_MAIN_2); + + b0 = data->unkB0; + ac = data->unkAC; + u32 unk8 = b0 * (ac + ac * 8); + s32 unk9 = b0 * (b0 + b0 * 8); + + s32 unk10 = unk8 - unk9 / 2; + + if (data->unkA8 > 0 && unk10 <= 0) { + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, 0); + *param1 = 5; + } else { + data->unkB0++; + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_ADD_X, 2); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_Y, unk10); + data->unkA8 = unk10; + } + break; + case 5: + sub_02005578(SPECIES_MUNCHLAX); + ov59_TilemapChangePalette(data, GF_BG_LYR_MAIN_2, 8); + ret = TRUE; } return ret; } #else -asm BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) -{ - //clang-tidy off +// clang-format off +asm BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) { push {r3, r4, r5, r6, r7, lr} add r6, r1, #0 add r4, r0, #0 @@ -1843,1098 +1628,982 @@ asm BOOL ov59_MunchlaxJumpAnimation(ov59_IntroOverlayData *data, u32 *param1) pop {r3, r4, r5, r6, r7, pc} nop } +// clang-format on #endif -void ov59_ResetMunchlaxPriority(ov59_IntroOverlayData *data) -{ -#pragma unused (data) +void ov59_ResetMunchlaxPriority(ov59_IntroOverlayData *data) { +#pragma unused(data) SetBgPriority(GF_BG_LYR_MAIN_2, 1); } -BOOL ov59_MasterController(ov59_IntroOverlayData *data) -{ +BOOL ov59_MasterController(ov59_IntroOverlayData *data) { BOOL ret = FALSE; - switch (data->controllerCounter) - { - case 0: //load and fade from black - sub_0200433C(2, SEQ_OPENING, 1); - sub_02005350(SEQ_OPENING, 0); - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); - BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 1; - break; - - case 1: //wait for fade, and wait 40 ticks - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - if (ov59_Timer(data, 40) != TRUE) - { - break; - } - data->controllerCounter = 2; + switch (data->controllerCounter) { + case 0: // load and fade from black + sub_0200433C(2, SEQ_OPENING, 1); + sub_02005350(SEQ_OPENING, 0); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 1; + break; + + case 1: // wait for fade, and wait 40 ticks + if (IsPaletteFadeFinished() != TRUE) { break; + } + if (ov59_Timer(data, 40) != TRUE) { + break; + } + data->controllerCounter = 2; + break; - case 2: //Hello there! It’s so very nice to meet you! - if(ov59_DisplayMessage(data, narc_0341_00000, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 3; - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + case 2: // Hello there! It’s so very nice to meet you! + if (ov59_DisplayMessage(data, narc_0341_00000, TRUE) != TRUE) { + break; + } + data->controllerCounter = 3; + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + break; + + case 3: // play SE, make rowan visible, fade from black + sub_0200521C(SEQ_OPENING); + data->spriteDataIndex0 = 1; + data->spriteDataIndex1 = 0; + ov59_LoadCharDataFromIndex(data); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); + BeginNormalPaletteFade(3, 1, 1, RGB_BLACK, 16, 4, data->heapId); + data->controllerCounter = 4; + break; + + case 4: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + data->controllerCounter = 5; + break; - case 3: //play SE, make rowan visible, fade from black - sub_0200521C(SEQ_OPENING); - data->spriteDataIndex0 = 1; - data->spriteDataIndex1 = 0; - ov59_LoadCharDataFromIndex(data); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); - BeginNormalPaletteFade(3, 1, 1, RGB_BLACK, 16, 4, data->heapId); - data->controllerCounter = 4; + case 5: // My name is Rowan. However, everyone just calls me the Pokémon Professor. + if (ov59_DisplayMessage(data, narc_0341_00001, TRUE) != TRUE) { break; + } + data->controllerCounter = 6; + break; - case 4: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - data->controllerCounter = 5; + case 6: // move rowan to the right + if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 1) != TRUE) { break; + } + data->controllerCounter = 7; + break; - case 5: //My name is Rowan. However, everyone just calls me the Pokémon Professor. - if (ov59_DisplayMessage(data, narc_0341_00001, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 6; + case 7: // help menu input handler + if (ov59_CreateListWithText(data, 1, 1) != TRUE) { + break; + } + switch (data->listMenuInput) { + case 1: // Control Info + data->nextControllerCounter = 10; + data->controllerCounter = 8; break; - case 6: //move rowan to the right - if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 1) != TRUE) - { - break; - } - data->controllerCounter = 7; + case 2: // Adventure Info + data->nextControllerCounter = 31; + data->controllerCounter = 8; + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); break; - case 7: //help menu input handler - if (ov59_CreateListWithText(data, 1, 1) != TRUE) - { - break; - } - switch (data->listMenuInput) - { - case 1: //Control Info - data->nextControllerCounter = 10; - data->controllerCounter = 8; - break; - - case 2: //Adventure Info - data->nextControllerCounter = 31; - data->controllerCounter = 8; - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - break; - - case 3: //No Info Needed - data->controllerCounter = 41; - break; - } + case 3: // No Info Needed + data->controllerCounter = 41; break; + } + break; - case 8: //fade to black - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 9; - break; + case 8: // fade to black + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 9; + break; - case 9: //wait for fade and clear screen of rowan - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); - data->controllerCounter = data->nextControllerCounter; + case 9: // wait for fade and clear screen of rowan + if (IsPaletteFadeFinished() != TRUE) { break; - - case 10: //load screen and palette data, fade from black - data->scrnDataIndexMain = 1; - ov59_LoadMainScrnData(data); - data->scrnDataIndexSub = 1; - ov59_LoadSubScrnData(data); - BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 11; + } + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); + data->controllerCounter = data->nextControllerCounter; + break; + + case 10: // load screen and palette data, fade from black + data->scrnDataIndexMain = 1; + ov59_LoadMainScrnData(data); + data->scrnDataIndexSub = 1; + ov59_LoadSubScrnData(data); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 11; + break; + + case 11: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + data->controllerCounter = 12; + break; - case 11: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - data->controllerCounter = 12; + case 12: // Moves the main character. Also used to choose various headings and selections. + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00002, 0, 3, 18) != TRUE) { break; + } + data->controllerCounter = 13; + break; - case 12: //Moves the main character. Also used to choose various headings and selections. - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00002, 0, 3, 18) != TRUE) - { - break; - } - data->controllerCounter = 13; - break; + case 13: // load screen data + data->scrnDataIndexMain = 2; + ov59_LoadMainScrnData(data); + data->controllerCounter = 14; + break; - case 13: //load screen data - data->scrnDataIndexMain = 2; - ov59_LoadMainScrnData(data); - data->controllerCounter = 14; + case 14: // Press to open the menu. Press to use an item, + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00003, 0, 7, 12) != TRUE) { break; + } + data->controllerCounter = 15; + break; - case 14: //Press to open the menu. Press to use an item, - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00003, 0, 7, 12) != TRUE) - { - break; - } - data->controllerCounter = 15; - break; + case 15: // load screen data + data->scrnDataIndexMain = 3; + ov59_LoadMainScrnData(data); + data->controllerCounter = 16; + break; - case 15: //load screen data - data->scrnDataIndexMain = 3; - ov59_LoadMainScrnData(data); - data->controllerCounter = 16; - break; - - case 16: //The lower screen is called the Touch Screen. - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00004, 0, 4, 12) != TRUE) - { - break; - } - data->controllerCounter = 17; + case 16: // The lower screen is called the Touch Screen. + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00004, 0, 4, 12) != TRUE) { break; + } + data->controllerCounter = 17; + break; - case 17: //Use DisplayMessage to create the flashing touchscreen icon ({YESNO 0}) - if (ov59_DisplayMessage(data, narc_0341_00006, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 18; + case 17: // Use DisplayMessage to create the flashing touchscreen icon ({YESNO 0}) + if (ov59_DisplayMessage(data, narc_0341_00006, TRUE) != TRUE) { break; + } + data->controllerCounter = 18; + break; - case 18: //If this mark is shown in the message window - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00005, 0, 4, 10) != TRUE) - { - break; - } - data->controllerCounter = 19; - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + case 18: // If this mark is shown in the message window + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00005, 0, 4, 10) != TRUE) { break; + } + data->controllerCounter = 19; + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + break; - case 19: //toggle layer 0 (no idea whats in here) - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); - data->controllerCounter = 20; - break; + case 19: // toggle layer 0 (no idea whats in here) + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + data->controllerCounter = 20; + break; - case 20: //Do you understand everything so far?{YESNO 0} - if (ov59_DisplayMessage(data, narc_0341_00007, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 21; + case 20: // Do you understand everything so far?{YESNO 0} + if (ov59_DisplayMessage(data, narc_0341_00007, TRUE) != TRUE) { break; + } + data->controllerCounter = 21; + break; - case 21: //Display Yes/No touchscreen buttons + case 21: // Display Yes/No touchscreen buttons #ifdef __MWERKS__ - u32 arr[5]; //todo - this is 100% a struct - arr = ov59_021D9E44; + u32 arr[5]; // todo - this is 100% a struct + arr = ov59_021D9E44; #else - u32 arr[5] = {}; - for (int i = 0; i < 5; i++) - { - arr[i] = ov59_021D9E44[i]; - } + u32 arr[5] = {}; + for (int i = 0; i < 5; i++) { + arr[i] = ov59_021D9E44[i]; + } #endif - arr[0] = (u32)data->bgConfig; - sub_020145C8(data->unk68, arr); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_ON); - data->scrnDataIndexSub = 3; - ov59_LoadSubScrnData(data); - data->controllerCounter = 22; - break; - - case 22: //check input - if (gSystem.newKeys != 0) - { - data->controllerCounter = 27; - break; - } - else - { - if ((sub_02014630(data->unk68) - 3) > 1) - { - break; - } - data->controllerCounter = 23; - break; - } + arr[0] = (u32)data->bgConfig; + sub_020145C8(data->unk68, arr); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_ON); + data->scrnDataIndexSub = 3; + ov59_LoadSubScrnData(data); + data->controllerCounter = 22; + break; - case 23: //check whether yes or no - switch (sub_02014630(data->unk68)) - { - case 1: - data->controllerCounter = 24; - break; - - case 2: - data->controllerCounter = 26; - break; - } + case 22: // check input + if (gSystem.newKeys != 0) { + data->controllerCounter = 27; break; - - case 24: //cleanup control info and fade to black - if (ov59_FadeController(data, GF_BG_LYR_SUB_2, 1) != TRUE) - { + } else { + if ((sub_02014630(data->unk68) - 3) > 1) { break; } - sub_020146C4(data->unk68); - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 25; + data->controllerCounter = 23; break; + } - case 25: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - data->controllerCounter = 28; + case 23: // check whether yes or no + switch (sub_02014630(data->unk68)) { + case 1: + data->controllerCounter = 24; break; - case 26: //reload initial screen data for help - if (ov59_FadeController(data, GF_BG_LYR_SUB_2, 1) != TRUE) - { - break; - } - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - sub_020146C4(data->unk68); - data->scrnDataIndexMain = 1; - ov59_LoadMainScrnData(data); - data->scrnDataIndexSub = 1; - ov59_LoadSubScrnData(data); - data->controllerCounter = 12; + case 2: + data->controllerCounter = 26; break; + } + break; - case 27: //Please touch a button on the Touch Screen below.{YESNO 0} - if (ov59_DisplayMessage(data, narc_0341_00008, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 22; + case 24: // cleanup control info and fade to black + if (ov59_FadeController(data, GF_BG_LYR_SUB_2, 1) != TRUE) { break; + } + sub_020146C4(data->unk68); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 25; + break; - case 28: //redisplay rowan, fade from black - data->scrnDataIndexMain = 0; - ov59_LoadMainScrnData(data); - data->scrnDataIndexSub = 0; - ov59_LoadSubScrnData(data); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); - BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 29; + case 25: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + data->controllerCounter = 28; + break; - case 29: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - data->controllerCounter = 30; + case 26: // reload initial screen data for help + if (ov59_FadeController(data, GF_BG_LYR_SUB_2, 1) != TRUE) { break; - - case 30: //Would you like to know more about anything else? - if (ov59_DisplayMessage(data, narc_0341_00009, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 6; + } + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + sub_020146C4(data->unk68); + data->scrnDataIndexMain = 1; + ov59_LoadMainScrnData(data); + data->scrnDataIndexSub = 1; + ov59_LoadSubScrnData(data); + data->controllerCounter = 12; + break; + + case 27: // Please touch a button on the Touch Screen below.{YESNO 0} + if (ov59_DisplayMessage(data, narc_0341_00008, TRUE) != TRUE) { break; - - case 31: //load screen data, fade from black - data->scrnDataIndexMain = 4; - ov59_LoadMainScrnData(data); - data->scrnDataIndexSub = 2; - ov59_LoadSubScrnData(data); - BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 32; + } + data->controllerCounter = 22; + break; + + case 28: // redisplay rowan, fade from black + data->scrnDataIndexMain = 0; + ov59_LoadMainScrnData(data); + data->scrnDataIndexSub = 0; + ov59_LoadSubScrnData(data); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 29; + break; + + case 29: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + data->controllerCounter = 30; + break; - case 32: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - data->controllerCounter = 33; + case 30: // Would you like to know more about anything else? + if (ov59_DisplayMessage(data, narc_0341_00009, TRUE) != TRUE) { break; + } + data->controllerCounter = 6; + break; - case 33: //You are about to enter a world where you will embark on a grand... - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00010, 1, 9, 6) != TRUE) - { - break; - } - data->controllerCounter = 34; - break; + case 31: // load screen data, fade from black + data->scrnDataIndexMain = 4; + ov59_LoadMainScrnData(data); + data->scrnDataIndexSub = 2; + ov59_LoadSubScrnData(data); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 32; + break; - case 34: //Speak to people and check things wherever you go, be it in towns, roads, or caves. - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00011, 1, 8, 8) != TRUE) - { - break; - } - data->controllerCounter = 35; + case 32: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + data->controllerCounter = 33; + break; - case 35: //New paths will open to you when you help people in need... - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00012, 1, 9, 6) != TRUE) - { - break; - } - data->controllerCounter = 36; + case 33: // You are about to enter a world where you will embark on a grand... + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00010, 1, 9, 6) != TRUE) { break; + } + data->controllerCounter = 34; + break; - case 36: //At times, you will be challenged by others to a battle. At other times, wild creatures may stand in your way. - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00013, 1, 5, 14) != TRUE) - { - break; - } - data->controllerCounter = 37; + case 34: // Speak to people and check things wherever you go, be it in towns, roads, or caves. + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00011, 1, 8, 8) != TRUE) { break; + } + data->controllerCounter = 35; + break; - case 37: //However, your adventure is not solely about becoming powerful. - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00014, 1, 10, 4) != TRUE) - { - break; - } - data->controllerCounter = 38; + case 35: // New paths will open to you when you help people in need... + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00012, 1, 9, 6) != TRUE) { break; + } + data->controllerCounter = 36; + break; - case 38: //On your travels, we hope that you will meet countless people and, through them, achieve personal growth. - if (ov59_DisplayControlAdventureMessage(data, narc_0341_00015, 1, 6, 12) != TRUE) - { - break; - } - data->controllerCounter = 39; + case 36: // At times, you will be challenged by others to a battle. At other times, wild creatures may stand in your way. + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00013, 1, 5, 14) != TRUE) { break; + } + data->controllerCounter = 37; + break; - case 39: //fade to black - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 40; + case 37: // However, your adventure is not solely about becoming powerful. + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00014, 1, 10, 4) != TRUE) { break; + } + data->controllerCounter = 38; + break; - case 40: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); - data->controllerCounter = 28; + case 38: // On your travels, we hope that you will meet countless people and, through them, achieve personal growth. + if (ov59_DisplayControlAdventureMessage(data, narc_0341_00015, 1, 6, 12) != TRUE) { break; + } + data->controllerCounter = 39; + break; - case 41: - if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 2) != TRUE) - { - break; - } - data->controllerCounter = 42; - break; + case 39: // fade to black + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 40; + break; - case 42: //This world is widely inhabited by creatures known as Pokémon. - if (ov59_DisplayMessage(data, narc_0341_00016, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 43; + case 40: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + data->controllerCounter = 28; + break; - case 43: //fade to black - BeginNormalPaletteFade(4, 0, 0, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 44; + case 41: + if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 2) != TRUE) { break; + } + data->controllerCounter = 42; + break; - case 44: //wait for fade, display pokeball button, fade from black - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - ov59_LoadPokeballButton(data); - data->scrnDataIndexSub = 4; - ov59_LoadSubScrnData(data); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_ON); - BeginNormalPaletteFade(4, 1, 1, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 45; + case 42: // This world is widely inhabited by creatures known as Pokémon. + if (ov59_DisplayMessage(data, narc_0341_00016, TRUE) != TRUE) { break; + } + data->controllerCounter = 43; + break; - case 45: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - data->controllerCounter = 46; + case 43: // fade to black + BeginNormalPaletteFade(4, 0, 0, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 44; + break; + + case 44: // wait for fade, display pokeball button, fade from black + if (IsPaletteFadeFinished() != TRUE) { break; + } + ov59_LoadPokeballButton(data); + data->scrnDataIndexSub = 4; + ov59_LoadSubScrnData(data); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_ON); + BeginNormalPaletteFade(4, 1, 1, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 45; + break; - case 46:// Here, I have a Poké Ball. Touch the button on the middle - if (ov59_DisplayMessage(data, narc_0341_00017, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 47; + case 45: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + data->controllerCounter = 46; + break; - case 47: //test touch location - if (ov59_TestPokeballTouchLocation() == TRUE) - { - data->spriteDataIndex2 = 0; - data->spriteData2Timer = 0; - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - data->controllerCounter = 48; - } - else - { - if (gSystem.newKeys == 0) - { - break; - } - data->controllerCounter = 49; - } + case 46: // Here, I have a Poké Ball. Touch the button on the middle + if (ov59_DisplayMessage(data, narc_0341_00017, TRUE) != TRUE) { break; + } + data->controllerCounter = 47; + break; - case 48: //load graphics - if (data->spriteData2Timer != 0) - { - data->spriteData2Timer--; + case 47: // test touch location + if (ov59_TestPokeballTouchLocation() == TRUE) { + data->spriteDataIndex2 = 0; + data->spriteData2Timer = 0; + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + data->controllerCounter = 48; + } else { + if (gSystem.newKeys == 0) { break; } + data->controllerCounter = 49; + } + break; + + case 48: // load graphics + if (data->spriteData2Timer != 0) { + data->spriteData2Timer--; + break; + } #ifdef __MWERKS__ - u32 arr2[3]; //todo - this is 100% a struct - arr2 = ov59_021D9DC0; + u32 arr2[3]; // todo - this is 100% a struct + arr2 = ov59_021D9DC0; #else - u32 arr2[3] = {}; - for (int i = 0; i < 3; i++) - { - arr2[i] = ov59_021D9DC0[i]; - } + u32 arr2[3] = {}; + for (int i = 0; i < 3; i++) { + arr2[i] = ov59_021D9DC0[i]; + } #endif - if (arr2[data->spriteDataIndex2] == 0xFFFF) - { - PlaySE(SEQ_SE_DP_BOWA2); - data->controllerCounter = 50; - } - else - { - GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, arr2[data->spriteDataIndex2], data->bgConfig, GF_BG_LYR_SUB_2, 32, 0, FALSE, data->heapId); - data->spriteDataIndex2++; - data->spriteData2Timer = 4; - } - break; + if (arr2[data->spriteDataIndex2] == 0xFFFF) { + PlaySE(SEQ_SE_DP_BOWA2); + data->controllerCounter = 50; + } else { + GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO, arr2[data->spriteDataIndex2], data->bgConfig, GF_BG_LYR_SUB_2, 32, 0, FALSE, data->heapId); + data->spriteDataIndex2++; + data->spriteData2Timer = 4; + } + break; - case 49: //No, no! Not that button! The button on the Poké Ball.{YESNO 0} - if (ov59_DisplayMessage(data, narc_0341_00018, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 47; + case 49: // No, no! Not that button! The button on the Poké Ball.{YESNO 0} + if (ov59_DisplayMessage(data, narc_0341_00018, TRUE) != TRUE) { break; + } + data->controllerCounter = 47; + break; - case 50: //flash - StartBrightnessTransition(1, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); //main screen - StartBrightnessTransition(1, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); //sub screen - data->controllerCounter = 51; - break; + case 50: // flash + StartBrightnessTransition(1, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); // main screen + StartBrightnessTransition(1, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); // sub screen + data->controllerCounter = 51; + break; - case 51: //unflash - if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) - { - break; - } - StartBrightnessTransition(1, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); //main screen - StartBrightnessTransition(1, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); //sub screen - data->controllerCounter = 52; + case 51: // unflash + if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) { break; + } + StartBrightnessTransition(1, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); // main screen + StartBrightnessTransition(1, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); // sub screen + data->controllerCounter = 52; + break; - case 52: //flash - if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) - { - break; - } - StartBrightnessTransition(4, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); //main screen - StartBrightnessTransition(4, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); //sub screen - data->controllerCounter = 53; + case 52: // flash + if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) { break; + } + StartBrightnessTransition(4, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); // main screen + StartBrightnessTransition(4, 16, 0, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); // sub screen + data->controllerCounter = 53; + break; - case 53: //wait for transition - if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) - { - break; - } - data->controllerCounter = 54; + case 53: // wait for transition + if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) { break; - - case 54: //spawn munchlax and unflash - ov59_DrawMunchlax(data); - ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_OFF); - data->spriteDataIndex2 = 0; - ov59_MunchlaxJumpAnimation(data, &data->spriteDataIndex2); - data->scrnDataIndexSub = 0; - ov59_LoadSubScrnData(data); - StartBrightnessTransition(16, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); //main screen - StartBrightnessTransition(16, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); //sub screen - data->controllerCounter = 55; - break; - - case 55: //movement and wait for transition - ov59_MunchlaxJumpAnimation(data, &data->spriteDataIndex2); - if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) - { - break; - } - data->controllerCounter = 56; + } + data->controllerCounter = 54; + break; + + case 54: // spawn munchlax and unflash + ov59_DrawMunchlax(data); + ToggleBgLayer(GF_BG_LYR_SUB_2, GX_PLANE_TOGGLE_OFF); + data->spriteDataIndex2 = 0; + ov59_MunchlaxJumpAnimation(data, &data->spriteDataIndex2); + data->scrnDataIndexSub = 0; + ov59_LoadSubScrnData(data); + StartBrightnessTransition(16, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_MAIN); // main screen + StartBrightnessTransition(16, 0, 16, (GXBlendPlaneMask)(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_BG3), SCREEN_MASK_SUB); // sub screen + data->controllerCounter = 55; + break; + + case 55: // movement and wait for transition + ov59_MunchlaxJumpAnimation(data, &data->spriteDataIndex2); + if (IsBrightnessTransitionActive(SCREEN_MASK_MAIN) != TRUE || IsBrightnessTransitionActive(SCREEN_MASK_SUB) != TRUE) { break; + } + data->controllerCounter = 56; + break; - case 56: //finish movement - if (ov59_MunchlaxJumpAnimation(data, &data->spriteDataIndex2) != TRUE) - { - break; - } - data->controllerCounter = 57; + case 56: // finish movement + if (ov59_MunchlaxJumpAnimation(data, &data->spriteDataIndex2) != TRUE) { break; + } + data->controllerCounter = 57; + break; - case 57: //wait - if (ov59_Timer(data, 40) != TRUE) - { - break; - } - data->controllerCounter = 58; + case 57: // wait + if (ov59_Timer(data, 40) != TRUE) { break; + } + data->controllerCounter = 58; + break; - case 58: // We humans live alongside Pokémon as friends. At times we play together, - if (ov59_DisplayMessage(data, narc_0341_00019, TRUE) != TRUE) - { - break; - } - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - data->controllerCounter = 59; + case 58: // We humans live alongside Pokémon as friends. At times we play together, + if (ov59_DisplayMessage(data, narc_0341_00019, TRUE) != TRUE) { break; + } + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + data->controllerCounter = 59; + break; - case 59: //bring rowan to front - if (ov59_FadeController(data, GF_BG_LYR_MAIN_2, 1) != TRUE) - { - break; - } - ov59_ResetMunchlaxPriority(data); - data->controllerCounter = 60; + case 59: // bring rowan to front + if (ov59_FadeController(data, GF_BG_LYR_MAIN_2, 1) != TRUE) { break; + } + ov59_ResetMunchlaxPriority(data); + data->controllerCounter = 60; + break; - case 60: //wait - if (ov59_Timer(data, 30) != TRUE) - { - break; - } - data->controllerCounter = 61; + case 60: // wait + if (ov59_Timer(data, 30) != TRUE) { break; + } + data->controllerCounter = 61; + break; - case 61: //Now, why don’t you tell me a little bit about yourself? - if (ov59_DisplayMessage(data, narc_0341_00020, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 62; + case 61: // Now, why don’t you tell me a little bit about yourself? + if (ov59_DisplayMessage(data, narc_0341_00020, TRUE) != TRUE) { break; + } + data->controllerCounter = 62; + break; - case 62: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) - { - break; - } - data->controllerCounter = 63; + case 62: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) { break; - - case 63: //load and setup boy/girl frontsprites - ov59_ResetPlayerAnimation(data); - data->spriteDataIndex0 = 2; - data->spriteDataIndex1 = 6; - ov59_LoadCharDataFromIndex(data); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, -48); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 48); - data->controllerCounter = 64; + } + data->controllerCounter = 63; + break; + + case 63: // load and setup boy/girl frontsprites + ov59_ResetPlayerAnimation(data); + data->spriteDataIndex0 = 2; + data->spriteDataIndex1 = 6; + ov59_LoadCharDataFromIndex(data); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, -48); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 48); + data->controllerCounter = 64; + break; + + case 64: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) { break; + } + data->controllerCounter = 65; + break; - case 64: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) - { - break; - } - data->controllerCounter = 65; + case 65: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_2, 0) != TRUE) { break; + } + data->controllerCounter = 66; + break; - case 65: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_2, 0) != TRUE) - { - break; - } - data->controllerCounter = 66; + case 66: // Are you a boy? Or are you a girl? + if (ov59_DisplayMessage(data, narc_0341_00021, TRUE) != TRUE) { break; + } + data->selectedGender = PLAYER_GENDER_MALE; + data->controllerCounter = 67; + break; - case 66: //Are you a boy? Or are you a girl? - if (ov59_DisplayMessage(data, narc_0341_00021, TRUE) != TRUE) - { - break; - } - data->selectedGender = PLAYER_GENDER_MALE; - data->controllerCounter = 67; - break; - - case 67: //handle gender selection + animation - if ((gSystem.newKeys & PAD_BUTTON_A) == 1) - { - data->alphaBlend1 = 6; - data->alphaBlend2 = 10; - data->fadeCounter = 2; - if (data->selectedGender == PLAYER_GENDER_MALE) - { - data->controllerCounter = 68; - } - else - { - data->controllerCounter = 70; - } - break; + case 67: // handle gender selection + animation + if ((gSystem.newKeys & PAD_BUTTON_A) == 1) { + data->alphaBlend1 = 6; + data->alphaBlend2 = 10; + data->fadeCounter = 2; + if (data->selectedGender == PLAYER_GENDER_MALE) { + data->controllerCounter = 68; + } else { + data->controllerCounter = 70; } - if ((gSystem.newKeys & PAD_KEY_LEFT) == 0x20 || (gSystem.newKeys & PAD_KEY_RIGHT) == 0x10) - { - data->selectedGender = (data->selectedGender == PLAYER_GENDER_MALE ? PLAYER_GENDER_FEMALE : PLAYER_GENDER_MALE); - PlaySE(SEQ_SE_DP_SELECT); - } - ov59_AnimatePlayerSprite(data); //animate sprite break; + } + if ((gSystem.newKeys & PAD_KEY_LEFT) == 0x20 || (gSystem.newKeys & PAD_KEY_RIGHT) == 0x10) { + data->selectedGender = (data->selectedGender == PLAYER_GENDER_MALE ? PLAYER_GENDER_FEMALE : PLAYER_GENDER_MALE); + PlaySE(SEQ_SE_DP_SELECT); + } + ov59_AnimatePlayerSprite(data); // animate sprite + break; - case 68: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_2, 1) != TRUE) - { - break; - } - data->controllerCounter = 69; + case 68: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_2, 1) != TRUE) { break; + } + data->controllerCounter = 69; + break; - case 69: //move sprite to centre - if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 0) != TRUE) - { - break; - } - ov59_DisableBlend(data); - data->controllerCounter = 72; + case 69: // move sprite to centre + if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 0) != TRUE) { break; + } + ov59_DisableBlend(data); + data->controllerCounter = 72; + break; - case 70: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) - { - break; - } - data->controllerCounter = 71; + case 70: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) { break; + } + data->controllerCounter = 71; + break; - case 71: //move sprite to centre - if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_2, 0) != TRUE) - { - break; - } - ov59_DisableBlend(data); - data->controllerCounter = 72; + case 71: // move sprite to centre + if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_2, 0) != TRUE) { break; + } + ov59_DisableBlend(data); + data->controllerCounter = 72; + break; - case 72: //All right, so you’re a boy/girl? - u32 msgNo = data->selectedGender == PLAYER_GENDER_MALE ? narc_0341_00022 : narc_0341_00023; - if (ov59_DisplayMessage(data, msgNo, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 73; + case 72: // All right, so you’re a boy/girl? + u32 msgNo = data->selectedGender == PLAYER_GENDER_MALE ? narc_0341_00022 : narc_0341_00023; + if (ov59_DisplayMessage(data, msgNo, TRUE) != TRUE) { break; + } + data->controllerCounter = 73; + break; - case 73: //YES/NO - if (ov59_CreateListWithText(data, 0, 0) != TRUE) - { - break; - } - switch (data->listMenuInput) - { - case 1: - data->controllerCounter = 75; - break; - - case -2: - case 2: - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - data->controllerCounter = 74; - break; - } + case 73: // YES/NO + if (ov59_CreateListWithText(data, 0, 0) != TRUE) { break; - - case 74: //reset blend - enum GFBgLayer layer = ((data->selectedGender == PLAYER_GENDER_MALE) ? GF_BG_LYR_MAIN_1 : GF_BG_LYR_MAIN_2); - if (ov59_FadeController(data, layer, 1) != TRUE) - { - break; - } - data->controllerCounter = 63; + } + switch (data->listMenuInput) { + case 1: + data->controllerCounter = 75; break; - case 75: //Tell me, what is your name? - if (ov59_DisplayMessage(data, narc_0341_00024, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 76; + case -2: + case 2: + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + data->controllerCounter = 74; break; + } + break; - case 76: //load keyboard overlay (except this is not an overlay at all) - data->playerStruct->gender = data->selectedGender; - data->loadedOverlay = OverlayManager_New(&UNK_020FA5FC, (s32 *)data->playerStruct, data->heapId); - data->controllerCounter = 77; + case 74: // reset blend + enum GFBgLayer layer = ((data->selectedGender == PLAYER_GENDER_MALE) ? GF_BG_LYR_MAIN_1 : GF_BG_LYR_MAIN_2); + if (ov59_FadeController(data, layer, 1) != TRUE) { break; + } + data->controllerCounter = 63; + break; - case 77: //toggle bg layers and position, fade from black - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); - if (data->selectedGender == PLAYER_GENDER_MALE) - { - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); - } - else - { - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 0); - } - BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 78; + case 75: // Tell me, what is your name? + if (ov59_DisplayMessage(data, narc_0341_00024, TRUE) != TRUE) { break; + } + data->controllerCounter = 76; + break; + + case 76: // load keyboard overlay (except this is not an overlay at all) + data->playerStruct->gender = data->selectedGender; + data->loadedOverlay = OverlayManager_New(&UNK_020FA5FC, (s32 *)data->playerStruct, data->heapId); + data->controllerCounter = 77; + break; + + case 77: // toggle bg layers and position, fade from black + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); + if (data->selectedGender == PLAYER_GENDER_MALE) { + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); + } else { + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2, BG_POS_OP_SET_X, 0); + } + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 78; + break; - case 78: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - data->controllerCounter = 79; + case 78: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + data->controllerCounter = 79; + break; - case 79: //Your name is {STRVAR_1 3, 0}? - u32 messageNumber = (data->selectedGender == PLAYER_GENDER_MALE ? narc_0341_00025 : narc_0341_00026); //no idea why these are different strings, they contain the same thing - if (ov59_DisplayMessage(data, messageNumber, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 80; + case 79: // Your name is {STRVAR_1 3, 0}? + // no idea why these are different strings, they contain the same thing + u32 messageNumber = (data->selectedGender == PLAYER_GENDER_MALE ? narc_0341_00025 : narc_0341_00026); + if (ov59_DisplayMessage(data, messageNumber, TRUE) != TRUE) { break; + } + data->controllerCounter = 80; + break; - case 80: //YES/NO - if (ov59_CreateListWithText(data, 0, 0) != TRUE) - { - break; - } - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - switch (data->listMenuInput) - { - case 1: - data->nextControllerCounter = 82; - data->controllerCounter = 81; - break; - - case -2: - case 2: - String_SetEmpty(data->playerStruct->name); - data->nextControllerCounter = 63; - data->controllerCounter = 81; - break; - } + case 80: // YES/NO + if (ov59_CreateListWithText(data, 0, 0) != TRUE) { break; - - case 81: //blend adjust - enum GFBgLayer layer2 = ((data->selectedGender == PLAYER_GENDER_MALE) ? GF_BG_LYR_MAIN_1 : GF_BG_LYR_MAIN_2); - if (ov59_FadeController(data, layer2, 1) != TRUE) - { - break; - } - data->controllerCounter = data->nextControllerCounter; + } + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + switch (data->listMenuInput) { + case 1: + data->nextControllerCounter = 82; + data->controllerCounter = 81; break; - case 82: //load sprite - data->spriteDataIndex0 = 1; - data->spriteDataIndex1 = 0; - ov59_LoadCharDataFromIndex(data); - data->controllerCounter = 83; + case -2: + case 2: + String_SetEmpty(data->playerStruct->name); + data->nextControllerCounter = 63; + data->controllerCounter = 81; break; + } + break; - case 83: //blend adjust - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) - { - break; - } - data->controllerCounter = 84; + case 81: // blend adjust + enum GFBgLayer layer2 = ((data->selectedGender == PLAYER_GENDER_MALE) ? GF_BG_LYR_MAIN_1 : GF_BG_LYR_MAIN_2); + if (ov59_FadeController(data, layer2, 1) != TRUE) { break; + } + data->controllerCounter = data->nextControllerCounter; + break; - case 84: // OK... So, you’re {STRVAR_1 3, 0}? A fine name that is! - if (ov59_DisplayMessage(data, narc_0341_00027, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 85; - break; + case 82: // load sprite + data->spriteDataIndex0 = 1; + data->spriteDataIndex1 = 0; + ov59_LoadCharDataFromIndex(data); + data->controllerCounter = 83; + break; - case 85: //blend adjust - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) - { - break; - } - data->controllerCounter = 86; + case 83: // blend adjust + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) { break; + } + data->controllerCounter = 84; + break; - case 86: - data->spriteDataIndex0 = 10; - data->spriteDataIndex1 = 0; - ov59_LoadCharDataFromIndex(data); - data->controllerCounter = 87; + case 84: // OK... So, you’re {STRVAR_1 3, 0}? A fine name that is! + if (ov59_DisplayMessage(data, narc_0341_00027, TRUE) != TRUE) { break; + } + data->controllerCounter = 85; + break; - case 87: //blend adjust - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) - { - break; - } - data->controllerCounter = 88; + case 85: // blend adjust + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) { break; + } + data->controllerCounter = 86; + break; - case 88: //What might his name be? - if (ov59_DisplayMessage(data, narc_0341_00028, TRUE) != TRUE) - { - break; - } - data->controllerCounter = 89; - break; + case 86: + data->spriteDataIndex0 = 10; + data->spriteDataIndex1 = 0; + ov59_LoadCharDataFromIndex(data); + data->controllerCounter = 87; + break; - case 89: //move sprite - if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 1) != TRUE) - { - break; - } - data->controllerCounter = 90; + case 87: // blend adjust + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) { break; + } + data->controllerCounter = 88; + break; - case 90: //rival name list - if (ov59_CreateListWithText(data, 2, 1) != TRUE) - { - break; - } - const struct ov59_ListStruct021D9E0C *nameList; - switch (data->listMenuInput) - { - case 0: - break; - - case 1: //New Name! - data->controllerCounter = 92; - break; - - case 2: //Barry/Clint - case 3: //Damion/Ralph - case 4: //Tyson/Lewis - case 5: //Markus/Tommy - u32 index; - u32 msgNo; - if ((u8)gGameVersion == VERSION_DIAMOND) - { - index = data->listMenuInput - 1; - nameList = ov59_021D9F40; - msgNo = nameList[index].msgNo; - } - else - { - index = data->listMenuInput - 1; - nameList = ov59_021D9F68; - msgNo = nameList[index].msgNo; - } - struct String *name = NewString_ReadMsgData(data->msgData, msgNo); - StringCopy(data->rivalStruct->name, name); - String_Delete(name); - data->controllerCounter = 91; - break; - } + case 88: // What might his name be? + if (ov59_DisplayMessage(data, narc_0341_00028, TRUE) != TRUE) { break; + } + data->controllerCounter = 89; + break; - case 91: //move sprite - if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 2) != TRUE) - { - break; - } - data->controllerCounter = 95; + case 89: // move sprite + if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 1) != TRUE) { break; + } + data->controllerCounter = 90; + break; - case 92: //load keyboard - data->loadedOverlay = OverlayManager_New(&UNK_020FA5FC, (s32 *)data->rivalStruct, data->heapId); - data->controllerCounter = 93; + case 90: // rival name list + if (ov59_CreateListWithText(data, 2, 1) != TRUE) { break; - - case 93: //toggle layers and position, fade from black - ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); - ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); - BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); - BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); - data->controllerCounter = 94; + } + const struct ov59_ListStruct021D9E0C *nameList; + switch (data->listMenuInput) { + case 0: break; - case 94: //wait for fade - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - data->controllerCounter = 95; + case 1: // New Name! + data->controllerCounter = 92; break; - case 95: //{STRVAR_1 3, 1}, is it? That’s your friend’s name? - if (ov59_DisplayMessage(data, narc_0341_00029, TRUE) != TRUE) - { - break; + case 2: // Barry/Clint + case 3: // Damion/Ralph + case 4: // Tyson/Lewis + case 5: // Markus/Tommy + u32 index; + u32 msgNo; + if ((u8)gGameVersion == VERSION_DIAMOND) { + index = data->listMenuInput - 1; + nameList = ov59_021D9F40; + msgNo = nameList[index].msgNo; + } else { + index = data->listMenuInput - 1; + nameList = ov59_021D9F68; + msgNo = nameList[index].msgNo; } - data->controllerCounter = 96; + struct String *name = NewString_ReadMsgData(data->msgData, msgNo); + StringCopy(data->rivalStruct->name, name); + String_Delete(name); + data->controllerCounter = 91; break; + } + break; - case 96: //YES/NO - if (ov59_CreateListWithText(data, 0, 0) != TRUE) - { - break; - } - switch (data->listMenuInput) - { - case 1: - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - data->controllerCounter = 97; - break; - - case -2: - case 2: - String_SetEmpty(data->rivalStruct->name); - data->controllerCounter = 88; - break; - } + case 91: // move sprite + if (ov59_MoveSprite(data, GF_BG_LYR_MAIN_1, 2) != TRUE) { break; - - case 97: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) - { - break; - } - data->controllerCounter = 98; + } + data->controllerCounter = 95; + break; + + case 92: // load keyboard + data->loadedOverlay = OverlayManager_New(&UNK_020FA5FC, (s32 *)data->rivalStruct, data->heapId); + data->controllerCounter = 93; + break; + + case 93: // toggle layers and position, fade from black + ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_SUB_3, GX_PLANE_TOGGLE_ON); + ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_ON); + BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_X, 0); + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); + data->controllerCounter = 94; + break; + + case 94: // wait for fade + if (IsPaletteFadeFinished() != TRUE) { break; + } + data->controllerCounter = 95; + break; - case 98: //load sprite - data->spriteDataIndex0 = 1; - data->spriteDataIndex1 = 0; - ov59_LoadCharDataFromIndex(data); - data->controllerCounter = 99; + case 95: //{STRVAR_1 3, 1}, is it? That’s your friend’s name? + if (ov59_DisplayMessage(data, narc_0341_00029, TRUE) != TRUE) { break; + } + data->controllerCounter = 96; + break; - case 99: //send blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) - { - break; - } - data->controllerCounter = 100; + case 96: // YES/NO + if (ov59_CreateListWithText(data, 0, 0) != TRUE) { + break; + } + switch (data->listMenuInput) { + case 1: + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + data->controllerCounter = 97; break; - case 100: //wait - if (ov59_Timer(data, 30) != TRUE) - { - break; - } - data->controllerCounter = 101; + case -2: + case 2: + String_SetEmpty(data->rivalStruct->name); + data->controllerCounter = 88; break; + } + break; - case 101: //All right, {STRVAR_1 3, 0}, the time has come. Your very own tale of grand... - if (ov59_DisplayMessage(data, narc_0341_00030, TRUE) != TRUE) - { - break; - } - GF_SndStartFadeOutBGM(0, 50); //fade music - data->controllerCounter = 102; + case 97: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) { break; + } + data->controllerCounter = 98; + break; - case 102: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) - { - break; - } - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); - data->controllerCounter = 103; + case 98: // load sprite + data->spriteDataIndex0 = 1; + data->spriteDataIndex1 = 0; + ov59_LoadCharDataFromIndex(data); + data->controllerCounter = 99; + break; + + case 99: // send blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) { break; + } + data->controllerCounter = 100; + break; - case 103: //wait - if (ov59_Timer(data, 30) != TRUE) - { - break; - } - data->controllerCounter = 104; + case 100: // wait + if (ov59_Timer(data, 30) != TRUE) { break; + } + data->controllerCounter = 101; + break; - case 104: //load sprite - if (data->selectedGender == PLAYER_GENDER_MALE) - { - data->spriteDataIndex0 = 2; - data->spriteDataIndex1 = 0; - ov59_LoadCharDataFromIndex(data); - } - else - { - data->spriteDataIndex0 = 6; - data->spriteDataIndex1 = 0; - ov59_LoadCharDataFromIndex(data); - } - data->controllerCounter = 105; + case 101: // All right, {STRVAR_1 3, 0}, the time has come. Your very own tale of grand... + if (ov59_DisplayMessage(data, narc_0341_00030, TRUE) != TRUE) { break; + } + GF_SndStartFadeOutBGM(0, 50); // fade music + data->controllerCounter = 102; + break; - case 105: //set blend - if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) - { - break; - } - ov59_ResetPlayerShrinkAnimation(data); - data->controllerCounter = 106; + case 102: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 1) != TRUE) { break; + } + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_0); + data->controllerCounter = 103; + break; - case 106: //wait - if (ov59_Timer(data, 30) != TRUE) - { - break; - } - data->controllerCounter = 107; + case 103: // wait + if (ov59_Timer(data, 30) != TRUE) { break; + } + data->controllerCounter = 104; + break; - case 107: //shrink player sprite - if (ov59_PlayerShrinkAnimation(data) != TRUE) - { - break; - } - data->controllerCounter = 108; + case 104: // load sprite + if (data->selectedGender == PLAYER_GENDER_MALE) { + data->spriteDataIndex0 = 2; + data->spriteDataIndex1 = 0; + ov59_LoadCharDataFromIndex(data); + } else { + data->spriteDataIndex0 = 6; + data->spriteDataIndex1 = 0; + ov59_LoadCharDataFromIndex(data); + } + data->controllerCounter = 105; + break; + + case 105: // set blend + if (ov59_FadeController(data, GF_BG_LYR_MAIN_1, 0) != TRUE) { break; + } + ov59_ResetPlayerShrinkAnimation(data); + data->controllerCounter = 106; + break; - case 108: //load overaly 59 TV - data->loadedOverlay = OverlayManager_New(&ov59_021D9DDC, 0, data->heapId); - data->controllerCounter = 109; + case 106: // wait + if (ov59_Timer(data, 30) != TRUE) { break; + } + data->controllerCounter = 107; + break; - case 109: //return - ret = TRUE; + case 107: // shrink player sprite + if (ov59_PlayerShrinkAnimation(data) != TRUE) { break; + } + data->controllerCounter = 108; + break; + + case 108: // load overaly 59 TV + data->loadedOverlay = OverlayManager_New(&ov59_021D9DDC, 0, data->heapId); + data->controllerCounter = 109; + break; + + case 109: // return + ret = TRUE; + break; } return ret; } diff --git a/arm9/overlays/59/src/ov59_TV.c b/arm9/overlays/59/src/ov59_TV.c index bb278ec59..3d95ace4c 100644 --- a/arm9/overlays/59/src/ov59_TV.c +++ b/arm9/overlays/59/src/ov59_TV.c @@ -1,17 +1,21 @@ -#include "global.h" #include "ov59_TV.h" -#include "gf_gfx_planes.h" -#include "PAD_pad.h" + +#include "global.h" + #include "constants/rgb.h" #include "constants/sndseq.h" + #include "demo/intro/intro_tv.naix" +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0549.h" + +#include "PAD_pad.h" #include "filesystem.h" #include "font.h" #include "game_init.h" #include "gf_gfx_loader.h" +#include "gf_gfx_planes.h" #include "heap.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0549.h" #include "overlay_manager.h" #include "text.h" #include "unk_020040F4.h" @@ -21,271 +25,253 @@ extern void sub_0200E3A0(PMLCDTarget, s32); extern void BeginNormalPaletteFade(u32 pattern, u32 typeTop, u32 typeBottom, u16 colour, u32 duration, u32 framesPer, HeapID heapId); extern BOOL IsPaletteFadeFinished(void); -const struct WindowTemplate ov59_021DA04C = - { - .bgId = GF_BG_LYR_MAIN_2, - .left = 0, - .top = 0, - .width = 32, - .height = 24, - .palette = 1, - .baseTile = 1, - }; - -const struct GraphicsModes ov59_021DA054 = - { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, - ._2d3dMode = GX_BG0_AS_2D, - }; - -const struct BgTemplate ov59_021DA080 = - { - .x = 0, - .y = 0, - .bufferSize = 2048, - .baseTile = 0, - - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, - .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x18000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE - }; - -const struct BgTemplate ov59_021DA09C = - { - .x = 0, - .y = 0, - .bufferSize = 2048, - .baseTile = 0, - - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, - .screenBase = GX_BG_SCRBASE_0x0800, - .charBase = GX_BG_CHARBASE_0x14000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE - }; - -const struct BgTemplate ov59_021DA064 = - { - .x = 0, - .y = 0, - .bufferSize = 2048, - .baseTile = 0, - - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, - .screenBase = GX_BG_SCRBASE_0x1000, - .charBase = GX_BG_CHARBASE_0x10000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE - }; - -const struct BgTemplate ov59_021DA0B8 = - { - .x = 0, - .y = 0, - .bufferSize = 2048, - .baseTile = 0, - - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_256, - .screenBase = GX_BG_SCRBASE_0x1800, - .charBase = GX_BG_CHARBASE_0x20000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE - }; - -const struct GraphicsBanks ov59_021DA0D4 = - { - .bg = GX_VRAM_BG_256_AB, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_NONE, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_NONE, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_NONE, - .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_NONE, - .texpltt = GX_VRAM_TEXPLTT_NONE - }; - -BOOL ov59_TVInit(struct OverlayManager *overlayManager, u32 *status) -{ +const struct WindowTemplate ov59_021DA04C = { + .bgId = GF_BG_LYR_MAIN_2, + .left = 0, + .top = 0, + .width = 32, + .height = 24, + .palette = 1, + .baseTile = 1, +}; + +const struct GraphicsModes ov59_021DA054 = { + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, + ._2d3dMode = GX_BG0_AS_2D, +}; + +const struct BgTemplate ov59_021DA080 = { + .x = 0, + .y = 0, + .bufferSize = 2048, + .baseTile = 0, + + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, + .screenBase = GX_BG_SCRBASE_0x0000, + .charBase = GX_BG_CHARBASE_0x18000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE +}; + +const struct BgTemplate ov59_021DA09C = { + .x = 0, + .y = 0, + .bufferSize = 2048, + .baseTile = 0, + + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, + .screenBase = GX_BG_SCRBASE_0x0800, + .charBase = GX_BG_CHARBASE_0x14000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE +}; + +const struct BgTemplate ov59_021DA064 = { + .x = 0, + .y = 0, + .bufferSize = 2048, + .baseTile = 0, + + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, + .screenBase = GX_BG_SCRBASE_0x1000, + .charBase = GX_BG_CHARBASE_0x10000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE +}; + +const struct BgTemplate ov59_021DA0B8 = { + .x = 0, + .y = 0, + .bufferSize = 2048, + .baseTile = 0, + + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_256, + .screenBase = GX_BG_SCRBASE_0x1800, + .charBase = GX_BG_CHARBASE_0x20000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE +}; + +const struct GraphicsBanks ov59_021DA0D4 = { + .bg = GX_VRAM_BG_256_AB, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_NONE, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_NONE, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_NONE, + .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, + .tex = GX_VRAM_TEX_NONE, + .texpltt = GX_VRAM_TEXPLTT_NONE +}; + +BOOL ov59_TVInit(struct OverlayManager *overlayManager, u32 *status) { #pragma unused(status) CreateHeap(3, HEAP_ID_INTRO_TV, 0x40000); ov59_TVOverlayData *data = (ov59_TVOverlayData *)OverlayManager_CreateAndGetData(overlayManager, sizeof(ov59_TVOverlayData), HEAP_ID_INTRO_TV); memset((void *)data, 0, sizeof(ov59_TVOverlayData)); data->heapId = HEAP_ID_INTRO_TV; - data->unk24 = 0; + data->unk24 = 0; return TRUE; } -BOOL ov59_TVMain(struct OverlayManager *overlayManager, u32 *status) -{ +BOOL ov59_TVMain(struct OverlayManager *overlayManager, u32 *status) { ov59_TVOverlayData *data = (ov59_TVOverlayData *)OverlayManager_GetData(overlayManager); - BOOL ret = FALSE; + BOOL ret = FALSE; + + switch (*status) { + case 0: + sub_0200E3A0(PM_LCD_TOP, 0); + sub_0200E3A0(PM_LCD_BOTTOM, 0); - switch (*status) - { - case 0: - sub_0200E3A0(PM_LCD_TOP, 0); - sub_0200E3A0(PM_LCD_BOTTOM, 0); + Main_SetVBlankIntrCB(NULL, NULL); + Main_SetHBlankIntrCB(NULL, NULL); - Main_SetVBlankIntrCB(NULL, NULL); - Main_SetHBlankIntrCB(NULL, NULL); + GfGfx_DisableEngineAPlanes(); + GfGfx_DisableEngineBPlanes(); - GfGfx_DisableEngineAPlanes(); - GfGfx_DisableEngineBPlanes(); + GX_SetVisiblePlane(0); + GXS_SetVisiblePlane(0); - GX_SetVisiblePlane(0); - GXS_SetVisiblePlane(0); + SetKeyRepeatTimers(4, 8); - SetKeyRepeatTimers(4, 8); + ov59_TVSetupGraphics(data); + ov59_TVSetupMsg(data); - ov59_TVSetupGraphics(data); - ov59_TVSetupMsg(data); + Main_SetVBlankIntrCB((void (*)(void *))ov59_TVDoGpuBgUpdate, data); - Main_SetVBlankIntrCB((void (*)(void *))ov59_TVDoGpuBgUpdate, data); + GfGfx_BothDispOn(); - GfGfx_BothDispOn(); + data->unk24 = 60; - data->unk24 = 60; + *status = 1; + break; - *status = 1; + case 1: + if (data->unk24 != 0) { + data->unk24--; break; + } - case 1: - if (data->unk24 != 0) - { - data->unk24--; - break; - } + sub_0200414C(SEQ_TV_HOUSOU); + sub_0200433C(4, SEQ_TV_HOUSOU, 1); - sub_0200414C(SEQ_TV_HOUSOU); - sub_0200433C(4, SEQ_TV_HOUSOU, 1); + data->unk24 = 90; - data->unk24 = 90; + *status = 2; + break; - *status = 2; + case 2: + if (data->unk24 != 0) { + data->unk24--; break; + } + data->unk24 = 0; //?? - case 2: - if (data->unk24 != 0) - { - data->unk24--; - break; - } - data->unk24 = 0; //?? + BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); - BeginNormalPaletteFade(0, 1, 1, RGB_BLACK, 6, 1, data->heapId); + *status = 3; + break; - *status = 3; + case 3: + ov59_021D9D78(data); + + if (IsPaletteFadeFinished() != TRUE) { break; + } - case 3: - ov59_021D9D78(data); + *status = 4; + break; - if (IsPaletteFadeFinished() != TRUE) - { - break; - } + case 4: + ov59_021D9D78(data); - *status = 4; + if (ov59_021D9C74(data, narc_0549_00000, 40, 48) != TRUE) { break; + } - case 4: - ov59_021D9D78(data); + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); - if (ov59_021D9C74(data, narc_0549_00000, 40, 48) != TRUE) - { - break; - } + *status = 5; + break; - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, data->heapId); + case 5: + ov59_021D9D78(data); - *status = 5; + if (IsPaletteFadeFinished() != TRUE) { break; + } - case 5: - ov59_021D9D78(data); - - if (IsPaletteFadeFinished() != TRUE) - { - break; - } - - ov59_TVDestroyMsg(data); - ov59_TVDestroyGraphics(data); + ov59_TVDestroyMsg(data); + ov59_TVDestroyGraphics(data); - Main_SetVBlankIntrCB(NULL, NULL); + Main_SetVBlankIntrCB(NULL, NULL); - ret = TRUE; - break; + ret = TRUE; + break; } return ret; } -BOOL ov59_TVExit(struct OverlayManager *overlayManager, u32 *status) -{ -#pragma unused (status) +BOOL ov59_TVExit(struct OverlayManager *overlayManager, u32 *status) { +#pragma unused(status) HeapID heapId = ((ov59_TVOverlayData *)OverlayManager_GetData(overlayManager))->heapId; OverlayManager_FreeData(overlayManager); DestroyHeap(heapId); return TRUE; } -void ov59_TVDoGpuBgUpdate(ov59_TVOverlayData *data) -{ +void ov59_TVDoGpuBgUpdate(ov59_TVOverlayData *data) { DoScheduledBgGpuUpdates(data->bgConfig); } -void ov59_TVSetupGraphics(ov59_TVOverlayData *data) -{ - const struct GraphicsBanks banks = ov59_021DA0D4; //sp #0x90 +void ov59_TVSetupGraphics(ov59_TVOverlayData *data) { + const struct GraphicsBanks banks = ov59_021DA0D4; // sp #0x90 GfGfx_SetBanks(&banks); data->bgConfig = BgConfig_Alloc(data->heapId); - const struct GraphicsModes modes = ov59_021DA054; //sp #0x80 + const struct GraphicsModes modes = ov59_021DA054; // sp #0x80 SetBothScreensModesAndDisable(&modes); - const struct BgTemplate bgTemplateMain2 = ov59_021DA080; //sp #0x64 + const struct BgTemplate bgTemplateMain2 = ov59_021DA080; // sp #0x64 InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_2, &bgTemplateMain2, GF_BG_TYPE_TEXT); BG_ClearCharDataRange(GF_BG_LYR_MAIN_2, 0x20, 0, data->heapId); BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2); - const struct BgTemplate bgTemplateMain0 = ov59_021DA09C; //sp #0x48 + const struct BgTemplate bgTemplateMain0 = ov59_021DA09C; // sp #0x48 InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_0, &bgTemplateMain0, GF_BG_TYPE_TEXT); GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0001_NCGR, data->bgConfig, GF_BG_LYR_MAIN_0, 0, 0, FALSE, data->heapId); GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0004_NSCR, data->bgConfig, GF_BG_LYR_MAIN_0, 0, 0, FALSE, data->heapId); - const struct BgTemplate bgTemplateMain1 = ov59_021DA064; //sp #0x2C + const struct BgTemplate bgTemplateMain1 = ov59_021DA064; // sp #0x2C InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_1, &bgTemplateMain1, GF_BG_TYPE_TEXT); GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0002_NCGR, data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); GfGfxLoader_LoadScrnData(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0005_NSCR, data->bgConfig, GF_BG_LYR_MAIN_1, 0, 0, FALSE, data->heapId); - const struct BgTemplate bgTemplateMain3 = ov59_021DA0B8; //sp #0x10 + const struct BgTemplate bgTemplateMain3 = ov59_021DA0B8; // sp #0x10 InitBgFromTemplate(data->bgConfig, GF_BG_LYR_MAIN_3, &bgTemplateMain3, GF_BG_TYPE_TEXT); GfGfxLoader_LoadCharData(NARC_DEMO_INTRO_INTRO_TV, NARC_intro_tv_narc_0000_NCGR, data->bgConfig, GF_BG_LYR_MAIN_3, 0, 0, FALSE, data->heapId); @@ -301,8 +287,7 @@ void ov59_TVSetupGraphics(ov59_TVOverlayData *data) G2_SetBlendAlpha(GX_BLEND_PLANEMASK_BG1, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2), 4, 12); } -void ov59_TVDestroyGraphics(ov59_TVOverlayData *data) -{ +void ov59_TVDestroyGraphics(ov59_TVOverlayData *data) { ToggleBgLayer(GF_BG_LYR_MAIN_0, GX_PLANE_TOGGLE_OFF); ToggleBgLayer(GF_BG_LYR_MAIN_1, GX_PLANE_TOGGLE_OFF); ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); @@ -321,8 +306,7 @@ void ov59_TVDestroyGraphics(ov59_TVOverlayData *data) FreeToHeap(data->bgConfig); } -void ov59_TVSetupMsg(ov59_TVOverlayData *data) -{ +void ov59_TVSetupMsg(ov59_TVOverlayData *data) { data->msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0549_bin, data->heapId); ResetAllTextPrinters(); @@ -330,62 +314,56 @@ void ov59_TVSetupMsg(ov59_TVOverlayData *data) data->unk0C = 0; } -void ov59_TVDestroyMsg(ov59_TVOverlayData *data) -{ +void ov59_TVDestroyMsg(ov59_TVOverlayData *data) { DestroyMsgData(data->msgData); } -BOOL ov59_021D9C74(ov59_TVOverlayData *data, u32 msgNo, u32 param2, u32 param3) -{ +BOOL ov59_021D9C74(ov59_TVOverlayData *data, u32 msgNo, u32 param2, u32 param3) { BOOL ret = FALSE; - switch (data->unk0C) - { - case 0: - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); - struct String *string = String_New(1024, data->heapId); - ReadMsgDataIntoString(data->msgData, msgNo, string); - AddWindow(data->bgConfig, &data->window, &ov59_021DA04C); - FillWindowPixelRect(&data->window, 0, 0, 0, 256, 192); - u32 width = FontID_String_GetWidthMultiline(0, string, 0); - - width = (256 - width) / 2; - AddTextPrinterParameterized2(&data->window, 0, string, width, param3, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(15, 2, 0), NULL); - String_Delete(string); - CopyWindowToVram(&data->window); - ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); - data->unk24 = 240; - data->unk0C = 1; - break; - - case 1: - if (data->unk24 != 0) - { - data->unk24--; - break; - } - data->unk0C = 2; - break; - - case 2: - if((gSystem.newKeys & PAD_BUTTON_A) != 1 && (gSystem.newKeys & PAD_BUTTON_B) != 2) - { - break; - } - data->unk0C = 3; + switch (data->unk0C) { + case 0: + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_OFF); + struct String *string = String_New(1024, data->heapId); + ReadMsgDataIntoString(data->msgData, msgNo, string); + AddWindow(data->bgConfig, &data->window, &ov59_021DA04C); + FillWindowPixelRect(&data->window, 0, 0, 0, 256, 192); + u32 width = FontID_String_GetWidthMultiline(0, string, 0); + + width = (256 - width) / 2; + AddTextPrinterParameterized2(&data->window, 0, string, width, param3, TEXT_SPEED_INSTANT, MAKE_TEXT_COLOR(15, 2, 0), NULL); + String_Delete(string); + CopyWindowToVram(&data->window); + ToggleBgLayer(GF_BG_LYR_MAIN_2, GX_PLANE_TOGGLE_ON); + data->unk24 = 240; + data->unk0C = 1; + break; + + case 1: + if (data->unk24 != 0) { + data->unk24--; break; + } + data->unk0C = 2; + break; - case 3: - RemoveWindow(&data->window); - BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2); - data->unk0C = 0; - ret = TRUE; + case 2: + if ((gSystem.newKeys & PAD_BUTTON_A) != 1 && (gSystem.newKeys & PAD_BUTTON_B) != 2) { break; + } + data->unk0C = 3; + break; + + case 3: + RemoveWindow(&data->window); + BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_MAIN_2); + data->unk0C = 0; + ret = TRUE; + break; } return ret; } -void ov59_021D9D78(ov59_TVOverlayData *data) -{ +void ov59_021D9D78(ov59_TVOverlayData *data) { data->unk20 += 4; BgSetPosTextAndCommit(data->bgConfig, GF_BG_LYR_MAIN_1, BG_POS_OP_SET_Y, data->unk20 >> 4); } diff --git a/arm9/overlays/62/src/overlay_62_sinit.c b/arm9/overlays/62/src/overlay_62_sinit.c index 1f24fc610..0ea463d37 100644 --- a/arm9/overlays/62/src/overlay_62_sinit.c +++ b/arm9/overlays/62/src/overlay_62_sinit.c @@ -1,11 +1,11 @@ #include "global.h" -#include "poke_overlay.h" + #include "FS_overlay.h" +#include "poke_overlay.h" FS_EXTERN_OVERLAY(OVERLAY_08); -static void ov62_0222D5C0(void) -{ +static void ov62_0222D5C0(void) { HandleLoadOverlay(FS_OVERLAY_ID(OVERLAY_08), 2); } diff --git a/arm9/overlays/63/include/ov63_021DB450.h b/arm9/overlays/63/include/ov63_021DB450.h index 1ee984796..fc8a665c8 100644 --- a/arm9/overlays/63/include/ov63_021DB450.h +++ b/arm9/overlays/63/include/ov63_021DB450.h @@ -2,19 +2,20 @@ #define POKEDIAMOND_ov63_021DB450_H #include "global.h" + #include "unk_02006D98.h" -typedef struct UnkStruct63_021DB450 //intro base struct type +typedef struct UnkStruct63_021DB450 // intro base struct type { - struct UnkStruct_02006D98 * field_00; //oddly requires this to be set to progress past copyright/pokemon screen. - struct UnkStruct_02006D98_2 * field_04[3]; //mon animations? + struct UnkStruct_02006D98 *field_00; // oddly requires this to be set to progress past copyright/pokemon screen. + struct UnkStruct_02006D98_2 *field_04[3]; // mon animations? u32 field_10; - void * field_14; - void * field_18; + void *field_14; + void *field_18; u8 field_1C; u8 field_1D; u8 padding_1E[2]; - u32 ** field_20; + u32 **field_20; u32 field_24; u32 field_28; u32 field_2C; @@ -22,16 +23,12 @@ typedef struct UnkStruct63_021DB450 //intro base struct type u8 filler_34[0x30]; } UnkStruct63_021DB450; - - -typedef struct UnkStruct63_021DBEF0 -{ +typedef struct UnkStruct63_021DBEF0 { u32 field_00; u32 field_04; } UnkStruct63_021DBEF0; -typedef struct UnkStruct63_021DBED8 -{ +typedef struct UnkStruct63_021DBED8 { BOOL (*unk_00)(struct UnkStruct63_021DB450 *, u32); BOOL (*unk_04)(struct UnkStruct63_021DB450 *, u32); } UnkStruct63_021DBED8; @@ -39,7 +36,7 @@ typedef struct UnkStruct63_021DBED8 u32 ov63_021DB450(u32 param0, u32 param1); u32 ov63_021DB474(u32 param0, u32 param1); u32 ov63_021DB498(void); -void Title_SetupMonAnimationSprites(struct UnkStruct63_021DB450 * arg0); +void Title_SetupMonAnimationSprites(struct UnkStruct63_021DB450 *arg0); void ov63_021DB580(UnkStruct63_021DB450 *param0); void ov63_021DB598(UnkStruct63_021DB450 *param0); void ov63_021DB5A8(UnkStruct63_021DB450 *param0); @@ -51,6 +48,6 @@ BOOL ov63_021DB838(UnkStruct63_021DB450 *param0, u32 param1); BOOL ov63_021DB884(UnkStruct63_021DB450 *param0, u32 param1); BOOL ov63_021DB8E8(UnkStruct63_021DB450 *param0, u32 param1); void ov63_021DB934(void); -void ov63_021DB940(struct UnkStruct63_021DB450 * a0); +void ov63_021DB940(struct UnkStruct63_021DB450 *a0); -#endif //POKEDIAMOND_ov63_021DB450_H +#endif // POKEDIAMOND_ov63_021DB450_H diff --git a/arm9/overlays/63/src/ov63_021DB450.c b/arm9/overlays/63/src/ov63_021DB450.c index a067f5030..48262eb8a 100644 --- a/arm9/overlays/63/src/ov63_021DB450.c +++ b/arm9/overlays/63/src/ov63_021DB450.c @@ -1,29 +1,31 @@ +#include "ov63_021DB450.h" + #include "global.h" -#include "camera.h" -#include "heap.h" + #include "constants/species.h" + +#include "camera.h" #include "gx.h" -#include "ov63_021DB450.h" +#include "heap.h" #include "unk_02006D98.h" -//todo resolve to static code +// todo resolve to static code extern u32 (*NNS_GfdDefaultFuncAllocTexVram)(u32 param0, u32 param1, u32 param2); extern u32 (*NNS_GfdDefaultFuncAllocPlttVram)(u32 param0, u32 param1, u32 param2); extern void sub_0201327C(u32 param0); extern void sub_020132BC(u32 param0); -extern void * sub_02012CDC(void *, void *, void *, u32, u32, HeapID); +extern void *sub_02012CDC(void *, void *, void *, u32, u32, HeapID); -extern void sub_02068C00(struct UnkStruct_02006D98_4*, u16, u32, u32, u32, u32, u32); +extern void sub_02068C00(struct UnkStruct_02006D98_4 *, u16, u32, u32, u32, u32, u32); extern void sub_02012CC8(void); -extern struct Camera * sub_0201343C(void); +extern struct Camera *sub_0201343C(void); extern void sub_02013194(void *, u32, u32, u32); extern u32 sub_0201318C(u32, u32, HeapID); extern void sub_02012DE4(void *); - extern void sub_020222AC(void); extern void NNS_G2dSetupSoftwareSpriteCamera(void); extern void sub_020222B4(u32, u32); @@ -32,44 +34,40 @@ extern void sub_02013440(void *, u32); extern void sub_020133AC(void *, u32, const void *, struct UnkStruct_02006D98_2 *); extern BOOL sub_020133C8(void *); - extern void sub_02013364(void); extern void sub_02013388(void); -struct UnkStruct_02006D98_2 * sub_0201341C(struct UnkStruct63_021DB450 *); +struct UnkStruct_02006D98_2 *sub_0201341C(struct UnkStruct63_021DB450 *); -const s32 ov63_021DBEC0[3] = {0x703, 0x7CE, 0x8A8}; +const s32 ov63_021DBEC0[3] = { 0x703, 0x7CE, 0x8A8 }; const struct UnkStruct63_021DBEF0 ov63_021DBEF0[3]; -u32 ov63_021DB450(u32 param0, u32 param1) -{ +u32 ov63_021DB450(u32 param0, u32 param1) { u32 res0 = (NNS_GfdDefaultFuncAllocTexVram)(param0, param1, 0); sub_0201327C(res0); GF_ASSERT(res0); return (u32)((u16)res0 * 8); } -u32 ov63_021DB474(u32 param0, u32 param1) -{ +u32 ov63_021DB474(u32 param0, u32 param1) { u32 res0 = (NNS_GfdDefaultFuncAllocPlttVram)(param0, param1, 1); GF_ASSERT(res0); sub_020132BC(res0); return (u32)((u16)res0 * 8); } -u32 ov63_021DB498(void) -{ +u32 ov63_021DB498(void) { return 32; } -void Title_SetupMonAnimationSprites(struct UnkStruct63_021DB450 * arg0) //TODO: this does a lot more than setup anim sprites +void Title_SetupMonAnimationSprites(struct UnkStruct63_021DB450 *arg0) // TODO: this does a lot more than setup anim sprites { struct UnkStruct_02006D98_4 sp1C; - int introMonArray[3] = {SPECIES_TURTWIG, SPECIES_CHIMCHAR, SPECIES_PIPLUP}; + int introMonArray[3] = { SPECIES_TURTWIG, SPECIES_CHIMCHAR, SPECIES_PIPLUP }; - arg0->field_00 = sub_02006D98(HEAP_ID_76); //this is needed to get into the world view, otherwise it is just black + arg0->field_00 = sub_02006D98(HEAP_ID_76); // this is needed to get into the world view, otherwise it is just black - for (u8 i = 0; i < 3; i++) //some kind of animation assignment TODO: investigate further + for (u8 i = 0; i < 3; i++) // some kind of animation assignment TODO: investigate further { sub_02068C00(&sp1C, (u16)introMonArray[i], 0, 2, 0, 0, 0); arg0->field_04[i] = sub_020073A0(arg0->field_00, &sp1C, ov63_021DBEF0[i].field_00, ov63_021DBEF0[i].field_04, 0x3FF, i, 0, 0); @@ -84,26 +82,21 @@ void Title_SetupMonAnimationSprites(struct UnkStruct63_021DB450 * arg0) //TODO: sub_02013194(arg0->field_18, sub_0201318C(0x3D, 4, HEAP_ID_76), 10, 1); } -void ov63_021DB580(UnkStruct63_021DB450 *param0) -{ +void ov63_021DB580(UnkStruct63_021DB450 *param0) { sub_02012DE4(param0->field_18); FreeToHeap(param0->field_14); sub_020072E8(param0->field_00); } -void ov63_021DB598(UnkStruct63_021DB450 *param0) -{ - if (param0 == NULL) - { +void ov63_021DB598(UnkStruct63_021DB450 *param0) { + if (param0 == NULL) { return; } sub_020081C4(param0->field_00); } -void ov63_021DB5A8(UnkStruct63_021DB450 *param0) -{ - if (param0 == NULL) - { +void ov63_021DB5A8(UnkStruct63_021DB450 *param0) { + if (param0 == NULL) { return; } sub_020222AC(); @@ -114,86 +107,79 @@ void ov63_021DB5A8(UnkStruct63_021DB450 *param0) } const struct UnkStruct63_021DBED8 ov63_021DBED8[3] = { - {ov63_021DB720, ov63_021DB784}, - {ov63_021DB7D0, ov63_021DB838}, - {ov63_021DB884, ov63_021DB8E8} + { ov63_021DB720, ov63_021DB784 }, + { ov63_021DB7D0, ov63_021DB838 }, + { ov63_021DB884, ov63_021DB8E8 } }; const struct UnkStruct63_021DBEF0 ov63_021DBEF0[3] = { - {0x080, 0xC0}, - {0x100, 0xC0}, - {0x050, 0xC0} + { 0x080, 0xC0 }, + { 0x100, 0xC0 }, + { 0x050, 0xC0 } }; -const struct UnkStruct63_021DBEF0 ov63_021DBF08[3] = { //no idea if this is the right type - {4, 5}, - {2, 3}, - {0, 1} +const struct UnkStruct63_021DBEF0 ov63_021DBF08[3] = { + // no idea if this is the right type + { 4, 5 }, + { 2, 3 }, + { 0, 1 } }; -BOOL ov63_021DB5CC(UnkStruct63_021DB450 *param0, u32 param1, s32 param2) -{ - u8 * state = ¶m0->field_1C; - switch(*state) - { - case 0: - G2_SetWndOutsidePlane(GX_WND_PLANEMASK_OBJ | GX_WND_PLANEMASK_BG0, TRUE); - sub_02007558(param0->field_04[param1], 12, 0x400); - sub_02007558(param0->field_04[param1], 13, 0x400); - sub_02007558(param0->field_04[param1], 6, 0); +BOOL ov63_021DB5CC(UnkStruct63_021DB450 *param0, u32 param1, s32 param2) { + u8 *state = ¶m0->field_1C; + switch (*state) { + case 0: + G2_SetWndOutsidePlane(GX_WND_PLANEMASK_OBJ | GX_WND_PLANEMASK_BG0, TRUE); + sub_02007558(param0->field_04[param1], 12, 0x400); + sub_02007558(param0->field_04[param1], 13, 0x400); + sub_02007558(param0->field_04[param1], 6, 0); + (*state)++; + // fallthrough + case 1: + if (ov63_021DBED8[param1].unk_00(param0, param1)) { + param0->field_1D = 0; (*state)++; - // fallthrough - case 1: - if (ov63_021DBED8[param1].unk_00(param0, param1)) - { - param0->field_1D = 0; - (*state)++; - } - break; - case 2: - sub_02013440(param0->field_18, 1); - sub_020133AC(param0->field_18, ov63_021DBF08[param1].field_00, ov63_021DB940, param0->field_04[param1]); - sub_020133AC(param0->field_18, ov63_021DBF08[param1].field_04, ov63_021DB940, param0->field_04[param1]); + } + break; + case 2: + sub_02013440(param0->field_18, 1); + sub_020133AC(param0->field_18, ov63_021DBF08[param1].field_00, ov63_021DB940, param0->field_04[param1]); + sub_020133AC(param0->field_18, ov63_021DBF08[param1].field_04, ov63_021DB940, param0->field_04[param1]); + (*state)++; + break; + case 3: + if (!sub_020133C8(param0->field_18) && param2 >= ov63_021DBEC0[param1]) { + G2_SetWndOutsidePlane(GX_WND_PLANEMASK_OBJ, TRUE); (*state)++; - break; - case 3: - if (!sub_020133C8(param0->field_18) && param2 >= ov63_021DBEC0[param1]) - { - G2_SetWndOutsidePlane(GX_WND_PLANEMASK_OBJ, TRUE); - (*state)++; - } - break; - case 4: - if (ov63_021DBED8[param1].unk_04(param0, param1)) - { - sub_02007558(param0->field_04[param1], 6, 1); - param0->field_1D = 0; - (*state)++; - } - break; - case 5: - param0->field_1D++; - if (param0->field_1D >= 20) - { - param0->field_1D = 0; - *state = 0; - return TRUE; - } - break; + } + break; + case 4: + if (ov63_021DBED8[param1].unk_04(param0, param1)) { + sub_02007558(param0->field_04[param1], 6, 1); + param0->field_1D = 0; + (*state)++; + } + break; + case 5: + param0->field_1D++; + if (param0->field_1D >= 20) { + param0->field_1D = 0; + *state = 0; + return TRUE; + } + break; } return FALSE; } -BOOL ov63_021DB720(UnkStruct63_021DB450 *param0, u32 param1) -{ +BOOL ov63_021DB720(UnkStruct63_021DB450 *param0, u32 param1) { struct UnkStruct_02006D98_2 *field = param0->field_04[param1]; sub_020079E0(field, 0x0, 0x6); sub_020079E0(field, 0x1, -0x10); sub_020079E0(field, 0xC, -0x80); sub_020079E0(field, 0xD, -0x80); param0->field_1D++; - if (param0->field_1D >= 6) - { + if (param0->field_1D >= 6) { sub_02007558(field, 0xC, 0x100); sub_02007558(field, 0xD, 0x100); return TRUE; @@ -201,14 +187,12 @@ BOOL ov63_021DB720(UnkStruct63_021DB450 *param0, u32 param1) return FALSE; } -BOOL ov63_021DB784(UnkStruct63_021DB450 *param0, u32 param1) -{ +BOOL ov63_021DB784(UnkStruct63_021DB450 *param0, u32 param1) { struct UnkStruct_02006D98_2 *field = param0->field_04[param1]; sub_020079E0(field, 0x0, -0x3); sub_020079E0(field, 0x1, -0x12); param0->field_1D++; - if (param0->field_1D >= 6) - { + if (param0->field_1D >= 6) { sub_02007558(field, 0xC, 0x100); sub_02007558(field, 0xD, 0x100); return TRUE; @@ -216,16 +200,14 @@ BOOL ov63_021DB784(UnkStruct63_021DB450 *param0, u32 param1) return FALSE; } -BOOL ov63_021DB7D0(UnkStruct63_021DB450 *param0, u32 param1) -{ +BOOL ov63_021DB7D0(UnkStruct63_021DB450 *param0, u32 param1) { struct UnkStruct_02006D98_2 *field = param0->field_04[param1]; sub_020079E0(field, 0x0, -0x10); sub_020079E0(field, 0x1, -0x10); sub_020079E0(field, 0xC, -0x80); sub_020079E0(field, 0xD, -0x80); param0->field_1D++; - if (param0->field_1D >= 6) - { + if (param0->field_1D >= 6) { sub_02007558(field, 0xC, 0x100); sub_02007558(field, 0xD, 0x100); return TRUE; @@ -233,14 +215,12 @@ BOOL ov63_021DB7D0(UnkStruct63_021DB450 *param0, u32 param1) return FALSE; } -BOOL ov63_021DB838(UnkStruct63_021DB450 *param0, u32 param1) -{ +BOOL ov63_021DB838(UnkStruct63_021DB450 *param0, u32 param1) { struct UnkStruct_02006D98_2 *field = param0->field_04[param1]; sub_020079E0(field, 0, -0x6); sub_020079E0(field, 1, -0x10); param0->field_1D++; - if (param0->field_1D >= 6) - { + if (param0->field_1D >= 6) { sub_02007558(field, 0xC, 0x100); sub_02007558(field, 0xD, 0x100); return TRUE; @@ -248,16 +228,14 @@ BOOL ov63_021DB838(UnkStruct63_021DB450 *param0, u32 param1) return FALSE; } -BOOL ov63_021DB884(UnkStruct63_021DB450 *param0, u32 param1) -{ +BOOL ov63_021DB884(UnkStruct63_021DB450 *param0, u32 param1) { struct UnkStruct_02006D98_2 *field = param0->field_04[param1]; sub_020079E0(field, 0, 0x8); sub_020079E0(field, 1, -0x10); sub_020079E0(field, 0xC, -0x80); sub_020079E0(field, 0xD, -0x80); param0->field_1D++; - if (param0->field_1D >= 6) - { + if (param0->field_1D >= 6) { sub_02007558(field, 0xC, 0x100); sub_02007558(field, 0xD, 0x100); return TRUE; @@ -265,14 +243,12 @@ BOOL ov63_021DB884(UnkStruct63_021DB450 *param0, u32 param1) return FALSE; } -BOOL ov63_021DB8E8(UnkStruct63_021DB450 *param0, u32 param1) -{ +BOOL ov63_021DB8E8(UnkStruct63_021DB450 *param0, u32 param1) { struct UnkStruct_02006D98_2 *field = param0->field_04[param1]; sub_020079E0(field, 0, 0x6); sub_020079E0(field, 1, -0x14); param0->field_1D++; - if (param0->field_1D >= 6) - { + if (param0->field_1D >= 6) { sub_02007558(field, 0xC, 0x100); sub_02007558(field, 0xD, 0x100); return TRUE; @@ -280,20 +256,18 @@ BOOL ov63_021DB8E8(UnkStruct63_021DB450 *param0, u32 param1) return FALSE; } -void ov63_021DB934(void) -{ +void ov63_021DB934(void) { sub_02013364(); sub_02013388(); } -void ov63_021DB940(struct UnkStruct63_021DB450 * a0) -{ - struct UnkStruct_02006D98_2 * r4 = sub_0201341C(a0); - int sp0[3] = {0, 0, 0}; - sp0[0] = (sub_0200782C(r4, 0) - 0x80) * 0xAC; - sp0[1] = (sub_0200782C(r4, 1) - 0x60) * 0xAC; - sp0[2] = 0x40; - a0->field_28 = sp0[0] + (*a0->field_20)[1]; - a0->field_2C = sp0[1] + (*a0->field_20)[2]; - a0->field_30 = sp0[2] + (*a0->field_20)[3]; +void ov63_021DB940(struct UnkStruct63_021DB450 *a0) { + struct UnkStruct_02006D98_2 *r4 = sub_0201341C(a0); + int sp0[3] = { 0, 0, 0 }; + sp0[0] = (sub_0200782C(r4, 0) - 0x80) * 0xAC; + sp0[1] = (sub_0200782C(r4, 1) - 0x60) * 0xAC; + sp0[2] = 0x40; + a0->field_28 = sp0[0] + (*a0->field_20)[1]; + a0->field_2C = sp0[1] + (*a0->field_20)[2]; + a0->field_30 = sp0[2] + (*a0->field_20)[3]; } diff --git a/arm9/src/ascii_util.c b/arm9/src/ascii_util.c index 54e7fdbd2..55a4d7951 100644 --- a/arm9/src/ascii_util.c +++ b/arm9/src/ascii_util.c @@ -1,6 +1,7 @@ -#include "global.h" #include "ascii_util.h" +#include "global.h" + s32 Ascii_StrLen(const s8 *str) { s32 i = 0; while (str[i] != 0) { @@ -28,7 +29,7 @@ s32 Ascii_StrToL(const s8 *str) { s32 length = Ascii_StrLen(str); s32 i; s32 pow10 = 1; - s32 num = 0; + s32 num = 0; // Traverse from right to left for (i = length - 1; i >= 0; i--) { @@ -38,7 +39,7 @@ s32 Ascii_StrToL(const s8 *str) { } else { // If first character is a minus sign, it's negative if (i == 0) { - if(str[i] == '-') { + if (str[i] == '-') { num *= -1; } } else { diff --git a/arm9/src/bag.c b/arm9/src/bag.c index 4c5b40d8b..2b8a0dc35 100644 --- a/arm9/src/bag.c +++ b/arm9/src/bag.c @@ -1,9 +1,12 @@ +#include "bag.h" + #include "global.h" + #include "constants/items.h" + #include "MI_memory.h" -#include "bag.h" -#include "itemtool.h" #include "heap.h" +#include "itemtool.h" static u32 Bag_GetItemPocket(Bag *bag, u16 itemId, ItemSlot **itemSlots, u32 *countPtr, HeapID heapId); static ItemSlot *Pocket_GetItemSlotForAdd(ItemSlot *slots, u32 count, u16 itemId, u16 quantity, u16 maxQuantity); @@ -19,7 +22,7 @@ u32 Save_Bag_sizeof(void) { } Bag *Save_Bag_New(HeapID heapId) { - Bag *bag = (Bag *) AllocFromHeap(heapId, sizeof(Bag)); + Bag *bag = (Bag *)AllocFromHeap(heapId, sizeof(Bag)); Save_Bag_Init(bag); return bag; } @@ -43,38 +46,38 @@ void Bag_SetRegisteredItem(Bag *bag, u32 item) { static u32 Bag_GetItemPocket(Bag *bag, u16 itemId, ItemSlot **itemSlots, u32 *countPtr, HeapID heapId) { u32 pocket = GetItemAttr(itemId, ITEMATTR_POCKET, heapId); switch (pocket) { - case POCKET_KEY_ITEMS: - *itemSlots = bag->keyItems; - *countPtr = NUM_BAG_KEY_ITEMS; - break; - case POCKET_ITEMS: - *itemSlots = bag->items; - *countPtr = NUM_BAG_ITEMS; - break; - case POCKET_BERRIES: - *itemSlots = bag->berries; - *countPtr = NUM_BAG_BERRIES; - break; - case POCKET_MEDICINE: - *itemSlots = bag->medicine; - *countPtr = NUM_BAG_MEDICINE; - break; - case POCKET_BALLS: - *itemSlots = bag->balls; - *countPtr = NUM_BAG_BALLS; - break; - case POCKET_BATTLE_ITEMS: - *itemSlots = bag->battleItems; - *countPtr = NUM_BAG_BATTLE_ITEMS; - break; - case POCKET_MAIL: - *itemSlots = bag->mail; - *countPtr = NUM_BAG_MAIL; - break; - case POCKET_TMHMS: - *itemSlots = bag->TMsHMs; - *countPtr = NUM_BAG_TMS_HMS; - break; + case POCKET_KEY_ITEMS: + *itemSlots = bag->keyItems; + *countPtr = NUM_BAG_KEY_ITEMS; + break; + case POCKET_ITEMS: + *itemSlots = bag->items; + *countPtr = NUM_BAG_ITEMS; + break; + case POCKET_BERRIES: + *itemSlots = bag->berries; + *countPtr = NUM_BAG_BERRIES; + break; + case POCKET_MEDICINE: + *itemSlots = bag->medicine; + *countPtr = NUM_BAG_MEDICINE; + break; + case POCKET_BALLS: + *itemSlots = bag->balls; + *countPtr = NUM_BAG_BALLS; + break; + case POCKET_BATTLE_ITEMS: + *itemSlots = bag->battleItems; + *countPtr = NUM_BAG_BATTLE_ITEMS; + break; + case POCKET_MAIL: + *itemSlots = bag->mail; + *countPtr = NUM_BAG_MAIL; + break; + case POCKET_TMHMS: + *itemSlots = bag->TMsHMs; + *countPtr = NUM_BAG_TMS_HMS; + break; } return pocket; } @@ -184,43 +187,43 @@ BOOL Bag_HasItem(Bag *bag, u16 itemId, u16 quantity, HeapID heapId) { } BOOL Bag_PocketNotEmpty(Bag *bag, u32 pocket) { - ItemSlot * slots; + ItemSlot *slots; u32 count; switch (pocket) { - case POCKET_KEY_ITEMS: - slots = bag->keyItems; - count = NUM_BAG_KEY_ITEMS; - break; - case POCKET_ITEMS: - slots = bag->items; - count = NUM_BAG_ITEMS; - break; - case POCKET_BERRIES: - slots = bag->berries; - count = NUM_BAG_BERRIES; - break; - case POCKET_MEDICINE: - slots = bag->medicine; - count = NUM_BAG_MEDICINE; - break; - case POCKET_BALLS: - slots = bag->balls; - count = NUM_BAG_BALLS; - break; - case POCKET_BATTLE_ITEMS: - slots = bag->battleItems; - count = NUM_BAG_BATTLE_ITEMS; - break; - case POCKET_MAIL: - slots = bag->mail; - count = NUM_BAG_MAIL; - break; - case POCKET_TMHMS: - slots = bag->TMsHMs; - count = NUM_BAG_TMS_HMS; - break; - default: - return FALSE; + case POCKET_KEY_ITEMS: + slots = bag->keyItems; + count = NUM_BAG_KEY_ITEMS; + break; + case POCKET_ITEMS: + slots = bag->items; + count = NUM_BAG_ITEMS; + break; + case POCKET_BERRIES: + slots = bag->berries; + count = NUM_BAG_BERRIES; + break; + case POCKET_MEDICINE: + slots = bag->medicine; + count = NUM_BAG_MEDICINE; + break; + case POCKET_BALLS: + slots = bag->balls; + count = NUM_BAG_BALLS; + break; + case POCKET_BATTLE_ITEMS: + slots = bag->battleItems; + count = NUM_BAG_BATTLE_ITEMS; + break; + case POCKET_MAIL: + slots = bag->mail; + count = NUM_BAG_MAIL; + break; + case POCKET_TMHMS: + slots = bag->TMsHMs; + count = NUM_BAG_TMS_HMS; + break; + default: + return FALSE; } for (s32 i = 0; i < count; i++) { @@ -249,8 +252,8 @@ u16 Pocket_GetQuantity(ItemSlot *slots, u32 count, u16 itemId) { static void SwapItemSlots(ItemSlot *a, ItemSlot *b) { ItemSlot c = *a; - *a = *b; - *b = c; + *a = *b; + *b = c; } static void PocketCompaction(ItemSlot *slots, u32 count) { @@ -273,78 +276,77 @@ static void SortPocket(ItemSlot *slots, u32 count) { } } -BagView *Bag_CreateView(Bag *bag, const u8 *pockets, HeapID heapId) -{ +BagView *Bag_CreateView(Bag *bag, const u8 *pockets, HeapID heapId) { BagView *ret = BagView_New(heapId); for (u32 i = 0; pockets[i] != POCKET_BAG_VIEW_END; i++) { switch (pockets[i]) { - case POCKET_KEY_ITEMS: - BagView_SetItem(ret, bag->keyItems, POCKET_KEY_ITEMS, i); - break; - case POCKET_ITEMS: - BagView_SetItem(ret, bag->items, POCKET_ITEMS, i); - break; - case POCKET_BERRIES: - BagView_SetItem(ret, bag->berries, POCKET_BERRIES, i); - break; - case POCKET_MEDICINE: - BagView_SetItem(ret, bag->medicine, POCKET_MEDICINE, i); - break; - case POCKET_BALLS: - BagView_SetItem(ret, bag->balls, POCKET_BALLS, i); - break; - case POCKET_BATTLE_ITEMS: - BagView_SetItem(ret, bag->battleItems, POCKET_BATTLE_ITEMS, i); - break; - case POCKET_MAIL: - BagView_SetItem(ret, bag->mail, POCKET_MAIL, i); - break; - case POCKET_TMHMS: - BagView_SetItem(ret, bag->TMsHMs, POCKET_TMHMS, i); - break; - } - } - return ret; -} - -ItemSlot *Bag_GetPocketSlotN(Bag *bag, u8 pocket, u32 slot) { - ItemSlot *slots; - u32 count; - - switch (pocket) { case POCKET_KEY_ITEMS: - slots = bag->keyItems; - count = NUM_BAG_KEY_ITEMS; + BagView_SetItem(ret, bag->keyItems, POCKET_KEY_ITEMS, i); break; case POCKET_ITEMS: - slots = bag->items; - count = NUM_BAG_ITEMS; + BagView_SetItem(ret, bag->items, POCKET_ITEMS, i); break; case POCKET_BERRIES: - slots = bag->berries; - count = NUM_BAG_BERRIES; + BagView_SetItem(ret, bag->berries, POCKET_BERRIES, i); break; case POCKET_MEDICINE: - slots = bag->medicine; - count = NUM_BAG_MEDICINE; + BagView_SetItem(ret, bag->medicine, POCKET_MEDICINE, i); break; case POCKET_BALLS: - slots = bag->balls; - count = NUM_BAG_BALLS; + BagView_SetItem(ret, bag->balls, POCKET_BALLS, i); break; case POCKET_BATTLE_ITEMS: - slots = bag->battleItems; - count = NUM_BAG_BATTLE_ITEMS; + BagView_SetItem(ret, bag->battleItems, POCKET_BATTLE_ITEMS, i); break; case POCKET_MAIL: - slots = bag->mail; - count = NUM_BAG_MAIL; + BagView_SetItem(ret, bag->mail, POCKET_MAIL, i); break; case POCKET_TMHMS: - slots = bag->TMsHMs; - count = NUM_BAG_TMS_HMS; + BagView_SetItem(ret, bag->TMsHMs, POCKET_TMHMS, i); break; + } + } + return ret; +} + +ItemSlot *Bag_GetPocketSlotN(Bag *bag, u8 pocket, u32 slot) { + ItemSlot *slots; + u32 count; + + switch (pocket) { + case POCKET_KEY_ITEMS: + slots = bag->keyItems; + count = NUM_BAG_KEY_ITEMS; + break; + case POCKET_ITEMS: + slots = bag->items; + count = NUM_BAG_ITEMS; + break; + case POCKET_BERRIES: + slots = bag->berries; + count = NUM_BAG_BERRIES; + break; + case POCKET_MEDICINE: + slots = bag->medicine; + count = NUM_BAG_MEDICINE; + break; + case POCKET_BALLS: + slots = bag->balls; + count = NUM_BAG_BALLS; + break; + case POCKET_BATTLE_ITEMS: + slots = bag->battleItems; + count = NUM_BAG_BATTLE_ITEMS; + break; + case POCKET_MAIL: + slots = bag->mail; + count = NUM_BAG_MAIL; + break; + case POCKET_TMHMS: + slots = bag->TMsHMs; + count = NUM_BAG_TMS_HMS; + break; } // UB: If pocket invalid, count and slot are uninitialized if (slot >= count) { @@ -365,7 +367,7 @@ BagCursor *BagCursor_New(HeapID heapId) { void BagCursor_Field_PocketGetPosition(BagCursor *cursor, u32 pocket, u8 *position, u8 *scroll) { *position = cursor->field.position[pocket]; - *scroll = cursor->field.scroll[pocket]; + *scroll = cursor->field.scroll[pocket]; } u16 BagCursor_Field_GetPocket(BagCursor *cursor) { @@ -374,7 +376,7 @@ u16 BagCursor_Field_GetPocket(BagCursor *cursor) { void BagCursor_Field_PocketSetPosition(BagCursor *cursor, u32 pocket, u8 position, u8 scroll) { cursor->field.position[pocket] = position; - cursor->field.scroll[pocket] = scroll; + cursor->field.scroll[pocket] = scroll; } void BagCursor_Field_SetPocket(BagCursor *cursor, u16 pocket) { @@ -383,7 +385,7 @@ void BagCursor_Field_SetPocket(BagCursor *cursor, u16 pocket) { void BagCursor_Battle_PocketGetPosition(BagCursor *cursor, u32 pocket, u8 *position, u8 *scroll) { *position = cursor->battle.position[pocket]; - *scroll = cursor->battle.scroll[pocket]; + *scroll = cursor->battle.scroll[pocket]; } u16 BagCursor_Battle_GetLastUsedItem(BagCursor *cursor) { @@ -400,7 +402,7 @@ u16 BagCursor_Battle_GetPocket(BagCursor *cursor) { void BagCursor_Battle_PocketSetPosition(BagCursor *cursor, u32 pocket, u8 position, u8 scroll) { cursor->battle.position[pocket] = position; - cursor->battle.scroll[pocket] = scroll; + cursor->battle.scroll[pocket] = scroll; } void BagCursor_Battle_Init(BagCursor *cursor) { @@ -411,7 +413,7 @@ void BagCursor_Battle_Init(BagCursor *cursor) { } void BagCursor_Battle_SetLastUsedItem(BagCursor *cursor, u16 itemId, u16 pocket) { - cursor->battle.lastUsedItem = itemId; + cursor->battle.lastUsedItem = itemId; cursor->battle.lastUsedPocket = pocket; } diff --git a/arm9/src/bag_view.c b/arm9/src/bag_view.c index b5483de93..6a4f3d282 100644 --- a/arm9/src/bag_view.c +++ b/arm9/src/bag_view.c @@ -1,15 +1,19 @@ -#include "global.h" #include "bag_view.h" -#include "coins.h" + +#include "global.h" + #include "constants/items.h" #include "constants/seal_constants.h" + +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0007.h" +#include "msgdata/msg/narc_0199.h" + +#include "coins.h" #include "fashion_case.h" #include "heap.h" #include "message_format.h" #include "msgdata.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0007.h" -#include "msgdata/msg/narc_0199.h" #include "player_data.h" #include "seal.h" #include "unk_0202A1E0.h" @@ -44,12 +48,12 @@ void sub_0206E314(BagView *bagView, SaveData *save, u8 r2, BagCursor *cursor) { sub_0206E30C(bagView, r2); bagView->saveData = save; - bagView->cursor = cursor; - bagView->unk66 = 0; + bagView->cursor = cursor; + bagView->unk66 = 0; } void BagView_SetItem(BagView *bagView, ItemSlot *slot, u8 pocket, u8 idx) { - bagView->pockets[idx].slot = slot; + bagView->pockets[idx].slot = slot; bagView->pockets[idx].pocket = pocket; } @@ -114,7 +118,7 @@ static u32 GetNumBattlePoints(SaveData *saveData) { } BOOL TryFormatRegisteredKeyItemUseMessage(SaveData *saveData, String *dest, u32 itemId, HeapID heapId) { - MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_DIRECT, NARC_MSGDATA_MSG, NARC_msg_narc_0007_bin, heapId); + MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_DIRECT, NARC_MSGDATA_MSG, NARC_msg_narc_0007_bin, heapId); MessageFormat *messageFormat = MessageFormat_New(heapId); String *string; @@ -151,28 +155,28 @@ void GetItemUseErrorMessage(PlayerProfile *playerProfile, String *dest, u16 item MsgData *msgData; switch (code) { - case ITEMUSEERROR_NODISMOUNT: - // You can’t dismount your Bike here. - msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0007_bin, heapId); - ReadMsgDataIntoString(msgData, narc_0007_00056, dest); - DestroyMsgData(msgData); - break; - case ITEMUSEERROR_NOFOLLOWER: - // It can’t be used when you have someone with you. - msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0007_bin, heapId); - ReadMsgDataIntoString(msgData, narc_0007_00111, dest); - DestroyMsgData(msgData); - break; - default: - // Rowan’s words echoed... {STRVAR_1 3, 0}! There’s a time and place for everything! But not now. - msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0199_bin, heapId); - MessageFormat *messageFormat = MessageFormat_New(heapId); - String *src = NewString_ReadMsgData(msgData, narc_0199_00036); - BufferPlayersName(messageFormat, 0, playerProfile); - StringExpandPlaceholders(messageFormat, dest, src); - String_Delete(src); - MessageFormat_Delete(messageFormat); - DestroyMsgData(msgData); - break; + case ITEMUSEERROR_NODISMOUNT: + // You can’t dismount your Bike here. + msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0007_bin, heapId); + ReadMsgDataIntoString(msgData, narc_0007_00056, dest); + DestroyMsgData(msgData); + break; + case ITEMUSEERROR_NOFOLLOWER: + // It can’t be used when you have someone with you. + msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0007_bin, heapId); + ReadMsgDataIntoString(msgData, narc_0007_00111, dest); + DestroyMsgData(msgData); + break; + default: + // Rowan’s words echoed... {STRVAR_1 3, 0}! There’s a time and place for everything! But not now. + msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0199_bin, heapId); + MessageFormat *messageFormat = MessageFormat_New(heapId); + String *src = NewString_ReadMsgData(msgData, narc_0199_00036); + BufferPlayersName(messageFormat, 0, playerProfile); + StringExpandPlaceholders(messageFormat, dest, src); + String_Delete(src); + MessageFormat_Delete(messageFormat); + DestroyMsgData(msgData); + break; } } diff --git a/arm9/src/bg_window.c b/arm9/src/bg_window.c index ff9fb9c38..4b716e64d 100644 --- a/arm9/src/bg_window.c +++ b/arm9/src/bg_window.c @@ -1,10 +1,12 @@ -#include "global.h" #include "bg_window.h" -#include "gf_gfx_planes.h" + +#include "global.h" + +#include "MI_uncompress.h" #include "game_init.h" +#include "gf_gfx_planes.h" #include "gx.h" #include "heap.h" -#include "MI_uncompress.h" static u8 TranslateGFBgModePairToGXScreenSize(enum GFBgScreenSize size, enum GFBgType type); static void GetBgScreenDimensions(u32 screenSize, u8 *widthPtr, u8 *heightPtr); @@ -93,8 +95,8 @@ static void (*const sClearWindowTilemapFuncs[])(Window *) = { BgConfig *BgConfig_Alloc(HeapID heapId) { BgConfig *ret = AllocFromHeap(heapId, sizeof(BgConfig)); memset(ret, 0, sizeof(BgConfig)); - ret->heapId = heapId; - ret->scrollScheduled = 0; // redundant to above memset + ret->heapId = heapId; + ret->scrollScheduled = 0; // redundant to above memset ret->bufferTransferScheduled = 0; // redundant to above memset return ret; } @@ -124,115 +126,115 @@ void SetScreenModeAndDisable(const struct GraphicsModes *gfxModes, enum GFScreen } void InitBgFromTemplate(BgConfig *bgConfig, u8 bgId, const BgTemplate *template, u8 bgMode) { - u8 screenSize = TranslateGFBgModePairToGXScreenSize((enum GFBgScreenSize)template->size, (enum GFBgType)bgMode); + u8 screenSize = TranslateGFBgModePairToGXScreenSize((enum GFBgScreenSize) template->size, (enum GFBgType)bgMode); switch (bgId) { - case GF_BG_LYR_MAIN_0: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_0_F, GX_PLANE_TOGGLE_ON); - G2_SetBG0Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); - G2_SetBG0Priority(template->priority); - G2_BG0Mosaic(template->mosaic); - break; + case GF_BG_LYR_MAIN_0: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_0_F, GX_PLANE_TOGGLE_ON); + G2_SetBG0Control((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase, (GXBGExtPltt) template->bgExtPltt); + G2_SetBG0Priority(template->priority); + G2_BG0Mosaic(template->mosaic); + break; - case GF_BG_LYR_MAIN_1: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_1_F, GX_PLANE_TOGGLE_ON); - G2_SetBG1Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); - G2_SetBG1Priority(template->priority); - G2_BG1Mosaic(template->mosaic); - break; + case GF_BG_LYR_MAIN_1: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_1_F, GX_PLANE_TOGGLE_ON); + G2_SetBG1Control((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase, (GXBGExtPltt) template->bgExtPltt); + G2_SetBG1Priority(template->priority); + G2_BG1Mosaic(template->mosaic); + break; - case GF_BG_LYR_MAIN_2: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_2_F, GX_PLANE_TOGGLE_ON); - switch (bgMode) { - default: - case GF_BG_TYPE_TEXT: - G2_SetBG2ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_AFFINE: - G2_SetBG2ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_256x16PLTT: - G2_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - } - G2_SetBG2Priority(template->priority); - G2_BG2Mosaic(template->mosaic); + case GF_BG_LYR_MAIN_2: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_2_F, GX_PLANE_TOGGLE_ON); + switch (bgMode) { + default: + case GF_BG_TYPE_TEXT: + G2_SetBG2ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); break; - - case GF_BG_LYR_MAIN_3: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_3_F, GX_PLANE_TOGGLE_ON); - switch (bgMode) { - default: - case GF_BG_TYPE_TEXT: - G2_SetBG3ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_AFFINE: - G2_SetBG3ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_256x16PLTT: - G2_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - } - G2_SetBG3Priority(template->priority); - G2_BG3Mosaic(template->mosaic); + case GF_BG_TYPE_AFFINE: + G2_SetBG2ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); break; - - case GF_BG_LYR_SUB_0: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_0_F, GX_PLANE_TOGGLE_ON); - G2S_SetBG0Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); - G2S_SetBG0Priority(template->priority); - G2S_BG0Mosaic(template->mosaic); + case GF_BG_TYPE_256x16PLTT: + G2_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); break; + } + G2_SetBG2Priority(template->priority); + G2_BG2Mosaic(template->mosaic); + break; - case GF_BG_LYR_SUB_1: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_1_F, GX_PLANE_TOGGLE_ON); - G2S_SetBG1Control((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase, (GXBGExtPltt)template->bgExtPltt); - G2S_SetBG1Priority(template->priority); - G2S_BG1Mosaic(template->mosaic); + case GF_BG_LYR_MAIN_3: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_3_F, GX_PLANE_TOGGLE_ON); + switch (bgMode) { + default: + case GF_BG_TYPE_TEXT: + G2_SetBG3ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); + break; + case GF_BG_TYPE_AFFINE: + G2_SetBG3ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); + break; + case GF_BG_TYPE_256x16PLTT: + G2_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); break; + } + G2_SetBG3Priority(template->priority); + G2_BG3Mosaic(template->mosaic); + break; - case GF_BG_LYR_SUB_2: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_2_F, GX_PLANE_TOGGLE_ON); - switch (bgMode) { - default: - case GF_BG_TYPE_TEXT: - G2S_SetBG2ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_AFFINE: - G2S_SetBG2ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_256x16PLTT: - G2S_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - } - G2S_SetBG2Priority(template->priority); - G2S_BG2Mosaic(template->mosaic); + case GF_BG_LYR_SUB_0: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_0_F, GX_PLANE_TOGGLE_ON); + G2S_SetBG0Control((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase, (GXBGExtPltt) template->bgExtPltt); + G2S_SetBG0Priority(template->priority); + G2S_BG0Mosaic(template->mosaic); + break; + + case GF_BG_LYR_SUB_1: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_1_F, GX_PLANE_TOGGLE_ON); + G2S_SetBG1Control((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase, (GXBGExtPltt) template->bgExtPltt); + G2S_SetBG1Priority(template->priority); + G2S_BG1Mosaic(template->mosaic); + break; + + case GF_BG_LYR_SUB_2: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_2_F, GX_PLANE_TOGGLE_ON); + switch (bgMode) { + default: + case GF_BG_TYPE_TEXT: + G2S_SetBG2ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); break; + case GF_BG_TYPE_AFFINE: + G2S_SetBG2ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); + break; + case GF_BG_TYPE_256x16PLTT: + G2S_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); + break; + } + G2S_SetBG2Priority(template->priority); + G2S_BG2Mosaic(template->mosaic); + break; - case GF_BG_LYR_SUB_3: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_3_F, GX_PLANE_TOGGLE_ON); - switch (bgMode) { - default: - case GF_BG_TYPE_TEXT: - G2S_SetBG3ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode)template->colorMode, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_AFFINE: - G2S_SetBG3ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - case GF_BG_TYPE_256x16PLTT: - G2S_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver)template->areaOver, (GXBGScrBase)template->screenBase, (GXBGCharBase)template->charBase); - break; - } - G2S_SetBG3Priority(template->priority); - G2S_BG3Mosaic(template->mosaic); + case GF_BG_LYR_SUB_3: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_3_F, GX_PLANE_TOGGLE_ON); + switch (bgMode) { + default: + case GF_BG_TYPE_TEXT: + G2S_SetBG3ControlText((GXBGScrSizeText)screenSize, (GXBGColorMode) template->colorMode, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); + break; + case GF_BG_TYPE_AFFINE: + G2S_SetBG3ControlAffine((GXBGScrSizeAffine)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); break; + case GF_BG_TYPE_256x16PLTT: + G2S_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)screenSize, (GXBGAreaOver) template->areaOver, (GXBGScrBase) template->screenBase, (GXBGCharBase) template->charBase); + break; + } + G2S_SetBG3Priority(template->priority); + G2S_BG3Mosaic(template->mosaic); + break; } bgConfig->bgs[bgId].rotation = 0; - bgConfig->bgs[bgId].xScale = FX32_ONE; - bgConfig->bgs[bgId].yScale = FX32_ONE; - bgConfig->bgs[bgId].centerX = 0; - bgConfig->bgs[bgId].centerY = 0; + bgConfig->bgs[bgId].xScale = FX32_ONE; + bgConfig->bgs[bgId].yScale = FX32_ONE; + bgConfig->bgs[bgId].centerX = 0; + bgConfig->bgs[bgId].centerY = 0; if (template->bufferSize != 0) { bgConfig->bgs[bgId].tilemapBuffer = AllocFromHeap(bgConfig->heapId, template->bufferSize); @@ -240,15 +242,15 @@ void InitBgFromTemplate(BgConfig *bgConfig, u8 bgId, const BgTemplate *template, MI_CpuClear16(bgConfig->bgs[bgId].tilemapBuffer, template->bufferSize); bgConfig->bgs[bgId].bufferSize = template->bufferSize; - bgConfig->bgs[bgId].baseTile = template->baseTile; + bgConfig->bgs[bgId].baseTile = template->baseTile; } else { bgConfig->bgs[bgId].tilemapBuffer = NULL; - bgConfig->bgs[bgId].bufferSize = 0; - bgConfig->bgs[bgId].baseTile = 0; + bgConfig->bgs[bgId].bufferSize = 0; + bgConfig->bgs[bgId].baseTile = 0; } - bgConfig->bgs[bgId].size = template->size; - bgConfig->bgs[bgId].mode = bgMode; + bgConfig->bgs[bgId].size = template->size; + bgConfig->bgs[bgId].mode = bgMode; bgConfig->bgs[bgId].colorMode = template->colorMode; if (bgMode == GF_BG_TYPE_TEXT && template->colorMode == GX_BG_COLORMODE_16) { @@ -267,226 +269,226 @@ void SetBgControlParam(BgConfig *config, u8 bgId, enum GFBgCntSet attr, u8 value } switch (bgId) { - case GF_BG_LYR_MAIN_0: - GXBg01Control bg0cnt = G2_GetBG0Control(); + case GF_BG_LYR_MAIN_0: + GXBg01Control bg0cnt = G2_GetBG0Control(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg0cnt.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg0cnt.charBase = value; + } + + G2_SetBG0Control((GXBGScrSizeText)bg0cnt.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg0cnt.screenBase, (GXBGCharBase)bg0cnt.charBase, (GXBGExtPltt)bg0cnt.bgExtPltt); + break; + case GF_BG_LYR_MAIN_1: + GXBg01Control bg1cnt = G2_GetBG1Control(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg1cnt.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg1cnt.charBase = value; + } + + G2_SetBG1Control((GXBGScrSizeText)bg1cnt.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg1cnt.screenBase, (GXBGCharBase)bg1cnt.charBase, (GXBGExtPltt)bg1cnt.bgExtPltt); + break; + case GF_BG_LYR_MAIN_2: + switch (config->bgs[bgId].mode) { + default: + case GF_BG_TYPE_TEXT: + GXBg23ControlText bg2cnt_tx = G2_GetBG2ControlText(); if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg0cnt.screenBase = value; + bg2cnt_tx.screenBase = value; } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg0cnt.charBase = value; + bg2cnt_tx.charBase = value; } - G2_SetBG0Control((GXBGScrSizeText)bg0cnt.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg0cnt.screenBase, (GXBGCharBase)bg0cnt.charBase, (GXBGExtPltt)bg0cnt.bgExtPltt); + G2_SetBG2ControlText((GXBGScrSizeText)bg2cnt_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg2cnt_tx.screenBase, (GXBGCharBase)bg2cnt_tx.charBase); break; - case GF_BG_LYR_MAIN_1: - GXBg01Control bg1cnt = G2_GetBG1Control(); + case GF_BG_TYPE_AFFINE: + GXBg23ControlAffine bg2cnt_aff = G2_GetBG2ControlAffine(); if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg1cnt.screenBase = value; + bg2cnt_aff.screenBase = value; } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg1cnt.charBase = value; + bg2cnt_aff.charBase = value; } - G2_SetBG1Control((GXBGScrSizeText)bg1cnt.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg1cnt.screenBase, (GXBGCharBase)bg1cnt.charBase, (GXBGExtPltt)bg1cnt.bgExtPltt); + G2_SetBG2ControlAffine((GXBGScrSizeAffine)bg2cnt_aff.screenSize, (GXBGAreaOver)bg2cnt_aff.areaOver, (GXBGScrBase)bg2cnt_aff.screenBase, (GXBGCharBase)bg2cnt_aff.charBase); break; - case GF_BG_LYR_MAIN_2: - switch (config->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - GXBg23ControlText bg2cnt_tx = G2_GetBG2ControlText(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg2cnt_tx.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg2cnt_tx.charBase = value; - } - - G2_SetBG2ControlText((GXBGScrSizeText)bg2cnt_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg2cnt_tx.screenBase, (GXBGCharBase)bg2cnt_tx.charBase); - break; - case GF_BG_TYPE_AFFINE: - GXBg23ControlAffine bg2cnt_aff = G2_GetBG2ControlAffine(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg2cnt_aff.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg2cnt_aff.charBase = value; - } - - G2_SetBG2ControlAffine((GXBGScrSizeAffine)bg2cnt_aff.screenSize, (GXBGAreaOver)bg2cnt_aff.areaOver, (GXBGScrBase)bg2cnt_aff.screenBase, (GXBGCharBase)bg2cnt_aff.charBase); - break; - case GF_BG_TYPE_256x16PLTT: - GXBg23Control256x16Pltt bg2cnt_256x16pltt = G2_GetBG2Control256x16Pltt(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg2cnt_256x16pltt.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg2cnt_256x16pltt.charBase = value; - } - - G2_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)bg2cnt_256x16pltt.screenSize, (GXBGAreaOver)bg2cnt_256x16pltt.areaOver, (GXBGScrBase)bg2cnt_256x16pltt.screenBase, (GXBGCharBase)bg2cnt_256x16pltt.charBase); - break; + case GF_BG_TYPE_256x16PLTT: + GXBg23Control256x16Pltt bg2cnt_256x16pltt = G2_GetBG2Control256x16Pltt(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg2cnt_256x16pltt.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg2cnt_256x16pltt.charBase = value; } + + G2_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)bg2cnt_256x16pltt.screenSize, (GXBGAreaOver)bg2cnt_256x16pltt.areaOver, (GXBGScrBase)bg2cnt_256x16pltt.screenBase, (GXBGCharBase)bg2cnt_256x16pltt.charBase); break; - case GF_BG_LYR_MAIN_3: - switch (config->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - GXBg23ControlText bg3cnt_tx = G2_GetBG3ControlText(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg3cnt_tx.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg3cnt_tx.charBase = value; - } - - G2_SetBG3ControlText((GXBGScrSizeText)bg3cnt_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg3cnt_tx.screenBase, (GXBGCharBase)bg3cnt_tx.charBase); - break; - case GF_BG_TYPE_AFFINE: - GXBg23ControlAffine bg3cnt_aff = G2_GetBG3ControlAffine(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg3cnt_aff.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg3cnt_aff.charBase = value; - } - - G2_SetBG3ControlAffine((GXBGScrSizeAffine)bg3cnt_aff.screenSize, (GXBGAreaOver)bg3cnt_aff.areaOver, (GXBGScrBase)bg3cnt_aff.screenBase, (GXBGCharBase)bg3cnt_aff.charBase); - break; - case GF_BG_TYPE_256x16PLTT: - GXBg23Control256x16Pltt bg3cnt_256x16pltt = G2_GetBG3Control256x16Pltt(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg3cnt_256x16pltt.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg3cnt_256x16pltt.charBase = value; - } - - G2_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)bg3cnt_256x16pltt.screenSize, (GXBGAreaOver)bg3cnt_256x16pltt.areaOver, (GXBGScrBase)bg3cnt_256x16pltt.screenBase, (GXBGCharBase)bg3cnt_256x16pltt.charBase); - break; + } + break; + case GF_BG_LYR_MAIN_3: + switch (config->bgs[bgId].mode) { + default: + case GF_BG_TYPE_TEXT: + GXBg23ControlText bg3cnt_tx = G2_GetBG3ControlText(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg3cnt_tx.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg3cnt_tx.charBase = value; } + + G2_SetBG3ControlText((GXBGScrSizeText)bg3cnt_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg3cnt_tx.screenBase, (GXBGCharBase)bg3cnt_tx.charBase); break; - case GF_BG_LYR_SUB_0: - GXBg01Control bg0cntsub = G2S_GetBG0Control(); + case GF_BG_TYPE_AFFINE: + GXBg23ControlAffine bg3cnt_aff = G2_GetBG3ControlAffine(); if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg0cntsub.screenBase = value; + bg3cnt_aff.screenBase = value; } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg0cntsub.charBase = value; + bg3cnt_aff.charBase = value; } - G2S_SetBG0Control((GXBGScrSizeText)bg0cntsub.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg0cntsub.screenBase, (GXBGCharBase)bg0cntsub.charBase, (GXBGExtPltt)bg0cntsub.bgExtPltt); + G2_SetBG3ControlAffine((GXBGScrSizeAffine)bg3cnt_aff.screenSize, (GXBGAreaOver)bg3cnt_aff.areaOver, (GXBGScrBase)bg3cnt_aff.screenBase, (GXBGCharBase)bg3cnt_aff.charBase); break; - case GF_BG_LYR_SUB_1: - GXBg01Control bg1cntsub = G2S_GetBG1Control(); + case GF_BG_TYPE_256x16PLTT: + GXBg23Control256x16Pltt bg3cnt_256x16pltt = G2_GetBG3Control256x16Pltt(); if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg1cntsub.screenBase = value; + bg3cnt_256x16pltt.screenBase = value; } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg1cntsub.charBase = value; + bg3cnt_256x16pltt.charBase = value; } - G2S_SetBG1Control((GXBGScrSizeText)bg1cntsub.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg1cntsub.screenBase, (GXBGCharBase)bg1cntsub.charBase, (GXBGExtPltt)bg1cntsub.bgExtPltt); + G2_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)bg3cnt_256x16pltt.screenSize, (GXBGAreaOver)bg3cnt_256x16pltt.areaOver, (GXBGScrBase)bg3cnt_256x16pltt.screenBase, (GXBGCharBase)bg3cnt_256x16pltt.charBase); break; - case GF_BG_LYR_SUB_2: - switch (config->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - GXBg23ControlText bg2cntsub_tx = G2S_GetBG2ControlText(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg2cntsub_tx.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg2cntsub_tx.charBase = value; - } - - G2S_SetBG2ControlText((GXBGScrSizeText)bg2cntsub_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg2cntsub_tx.screenBase, (GXBGCharBase)bg2cntsub_tx.charBase); - break; - case GF_BG_TYPE_AFFINE: - GXBg23ControlAffine bg2cntsub_aff = G2S_GetBG2ControlAffine(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg2cntsub_aff.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg2cntsub_aff.charBase = value; - } - - G2S_SetBG2ControlAffine((GXBGScrSizeAffine)bg2cntsub_aff.screenSize, (GXBGAreaOver)bg2cntsub_aff.areaOver, (GXBGScrBase)bg2cntsub_aff.screenBase, (GXBGCharBase)bg2cntsub_aff.charBase); - break; - case GF_BG_TYPE_256x16PLTT: - GXBg23Control256x16Pltt bg2cntsub_256x16pltt = G2S_GetBG2Control256x16Pltt(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg2cntsub_256x16pltt.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg2cntsub_256x16pltt.charBase = value; - } - - G2S_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)bg2cntsub_256x16pltt.screenSize, (GXBGAreaOver)bg2cntsub_256x16pltt.areaOver, (GXBGScrBase)bg2cntsub_256x16pltt.screenBase, (GXBGCharBase)bg2cntsub_256x16pltt.charBase); - break; + } + break; + case GF_BG_LYR_SUB_0: + GXBg01Control bg0cntsub = G2S_GetBG0Control(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg0cntsub.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg0cntsub.charBase = value; + } + + G2S_SetBG0Control((GXBGScrSizeText)bg0cntsub.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg0cntsub.screenBase, (GXBGCharBase)bg0cntsub.charBase, (GXBGExtPltt)bg0cntsub.bgExtPltt); + break; + case GF_BG_LYR_SUB_1: + GXBg01Control bg1cntsub = G2S_GetBG1Control(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg1cntsub.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg1cntsub.charBase = value; + } + + G2S_SetBG1Control((GXBGScrSizeText)bg1cntsub.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg1cntsub.screenBase, (GXBGCharBase)bg1cntsub.charBase, (GXBGExtPltt)bg1cntsub.bgExtPltt); + break; + case GF_BG_LYR_SUB_2: + switch (config->bgs[bgId].mode) { + default: + case GF_BG_TYPE_TEXT: + GXBg23ControlText bg2cntsub_tx = G2S_GetBG2ControlText(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg2cntsub_tx.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg2cntsub_tx.charBase = value; } + + G2S_SetBG2ControlText((GXBGScrSizeText)bg2cntsub_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg2cntsub_tx.screenBase, (GXBGCharBase)bg2cntsub_tx.charBase); break; - case GF_BG_LYR_SUB_3: - switch (config->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - GXBg23ControlText bg3cntsub_tx = G2S_GetBG3ControlText(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg3cntsub_tx.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg3cntsub_tx.charBase = value; - } - - G2S_SetBG3ControlText((GXBGScrSizeText)bg3cntsub_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg3cntsub_tx.screenBase, (GXBGCharBase)bg3cntsub_tx.charBase); - break; - case GF_BG_TYPE_AFFINE: - GXBg23ControlAffine bg3cntsub_aff = G2S_GetBG3ControlAffine(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg3cntsub_aff.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg3cntsub_aff.charBase = value; - } - - G2S_SetBG3ControlAffine((GXBGScrSizeAffine)bg3cntsub_aff.screenSize, (GXBGAreaOver)bg3cntsub_aff.areaOver, (GXBGScrBase)bg3cntsub_aff.screenBase, (GXBGCharBase)bg3cntsub_aff.charBase); - break; - case GF_BG_TYPE_256x16PLTT: - GXBg23Control256x16Pltt bg3cntsub_256x16pltt = G2S_GetBG3Control256x16Pltt(); - if (attr == GF_BG_CNT_SET_SCREEN_BASE) { - bg3cntsub_256x16pltt.screenBase = value; - } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { - bg3cntsub_256x16pltt.charBase = value; - } - - G2S_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)bg3cntsub_256x16pltt.screenSize, (GXBGAreaOver)bg3cntsub_256x16pltt.areaOver, (GXBGScrBase)bg3cntsub_256x16pltt.screenBase, (GXBGCharBase)bg3cntsub_256x16pltt.charBase); - break; + case GF_BG_TYPE_AFFINE: + GXBg23ControlAffine bg2cntsub_aff = G2S_GetBG2ControlAffine(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg2cntsub_aff.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg2cntsub_aff.charBase = value; } + + G2S_SetBG2ControlAffine((GXBGScrSizeAffine)bg2cntsub_aff.screenSize, (GXBGAreaOver)bg2cntsub_aff.areaOver, (GXBGScrBase)bg2cntsub_aff.screenBase, (GXBGCharBase)bg2cntsub_aff.charBase); break; - } -} + case GF_BG_TYPE_256x16PLTT: + GXBg23Control256x16Pltt bg2cntsub_256x16pltt = G2S_GetBG2Control256x16Pltt(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg2cntsub_256x16pltt.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg2cntsub_256x16pltt.charBase = value; + } -static u8 TranslateGFBgModePairToGXScreenSize(enum GFBgScreenSize size, enum GFBgType type) { - switch (type) { + G2S_SetBG2Control256x16Pltt((GXBGScrSize256x16Pltt)bg2cntsub_256x16pltt.screenSize, (GXBGAreaOver)bg2cntsub_256x16pltt.areaOver, (GXBGScrBase)bg2cntsub_256x16pltt.screenBase, (GXBGCharBase)bg2cntsub_256x16pltt.charBase); + break; + } + break; + case GF_BG_LYR_SUB_3: + switch (config->bgs[bgId].mode) { + default: case GF_BG_TYPE_TEXT: - if (size == GF_BG_SCR_SIZE_256x256) { - return GX_BG_SCRSIZE_TEXT_256x256; - } else if (size == GF_BG_SCR_SIZE_256x512) { - return GX_BG_SCRSIZE_TEXT_256x512; - } else if (size == GF_BG_SCR_SIZE_512x256) { - return GX_BG_SCRSIZE_TEXT_512x256; - } else if (size == GF_BG_SCR_SIZE_512x512) { - return GX_BG_SCRSIZE_TEXT_512x512; + GXBg23ControlText bg3cntsub_tx = G2S_GetBG3ControlText(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg3cntsub_tx.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg3cntsub_tx.charBase = value; } - break; + G2S_SetBG3ControlText((GXBGScrSizeText)bg3cntsub_tx.screenSize, (GXBGColorMode)config->bgs[bgId].colorMode, (GXBGScrBase)bg3cntsub_tx.screenBase, (GXBGCharBase)bg3cntsub_tx.charBase); + break; case GF_BG_TYPE_AFFINE: - if (size == GF_BG_SCR_SIZE_128x128) { - return GX_BG_SCRSIZE_AFFINE_128x128; - } else if (size == GF_BG_SCR_SIZE_256x256) { - return GX_BG_SCRSIZE_AFFINE_256x256; - } else if (size == GF_BG_SCR_SIZE_512x512) { - return GX_BG_SCRSIZE_AFFINE_512x512; - } else if (size == GF_BG_SCR_SIZE_1024x1024) { - return GX_BG_SCRSIZE_AFFINE_1024x1024; + GXBg23ControlAffine bg3cntsub_aff = G2S_GetBG3ControlAffine(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg3cntsub_aff.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg3cntsub_aff.charBase = value; } - break; + G2S_SetBG3ControlAffine((GXBGScrSizeAffine)bg3cntsub_aff.screenSize, (GXBGAreaOver)bg3cntsub_aff.areaOver, (GXBGScrBase)bg3cntsub_aff.screenBase, (GXBGCharBase)bg3cntsub_aff.charBase); + break; case GF_BG_TYPE_256x16PLTT: - if (size == GF_BG_SCR_SIZE_128x128) { - return GX_BG_SCRSIZE_256x16PLTT_128x128; - } else if (size == GF_BG_SCR_SIZE_256x256) { - return GX_BG_SCRSIZE_256x16PLTT_256x256; - } else if (size == GF_BG_SCR_SIZE_512x512) { - return GX_BG_SCRSIZE_256x16PLTT_512x512; - } else if (size == GF_BG_SCR_SIZE_1024x1024) { - return GX_BG_SCRSIZE_256x16PLTT_1024x1024; + GXBg23Control256x16Pltt bg3cntsub_256x16pltt = G2S_GetBG3Control256x16Pltt(); + if (attr == GF_BG_CNT_SET_SCREEN_BASE) { + bg3cntsub_256x16pltt.screenBase = value; + } else if (attr == GF_BG_CNT_SET_CHAR_BASE) { + bg3cntsub_256x16pltt.charBase = value; } + + G2S_SetBG3Control256x16Pltt((GXBGScrSize256x16Pltt)bg3cntsub_256x16pltt.screenSize, (GXBGAreaOver)bg3cntsub_256x16pltt.areaOver, (GXBGScrBase)bg3cntsub_256x16pltt.screenBase, (GXBGCharBase)bg3cntsub_256x16pltt.charBase); break; + } + break; + } +} + +static u8 TranslateGFBgModePairToGXScreenSize(enum GFBgScreenSize size, enum GFBgType type) { + switch (type) { + case GF_BG_TYPE_TEXT: + if (size == GF_BG_SCR_SIZE_256x256) { + return GX_BG_SCRSIZE_TEXT_256x256; + } else if (size == GF_BG_SCR_SIZE_256x512) { + return GX_BG_SCRSIZE_TEXT_256x512; + } else if (size == GF_BG_SCR_SIZE_512x256) { + return GX_BG_SCRSIZE_TEXT_512x256; + } else if (size == GF_BG_SCR_SIZE_512x512) { + return GX_BG_SCRSIZE_TEXT_512x512; + } + break; + + case GF_BG_TYPE_AFFINE: + if (size == GF_BG_SCR_SIZE_128x128) { + return GX_BG_SCRSIZE_AFFINE_128x128; + } else if (size == GF_BG_SCR_SIZE_256x256) { + return GX_BG_SCRSIZE_AFFINE_256x256; + } else if (size == GF_BG_SCR_SIZE_512x512) { + return GX_BG_SCRSIZE_AFFINE_512x512; + } else if (size == GF_BG_SCR_SIZE_1024x1024) { + return GX_BG_SCRSIZE_AFFINE_1024x1024; + } + break; + + case GF_BG_TYPE_256x16PLTT: + if (size == GF_BG_SCR_SIZE_128x128) { + return GX_BG_SCRSIZE_256x16PLTT_128x128; + } else if (size == GF_BG_SCR_SIZE_256x256) { + return GX_BG_SCRSIZE_256x16PLTT_256x256; + } else if (size == GF_BG_SCR_SIZE_512x512) { + return GX_BG_SCRSIZE_256x16PLTT_512x512; + } else if (size == GF_BG_SCR_SIZE_1024x1024) { + return GX_BG_SCRSIZE_256x16PLTT_1024x1024; + } + break; } return GX_BG_SCRSIZE_TEXT_256x256; // GX_BG_SCRSIZE_AFFINE_128x128; GX_BG_SCRSIZE_256x16PLTT_128x128; @@ -494,30 +496,30 @@ static u8 TranslateGFBgModePairToGXScreenSize(enum GFBgScreenSize size, enum GFB static void GetBgScreenDimensions(u32 screenSize, u8 *widthPtr, u8 *heightPtr) { switch (screenSize) { - case GF_BG_SCR_SIZE_128x128: - *widthPtr = 0x10; - *heightPtr = 0x10; - break; - case GF_BG_SCR_SIZE_256x256: - *widthPtr = 0x20; - *heightPtr = 0x20; - break; - case GF_BG_SCR_SIZE_256x512: - *widthPtr = 0x20; - *heightPtr = 0x40; - break; - case GF_BG_SCR_SIZE_512x256: - *widthPtr = 0x40; - *heightPtr = 0x20; - break; - case GF_BG_SCR_SIZE_512x512: - *widthPtr = 0x40; - *heightPtr = 0x40; - break; - case GF_BG_SCR_SIZE_1024x1024: - *widthPtr = 0x80; - *heightPtr = 0x80; - break; + case GF_BG_SCR_SIZE_128x128: + *widthPtr = 0x10; + *heightPtr = 0x10; + break; + case GF_BG_SCR_SIZE_256x256: + *widthPtr = 0x20; + *heightPtr = 0x20; + break; + case GF_BG_SCR_SIZE_256x512: + *widthPtr = 0x20; + *heightPtr = 0x40; + break; + case GF_BG_SCR_SIZE_512x256: + *widthPtr = 0x40; + *heightPtr = 0x20; + break; + case GF_BG_SCR_SIZE_512x512: + *widthPtr = 0x40; + *heightPtr = 0x40; + break; + case GF_BG_SCR_SIZE_1024x1024: + *widthPtr = 0x80; + *heightPtr = 0x80; + break; } } @@ -530,60 +532,59 @@ void FreeBgTilemapBuffer(BgConfig *bgConfig, u8 bgId) { void SetBgPriority(u8 bgId, u16 priority) { switch (bgId) { - case GF_BG_LYR_MAIN_0: - G2_SetBG0Priority(priority); - break; - case GF_BG_LYR_MAIN_1: - G2_SetBG1Priority(priority); - break; - case GF_BG_LYR_MAIN_2: - G2_SetBG2Priority(priority); - break; - case GF_BG_LYR_MAIN_3: - G2_SetBG3Priority(priority); - break; - case GF_BG_LYR_SUB_0: - G2S_SetBG0Priority(priority); - break; - case GF_BG_LYR_SUB_1: - G2S_SetBG1Priority(priority); - break; - case GF_BG_LYR_SUB_2: - G2S_SetBG2Priority(priority); - break; - case GF_BG_LYR_SUB_3: - G2S_SetBG3Priority(priority); - break; + case GF_BG_LYR_MAIN_0: + G2_SetBG0Priority(priority); + break; + case GF_BG_LYR_MAIN_1: + G2_SetBG1Priority(priority); + break; + case GF_BG_LYR_MAIN_2: + G2_SetBG2Priority(priority); + break; + case GF_BG_LYR_MAIN_3: + G2_SetBG3Priority(priority); + break; + case GF_BG_LYR_SUB_0: + G2S_SetBG0Priority(priority); + break; + case GF_BG_LYR_SUB_1: + G2S_SetBG1Priority(priority); + break; + case GF_BG_LYR_SUB_2: + G2S_SetBG2Priority(priority); + break; + case GF_BG_LYR_SUB_3: + G2S_SetBG3Priority(priority); + break; } } -void ToggleBgLayer(u8 bgId, GXPlaneToggle toggle) -{ +void ToggleBgLayer(u8 bgId, GXPlaneToggle toggle) { switch (bgId) { - case GF_BG_LYR_MAIN_0: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_0_F, toggle); - break; - case GF_BG_LYR_MAIN_1: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_1_F, toggle); - break; - case GF_BG_LYR_MAIN_2: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_2_F, toggle); - break; - case GF_BG_LYR_MAIN_3: - GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_3_F, toggle); - break; - case GF_BG_LYR_SUB_0: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_0_F, toggle); - break; - case GF_BG_LYR_SUB_1: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_1_F, toggle); - break; - case GF_BG_LYR_SUB_2: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_2_F, toggle); - break; - case GF_BG_LYR_SUB_3: - GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_3_F, toggle); - break; + case GF_BG_LYR_MAIN_0: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_0_F, toggle); + break; + case GF_BG_LYR_MAIN_1: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_1_F, toggle); + break; + case GF_BG_LYR_MAIN_2: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_2_F, toggle); + break; + case GF_BG_LYR_MAIN_3: + GfGfx_EngineATogglePlanes(GF_BG_LYR_MAIN_3_F, toggle); + break; + case GF_BG_LYR_SUB_0: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_0_F, toggle); + break; + case GF_BG_LYR_SUB_1: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_1_F, toggle); + break; + case GF_BG_LYR_SUB_2: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_2_F, toggle); + break; + case GF_BG_LYR_SUB_3: + GfGfx_EngineBTogglePlanes(GF_BG_LYR_SUB_3_F, toggle); + break; } } @@ -593,47 +594,47 @@ void BgSetPosTextAndCommit(BgConfig *bgConfig, u8 bgId, enum BgPosAdjustOp op, f u32 x = (u32)bgConfig->bgs[bgId].hOffset; u32 y = (u32)bgConfig->bgs[bgId].vOffset; switch (bgId) { - case GF_BG_LYR_MAIN_0: - G2_SetBG0Offset(x, y); - break; - case GF_BG_LYR_MAIN_1: - G2_SetBG1Offset(x, y); - break; - case GF_BG_LYR_MAIN_2: - if (bgConfig->bgs[GF_BG_LYR_MAIN_2].mode == 0) { - G2_SetBG2Offset(x, y); - } else { - BgAffineReset(bgConfig, GF_BG_LYR_MAIN_2); - } + case GF_BG_LYR_MAIN_0: + G2_SetBG0Offset(x, y); + break; + case GF_BG_LYR_MAIN_1: + G2_SetBG1Offset(x, y); + break; + case GF_BG_LYR_MAIN_2: + if (bgConfig->bgs[GF_BG_LYR_MAIN_2].mode == 0) { + G2_SetBG2Offset(x, y); + } else { + BgAffineReset(bgConfig, GF_BG_LYR_MAIN_2); + } break; - case GF_BG_LYR_MAIN_3: - if (bgConfig->bgs[GF_BG_LYR_MAIN_3].mode == 0) { - G2_SetBG3Offset(x, y); - } else { - BgAffineReset(bgConfig, GF_BG_LYR_MAIN_3); - } - break; - case GF_BG_LYR_SUB_0: - G2S_SetBG0Offset(x, y); - break; - case GF_BG_LYR_SUB_1: - G2S_SetBG1Offset(x, y); - break; - case GF_BG_LYR_SUB_2: - if (bgConfig->bgs[GF_BG_LYR_SUB_2].mode == 0) { - G2S_SetBG2Offset(x, y); - } else { - BgAffineReset(bgConfig, GF_BG_LYR_SUB_2); - } - break; - case GF_BG_LYR_SUB_3: - if (bgConfig->bgs[GF_BG_LYR_SUB_3].mode == 0) { - G2S_SetBG3Offset(x, y); - } else { - BgAffineReset(bgConfig, GF_BG_LYR_SUB_3); - } - break; + case GF_BG_LYR_MAIN_3: + if (bgConfig->bgs[GF_BG_LYR_MAIN_3].mode == 0) { + G2_SetBG3Offset(x, y); + } else { + BgAffineReset(bgConfig, GF_BG_LYR_MAIN_3); + } + break; + case GF_BG_LYR_SUB_0: + G2S_SetBG0Offset(x, y); + break; + case GF_BG_LYR_SUB_1: + G2S_SetBG1Offset(x, y); + break; + case GF_BG_LYR_SUB_2: + if (bgConfig->bgs[GF_BG_LYR_SUB_2].mode == 0) { + G2S_SetBG2Offset(x, y); + } else { + BgAffineReset(bgConfig, GF_BG_LYR_SUB_2); + } + break; + case GF_BG_LYR_SUB_3: + if (bgConfig->bgs[GF_BG_LYR_SUB_3].mode == 0) { + G2S_SetBG3Offset(x, y); + } else { + BgAffineReset(bgConfig, GF_BG_LYR_SUB_3); + } + break; } } @@ -652,49 +653,49 @@ void Bg_SetTextDimAndAffineParams(BgConfig *bgConfig, u8 bgId, enum BgPosAdjustO static void Bg_SetPosText(Background *bg, enum BgPosAdjustOp op, fx32 val) { switch (op) { - case BG_POS_OP_SET_X: - bg->hOffset = val; - break; - case BG_POS_OP_ADD_X: - bg->hOffset += val; - break; - case BG_POS_OP_SUB_X: - bg->hOffset -= val; - break; - case BG_POS_OP_SET_Y: - bg->vOffset = val; - break; - case BG_POS_OP_ADD_Y: - bg->vOffset += val; - break; - case BG_POS_OP_SUB_Y: - bg->vOffset -= val; - break; + case BG_POS_OP_SET_X: + bg->hOffset = val; + break; + case BG_POS_OP_ADD_X: + bg->hOffset += val; + break; + case BG_POS_OP_SUB_X: + bg->hOffset -= val; + break; + case BG_POS_OP_SET_Y: + bg->vOffset = val; + break; + case BG_POS_OP_ADD_Y: + bg->vOffset += val; + break; + case BG_POS_OP_SUB_Y: + bg->vOffset -= val; + break; } } void SetBgAffine(BgConfig *bgConfig, u8 bgId, MtxFx22 *mtx, fx32 centerX, fx32 centerY) { switch (bgId) { - case GF_BG_LYR_MAIN_0: - break; - case GF_BG_LYR_MAIN_1: - break; - case GF_BG_LYR_MAIN_2: - G2_SetBG2Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); - break; - case GF_BG_LYR_MAIN_3: - G2_SetBG3Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); - break; - case GF_BG_LYR_SUB_0: - break; - case GF_BG_LYR_SUB_1: - break; - case GF_BG_LYR_SUB_2: - G2S_SetBG2Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); - break; - case GF_BG_LYR_SUB_3: - G2S_SetBG3Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); - break; + case GF_BG_LYR_MAIN_0: + break; + case GF_BG_LYR_MAIN_1: + break; + case GF_BG_LYR_MAIN_2: + G2_SetBG2Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); + break; + case GF_BG_LYR_MAIN_3: + G2_SetBG3Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); + break; + case GF_BG_LYR_SUB_0: + break; + case GF_BG_LYR_SUB_1: + break; + case GF_BG_LYR_SUB_2: + G2S_SetBG2Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); + break; + case GF_BG_LYR_SUB_3: + G2S_SetBG3Affine(mtx, centerX, centerY, bgConfig->bgs[bgId].hOffset, bgConfig->bgs[bgId].vOffset); + break; } } @@ -732,7 +733,7 @@ void BgCopyOrUncompressTilemapBufferRangeToVram(BgConfig *bgConfig, u8 bgId, con } u32 uncompSize = MI_GetUncompressedSize(buffer); - void *ptr = AllocFromHeapAtEnd(bgConfig->heapId, uncompSize); + void *ptr = AllocFromHeapAtEnd(bgConfig->heapId, uncompSize); CopyOrUncompressTilemapData(buffer, ptr, bufferSize); LoadBgVramScr(bgId, ptr, baseTile * 2, uncompSize); FreeToHeap(ptr); @@ -745,30 +746,30 @@ void BgCopyOrUncompressTilemapBufferRangeToVram(BgConfig *bgConfig, u8 bgId, con static void LoadBgVramScr(u8 bgId, const void *data, u32 offset, u32 size) { DC_FlushRange(data, size); switch (bgId) { - case GF_BG_LYR_MAIN_0: - GX_LoadBG0Scr(data, offset, size); - break; - case GF_BG_LYR_MAIN_1: - GX_LoadBG1Scr(data, offset, size); - break; - case GF_BG_LYR_MAIN_2: - GX_LoadBG2Scr(data, offset, size); - break; - case GF_BG_LYR_MAIN_3: - GX_LoadBG3Scr(data, offset, size); - break; - case GF_BG_LYR_SUB_0: - GXS_LoadBG0Scr(data, offset, size); - break; - case GF_BG_LYR_SUB_1: - GXS_LoadBG1Scr(data, offset, size); - break; - case GF_BG_LYR_SUB_2: - GXS_LoadBG2Scr(data, offset, size); - break; - case GF_BG_LYR_SUB_3: - GXS_LoadBG3Scr(data, offset, size); - break; + case GF_BG_LYR_MAIN_0: + GX_LoadBG0Scr(data, offset, size); + break; + case GF_BG_LYR_MAIN_1: + GX_LoadBG1Scr(data, offset, size); + break; + case GF_BG_LYR_MAIN_2: + GX_LoadBG2Scr(data, offset, size); + break; + case GF_BG_LYR_MAIN_3: + GX_LoadBG3Scr(data, offset, size); + break; + case GF_BG_LYR_SUB_0: + GXS_LoadBG0Scr(data, offset, size); + break; + case GF_BG_LYR_SUB_1: + GXS_LoadBG1Scr(data, offset, size); + break; + case GF_BG_LYR_SUB_2: + GXS_LoadBG2Scr(data, offset, size); + break; + case GF_BG_LYR_SUB_3: + GXS_LoadBG3Scr(data, offset, size); + break; } } @@ -786,7 +787,7 @@ void BG_LoadCharTilesData(BgConfig *bgConfig, u8 bgId, const void *data, u32 siz static void BG_LoadCharPixelData(BgConfig *bgConfig, u8 bgId, const void *buffer, u32 size, u32 offset) { if (size == 0) { - u32 uncompressedSize = MI_GetUncompressedSize(buffer); + u32 uncompressedSize = MI_GetUncompressedSize(buffer); void *uncompressedBuffer = AllocFromHeapAtEnd(bgConfig->heapId, uncompressedSize); CopyOrUncompressTilemapData(buffer, uncompressedBuffer, size); LoadBgVramChar(bgId, uncompressedBuffer, offset, uncompressedSize); @@ -800,30 +801,30 @@ static void BG_LoadCharPixelData(BgConfig *bgConfig, u8 bgId, const void *buffer static void LoadBgVramChar(u8 bgId, const void *data, u32 offset, u32 size) { DC_FlushRange(data, size); switch (bgId) { - case GF_BG_LYR_MAIN_0: - GX_LoadBG0Char(data, offset, size); - break; - case GF_BG_LYR_MAIN_1: - GX_LoadBG1Char(data, offset, size); - break; - case GF_BG_LYR_MAIN_2: - GX_LoadBG2Char(data, offset, size); - break; - case GF_BG_LYR_MAIN_3: - GX_LoadBG3Char(data, offset, size); - break; - case GF_BG_LYR_SUB_0: - GXS_LoadBG0Char(data, offset, size); - break; - case GF_BG_LYR_SUB_1: - GXS_LoadBG1Char(data, offset, size); - break; - case GF_BG_LYR_SUB_2: - GXS_LoadBG2Char(data, offset, size); - break; - case GF_BG_LYR_SUB_3: - GXS_LoadBG3Char(data, offset, size); - break; + case GF_BG_LYR_MAIN_0: + GX_LoadBG0Char(data, offset, size); + break; + case GF_BG_LYR_MAIN_1: + GX_LoadBG1Char(data, offset, size); + break; + case GF_BG_LYR_MAIN_2: + GX_LoadBG2Char(data, offset, size); + break; + case GF_BG_LYR_MAIN_3: + GX_LoadBG3Char(data, offset, size); + break; + case GF_BG_LYR_SUB_0: + GXS_LoadBG0Char(data, offset, size); + break; + case GF_BG_LYR_SUB_1: + GXS_LoadBG1Char(data, offset, size); + break; + case GF_BG_LYR_SUB_2: + GXS_LoadBG2Char(data, offset, size); + break; + case GF_BG_LYR_SUB_3: + GXS_LoadBG3Char(data, offset, size); + break; } } @@ -837,9 +838,9 @@ void BG_ClearCharDataRange(u8 bgId, u32 size, u32 offset, HeapID heapId) { void BG_FillCharDataRange(BgConfig *bgConfig, enum GFBgLayer bgId, u32 fillValue, u32 ntiles, u32 offset) { void *buffer; - u32 size = ntiles * bgConfig->bgs[bgId].tileSize; + u32 size = ntiles * bgConfig->bgs[bgId].tileSize; u32 value = fillValue; - buffer = AllocFromHeapAtEnd(bgConfig->heapId, size); + buffer = AllocFromHeapAtEnd(bgConfig->heapId, size); if (bgConfig->bgs[bgId].tileSize == TILE_SIZE_4BPP) { value = (value << 12) | (value << 8) | (value << 4) | (value << 0); @@ -870,28 +871,28 @@ void BG_SetMaskColor(u8 bgId, u16 value) { static u16 GetTileMapIndexFromCoords(u8 x, u8 y, u8 size) { switch (size) { - case GF_BG_SCR_SIZE_128x128: - return (u16)(x + (y << 4)); - case GF_BG_SCR_SIZE_256x256: - case GF_BG_SCR_SIZE_256x512: - return (u16)(x + (y << 5)); - case GF_BG_SCR_SIZE_512x256: - return (u16)((x & 0x1f) + ((y + (x & ~0x1f)) << 5)); - case GF_BG_SCR_SIZE_512x512: - u16 res = (u16)(((u16)((x >> 5) + (y >> 5) * 2)) << 10); - res += (x & 0x1f) + ((y & 0x1f) << 5); - return res; - case GF_BG_SCR_SIZE_1024x1024: - return 0; + case GF_BG_SCR_SIZE_128x128: + return (u16)(x + (y << 4)); + case GF_BG_SCR_SIZE_256x256: + case GF_BG_SCR_SIZE_256x512: + return (u16)(x + (y << 5)); + case GF_BG_SCR_SIZE_512x256: + return (u16)((x & 0x1f) + ((y + (x & ~0x1f)) << 5)); + case GF_BG_SCR_SIZE_512x512: + u16 res = (u16)(((u16)((x >> 5) + (y >> 5) * 2)) << 10); + res += (x & 0x1f) + ((y & 0x1f) << 5); + return res; + case GF_BG_SCR_SIZE_1024x1024: + return 0; } return x; } static u16 GetSrcTileMapIndexFromCoords(u8 x, u8 y, u8 width, u8 height) { - u8 coordType = 0; - u16 tilemapIndex = 0; - s16 adjustedWidth = width - 32; + u8 coordType = 0; + u16 tilemapIndex = 0; + s16 adjustedWidth = width - 32; s16 adjustedHeight = height - 32; if (x / 32) { @@ -903,34 +904,33 @@ static u16 GetSrcTileMapIndexFromCoords(u8 x, u8 y, u8 width, u8 height) { } switch (coordType) { - case 0: - if (adjustedWidth >= 0) - { - tilemapIndex += y * 32 + x; - } else { - tilemapIndex += y * width + x; - } - break; - case 1: - if (adjustedHeight >= 0) { - tilemapIndex += 1024; - } else { - tilemapIndex += height * 32; - } - tilemapIndex += y * adjustedWidth + (x & 0x1f); - break; - case 2: - tilemapIndex += width * 32; - if (adjustedWidth >= 0) { - tilemapIndex += (y & 0x1f) * 32 + x; - } else { - tilemapIndex += (y & 0x1f) * width + x; - } - break; - case 3: - tilemapIndex += width * 32 + adjustedHeight * 32; - tilemapIndex += (y & 0x1f) * adjustedWidth + (x & 0x1f); - break; + case 0: + if (adjustedWidth >= 0) { + tilemapIndex += y * 32 + x; + } else { + tilemapIndex += y * width + x; + } + break; + case 1: + if (adjustedHeight >= 0) { + tilemapIndex += 1024; + } else { + tilemapIndex += height * 32; + } + tilemapIndex += y * adjustedWidth + (x & 0x1f); + break; + case 2: + tilemapIndex += width * 32; + if (adjustedWidth >= 0) { + tilemapIndex += (y & 0x1f) * 32 + x; + } else { + tilemapIndex += (y & 0x1f) * width + x; + } + break; + case 3: + tilemapIndex += width * 32 + adjustedHeight * 32; + tilemapIndex += (y & 0x1f) * adjustedWidth + (x & 0x1f); + break; } return tilemapIndex; @@ -978,7 +978,7 @@ static void CopyToBgTilemapRectText(Background *bg, u8 destX, u8 destY, u8 destW if (destX + j >= screenWidth || srcX + j >= srcWidth) { break; } - tilemapBuffer[GetTileMapIndexFromCoords(destX + j, destY + i, bg->size)] = buffer[(srcY + i) * srcWidth + srcX +j]; + tilemapBuffer[GetTileMapIndexFromCoords(destX + j, destY + i, bg->size)] = buffer[(srcY + i) * srcWidth + srcX + j]; } } } else { @@ -1124,7 +1124,7 @@ void BgTilemapRectChangePalette(BgConfig *bgConfig, u8 bgId, u8 x, u8 y, u8 widt if (j >= screenWidth) { break; } - u16 pos = GetTileMapIndexFromCoords(j, i, bgConfig->bgs[bgId].size); + u16 pos = GetTileMapIndexFromCoords(j, i, bgConfig->bgs[bgId].size); tilemapBuffer[pos] = (tilemapBuffer[pos] & 0xFFF) | (palette << 12); } } @@ -1153,22 +1153,22 @@ void BgFillTilemapBufferAndSchedule(BgConfig *bgConfig, u8 bgId, u16 fillValue) void *BgGetCharPtr(u8 bgId) { switch (bgId) { - case GF_BG_LYR_MAIN_0: - return G2_GetBG0CharPtr(); - case GF_BG_LYR_MAIN_1: - return G2_GetBG1CharPtr(); - case GF_BG_LYR_MAIN_2: - return G2_GetBG2CharPtr(); - case GF_BG_LYR_MAIN_3: - return G2_GetBG3CharPtr(); - case GF_BG_LYR_SUB_0: - return G2S_GetBG0CharPtr(); - case GF_BG_LYR_SUB_1: - return G2S_GetBG1CharPtr(); - case GF_BG_LYR_SUB_2: - return G2S_GetBG2CharPtr(); - case GF_BG_LYR_SUB_3: - return G2S_GetBG3CharPtr(); + case GF_BG_LYR_MAIN_0: + return G2_GetBG0CharPtr(); + case GF_BG_LYR_MAIN_1: + return G2_GetBG1CharPtr(); + case GF_BG_LYR_MAIN_2: + return G2_GetBG2CharPtr(); + case GF_BG_LYR_MAIN_3: + return G2_GetBG3CharPtr(); + case GF_BG_LYR_SUB_0: + return G2S_GetBG0CharPtr(); + case GF_BG_LYR_SUB_1: + return G2S_GetBG1CharPtr(); + case GF_BG_LYR_SUB_2: + return G2S_GetBG2CharPtr(); + case GF_BG_LYR_SUB_3: + return G2S_GetBG3CharPtr(); } return NULL; @@ -1190,7 +1190,7 @@ static void Convert4bppTo8bppInternal(u8 *src4bpp, u32 size, u8 *dest8bpp, u8 pa } u8 *Convert4bppTo8bpp(u8 *src4Bpp, u32 size, u8 paletteNum, HeapID heapId) { - u8 *ptr = (u8*)AllocFromHeap(heapId, size * 2); + u8 *ptr = (u8 *)AllocFromHeap(heapId, size * 2); Convert4bppTo8bppInternal(src4Bpp, size, ptr, paletteNum); @@ -1207,58 +1207,58 @@ u16 GetBgRotation(BgConfig *bgConfig, u8 bgId) { u8 GetBgPriority(BgConfig *bgConfig, u8 bgId) { switch (bgId) { - case GF_BG_LYR_MAIN_0: - return G2_GetBG0Control().priority; - case GF_BG_LYR_MAIN_1: - return G2_GetBG1Control().priority; - case GF_BG_LYR_MAIN_2: - switch (bgConfig->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - return G2_GetBG2ControlText().priority; - case GF_BG_TYPE_AFFINE: - return G2_GetBG2ControlAffine().priority; - case GF_BG_TYPE_256x16PLTT: - return G2_GetBG2Control256x16Pltt().priority; - } - break; - case GF_BG_LYR_MAIN_3: - switch (bgConfig->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - return G2_GetBG3ControlText().priority; - case GF_BG_TYPE_AFFINE: - return G2_GetBG3ControlAffine().priority; - case GF_BG_TYPE_256x16PLTT: - return G2_GetBG3Control256x16Pltt().priority; - } - break; - case GF_BG_LYR_SUB_0: - return G2S_GetBG0Control().priority; - case GF_BG_LYR_SUB_1: - return G2S_GetBG1Control().priority; - case GF_BG_LYR_SUB_2: - switch (bgConfig->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - return G2S_GetBG2ControlText().priority; - case GF_BG_TYPE_AFFINE: - return G2S_GetBG2ControlAffine().priority; - case GF_BG_TYPE_256x16PLTT: - return G2S_GetBG2Control256x16Pltt().priority; - } - break; - case GF_BG_LYR_SUB_3: - switch (bgConfig->bgs[bgId].mode) { - default: - case GF_BG_TYPE_TEXT: - return G2S_GetBG3ControlText().priority; - case GF_BG_TYPE_AFFINE: - return G2S_GetBG3ControlAffine().priority; - case GF_BG_TYPE_256x16PLTT: - return G2S_GetBG3Control256x16Pltt().priority; - } - break; + case GF_BG_LYR_MAIN_0: + return G2_GetBG0Control().priority; + case GF_BG_LYR_MAIN_1: + return G2_GetBG1Control().priority; + case GF_BG_LYR_MAIN_2: + switch (bgConfig->bgs[bgId].mode) { + default: + case GF_BG_TYPE_TEXT: + return G2_GetBG2ControlText().priority; + case GF_BG_TYPE_AFFINE: + return G2_GetBG2ControlAffine().priority; + case GF_BG_TYPE_256x16PLTT: + return G2_GetBG2Control256x16Pltt().priority; + } + break; + case GF_BG_LYR_MAIN_3: + switch (bgConfig->bgs[bgId].mode) { + default: + case GF_BG_TYPE_TEXT: + return G2_GetBG3ControlText().priority; + case GF_BG_TYPE_AFFINE: + return G2_GetBG3ControlAffine().priority; + case GF_BG_TYPE_256x16PLTT: + return G2_GetBG3Control256x16Pltt().priority; + } + break; + case GF_BG_LYR_SUB_0: + return G2S_GetBG0Control().priority; + case GF_BG_LYR_SUB_1: + return G2S_GetBG1Control().priority; + case GF_BG_LYR_SUB_2: + switch (bgConfig->bgs[bgId].mode) { + default: + case GF_BG_TYPE_TEXT: + return G2S_GetBG2ControlText().priority; + case GF_BG_TYPE_AFFINE: + return G2S_GetBG2ControlAffine().priority; + case GF_BG_TYPE_256x16PLTT: + return G2S_GetBG2Control256x16Pltt().priority; + } + break; + case GF_BG_LYR_SUB_3: + switch (bgConfig->bgs[bgId].mode) { + default: + case GF_BG_TYPE_TEXT: + return G2S_GetBG3ControlText().priority; + case GF_BG_TYPE_AFFINE: + return G2S_GetBG3ControlAffine().priority; + case GF_BG_TYPE_256x16PLTT: + return G2S_GetBG3Control256x16Pltt().priority; + } + break; } return 0; @@ -1266,7 +1266,7 @@ u8 GetBgPriority(BgConfig *bgConfig, u8 bgId) { #define GetPixelAddressFromBlit4bpp(ptr, x, y, width) ((u8 *)((ptr) + (((x) >> 1) & 3) + (((x) << 2) & 0x3FE0) + ((((y) << 2) & 0x3FE0) * (width)) + (((u32)(((y) << 2) & 0x1C))))) #define GetPixelAddressFromBlit8bpp(ptr, x, y, width) ((u8 *)((ptr) + ((x) & 7) + (((x) << 3) & 0x7FC0) + ((((y) << 3) & 0x7FC0) * (width)) + (((u32)(((y) << 3) & 0x38))))) -#define ConvertPixelsToTiles(x) (((x) + ((x) & 7)) >> 3) +#define ConvertPixelsToTiles(x) (((x) + ((x) & 7)) >> 3) void BlitBitmapRect4Bit(const Bitmap *src, const Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u16 colorKey) { int xEnd, yEnd; @@ -1286,30 +1286,30 @@ void BlitBitmapRect4Bit(const Bitmap *src, const Bitmap *dest, u16 srcX, u16 src } else { yEnd = height + srcY; } - multiplierSrcY = ConvertPixelsToTiles(src->width); + multiplierSrcY = ConvertPixelsToTiles(src->width); multiplierDestY = ConvertPixelsToTiles(dest->width); if (colorKey == 0xFFFF) { for (loopSrcY = srcY, loopDestY = destY; loopSrcY < yEnd; loopSrcY++, loopDestY++) { for (loopSrcX = srcX, loopDestX = destX; loopSrcX < xEnd; loopSrcX++, loopDestX++) { - pixelsSrc = GetPixelAddressFromBlit4bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); + pixelsSrc = GetPixelAddressFromBlit4bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); pixelsDest = GetPixelAddressFromBlit4bpp(dest->pixels, loopDestX, loopDestY, multiplierDestY); - toOrr = (*pixelsSrc >> ((loopSrcX & 1) * 4)) & 0xF; - toShift = (loopDestX & 1) * 4; + toOrr = (*pixelsSrc >> ((loopSrcX & 1) * 4)) & 0xF; + toShift = (loopDestX & 1) * 4; *pixelsDest = ((toOrr << toShift) | (*pixelsDest & (0xF0 >> toShift))); } } } else { for (loopSrcY = srcY, loopDestY = destY; loopSrcY < yEnd; loopSrcY++, loopDestY++) { for (loopSrcX = srcX, loopDestX = destX; loopSrcX < xEnd; loopSrcX++, loopDestX++) { - pixelsSrc = GetPixelAddressFromBlit4bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); + pixelsSrc = GetPixelAddressFromBlit4bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); pixelsDest = GetPixelAddressFromBlit4bpp(dest->pixels, loopDestX, loopDestY, multiplierDestY); toOrr = (*pixelsSrc >> ((loopSrcX & 1) * 4)) & 0xF; if (toOrr != colorKey) { - toShift = (loopDestX & 1) * 4; - *pixelsDest = (u8) ((toOrr << toShift) | (*pixelsDest & (0xF0 >> toShift))); + toShift = (loopDestX & 1) * 4; + *pixelsDest = (u8)((toOrr << toShift) | (*pixelsDest & (0xF0 >> toShift))); } } } @@ -1333,13 +1333,13 @@ static void BlitBitmapRect8Bit(const struct Bitmap *src, const struct Bitmap *de } else { yEnd = height + srcY; } - multiplierSrcY = ConvertPixelsToTiles(src->width); + multiplierSrcY = ConvertPixelsToTiles(src->width); multiplierDestY = ConvertPixelsToTiles(dest->width); if (colorKey == 0xFFFF) { for (loopSrcY = srcY, loopDestY = destY; loopSrcY < yEnd; loopSrcY++, loopDestY++) { for (loopSrcX = srcX, loopDestX = destX; loopSrcX < xEnd; loopSrcX++, loopDestX++) { - pixelsSrc = GetPixelAddressFromBlit8bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); + pixelsSrc = GetPixelAddressFromBlit8bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); pixelsDest = GetPixelAddressFromBlit8bpp(dest->pixels, loopDestX, loopDestY, multiplierDestY); *pixelsDest = *pixelsSrc; @@ -1348,7 +1348,7 @@ static void BlitBitmapRect8Bit(const struct Bitmap *src, const struct Bitmap *de } else { for (loopSrcY = srcY, loopDestY = destY; loopSrcY < yEnd; loopSrcY++, loopDestY++) { for (loopSrcX = srcX, loopDestX = destX; loopSrcX < xEnd; loopSrcX++, loopDestX++) { - pixelsSrc = GetPixelAddressFromBlit8bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); + pixelsSrc = GetPixelAddressFromBlit8bpp(src->pixels, loopSrcX, loopSrcY, multiplierSrcY); pixelsDest = GetPixelAddressFromBlit8bpp(dest->pixels, loopDestX, loopDestY, multiplierDestY); if (*pixelsSrc != colorKey) { @@ -1403,7 +1403,7 @@ void FillBitmapRect8Bit(const Bitmap *surface, u16 x, u16 y, u16 width, u16 heig for (int i = y; i < yEnd; i++) { for (int j = x; j < xEnd; j++) { u8 *pixels = GetPixelAddressFromBlit8bpp(surface->pixels, j, i, blitWidth); - *pixels = fillValue; + *pixels = fillValue; } } } @@ -1417,16 +1417,16 @@ Window *AllocWindows(HeapID heapId, s32 num) { } void InitWindow(Window *window) { - window->bgConfig = NULL; - window->bgId = GF_BG_LYR_UNALLOC; + window->bgConfig = NULL; + window->bgId = GF_BG_LYR_UNALLOC; window->tilemapLeft = 0; - window->tilemapTop = 0; - window->width = 0; - window->height = 0; - window->paletteNum = 0; - window->baseTile = 0; + window->tilemapTop = 0; + window->width = 0; + window->height = 0; + window->paletteNum = 0; + window->baseTile = 0; window->pixelBuffer = NULL; - window->colorMode = GF_BG_CLR_4BPP; + window->colorMode = GF_BG_CLR_4BPP; } BOOL WindowIsInUse(const Window *window) { @@ -1447,16 +1447,16 @@ void AddWindowParameterized(BgConfig *bgConfig, Window *window, u8 bgId, u8 x, u if (buffer == NULL) { return; } - window->bgConfig = bgConfig; - window->bgId = bgId; + window->bgConfig = bgConfig; + window->bgId = bgId; window->tilemapLeft = x; - window->tilemapTop = y; - window->width = width; - window->height = height; - window->paletteNum = paletteNum; - window->baseTile = baseTile; + window->tilemapTop = y; + window->width = width; + window->height = height; + window->paletteNum = paletteNum; + window->baseTile = baseTile; window->pixelBuffer = buffer; - window->colorMode = bgConfig->bgs[bgId].colorMode == GX_BG_COLORMODE_16 ? GF_BG_CLR_4BPP : GF_BG_CLR_8BPP; + window->colorMode = bgConfig->bgs[bgId].colorMode == GX_BG_COLORMODE_16 ? GF_BG_CLR_4BPP : GF_BG_CLR_8BPP; } void AddTextWindowTopLeftCorner(BgConfig *bgConfig, Window *window, u8 width, u8 height, u16 baseTile, u8 paletteNum) { @@ -1468,12 +1468,12 @@ void AddTextWindowTopLeftCorner(BgConfig *bgConfig, Window *window, u8 width, u8 memset(ptr, paletteNum, size); // could cause a data protection abort if below is true if (ptr != NULL) { - window->bgConfig = bgConfig; - window->width = width; - window->height = height; - window->baseTile = baseTile; + window->bgConfig = bgConfig; + window->width = width; + window->height = height; + window->baseTile = baseTile; window->pixelBuffer = ptr; - window->colorMode = GF_BG_CLR_4BPP; + window->colorMode = GF_BG_CLR_4BPP; } } @@ -1484,14 +1484,14 @@ void AddWindow(BgConfig *bgConfig, Window *window, const WindowTemplate *templat void RemoveWindow(Window *window) { FreeToHeap(window->pixelBuffer); - window->bgConfig = NULL; - window->bgId = GF_BG_LYR_UNALLOC; + window->bgConfig = NULL; + window->bgId = GF_BG_LYR_UNALLOC; window->tilemapLeft = 0; - window->tilemapTop = 0; - window->width = 0; - window->height = 0; - window->paletteNum = 0; - window->baseTile = 0; + window->tilemapTop = 0; + window->width = 0; + window->height = 0; + window->paletteNum = 0; + window->baseTile = 0; window->pixelBuffer = NULL; } @@ -1526,14 +1526,14 @@ void PutWindowTilemap(Window *window) { } void PutWindowTilemapRectAnchoredTopLeft(Window *window, u8 width, u8 height) { - u8 widthBak = window->width; + u8 widthBak = window->width; u8 heightBak = window->height; - window->width = width; + window->width = width; window->height = height; sPutWindowTilemapFuncs[window->bgConfig->bgs[window->bgId].mode](window); - window->width = widthBak; + window->width = widthBak; window->height = heightBak; } @@ -1551,8 +1551,8 @@ static void PutWindowTilemap_TextMode(Window *window) { return; } - tile = window->baseTile; - tilemapRight = window->tilemapLeft + window->width; + tile = window->baseTile; + tilemapRight = window->tilemapLeft + window->width; tilemapBottom = window->tilemapTop + window->height; for (i = window->tilemapTop; i < tilemapBottom; i++) { @@ -1577,7 +1577,7 @@ static void PutWindowTilemap_AffineMode(Window *window) { tilemapWidth = sTilemapWidthByBufferSize[window->bgConfig->bgs[window->bgId].size]; tilemap = window->bgConfig->bgs[window->bgId].tilemapBuffer + window->tilemapTop * tilemapWidth + window->tilemapLeft; - tile = window->baseTile; + tile = window->baseTile; for (i = 0; i < window->height; i++) { for (j = 0; j < window->width; j++) { @@ -1596,9 +1596,9 @@ static void ClearWindowTilemapText(Window *window) { if (window->bgConfig->bgs[window->bgId].tilemapBuffer == NULL) { return; } - tilemap = window->bgConfig->bgs[window->bgId].tilemapBuffer; - tilemapWidth = sTilemapWidthByBufferSize[window->bgConfig->bgs[window->bgId].size]; - tilemapRight = window->tilemapLeft + window->width; + tilemap = window->bgConfig->bgs[window->bgId].tilemapBuffer; + tilemapWidth = sTilemapWidthByBufferSize[window->bgConfig->bgs[window->bgId].size]; + tilemapRight = window->tilemapLeft + window->width; tilemapBottom = window->tilemapTop + window->height; for (i = window->tilemapTop; i < tilemapBottom; i++) { for (j = window->tilemapLeft; j < tilemapRight; j++) { @@ -1617,7 +1617,7 @@ static void ClearWindowTilemapAffine(Window *window) { } tilemapWidth = sTilemapWidthByBufferSize[window->bgConfig->bgs[window->bgId].size]; - tilemap = window->bgConfig->bgs[window->bgId].tilemapBuffer + window->tilemapTop * tilemapWidth + window->tilemapLeft; + tilemap = window->bgConfig->bgs[window->bgId].tilemapBuffer + window->tilemapTop * tilemapWidth + window->tilemapLeft; for (i = 0; i < window->height; i++) { for (j = 0; j < window->width; j++) { tilemap[j] = 0; @@ -1687,7 +1687,7 @@ void FillWindowPixelBuffer(Window *window, u8 fillValue) { fillValue |= fillValue << 4; } - MI_CpuFillFast(window->pixelBuffer, ((fillValue << 0x18) | (fillValue << 0x10) | (fillValue << 0x8) | fillValue), window->bgConfig->bgs[window->bgId].tileSize * window->width * window->height); + MI_CpuFillFast(window->pixelBuffer, (fillValue << 0x18) | (fillValue << 0x10) | (fillValue << 0x8) | fillValue, window->bgConfig->bgs[window->bgId].tileSize * window->width * window->height); } void BlitBitmapRectToWindow(Window *window, void *src, u16 srcX, u16 srcY, u16 srcWidth, u16 srcHeight, u16 destX, u16 destY, u16 destWidth, u16 destHeight) { @@ -1698,11 +1698,11 @@ void BlitBitmapRect(Window *window, void *src, u16 srcX, u16 srcY, u16 srcWidth, Bitmap bmpSrc, bmpDest; bmpSrc.pixels = src; - bmpSrc.width = srcWidth; + bmpSrc.width = srcWidth; bmpSrc.height = srcHeight; bmpDest.pixels = window->pixelBuffer; - bmpDest.width = window->width * 8; + bmpDest.width = window->width * 8; bmpDest.height = window->height * 8; if (window->bgConfig->bgs[window->bgId].colorMode == GF_BG_CLR_4BPP) { @@ -1716,7 +1716,7 @@ void FillWindowPixelRect(Window *window, u8 fillValue, u16 x, u16 y, u16 width, Bitmap bmp; bmp.pixels = window->pixelBuffer; - bmp.width = window->width * 8; + bmp.width = window->width * 8; bmp.height = window->height * 8; if (window->bgConfig->bgs[window->bgId].colorMode == GF_BG_CLR_4BPP) { @@ -1726,97 +1726,99 @@ void FillWindowPixelRect(Window *window, u8 fillValue, u16 x, u16 y, u16 width, } } -#define GLYPH_COPY_4BPP(glyphPixels, srcX, srcY, srcWidth, srcHeight, windowPixels, destX, destY, destWidth, table) { \ - int srcJ, destJ, srcI, destI, bits; \ - u8 toOrr; \ - u8 tableFlag; \ - u8 tableBit; \ - u8 *dest; \ - const u8 *src; \ - u32 pixelData; \ - \ - src = glyphPixels + (srcY / 8 * 64) + (srcX / 8 * 32); \ - if (srcY == 0) { \ - destI = destY + srcY; \ - tableBit = table & 0xFF; \ - } else { \ - destI = destY + srcY; \ - for (srcI = 0; srcI < 8; srcI++) { \ - if (((table >> srcI) & 1) != 0) { \ - destI++; \ - } \ - } \ - tableBit = table >> 8; \ - } \ - for (srcI = 0; srcI < srcHeight; srcI++) { \ - pixelData = *(u32 *)src; \ - tableFlag = (tableBit >> srcI) & 1; \ - for (srcJ = 0, destJ = destX + srcX; srcJ < srcWidth; srcJ++, destJ++) { \ - dest = GetPixelAddressFromBlit4bpp(windowPixels, destJ, destI, destWidth); \ - toOrr = (pixelData >> (srcJ * 4)) & 0xF; \ - if (toOrr != 0) { \ - bits = (destJ & 1) * 4; \ - toOrr = (toOrr << bits) | (*dest & (0xF0 >> bits)); \ - *dest = toOrr; \ - if (tableFlag) { \ - dest = GetPixelAddressFromBlit4bpp(windowPixels, destJ, destI + 1, destWidth); \ - *dest = toOrr; \ - } \ - } \ - } \ - if (tableFlag) { \ - destI += 2; \ - } else { \ - destI += 1; \ - } \ - src += 4; \ - } \ -} - -#define GLYPH_COPY_8BPP(glyphPixels, srcX, srcY, srcWidth, srcHeight, windowPixels, destX, destY, destWidth, table) { \ - int srcJ, destJ, srcI, destI; \ - u8 toOrr; \ - u8 tableFlag; \ - u8 tableBit; \ - u8 *dest; \ - const u8 *src; \ - u8 *pixelData; \ - \ - src = glyphPixels + (srcY / 8 * 128) + (srcX / 8 * 64); \ - if (srcY == 0) { \ - destI = destY + srcY; \ - tableBit = table & 0xFF; \ - } else { \ - destI = destY + srcY; \ - for (srcI = 0; srcI < 8; srcI++) { \ - if (((table >> srcI) & 1) != 0) { \ - destI++; \ - } \ - } \ - tableBit = table >> 8; \ - } \ - for (srcI = 0; srcI < srcHeight; srcI++) { \ - pixelData = (u8 *)src; \ - tableFlag = (tableBit >> srcI) & 1; \ - for (srcJ = 0, destJ = destX + srcX; srcJ < srcWidth; srcJ++, destJ++) { \ - dest = GetPixelAddressFromBlit8bpp(windowPixels, destJ, destI, destWidth); \ - toOrr = pixelData[srcJ]; \ - if (toOrr != 0) { \ - *dest = toOrr; \ - if (tableFlag) { \ - dest = GetPixelAddressFromBlit8bpp(windowPixels, destJ, destI + 1, destWidth); \ - *dest = toOrr; \ - } \ - } \ - } \ - if (tableFlag) { \ - destI += 2; \ - } else { \ - destI += 1; \ - } \ - src += 8; \ - } \ -} +#define GLYPH_COPY_4BPP(glyphPixels, srcX, srcY, srcWidth, srcHeight, windowPixels, destX, destY, destWidth, table) \ + { \ + int srcJ, destJ, srcI, destI, bits; \ + u8 toOrr; \ + u8 tableFlag; \ + u8 tableBit; \ + u8 *dest; \ + const u8 *src; \ + u32 pixelData; \ + \ + src = glyphPixels + (srcY / 8 * 64) + (srcX / 8 * 32); \ + if (srcY == 0) { \ + destI = destY + srcY; \ + tableBit = table & 0xFF; \ + } else { \ + destI = destY + srcY; \ + for (srcI = 0; srcI < 8; srcI++) { \ + if (((table >> srcI) & 1) != 0) { \ + destI++; \ + } \ + } \ + tableBit = table >> 8; \ + } \ + for (srcI = 0; srcI < srcHeight; srcI++) { \ + pixelData = *(u32 *)src; \ + tableFlag = (tableBit >> srcI) & 1; \ + for (srcJ = 0, destJ = destX + srcX; srcJ < srcWidth; srcJ++, destJ++) { \ + dest = GetPixelAddressFromBlit4bpp(windowPixels, destJ, destI, destWidth); \ + toOrr = (pixelData >> (srcJ * 4)) & 0xF; \ + if (toOrr != 0) { \ + bits = (destJ & 1) * 4; \ + toOrr = (toOrr << bits) | (*dest & (0xF0 >> bits)); \ + *dest = toOrr; \ + if (tableFlag) { \ + dest = GetPixelAddressFromBlit4bpp(windowPixels, destJ, destI + 1, destWidth); \ + *dest = toOrr; \ + } \ + } \ + } \ + if (tableFlag) { \ + destI += 2; \ + } else { \ + destI += 1; \ + } \ + src += 4; \ + } \ + } + +#define GLYPH_COPY_8BPP(glyphPixels, srcX, srcY, srcWidth, srcHeight, windowPixels, destX, destY, destWidth, table) \ + { \ + int srcJ, destJ, srcI, destI; \ + u8 toOrr; \ + u8 tableFlag; \ + u8 tableBit; \ + u8 *dest; \ + const u8 *src; \ + u8 *pixelData; \ + \ + src = glyphPixels + (srcY / 8 * 128) + (srcX / 8 * 64); \ + if (srcY == 0) { \ + destI = destY + srcY; \ + tableBit = table & 0xFF; \ + } else { \ + destI = destY + srcY; \ + for (srcI = 0; srcI < 8; srcI++) { \ + if (((table >> srcI) & 1) != 0) { \ + destI++; \ + } \ + } \ + tableBit = table >> 8; \ + } \ + for (srcI = 0; srcI < srcHeight; srcI++) { \ + pixelData = (u8 *)src; \ + tableFlag = (tableBit >> srcI) & 1; \ + for (srcJ = 0, destJ = destX + srcX; srcJ < srcWidth; srcJ++, destJ++) { \ + dest = GetPixelAddressFromBlit8bpp(windowPixels, destJ, destI, destWidth); \ + toOrr = pixelData[srcJ]; \ + if (toOrr != 0) { \ + *dest = toOrr; \ + if (tableFlag) { \ + dest = GetPixelAddressFromBlit8bpp(windowPixels, destJ, destI + 1, destWidth); \ + *dest = toOrr; \ + } \ + } \ + } \ + if (tableFlag) { \ + destI += 2; \ + } else { \ + destI += 1; \ + } \ + src += 8; \ + } \ + } void CopyGlyphToWindow(Window *window, u8 *glyphPixels, u16 srcWidth, u16 srcHeight, u16 destX, u16 destY, u16 table) { u8 *windowPixels; @@ -1825,8 +1827,8 @@ void CopyGlyphToWindow(Window *window, u8 *glyphPixels, u16 srcWidth, u16 srcHei u8 glyphSizeParam; windowPixels = (u8 *)window->pixelBuffer; - destWidth = (u16)(window->width * 8); - destHeight = (u16)(window->height * 8); + destWidth = (u16)(window->width * 8); + destHeight = (u16)(window->height * 8); // Don't overflow the window if (destWidth - destX < srcWidth) { @@ -1852,51 +1854,51 @@ void CopyGlyphToWindow(Window *window, u8 *glyphPixels, u16 srcWidth, u16 srcHei if (window->colorMode == GF_BG_CLR_4BPP) { switch (glyphSizeParam) { - case 0: // 1x1 - GLYPH_COPY_4BPP(glyphPixels, 0, 0, srcRight, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - return; - - case 1: // 2x1 - GLYPH_COPY_4BPP(glyphPixels, 0, 0, 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_4BPP(glyphPixels, 8, 0, srcRight - 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - return; - - case 2: // 1x2 - GLYPH_COPY_4BPP(glyphPixels, 0, 0, srcRight, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_4BPP(glyphPixels, 0, 8, srcRight, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - return; - - case 3: // 2x2 - GLYPH_COPY_4BPP(glyphPixels, 0, 0, 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_4BPP(glyphPixels, 8, 0, srcRight - 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_4BPP(glyphPixels, 0, 8, 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_4BPP(glyphPixels, 8, 8, srcRight - 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - return; + case 0: // 1x1 + GLYPH_COPY_4BPP(glyphPixels, 0, 0, srcRight, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + return; + + case 1: // 2x1 + GLYPH_COPY_4BPP(glyphPixels, 0, 0, 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_4BPP(glyphPixels, 8, 0, srcRight - 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + return; + + case 2: // 1x2 + GLYPH_COPY_4BPP(glyphPixels, 0, 0, srcRight, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_4BPP(glyphPixels, 0, 8, srcRight, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + return; + + case 3: // 2x2 + GLYPH_COPY_4BPP(glyphPixels, 0, 0, 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_4BPP(glyphPixels, 8, 0, srcRight - 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_4BPP(glyphPixels, 0, 8, 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_4BPP(glyphPixels, 8, 8, srcRight - 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + return; } } else { // 8bpp u8 *convertedSrc; convertedSrc = Convert4bppTo8bpp(glyphPixels, srcWidth * 4 * srcHeight * 8, window->paletteNum, window->bgConfig->heapId); switch (glyphSizeParam) { - case 0: // 1x1 - GLYPH_COPY_8BPP(convertedSrc, 0, 0, srcRight, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - break; + case 0: // 1x1 + GLYPH_COPY_8BPP(convertedSrc, 0, 0, srcRight, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + break; - case 1: // 2x1 - GLYPH_COPY_8BPP(convertedSrc, 0, 0, 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_8BPP(convertedSrc, 8, 0, srcRight - 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - break; + case 1: // 2x1 + GLYPH_COPY_8BPP(convertedSrc, 0, 0, 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_8BPP(convertedSrc, 8, 0, srcRight - 8, srcBottom, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + break; - case 2: // 1x2 - GLYPH_COPY_8BPP(convertedSrc, 0, 0, srcRight, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_8BPP(convertedSrc, 0, 8, srcRight, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - break; + case 2: // 1x2 + GLYPH_COPY_8BPP(convertedSrc, 0, 0, srcRight, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_8BPP(convertedSrc, 0, 8, srcRight, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + break; - case 3: // 2x2 - GLYPH_COPY_8BPP(convertedSrc, 0, 0, 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_8BPP(convertedSrc, 8, 0, srcRight - 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_8BPP(convertedSrc, 0, 8, 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - GLYPH_COPY_8BPP(convertedSrc, 8, 8, srcRight - 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); - break; + case 3: // 2x2 + GLYPH_COPY_8BPP(convertedSrc, 0, 0, 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_8BPP(convertedSrc, 8, 0, srcRight - 8, 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_8BPP(convertedSrc, 0, 8, 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + GLYPH_COPY_8BPP(convertedSrc, 8, 8, srcRight - 8, srcBottom - 8, windowPixels, destX, destY, ConvertPixelsToTiles(destWidth), table); + break; } FreeToHeap(convertedSrc); } @@ -1918,45 +1920,45 @@ static void ScrollWindow4bpp(Window *window, u8 direction, u8 y, u8 fillValue) { int i, j; pixelBuffer = window->pixelBuffer; - fillWord = (fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0); - size = window->height * window->width * TILE_SIZE_4BPP; - width = window->width; + fillWord = (fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0); + size = window->height * window->width * TILE_SIZE_4BPP; + width = window->width; switch (direction) { - case 0: // up - for (i = 0; i < size; i += TILE_SIZE_4BPP) { - y0 = y; - for (j = 0; j < 8; j++) { - y1 = i + (j << 2); - y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 2); - if (y2 < size) { - *(u32 *)(pixelBuffer + y1) = *(u32 *)(pixelBuffer + y2); - } else { - *(u32 *)(pixelBuffer + y1) = fillWord; - } - y0++; + case 0: // up + for (i = 0; i < size; i += TILE_SIZE_4BPP) { + y0 = y; + for (j = 0; j < 8; j++) { + y1 = i + (j << 2); + y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 2); + if (y2 < size) { + *(u32 *)(pixelBuffer + y1) = *(u32 *)(pixelBuffer + y2); + } else { + *(u32 *)(pixelBuffer + y1) = fillWord; } + y0++; } - break; - case 1: // down - pixelBuffer += size - 4; - for (i = 0; i < size; i += TILE_SIZE_4BPP) { - y0 = y; - for (j = 0; j < 8; j++) { - y1 = i + (j << 2); - y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 2); - if (y2 < size) { - *(u32 *)(pixelBuffer - y1) = *(u32 *)(pixelBuffer - y2); - } else { - *(u32 *)(pixelBuffer - y1) = fillWord; - } - y0++; + } + break; + case 1: // down + pixelBuffer += size - 4; + for (i = 0; i < size; i += TILE_SIZE_4BPP) { + y0 = y; + for (j = 0; j < 8; j++) { + y1 = i + (j << 2); + y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 2); + if (y2 < size) { + *(u32 *)(pixelBuffer - y1) = *(u32 *)(pixelBuffer - y2); + } else { + *(u32 *)(pixelBuffer - y1) = fillWord; } + y0++; } - break; - case 2: // left - case 3: // right - break; + } + break; + case 2: // left + case 3: // right + break; } } @@ -1968,59 +1970,59 @@ static void ScrollWindow8bpp(Window *window, u8 direction, u8 y, u8 fillValue) { int i, j; pixelBuffer = window->pixelBuffer; - fillWord = (fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0); - size = window->height * window->width * TILE_SIZE_8BPP; - width = window->width; + fillWord = (fillValue << 24) | (fillValue << 16) | (fillValue << 8) | (fillValue << 0); + size = window->height * window->width * TILE_SIZE_8BPP; + width = window->width; switch (direction) { - case 0: // up - for (i = 0; i < size; i += TILE_SIZE_8BPP) { - y0 = y; - for (j = 0; j < 8; j++) { - y1 = i + (j << 3); - y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 3); - if (y2 < size) { - *(u32 *)(pixelBuffer + y1) = *(u32 *)(pixelBuffer + y2); - } else { - *(u32 *)(pixelBuffer + y1) = fillWord; - } - y1 += 4; - y2 += 4; - if (y2 < size + 4) { - *(u32 *)(pixelBuffer + y1) = *(u32 *)(pixelBuffer + y2); - } else { - *(u32 *)(pixelBuffer + y1) = fillWord; - } - y0++; + case 0: // up + for (i = 0; i < size; i += TILE_SIZE_8BPP) { + y0 = y; + for (j = 0; j < 8; j++) { + y1 = i + (j << 3); + y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 3); + if (y2 < size) { + *(u32 *)(pixelBuffer + y1) = *(u32 *)(pixelBuffer + y2); + } else { + *(u32 *)(pixelBuffer + y1) = fillWord; + } + y1 += 4; + y2 += 4; + if (y2 < size + 4) { + *(u32 *)(pixelBuffer + y1) = *(u32 *)(pixelBuffer + y2); + } else { + *(u32 *)(pixelBuffer + y1) = fillWord; } + y0++; } - break; - case 1: // down - pixelBuffer += size - 8; - for (i = 0; i < size; i += TILE_SIZE_8BPP) { - y0 = y; - for (j = 0; j < 8; j++) { - y1 = i + (j << 3); - y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 3); - if (y2 < size) { - *(u32 *)(pixelBuffer - y1) = *(u32 *)(pixelBuffer - y2); - } else { - *(u32 *)(pixelBuffer - y1) = fillWord; - } - y1 -= 4; - y2 -= 4; - if (y2 < size - 4) { - *(u32 *)(pixelBuffer - y1) = *(u32 *)(pixelBuffer - y2); - } else { - *(u32 *)(pixelBuffer - y1) = fillWord; - } - y0++; + } + break; + case 1: // down + pixelBuffer += size - 8; + for (i = 0; i < size; i += TILE_SIZE_8BPP) { + y0 = y; + for (j = 0; j < 8; j++) { + y1 = i + (j << 3); + y2 = i + (((width * (y0 & ~7)) | (y0 & 7)) << 3); + if (y2 < size) { + *(u32 *)(pixelBuffer - y1) = *(u32 *)(pixelBuffer - y2); + } else { + *(u32 *)(pixelBuffer - y1) = fillWord; } + y1 -= 4; + y2 -= 4; + if (y2 < size - 4) { + *(u32 *)(pixelBuffer - y1) = *(u32 *)(pixelBuffer - y2); + } else { + *(u32 *)(pixelBuffer - y1) = fillWord; + } + y0++; } - break; - case 2: // left - case 3: // right - break; + } + break; + case 2: // left + case 3: // right + break; } } @@ -2076,7 +2078,7 @@ NNSG2dPaletteData *LoadPaletteDataFromFile(void **pltt_ret, HeapID heapId, const void DoScheduledBgGpuUpdates(BgConfig *bgConfig) { BgConfig_HandleScheduledScrolls(bgConfig); BgConfig_HandleScheduledBufferTransfers(bgConfig); - bgConfig->scrollScheduled = 0; + bgConfig->scrollScheduled = 0; bgConfig->bufferTransferScheduled = 0; } @@ -2102,8 +2104,7 @@ static void BgConfig_HandleScheduledBufferTransfers(BgConfig *bgConfig) { if (bgConfig->bufferTransferScheduled & (1 << GF_BG_LYR_SUB_2)) { LoadBgVramScr(GF_BG_LYR_SUB_2, bgConfig->bgs[GF_BG_LYR_SUB_2].tilemapBuffer, bgConfig->bgs[GF_BG_LYR_SUB_2].baseTile * 2, bgConfig->bgs[GF_BG_LYR_SUB_2].bufferSize); } - if (bgConfig->bufferTransferScheduled & (1 << GF_BG_LYR_SUB_3)) - { + if (bgConfig->bufferTransferScheduled & (1 << GF_BG_LYR_SUB_3)) { LoadBgVramScr(GF_BG_LYR_SUB_3, bgConfig->bgs[GF_BG_LYR_SUB_3].tilemapBuffer, bgConfig->bgs[GF_BG_LYR_SUB_3].baseTile * 2, bgConfig->bgs[GF_BG_LYR_SUB_3].bufferSize); } } @@ -2168,22 +2169,22 @@ void ScheduleSetBgPosText(BgConfig *bgConfig, u8 bgId, enum BgPosAdjustOp op, fx bgConfig->scrollScheduled |= 1 << bgId; } -void ScheduleSetBgAffineRotation( BgConfig *bgConfig, u8 bgId, enum BgPosAdjustOp op, u16 value) { +void ScheduleSetBgAffineRotation(BgConfig *bgConfig, u8 bgId, enum BgPosAdjustOp op, u16 value) { Bg_SetAffineRotation(&bgConfig->bgs[bgId], op, value); bgConfig->scrollScheduled |= 1 << bgId; } static void Bg_SetAffineRotation(Background *bg, enum BgPosAdjustOp op, u16 val) { switch (op) { - case BG_POS_OP_SET_ROT: - bg->rotation = val; - break; - case BG_POS_OP_ADD_ROT: - bg->rotation += val; - break; - case BG_POS_OP_SUB_ROT: - bg->rotation -= val; - break; + case BG_POS_OP_SET_ROT: + bg->rotation = val; + break; + case BG_POS_OP_ADD_ROT: + bg->rotation += val; + break; + case BG_POS_OP_SUB_ROT: + bg->rotation -= val; + break; } } @@ -2194,24 +2195,24 @@ void ScheduleSetBgAffinePos(BgConfig *bgConfig, u8 bgId, enum BgPosAdjustOp op, static void Bg_SetAffinePos(Background *bg, enum BgPosAdjustOp op, fx32 val) { switch (op) { - case BG_POS_OP_SET_CENTERX: - bg->centerX = val; - break; - case BG_POS_OP_ADD_CENTERX: - bg->centerX += val; - break; - case BG_POS_OP_SUB_CENTERX: - bg->centerX -= val; - break; - case BG_POS_OP_SET_CENTERY: - bg->centerY = val; - break; - case BG_POS_OP_ADD_CENTERY: - bg->centerY += val; - break; - case BG_POS_OP_SUB_CENTERY: - bg->centerY -= val; - break; + case BG_POS_OP_SET_CENTERX: + bg->centerX = val; + break; + case BG_POS_OP_ADD_CENTERX: + bg->centerX += val; + break; + case BG_POS_OP_SUB_CENTERX: + bg->centerX -= val; + break; + case BG_POS_OP_SET_CENTERY: + bg->centerY = val; + break; + case BG_POS_OP_ADD_CENTERY: + bg->centerY += val; + break; + case BG_POS_OP_SUB_CENTERY: + bg->centerY -= val; + break; } } @@ -2227,16 +2228,16 @@ BOOL DoesPixelAtScreenXYMatchPtrVal(BgConfig *bgConfig, u8 bgId, u8 x, u8 y, u16 } tilemapIdx = GetTileMapIndexFromCoords(x >> 3, y >> 3, bgConfig->bgs[bgId].size); - bgCharPtr = BgGetCharPtr(bgId); - xPixOffs = x & 7; - yPixOffs = y & 7; + bgCharPtr = BgGetCharPtr(bgId); + xPixOffs = x & 7; + yPixOffs = y & 7; if (bgConfig->bgs[bgId].colorMode == GX_BG_COLORMODE_16) { u16 *tilemapBuffer = bgConfig->bgs[bgId].tilemapBuffer; - u8 *tile = AllocFromHeapAtEnd(bgConfig->heapId, 0x40); + u8 *tile = AllocFromHeapAtEnd(bgConfig->heapId, 0x40); bgCharPtr += (tilemapBuffer[tilemapIdx] & 0x3FF) * TILE_SIZE_4BPP; for (i = 0; i < TILE_SIZE_4BPP; i++) { - tile[i * 2] = bgCharPtr[i] & 0xF; + tile[i * 2] = bgCharPtr[i] & 0xF; tile[i * 2 + 1] = bgCharPtr[i] >> 4; } ApplyFlipFlagsToTile(bgConfig, (tilemapBuffer[tilemapIdx] >> 10) & 3, tile); @@ -2248,7 +2249,7 @@ BOOL DoesPixelAtScreenXYMatchPtrVal(BgConfig *bgConfig, u8 bgId, u8 x, u8 y, u16 } else { if (bgConfig->bgs[bgId].mode != GF_BG_TYPE_AFFINE) { u16 *tilemapBuffer = bgConfig->bgs[bgId].tilemapBuffer; - u8 *tile = AllocFromHeapAtEnd(bgConfig->heapId, 0x40); + u8 *tile = AllocFromHeapAtEnd(bgConfig->heapId, 0x40); memcpy(tile, bgCharPtr + (tilemapBuffer[tilemapIdx] & 0x3FF) * TILE_SIZE_8BPP, TILE_SIZE_8BPP); ApplyFlipFlagsToTile(bgConfig, (tilemapBuffer[tilemapIdx] >> 10) & 3, tile); diff --git a/arm9/src/blackout.c b/arm9/src/blackout.c index a2e09402e..0cf9c3846 100644 --- a/arm9/src/blackout.c +++ b/arm9/src/blackout.c @@ -1,13 +1,16 @@ #include "blackout.h" -#include "bg_window.h" -#include "brightness.h" + #include "constants/maps.h" #include "constants/rgb.h" + +#include "graphic/font.naix" #include "msgdata/msg.naix" #include "msgdata/msg/narc_0328.h" -#include "graphic/font.naix" -#include "gf_gfx_loader.h" + #include "PAD_pad.h" +#include "bg_window.h" +#include "brightness.h" +#include "gf_gfx_loader.h" #include "render_window.h" #include "save_local_field_data.h" #include "script.h" //TODO: temp include, remove when structs are split @@ -35,48 +38,48 @@ extern void sub_0204AB0C(void); extern u16 GetMomSpawnId(void); static const struct GraphicsBanks sBlackoutGraphicsBanks = { - .bg = GX_VRAM_BG_128_B, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_128_C, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_64_E, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_16_I, + .bg = GX_VRAM_BG_128_B, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_128_C, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_64_E, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_16_I, .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_0_A, - .texpltt = GX_VRAM_TEXPLTT_01_FG, + .tex = GX_VRAM_TEX_0_A, + .texpltt = GX_VRAM_TEXPLTT_01_FG, }; static const struct GraphicsModes sBlackoutGraphicsModes = { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, ._2d3dMode = GX_BG0_AS_2D, }; static const BgTemplate sBlackoutBgTemplate = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0, - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, + .baseTile = 0, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, .screenBase = GX_BG_SCRBASE_0xf800, - .charBase = GX_BG_CHARBASE_0x00000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE + .charBase = GX_BG_CHARBASE_0x00000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE }; static const WindowTemplate sBlackoutWindowTemplate = { - .bgId = GF_BG_LYR_MAIN_3, - .left = 4, - .top = 5, - .width = 25, - .height = 15, - .palette = 13, + .bgId = GF_BG_LYR_MAIN_3, + .left = 4, + .top = 5, + .width = 25, + .height = 15, + .palette = 13, .baseTile = 0x01 }; @@ -92,13 +95,13 @@ static void Blackout_DrawMessage(FieldSystem *fieldSystem, TaskManager *taskMana GF_ASSERT(env != NULL); memset(env, 0, sizeof(BlackoutScreenEnvironment)); - env->state = 0; + env->state = 0; env->fieldSystem = fieldSystem; - env->bgConfig = BgConfig_Alloc(HEAP_ID_FIELD); + env->bgConfig = BgConfig_Alloc(HEAP_ID_FIELD); Blackout_InitDisplays(env->bgConfig); env->msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0328_bin, HEAP_ID_FIELD); - env->msgFmt = MessageFormat_New(HEAP_ID_FIELD); + env->msgFmt = MessageFormat_New(HEAP_ID_FIELD); AddWindow(env->bgConfig, &env->window, &sBlackoutWindowTemplate); @@ -125,36 +128,36 @@ enum { static BOOL Task_ShowPrintedBlackoutMessage(TaskManager *taskManager) { BlackoutScreenEnvironment *env = TaskManager_GetEnvironment(taskManager); switch (env->state) { - case STATE_SHOW_PRINTED_BLACKOUT_FADE_IN: - BeginNormalPaletteFade(3, 1, 42, RGB_BLACK, 8, 1, HEAP_ID_32); + case STATE_SHOW_PRINTED_BLACKOUT_FADE_IN: + BeginNormalPaletteFade(3, 1, 42, RGB_BLACK, 8, 1, HEAP_ID_32); + env->state++; + break; + case STATE_SHOW_PRINTED_BLACKOUT_FADE_IN_WAIT: + if (IsPaletteFadeFinished()) { + env->state++; + } + break; + case STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_INPUT: + if (gSystem.newKeys & PAD_BUTTON_A || gSystem.newKeys & PAD_BUTTON_B) { + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 8, 1, HEAP_ID_32); env->state++; - break; - case STATE_SHOW_PRINTED_BLACKOUT_FADE_IN_WAIT: - if (IsPaletteFadeFinished()) { - env->state++; - } - break; - case STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_INPUT: - if (gSystem.newKeys & PAD_BUTTON_A || gSystem.newKeys & PAD_BUTTON_B) { - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 8, 1, HEAP_ID_32); - env->state++; - } - break; - case STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_WAIT: - if (IsPaletteFadeFinished()) { - FillWindowPixelBuffer(&env->window, 0); - env->state++; - } - break; - case STATE_SHOW_PRINTED_BLACKOUT_CLEANUP: - ClearFrameAndWindow2(&env->window, FALSE); - RemoveWindow(&env->window); - MessageFormat_Delete(env->msgFmt); - DestroyMsgData(env->msgData); - FreeBgTilemapBuffer(env->bgConfig, GF_BG_LYR_MAIN_3); - FreeToHeap(env->bgConfig); - FreeToHeap(env); - return TRUE; + } + break; + case STATE_SHOW_PRINTED_BLACKOUT_FADE_OUT_WAIT: + if (IsPaletteFadeFinished()) { + FillWindowPixelBuffer(&env->window, 0); + env->state++; + } + break; + case STATE_SHOW_PRINTED_BLACKOUT_CLEANUP: + ClearFrameAndWindow2(&env->window, FALSE); + RemoveWindow(&env->window); + MessageFormat_Delete(env->msgFmt); + DestroyMsgData(env->msgData); + FreeBgTilemapBuffer(env->bgConfig, GF_BG_LYR_MAIN_3); + FreeToHeap(env->bgConfig); + FreeToHeap(env); + return TRUE; } return FALSE; @@ -167,9 +170,9 @@ static void Blackout_PrintMessage(BlackoutScreenEnvironment *environment, s32 ms FillWindowPixelBuffer(&environment->window, 0); ReadMsgDataIntoString(environment->msgData, msgNo, tmpStr); StringExpandPlaceholders(environment->msgFmt, finStr, tmpStr); - + u32 width = FontID_String_GetWidthMultiline(0, finStr, 0); - x = (environment->window.width * 8 - width); + x = (environment->window.width * 8 - width); x /= 2; x -= 4; @@ -191,52 +194,52 @@ enum { BOOL Task_Blackout(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); LocalFieldData *localFieldData; Location deathWarp; u16 deathSpawn; switch (*state) { - case STATE_BLACKOUT_TASK_INIT: - localFieldData = Save_LocalFieldData_Get(fieldSystem->saveData); - deathSpawn = LocalFieldData_GetBlackoutSpawn(localFieldData); - GetDeathWarpData(deathSpawn, &deathWarp); - GetSpecialSpawnWarpData(deathSpawn, LocalFieldData_GetSpecialSpawnWarpPtr(localFieldData)); - sub_02049160(taskManager, &deathWarp); - FieldSystem_ClearFollowingTrainer(fieldSystem); - (*state)++; - break; - case STATE_BLACKOUT_TASK_SOUND_FADE: - GF_SndStartFadeOutBGM(0, 20); - (*state)++; - break; - case STATE_BLACKOUT_TASK_SOUND_FADE_WAIT: - if (GF_SndGetFadeTimer() == 0) { - sub_0204AB0C(); - (*state)++; - } - break; - case STATE_BLACKOUT_TASK_DRAW: - SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN); - SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_SUB); - Blackout_DrawMessage(fieldSystem, taskManager); - (*state)++; - break; - case STATE_BLACKOUT_TASK_RESTORE_OVERWORLD: - CallTask_RestoreOverworld(taskManager); - (*state)++; - break; - case STATE_BLACKOUT_TASK_QUEUE_SCRIPT: - SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); - if (GetMomSpawnId() == LocalFieldData_GetBlackoutSpawn(Save_LocalFieldData_Get(fieldSystem->saveData))) { - QueueScript(taskManager, 0x7E4, NULL, NULL); - } else { - QueueScript(taskManager, 0x7E5, NULL, NULL); - } + case STATE_BLACKOUT_TASK_INIT: + localFieldData = Save_LocalFieldData_Get(fieldSystem->saveData); + deathSpawn = LocalFieldData_GetBlackoutSpawn(localFieldData); + GetDeathWarpData(deathSpawn, &deathWarp); + GetSpecialSpawnWarpData(deathSpawn, LocalFieldData_GetSpecialSpawnWarpPtr(localFieldData)); + sub_02049160(taskManager, &deathWarp); + FieldSystem_ClearFollowingTrainer(fieldSystem); + (*state)++; + break; + case STATE_BLACKOUT_TASK_SOUND_FADE: + GF_SndStartFadeOutBGM(0, 20); + (*state)++; + break; + case STATE_BLACKOUT_TASK_SOUND_FADE_WAIT: + if (GF_SndGetFadeTimer() == 0) { + sub_0204AB0C(); (*state)++; - break; - case STATE_BLACKOUT_TASK_EXIT: - return TRUE; + } + break; + case STATE_BLACKOUT_TASK_DRAW: + SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN); + SetBlendBrightness(-16, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_SUB); + Blackout_DrawMessage(fieldSystem, taskManager); + (*state)++; + break; + case STATE_BLACKOUT_TASK_RESTORE_OVERWORLD: + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case STATE_BLACKOUT_TASK_QUEUE_SCRIPT: + SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); + if (GetMomSpawnId() == LocalFieldData_GetBlackoutSpawn(Save_LocalFieldData_Get(fieldSystem->saveData))) { + QueueScript(taskManager, 0x7E4, NULL, NULL); + } else { + QueueScript(taskManager, 0x7E5, NULL, NULL); + } + (*state)++; + break; + case STATE_BLACKOUT_TASK_EXIT: + return TRUE; } return FALSE; diff --git a/arm9/src/brightness.c b/arm9/src/brightness.c index ddcbae28b..422e1744d 100644 --- a/arm9/src/brightness.c +++ b/arm9/src/brightness.c @@ -1,5 +1,7 @@ -#include "global.h" #include "brightness.h" + +#include "global.h" + #include "GX_g2.h" #include "MI_memory.h" @@ -23,7 +25,7 @@ void DoBrightnessTransitionStep(BrightnessData *brightness) { } } else { brightness->currentBrightness = brightness->targetBrightness; - transitionFinished = TRUE; + transitionFinished = TRUE; } if (brightness->screenMask & SCREEN_MASK_MAIN) { @@ -40,13 +42,13 @@ void DoBrightnessTransitionStep(BrightnessData *brightness) { void InitBrightnessTransition(BrightnessData *brightnessData, u16 stepCount, s16 targetBrightness, s16 startBrightness, GXBlendPlaneMask surfaceMask, u32 screenMask) { GF_ASSERT(!brightnessData->transitionActive); - brightnessData->transitionActive = TRUE; - brightnessData->surfaceMask = (GXBlendPlaneMask)(u8)surfaceMask; - brightnessData->screenMask = (u8)screenMask; - brightnessData->stepCount = stepCount; - brightnessData->targetBrightness = targetBrightness; + brightnessData->transitionActive = TRUE; + brightnessData->surfaceMask = (GXBlendPlaneMask)(u8)surfaceMask; + brightnessData->screenMask = (u8)screenMask; + brightnessData->stepCount = stepCount; + brightnessData->targetBrightness = targetBrightness; brightnessData->currentBrightness = startBrightness; - brightnessData->brightnessDiff = startBrightness - targetBrightness; + brightnessData->brightnessDiff = startBrightness - targetBrightness; if (brightnessData->brightnessDiff > 0) { brightnessData->transitionDirection = -1; @@ -55,9 +57,9 @@ void InitBrightnessTransition(BrightnessData *brightnessData, u16 stepCount, s16 brightnessData->brightnessDiff *= -1; } - brightnessData->stepSizeInteger = brightnessData->brightnessDiff / stepCount; + brightnessData->stepSizeInteger = brightnessData->brightnessDiff / stepCount; brightnessData->stepSizeFractional = brightnessData->brightnessDiff % stepCount; - brightnessData->fractionalCount = 0; + brightnessData->fractionalCount = 0; } void StartBrightnessTransition(u16 stepCount, s16 targetBrightness, s16 startBrightness, GXBlendPlaneMask surfaceMask, u32 screenMask) { @@ -91,7 +93,7 @@ void ScreenBrightnessData_InitAll(void) { MI_CpuFill8(&sSubScreenBrightnessData, 0, sizeof(BrightnessData)); sMainScreenBrightnessData.transitionActive = FALSE; - sSubScreenBrightnessData.transitionActive = FALSE; + sSubScreenBrightnessData.transitionActive = FALSE; } void InitScreenBrightnessData(u32 screenMask) { diff --git a/arm9/src/camera.c b/arm9/src/camera.c index 04fad59b8..185fb90d9 100644 --- a/arm9/src/camera.c +++ b/arm9/src/camera.c @@ -1,6 +1,9 @@ -#include "global.h" -#include "nitro/NNS_g3d.h" #include "camera.h" + +#include "nitro/NNS_g3d.h" + +#include "global.h" + #include "GX_g3.h" #include "fx.h" #include "heap.h" @@ -17,7 +20,7 @@ GXBufferMode gG3dDepthBufferingMode = GX_BUFFERMODE_W; static Camera *sCameraPtr; static void Camera_CalcLookAtPosFromTargetAndAngle(Camera *camera) { - u16 negx = -camera->angle.x; + u16 negx = -camera->angle.x; camera->lookAt.camPos.x = FX_Mul(FX_Mul(FX_SinIdx(camera->angle.y), camera->distance), FX_CosIdx(camera->angle.x)); camera->lookAt.camPos.z = FX_Mul(FX_Mul(FX_CosIdx(camera->angle.y), camera->distance), FX_CosIdx(camera->angle.x)); camera->lookAt.camPos.y = FX_Mul(FX_SinIdx(negx), camera->distance); @@ -25,7 +28,7 @@ static void Camera_CalcLookAtPosFromTargetAndAngle(Camera *camera) { } static void Camera_CalcLookAtTargetFromPosAndAngle(Camera *camera) { - u16 negx = -camera->angle.x; + u16 negx = -camera->angle.x; camera->lookAt.camTarget.x = -FX_Mul(FX_Mul(FX_SinIdx(camera->angle.y), camera->distance), FX_CosIdx(camera->angle.x)); camera->lookAt.camTarget.z = -FX_Mul(FX_Mul(FX_CosIdx(camera->angle.y), camera->distance), FX_CosIdx(camera->angle.x)); camera->lookAt.camTarget.y = -FX_Mul(FX_SinIdx(negx), camera->distance); @@ -33,20 +36,20 @@ static void Camera_CalcLookAtTargetFromPosAndAngle(Camera *camera) { } static void Camera_InitInternal(u16 perspectiveAngle, Camera *camera) { - camera->perspectiveAngle = perspectiveAngle; + camera->perspectiveAngle = perspectiveAngle; camera->perspective.fovySin = FX_SinIdx(perspectiveAngle); camera->perspective.fovyCos = FX_CosIdx(perspectiveAngle); - camera->perspective.aspect = FX32_CONST(1.33333333); // 4x3 - camera->perspective.near = FX32_CONST(150); - camera->perspective.far = FX32_CONST(900); - camera->lookAt.camUp.x = 0; - camera->lookAt.camUp.y = FX32_ONE; - camera->lookAt.camUp.z = 0; - camera->curTarget = NULL; - camera->enableOffsetX = FALSE; - camera->enableOffsetY = FALSE; - camera->enableOffsetZ = FALSE; - camera->history = NULL; + camera->perspective.aspect = FX32_CONST(1.33333333); // 4x3 + camera->perspective.near = FX32_CONST(150); + camera->perspective.far = FX32_CONST(900); + camera->lookAt.camUp.x = 0; + camera->lookAt.camUp.y = FX32_ONE; + camera->lookAt.camUp.z = 0; + camera->curTarget = NULL; + camera->enableOffsetX = FALSE; + camera->enableOffsetY = FALSE; + camera->enableOffsetZ = FALSE; + camera->history = NULL; } static void Camera_VecResetCoordsIfOffsetComponentNotEnabled(Camera *camera, VecFx32 *vec) { @@ -65,7 +68,7 @@ static void Camera_GetVecFromSomeRingBufferMaybe(Camera *camera, const VecFx32 * if (camera->history == NULL) { *vecDest = *vecDefault; } else { - s32 *idxPtr = &camera->history->readIdx; + s32 *idxPtr = &camera->history->readIdx; s32 *idx2Ptr = &camera->history->writeIdx; if (!camera->history->overrideEnabled) { *vecDest = *vecDefault; @@ -75,9 +78,9 @@ static void Camera_GetVecFromSomeRingBufferMaybe(Camera *camera, const VecFx32 * } else { *vecDest = camera->history->vecs[camera->history->readIdx]; } - *idxPtr = (*idxPtr + 1) % camera->history->count; + *idxPtr = (*idxPtr + 1) % camera->history->count; camera->history->vecs[*idx2Ptr] = *vecDefault; - *idx2Ptr = (*idx2Ptr + 1) % camera->history->count; + *idx2Ptr = (*idx2Ptr + 1) % camera->history->count; if (!camera->history->enableUpdateX) { vecDest->x = vecDefault->x; } @@ -96,20 +99,20 @@ void Camera_History_New(s32 count, s32 initialWriteIdx, s32 updateEnableFlags, H } GF_ASSERT(initialWriteIdx + 1 <= count); CameraHistory *history = AllocFromHeap(heapId, sizeof(CameraHistory)); - history->vecs = AllocFromHeap(heapId, sizeof(VecFx32) * count); + history->vecs = AllocFromHeap(heapId, sizeof(VecFx32) * count); for (s32 i = 0; i < count; i++) { history->vecs[i].x = 0; history->vecs[i].y = 0; history->vecs[i].z = 0; } - history->count = count; - history->readIdx = 0; - history->writeIdx = initialWriteIdx; - history->writeIdxInit = initialWriteIdx; + history->count = count; + history->readIdx = 0; + history->writeIdx = initialWriteIdx; + history->writeIdxInit = initialWriteIdx; history->overrideEnabled = FALSE; - history->enableUpdateX = FALSE; - history->enableUpdateY = FALSE; - history->enableUpdateZ = FALSE; + history->enableUpdateX = FALSE; + history->enableUpdateY = FALSE; + history->enableUpdateZ = FALSE; if (updateEnableFlags & CAMERA_UPDATE_ENABLE_X) { history->enableUpdateX = TRUE; } @@ -171,15 +174,15 @@ void Camera_SetLookAtCamUp(VecFx32 *camUp, Camera *camera) { } void Camera_SetFixedTarget(VecFx32 *target, Camera *camera) { - camera->curTarget = target; - camera->lastTarget = *target; + camera->curTarget = target; + camera->lastTarget = *target; camera->enableOffsetX = TRUE; camera->enableOffsetY = TRUE; camera->enableOffsetZ = TRUE; } void Camera_ClearFixedTarget(Camera *camera) { - camera->curTarget = NULL; + camera->curTarget = NULL; camera->enableOffsetX = FALSE; camera->enableOffsetY = FALSE; camera->enableOffsetZ = FALSE; @@ -187,22 +190,22 @@ void Camera_ClearFixedTarget(Camera *camera) { void Camera_SetPerspectiveClippingPlane(fx32 near, fx32 far, Camera *camera) { camera->perspective.near = near; - camera->perspective.far = far, + camera->perspective.far = far, Camera_ApplyPerspectiveType(camera->perspectiveType, camera); } void Camera_Init_FromTargetDistanceAndAngle(VecFx32 *target, fx32 distance, CameraAngle *angle, u16 perspectiveAngle, u8 perspectiveType, BOOL setReference, Camera *camera) { Camera_InitInternal(perspectiveAngle, camera); camera->lookAt.camTarget = *target; - camera->distance = distance; - camera->angle = *angle; + camera->distance = distance; + camera->angle = *angle; Camera_CalcLookAtPosFromTargetAndAngle(camera); Camera_ApplyPerspectiveType(perspectiveType, camera); if (!setReference) { return; - } - camera->curTarget = target; - camera->lastTarget = *target; + } + camera->curTarget = target; + camera->lastTarget = *target; camera->enableOffsetX = TRUE; camera->enableOffsetY = TRUE; camera->enableOffsetZ = TRUE; @@ -211,8 +214,8 @@ void Camera_Init_FromTargetDistanceAndAngle(VecFx32 *target, fx32 distance, Came void Camera_Init_FromPosDistanceAndAngle(VecFx32 *pos, fx32 distance, CameraAngle *angle, u16 perspectiveAngle, u8 perspectiveType, Camera *camera) { Camera_InitInternal(perspectiveAngle, camera); camera->lookAt.camPos = *pos; - camera->distance = distance; - camera->angle = *angle; + camera->distance = distance; + camera->angle = *angle; Camera_CalcLookAtTargetFromPosAndAngle(camera); Camera_ApplyPerspectiveType(perspectiveType, camera); } @@ -222,28 +225,28 @@ void Camera_Init_FromTargetAndPos(const VecFx32 *target, const VecFx32 *pos, u16 Camera_InitInternal(perspectiveAngle, camera); camera->lookAt.camTarget = *target; - camera->lookAt.camPos = *pos; + camera->lookAt.camPos = *pos; VEC_Subtract(pos, target, &vec_from_pos_to_target); camera->distance = VEC_Mag(&vec_from_pos_to_target); - VecFx32 sp24 = {0, 0, 0}; // unused - VecFx32 sp18 = {0, 0, 0}; // unused - VecFx32 sp0C = {0, 0, 0}; + VecFx32 sp24 = { 0, 0, 0 }; // unused + VecFx32 sp18 = { 0, 0, 0 }; // unused + VecFx32 sp0C = { 0, 0, 0 }; VecFx32 sp00; - sp00.x = 0; - sp00.y = 0; - sp00.z = FX32_ONE; - sp0C = vec_from_pos_to_target; - sp0C.y = 0; + sp00.x = 0; + sp00.y = 0; + sp00.z = FX32_ONE; + sp0C = vec_from_pos_to_target; + sp0C.y = 0; camera->angle.y = CalcAngleBetweenVecs(&sp00, &sp0C); - sp00.x = FX32_ONE; - sp00.y = 0; - sp00.z = 0; - sp0C.x = vec_from_pos_to_target.z; - sp0C.z = vec_from_pos_to_target.y; - sp0C.y = 0; + sp00.x = FX32_ONE; + sp00.y = 0; + sp00.z = 0; + sp0C.x = vec_from_pos_to_target.z; + sp0C.z = vec_from_pos_to_target.y; + sp0C.y = 0; camera->angle.x = CalcAngleBetweenVecs(&sp00, &sp0C); camera->angle.z = 0; @@ -252,8 +255,8 @@ void Camera_Init_FromTargetAndPos(const VecFx32 *target, const VecFx32 *pos, u16 if (!setReference) { return; } - camera->curTarget = target; - camera->lastTarget = *target; + camera->curTarget = target; + camera->lastTarget = *target; camera->enableOffsetX = TRUE; camera->enableOffsetY = TRUE; camera->enableOffsetZ = TRUE; @@ -263,18 +266,18 @@ void Camera_ApplyPerspectiveType(u8 perspectiveType, Camera *camera) { if (perspectiveType == CAMERA_PERSPECTIVE_TYPE_PERSPECTIVE) { NNS_G3dGlbPerspective(camera->perspective.fovySin, camera->perspective.fovyCos, camera->perspective.aspect, camera->perspective.near, camera->perspective.far); camera->perspectiveType = CAMERA_PERSPECTIVE_TYPE_PERSPECTIVE; - gG3dDepthBufferingMode = GX_BUFFERMODE_Z; + gG3dDepthBufferingMode = GX_BUFFERMODE_Z; } else { fx32 y = FX_Mul(FX_Div(camera->perspective.fovySin, camera->perspective.fovyCos), camera->distance); fx32 x = FX_Mul(y, camera->perspective.aspect); NNS_G3dGlbOrtho(y, -y, -x, x, camera->perspective.near, camera->perspective.far); camera->perspectiveType = CAMERA_PERSPECTIVE_TYPE_ORTHOGRAPHIC; - gG3dDepthBufferingMode = GX_BUFFERMODE_Z; + gG3dDepthBufferingMode = GX_BUFFERMODE_Z; } } void Camera_SetPerspectiveAngle(u16 perspectiveAngle, Camera *camera) { - camera->perspectiveAngle = perspectiveAngle; + camera->perspectiveAngle = perspectiveAngle; camera->perspective.fovySin = FX_SinIdx(camera->perspectiveAngle); camera->perspective.fovyCos = FX_CosIdx(camera->perspectiveAngle); Camera_ApplyPerspectiveType(camera->perspectiveType, camera); diff --git a/arm9/src/coins.c b/arm9/src/coins.c index d8842a590..5eceb0738 100644 --- a/arm9/src/coins.c +++ b/arm9/src/coins.c @@ -1,6 +1,7 @@ -#include "global.h" #include "coins.h" +#include "global.h" + void InitCoins(u16 *coins) { *coins = 0; } @@ -14,7 +15,7 @@ u16 CheckCoins(u16 *coins) { return *coins; } -BOOL GiveCoins(u16 * coins, u16 amount) { +BOOL GiveCoins(u16 *coins, u16 amount) { if (*coins >= MAX_COINS) { return FALSE; } diff --git a/arm9/src/communication_error.c b/arm9/src/communication_error.c index 51ba394a6..9c98a6047 100644 --- a/arm9/src/communication_error.c +++ b/arm9/src/communication_error.c @@ -1,63 +1,67 @@ -#include "global.h" -#include "bg_window.h" #include "communication_error.h" + +#include "global.h" + #include "constants/rgb.h" -#include "game_init.h" -#include "MI_dma.h" -#include "msgdata.h" + #include "msgdata/msg.naix" #include "msgdata/msg/narc_0200.h" -#include "text.h" + +#include "MI_dma.h" +#include "bg_window.h" #include "brightness.h" +#include "game_init.h" +#include "msgdata.h" #include "render_window.h" +#include "text.h" extern void SetMasterBrightnessNeutral(BOOL set_brightness_on_bottom_screen); extern void sub_0200E3A0(BOOL set_brightness_on_bottom_screen, s32); static const struct WindowTemplate sCommunicationErrorWindowTemplate = { - .bgId = GF_BG_LYR_MAIN_0, - .left = 3, - .top = 3, - .width = 26, - .height = 18, - .palette = 1, + .bgId = GF_BG_LYR_MAIN_0, + .left = 3, + .top = 3, + .width = 26, + .height = 18, + .palette = 1, .baseTile = 0x23, }; static const struct GraphicsModes sCommunicationErrorGraphicsModes = { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, ._2d3dMode = GX_BG0_AS_2D, }; static const struct BgTemplate sCommunicationErrorBgTemplate = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0, - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, + .baseTile = 0, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x18000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE, + .charBase = GX_BG_CHARBASE_0x18000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE, }; static const GraphicsBanks sCommunicationErrorGraphicsBanks = { - .bg = GX_VRAM_BG_256_AB, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_NONE, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_NONE, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_NONE, + .bg = GX_VRAM_BG_256_AB, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_NONE, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_NONE, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_NONE, .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_NONE, - .texpltt = GX_VRAM_TEXPLTT_NONE, + .tex = GX_VRAM_TEX_NONE, + .texpltt = GX_VRAM_TEXPLTT_NONE, }; static void VBlankIntr(void); @@ -69,25 +73,25 @@ static void VBlankIntr(void) { void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { Window window; - + u32 msgNo; switch (error) { - default: - case 0: - msgNo = narc_0200_00001; //A communication error has occurred. If you were in the Union Room... - break; - case 1: - msgNo = narc_0200_00002; //An error occurred while attempting to communicate. ({STRVAR_1 54, 0}) Please turn off the power... - break; - case 2: - msgNo = narc_0200_00003; //A communication error has occurred. You will be returned to the title screen... - break; - case 3: - msgNo = narc_0200_00004; //The GTS is extremely busy now. Please wait a while and try again. - break; - case 4: - msgNo = narc_0200_00005; //An error occurred while attempting\nto communicate.\nPlease turn off the power... - break; + default: + case 0: + msgNo = narc_0200_00001; // A communication error has occurred. If you were in the Union Room... + break; + case 1: + msgNo = narc_0200_00002; // An error occurred while attempting to communicate. ({STRVAR_1 54, 0}) Please turn off the power... + break; + case 2: + msgNo = narc_0200_00003; // A communication error has occurred. You will be returned to the title screen... + break; + case 3: + msgNo = narc_0200_00004; // The GTS is extremely busy now. Please wait a while and try again. + break; + case 4: + msgNo = narc_0200_00005; // An error occurred while attempting\nto communicate.\nPlease turn off the power... + break; } sub_0200E3A0(PM_LCD_TOP, 0); @@ -116,7 +120,7 @@ void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { GXS_SetVisibleWnd(0); GfGfx_SetBanks(&sCommunicationErrorGraphicsBanks); - BgConfig* bgConfig = BgConfig_Alloc(heapId); + BgConfig *bgConfig = BgConfig_Alloc(heapId); SetBothScreensModesAndDisable(&sCommunicationErrorGraphicsModes); InitBgFromTemplate(bgConfig, 0, &sCommunicationErrorBgTemplate, GX_BGMODE_0); BgClearTilemapBufferAndCommit(bgConfig, GF_BG_LYR_MAIN_0); @@ -126,11 +130,11 @@ void ShowCommunicationError(HeapID heapId, u32 error, u32 errorCode) { BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); - MsgData* errorMessageData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0200_bin, heapId); - String* errorMessageStr = String_New(384, heapId); - String* tmpStr = String_New(384, heapId); + MsgData *errorMessageData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0200_bin, heapId); + String *errorMessageStr = String_New(384, heapId); + String *tmpStr = String_New(384, heapId); ResetAllTextPrinters(); - MessageFormat* messageFormat = MessageFormat_New(heapId); + MessageFormat *messageFormat = MessageFormat_New(heapId); AddWindow(bgConfig, &window, &sCommunicationErrorWindowTemplate); FillWindowPixelRect(&window, 0xF, 0, 0, 208, 144); diff --git a/arm9/src/daycare.c b/arm9/src/daycare.c index 935c49f62..3a749e3bc 100644 --- a/arm9/src/daycare.c +++ b/arm9/src/daycare.c @@ -1,8 +1,10 @@ +#include "daycare.h" + #include "global.h" -#include "pokemon.h" + #include "mail.h" +#include "pokemon.h" #include "save.h" -#include "daycare.h" u32 Save_Daycare_sizeof(void) { return sizeof(Daycare); @@ -12,7 +14,7 @@ void Save_Daycare_Init(Daycare *daycare) { memset(daycare, 0, sizeof(Daycare)); ZeroBoxMonData(&daycare->mons[0].mon); ZeroBoxMonData(&daycare->mons[1].mon); - daycare->egg_pid = 0; + daycare->egg_pid = 0; daycare->egg_cycles = 0; } @@ -65,15 +67,14 @@ BOOL Save_Daycare_MasudaCheck(Daycare *daycare) { // Uses language as a proxy for country, even though it // only accounts for European languages and Japanese. // If true, shiny odds are increased. - return GetBoxMonData(&daycare->mons[0].mon, MON_DATA_GAME_LANGUAGE, NULL) != - GetBoxMonData(&daycare->mons[1].mon, MON_DATA_GAME_LANGUAGE, NULL); + return GetBoxMonData(&daycare->mons[0].mon, MON_DATA_GAME_LANGUAGE, NULL) != GetBoxMonData(&daycare->mons[1].mon, MON_DATA_GAME_LANGUAGE, NULL); } void DaycareMon_Copy(DaycareMon *dest, const DaycareMon *src) { *dest = *src; } -void DaycareMon_Extras_Init(DaycareMail *mail){ +void DaycareMon_Extras_Init(DaycareMail *mail) { int i; for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) { @@ -84,7 +85,7 @@ void DaycareMon_Extras_Init(DaycareMail *mail){ mail->nickname[i] = 0; } - mail->ot_name[0] = EOS; + mail->ot_name[0] = EOS; mail->nickname[0] = EOS; } diff --git a/arm9/src/easy_chat.c b/arm9/src/easy_chat.c index fe360f389..68bb3f1f5 100644 --- a/arm9/src/easy_chat.c +++ b/arm9/src/easy_chat.c @@ -1,23 +1,26 @@ -#include "global.h" -#include "msgdata.h" -#include "heap.h" -#include "save.h" -#include "math_util.h" #include "easy_chat.h" -#include "msgdata/msg.naix" + +#include "global.h" + #include "constants/abilities.h" #include "constants/easy_chat.h" #include "constants/moves.h" +#include "msgdata/msg.naix" #include "msgdata/msg/narc_0390.h" +#include "heap.h" +#include "math_util.h" +#include "msgdata.h" +#include "save.h" + static const u8 sLanguageToGreetingMap[6][2] = { { LANGUAGE_JAPANESE, narc_0390_konnichiwa }, - { LANGUAGE_ENGLISH, narc_0390_hello }, - { LANGUAGE_FRENCH, narc_0390_bonjour }, - { LANGUAGE_ITALIAN, narc_0390_ciao }, - { LANGUAGE_GERMAN, narc_0390_hallo }, - { LANGUAGE_SPANISH, narc_0390_hola }, + { LANGUAGE_ENGLISH, narc_0390_hello }, + { LANGUAGE_FRENCH, narc_0390_bonjour }, + { LANGUAGE_ITALIAN, narc_0390_ciao }, + { LANGUAGE_GERMAN, narc_0390_hallo }, + { LANGUAGE_SPANISH, narc_0390_hola }, }; static const u16 sNarcMsgBanks[EC_GROUP_MAX] = { @@ -48,18 +51,18 @@ static const u16 sNarcMsgCounts[EC_GROUP_MAX] = { EC_WORDS_UNION_COUNT, }; -static const ecword_t sEasyChatHey[] = {EC_WORD_GREETINGS_HEY, EC_WORD_GREETINGS_HEY_2}; -static const ecword_t sEasyChatHuh_[] = {EC_WORD_GREETINGS_HUH_, EC_WORD_GREETINGS_HUH__2}; -static const ecword_t sEasyChatI[] = {EC_WORD_PEOPLE_I, EC_WORD_PEOPLE_I_2, EC_WORD_PEOPLE_I_3, EC_WORD_PEOPLE_I_4}; -static const ecword_t sEasyChatKids[] = {EC_WORD_PEOPLE_KIDS, EC_WORD_PEOPLE_KIDS_2}; -static const ecword_t sEasyChatNoWay[] = {EC_WORD_GREETINGS_NO_WAY, EC_WORD_FEELINGS_NO_WAY}; -static const ecword_t sEasyChatYou[] = {EC_WORD_PEOPLE_YOU, EC_WORD_PEOPLE_YOU_2}; -static const ecword_t sEasyChatAnticipation[] = {EC_WORD_ABILITY(ABILITY_ANTICIPATION), EC_WORD_FEELINGS_ANTICIPATION}; -static const ecword_t sEasyChatSimple[] = {EC_WORD_ABILITY(ABILITY_SIMPLE), EC_WORD_FEELINGS_SIMPLE}; -static const ecword_t sEasyChatWelcome[] = {EC_WORD_GREETINGS_WELCOME, EC_WORD_GREETINGS_WELCOME_2}; -static const ecword_t sEasyChatWow[] = {EC_WORD_GREETINGS_WOW, EC_WORD_GREETINGS_WOW_2}; -static const ecword_t sEasyChatPsychic[] = {EC_WORD_MOVE(MOVE_PSYCHIC), EC_WORD_TYPE(TYPE_PSYCHIC)}; -static const ecword_t sEasyChatOk[] = {EC_WORD_GREETINGS_OK, EC_WORD_GREETINGS_OK_2}; +static const ecword_t sEasyChatHey[] = { EC_WORD_GREETINGS_HEY, EC_WORD_GREETINGS_HEY_2 }; +static const ecword_t sEasyChatHuh_[] = { EC_WORD_GREETINGS_HUH_, EC_WORD_GREETINGS_HUH__2 }; +static const ecword_t sEasyChatI[] = { EC_WORD_PEOPLE_I, EC_WORD_PEOPLE_I_2, EC_WORD_PEOPLE_I_3, EC_WORD_PEOPLE_I_4 }; +static const ecword_t sEasyChatKids[] = { EC_WORD_PEOPLE_KIDS, EC_WORD_PEOPLE_KIDS_2 }; +static const ecword_t sEasyChatNoWay[] = { EC_WORD_GREETINGS_NO_WAY, EC_WORD_FEELINGS_NO_WAY }; +static const ecword_t sEasyChatYou[] = { EC_WORD_PEOPLE_YOU, EC_WORD_PEOPLE_YOU_2 }; +static const ecword_t sEasyChatAnticipation[] = { EC_WORD_ABILITY(ABILITY_ANTICIPATION), EC_WORD_FEELINGS_ANTICIPATION }; +static const ecword_t sEasyChatSimple[] = { EC_WORD_ABILITY(ABILITY_SIMPLE), EC_WORD_FEELINGS_SIMPLE }; +static const ecword_t sEasyChatWelcome[] = { EC_WORD_GREETINGS_WELCOME, EC_WORD_GREETINGS_WELCOME_2 }; +static const ecword_t sEasyChatWow[] = { EC_WORD_GREETINGS_WOW, EC_WORD_GREETINGS_WOW_2 }; +static const ecword_t sEasyChatPsychic[] = { EC_WORD_MOVE(MOVE_PSYCHIC), EC_WORD_TYPE(TYPE_PSYCHIC) }; +static const ecword_t sEasyChatOk[] = { EC_WORD_GREETINGS_OK, EC_WORD_GREETINGS_OK_2 }; typedef struct ECIdenticalPhrases { const ecword_t *data; @@ -68,24 +71,24 @@ typedef struct ECIdenticalPhrases { static const ECIdenticalPhrases sIdenticalPhrases[12] = { { sEasyChatAnticipation, NELEMS(sEasyChatAnticipation) }, - { sEasyChatHey, NELEMS(sEasyChatHey) }, - { sEasyChatHuh_, NELEMS(sEasyChatHuh_) }, - { sEasyChatI, NELEMS(sEasyChatI) }, - { sEasyChatKids, NELEMS(sEasyChatKids) }, - { sEasyChatNoWay, NELEMS(sEasyChatNoWay) }, - { sEasyChatOk, NELEMS(sEasyChatOk) }, - { sEasyChatPsychic, NELEMS(sEasyChatPsychic) }, - { sEasyChatSimple, NELEMS(sEasyChatSimple) }, - { sEasyChatWelcome, NELEMS(sEasyChatWelcome) }, - { sEasyChatWow, NELEMS(sEasyChatWow) }, - { sEasyChatYou, NELEMS(sEasyChatYou) }, + { sEasyChatHey, NELEMS(sEasyChatHey) }, + { sEasyChatHuh_, NELEMS(sEasyChatHuh_) }, + { sEasyChatI, NELEMS(sEasyChatI) }, + { sEasyChatKids, NELEMS(sEasyChatKids) }, + { sEasyChatNoWay, NELEMS(sEasyChatNoWay) }, + { sEasyChatOk, NELEMS(sEasyChatOk) }, + { sEasyChatPsychic, NELEMS(sEasyChatPsychic) }, + { sEasyChatSimple, NELEMS(sEasyChatSimple) }, + { sEasyChatWelcome, NELEMS(sEasyChatWelcome) }, + { sEasyChatWow, NELEMS(sEasyChatWow) }, + { sEasyChatYou, NELEMS(sEasyChatYou) }, }; EasyChatManager *EasyChatManager_New(HeapID heapId) { EasyChatManager *ret = AllocFromHeap(heapId, sizeof(EasyChatManager)); for (s32 i = 0; i < EC_GROUP_MAX; i++) { - ret->heapId = heapId; // inadvertently inside the loop + ret->heapId = heapId; // inadvertently inside the loop ret->msgData[i] = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, sNarcMsgBanks[i], heapId); } return ret; @@ -112,8 +115,7 @@ void GetECWordIntoStringByIndex(u32 ecWord, String *dest) { GetCategoryAndMsgNoByECWordIdx(ecWord, &category, &msgNo); category = sNarcMsgBanks[category]; ReadMsgData_NewNarc_ExistingString(NARC_MSGDATA_MSG, category, msgNo, HEAP_ID_DEFAULT, dest); - } - else { + } else { String_SetEmpty(dest); } } @@ -143,7 +145,7 @@ void GetCategoryAndMsgNoByECWordIdx(u32 ecWord, u32 *category, u32 *msgNo) { count += sNarcMsgCounts[bank]; if (wordId < count) { *category = bank; - *msgNo = (wordId - (count - sNarcMsgCounts[bank])); + *msgNo = (wordId - (count - sNarcMsgCounts[bank])); return; } } @@ -157,7 +159,7 @@ void Save_EasyChat_Init(SaveEasyChat *saveEasyChat) { u32 i; saveEasyChat->greetings = 0; - saveEasyChat->trendy = 0; + saveEasyChat->trendy = 0; for (i = 0; i < NELEMS(sLanguageToGreetingMap); i++) { if (sLanguageToGreetingMap[i][0] == GAME_LANGUAGE) { Save_EasyChat_SetGreetingFlag(saveEasyChat, sLanguageToGreetingMap[i][1]); diff --git a/arm9/src/encounter.c b/arm9/src/encounter.c index ea95caeb4..cfeda407a 100644 --- a/arm9/src/encounter.c +++ b/arm9/src/encounter.c @@ -1,11 +1,14 @@ -#include "global.h" #include "encounter.h" -#include "blackout.h" + +#include "global.h" + #include "constants/battle.h" #include "constants/game_stats.h" -#include "save_vars_flags.h" + +#include "blackout.h" #include "field_system.h" #include "igt.h" +#include "save_vars_flags.h" #include "task.h" #include "unk_020040F4.h" #include "unk_02022504.h" @@ -84,18 +87,18 @@ static void sub_020473CC(FieldSystem *fieldSystem, BattleSetup *setup); static BOOL Task_StartBattle(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); BattleSetup *battleSetup = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - sub_0203780C(fieldSystem, battleSetup); - (*state)++; - break; - case 1: - if (!FieldSystem_ApplicationIsRunning(fieldSystem)) { - return TRUE; - } - break; + case 0: + sub_0203780C(fieldSystem, battleSetup); + (*state)++; + break; + case 1: + if (!FieldSystem_ApplicationIsRunning(fieldSystem)) { + return TRUE; + } + break; } return FALSE; @@ -107,13 +110,13 @@ static void CallTask_StartBattle(TaskManager *taskManager, BattleSetup *setup) { static Encounter *Encounter_New(BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag) { Encounter *encounter = AllocFromHeapAtEnd(HEAP_ID_FIELD, sizeof(Encounter)); - encounter->winFlag = winFlag; + encounter->winFlag = winFlag; if (winFlag != NULL) { *winFlag = BATTLE_OUTCOME_NONE; } encounter->effect = effect; - encounter->bgm = bgm; - encounter->setup = setup; + encounter->bgm = bgm; + encounter->setup = setup; return encounter; } @@ -135,54 +138,54 @@ static void sub_020465E4(BattleSetup *setup, FieldSystem *fieldSystem) { } } -static BOOL Task_StartEncounter(TaskManager *taskManager) { //todo: better name +static BOOL Task_StartEncounter(TaskManager *taskManager) { // todo: better name FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - Encounter *encounter = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); - sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); - (*state)++; - break; - case 1: - sub_0204AF3C(taskManager); - (*state)++; - break; - case 2: - CallTask_StartBattle(taskManager, encounter->setup); - (*state)++; - break; - case 3: - sub_020465E4(encounter->setup, fieldSystem); - if (encounter->setup->flags == BATTLE_TYPE_NONE || encounter->setup->flags == BATTLE_TYPE_8 || encounter->setup->flags == (BATTLE_TYPE_DOUBLES | BATTLE_TYPE_MULTI | BATTLE_TYPE_6)) { - sub_02061080(fieldSystem, encounter->setup->unk134, encounter->setup->winFlag); - } - - if (Encounter_GetResult(encounter) == FALSE) { - Encounter_Delete(encounter); - return TRUE; - } - - if (Save_VarsFlags_CheckHaveFollower(Save_VarsFlags_Get(fieldSystem->saveData))) { - HealParty(SaveArray_Party_Get(fieldSystem->saveData)); - } + case 0: + MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); + sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); + (*state)++; + break; + case 1: + sub_0204AF3C(taskManager); + (*state)++; + break; + case 2: + CallTask_StartBattle(taskManager, encounter->setup); + (*state)++; + break; + case 3: + sub_020465E4(encounter->setup, fieldSystem); + if (encounter->setup->flags == BATTLE_TYPE_NONE || encounter->setup->flags == BATTLE_TYPE_8 || encounter->setup->flags == (BATTLE_TYPE_DOUBLES | BATTLE_TYPE_MULTI | BATTLE_TYPE_6)) { + sub_02061080(fieldSystem, encounter->setup->unk134, encounter->setup->winFlag); + } - sub_020472F4(fieldSystem, encounter->setup); - sub_020473CC(fieldSystem, encounter->setup); - CallTask_RestoreOverworld(taskManager); - (*state)++; - break; - case 4: - MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); - CallTask_FadeFromBlack(taskManager); - (*state)++; - break; - case 5: + if (Encounter_GetResult(encounter) == FALSE) { Encounter_Delete(encounter); return TRUE; - break; + } + + if (Save_VarsFlags_CheckHaveFollower(Save_VarsFlags_Get(fieldSystem->saveData))) { + HealParty(SaveArray_Party_Get(fieldSystem->saveData)); + } + + sub_020472F4(fieldSystem, encounter->setup); + sub_020473CC(fieldSystem, encounter->setup); + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case 4: + MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); + CallTask_FadeFromBlack(taskManager); + (*state)++; + break; + case 5: + Encounter_Delete(encounter); + return TRUE; + break; } return FALSE; @@ -194,111 +197,111 @@ static void CallTask_StartEncounter(TaskManager *taskManager, BattleSetup *setup } static void sub_0204671C(s32 flag, FieldSystem *fieldSystem) { - switch(flag & 0xF) { - case 1: - case 6: - sub_0202E25C(fieldSystem->saveData, 1); - break; - case 2: - case 5: - sub_0202E25C(fieldSystem->saveData, -1); - break; + switch (flag & 0xF) { + case 1: + case 6: + sub_0202E25C(fieldSystem->saveData, 1); + break; + case 2: + case 5: + sub_0202E25C(fieldSystem->saveData, -1); + break; } } static BOOL Task_02046758(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - Encounter *encounter = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); - (*state)++; - break; - case 1: - sub_0204AF3C(taskManager); - (*state)++; - break; - case 2: - CallTask_StartBattle(taskManager, encounter->setup); - (*state)++; - break; - case 3: - sub_0204671C(encounter->setup->winFlag, fieldSystem); - sub_02047FA4(encounter->setup, fieldSystem); - GameStats_AddSpecial(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK21); - CallTask_RestoreOverworld(taskManager); - (*state)++; - break; - case 4: - case 5: //?? - Encounter_Delete(encounter); - return TRUE; + case 0: + sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); + (*state)++; + break; + case 1: + sub_0204AF3C(taskManager); + (*state)++; + break; + case 2: + CallTask_StartBattle(taskManager, encounter->setup); + (*state)++; + break; + case 3: + sub_0204671C(encounter->setup->winFlag, fieldSystem); + sub_02047FA4(encounter->setup, fieldSystem); + GameStats_AddSpecial(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK21); + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case 4: + case 5: //?? + Encounter_Delete(encounter); + return TRUE; } return FALSE; } static BOOL Task_020467FC(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - Encounter *encounter = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - sub_0200433C(5, encounter->bgm, 1); - CallTask_StartBattle(taskManager, encounter->setup); - (*state)++; - break; - case 1: - sub_0204671C(encounter->setup->winFlag, fieldSystem); - sub_02047FA4(encounter->setup, fieldSystem); - GameStats_AddSpecial(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK21); - (*state)++; - break; - case 2: - Encounter_Delete(encounter); - return TRUE; + case 0: + sub_0200433C(5, encounter->bgm, 1); + CallTask_StartBattle(taskManager, encounter->setup); + (*state)++; + break; + case 1: + sub_0204671C(encounter->setup->winFlag, fieldSystem); + sub_02047FA4(encounter->setup, fieldSystem); + GameStats_AddSpecial(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK21); + (*state)++; + break; + case 2: + Encounter_Delete(encounter); + return TRUE; } return FALSE; } static BOOL Task_02046878(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - Encounter *encounter = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); - (*state)++; - break; - case 1: - sub_0204AF3C(taskManager); - (*state)++; - break; - case 2: - CallTask_StartBattle(taskManager, encounter->setup); - (*state)++; - break; - case 3: - sub_02047FA4(encounter->setup, fieldSystem); - sub_02060044(fieldSystem, &encounter->setup->unk138); - Encounter_GetResult(encounter); - CallTask_RestoreOverworld(taskManager); - (*state)++; - break; - case 4: - CallTask_FadeFromBlack(taskManager); - (*state)++; - break; - case 5: - Encounter_Delete(encounter); - return TRUE; + case 0: + sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); + (*state)++; + break; + case 1: + sub_0204AF3C(taskManager); + (*state)++; + break; + case 2: + CallTask_StartBattle(taskManager, encounter->setup); + (*state)++; + break; + case 3: + sub_02047FA4(encounter->setup, fieldSystem); + sub_02060044(fieldSystem, &encounter->setup->unk138); + Encounter_GetResult(encounter); + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case 4: + CallTask_FadeFromBlack(taskManager); + (*state)++; + break; + case 5: + Encounter_Delete(encounter); + return TRUE; } return FALSE; } -static void CallTask_02046878(TaskManager *taskManager, BattleSetup *battleSetup, s32 effect, s32 bgm, u32 *winFlag) { //CallTask_02046878 +static void CallTask_02046878(TaskManager *taskManager, BattleSetup *battleSetup, s32 effect, s32 bgm, u32 *winFlag) { // CallTask_02046878 Encounter *encounter = Encounter_New(battleSetup, effect, bgm, winFlag); TaskManager_Call(taskManager, Task_02046878, encounter); } @@ -306,21 +309,21 @@ static void CallTask_02046878(TaskManager *taskManager, BattleSetup *battleSetup void sub_02046948(TaskManager *taskManager, u32 param1, u32 *winFlag) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); BattleSetup *battleSetup = ov06_02244558(param1, fieldSystem); - s32 effect = sub_020475A0(battleSetup); - s32 bgm = sub_020475B0(battleSetup); + s32 effect = sub_020475A0(battleSetup); + s32 bgm = sub_020475B0(battleSetup); CallTask_02046878(taskManager, battleSetup, effect, bgm, winFlag); } static WildEncounter *WildEncounter_New(BattleSetup *setup, s32 effect, s32 bgm, u32 *winFlag) { WildEncounter *encounter = AllocFromHeapAtEnd(HEAP_ID_FIELD, sizeof(WildEncounter)); - encounter->winFlag = winFlag; + encounter->winFlag = winFlag; if (winFlag != NULL) { *winFlag = BATTLE_OUTCOME_NONE; } encounter->effect = effect; - encounter->bgm = bgm; - encounter->setup = setup; - encounter->state = 0; + encounter->bgm = bgm; + encounter->setup = setup; + encounter->state = 0; return encounter; } @@ -358,139 +361,139 @@ static BOOL Task_WildEncounter(TaskManager *taskManager) { WildEncounter *encounter = TaskManager_GetEnvironment(taskManager); switch (encounter->state) { - case 0: - MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); - GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); - sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); - encounter->state++; - break; - case 1: - sub_0204AF3C(taskManager); - encounter->state++; - break; - case 2: - CallTask_StartBattle(taskManager, encounter->setup); - encounter->state++; - break; - case 3: - sub_020465E4(encounter->setup, fieldSystem); - sub_02061080(fieldSystem, encounter->setup->unk134, encounter->setup->winFlag); + case 0: + MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); + GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); + sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); + encounter->state++; + break; + case 1: + sub_0204AF3C(taskManager); + encounter->state++; + break; + case 2: + CallTask_StartBattle(taskManager, encounter->setup); + encounter->state++; + break; + case 3: + sub_020465E4(encounter->setup, fieldSystem); + sub_02061080(fieldSystem, encounter->setup->unk134, encounter->setup->winFlag); + + if (IsBattleResultWin(encounter->setup->winFlag) == FALSE) { + WildEncounter_Delete(encounter); + sub_0205DD40(fieldSystem->unk90); + TaskManager_Jump(taskManager, Task_Blackout, NULL); + return FALSE; + } - if (IsBattleResultWin(encounter->setup->winFlag) == FALSE) { - WildEncounter_Delete(encounter); - sub_0205DD40(fieldSystem->unk90); - TaskManager_Jump(taskManager, Task_Blackout, NULL); - return FALSE; - } + if (Save_VarsFlags_CheckHaveFollower(Save_VarsFlags_Get(fieldSystem->saveData))) { + HealParty(SaveArray_Party_Get(fieldSystem->saveData)); + } - if (Save_VarsFlags_CheckHaveFollower(Save_VarsFlags_Get(fieldSystem->saveData))) { - HealParty(SaveArray_Party_Get(fieldSystem->saveData)); - } + sub_020472F4(fieldSystem, encounter->setup); + sub_020473CC(fieldSystem, encounter->setup); - sub_020472F4(fieldSystem, encounter->setup); - sub_020473CC(fieldSystem, encounter->setup); - - if (sub_0205E128(fieldSystem->unk90) != 0) { - if (sub_0205E0A4(fieldSystem->unk90) != 0) { - if (encounter->setup->winFlag != BATTLE_OUTCOME_WIN && encounter->setup->winFlag != BATTLE_OUTCOME_MON_CAUGHT) { - sub_0205DD40(fieldSystem->unk90); - } - } else { + if (sub_0205E128(fieldSystem->unk90) != 0) { + if (sub_0205E0A4(fieldSystem->unk90) != 0) { + if (encounter->setup->winFlag != BATTLE_OUTCOME_WIN && encounter->setup->winFlag != BATTLE_OUTCOME_MON_CAUGHT) { sub_0205DD40(fieldSystem->unk90); } - } - CallTask_RestoreOverworld(taskManager); - encounter->state++; - break; - case 4: - ov06_02248724(fieldSystem, encounter->setup); - CallTask_FadeFromBlack(taskManager); - encounter->state++; - break; - case 5: - if (sub_0205E128(fieldSystem->unk90) != 0) { - sub_0205DED4(fieldSystem, encounter->setup->winFlag, fieldSystem->unk90); - sub_0205DF44(fieldSystem, fieldSystem->unk90); - } - encounter->state++; - break; - case 6: - if (sub_0205DF9C(fieldSystem->unk90)) { - MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); - WildEncounter_Delete(encounter); - return TRUE; + } else { + sub_0205DD40(fieldSystem->unk90); } - break; + } + CallTask_RestoreOverworld(taskManager); + encounter->state++; + break; + case 4: + ov06_02248724(fieldSystem, encounter->setup); + CallTask_FadeFromBlack(taskManager); + encounter->state++; + break; + case 5: + if (sub_0205E128(fieldSystem->unk90) != 0) { + sub_0205DED4(fieldSystem, encounter->setup->winFlag, fieldSystem->unk90); + sub_0205DF44(fieldSystem, fieldSystem->unk90); + } + encounter->state++; + break; + case 6: + if (sub_0205DF9C(fieldSystem->unk90)) { + MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); + WildEncounter_Delete(encounter); + return TRUE; + } + break; } return FALSE; } static BOOL Task_SafariEncounter(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - Encounter *encounter = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); - u16 *safariBalls = LocalFieldData_GetSafariBallsCounter(Save_LocalFieldData_Get(fieldSystem->saveData)); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); + u16 *safariBalls = LocalFieldData_GetSafariBallsCounter(Save_LocalFieldData_Get(fieldSystem->saveData)); switch (*state) { - case 0: - MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); - GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); - sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); - (*state)++; - break; - case 1: - sub_0204AF3C(taskManager); - (*state)++; - break; - case 2: - CallTask_StartBattle(taskManager, encounter->setup); - (*state)++; - break; - case 3: - sub_020465E4(encounter->setup, fieldSystem); - if (encounter->setup->winFlag == BATTLE_OUTCOME_MON_CAUGHT) { - SafariZone *safariZone = Save_SafariZone_Get(fieldSystem->saveData); - Pokemon *pokemon = Party_GetMonByIndex(encounter->setup->party[BATTLER_ENEMY], 0); - sub_02060FE0(safariZone, pokemon); - } + case 0: + MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); + GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); + sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); + (*state)++; + break; + case 1: + sub_0204AF3C(taskManager); + (*state)++; + break; + case 2: + CallTask_StartBattle(taskManager, encounter->setup); + (*state)++; + break; + case 3: + sub_020465E4(encounter->setup, fieldSystem); + if (encounter->setup->winFlag == BATTLE_OUTCOME_MON_CAUGHT) { + SafariZone *safariZone = Save_SafariZone_Get(fieldSystem->saveData); + Pokemon *pokemon = Party_GetMonByIndex(encounter->setup->party[BATTLER_ENEMY], 0); + sub_02060FE0(safariZone, pokemon); + } - sub_020472F4(fieldSystem, encounter->setup); + sub_020472F4(fieldSystem, encounter->setup); - if (*safariBalls == 0 && encounter->setup->winFlag != BATTLE_OUTCOME_MON_CAUGHT) { - Location *location = LocalFieldData_GetDynamicWarp(Save_LocalFieldData_Get(fieldSystem->saveData)); - sub_02049160(taskManager, location); - } - sub_020473CC(fieldSystem, encounter->setup); - (*state)++; - break; - case 4: - CallTask_RestoreOverworld(taskManager); - (*state)++; - break; - case 5: - MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); - CallTask_FadeFromBlack(taskManager); - (*state)++; - break; - case 6: - if (*safariBalls == 0) { - if (encounter->setup->winFlag == BATTLE_OUTCOME_MON_CAUGHT) { - QueueScript(taskManager, 0x2262, NULL, NULL); - } else { - QueueScript(taskManager, 0x2269, NULL, NULL); - } + if (*safariBalls == 0 && encounter->setup->winFlag != BATTLE_OUTCOME_MON_CAUGHT) { + Location *location = LocalFieldData_GetDynamicWarp(Save_LocalFieldData_Get(fieldSystem->saveData)); + sub_02049160(taskManager, location); + } + sub_020473CC(fieldSystem, encounter->setup); + (*state)++; + break; + case 4: + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case 5: + MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); + CallTask_FadeFromBlack(taskManager); + (*state)++; + break; + case 6: + if (*safariBalls == 0) { + if (encounter->setup->winFlag == BATTLE_OUTCOME_MON_CAUGHT) { + QueueScript(taskManager, 0x2262, NULL, NULL); } else { - PCStorage *pc = SaveArray_PCStorage_Get(fieldSystem->saveData); - Party *party = SaveArray_Party_Get(fieldSystem->saveData); - if (PCStorage_FindFirstBoxWithEmptySlot(pc) == NUM_BOXES && Party_GetCount(party) == PARTY_SIZE) { - QueueScript(taskManager, 0x2276, NULL, NULL); - } + QueueScript(taskManager, 0x2269, NULL, NULL); } - (*state)++; - break; - case 7: - Encounter_Delete(encounter); - return TRUE; + } else { + PCStorage *pc = SaveArray_PCStorage_Get(fieldSystem->saveData); + Party *party = SaveArray_Party_Get(fieldSystem->saveData); + if (PCStorage_FindFirstBoxWithEmptySlot(pc) == NUM_BOXES && Party_GetCount(party) == PARTY_SIZE) { + QueueScript(taskManager, 0x2276, NULL, NULL); + } + } + (*state)++; + break; + case 7: + Encounter_Delete(encounter); + return TRUE; } return FALSE; } @@ -529,46 +532,46 @@ void SetupAndStartWildBattle(TaskManager *taskManager, u16 species, u8 level, u3 static BOOL Task_PalParkEncounter(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - Encounter *encounter = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); - GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); - sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); - (*state)++; - break; - case 1: - sub_0204AF3C(taskManager); - (*state)++; - break; - case 2: - CallTask_StartBattle(taskManager, encounter->setup); - (*state)++; - break; - case 3: - sub_020465E4(encounter->setup, fieldSystem); - PalPark_HandleBattleEnd(fieldSystem, encounter->setup); - sub_020472F4(fieldSystem, encounter->setup); - (*state)++; - break; - case 4: - CallTask_RestoreOverworld(taskManager); - (*state)++; - break; - case 5: - MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); - CallTask_FadeFromBlack(taskManager); - (*state)++; - break; - case 6: - Encounter_Delete(encounter); - if (PalPark_CountMonsNotCaught(fieldSystem) == 0) { - StartScriptFromMenu(taskManager, 3, NULL); - return FALSE; - } - return TRUE; + case 0: + MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); + GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); + sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); + (*state)++; + break; + case 1: + sub_0204AF3C(taskManager); + (*state)++; + break; + case 2: + CallTask_StartBattle(taskManager, encounter->setup); + (*state)++; + break; + case 3: + sub_020465E4(encounter->setup, fieldSystem); + PalPark_HandleBattleEnd(fieldSystem, encounter->setup); + sub_020472F4(fieldSystem, encounter->setup); + (*state)++; + break; + case 4: + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case 5: + MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); + CallTask_FadeFromBlack(taskManager); + (*state)++; + break; + case 6: + Encounter_Delete(encounter); + if (PalPark_CountMonsNotCaught(fieldSystem) == 0) { + StartScriptFromMenu(taskManager, 3, NULL); + return FALSE; + } + return TRUE; } return FALSE; @@ -581,52 +584,52 @@ void sub_02046F70(FieldSystem *fieldSystem, BattleSetup *setup) { void SetupAndStartFirstBattle(TaskManager *taskManager, u16 species, u8 level) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - BattleSetup *setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_TYPE_NONE); + BattleSetup *setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_TYPE_NONE); BattleSetup_InitFromFieldSystem(setup, fieldSystem); ov06_0223CD7C(fieldSystem, species, level, setup); setup->unk18C = 1; - GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); + GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK7); CallTask_StartEncounter(taskManager, setup, sub_020475A0(setup), sub_020475B0(setup), NULL); } static BOOL Task_TutorialBattle(TaskManager *taskManager) { - Encounter *encounter = TaskManager_GetEnvironment(taskManager); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); - sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); - (*state)++; - break; - case 1: - sub_0204AF3C(taskManager); - (*state)++; - break; - case 2: - CallTask_StartBattle(taskManager, encounter->setup); - (*state)++; - break; - case 3: - (*state)++; - break; - case 4: - CallTask_RestoreOverworld(taskManager); - (*state)++; - break; - case 5: - MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); - CallTask_FadeFromBlack(taskManager); - (*state)++; - break; - case 6: - Encounter_Delete(encounter); - return TRUE; + case 0: + MapObjectManager_PauseAllMovement(fieldSystem->mapObjectManager); + sub_0204AEF8(taskManager, encounter->effect, encounter->bgm); + (*state)++; + break; + case 1: + sub_0204AF3C(taskManager); + (*state)++; + break; + case 2: + CallTask_StartBattle(taskManager, encounter->setup); + (*state)++; + break; + case 3: + (*state)++; + break; + case 4: + CallTask_RestoreOverworld(taskManager); + (*state)++; + break; + case 5: + MapObjectManager_UnpauseAllMovement(fieldSystem->mapObjectManager); + CallTask_FadeFromBlack(taskManager); + (*state)++; + break; + case 6: + Encounter_Delete(encounter); + return TRUE; } return FALSE; } @@ -635,8 +638,8 @@ void SetupAndStartTutorialBattle(TaskManager *taskManager) { Encounter *encounter; BattleSetup *setup; FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - - setup = sub_02047814(HEAP_ID_FIELD, fieldSystem); + + setup = sub_02047814(HEAP_ID_FIELD, fieldSystem); encounter = Encounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL); TaskManager_Call(taskManager, Task_TutorialBattle, encounter); @@ -646,7 +649,7 @@ void SetupAndStartTrainerBattle(TaskManager *taskManager, u32 opponentTrainer1, u32 battleType; BattleSetup *setup; FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - + if (opponentTrainer2 != 0 && opponentTrainer1 != opponentTrainer2) { if (followerTrainerNum == 0) { battleType = (BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLES | BATTLE_TYPE_INGAME_PARTNER); @@ -663,14 +666,14 @@ void SetupAndStartTrainerBattle(TaskManager *taskManager, u32 opponentTrainer1, setup = BattleSetup_New(HEAP_ID_FIELD, battleType); BattleSetup_InitFromFieldSystem(setup, fieldSystem); - setup->trainerId[BATTLER_ENEMY] = opponentTrainer1; - setup->trainerId[BATTLER_ENEMY2] = opponentTrainer2; + setup->trainerId[BATTLER_ENEMY] = opponentTrainer1; + setup->trainerId[BATTLER_ENEMY2] = opponentTrainer2; setup->trainerId[BATTLER_PLAYER2] = followerTrainerNum; EnemyTrainerSet_Init(setup, fieldSystem->saveData, heapId); GameStats_Inc(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK8); - + CallTask_StartEncounter(taskManager, setup, sub_020475A0(setup), sub_020475B0(setup), winFlag); } @@ -694,14 +697,14 @@ void sub_020471C0(TaskManager *taskManager, s32 target, s32 maxLevel, u32 flag) BattleSetup *setup; if (flag != 0) { - setup = BattleSetup_New(HEAP_ID_FIELD, (BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER)); + setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER); } else { - setup = BattleSetup_New(HEAP_ID_FIELD, (BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLES | BATTLE_TYPE_TRAINER)); + setup = BattleSetup_New(HEAP_ID_FIELD, BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLES | BATTLE_TYPE_TRAINER); } sub_02047BC0(setup, fieldSystem, maxLevel); - encounter = Encounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL); + encounter = Encounter_New(setup, sub_020475A0(setup), sub_020475B0(setup), NULL); encounter->unkC = target; TaskManager_Call(taskManager, Task_020467FC, encounter); @@ -709,17 +712,17 @@ void sub_020471C0(TaskManager *taskManager, s32 target, s32 maxLevel, u32 flag) static BOOL sub_02047220(TaskManager *taskManager) { FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - Encounter *encounter = TaskManager_GetEnvironment(taskManager); - u32 *state = TaskManager_GetStatePtr(taskManager); + Encounter *encounter = TaskManager_GetEnvironment(taskManager); + u32 *state = TaskManager_GetStatePtr(taskManager); switch (*state) { - case 0: - TaskManager_Call(taskManager, Task_02046758, encounter); - (*state)++; - break; - case 1: - sub_0204FF5C(fieldSystem); - return TRUE; + case 0: + TaskManager_Call(taskManager, Task_02046758, encounter); + (*state)++; + break; + case 1: + sub_0204FF5C(fieldSystem); + return TRUE; } return FALSE; } @@ -749,12 +752,12 @@ void sub_020472B0(FieldSystem *fieldSystem, Party *party, s32 battleType) { static void sub_020472F4(FieldSystem *fieldSystem, BattleSetup *setup) { Pokemon *mon; u32 battleType = setup->flags; - u32 winFlag = setup->winFlag; + u32 winFlag = setup->winFlag; if (battleType & BATTLE_TYPE_LINK || battleType & BATTLE_TYPE_TOWER) { return; } - + if (battleType == BATTLE_TYPE_NONE || battleType == BATTLE_TYPE_8 || battleType == (BATTLE_TYPE_DOUBLES | BATTLE_TYPE_MULTI | BATTLE_TYPE_6)) { if (winFlag == BATTLE_OUTCOME_WIN) { GameStats_AddSpecial(Save_GameStats_Get(fieldSystem->saveData), GAME_STAT_UNK8); @@ -783,7 +786,7 @@ static void sub_020472F4(FieldSystem *fieldSystem, BattleSetup *setup) { static void sub_020473CC(FieldSystem *fieldSystem, BattleSetup *setup) { Pokemon *mon; u32 battleType = setup->flags; - u32 winFlag = setup->winFlag; + u32 winFlag = setup->winFlag; if (battleType & BATTLE_TYPE_LINK || battleType & BATTLE_TYPE_TOWER || battleType & BATTLE_TYPE_PAL_PARK) { return; diff --git a/arm9/src/error_handling.c b/arm9/src/error_handling.c index 5f8641ed6..0ed0f841b 100644 --- a/arm9/src/error_handling.c +++ b/arm9/src/error_handling.c @@ -1,5 +1,7 @@ -#include "global.h" #include "error_handling.h" + +#include "global.h" + #include "error_message_reset.h" #include "unk_02031734.h" diff --git a/arm9/src/error_message_reset.c b/arm9/src/error_message_reset.c index 782b0cd80..073edfd44 100644 --- a/arm9/src/error_message_reset.c +++ b/arm9/src/error_message_reset.c @@ -1,67 +1,71 @@ -#include "global.h" #include "error_message_reset.h" + +#include "global.h" + #include "constants/rgb.h" + +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0200.h" + +#include "PAD_pad.h" +#include "bg_window.h" +#include "brightness.h" +#include "font.h" #include "gf_gfx_planes.h" #include "gx.h" #include "heap.h" -#include "unk_02031734.h" -#include "unk_0202F150.h" -#include "bg_window.h" -#include "PAD_pad.h" -#include "font.h" -#include "brightness.h" #include "render_window.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0200.h" +#include "unk_0202F150.h" +#include "unk_02031734.h" static const struct WindowTemplate sErrorMessageWindowTemplate = { - .bgId = GF_BG_LYR_MAIN_0, - .left = 3, - .top = 3, - .width = 26, - .height = 18, - .palette = 1, + .bgId = GF_BG_LYR_MAIN_0, + .left = 3, + .top = 3, + .width = 26, + .height = 18, + .palette = 1, .baseTile = 0x23 }; static const struct HeapParam sErrorMessageHeapParams = { - .size = 0x00020000, + .size = 0x00020000, .arena = OS_ARENA_MAIN }; static const struct GraphicsModes sErrorMessageBgModeSet = { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, ._2d3dMode = GX_BG0_AS_2D }; static const struct BgTemplate sErrorMessageBgTemplate = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0, - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, + .baseTile = 0, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x18000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .mosaic = FALSE + .charBase = GX_BG_CHARBASE_0x18000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .mosaic = FALSE }; static const struct GraphicsBanks sErrorMessageBanksConfig = { - .bg = GX_VRAM_BG_256_AB, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_NONE, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_NONE, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_NONE, + .bg = GX_VRAM_BG_256_AB, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_NONE, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_NONE, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_NONE, .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_NONE, - .texpltt = GX_VRAM_TEXPLTT_NONE, + .tex = GX_VRAM_TEX_NONE, + .texpltt = GX_VRAM_TEXPLTT_NONE, }; static u32 sErrorMessagePrinterLock; @@ -69,20 +73,17 @@ static u32 sErrorMessagePrinterLock; extern void sub_0200E3A0(PMLCDTarget, int); extern void SetMasterBrightnessNeutral(u32 screen); -void VBlankHandler() -{ +void VBlankHandler() { OS_SetIrqCheckFlag(OS_IE_VBLANK); MI_WaitDma(GX_DEFAULT_DMAID); } -void PrintErrorMessageAndReset() -{ +void PrintErrorMessageAndReset() { struct BgConfig *ptr; struct Window buf; - if (sErrorMessagePrinterLock != TRUE) - { + if (sErrorMessagePrinterLock != TRUE) { sErrorMessagePrinterLock = TRUE; OS_SetArenaHi(OS_ARENA_MAIN, OS_GetInitArenaHi(OS_ARENA_MAIN)); OS_SetArenaLo(OS_ARENA_MAIN, OS_GetInitArenaLo(OS_ARENA_MAIN)); @@ -130,14 +131,14 @@ void PrintErrorMessageAndReset() BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); struct MsgData *msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0200_bin, HEAP_ID_DEFAULT); - struct String *str = String_New(6 << 6, HEAP_ID_DEFAULT); + struct String *str = String_New(6 << 6, HEAP_ID_DEFAULT); ResetAllTextPrinters(); AddWindow(ptr, &buf, &sErrorMessageWindowTemplate); FillWindowPixelRect(&buf, 15, 0, 0, 0xd0, 0x90); DrawFrameAndWindow1(&buf, FALSE, 0x1f7, 2); - ReadMsgDataIntoString(msg_data, narc_0200_00003, str); //A communication error has occurred. You will be returned to the title screen... + ReadMsgDataIntoString(msg_data, narc_0200_00003, str); // A communication error has occurred. You will be returned to the title screen... AddTextPrinterParameterized(&buf, 0, str, 0, 0, 0, NULL); @@ -148,20 +149,20 @@ void PrintErrorMessageAndReset() SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); sub_02032DAC(); - while (TRUE) - { + while (TRUE) { HandleDSLidAction(); sub_0202FB80(); - if (sub_02033678()) + if (sub_02033678()) { break; + } OS_WaitIrq(TRUE, OS_IE_VBLANK); } - while (TRUE) - { + while (TRUE) { HandleDSLidAction(); - if ((PAD_Read() & PAD_BUTTON_A)) + if (PAD_Read() & PAD_BUTTON_A) { break; + } OS_WaitIrq(TRUE, OS_IE_VBLANK); } sub_0200E3A0(PM_LCD_TOP, 0x7FFF); diff --git a/arm9/src/field_system_rtc_weather.c b/arm9/src/field_system_rtc_weather.c index ed4ca69ea..969d1a4b7 100644 --- a/arm9/src/field_system_rtc_weather.c +++ b/arm9/src/field_system_rtc_weather.c @@ -1,6 +1,9 @@ -#include "global.h" #include "field_system_rtc_weather.h" + +#include "global.h" + #include "constants/weather.h" + #include "gf_rtc.h" #include "map_header.h" #include "save_system_info.h" @@ -8,372 +11,1832 @@ #include "unk_0204B0A0.h" static const u8 sWeatherTable[] = { - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, // Jan 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 3 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 4 - WEATHER_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 5 - WEATHER_THUNDERSTORM, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, WEATHER_DIAMOND_DUST, // Jan 12 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 14 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 20 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 23 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 27 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jan 31 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 1 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 2 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 8 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 9 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 14 - WEATHER_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 17 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 18 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Feb 28 - WEATHER_HEAVY_RAIN, WEATHER_CLOUDY, WEATHER_BLIZZARD, WEATHER_LIGHT_SNOW, WEATHER_DIAMOND_DUST, // Feb 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 2 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 12 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 13 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_DIAMOND_DUST, // Mar 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 17 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 29 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Mar 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_DIAMOND_DUST, // Mar 31 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 6 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 14 - WEATHER_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 21 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_DIAMOND_DUST, // Apr 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Apr 30 - WEATHER_CLOUDY, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_DIAMOND_DUST, // May 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 10 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // May 31 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 1 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 5 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 6 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 7 - WEATHER_THUNDERSTORM, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 10 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 11 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 14 - WEATHER_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 15 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 19 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 20 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 21 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 25 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 26 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 27 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 28 - WEATHER_THUNDERSTORM, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jun 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 3 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 9 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 10 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 22 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 25 - WEATHER_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Jul 31 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, // Aug 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 8 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 11 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 19 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 25 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Aug 31 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 1 - WEATHER_THUNDERSTORM, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_DIAMOND_DUST, // Sep 2 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 6 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 7 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, // Sep 10 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_BLIZZARD, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 12 - WEATHER_HEAVY_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 17 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 18 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_DIAMOND_DUST, // Sep 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 22 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 27 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 28 - WEATHER_THUNDERSTORM, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 29 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Sep 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 2 - WEATHER_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_BLIZZARD, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 12 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_BLIZZARD, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 17 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, // Oct 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_BLIZZARD, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_DIAMOND_DUST, // Oct 30 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Oct 31 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 1 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 8 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 9 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 13 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 18 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_BLIZZARD, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 22 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 23 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, // Nov 24 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 29 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Nov 30 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 1 - WEATHER_RAIN, WEATHER_RAIN, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 2 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 3 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 4 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 5 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 6 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 7 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 8 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 9 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 10 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 11 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 12 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 13 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 14 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 15 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 16 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 17 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 18 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 19 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 20 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 21 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 22 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, // Dec 23 - WEATHER_THUNDERSTORM, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 24 - WEATHER_RAIN, WEATHER_CLOUDY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 25 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_BLIZZARD, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 26 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 27 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 28 - WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 29 - WEATHER_HEAVY_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_SNOW, WEATHER_LIGHT_SNOW, // Dec 30 - WEATHER_THUNDERSTORM, WEATHER_RAIN, WEATHER_BLIZZARD, WEATHER_SNOW, WEATHER_LIGHT_SNOW // Dec 31 + WEATHER_RAIN, WEATHER_SUNNY, WEATHER_SNOW, WEATHER_LIGHT_SNOW, WEATHER_LIGHT_SNOW, // Jan 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 3 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 4 + WEATHER_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 5 + WEATHER_THUNDERSTORM, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_LIGHT_SNOW, + WEATHER_LIGHT_SNOW, + WEATHER_DIAMOND_DUST, // Jan 12 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 14 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 20 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 23 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 27 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jan 31 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 1 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 2 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 8 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 9 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 14 + WEATHER_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 17 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 18 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Feb 28 + WEATHER_HEAVY_RAIN, + WEATHER_CLOUDY, + WEATHER_BLIZZARD, + WEATHER_LIGHT_SNOW, + WEATHER_DIAMOND_DUST, // Feb 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 2 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 12 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 13 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_DIAMOND_DUST, // Mar 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 17 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 29 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Mar 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_DIAMOND_DUST, // Mar 31 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 6 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 14 + WEATHER_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 21 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_DIAMOND_DUST, // Apr 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Apr 30 + WEATHER_CLOUDY, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_DIAMOND_DUST, // May 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 10 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // May 31 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 1 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 5 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 6 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 7 + WEATHER_THUNDERSTORM, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 10 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 11 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 14 + WEATHER_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 15 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 19 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 20 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 21 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 25 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 26 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 27 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 28 + WEATHER_THUNDERSTORM, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jun 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 3 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 9 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 10 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 22 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 25 + WEATHER_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Jul 31 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, + WEATHER_LIGHT_SNOW, // Aug 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 8 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 11 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 19 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 25 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Aug 31 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 1 + WEATHER_THUNDERSTORM, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_DIAMOND_DUST, // Sep 2 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 6 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 7 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, + WEATHER_LIGHT_SNOW, // Sep 10 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_BLIZZARD, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 12 + WEATHER_HEAVY_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 17 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 18 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_DIAMOND_DUST, // Sep 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 22 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 27 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 28 + WEATHER_THUNDERSTORM, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 29 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Sep 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 2 + WEATHER_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_BLIZZARD, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 12 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_BLIZZARD, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 17 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, + WEATHER_LIGHT_SNOW, // Oct 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_BLIZZARD, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_DIAMOND_DUST, // Oct 30 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Oct 31 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 1 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 8 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 9 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 13 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 18 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_BLIZZARD, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 22 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 23 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, + WEATHER_LIGHT_SNOW, // Nov 24 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 29 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Nov 30 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 1 + WEATHER_RAIN, + WEATHER_RAIN, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 2 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 3 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 4 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 5 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 6 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 7 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 8 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 9 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 10 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 11 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 12 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 13 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 14 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 15 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 16 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 17 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 18 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 19 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 20 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 21 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 22 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, + WEATHER_LIGHT_SNOW, // Dec 23 + WEATHER_THUNDERSTORM, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 24 + WEATHER_RAIN, + WEATHER_CLOUDY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 25 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_BLIZZARD, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 26 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 27 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 28 + WEATHER_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 29 + WEATHER_HEAVY_RAIN, + WEATHER_SUNNY, + WEATHER_SNOW, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW, // Dec 30 + WEATHER_THUNDERSTORM, + WEATHER_RAIN, + WEATHER_BLIZZARD, + WEATHER_SNOW, + WEATHER_LIGHT_SNOW // Dec 31 }; u32 FieldSystem_GetWeather(FieldSystem *fieldSystem, u32 mapId) { @@ -382,7 +1845,7 @@ u32 FieldSystem_GetWeather(FieldSystem *fieldSystem, u32 mapId) { return weatherType; } SysInfo_RTC *sysInfoRTC = Save_SysInfo_RTC_Get(fieldSystem->saveData); - s32 dayOfYear = GF_RTC_GetDayOfYear(&sysInfoRTC->date) - 1; + s32 dayOfYear = GF_RTC_GetDayOfYear(&sysInfoRTC->date) - 1; GF_ASSERT(dayOfYear >= 0 && dayOfYear < 366); if (sysInfoRTC->date.month > 2) { u32 year = sysInfoRTC->date.year; @@ -400,7 +1863,7 @@ u32 FieldSystem_GetWeather(FieldSystem *fieldSystem, u32 mapId) { dayOfYear = 1; } weatherType -= WEATHER_UNKNOWN_24; - u32 index = 5 * dayOfYear + weatherType; + u32 index = 5 * dayOfYear + weatherType; weatherType = sWeatherTable[index]; return weatherType; } diff --git a/arm9/src/filesystem.c b/arm9/src/filesystem.c index 097711f9b..06a482d2c 100644 --- a/arm9/src/filesystem.c +++ b/arm9/src/filesystem.c @@ -1,9 +1,11 @@ +#include "filesystem.h" + #include "global.h" + #include "FS_file.h" #include "heap.h" -#include "filesystem.h" -static char * sNarcFileList[] = { +static char *sNarcFileList[] = { "battle/skill/waza_seq.narc", "battle/skill/sub_seq.narc", #ifdef PEARL @@ -156,15 +158,14 @@ static char * sNarcFileList[] = { "poketool/shinzukan.narc", }; -void ReadFromNarcMemberByPathAndId(void * dest, const char * path, s32 file_idx, u32 offset, u32 size) -{ +void ReadFromNarcMemberByPathAndId(void *dest, const char *path, s32 file_idx, u32 offset, u32 size) { FSFile file; register u32 chunk_starts[3]; - u32 btnf_size = 0; + u32 btnf_size = 0; u32 chunk_size = 0; u32 file_start = 0; - u32 file_end = 0; - u16 num_files = 0; + u32 file_end = 0; + u16 num_files = 0; FS_InitFile(&file); FS_OpenFile(&file, path); @@ -185,25 +186,25 @@ void ReadFromNarcMemberByPathAndId(void * dest, const char * path, s32 file_idx, FS_ReadFile(&file, &file_end, 4); chunk_starts[2] = chunk_starts[1] + btnf_size; FS_SeekFile(&file, (s32)(chunk_starts[2] + 8 + file_start + offset), FS_SEEK_SET); - if (size == 0) + if (size == 0) { chunk_size = file_end - file_start; - else + } else { chunk_size = size; + } GF_ASSERT(chunk_size != 0); FS_ReadFile(&file, dest, (s32)chunk_size); FS_CloseFile(&file); } -void * AllocAndReadFromNarcMemberByPathAndId(const char * path, s32 file_idx, HeapID heapId, u32 offset, u32 size, BOOL r4) -{ +void *AllocAndReadFromNarcMemberByPathAndId(const char *path, s32 file_idx, HeapID heapId, u32 offset, u32 size, BOOL r4) { FSFile file; register u32 chunk_starts[3]; - u32 btnf_size = 0; + u32 btnf_size = 0; u32 chunk_size = 0; u32 file_start = 0; - u32 file_end = 0; - u16 num_files = 0; - void * dest = NULL; + u32 file_end = 0; + u16 num_files = 0; + void *dest = NULL; FS_InitFile(&file); FS_OpenFile(&file, path); @@ -224,13 +225,13 @@ void * AllocAndReadFromNarcMemberByPathAndId(const char * path, s32 file_idx, He FS_ReadFile(&file, &file_end, 4); chunk_starts[2] = chunk_starts[1] + btnf_size; FS_SeekFile(&file, (s32)(chunk_starts[2] + 8 + file_start + offset), FS_SEEK_SET); - if (size == 0) + if (size == 0) { chunk_size = file_end - file_start; - else + } else { chunk_size = size; + } GF_ASSERT(chunk_size != 0); - switch (r4) - { + switch (r4) { case 0: dest = AllocFromHeap(heapId, chunk_size); break; @@ -243,45 +244,38 @@ void * AllocAndReadFromNarcMemberByPathAndId(const char * path, s32 file_idx, He return dest; } -void ReadWholeNarcMemberByIdPair(void * dest, NarcId narc_id, s32 file_id) -{ +void ReadWholeNarcMemberByIdPair(void *dest, NarcId narc_id, s32 file_id) { ReadFromNarcMemberByPathAndId(dest, sNarcFileList[narc_id], file_id, 0, 0); } -void * AllocAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId) -{ +void *AllocAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId) { return AllocAndReadFromNarcMemberByPathAndId(sNarcFileList[narc_id], file_id, heapId, 0, 0, FALSE); } -void * AllocAtEndAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId) -{ +void *AllocAtEndAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId) { return AllocAndReadFromNarcMemberByPathAndId(sNarcFileList[narc_id], file_id, heapId, 0, 0, TRUE); } -void ReadFromNarcMemberByIdPair(void * dest, NarcId narc_id, s32 file_id, u32 offset, u32 size) -{ +void ReadFromNarcMemberByIdPair(void *dest, NarcId narc_id, s32 file_id, u32 offset, u32 size) { ReadFromNarcMemberByPathAndId(dest, sNarcFileList[narc_id], file_id, offset, size); } -void * AllocAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size) -{ +void *AllocAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size) { return AllocAndReadFromNarcMemberByPathAndId(sNarcFileList[narc_id], file_id, heapId, offset, size, FALSE); } -void * AllocAtEndAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size) -{ +void *AllocAtEndAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size) { return AllocAndReadFromNarcMemberByPathAndId(sNarcFileList[narc_id], file_id, heapId, offset, size, TRUE); } -u32 GetNarcMemberSizeByIdPair(NarcId narc_id, s32 file_idx) -{ +u32 GetNarcMemberSizeByIdPair(NarcId narc_id, s32 file_idx) { FSFile file; register u32 chunk_starts[3]; - u32 btnf_size = 0; + u32 btnf_size = 0; u32 chunk_size = 0; u32 file_start = 0; - u32 file_end = 0; - u16 num_files = 0; + u32 file_end = 0; + u16 num_files = 0; FS_InitFile(&file); FS_OpenFile(&file, sNarcFileList[narc_id]); @@ -308,13 +302,11 @@ u32 GetNarcMemberSizeByIdPair(NarcId narc_id, s32 file_idx) return chunk_size; } -NARC * NARC_New(NarcId narc_id, HeapID heapId) -{ - NARC * narc = (NARC *)AllocFromHeap(heapId, sizeof(NARC)); +NARC *NARC_New(NarcId narc_id, HeapID heapId) { + NARC *narc = (NARC *)AllocFromHeap(heapId, sizeof(NARC)); u32 btnf_start; u32 chunk_size; - if (narc != NULL) - { + if (narc != NULL) { narc->btaf_start = 0; FS_InitFile(&narc->file); FS_OpenFile(&narc->file, sNarcFileList[narc_id]); @@ -331,32 +323,28 @@ NARC * NARC_New(NarcId narc_id, HeapID heapId) return narc; } -void NARC_Delete(NARC * narc) -{ +void NARC_Delete(NARC *narc) { FS_CloseFile(&narc->file); FreeToHeap(narc); // free to heap } -void * NARC_AllocAndReadWholeMember(NARC * narc, u32 file_id, HeapID heapId) -{ +void *NARC_AllocAndReadWholeMember(NARC *narc, u32 file_id, HeapID heapId) { u32 file_start; u32 file_end; - void * dest; + void *dest; GF_ASSERT(narc->num_files > file_id); FS_SeekFile(&narc->file, (s32)(narc->btaf_start + 12 + 8 * file_id), FS_SEEK_SET); FS_ReadFile(&narc->file, &file_start, 4); FS_ReadFile(&narc->file, &file_end, 4); FS_SeekFile(&narc->file, (s32)(narc->gmif_start + 8 + file_start), FS_SEEK_SET); dest = AllocFromHeap(heapId, file_end - file_start); - if (dest != NULL) - { + if (dest != NULL) { FS_ReadFile(&narc->file, dest, (s32)(file_end - file_start)); } return dest; } -void NARC_ReadWholeMember(NARC * narc, u32 file_id, void * dest) -{ +void NARC_ReadWholeMember(NARC *narc, u32 file_id, void *dest) { u32 file_start; u32 file_end; GF_ASSERT(narc->num_files > file_id); @@ -367,8 +355,7 @@ void NARC_ReadWholeMember(NARC * narc, u32 file_id, void * dest) FS_ReadFile(&narc->file, dest, (s32)(file_end - file_start)); } -u32 NARC_GetMemberSize(NARC * narc, u32 file_id) -{ +u32 NARC_GetMemberSize(NARC *narc, u32 file_id) { u32 file_start; u32 file_end; GF_ASSERT(narc->num_files > file_id); @@ -378,8 +365,7 @@ u32 NARC_GetMemberSize(NARC * narc, u32 file_id) return file_end - file_start; } -void NARC_ReadFromMember(NARC * narc, u32 file_id, u32 pos, u32 size, void * dest) -{ +void NARC_ReadFromMember(NARC *narc, u32 file_id, u32 pos, u32 size, void *dest) { u32 file_start; GF_ASSERT(narc->num_files > file_id); FS_SeekFile(&narc->file, (s32)(narc->btaf_start + 12 + 8 * file_id), FS_SEEK_SET); @@ -388,12 +374,10 @@ void NARC_ReadFromMember(NARC * narc, u32 file_id, u32 pos, u32 size, void * des FS_ReadFile(&narc->file, dest, (s32)size); } -void NARC_ReadFile(NARC * narc, u32 size, void * dest) -{ +void NARC_ReadFile(NARC *narc, u32 size, void *dest) { FS_ReadFile(&narc->file, dest, (s32)size); } -u16 NARC_GetFileCount(NARC * narc) -{ +u16 NARC_GetFileCount(NARC *narc) { return narc->num_files; } diff --git a/arm9/src/font.c b/arm9/src/font.c index d08ea7e20..9f1b57045 100644 --- a/arm9/src/font.c +++ b/arm9/src/font.c @@ -1,7 +1,10 @@ -#include "global.h" #include "font.h" -#include "gf_gfx_loader.h" + +#include "global.h" + #include "graphic/font.naix" + +#include "gf_gfx_loader.h" #include "render_text.h" #include "string16.h" #include "string_control_code.h" @@ -27,12 +30,10 @@ const struct FontInfo gFontInfos[5] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, }; -void sub_02002C14() -{ +void sub_02002C14() { UNK_02106FC8 = &UNK_02106FCC; - for (u32 i = 0; i < 4; i++) - { + for (u32 i = 0; i < 4; i++) { UNK_02106FC8->unk84[i] = NULL; UNK_02106FC8->unk94[i] = NULL; } @@ -40,170 +41,142 @@ void sub_02002C14() SetFontsPointer(&gFontInfos[0]); } -void sub_02002C50(u32 font_id, HeapID heapId) -{ - UNK_02106FC8->unk94[font_id] = - FontData_New(NARC_GRAPHIC_FONT, UNK_020ECB54[font_id][0], 1, UNK_020ECB54[font_id][1], heapId); +void sub_02002C50(u32 font_id, HeapID heapId) { + UNK_02106FC8->unk94[font_id] = FontData_New(NARC_GRAPHIC_FONT, UNK_020ECB54[font_id][0], 1, UNK_020ECB54[font_id][1], heapId); } -void sub_02002C84(s32 param0, HeapID heapId) -{ +void sub_02002C84(s32 param0, HeapID heapId) { GF_ASSERT(param0 < 4); GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); FontData_ModeSwitch(UNK_02106FC8->unk94[param0], 0, heapId); } -void sub_02002CC0(s32 param0) -{ +void sub_02002CC0(s32 param0) { GF_ASSERT(param0 < 4); GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); FontData_ModeSwitch(UNK_02106FC8->unk94[param0], 1, HEAP_ID_DEFAULT); -} +} -void sub_02002CF8(int param0) -{ +void sub_02002CF8(int param0) { GF_ASSERT(param0 < 4); - if (UNK_02106FC8->unk84[param0] != NULL) - { + if (UNK_02106FC8->unk84[param0] != NULL) { u32 i; - for (i = 0; i < 4; i++) - { - if (i != param0 && UNK_020ECB54[i][0] == UNK_020ECB54[param0][0] && - UNK_02106FC8->unk94[i] != NULL) - { + for (i = 0; i < 4; i++) { + if (i != param0 && UNK_020ECB54[i][0] == UNK_020ECB54[param0][0] && UNK_02106FC8->unk94[i] != NULL) { UNK_02106FC8->unk84[i] = UNK_02106FC8->unk84[param0]; break; } } - if (i == 4) - { + if (i == 4) { FreeToHeap(UNK_02106FC8->unk84[param0]); UNK_02106FC8->unk84[param0] = NULL; } } - if (UNK_02106FC8->unk94[param0] != NULL) - { + if (UNK_02106FC8->unk94[param0] != NULL) { FontData_Delete(UNK_02106FC8->unk94[param0]); UNK_02106FC8->unk94[param0] = NULL; } } -struct UnkStruct_02002C14_sub *sub_02002D94(u32 param0, u32 param1) -{ +struct UnkStruct_02002C14_sub *sub_02002D94(u32 param0, u32 param1) { TryLoadGlyph(UNK_02106FC8->unk94[param0], param1, &UNK_02106FC8->unk00); return &UNK_02106FC8->unk00; } -u32 FontFunc(u32 fontId, struct TextPrinter *printer) -{ - struct TextPrinterSubStruct *subStruct = - (struct TextPrinterSubStruct *)(&printer->subStructFields); +u32 FontFunc(u32 fontId, struct TextPrinter *printer) { + struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&printer->subStructFields); - if (subStruct->hasGlyphIdBeenSet == 0) - { - subStruct->glyphId = fontId; + if (subStruct->hasGlyphIdBeenSet == 0) { + subStruct->glyphId = fontId; subStruct->hasGlyphIdBeenSet = 1; } return RenderText(printer); } -u32 sub_02002DE0(u32 param0, u16 *str, u32 param2) -{ +u32 sub_02002DE0(u32 param0, u16 *str, u32 param2) { GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); return GetStringWidth(UNK_02106FC8->unk94[param0], str, param2); } -u32 sub_02002E14(u32 param0, struct String *str, u32 param2) -{ +u32 sub_02002E14(u32 param0, struct String *str, u32 param2) { GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); return GetStringWidth(UNK_02106FC8->unk94[param0], String_c_str(str), param2); } -s32 GetFontAttribute(u8 fontId, s32 attr) -{ +s32 GetFontAttribute(u8 fontId, s32 attr) { u8 ret = 0; - switch (attr) - { - case 0: - ret = gFontInfos[fontId].maxLetterWidth; - break; - case 1: - ret = gFontInfos[fontId].maxLetterHeight; - break; - case 2: - ret = gFontInfos[fontId].letterSpacing; - break; - case 3: - ret = gFontInfos[fontId].lineSpacing; - break; - case 4: - ret = gFontInfos[fontId].unk; - break; - case 5: - ret = gFontInfos[fontId].fgColor; - break; - case 6: - ret = gFontInfos[fontId].bgColor; - break; - case 7: - ret = gFontInfos[fontId].shadowColor; - break; + switch (attr) { + case 0: + ret = gFontInfos[fontId].maxLetterWidth; + break; + case 1: + ret = gFontInfos[fontId].maxLetterHeight; + break; + case 2: + ret = gFontInfos[fontId].letterSpacing; + break; + case 3: + ret = gFontInfos[fontId].lineSpacing; + break; + case 4: + ret = gFontInfos[fontId].unk; + break; + case 5: + ret = gFontInfos[fontId].fgColor; + break; + case 6: + ret = gFontInfos[fontId].bgColor; + break; + case 7: + ret = gFontInfos[fontId].shadowColor; + break; } return ret; } -void LoadFontPal0(enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, HeapID heapId) -{ +void LoadFontPal0(enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, HeapID heapId) { GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, location, palSlotOffset, 0x20, heapId); } -void LoadFontPal1(enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, HeapID heapId) -{ +void LoadFontPal1(enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, HeapID heapId) { GfGfxLoader_GXLoadPal(NARC_GRAPHIC_FONT, NARC_font_narc_0007_NCLR, location, palSlotOffset, 0x20, heapId); } -u32 FontID_String_GetWidthMultiline(u32 param0, struct String *str, u32 param2) -{ +u32 FontID_String_GetWidthMultiline(u32 param0, struct String *str, u32 param2) { GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); return GetStringWidthMultiline(UNK_02106FC8->unk94[param0], String_c_str(str), param2); } -u32 sub_02002F40(u32 param0, struct String *str, u32 param2, u32 param3) -{ +u32 sub_02002F40(u32 param0, struct String *str, u32 param2, u32 param3) { u32 r0 = sub_02002E14(param0, str, param2); - if (r0 < param3) - { + if (r0 < param3) { return (param3 - r0) / 2; } return 0; } -u32 sub_02002F58(const u16 *str) -{ +u32 sub_02002F58(const u16 *str) { u32 r5 = 1; - while (*str != EOS) - { - if (*str == EXT_CTRL_CODE_BEGIN) - { + while (*str != EOS) { + if (*str == EXT_CTRL_CODE_BEGIN) { str = MsgArray_SkipControlCode(str); continue; } - if (*str == CHAR_LF) - { + if (*str == CHAR_LF) { r5++; str++; continue; @@ -215,13 +188,11 @@ u32 sub_02002F58(const u16 *str) return r5; } -u32 sub_02002F90(struct String *str) -{ +u32 sub_02002F90(struct String *str) { return sub_02002F58(String_c_str(str)); } -s32 sub_02002F9C(u32 param0, struct String *str) -{ +s32 sub_02002F9C(u32 param0, struct String *str) { GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); return StringGetWidth_SingleLine_HandleClearToControlCode( diff --git a/arm9/src/game_init.c b/arm9/src/game_init.c index 07a07fd66..6c0c1eda7 100644 --- a/arm9/src/game_init.c +++ b/arm9/src/game_init.c @@ -1,20 +1,22 @@ +#include "game_init.h" + #include "global.h" -#include "gx.h" -#include "math.h" -#include "main.h" + #include "FS_rom.h" +#include "OS_interrupt.h" #include "PAD_pad.h" +#include "gx.h" +#include "heap.h" +#include "main.h" +#include "math.h" +#include "registers.h" #include "string.h" #include "tp.h" #include "unk_0201B4E8.h" #include "unk_02022450.h" -#include "game_init.h" -#include "registers.h" -#include "heap.h" -#include "OS_interrupt.h" static struct { - void * contents; + void *contents; u32 name_hash; } sFileCache[128]; @@ -23,79 +25,64 @@ struct Main gSystem; void Main_ToggleHBlankInterrupt(BOOL enableFlag); void sub_0201B5CC(void *); -void sub_02015EA0(void) -{ +void sub_02015EA0(void) { DTCM.intr_check |= 1; MI_WaitDma(3); sub_0201B5CC(gSystem.unk1C); gSystem.unk30++; } -void sub_02015ED4(void) -{ +void sub_02015ED4(void) { DTCM.intr_check |= 1; MI_WaitDma(3); } -void sub_02015EF4(void) -{ +void sub_02015EF4(void) { OS_DisableIrqMask(1); OS_SetIrqFunction(1, sub_02015ED4); OS_EnableIrqMask(1); } -void Main_SetVBlankIntrCB(void (*a0)(void *), void * a1) -{ - gSystem.vBlankIntr = a0; +void Main_SetVBlankIntrCB(void (*a0)(void *), void *a1) { + gSystem.vBlankIntr = a0; gSystem.vBlankIntrArg = a1; } -void sub_02015F1C(void) -{ +void sub_02015F1C(void) { Main_ToggleHBlankInterrupt(FALSE); - gSystem.hBlankIntr = NULL; + gSystem.hBlankIntr = NULL; gSystem.hBlankIntrArg = NULL; } -BOOL Main_SetHBlankIntrCB(void (*a0)(void *), void * a1) -{ - if (a0 == 0) - { +BOOL Main_SetHBlankIntrCB(void (*a0)(void *), void *a1) { + if (a0 == 0) { Main_ToggleHBlankInterrupt(FALSE); - gSystem.hBlankIntr = NULL; + gSystem.hBlankIntr = NULL; gSystem.hBlankIntrArg = NULL; return TRUE; - } - else if (gSystem.hBlankIntr == NULL) - { + } else if (gSystem.hBlankIntr == NULL) { gSystem.hBlankIntrArg = a1; - gSystem.hBlankIntr = a0; + gSystem.hBlankIntr = a0; Main_ToggleHBlankInterrupt(TRUE); return TRUE; - } - else - { + } else { return FALSE; } } -void Main_CallHBlankCallback(void) -{ - if (gSystem.hBlankIntr != NULL) +void Main_CallHBlankCallback(void) { + if (gSystem.hBlankIntr != NULL) { gSystem.hBlankIntr(gSystem.hBlankIntrArg); + } } -void Main_ToggleHBlankInterrupt(BOOL enableFlag) -{ +void Main_ToggleHBlankInterrupt(BOOL enableFlag) { (void)OS_DisableIrq(); - if (!enableFlag) - { + if (!enableFlag) { (void)OS_GetIrqMask(); OS_DisableIrqMask(OS_IE_HBLANK); GX_HBlankIntr(FALSE); - } - else - { + } else { (void)OS_GetIrqMask(); OS_SetIrqFunction(OS_IE_HBLANK, Main_CallHBlankCallback); OS_EnableIrqMask(OS_IE_HBLANK); @@ -111,27 +98,23 @@ const struct HeapParam UNK_020EDB10[] = { { 0x10D800, OS_ARENA_MAIN } }; -void sub_02015FC8(void) -{ +void sub_02015FC8(void) { u32 data[8]; u8 digest[16]; OS_GetLowEntropyData(data); MATH_CalcMD5(digest, data, 32); u32 csum = 0, i; - for (i = 0; i < sizeof(digest); i++) - { + for (i = 0; i < sizeof(digest); i++) { csum += digest[i]; } csum %= 256; - while (csum & 3) - { + while (csum & 3) { csum++; } InitHeapSystem(UNK_020EDB10, NELEMS(UNK_020EDB10), 92, csum); } -void InitSystemForTheGame(void) -{ +void InitSystemForTheGame(void) { OS_Init(); FX_Init(); reg_GX_POWCNT = (REGType16v)((reg_GX_POWCNT & ~(REG_GX_POWCNT_GE_MASK | REG_GX_POWCNT_RE_MASK | REG_GX_POWCNT_E2DG_MASK | REG_GX_POWCNT_E2DGB_MASK)) | (REG_GX_POWCNT_GE_MASK | REG_GX_POWCNT_RE_MASK | REG_GX_POWCNT_E2DG_MASK | REG_GX_POWCNT_E2DGB_MASK)); @@ -152,20 +135,19 @@ void InitSystemForTheGame(void) GX_VBlankIntr(TRUE); FS_Init(1); sub_02022450(); - u32 size = FS_TryLoadTable(NULL, 0); - void * table = OS_AllocFromArenaLo(OS_ARENA_MAIN, size, 4); + u32 size = FS_TryLoadTable(NULL, 0); + void *table = OS_AllocFromArenaLo(OS_ARENA_MAIN, size, 4); GF_ASSERT(table != NULL); FS_TryLoadTable(table, size); - gSystem.vBlankIntr = NULL; - gSystem.hBlankIntr = NULL; - gSystem.unk10 = 0; - gSystem.unk14 = 0; - gSystem.unk2C = 0; + gSystem.vBlankIntr = NULL; + gSystem.hBlankIntr = NULL; + gSystem.unk10 = 0; + gSystem.unk14 = 0; + gSystem.unk2C = 0; gSystem.screensFlipped = 0; } -void InitGraphicMemory(void) -{ +void InitGraphicMemory(void) { GX_SetBankForLCDC(0x1FF); MI_CpuClearFast((void *)HW_LCDC_VRAM, HW_LCDC_VRAM_SIZE); GX_DisableBankForLCDC(); @@ -175,62 +157,56 @@ void InitGraphicMemory(void) MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); } -void * AllocAndReadFile(HeapID heapId, const char * path) -{ - void * ret; +void *AllocAndReadFile(HeapID heapId, const char *path) { + void *ret; FSFile file; FS_InitFile(&file); - if (FS_OpenFile(&file, path)) - { + if (FS_OpenFile(&file, path)) { u32 size = file.prop.file.bottom - file.prop.file.top; - ret = AllocFromHeap(heapId, size); - if (ret != NULL) - { - if (size != FS_ReadFile(&file, ret, (s32)size)) - { + ret = AllocFromHeap(heapId, size); + if (ret != NULL) { + if (size != FS_ReadFile(&file, ret, (s32)size)) { FreeToHeapExplicit(heapId, ret); ret = NULL; } } FS_CloseFile(&file); - } - else + } else { ret = NULL; + } return ret; } -void OpenAndReadWholeFile(const char * path, void ** ptr) -{ +void OpenAndReadWholeFile(const char *path, void **ptr) { FSFile file; FS_InitFile(&file); - if (FS_OpenFile(&file, path)) - { + if (FS_OpenFile(&file, path)) { u32 size = file.prop.file.bottom - file.prop.file.top; - if (*ptr != NULL) + if (*ptr != NULL) { FS_ReadFile(&file, *ptr, (s32)size); + } FS_CloseFile(&file); } } -u32 GetFilenameHash(const s8 * str) -{ +u32 GetFilenameHash(const s8 *str) { u16 len = (u16)strlen(str); u16 numWords; - if ((len % 4) != 0) + if ((len % 4) != 0) { numWords = (u16)((len / 4) + 1); - else + } else { numWords = (u16)(len / 4); + } u32 hash = 0; s32 i, j; - for (i = 0; i < numWords; i++) - { + for (i = 0; i < numWords; i++) { u32 curWord = 0; - for (j = 0; j < 4; j++) - { + for (j = 0; j < 4; j++) { int curChar = str[4 * i + j]; - if (curChar == 0) + if (curChar == 0) { break; + } curWord |= curChar << (8 * j); } hash ^= curWord; @@ -238,23 +214,19 @@ u32 GetFilenameHash(const s8 * str) return hash; } -int GetFileCacheId(u32 hash) -{ - for (int i = 0; i < 128; i++) - { - if (sFileCache[i].name_hash == hash && sFileCache[i].contents != NULL) +int GetFileCacheId(u32 hash) { + for (int i = 0; i < 128; i++) { + if (sFileCache[i].name_hash == hash && sFileCache[i].contents != NULL) { return i; + } } return -1; } -int AddFileToCache(void * contents, u32 hash) -{ - for (int i = 0; i < 128; i++) - { - if (sFileCache[i].contents == NULL) - { - sFileCache[i].contents = contents; +int AddFileToCache(void *contents, u32 hash) { + for (int i = 0; i < 128; i++) { + if (sFileCache[i].contents == NULL) { + sFileCache[i].contents = contents; sFileCache[i].name_hash = hash; return i; } @@ -262,123 +234,104 @@ int AddFileToCache(void * contents, u32 hash) return -1; } -void ClearFileCache(void) -{ - for (int i = 127; i > -1; i--) - { - if (sFileCache[i].contents != NULL) - { +void ClearFileCache(void) { + for (int i = 127; i > -1; i--) { + if (sFileCache[i].contents != NULL) { FreeToHeap(sFileCache[i].contents); - sFileCache[i].contents = NULL; + sFileCache[i].contents = NULL; sFileCache[i].name_hash = 0; } } } -void * OpenFileCached(const s8 * str, HeapID heapId) -{ +void *OpenFileCached(const s8 *str, HeapID heapId) { s8 filenameBuf[32]; FSFile file; - void * ret; + void *ret; int skipCache = 0; - if (str[0] == '!') - { + if (str[0] == '!') { strcpy(filenameBuf, str + 1); skipCache = 1; - } - else - { + } else { strcpy(filenameBuf, str); } - u32 hash = GetFilenameHash(filenameBuf); + u32 hash = GetFilenameHash(filenameBuf); s32 cacheId = GetFileCacheId(hash); - if (cacheId >= 0 && skipCache == 0) - { + if (cacheId >= 0 && skipCache == 0) { ret = sFileCache[cacheId].contents; - } - else - { + } else { FS_InitFile(&file); - if (FS_OpenFile(&file, (const char *)filenameBuf)) - { + if (FS_OpenFile(&file, (const char *)filenameBuf)) { u32 size = file.prop.file.bottom - file.prop.file.top; - ret = AllocFromHeap(heapId, size); - if (ret != NULL) - { - if (size != FS_ReadFile(&file, ret, (s32)size)) - { + ret = AllocFromHeap(heapId, size); + if (ret != NULL) { + if (size != FS_ReadFile(&file, ret, (s32)size)) { FreeToHeap(ret); ret = NULL; } } FS_CloseFile(&file); - if (skipCache == 0) + if (skipCache == 0) { AddFileToCache(ret, hash); - } - else + } + } else { ret = NULL; + } } return ret; } -void InitKeypadAndTouchpad(void) -{ +void InitKeypadAndTouchpad(void) { TPCalibrateParam tp; - gSystem.buttonMode = 0; - gSystem.heldKeysRaw = 0; - gSystem.newKeysRaw = 0; - gSystem.newAndRepeatedKeysRaw = 0; - gSystem.heldKeys = 0; - gSystem.newKeys = 0; - gSystem.newAndRepeatedKeys = 0; - gSystem.keyRepeatCounter = 0; + gSystem.buttonMode = 0; + gSystem.heldKeysRaw = 0; + gSystem.newKeysRaw = 0; + gSystem.newAndRepeatedKeysRaw = 0; + gSystem.heldKeys = 0; + gSystem.newKeys = 0; + gSystem.newAndRepeatedKeys = 0; + gSystem.keyRepeatCounter = 0; gSystem.keyRepeatContinueDelay = 8; - gSystem.keyRepeatStartDelay = 15; - gSystem.touchX = 0; - gSystem.touchY = 0; - gSystem.touchNew = 0; - gSystem.touchHeld = 0; - gSystem.touchpadReadAuto = 0; + gSystem.keyRepeatStartDelay = 15; + gSystem.touchX = 0; + gSystem.touchY = 0; + gSystem.touchNew = 0; + gSystem.touchHeld = 0; + gSystem.touchpadReadAuto = 0; TP_Init(); - if (TP_GetUserInfo(&tp) == TRUE) + if (TP_GetUserInfo(&tp) == TRUE) { TP_SetCalibrateParam(&tp); - else - { - tp.x0 = 686; - tp.y0 = 1420; + } else { + tp.x0 = 686; + tp.y0 = 1420; tp.xDotSize = 3621; tp.yDotSize = 4616; TP_SetCalibrateParam(&tp); } } -void sub_02016438(u8 a0) -{ +void sub_02016438(u8 a0) { gSystem.gbaCartId = a0; } -void sub_02016444(u8 a0) -{ +void sub_02016444(u8 a0) { gSystem.unk67 |= a0; } -void sub_02016454(u8 a0) -{ +void sub_02016454(u8 a0) { gSystem.unk67 &= ~a0; } -void ReadKeypadAndTocuhpad(void) -{ +void ReadKeypadAndTocuhpad(void) { TPData raw, calib; - if (PAD_DetectFold()) - { + if (PAD_DetectFold()) { // Can't press any buttons while the lid is closed. - gSystem.newKeys = 0; - gSystem.heldKeys = 0; + gSystem.newKeys = 0; + gSystem.heldKeys = 0; gSystem.newAndRepeatedKeys = 0; - gSystem.touchNew = 0; - gSystem.touchHeld = 0; + gSystem.touchNew = 0; + gSystem.touchHeld = 0; return; } @@ -393,48 +346,40 @@ void ReadKeypadAndTocuhpad(void) // Same logic as gen3, but fixes the bug where the // remapped keys are incorrectly used here. // See also: pokeemerald/src/main.c:ReadKeys - if (padRead != 0 && gSystem.heldKeysRaw == padRead) - { - if (--gSystem.keyRepeatCounter == 0) - { + if (padRead != 0 && gSystem.heldKeysRaw == padRead) { + if (--gSystem.keyRepeatCounter == 0) { gSystem.newAndRepeatedKeysRaw = padRead; - gSystem.keyRepeatCounter = gSystem.keyRepeatContinueDelay; + gSystem.keyRepeatCounter = gSystem.keyRepeatContinueDelay; } - } - else - { + } else { gSystem.keyRepeatCounter = gSystem.keyRepeatStartDelay; } gSystem.heldKeysRaw = padRead; // Apply the button mode option to the read key input - gSystem.newKeys = gSystem.newKeysRaw; - gSystem.heldKeys = padRead; + gSystem.newKeys = gSystem.newKeysRaw; + gSystem.heldKeys = padRead; gSystem.newAndRepeatedKeys = gSystem.newAndRepeatedKeysRaw; ApplyButtonModeToInput(); // Read the touchpad. New to gen 4. - if (gSystem.touchpadReadAuto == 0) - { + if (gSystem.touchpadReadAuto == 0) { while (TP_RequestRawSampling(&raw)) ; - } - else + } else { TP_GetLatestRawPointInAuto(&raw); + } TP_GetCalibratedPoint(&calib, &raw); // If the touchpad is valid, we gucci. - if (calib.validity == TP_VALIDITY_VALID) - { + if (calib.validity == TP_VALIDITY_VALID) { gSystem.touchX = calib.x; gSystem.touchY = calib.y; } // If the touchpad was used last frame, salvage what we can. - else if (gSystem.touchHeld) - { - switch (calib.validity) - { + else if (gSystem.touchHeld) { + switch (calib.validity) { case TP_VALIDITY_INVALID_X: gSystem.touchY = calib.y; break; @@ -447,48 +392,47 @@ void ReadKeypadAndTocuhpad(void) } // What was read from the touchpad was not salvageable. // Ignore touch input. - else + else { calib.touch = 0; - gSystem.touchNew = (u16)((gSystem.touchHeld ^ calib.touch) & calib.touch); + } + gSystem.touchNew = (u16)((gSystem.touchHeld ^ calib.touch) & calib.touch); gSystem.touchHeld = calib.touch; } -void ApplyButtonModeToInput(void) -{ - switch (gSystem.buttonMode) - { +void ApplyButtonModeToInput(void) { + switch (gSystem.buttonMode) { case 0: // Normal break; case 1: // Start = X - if (gSystem.newKeys & PAD_BUTTON_START) + if (gSystem.newKeys & PAD_BUTTON_START) { gSystem.newKeys |= PAD_BUTTON_X; - if (gSystem.heldKeys & PAD_BUTTON_START) + } + if (gSystem.heldKeys & PAD_BUTTON_START) { gSystem.heldKeys |= PAD_BUTTON_X; - if (gSystem.newAndRepeatedKeys & PAD_BUTTON_START) + } + if (gSystem.newAndRepeatedKeys & PAD_BUTTON_START) { gSystem.newAndRepeatedKeys |= PAD_BUTTON_X; + } break; case 2: // Swap X and Y; unused in the retail game - { - u32 swapMask = 0; - if (gSystem.newKeys & PAD_BUTTON_X) - { - swapMask |= PAD_BUTTON_Y; - } - if (gSystem.newKeys & PAD_BUTTON_Y) - { - swapMask |= PAD_BUTTON_X; - } - gSystem.newKeys &= ((PAD_BUTTON_X | PAD_BUTTON_Y) ^ 0xFFFF);; - gSystem.newKeys |= swapMask; + { + u32 swapMask = 0; + if (gSystem.newKeys & PAD_BUTTON_X) { + swapMask |= PAD_BUTTON_Y; } + if (gSystem.newKeys & PAD_BUTTON_Y) { + swapMask |= PAD_BUTTON_X; + } + gSystem.newKeys &= ((PAD_BUTTON_X | PAD_BUTTON_Y) ^ 0xFFFF); + ; + gSystem.newKeys |= swapMask; + } { u32 swapMask = 0; - if (gSystem.heldKeys & PAD_BUTTON_X) - { + if (gSystem.heldKeys & PAD_BUTTON_X) { swapMask |= PAD_BUTTON_Y; } - if (gSystem.heldKeys & PAD_BUTTON_Y) - { + if (gSystem.heldKeys & PAD_BUTTON_Y) { swapMask |= PAD_BUTTON_X; } gSystem.heldKeys &= ((PAD_BUTTON_X | PAD_BUTTON_Y) ^ 0xFFFF); @@ -496,12 +440,10 @@ void ApplyButtonModeToInput(void) } { u32 swapMask = 0; - if (gSystem.newAndRepeatedKeys & PAD_BUTTON_X) - { + if (gSystem.newAndRepeatedKeys & PAD_BUTTON_X) { swapMask |= PAD_BUTTON_Y; } - if (gSystem.newAndRepeatedKeys & PAD_BUTTON_Y) - { + if (gSystem.newAndRepeatedKeys & PAD_BUTTON_Y) { swapMask |= PAD_BUTTON_X; } gSystem.newAndRepeatedKeys &= ((PAD_BUTTON_X | PAD_BUTTON_Y) ^ 0xFFFF); @@ -509,30 +451,30 @@ void ApplyButtonModeToInput(void) } break; case 3: // L = A - if (gSystem.newKeys & PAD_BUTTON_L) + if (gSystem.newKeys & PAD_BUTTON_L) { gSystem.newKeys |= PAD_BUTTON_A; - if (gSystem.heldKeys & PAD_BUTTON_L) + } + if (gSystem.heldKeys & PAD_BUTTON_L) { gSystem.heldKeys |= PAD_BUTTON_A; - if (gSystem.newAndRepeatedKeys & PAD_BUTTON_L) + } + if (gSystem.newAndRepeatedKeys & PAD_BUTTON_L) { gSystem.newAndRepeatedKeys |= PAD_BUTTON_A; + } gSystem.newKeys &= ((PAD_BUTTON_L | PAD_BUTTON_R) ^ 0xFFFF); gSystem.heldKeys &= ((PAD_BUTTON_L | PAD_BUTTON_R) ^ 0xFFFF); gSystem.newAndRepeatedKeys &= ((PAD_BUTTON_L | PAD_BUTTON_R) ^ 0xFFFF); } } -void SetKeyRepeatTimers(int continueDelay, int startDelay) -{ +void SetKeyRepeatTimers(int continueDelay, int startDelay) { gSystem.keyRepeatContinueDelay = continueDelay; - gSystem.keyRepeatStartDelay = startDelay; + gSystem.keyRepeatStartDelay = startDelay; } -void SetSoftResetDisableMask(u8 a0) -{ +void SetSoftResetDisableMask(u8 a0) { gSystem.softResetDisabled |= a0; } -void ClearSoftResetDisableMask(u8 a0) -{ +void ClearSoftResetDisableMask(u8 a0) { gSystem.softResetDisabled &= ~a0; } diff --git a/arm9/src/gf_gfx_loader.c b/arm9/src/gf_gfx_loader.c index 5e442bc2d..bdfec3e4a 100644 --- a/arm9/src/gf_gfx_loader.c +++ b/arm9/src/gf_gfx_loader.c @@ -1,18 +1,18 @@ +#include "gf_gfx_loader.h" + #include "global.h" -#include "filesystem.h" + #include "NNS_g2d.h" -#include "gf_gfx_loader.h" +#include "filesystem.h" -u32 GfGfxLoader_LoadCharData(NarcId narcId, s32 memberNo, struct BgConfig * unkStruct02016B94_2, u32 layer, u32 numTiles, u32 szByte, BOOL isCompressed, HeapID heapId) -{ - NNSG2dCharacterData * pCharData; - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberNo, isCompressed, heapId, FALSE); - if (pFile != NULL) - { - if (NNS_G2dGetUnpackedBGCharacterData(pFile, &pCharData)) - { - if (szByte == 0) +u32 GfGfxLoader_LoadCharData(NarcId narcId, s32 memberNo, struct BgConfig *unkStruct02016B94_2, u32 layer, u32 numTiles, u32 szByte, BOOL isCompressed, HeapID heapId) { + NNSG2dCharacterData *pCharData; + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberNo, isCompressed, heapId, FALSE); + if (pFile != NULL) { + if (NNS_G2dGetUnpackedBGCharacterData(pFile, &pCharData)) { + if (szByte == 0) { szByte = pCharData->szByte; + } BG_LoadCharTilesData(unkStruct02016B94_2, (u8)layer, pCharData->pRawData, szByte, numTiles); } FreeToHeap(pFile); @@ -20,31 +20,28 @@ u32 GfGfxLoader_LoadCharData(NarcId narcId, s32 memberNo, struct BgConfig * unkS return szByte; } -void GfGfxLoader_LoadScrnData(NarcId narcId, s32 memberNo, struct BgConfig * unkStruct02016B94_2, u32 layer, u32 tileOffset, u32 szByte, BOOL isCompressed, HeapID heapId) -{ - NNSG2dScreenData * pScreenData; - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberNo, isCompressed, heapId, TRUE); - if (pFile != NULL) - { - if (NNS_G2dGetUnpackedScreenData(pFile, &pScreenData)) - { - if (szByte == 0) +void GfGfxLoader_LoadScrnData(NarcId narcId, s32 memberNo, struct BgConfig *unkStruct02016B94_2, u32 layer, u32 tileOffset, u32 szByte, BOOL isCompressed, HeapID heapId) { + NNSG2dScreenData *pScreenData; + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberNo, isCompressed, heapId, TRUE); + if (pFile != NULL) { + if (NNS_G2dGetUnpackedScreenData(pFile, &pScreenData)) { + if (szByte == 0) { szByte = pScreenData->szByte; - if (GetBgTilemapBuffer(unkStruct02016B94_2, (u8) layer) != NULL) - BG_LoadScreenTilemapData(unkStruct02016B94_2, (u8) layer, pScreenData->rawData, szByte); - BgCopyOrUncompressTilemapBufferRangeToVram(unkStruct02016B94_2, (u8) layer, pScreenData->rawData, szByte, tileOffset); + } + if (GetBgTilemapBuffer(unkStruct02016B94_2, (u8)layer) != NULL) { + BG_LoadScreenTilemapData(unkStruct02016B94_2, (u8)layer, pScreenData->rawData, szByte); + } + BgCopyOrUncompressTilemapBufferRangeToVram(unkStruct02016B94_2, (u8)layer, pScreenData->rawData, szByte, tileOffset); } FreeToHeap(pFile); } } -void GfGfxLoader_GXLoadPal(NarcId narcId, s32 memberNo, enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, u32 szByte, HeapID heapId) -{ +void GfGfxLoader_GXLoadPal(NarcId narcId, s32 memberNo, enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, u32 szByte, HeapID heapId) { GfGfxLoader_GXLoadPalWithSrcOffset(narcId, memberNo, location, 0, palSlotOffset, szByte, heapId); } -void GfGfxLoader_GXLoadPalWithSrcOffset(NarcId narcId, s32 memberNo, enum GFPalLoadLocation location, u32 srcOffset, enum GFPalSlotOffset palSlotOffset, u32 szByte, HeapID heapId) -{ +void GfGfxLoader_GXLoadPalWithSrcOffset(NarcId narcId, s32 memberNo, enum GFPalLoadLocation location, u32 srcOffset, enum GFPalSlotOffset palSlotOffset, u32 szByte, HeapID heapId) { static void (*const load_funcs[])(void *, u32, u32) = { GX_LoadBGPltt, GX_LoadOBJPltt, @@ -55,18 +52,16 @@ void GfGfxLoader_GXLoadPalWithSrcOffset(NarcId narcId, s32 memberNo, enum GFPalL GXS_LoadBGExtPltt, GXS_LoadOBJExtPltt }; - NNSG2dPaletteData * pPltData; - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberNo, FALSE, heapId, TRUE); - if (pFile != NULL) - { - if (NNS_G2dGetUnpackedPaletteData(pFile, &pPltData)) - { + NNSG2dPaletteData *pPltData; + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberNo, FALSE, heapId, TRUE); + if (pFile != NULL) { + if (NNS_G2dGetUnpackedPaletteData(pFile, &pPltData)) { pPltData->pRawData = (void *)((u32)pPltData->pRawData + srcOffset); - if (szByte == 0) + if (szByte == 0) { szByte = pPltData->szByte - srcOffset; + } DC_FlushRange(pPltData->pRawData, szByte); - switch (location) - { + switch (location) { case GF_PAL_LOCATION_MAIN_BGEXT: GX_BeginLoadBGExtPltt(); load_funcs[location](pPltData->pRawData, palSlotOffset, szByte); @@ -96,21 +91,20 @@ void GfGfxLoader_GXLoadPalWithSrcOffset(NarcId narcId, s32 memberNo, enum GFPalL } } -u32 GfGfxLoader_LoadWholePalette(NarcId narcId, s32 memberId, u32 layer, u32 baseAddr, u32 szByte, BOOL isCompressed, HeapID heapId) //todo: change this to new format +u32 GfGfxLoader_LoadWholePalette(NarcId narcId, s32 memberId, u32 layer, u32 baseAddr, u32 szByte, BOOL isCompressed, HeapID heapId) // todo: change this to new format { static void (*const load_funcs[])(void *, u32, u32) = { GX_LoadOBJ, GXS_LoadOBJ }; - NNSG2dCharacterData* pCharData; - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, TRUE); - if (pFile != NULL) - { - if (NNS_G2dGetUnpackedCharacterData(pFile, &pCharData)) - { - if (szByte == 0) + NNSG2dCharacterData *pCharData; + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, TRUE); + if (pFile != NULL) { + if (NNS_G2dGetUnpackedCharacterData(pFile, &pCharData)) { + if (szByte == 0) { szByte = pCharData->szByte; + } DC_FlushRange(pCharData->pRawData, szByte); load_funcs[layer](pCharData->pRawData, baseAddr, szByte); } @@ -119,22 +113,16 @@ u32 GfGfxLoader_LoadWholePalette(NarcId narcId, s32 memberId, u32 layer, u32 bas return szByte; } -void GfGfxLoader_PartiallyLoadPalette(NarcId narcId, s32 memberId, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, HeapID heapId, NNSG2dImagePaletteProxy * pPltProxy) -{ - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, FALSE, heapId, TRUE); - NNSG2dPaletteData* pPlttData; - NNSG2dPaletteCompressInfo* pCompressInfo; - if (pFile != NULL) - { +void GfGfxLoader_PartiallyLoadPalette(NarcId narcId, s32 memberId, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, HeapID heapId, NNSG2dImagePaletteProxy *pPltProxy) { + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, FALSE, heapId, TRUE); + NNSG2dPaletteData *pPlttData; + NNSG2dPaletteCompressInfo *pCompressInfo; + if (pFile != NULL) { BOOL isCompressed = NNS_G2dGetUnpackedPaletteCompressInfo(pFile, &pCompressInfo); - if (NNS_G2dGetUnpackedPaletteData(pFile, &pPlttData)) - { - if (isCompressed) - { + if (NNS_G2dGetUnpackedPaletteData(pFile, &pPlttData)) { + if (isCompressed) { NNS_G2dLoadPaletteEx(pPlttData, pCompressInfo, baseAddr, vramType, pPltProxy); - } - else - { + } else { NNS_G2dLoadPalette(pPlttData, baseAddr, vramType, pPltProxy); } } @@ -142,22 +130,20 @@ void GfGfxLoader_PartiallyLoadPalette(NarcId narcId, s32 memberId, NNS_G2D_VRAM_ } } -u32 GfGfxLoader_LoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 layer, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, HeapID heapId, NNSG2dImageProxy *pImgProxy) -{ +u32 GfGfxLoader_LoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 layer, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, HeapID heapId, NNSG2dImageProxy *pImgProxy) { static void (*const load_funcs[])(const NNSG2dCharacterData *, u32, NNS_G2D_VRAM_TYPE, NNSG2dImageProxy *) = { NNS_G2dLoadImage1DMapping, NNS_G2dLoadImage2DMapping }; - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, TRUE); + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, TRUE); u32 retSize = 0; - NNSG2dCharacterData * pSrcData; - if (pFile != NULL) - { - if (NNS_G2dGetUnpackedCharacterData(pFile, &pSrcData)) - { - if (szByte != 0) + NNSG2dCharacterData *pSrcData; + if (pFile != NULL) { + if (NNS_G2dGetUnpackedCharacterData(pFile, &pSrcData)) { + if (szByte != 0) { pSrcData->szByte = szByte; + } load_funcs[layer](pSrcData, baseAddr, type, pImgProxy); retSize = pSrcData->szByte; } @@ -166,30 +152,26 @@ u32 GfGfxLoader_LoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, return retSize; } -void GfGfxLoader_SetObjCntFlagsAndLoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 layer, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, HeapID heapId, NNSG2dImageProxy * pImageProxy) -{ +void GfGfxLoader_SetObjCntFlagsAndLoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 layer, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, HeapID heapId, NNSG2dImageProxy *pImageProxy) { static void (*const load_funcs[])(const NNSG2dCharacterData *, u32, NNS_G2D_VRAM_TYPE, NNSG2dImageProxy *) = { NNS_G2dLoadImage1DMapping, NNS_G2dLoadImage2DMapping }; - NNSG2dCharacterData * pCharacterData; - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, TRUE); - if (pFile != NULL) - { - if (NNS_G2dGetUnpackedCharacterData(pFile, &pCharacterData)) - { - if (szByte != 0) + NNSG2dCharacterData *pCharacterData; + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, TRUE); + if (pFile != NULL) { + if (NNS_G2dGetUnpackedCharacterData(pFile, &pCharacterData)) { + if (szByte != 0) { pCharacterData->szByte = szByte; - switch (type) - { + } + switch (type) { case NNS_G2D_VRAM_TYPE_2DMAIN: pCharacterData->mapingType = (GXOBJVRamModeChar)(reg_GX_DISPCNT & (REG_GX_DISPCNT_EXOBJ_CH_MASK | REG_GX_DISPCNT_OBJMAP_CH_MASK)); break; case NNS_G2D_VRAM_TYPE_2DSUB: pCharacterData->mapingType = (GXOBJVRamModeChar)(reg_GXS_DB_DISPCNT & (REG_GXS_DB_DISPCNT_EXOBJ_MASK | REG_GXS_DB_DISPCNT_OBJMAP_CH_MASK)); break; - default: - ; + default:; } load_funcs[layer](pCharacterData, baseAddr, type, pImageProxy); } @@ -197,13 +179,10 @@ void GfGfxLoader_SetObjCntFlagsAndLoadImageMapping(NarcId narcId, s32 memberId, } } -void * GfGfxLoader_GetCharData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCharacterData ** ppCharData, HeapID heapId) -{ - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); - if (pFile != NULL) - { - if (!NNS_G2dGetUnpackedBGCharacterData(pFile, ppCharData)) - { +void *GfGfxLoader_GetCharData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCharacterData **ppCharData, HeapID heapId) { + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); + if (pFile != NULL) { + if (!NNS_G2dGetUnpackedBGCharacterData(pFile, ppCharData)) { FreeToHeap(pFile); return NULL; } @@ -211,13 +190,10 @@ void * GfGfxLoader_GetCharData(NarcId narcId, s32 memberId, BOOL isCompressed, N return pFile; } -void * GfGfxLoader_GetScrnData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dScreenData ** ppScrData, HeapID heapId) -{ - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); - if (pFile != NULL) - { - if (!NNS_G2dGetUnpackedScreenData(pFile, ppScrData)) - { +void *GfGfxLoader_GetScrnData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dScreenData **ppScrData, HeapID heapId) { + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); + if (pFile != NULL) { + if (!NNS_G2dGetUnpackedScreenData(pFile, ppScrData)) { FreeToHeap(pFile); return NULL; } @@ -225,13 +201,10 @@ void * GfGfxLoader_GetScrnData(NarcId narcId, s32 memberId, BOOL isCompressed, N return pFile; } -void * GfGfxLoader_GetPlttData(NarcId narcId, s32 memberId, NNSG2dPaletteData ** ppPltData, HeapID heapId) -{ - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, FALSE, heapId, FALSE); - if (pFile != NULL) - { - if (!NNS_G2dGetUnpackedPaletteData(pFile, ppPltData)) - { +void *GfGfxLoader_GetPlttData(NarcId narcId, s32 memberId, NNSG2dPaletteData **ppPltData, HeapID heapId) { + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, FALSE, heapId, FALSE); + if (pFile != NULL) { + if (!NNS_G2dGetUnpackedPaletteData(pFile, ppPltData)) { FreeToHeap(pFile); return NULL; } @@ -239,13 +212,10 @@ void * GfGfxLoader_GetPlttData(NarcId narcId, s32 memberId, NNSG2dPaletteData ** return pFile; } -void * GfGfxLoader_GetCellBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCellDataBank ** ppCellBank, HeapID heapId) -{ - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); - if (pFile != NULL) - { - if (!NNS_G2dGetUnpackedCellBank(pFile, ppCellBank)) - { +void *GfGfxLoader_GetCellBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCellDataBank **ppCellBank, HeapID heapId) { + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); + if (pFile != NULL) { + if (!NNS_G2dGetUnpackedCellBank(pFile, ppCellBank)) { FreeToHeap(pFile); return NULL; } @@ -253,13 +223,10 @@ void * GfGfxLoader_GetCellBank(NarcId narcId, s32 memberId, BOOL isCompressed, N return pFile; } -void * GfGfxLoader_GetAnimBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dAnimBankData ** ppAnimBank, HeapID heapId) -{ - void * pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); - if (pFile != NULL) - { - if (!NNS_G2dGetUnpackedAnimBank(pFile, ppAnimBank)) - { +void *GfGfxLoader_GetAnimBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dAnimBankData **ppAnimBank, HeapID heapId) { + void *pFile = GfGfxLoader_LoadFromNarc(narcId, memberId, isCompressed, heapId, FALSE); + if (pFile != NULL) { + if (!NNS_G2dGetUnpackedAnimBank(pFile, ppAnimBank)) { FreeToHeap(pFile); return NULL; } @@ -267,40 +234,29 @@ void * GfGfxLoader_GetAnimBank(NarcId narcId, s32 memberId, BOOL isCompressed, N return pFile; } -void * GfGfxLoader_UncompressFromNarc(NarcId narcId, s32 memberId, HeapID heapId) -{ +void *GfGfxLoader_UncompressFromNarc(NarcId narcId, s32 memberId, HeapID heapId) { return GfGfxLoader_LoadFromNarc(narcId, memberId, TRUE, heapId, FALSE); } -void * GfGfxLoader_LoadFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd) -{ - void * dest; - void * dest2; - if (isCompressed || allocAtEnd == TRUE) - { +void *GfGfxLoader_LoadFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd) { + void *dest; + void *dest2; + if (isCompressed || allocAtEnd == TRUE) { u32 size = GetNarcMemberSizeByIdPair(narcId, memberNo); - dest = AllocFromHeapAtEnd(heapId, size); - } - else - { + dest = AllocFromHeapAtEnd(heapId, size); + } else { u32 size = GetNarcMemberSizeByIdPair(narcId, memberNo); - dest = AllocFromHeap(heapId, size); + dest = AllocFromHeap(heapId, size); } - if (dest != NULL) - { + if (dest != NULL) { ReadWholeNarcMemberByIdPair(dest, narcId, memberNo); - if (isCompressed) - { - if (allocAtEnd == FALSE) - { + if (isCompressed) { + if (allocAtEnd == FALSE) { dest2 = AllocFromHeap(heapId, (*(u32 *)dest) >> 8); - } - else - { + } else { dest2 = AllocFromHeapAtEnd(heapId, (*(u32 *)dest) >> 8); } - if (dest2 != NULL) - { + if (dest2 != NULL) { MI_UncompressLZ8(dest, dest2); FreeToHeap(dest); } @@ -310,35 +266,25 @@ void * GfGfxLoader_LoadFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, return dest; } -void * GfGfxLoader_LoadFromNarc_GetSizeOut(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd, u32 *size_p) -{ - void * dest; - void * dest2; +void *GfGfxLoader_LoadFromNarc_GetSizeOut(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd, u32 *size_p) { + void *dest; + void *dest2; *size_p = GetNarcMemberSizeByIdPair(narcId, memberNo); - if (isCompressed || allocAtEnd == TRUE) - { + if (isCompressed || allocAtEnd == TRUE) { dest = AllocFromHeapAtEnd(heapId, *size_p); - } - else - { + } else { dest = AllocFromHeap(heapId, *size_p); } - if (dest != NULL) - { + if (dest != NULL) { ReadWholeNarcMemberByIdPair(dest, narcId, memberNo); - if (isCompressed) - { + if (isCompressed) { *size_p = (*(u32 *)dest) >> 8; - if (allocAtEnd == FALSE) - { + if (allocAtEnd == FALSE) { dest2 = AllocFromHeap(heapId, *size_p); - } - else - { + } else { dest2 = AllocFromHeapAtEnd(heapId, *size_p); } - if (dest2 != NULL) - { + if (dest2 != NULL) { MI_UncompressLZ8(dest, dest2); FreeToHeap(dest); } diff --git a/arm9/src/gf_gfx_planes.c b/arm9/src/gf_gfx_planes.c index 126a187c0..ec230007f 100644 --- a/arm9/src/gf_gfx_planes.c +++ b/arm9/src/gf_gfx_planes.c @@ -1,5 +1,7 @@ -#include "global.h" #include "gf_gfx_planes.h" + +#include "global.h" + #include "GX_vramcnt.h" #include "gx.h" #include "main.h" @@ -9,8 +11,7 @@ static u32 sEngineAPlanes; static u32 sEngineBPlanes; -void GfGfx_SetBanks(const struct GraphicsBanks *banks) -{ +void GfGfx_SetBanks(const struct GraphicsBanks *banks) { GX_ResetBankForBG(); GX_ResetBankForBGExtPltt(); GX_ResetBankForSubBG(); @@ -34,25 +35,17 @@ void GfGfx_SetBanks(const struct GraphicsBanks *banks) GX_SetBankForTexPltt(banks->texpltt); } - -void GfGfx_DisableEngineAPlanes() -{ +void GfGfx_DisableEngineAPlanes() { sEngineAPlanes = 0; } -void GfGfx_EngineATogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) -{ - if (layer_toggle == GX_PLANE_TOGGLE_ON) - { - if ((sEngineAPlanes & layer_mask) != 0) - { +void GfGfx_EngineATogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) { + if (layer_toggle == GX_PLANE_TOGGLE_ON) { + if ((sEngineAPlanes & layer_mask) != 0) { return; } - } - else - { - if ((sEngineAPlanes & layer_mask) == 0) - { + } else { + if ((sEngineAPlanes & layer_mask) == 0) { return; } } @@ -60,30 +53,22 @@ void GfGfx_EngineATogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) GX_SetVisiblePlane(sEngineAPlanes ^= layer_mask); } -void GfGfx_EngineASetPlanes(u32 layer_mask) -{ +void GfGfx_EngineASetPlanes(u32 layer_mask) { sEngineAPlanes = layer_mask; GX_SetVisiblePlane(layer_mask); } -void GfGfx_DisableEngineBPlanes() -{ +void GfGfx_DisableEngineBPlanes() { sEngineBPlanes = 0; } -void GfGfx_EngineBTogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) -{ - if (layer_toggle == GX_PLANE_TOGGLE_ON) - { - if ((sEngineBPlanes & layer_mask) != 0) - { +void GfGfx_EngineBTogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) { + if (layer_toggle == GX_PLANE_TOGGLE_ON) { + if ((sEngineBPlanes & layer_mask) != 0) { return; } - } - else - { - if ((sEngineBPlanes & layer_mask) == 0) - { + } else { + if ((sEngineBPlanes & layer_mask) == 0) { return; } } @@ -91,25 +76,19 @@ void GfGfx_EngineBTogglePlanes(u32 layer_mask, GXPlaneToggle layer_toggle) GXS_SetVisiblePlane(sEngineBPlanes ^= layer_mask); } -void GfGfx_BothDispOn() -{ +void GfGfx_BothDispOn() { GX_DispOn(); GXS_DispOn(); } -void GfGfx_SwapDisplay() -{ - if (gSystem.screensFlipped == 0) - { +void GfGfx_SwapDisplay() { + if (gSystem.screensFlipped == 0) { GX_SetDispSelect(GX_DISP_SELECT_MAIN_SUB); - } - else - { + } else { GX_SetDispSelect(GX_DISP_SELECT_SUB_MAIN); } } -u32 GfGfx_EngineAGetPlanes() -{ +u32 GfGfx_EngineAGetPlanes() { return sEngineAPlanes; } diff --git a/arm9/src/gf_rtc.c b/arm9/src/gf_rtc.c index 3be23dedd..c3ea32174 100644 --- a/arm9/src/gf_rtc.c +++ b/arm9/src/gf_rtc.c @@ -1,104 +1,92 @@ +#include "gf_rtc.h" + #include "global.h" + #include "MI_memory.h" -#include "gf_rtc.h" #include "RTC_convert.h" -typedef struct GF_RTC_Work -{ +typedef struct GF_RTC_Work { BOOL getDateTimeSuccess; BOOL getDateTimeLock; s32 getDateTimeSleep; RTCResult getDateTimeErrorCode; - RTCDate date; // 10 - RTCTime time; // 20 + RTCDate date; // 10 + RTCTime time; // 20 RTCDate date_async; // 2C RTCTime time_async; // 3C } GF_RTC_Work; GF_RTC_Work sGFRTCWork; -#define MAX_SECONDS (3155759999ll) +#define MAX_SECONDS (3155759999ll) -void GF_RTC_GetDateTime(GF_RTC_Work * work); +void GF_RTC_GetDateTime(GF_RTC_Work *work); -void GF_InitRTCWork(void) -{ +void GF_InitRTCWork(void) { RTC_Init(); - memset(&sGFRTCWork, 0, sizeof(sGFRTCWork)); //todo: figure out how to use memset + memset(&sGFRTCWork, 0, sizeof(sGFRTCWork)); // todo: figure out how to use memset sGFRTCWork.getDateTimeSuccess = FALSE; - sGFRTCWork.getDateTimeLock = FALSE; - sGFRTCWork.getDateTimeSleep = 0; + sGFRTCWork.getDateTimeLock = FALSE; + sGFRTCWork.getDateTimeSleep = 0; GF_RTC_GetDateTime(&sGFRTCWork); } -void GF_RTC_UpdateOnFrame(void) -{ - if (!sGFRTCWork.getDateTimeLock) - { - if (++sGFRTCWork.getDateTimeSleep > 10) - { +void GF_RTC_UpdateOnFrame(void) { + if (!sGFRTCWork.getDateTimeLock) { + if (++sGFRTCWork.getDateTimeSleep > 10) { sGFRTCWork.getDateTimeSleep = 0; GF_RTC_GetDateTime(&sGFRTCWork); } } } -void GF_RTC_GetDateTime_Callback(RTCResult result, void * data) -{ - GF_RTC_Work * work = (GF_RTC_Work *)data; +void GF_RTC_GetDateTime_Callback(RTCResult result, void *data) { + GF_RTC_Work *work = (GF_RTC_Work *)data; work->getDateTimeErrorCode = result; GF_ASSERT(result == RTC_RESULT_SUCCESS); work->getDateTimeSuccess = TRUE; - work->date = work->date_async; - work->time = work->time_async; - work->getDateTimeLock = FALSE; + work->date = work->date_async; + work->time = work->time_async; + work->getDateTimeLock = FALSE; } -void GF_RTC_GetDateTime(GF_RTC_Work * work) -{ - work->getDateTimeLock = TRUE; - RTCResult result = RTC_GetDateTimeAsync(&work->date_async, &work->time_async, GF_RTC_GetDateTime_Callback, work); +void GF_RTC_GetDateTime(GF_RTC_Work *work) { + work->getDateTimeLock = TRUE; + RTCResult result = RTC_GetDateTimeAsync(&work->date_async, &work->time_async, GF_RTC_GetDateTime_Callback, work); work->getDateTimeErrorCode = result; GF_ASSERT(result == RTC_RESULT_SUCCESS); } -void GF_RTC_CopyDateTime(RTCDate * date, RTCTime * time) -{ +void GF_RTC_CopyDateTime(RTCDate *date, RTCTime *time) { GF_ASSERT(sGFRTCWork.getDateTimeSuccess == TRUE); *date = sGFRTCWork.date; *time = sGFRTCWork.time; } -void GF_RTC_CopyTime(RTCTime * time) -{ +void GF_RTC_CopyTime(RTCTime *time) { GF_ASSERT(sGFRTCWork.getDateTimeSuccess == TRUE); *time = sGFRTCWork.time; } -void GF_RTC_CopyDate(RTCDate * date) -{ +void GF_RTC_CopyDate(RTCDate *date) { GF_ASSERT(sGFRTCWork.getDateTimeSuccess == TRUE); *date = sGFRTCWork.date; } -s32 GF_RTC_TimeToSec(void) -{ - RTCTime* time = &sGFRTCWork.time; +s32 GF_RTC_TimeToSec(void) { + RTCTime *time = &sGFRTCWork.time; return 60 * time->minute + 3600 * time->hour + time->second; } -s64 GF_RTC_DateTimeToSec(void) -{ +s64 GF_RTC_DateTimeToSec(void) { return RTC_ConvertDateTimeToSecond(&sGFRTCWork.date, &sGFRTCWork.time); } -static inline BOOL IsLeapYear(s32 year) -{ +static inline BOOL IsLeapYear(s32 year) { return ((year % 4) == 0 && (year % 100) != 0) || ((year % 400) == 0); } -s32 GF_RTC_GetDayOfYear(const RTCDate * date) -{ +s32 GF_RTC_GetDayOfYear(const RTCDate *date) { RTCDate date_stack; s32 days; static const u16 sGF_DaysPerMonth[] = { @@ -118,63 +106,79 @@ s32 GF_RTC_GetDayOfYear(const RTCDate * date) days = date->day; days += sGF_DaysPerMonth[date->month - 1]; - if (date->month >= RTC_MONTH_MARCH && IsLeapYear(date->year)) + if (date->month >= RTC_MONTH_MARCH && IsLeapYear(date->year)) { days++; - date_stack = *date; + } + date_stack = *date; date_stack.month = RTC_MONTH_JANUARY; - date_stack.day = 1; + date_stack.day = 1; RTC_ConvertDateToDay(&date_stack); RTC_ConvertDateToDay(date); return days; } -BOOL IsNighttime(void) -{ - switch (GF_RTC_GetTimeOfDay()) - { - case RTC_TIMEOFDAY_NITE: - case RTC_TIMEOFDAY_LATE: - return TRUE; - default: - return FALSE; +BOOL IsNighttime(void) { + switch (GF_RTC_GetTimeOfDay()) { + case RTC_TIMEOFDAY_NITE: + case RTC_TIMEOFDAY_LATE: + return TRUE; + default: + return FALSE; } } -enum RTC_TimeOfDay GF_RTC_GetTimeOfDay(void) -{ +enum RTC_TimeOfDay GF_RTC_GetTimeOfDay(void) { RTCTime time; GF_RTC_CopyTime(&time); return GF_RTC_GetTimeOfDayByHour(time.hour); } -enum RTC_TimeOfDay GF_RTC_GetTimeOfDayByHour(s32 hour) -{ +enum RTC_TimeOfDay GF_RTC_GetTimeOfDayByHour(s32 hour) { static const u8 sTimeOfDayByHour[] = { // 00:00 - 03:59 - RTC_TIMEOFDAY_LATE, RTC_TIMEOFDAY_LATE, RTC_TIMEOFDAY_LATE, RTC_TIMEOFDAY_LATE, + RTC_TIMEOFDAY_LATE, + RTC_TIMEOFDAY_LATE, + RTC_TIMEOFDAY_LATE, + RTC_TIMEOFDAY_LATE, // 04:00 - 09:59 - RTC_TIMEOFDAY_MORN, RTC_TIMEOFDAY_MORN, RTC_TIMEOFDAY_MORN, RTC_TIMEOFDAY_MORN, RTC_TIMEOFDAY_MORN, RTC_TIMEOFDAY_MORN, + RTC_TIMEOFDAY_MORN, + RTC_TIMEOFDAY_MORN, + RTC_TIMEOFDAY_MORN, + RTC_TIMEOFDAY_MORN, + RTC_TIMEOFDAY_MORN, + RTC_TIMEOFDAY_MORN, // 10:00 - 16:59 - RTC_TIMEOFDAY_DAY, RTC_TIMEOFDAY_DAY, RTC_TIMEOFDAY_DAY, RTC_TIMEOFDAY_DAY, RTC_TIMEOFDAY_DAY, RTC_TIMEOFDAY_DAY, RTC_TIMEOFDAY_DAY, + RTC_TIMEOFDAY_DAY, + RTC_TIMEOFDAY_DAY, + RTC_TIMEOFDAY_DAY, + RTC_TIMEOFDAY_DAY, + RTC_TIMEOFDAY_DAY, + RTC_TIMEOFDAY_DAY, + RTC_TIMEOFDAY_DAY, // 17:00 - 19:59 - RTC_TIMEOFDAY_EVE, RTC_TIMEOFDAY_EVE, RTC_TIMEOFDAY_EVE, + RTC_TIMEOFDAY_EVE, + RTC_TIMEOFDAY_EVE, + RTC_TIMEOFDAY_EVE, // 20:00 - 23:59 - RTC_TIMEOFDAY_NITE, RTC_TIMEOFDAY_NITE, RTC_TIMEOFDAY_NITE, RTC_TIMEOFDAY_NITE, + RTC_TIMEOFDAY_NITE, + RTC_TIMEOFDAY_NITE, + RTC_TIMEOFDAY_NITE, + RTC_TIMEOFDAY_NITE, }; GF_ASSERT(hour >= 0 && hour < 24); return (enum RTC_TimeOfDay)sTimeOfDayByHour[hour]; } -s64 GF_RTC_TimeDelta(s64 first, s64 last) -{ +s64 GF_RTC_TimeDelta(s64 first, s64 last) { RTCDate maxDate = { 99, 12, 31, RTC_WEEK_SUNDAY }; RTCTime maxTime = { 23, 59, 59 }; s64 check = RTC_ConvertDateTimeToSecond(&maxDate, &maxTime); GF_ASSERT(check == MAX_SECONDS); - if (first < last) + if (first < last) { return last - first; - else + } else { return last + (MAX_SECONDS - first); + } } diff --git a/arm9/src/hall_of_fame.c b/arm9/src/hall_of_fame.c index be06fae1e..5759b9b31 100644 --- a/arm9/src/hall_of_fame.c +++ b/arm9/src/hall_of_fame.c @@ -1,146 +1,139 @@ +#include "hall_of_fame.h" + #include "global.h" -#include "pokemon.h" -#include "save.h" + #include "MI_memory.h" -#include "party.h" -#include "string16.h" #include "RTC_api.h" -#include "hall_of_fame.h" #include "heap.h" +#include "party.h" +#include "pokemon.h" +#include "save.h" +#include "string16.h" -u32 Save_HOF_sizeof(void) -{ +u32 Save_HOF_sizeof(void) { return sizeof(struct HallOfFame); } -void Save_HOF_Init(struct HallOfFame * hof) -{ +void Save_HOF_Init(struct HallOfFame *hof) { MI_CpuClear32(hof, sizeof(struct HallOfFame)); } -void Save_HOF_RecordParty(struct HallOfFame * hof, struct Party * party, RTCDate * date) -{ +void Save_HOF_RecordParty(struct HallOfFame *hof, struct Party *party, RTCDate *date) { GF_ASSERT(hof != NULL); GF_ASSERT(hof->next_record < NUM_HOF_RECORDS); - if (hof->num_total < 9999) - { - struct HOFParty * hof_party = &hof->parties[hof->next_record]; - int nmons = Party_GetCount(party); - struct String * str = String_New(POKEMON_NAME_LENGTH + 1, HEAP_ID_DEFAULT); + if (hof->num_total < 9999) { + struct HOFParty *hof_party = &hof->parties[hof->next_record]; + int nmons = Party_GetCount(party); + struct String *str = String_New(POKEMON_NAME_LENGTH + 1, HEAP_ID_DEFAULT); MI_CpuClear16(hof_party->party, 6 * sizeof(struct HOFMon)); int i, j; - for (i = 0, j = 0; i < nmons; i++) - { - struct Pokemon * mon = Party_GetMonByIndex(party, i); - BOOL lock = AcquireMonLock(mon); - if (!GetMonData(mon, MON_DATA_IS_EGG, NULL)) - { - hof_party->party[j].species = (u16)GetMonData(mon, MON_DATA_SPECIES, NULL); - hof_party->party[j].level = (u8)GetMonData(mon, MON_DATA_LEVEL, NULL); - hof_party->party[j].form = (u8)GetMonData(mon, MON_DATA_FORM, NULL); + for (i = 0, j = 0; i < nmons; i++) { + struct Pokemon *mon = Party_GetMonByIndex(party, i); + BOOL lock = AcquireMonLock(mon); + if (!GetMonData(mon, MON_DATA_IS_EGG, NULL)) { + hof_party->party[j].species = (u16)GetMonData(mon, MON_DATA_SPECIES, NULL); + hof_party->party[j].level = (u8)GetMonData(mon, MON_DATA_LEVEL, NULL); + hof_party->party[j].form = (u8)GetMonData(mon, MON_DATA_FORM, NULL); hof_party->party[j].personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL); - hof_party->party[j].otid = GetMonData(mon, MON_DATA_OTID, NULL); - hof_party->party[j].moves[0] = (u16)GetMonData(mon, MON_DATA_MOVE1, NULL); - hof_party->party[j].moves[1] = (u16)GetMonData(mon, MON_DATA_MOVE2, NULL); - hof_party->party[j].moves[2] = (u16)GetMonData(mon, MON_DATA_MOVE3, NULL); - hof_party->party[j].moves[3] = (u16)GetMonData(mon, MON_DATA_MOVE4, NULL); - if (str != NULL) - { + hof_party->party[j].otid = GetMonData(mon, MON_DATA_OTID, NULL); + hof_party->party[j].moves[0] = (u16)GetMonData(mon, MON_DATA_MOVE1, NULL); + hof_party->party[j].moves[1] = (u16)GetMonData(mon, MON_DATA_MOVE2, NULL); + hof_party->party[j].moves[2] = (u16)GetMonData(mon, MON_DATA_MOVE3, NULL); + hof_party->party[j].moves[3] = (u16)GetMonData(mon, MON_DATA_MOVE4, NULL); + if (str != NULL) { GetMonData(mon, MON_DATA_NICKNAME_3, str); CopyStringToU16Array(str, hof_party->party[j].nickname, POKEMON_NAME_LENGTH + 1); GetMonData(mon, MON_DATA_OT_NAME_2, str); CopyStringToU16Array(str, hof_party->party[j].otname, PLAYER_NAME_LENGTH + 1); - } - else - { + } else { hof_party->party[j].nickname[0] = EOS; - hof_party->party[j].otname[0] = EOS; + hof_party->party[j].otname[0] = EOS; } j++; } ReleaseMonLock(mon, lock); } - hof_party->year = (u16)date->year; + hof_party->year = (u16)date->year; hof_party->month = (u8)date->month; - hof_party->day = (u8)date->day; + hof_party->day = (u8)date->day; hof->next_record++; - if (hof->next_record >= NUM_HOF_RECORDS) + if (hof->next_record >= NUM_HOF_RECORDS) { hof->next_record = 0; + } hof->num_total++; - if (str != NULL) + if (str != NULL) { String_Delete(str); + } } } -u32 Save_HOF_GetNumRecords(struct HallOfFame * hof) -{ +u32 Save_HOF_GetNumRecords(struct HallOfFame *hof) { GF_ASSERT(hof != NULL); GF_ASSERT(hof->next_record < NUM_HOF_RECORDS); - if (hof->num_total < NUM_HOF_RECORDS) + if (hof->num_total < NUM_HOF_RECORDS) { return hof->num_total; - else + } else { return NUM_HOF_RECORDS; + } } -int Save_HOF_TranslateRecordIdx(struct HallOfFame * hof, int a1) -{ +int Save_HOF_TranslateRecordIdx(struct HallOfFame *hof, int a1) { GF_ASSERT(hof != NULL); GF_ASSERT(hof->next_record < NUM_HOF_RECORDS); GF_ASSERT(a1 < NUM_HOF_RECORDS); return (int)(hof->num_total - a1); } -u32 Save_HOF_RecordCountMons(struct HallOfFame * hof, int a1) -{ +u32 Save_HOF_RecordCountMons(struct HallOfFame *hof, int a1) { GF_ASSERT(hof != NULL); GF_ASSERT(hof->next_record < NUM_HOF_RECORDS); GF_ASSERT(a1 < NUM_HOF_RECORDS); int hofno = (int)(hof->next_record - 1 - a1); - if (hofno < 0) + if (hofno < 0) { hofno += NUM_HOF_RECORDS; - struct HOFParty * hof_party = &hof->parties[hofno]; + } + struct HOFParty *hof_party = &hof->parties[hofno]; u32 i; - for (i = 0; i < 6; i++) - { - if (hof_party->party[i].species == SPECIES_NONE) + for (i = 0; i < 6; i++) { + if (hof_party->party[i].species == SPECIES_NONE) { break; + } } return i; } -void Save_HOF_GetMonStatsByIndexPair(struct HallOfFame * hof, int a1, int a2, struct HofDisplayMon * dest) -{ +void Save_HOF_GetMonStatsByIndexPair(struct HallOfFame *hof, int a1, int a2, struct HofDisplayMon *dest) { GF_ASSERT(hof != NULL); GF_ASSERT(hof->next_record < NUM_HOF_RECORDS); GF_ASSERT(a1 < NUM_HOF_RECORDS); int hofno = (int)(hof->next_record - 1 - a1); - if (hofno < 0) + if (hofno < 0) { hofno += NUM_HOF_RECORDS; - struct HOFMon * mon = &hof->parties[hofno].party[a2]; - dest->species = mon->species; - dest->level = mon->level; - dest->personality = mon->personality; - dest->otid = mon->otid; - dest->form = mon->form; + } + struct HOFMon *mon = &hof->parties[hofno].party[a2]; + dest->species = mon->species; + dest->level = mon->level; + dest->personality = mon->personality; + dest->otid = mon->otid; + dest->form = mon->form; CopyU16ArrayToString(dest->nickname, mon->nickname); CopyU16ArrayToString(dest->otname, mon->otname); - for (int i = 0; i < 4; i++) - { + for (int i = 0; i < 4; i++) { dest->moves[i] = mon->moves[i]; } } -void Save_HOF_GetClearDate(struct HallOfFame * hof, int a1, RTCDate * dest) -{ +void Save_HOF_GetClearDate(struct HallOfFame *hof, int a1, RTCDate *dest) { GF_ASSERT(hof != NULL); GF_ASSERT(hof->next_record < NUM_HOF_RECORDS); GF_ASSERT(a1 < NUM_HOF_RECORDS); int hofno = (int)(hof->next_record - 1 - a1); - if (hofno < 0) + if (hofno < 0) { hofno += NUM_HOF_RECORDS; + } struct HOFParty *party = &hof->parties[hofno]; - dest->year = party->year; - dest->month = party->month; - dest->day = party->day; - dest->week = RTC_WEEK_SUNDAY; + dest->year = party->year; + dest->month = party->month; + dest->day = party->day; + dest->week = RTC_WEEK_SUNDAY; } diff --git a/arm9/src/heap.c b/arm9/src/heap.c index 4d6352a6c..120ac7914 100644 --- a/arm9/src/heap.c +++ b/arm9/src/heap.c @@ -1,12 +1,13 @@ -#include "global.h" #include "heap.h" + +#include "global.h" + +#include "NNS_FND_allocator.h" +#include "NNS_FND_expheap.h" #include "error_message_reset.h" #include "unk_02031734.h" -#include "NNS_FND_expheap.h" -#include "NNS_FND_allocator.h" -struct HeapInfo -{ +struct HeapInfo { NNSFndHeapHandle *heapHandles; NNSFndHeapHandle *parentHeapHandles; void **subHeapRawPtrs; @@ -18,60 +19,52 @@ struct HeapInfo u16 unallocatedHeapId; }; -typedef struct MemoryBlock -{ +typedef struct MemoryBlock { u8 filler_00[12]; - u32 heapId:8; - u32 filler_0D:24; + u32 heapId : 8; + u32 filler_0D : 24; } MemoryBlock; struct HeapInfo sHeapInfo; -void InitHeapSystem(const struct HeapParam *templates, u32 nTemplates, u32 totalNumHeaps, u32 pre_size) -{ - void * ptr; +void InitHeapSystem(const struct HeapParam *templates, u32 nTemplates, u32 totalNumHeaps, u32 pre_size) { + void *ptr; u32 unk_size, i; unk_size = nTemplates + 24; - if (totalNumHeaps < unk_size) - { + if (totalNumHeaps < unk_size) { totalNumHeaps = unk_size; } - if (pre_size != 0) - { + if (pre_size != 0) { // force align - while (pre_size % 4 != 0) - { + while (pre_size % 4 != 0) { pre_size++; } OS_AllocFromArenaLo(OS_ARENA_MAIN, pre_size, 4); } - sHeapInfo.heapHandles = (NNSFndHeapHandle*) OS_AllocFromArenaLo( + sHeapInfo.heapHandles = (NNSFndHeapHandle *)OS_AllocFromArenaLo( OS_ARENA_MAIN, (unk_size + 1) * sizeof(NNSFndHeapHandle) - + unk_size * sizeof(NNSFndHeapHandle) - + unk_size * sizeof(void *) - + totalNumHeaps * sizeof(u16) - + totalNumHeaps, - 4 - ); + + unk_size * sizeof(NNSFndHeapHandle) + + unk_size * sizeof(void *) + + totalNumHeaps * sizeof(u16) + + totalNumHeaps, + 4); sHeapInfo.parentHeapHandles = sHeapInfo.heapHandles + (unk_size + 1); - sHeapInfo.subHeapRawPtrs = (void **)(sHeapInfo.parentHeapHandles + unk_size); - sHeapInfo.numMemBlocks = (u16 *)(sHeapInfo.subHeapRawPtrs + unk_size); - sHeapInfo.heapIdxs = (u8 *)(sHeapInfo.numMemBlocks + totalNumHeaps); - sHeapInfo.totalNumHeaps = (u16)totalNumHeaps; - sHeapInfo.nTemplates = (u16)nTemplates; + sHeapInfo.subHeapRawPtrs = (void **)(sHeapInfo.parentHeapHandles + unk_size); + sHeapInfo.numMemBlocks = (u16 *)(sHeapInfo.subHeapRawPtrs + unk_size); + sHeapInfo.heapIdxs = (u8 *)(sHeapInfo.numMemBlocks + totalNumHeaps); + sHeapInfo.totalNumHeaps = (u16)totalNumHeaps; + sHeapInfo.nTemplates = (u16)nTemplates; sHeapInfo.unallocatedHeapId = (u16)unk_size; - sHeapInfo.maxHeaps = (u16)unk_size; + sHeapInfo.maxHeaps = (u16)unk_size; - for (i = 0; i < nTemplates; i++) - { - switch (templates[i].arena) - { + for (i = 0; i < nTemplates; i++) { + switch (templates[i].arena) { case OS_ARENA_MAIN: default: ptr = OS_AllocFromArenaLo(OS_ARENA_MAIN, templates[i].size, 4); @@ -81,146 +74,114 @@ void InitHeapSystem(const struct HeapParam *templates, u32 nTemplates, u32 total break; } - if (ptr != NULL) - { + if (ptr != NULL) { sHeapInfo.heapHandles[i] = NNS_FndCreateExpHeap(ptr, templates[i].size); - sHeapInfo.heapIdxs[i] = (u8)i; - } - else - { + sHeapInfo.heapIdxs[i] = (u8)i; + } else { GF_ASSERT(0); } } - for (i = nTemplates; i < unk_size + 1; i++) - { + for (i = nTemplates; i < unk_size + 1; i++) { sHeapInfo.heapHandles[i] = NULL; - sHeapInfo.heapIdxs[i] = (u8)sHeapInfo.unallocatedHeapId; + sHeapInfo.heapIdxs[i] = (u8)sHeapInfo.unallocatedHeapId; } - while (i < totalNumHeaps) - { + while (i < totalNumHeaps) { sHeapInfo.heapIdxs[i] = (u8)sHeapInfo.unallocatedHeapId; i++; } - for (i = 0; i < totalNumHeaps; i++) - { + for (i = 0; i < totalNumHeaps; i++) { sHeapInfo.numMemBlocks[i] = 0; } } -s32 FindFirstAvailableHeapHandle(void) -{ +s32 FindFirstAvailableHeapHandle(void) { s32 i; - for (i = sHeapInfo.nTemplates; i < sHeapInfo.maxHeaps; i++) - { - if (sHeapInfo.heapHandles[i] == NULL) + for (i = sHeapInfo.nTemplates; i < sHeapInfo.maxHeaps; i++) { + if (sHeapInfo.heapHandles[i] == NULL) { return i; + } } return -1; } -BOOL CreateHeap(u32 parent, u32 child, u32 size) -{ +BOOL CreateHeap(u32 parent, u32 child, u32 size) { return CreateHeapInternal(parent, child, size, 4); } -BOOL CreateHeapAtEnd(u32 parent, u32 child, u32 size) -{ +BOOL CreateHeapAtEnd(u32 parent, u32 child, u32 size) { return CreateHeapInternal(parent, child, size, -4); } -BOOL CreateHeapInternal(u32 parent, u32 child, u32 size, s32 alignment) -{ +BOOL CreateHeapInternal(u32 parent, u32 child, u32 size, s32 alignment) { GF_ASSERT(OS_GetProcMode() != OS_PROCMODE_IRQ); u8 *ptr = sHeapInfo.heapIdxs; - if (sHeapInfo.unallocatedHeapId == ptr[child]) - { + if (sHeapInfo.unallocatedHeapId == ptr[child]) { NNSFndHeapHandle parentHeap = sHeapInfo.heapHandles[ptr[parent]]; - if (parentHeap != NULL) - { + if (parentHeap != NULL) { void *newHeapAddr = NNS_FndAllocFromExpHeapEx(parentHeap, size, alignment); - if (newHeapAddr != NULL) - { + if (newHeapAddr != NULL) { s32 i = FindFirstAvailableHeapHandle(); - if (i >= 0) - { + if (i >= 0) { sHeapInfo.heapHandles[i] = NNS_FndCreateExpHeap(newHeapAddr, size); - - if (sHeapInfo.heapHandles[i] != NULL) - { + if (sHeapInfo.heapHandles[i] != NULL) { sHeapInfo.parentHeapHandles[i] = parentHeap; - sHeapInfo.subHeapRawPtrs[i] = newHeapAddr; - sHeapInfo.heapIdxs[child] = (u8)i; + sHeapInfo.subHeapRawPtrs[i] = newHeapAddr; + sHeapInfo.heapIdxs[child] = (u8)i; return TRUE; - } - else - { + } else { GF_ASSERT(0); } - } - else - { + } else { GF_ASSERT(0); } - } - else - { + } else { GF_ASSERT(0); } - } - else - { + } else { GF_ASSERT(0); } - } - else - { + } else { GF_ASSERT(0); } return FALSE; } -void DestroyHeap(HeapID heapId) -{ +void DestroyHeap(HeapID heapId) { GF_ASSERT(OS_GetProcMode() != OS_PROCMODE_IRQ); NNSFndHeapHandle handle = sHeapInfo.heapHandles[sHeapInfo.heapIdxs[heapId]]; - if (handle != NULL) - { + if (handle != NULL) { NNS_FndDestroyExpHeap(handle); - u8 index = sHeapInfo.heapIdxs[heapId]; + u8 index = sHeapInfo.heapIdxs[heapId]; NNSFndHeapHandle parentHeap = sHeapInfo.parentHeapHandles[index]; - void *childRaw = sHeapInfo.subHeapRawPtrs[index]; - if (parentHeap != NULL && childRaw != NULL) - { + void *childRaw = sHeapInfo.subHeapRawPtrs[index]; + if (parentHeap != NULL && childRaw != NULL) { NNS_FndFreeToExpHeap(parentHeap, childRaw); - } - else - { + } else { GF_ASSERT(0); } - sHeapInfo.heapHandles[sHeapInfo.heapIdxs[heapId]] = NULL; + sHeapInfo.heapHandles[sHeapInfo.heapIdxs[heapId]] = NULL; sHeapInfo.parentHeapHandles[sHeapInfo.heapIdxs[heapId]] = NULL; - sHeapInfo.subHeapRawPtrs[sHeapInfo.heapIdxs[heapId]] = NULL; + sHeapInfo.subHeapRawPtrs[sHeapInfo.heapIdxs[heapId]] = NULL; sHeapInfo.heapIdxs[heapId] = (u8)sHeapInfo.unallocatedHeapId; } } -void *AllocFromHeapInternal(NNSFndHeapHandle heap, u32 size, s32 alignment, HeapID heapId) -{ +void *AllocFromHeapInternal(NNSFndHeapHandle heap, u32 size, s32 alignment, HeapID heapId) { GF_ASSERT(heap); OSIntrMode intr_mode = OS_DisableInterrupts(); @@ -228,8 +189,7 @@ void *AllocFromHeapInternal(NNSFndHeapHandle heap, u32 size, s32 alignment, Heap void *ptr = NNS_FndAllocFromExpHeapEx(heap, size, alignment); OS_RestoreInterrupts(intr_mode); - if (ptr != NULL) - { + if (ptr != NULL) { ((MemoryBlock *)ptr)->heapId = heapId; ptr += sizeof(MemoryBlock); @@ -238,68 +198,53 @@ void *AllocFromHeapInternal(NNSFndHeapHandle heap, u32 size, s32 alignment, Heap return ptr; } -void AllocFail(void) -{ - if (sub_02031810() != 0) - { +void AllocFail(void) { + if (sub_02031810() != 0) { PrintErrorMessageAndReset(); } } -void *AllocFromHeap(HeapID heapId, u32 size) -{ +void *AllocFromHeap(HeapID heapId, u32 size) { void *ptr = NULL; - if ((u32)heapId < sHeapInfo.totalNumHeaps) - { + if ((u32)heapId < sHeapInfo.totalNumHeaps) { u8 index = sHeapInfo.heapIdxs[heapId]; - ptr = AllocFromHeapInternal(sHeapInfo.heapHandles[index], size, 4, heapId); + ptr = AllocFromHeapInternal(sHeapInfo.heapHandles[index], size, 4, heapId); } - if (ptr != NULL) - { + if (ptr != NULL) { sHeapInfo.numMemBlocks[heapId]++; - } - else - { + } else { AllocFail(); } return ptr; } -void *AllocFromHeapAtEnd(HeapID heapId, u32 size) -{ +void *AllocFromHeapAtEnd(HeapID heapId, u32 size) { void *ptr = NULL; - if ((u32)heapId < sHeapInfo.totalNumHeaps) - { + if ((u32)heapId < sHeapInfo.totalNumHeaps) { u8 index = sHeapInfo.heapIdxs[heapId]; - ptr = AllocFromHeapInternal(sHeapInfo.heapHandles[index], size, -4, heapId); + ptr = AllocFromHeapInternal(sHeapInfo.heapHandles[index], size, -4, heapId); } - if (ptr != NULL) - { + if (ptr != NULL) { sHeapInfo.numMemBlocks[heapId]++; - } - else - { + } else { AllocFail(); } return ptr; } -void FreeToHeap(void *ptr) -{ +void FreeToHeap(void *ptr) { ptr -= sizeof(MemoryBlock); HeapID heapId = (HeapID)(((MemoryBlock *)ptr)->heapId); - if ((u32)heapId < sHeapInfo.totalNumHeaps) - { - u8 index = sHeapInfo.heapIdxs[heapId]; + if ((u32)heapId < sHeapInfo.totalNumHeaps) { + u8 index = sHeapInfo.heapIdxs[heapId]; NNSFndHeapHandle heap = sHeapInfo.heapHandles[index]; GF_ASSERT(heap != NULL); - if (sHeapInfo.numMemBlocks[heapId] == 0) - { + if (sHeapInfo.numMemBlocks[heapId] == 0) { GF_heap_c_dummy_return_true(heapId); } GF_ASSERT(sHeapInfo.numMemBlocks[heapId] != 0); @@ -314,15 +259,13 @@ void FreeToHeap(void *ptr) GF_ASSERT(0); } -void FreeToHeapExplicit(HeapID heapId, void *ptr) -{ +void FreeToHeapExplicit(HeapID heapId, void *ptr) { GF_ASSERT(OS_GetProcMode() != OS_PROCMODE_IRQ); - if ((u32)heapId < sHeapInfo.totalNumHeaps) - { - u8 index = sHeapInfo.heapIdxs[heapId]; + if ((u32)heapId < sHeapInfo.totalNumHeaps) { + u8 index = sHeapInfo.heapIdxs[heapId]; NNSFndHeapHandle heap = sHeapInfo.heapHandles[index]; - GF_ASSERT( heap != NULL ); + GF_ASSERT(heap != NULL); ptr -= sizeof(MemoryBlock); GF_ASSERT(((MemoryBlock *)ptr)->heapId == heapId); @@ -337,10 +280,8 @@ void FreeToHeapExplicit(HeapID heapId, void *ptr) GF_ASSERT(0); } -u32 GF_ExpHeap_FndGetTotalFreeSize(HeapID heapId) -{ - if ((u32)heapId < sHeapInfo.totalNumHeaps) - { +u32 GF_ExpHeap_FndGetTotalFreeSize(HeapID heapId) { + if ((u32)heapId < sHeapInfo.totalNumHeaps) { u8 index = sHeapInfo.heapIdxs[heapId]; return NNS_FndGetTotalFreeSizeForExpHeap(sHeapInfo.heapHandles[index]); } @@ -349,10 +290,8 @@ u32 GF_ExpHeap_FndGetTotalFreeSize(HeapID heapId) return 0; } -void GF_ExpHeap_FndInitAllocator(NNSFndAllocator * pAllocator, HeapID heapId, int alignment) -{ - if ((u32)heapId < sHeapInfo.totalNumHeaps) - { +void GF_ExpHeap_FndInitAllocator(NNSFndAllocator *pAllocator, HeapID heapId, int alignment) { + if ((u32)heapId < sHeapInfo.totalNumHeaps) { u8 index = sHeapInfo.heapIdxs[heapId]; NNS_FndInitAllocatorForExpHeap(pAllocator, sHeapInfo.heapHandles[index], alignment); @@ -362,15 +301,13 @@ void GF_ExpHeap_FndInitAllocator(NNSFndAllocator * pAllocator, HeapID heapId, in GF_ASSERT(0); } -void ReallocFromHeap(void *ptr, u32 newSize) -{ +void ReallocFromHeap(void *ptr, u32 newSize) { GF_ASSERT(OS_GetProcMode() != OS_PROCMODE_IRQ); newSize += sizeof(MemoryBlock); ptr -= sizeof(MemoryBlock); - if (NNS_FndGetSizeForMBlockExpHeap(ptr) >= newSize) - { - u32 heapId = ((MemoryBlock *)ptr)->heapId; //purposefully left as u32, using HeapID casues fuckery with regalloc + if (NNS_FndGetSizeForMBlockExpHeap(ptr) >= newSize) { + u32 heapId = ((MemoryBlock *)ptr)->heapId; // purposefully left as u32, using HeapID casues fuckery with regalloc u8 index = sHeapInfo.heapIdxs[heapId]; @@ -380,8 +317,7 @@ void ReallocFromHeap(void *ptr, u32 newSize) GF_ASSERT(0); } -BOOL GF_heap_c_dummy_return_true(HeapID heapId) -{ +BOOL GF_heap_c_dummy_return_true(HeapID heapId) { #pragma unused(heapId) return TRUE; } diff --git a/arm9/src/igt.c b/arm9/src/igt.c index 7b72e530a..3f4886aa4 100644 --- a/arm9/src/igt.c +++ b/arm9/src/igt.c @@ -1,48 +1,43 @@ -#include "global.h" #include "igt.h" -void InitIGT(struct IGT * igt) -{ - igt->hours = 0; +#include "global.h" + +void InitIGT(struct IGT *igt) { + igt->hours = 0; igt->minutes = 0; igt->seconds = 0; } -void AddIGTSeconds(struct IGT * igt, u32 to_add) -{ +void AddIGTSeconds(struct IGT *igt, u32 to_add) { u32 hours, minutes, seconds; - if (igt->hours == 999 && igt->minutes == 59 && igt->seconds == 59) + if (igt->hours == 999 && igt->minutes == 59 && igt->seconds == 59) { return; + } seconds = (u32)(igt->seconds + to_add); minutes = (u32)igt->minutes; - hours = (u32)igt->hours; - if (seconds > 59) - { + hours = (u32)igt->hours; + if (seconds > 59) { minutes += seconds / 60; seconds %= 60; - if (minutes > 59) - { + if (minutes > 59) { hours += minutes / 60; minutes %= 60; - if (hours >= 999) - { - hours = 999; + if (hours >= 999) { + hours = 999; minutes = 59; seconds = 59; } } } - igt->hours = (u16)hours; + igt->hours = (u16)hours; igt->minutes = (u8)minutes; igt->seconds = (u8)seconds; } -u16 GetIGTHours(struct IGT * igt) -{ +u16 GetIGTHours(struct IGT *igt) { return igt->hours; } -u8 GetIGTMinutes(struct IGT * igt) -{ +u8 GetIGTMinutes(struct IGT *igt) { return igt->minutes; } diff --git a/arm9/src/itemtool.c b/arm9/src/itemtool.c index 40d0d83ed..a72c36ecf 100644 --- a/arm9/src/itemtool.c +++ b/arm9/src/itemtool.c @@ -1,9 +1,13 @@ -#include "global.h" #include "itemtool.h" -#include "msgdata.h" + +#include "global.h" + +#include "constants/moves.h" + #include "msgdata/msg.naix" + #include "heap.h" -#include "constants/moves.h" +#include "msgdata.h" static const u16 sMailIdxs[] = { ITEM_GRASS_MAIL, @@ -190,498 +194,491 @@ static const u16 sTMHMMoves[] = { MOVE_ROCK_CLIMB, }; -//TODO: use narc constants +// TODO: use narc constants static const u16 sItemIndexMappings[][4] = { /* Col 1: Offset in item_data.narc * Col 2: Gfx offset in item_icon.narc * Col 3: Pal offset in item_icon.narc * Col 4: Gen 3 item index (for Pal Park conversion) */ - { 0, 699, 700, 0 }, - { 1, 2, 3, 1 }, - { 2, 4, 5, 2 }, - { 3, 6, 7, 3 }, - { 4, 8, 9, 4 }, - { 5, 10, 11, 5 }, - { 6, 12, 13, 6 }, - { 7, 14, 15, 7 }, - { 8, 16, 17, 8 }, - { 9, 18, 19, 9 }, - { 10, 20, 19, 10 }, - { 11, 21, 22, 11 }, - { 12, 23, 22, 12 }, - { 13, 663, 664, 0 }, - { 14, 665, 666, 0 }, - { 15, 667, 668, 0 }, - { 16, 669, 670, 0 }, - { 17, 24, 25, 13 }, - { 18, 26, 27, 14 }, - { 19, 30, 28, 15 }, - { 20, 30, 29, 16 }, - { 21, 30, 31, 17 }, - { 22, 30, 32, 18 }, - { 23, 33, 34, 19 }, - { 24, 33, 35, 20 }, - { 25, 24, 36, 21 }, - { 26, 24, 37, 22 }, - { 27, 38, 39, 23 }, - { 28, 40, 42, 24 }, - { 29, 41, 42, 25 }, - { 30, 43, 44, 26 }, - { 31, 45, 46, 27 }, - { 32, 47, 48, 28 }, - { 33, 49, 50, 29 }, - { 34, 51, 52, 30 }, - { 35, 53, 54, 31 }, - { 36, 51, 55, 32 }, - { 37, 56, 57, 33 }, - { 38, 58, 59, 34 }, - { 39, 58, 60, 35 }, - { 40, 58, 61, 36 }, - { 41, 58, 62, 37 }, - { 42, 63, 64, 38 }, - { 43, 71, 72, 44 }, - { 44, 73, 74, 45 }, - { 45, 83, 84, 63 }, - { 46, 85, 86, 64 }, - { 47, 85, 87, 65 }, - { 48, 85, 88, 66 }, - { 49, 85, 89, 67 }, - { 50, 90, 91, 68 }, - { 51, 92, 93, 69 }, - { 52, 85, 94, 70 }, - { 53, 95, 96, 71 }, - { 54, 466, 467, 0 }, - { 55, 100, 97, 73 }, - { 56, 100, 98, 74 }, - { 57, 100, 99, 75 }, - { 58, 100, 101, 76 }, - { 59, 100, 102, 77 }, - { 60, 100, 103, 78 }, - { 61, 100, 104, 79 }, - { 62, 100, 469, 0 }, - { 63, 105, 106, 80 }, - { 64, 107, 108, 81 }, - { 65, 65, 66, 39 }, - { 66, 65, 67, 40 }, - { 67, 65, 68, 41 }, - { 68, 65, 69, 42 }, - { 69, 65, 70, 43 }, - { 70, 51, 75, 46 }, - { 71, 76, 77, 47 }, - { 72, 78, 79, 48 }, - { 73, 78, 80, 49 }, - { 74, 78, 81, 50 }, - { 75, 78, 82, 51 }, - { 76, 109, 110, 83 }, - { 77, 109, 111, 84 }, - { 78, 112, 113, 85 }, - { 79, 109, 114, 86 }, - { 80, 115, 116, 93 }, - { 81, 117, 118, 94 }, - { 82, 119, 120, 95 }, - { 83, 121, 122, 96 }, - { 84, 123, 124, 97 }, - { 85, 125, 126, 98 }, - { 86, 127, 129, 103 }, - { 87, 128, 129, 104 }, - { 88, 130, 131, 106 }, - { 89, 132, 131, 107 }, - { 90, 133, 134, 108 }, - { 91, 135, 134, 109 }, - { 92, 136, 137, 110 }, - { 93, 138, 139, 111 }, - { 94, 470, 471, 0 }, - { 95, 472, 473, 0 }, - { 96, 474, 475, 0 }, - { 97, 476, 477, 0 }, - { 98, 478, 479, 0 }, - { 99, 392, 393, 286 }, - { 100, 394, 393, 287 }, - { 101, 431, 432, 357 }, - { 102, 433, 432, 358 }, - { 103, 425, 426, 354 }, - { 104, 617, 618, 0 }, - { 105, 615, 616, 0 }, - { 106, 337, 338, 0 }, - { 107, 480, 481, 0 }, - { 108, 482, 483, 0 }, - { 109, 484, 485, 0 }, - { 110, 486, 487, 0 }, - { 111, 488, 489, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 0, 699, 700, 0 }, - { 112, 648, 649, 0 }, - { 113, 646, 647, 0 }, - { 114, 140, 141, 0 }, - { 115, 142, 143, 0 }, - { 116, 144, 145, 0 }, - { 117, 146, 147, 0 }, - { 118, 148, 149, 0 }, - { 119, 150, 151, 0 }, - { 120, 152, 153, 0 }, - { 121, 154, 155, 0 }, - { 122, 156, 157, 0 }, - { 123, 158, 159, 0 }, - { 124, 160, 161, 0 }, - { 125, 162, 163, 0 }, - { 126, 164, 165, 133 }, - { 127, 166, 167, 134 }, - { 128, 168, 169, 135 }, - { 129, 170, 171, 136 }, - { 130, 172, 173, 137 }, - { 131, 174, 175, 138 }, - { 132, 176, 177, 139 }, - { 133, 178, 179, 140 }, - { 134, 180, 181, 141 }, - { 135, 182, 183, 142 }, - { 136, 184, 185, 143 }, - { 137, 186, 187, 144 }, - { 138, 188, 189, 145 }, - { 139, 190, 191, 146 }, - { 140, 192, 193, 147 }, - { 141, 194, 195, 148 }, - { 142, 196, 197, 149 }, - { 143, 198, 199, 150 }, - { 144, 200, 201, 151 }, - { 145, 202, 203, 152 }, - { 146, 204, 205, 153 }, - { 147, 206, 207, 154 }, - { 148, 208, 209, 155 }, - { 149, 210, 211, 156 }, - { 150, 212, 213, 157 }, - { 151, 214, 215, 158 }, - { 152, 216, 217, 159 }, - { 153, 218, 219, 160 }, - { 154, 220, 221, 161 }, - { 155, 222, 223, 162 }, - { 156, 224, 225, 163 }, - { 157, 226, 227, 164 }, - { 158, 228, 229, 165 }, - { 159, 230, 231, 166 }, - { 160, 232, 233, 167 }, - { 161, 554, 555, 0 }, - { 162, 556, 557, 0 }, - { 163, 558, 559, 0 }, - { 164, 560, 561, 0 }, - { 165, 562, 563, 0 }, - { 166, 564, 565, 0 }, - { 167, 566, 567, 0 }, - { 168, 568, 569, 0 }, - { 169, 570, 571, 0 }, - { 170, 572, 573, 0 }, - { 171, 574, 575, 0 }, - { 172, 576, 577, 0 }, - { 173, 578, 579, 0 }, - { 174, 580, 581, 0 }, - { 175, 582, 583, 0 }, - { 176, 584, 585, 0 }, - { 177, 586, 587, 0 }, - { 178, 234, 235, 168 }, - { 179, 236, 237, 169 }, - { 180, 238, 239, 170 }, - { 181, 240, 241, 171 }, - { 182, 242, 243, 172 }, - { 183, 244, 245, 173 }, - { 184, 246, 247, 174 }, - { 185, 248, 249, 175 }, - { 186, 588, 589, 0 }, - { 187, 590, 591, 0 }, - { 188, 592, 593, 0 }, - { 189, 594, 595, 0 }, - { 190, 250, 251, 179 }, - { 191, 252, 253, 180 }, - { 192, 254, 255, 181 }, - { 193, 256, 257, 182 }, - { 194, 258, 259, 183 }, - { 195, 260, 261, 184 }, - { 196, 252, 262, 185 }, - { 197, 263, 264, 186 }, - { 198, 265, 266, 187 }, - { 199, 267, 268, 188 }, - { 200, 269, 270, 189 }, - { 201, 271, 272, 190 }, - { 202, 273, 274, 191 }, - { 203, 275, 276, 192 }, - { 204, 277, 278, 193 }, - { 205, 279, 280, 194 }, - { 206, 281, 282, 195 }, - { 207, 283, 284, 196 }, - { 208, 285, 286, 197 }, - { 209, 287, 288, 198 }, - { 210, 289, 290, 199 }, - { 211, 291, 292, 200 }, - { 212, 293, 294, 201 }, - { 213, 295, 296, 202 }, - { 214, 297, 298, 203 }, - { 215, 299, 300, 204 }, - { 216, 301, 302, 205 }, - { 217, 303, 304, 206 }, - { 218, 305, 304, 207 }, - { 219, 306, 307, 208 }, - { 220, 308, 309, 209 }, - { 221, 310, 311, 210 }, - { 222, 312, 313, 211 }, - { 223, 314, 315, 212 }, - { 224, 316, 317, 213 }, - { 225, 318, 319, 214 }, - { 226, 320, 321, 215 }, - { 227, 322, 323, 216 }, - { 228, 324, 325, 217 }, - { 229, 326, 327, 218 }, - { 230, 328, 77, 219 }, - { 231, 329, 330, 220 }, - { 232, 331, 332, 221 }, - { 233, 333, 334, 222 }, - { 234, 335, 336, 223 }, - { 235, 337, 338, 224 }, - { 236, 339, 340, 225 }, - { 237, 341, 342, 254 }, - { 238, 341, 343, 255 }, - { 239, 341, 344, 256 }, - { 240, 341, 345, 257 }, - { 241, 341, 346, 258 }, - { 242, 490, 491, 0 }, - { 243, 492, 493, 0 }, - { 244, 494, 495, 0 }, - { 245, 496, 497, 0 }, - { 246, 611, 612, 0 }, - { 247, 498, 499, 0 }, - { 248, 500, 501, 0 }, - { 249, 502, 503, 0 }, - { 250, 504, 505, 0 }, - { 251, 335, 658, 0 }, - { 252, 659, 660, 0 }, - { 253, 506, 507, 0 }, - { 254, 508, 509, 0 }, - { 255, 613, 614, 0 }, - { 256, 650, 651, 0 }, - { 257, 654, 655, 0 }, - { 258, 510, 511, 0 }, - { 259, 636, 637, 0 }, - { 260, 638, 639, 0 }, - { 261, 640, 641, 0 }, - { 262, 642, 643, 0 }, - { 263, 652, 653, 0 }, - { 264, 512, 513, 0 }, - { 265, 514, 515, 0 }, - { 266, 683, 684, 0 }, - { 267, 691, 692, 0 }, - { 268, 693, 694, 0 }, - { 269, 685, 686, 0 }, - { 270, 687, 688, 0 }, - { 271, 689, 690, 0 }, - { 272, 516, 517, 0 }, - { 273, 518, 519, 0 }, - { 274, 520, 521, 0 }, - { 275, 619, 620, 0 }, - { 276, 619, 621, 0 }, - { 277, 619, 622, 0 }, - { 278, 619, 623, 0 }, - { 279, 619, 624, 0 }, - { 280, 619, 625, 0 }, - { 281, 619, 626, 0 }, - { 282, 619, 627, 0 }, - { 283, 619, 628, 0 }, - { 284, 619, 629, 0 }, - { 285, 619, 630, 0 }, - { 286, 619, 631, 0 }, - { 287, 619, 632, 0 }, - { 288, 619, 633, 0 }, - { 289, 619, 634, 0 }, - { 290, 619, 635, 0 }, - { 291, 522, 523, 0 }, - { 292, 524, 525, 0 }, - { 293, 526, 527, 0 }, - { 294, 528, 529, 0 }, - { 295, 530, 531, 0 }, - { 296, 532, 533, 0 }, - { 297, 534, 535, 0 }, - { 298, 695, 696, 0 }, - { 299, 536, 537, 0 }, - { 300, 538, 539, 0 }, - { 301, 540, 541, 0 }, - { 302, 542, 543, 0 }, - { 303, 544, 545, 0 }, - { 304, 546, 547, 0 }, - { 305, 397, 398, 289 }, - { 306, 397, 399, 290 }, - { 307, 397, 400, 291 }, - { 308, 397, 401, 292 }, - { 309, 397, 402, 293 }, - { 310, 397, 403, 294 }, - { 311, 397, 404, 295 }, - { 312, 397, 398, 296 }, - { 313, 397, 405, 297 }, - { 314, 397, 402, 298 }, - { 315, 397, 406, 299 }, - { 316, 397, 407, 300 }, - { 317, 397, 404, 301 }, - { 318, 397, 404, 302 }, - { 319, 397, 402, 303 }, - { 320, 397, 401, 304 }, - { 321, 397, 402, 305 }, - { 322, 397, 400, 306 }, - { 323, 397, 405, 307 }, - { 324, 397, 402, 308 }, - { 325, 397, 402, 309 }, - { 326, 397, 405, 310 }, - { 327, 397, 408, 311 }, - { 328, 397, 409, 312 }, - { 329, 397, 409, 313 }, - { 330, 397, 410, 314 }, - { 331, 397, 402, 315 }, - { 332, 397, 410, 316 }, - { 333, 397, 401, 317 }, - { 334, 397, 411, 318 }, - { 335, 397, 398, 319 }, - { 336, 397, 402, 320 }, - { 337, 397, 401, 321 }, - { 338, 397, 409, 322 }, - { 339, 397, 406, 323 }, - { 340, 397, 403, 324 }, - { 341, 397, 412, 325 }, - { 342, 397, 406, 326 }, - { 343, 397, 412, 327 }, - { 344, 397, 413, 328 }, - { 345, 397, 407, 329 }, - { 346, 397, 402, 330 }, - { 347, 397, 402, 331 }, - { 348, 397, 401, 332 }, - { 349, 397, 402, 333 }, - { 350, 397, 407, 334 }, - { 351, 397, 408, 335 }, - { 352, 397, 401, 336 }, - { 353, 397, 407, 337 }, - { 354, 397, 406, 338 }, - { 355, 397, 413, 0 }, - { 356, 397, 398, 0 }, - { 357, 397, 405, 0 }, - { 358, 397, 402, 0 }, - { 359, 397, 400, 0 }, - { 360, 397, 407, 0 }, - { 361, 397, 409, 0 }, - { 362, 397, 402, 0 }, - { 363, 397, 399, 0 }, - { 364, 397, 398, 0 }, - { 365, 397, 406, 0 }, - { 366, 397, 610, 0 }, - { 367, 397, 407, 0 }, - { 368, 397, 402, 0 }, - { 369, 397, 411, 0 }, - { 370, 397, 407, 0 }, - { 371, 397, 402, 0 }, - { 372, 397, 402, 0 }, - { 373, 397, 412, 0 }, - { 374, 397, 402, 0 }, - { 375, 397, 412, 0 }, - { 376, 397, 404, 0 }, - { 377, 397, 409, 0 }, - { 378, 397, 408, 0 }, - { 379, 397, 402, 0 }, - { 380, 397, 412, 0 }, - { 381, 397, 402, 0 }, - { 382, 397, 402, 0 }, - { 383, 397, 407, 0 }, - { 384, 397, 412, 0 }, - { 385, 397, 610, 0 }, - { 386, 397, 402, 0 }, - { 387, 397, 402, 0 }, - { 388, 397, 403, 0 }, - { 389, 397, 401, 0 }, - { 390, 397, 405, 0 }, - { 391, 397, 402, 0 }, - { 392, 397, 413, 0 }, - { 393, 397, 610, 0 }, - { 394, 397, 402, 0 }, - { 395, 397, 408, 0 }, - { 396, 397, 401, 0 }, - { 397, 414, 402, 339 }, - { 398, 414, 413, 340 }, - { 399, 414, 400, 341 }, - { 400, 414, 402, 342 }, - { 401, 414, 400, 343 }, - { 402, 414, 398, 344 }, - { 403, 414, 400, 345 }, - { 404, 414, 402, 346 }, - { 405, 548, 549, 0 }, - { 406, 550, 551, 0 }, - { 407, 552, 553, 0 }, - { 408, 697, 698, 0 }, - { 409, 681, 682, 0 }, - { 410, 606, 607, 0 }, - { 411, 671, 672, 0 }, - { 412, 675, 676, 0 }, - { 413, 673, 674, 0 }, - { 414, 661, 662, 0 }, - { 415, 644, 645, 0 }, - { 416, 604, 605, 0 }, - { 417, 656, 657, 0 }, - { 418, 679, 680, 0 }, - { 419, 439, 440, 361 }, - { 420, 441, 442, 362 }, - { 421, 349, 350, 260 }, - { 422, 353, 354, 262 }, - { 423, 355, 356, 263 }, - { 424, 357, 358, 264 }, - { 425, 363, 364, 0 }, - { 426, 373, 374, 0 }, - { 427, 437, 438, 360 }, - { 428, 429, 430, 0 }, - { 429, 375, 64, 0 }, - { 430, 602, 603, 0 }, - { 431, 608, 609, 0 }, - { 432, 677, 678, 0 }, - { 433, 359, 360, 265 }, - { 434, 361, 362, 266 }, - { 435, 596, 597, 0 }, - { 436, 415, 416, 349 }, - { 437, 417, 418, 0 }, - { 438, 419, 420, 0 }, - { 439, 421, 422, 0 }, - { 440, 598, 599, 285 }, - { 441, 600, 601, 0 }, + { 0, 699, 700, 0 }, + { 1, 2, 3, 1 }, + { 2, 4, 5, 2 }, + { 3, 6, 7, 3 }, + { 4, 8, 9, 4 }, + { 5, 10, 11, 5 }, + { 6, 12, 13, 6 }, + { 7, 14, 15, 7 }, + { 8, 16, 17, 8 }, + { 9, 18, 19, 9 }, + { 10, 20, 19, 10 }, + { 11, 21, 22, 11 }, + { 12, 23, 22, 12 }, + { 13, 663, 664, 0 }, + { 14, 665, 666, 0 }, + { 15, 667, 668, 0 }, + { 16, 669, 670, 0 }, + { 17, 24, 25, 13 }, + { 18, 26, 27, 14 }, + { 19, 30, 28, 15 }, + { 20, 30, 29, 16 }, + { 21, 30, 31, 17 }, + { 22, 30, 32, 18 }, + { 23, 33, 34, 19 }, + { 24, 33, 35, 20 }, + { 25, 24, 36, 21 }, + { 26, 24, 37, 22 }, + { 27, 38, 39, 23 }, + { 28, 40, 42, 24 }, + { 29, 41, 42, 25 }, + { 30, 43, 44, 26 }, + { 31, 45, 46, 27 }, + { 32, 47, 48, 28 }, + { 33, 49, 50, 29 }, + { 34, 51, 52, 30 }, + { 35, 53, 54, 31 }, + { 36, 51, 55, 32 }, + { 37, 56, 57, 33 }, + { 38, 58, 59, 34 }, + { 39, 58, 60, 35 }, + { 40, 58, 61, 36 }, + { 41, 58, 62, 37 }, + { 42, 63, 64, 38 }, + { 43, 71, 72, 44 }, + { 44, 73, 74, 45 }, + { 45, 83, 84, 63 }, + { 46, 85, 86, 64 }, + { 47, 85, 87, 65 }, + { 48, 85, 88, 66 }, + { 49, 85, 89, 67 }, + { 50, 90, 91, 68 }, + { 51, 92, 93, 69 }, + { 52, 85, 94, 70 }, + { 53, 95, 96, 71 }, + { 54, 466, 467, 0 }, + { 55, 100, 97, 73 }, + { 56, 100, 98, 74 }, + { 57, 100, 99, 75 }, + { 58, 100, 101, 76 }, + { 59, 100, 102, 77 }, + { 60, 100, 103, 78 }, + { 61, 100, 104, 79 }, + { 62, 100, 469, 0 }, + { 63, 105, 106, 80 }, + { 64, 107, 108, 81 }, + { 65, 65, 66, 39 }, + { 66, 65, 67, 40 }, + { 67, 65, 68, 41 }, + { 68, 65, 69, 42 }, + { 69, 65, 70, 43 }, + { 70, 51, 75, 46 }, + { 71, 76, 77, 47 }, + { 72, 78, 79, 48 }, + { 73, 78, 80, 49 }, + { 74, 78, 81, 50 }, + { 75, 78, 82, 51 }, + { 76, 109, 110, 83 }, + { 77, 109, 111, 84 }, + { 78, 112, 113, 85 }, + { 79, 109, 114, 86 }, + { 80, 115, 116, 93 }, + { 81, 117, 118, 94 }, + { 82, 119, 120, 95 }, + { 83, 121, 122, 96 }, + { 84, 123, 124, 97 }, + { 85, 125, 126, 98 }, + { 86, 127, 129, 103 }, + { 87, 128, 129, 104 }, + { 88, 130, 131, 106 }, + { 89, 132, 131, 107 }, + { 90, 133, 134, 108 }, + { 91, 135, 134, 109 }, + { 92, 136, 137, 110 }, + { 93, 138, 139, 111 }, + { 94, 470, 471, 0 }, + { 95, 472, 473, 0 }, + { 96, 474, 475, 0 }, + { 97, 476, 477, 0 }, + { 98, 478, 479, 0 }, + { 99, 392, 393, 286 }, + { 100, 394, 393, 287 }, + { 101, 431, 432, 357 }, + { 102, 433, 432, 358 }, + { 103, 425, 426, 354 }, + { 104, 617, 618, 0 }, + { 105, 615, 616, 0 }, + { 106, 337, 338, 0 }, + { 107, 480, 481, 0 }, + { 108, 482, 483, 0 }, + { 109, 484, 485, 0 }, + { 110, 486, 487, 0 }, + { 111, 488, 489, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 0, 699, 700, 0 }, + { 112, 648, 649, 0 }, + { 113, 646, 647, 0 }, + { 114, 140, 141, 0 }, + { 115, 142, 143, 0 }, + { 116, 144, 145, 0 }, + { 117, 146, 147, 0 }, + { 118, 148, 149, 0 }, + { 119, 150, 151, 0 }, + { 120, 152, 153, 0 }, + { 121, 154, 155, 0 }, + { 122, 156, 157, 0 }, + { 123, 158, 159, 0 }, + { 124, 160, 161, 0 }, + { 125, 162, 163, 0 }, + { 126, 164, 165, 133 }, + { 127, 166, 167, 134 }, + { 128, 168, 169, 135 }, + { 129, 170, 171, 136 }, + { 130, 172, 173, 137 }, + { 131, 174, 175, 138 }, + { 132, 176, 177, 139 }, + { 133, 178, 179, 140 }, + { 134, 180, 181, 141 }, + { 135, 182, 183, 142 }, + { 136, 184, 185, 143 }, + { 137, 186, 187, 144 }, + { 138, 188, 189, 145 }, + { 139, 190, 191, 146 }, + { 140, 192, 193, 147 }, + { 141, 194, 195, 148 }, + { 142, 196, 197, 149 }, + { 143, 198, 199, 150 }, + { 144, 200, 201, 151 }, + { 145, 202, 203, 152 }, + { 146, 204, 205, 153 }, + { 147, 206, 207, 154 }, + { 148, 208, 209, 155 }, + { 149, 210, 211, 156 }, + { 150, 212, 213, 157 }, + { 151, 214, 215, 158 }, + { 152, 216, 217, 159 }, + { 153, 218, 219, 160 }, + { 154, 220, 221, 161 }, + { 155, 222, 223, 162 }, + { 156, 224, 225, 163 }, + { 157, 226, 227, 164 }, + { 158, 228, 229, 165 }, + { 159, 230, 231, 166 }, + { 160, 232, 233, 167 }, + { 161, 554, 555, 0 }, + { 162, 556, 557, 0 }, + { 163, 558, 559, 0 }, + { 164, 560, 561, 0 }, + { 165, 562, 563, 0 }, + { 166, 564, 565, 0 }, + { 167, 566, 567, 0 }, + { 168, 568, 569, 0 }, + { 169, 570, 571, 0 }, + { 170, 572, 573, 0 }, + { 171, 574, 575, 0 }, + { 172, 576, 577, 0 }, + { 173, 578, 579, 0 }, + { 174, 580, 581, 0 }, + { 175, 582, 583, 0 }, + { 176, 584, 585, 0 }, + { 177, 586, 587, 0 }, + { 178, 234, 235, 168 }, + { 179, 236, 237, 169 }, + { 180, 238, 239, 170 }, + { 181, 240, 241, 171 }, + { 182, 242, 243, 172 }, + { 183, 244, 245, 173 }, + { 184, 246, 247, 174 }, + { 185, 248, 249, 175 }, + { 186, 588, 589, 0 }, + { 187, 590, 591, 0 }, + { 188, 592, 593, 0 }, + { 189, 594, 595, 0 }, + { 190, 250, 251, 179 }, + { 191, 252, 253, 180 }, + { 192, 254, 255, 181 }, + { 193, 256, 257, 182 }, + { 194, 258, 259, 183 }, + { 195, 260, 261, 184 }, + { 196, 252, 262, 185 }, + { 197, 263, 264, 186 }, + { 198, 265, 266, 187 }, + { 199, 267, 268, 188 }, + { 200, 269, 270, 189 }, + { 201, 271, 272, 190 }, + { 202, 273, 274, 191 }, + { 203, 275, 276, 192 }, + { 204, 277, 278, 193 }, + { 205, 279, 280, 194 }, + { 206, 281, 282, 195 }, + { 207, 283, 284, 196 }, + { 208, 285, 286, 197 }, + { 209, 287, 288, 198 }, + { 210, 289, 290, 199 }, + { 211, 291, 292, 200 }, + { 212, 293, 294, 201 }, + { 213, 295, 296, 202 }, + { 214, 297, 298, 203 }, + { 215, 299, 300, 204 }, + { 216, 301, 302, 205 }, + { 217, 303, 304, 206 }, + { 218, 305, 304, 207 }, + { 219, 306, 307, 208 }, + { 220, 308, 309, 209 }, + { 221, 310, 311, 210 }, + { 222, 312, 313, 211 }, + { 223, 314, 315, 212 }, + { 224, 316, 317, 213 }, + { 225, 318, 319, 214 }, + { 226, 320, 321, 215 }, + { 227, 322, 323, 216 }, + { 228, 324, 325, 217 }, + { 229, 326, 327, 218 }, + { 230, 328, 77, 219 }, + { 231, 329, 330, 220 }, + { 232, 331, 332, 221 }, + { 233, 333, 334, 222 }, + { 234, 335, 336, 223 }, + { 235, 337, 338, 224 }, + { 236, 339, 340, 225 }, + { 237, 341, 342, 254 }, + { 238, 341, 343, 255 }, + { 239, 341, 344, 256 }, + { 240, 341, 345, 257 }, + { 241, 341, 346, 258 }, + { 242, 490, 491, 0 }, + { 243, 492, 493, 0 }, + { 244, 494, 495, 0 }, + { 245, 496, 497, 0 }, + { 246, 611, 612, 0 }, + { 247, 498, 499, 0 }, + { 248, 500, 501, 0 }, + { 249, 502, 503, 0 }, + { 250, 504, 505, 0 }, + { 251, 335, 658, 0 }, + { 252, 659, 660, 0 }, + { 253, 506, 507, 0 }, + { 254, 508, 509, 0 }, + { 255, 613, 614, 0 }, + { 256, 650, 651, 0 }, + { 257, 654, 655, 0 }, + { 258, 510, 511, 0 }, + { 259, 636, 637, 0 }, + { 260, 638, 639, 0 }, + { 261, 640, 641, 0 }, + { 262, 642, 643, 0 }, + { 263, 652, 653, 0 }, + { 264, 512, 513, 0 }, + { 265, 514, 515, 0 }, + { 266, 683, 684, 0 }, + { 267, 691, 692, 0 }, + { 268, 693, 694, 0 }, + { 269, 685, 686, 0 }, + { 270, 687, 688, 0 }, + { 271, 689, 690, 0 }, + { 272, 516, 517, 0 }, + { 273, 518, 519, 0 }, + { 274, 520, 521, 0 }, + { 275, 619, 620, 0 }, + { 276, 619, 621, 0 }, + { 277, 619, 622, 0 }, + { 278, 619, 623, 0 }, + { 279, 619, 624, 0 }, + { 280, 619, 625, 0 }, + { 281, 619, 626, 0 }, + { 282, 619, 627, 0 }, + { 283, 619, 628, 0 }, + { 284, 619, 629, 0 }, + { 285, 619, 630, 0 }, + { 286, 619, 631, 0 }, + { 287, 619, 632, 0 }, + { 288, 619, 633, 0 }, + { 289, 619, 634, 0 }, + { 290, 619, 635, 0 }, + { 291, 522, 523, 0 }, + { 292, 524, 525, 0 }, + { 293, 526, 527, 0 }, + { 294, 528, 529, 0 }, + { 295, 530, 531, 0 }, + { 296, 532, 533, 0 }, + { 297, 534, 535, 0 }, + { 298, 695, 696, 0 }, + { 299, 536, 537, 0 }, + { 300, 538, 539, 0 }, + { 301, 540, 541, 0 }, + { 302, 542, 543, 0 }, + { 303, 544, 545, 0 }, + { 304, 546, 547, 0 }, + { 305, 397, 398, 289 }, + { 306, 397, 399, 290 }, + { 307, 397, 400, 291 }, + { 308, 397, 401, 292 }, + { 309, 397, 402, 293 }, + { 310, 397, 403, 294 }, + { 311, 397, 404, 295 }, + { 312, 397, 398, 296 }, + { 313, 397, 405, 297 }, + { 314, 397, 402, 298 }, + { 315, 397, 406, 299 }, + { 316, 397, 407, 300 }, + { 317, 397, 404, 301 }, + { 318, 397, 404, 302 }, + { 319, 397, 402, 303 }, + { 320, 397, 401, 304 }, + { 321, 397, 402, 305 }, + { 322, 397, 400, 306 }, + { 323, 397, 405, 307 }, + { 324, 397, 402, 308 }, + { 325, 397, 402, 309 }, + { 326, 397, 405, 310 }, + { 327, 397, 408, 311 }, + { 328, 397, 409, 312 }, + { 329, 397, 409, 313 }, + { 330, 397, 410, 314 }, + { 331, 397, 402, 315 }, + { 332, 397, 410, 316 }, + { 333, 397, 401, 317 }, + { 334, 397, 411, 318 }, + { 335, 397, 398, 319 }, + { 336, 397, 402, 320 }, + { 337, 397, 401, 321 }, + { 338, 397, 409, 322 }, + { 339, 397, 406, 323 }, + { 340, 397, 403, 324 }, + { 341, 397, 412, 325 }, + { 342, 397, 406, 326 }, + { 343, 397, 412, 327 }, + { 344, 397, 413, 328 }, + { 345, 397, 407, 329 }, + { 346, 397, 402, 330 }, + { 347, 397, 402, 331 }, + { 348, 397, 401, 332 }, + { 349, 397, 402, 333 }, + { 350, 397, 407, 334 }, + { 351, 397, 408, 335 }, + { 352, 397, 401, 336 }, + { 353, 397, 407, 337 }, + { 354, 397, 406, 338 }, + { 355, 397, 413, 0 }, + { 356, 397, 398, 0 }, + { 357, 397, 405, 0 }, + { 358, 397, 402, 0 }, + { 359, 397, 400, 0 }, + { 360, 397, 407, 0 }, + { 361, 397, 409, 0 }, + { 362, 397, 402, 0 }, + { 363, 397, 399, 0 }, + { 364, 397, 398, 0 }, + { 365, 397, 406, 0 }, + { 366, 397, 610, 0 }, + { 367, 397, 407, 0 }, + { 368, 397, 402, 0 }, + { 369, 397, 411, 0 }, + { 370, 397, 407, 0 }, + { 371, 397, 402, 0 }, + { 372, 397, 402, 0 }, + { 373, 397, 412, 0 }, + { 374, 397, 402, 0 }, + { 375, 397, 412, 0 }, + { 376, 397, 404, 0 }, + { 377, 397, 409, 0 }, + { 378, 397, 408, 0 }, + { 379, 397, 402, 0 }, + { 380, 397, 412, 0 }, + { 381, 397, 402, 0 }, + { 382, 397, 402, 0 }, + { 383, 397, 407, 0 }, + { 384, 397, 412, 0 }, + { 385, 397, 610, 0 }, + { 386, 397, 402, 0 }, + { 387, 397, 402, 0 }, + { 388, 397, 403, 0 }, + { 389, 397, 401, 0 }, + { 390, 397, 405, 0 }, + { 391, 397, 402, 0 }, + { 392, 397, 413, 0 }, + { 393, 397, 610, 0 }, + { 394, 397, 402, 0 }, + { 395, 397, 408, 0 }, + { 396, 397, 401, 0 }, + { 397, 414, 402, 339 }, + { 398, 414, 413, 340 }, + { 399, 414, 400, 341 }, + { 400, 414, 402, 342 }, + { 401, 414, 400, 343 }, + { 402, 414, 398, 344 }, + { 403, 414, 400, 345 }, + { 404, 414, 402, 346 }, + { 405, 548, 549, 0 }, + { 406, 550, 551, 0 }, + { 407, 552, 553, 0 }, + { 408, 697, 698, 0 }, + { 409, 681, 682, 0 }, + { 410, 606, 607, 0 }, + { 411, 671, 672, 0 }, + { 412, 675, 676, 0 }, + { 413, 673, 674, 0 }, + { 414, 661, 662, 0 }, + { 415, 644, 645, 0 }, + { 416, 604, 605, 0 }, + { 417, 656, 657, 0 }, + { 418, 679, 680, 0 }, + { 419, 439, 440, 361 }, + { 420, 441, 442, 362 }, + { 421, 349, 350, 260 }, + { 422, 353, 354, 262 }, + { 423, 355, 356, 263 }, + { 424, 357, 358, 264 }, + { 425, 363, 364, 0 }, + { 426, 373, 374, 0 }, + { 427, 437, 438, 360 }, + { 428, 429, 430, 0 }, + { 429, 375, 64, 0 }, + { 430, 602, 603, 0 }, + { 431, 608, 609, 0 }, + { 432, 677, 678, 0 }, + { 433, 359, 360, 265 }, + { 434, 361, 362, 266 }, + { 435, 596, 597, 0 }, + { 436, 415, 416, 349 }, + { 437, 417, 418, 0 }, + { 438, 419, 420, 0 }, + { 439, 421, 422, 0 }, + { 440, 598, 599, 285 }, + { 441, 600, 601, 0 }, }; -void MoveItemSlotInList(struct ItemSlot * itemSlots, u16 from, u16 to) -{ - if (from != to) - { +void MoveItemSlotInList(struct ItemSlot *itemSlots, u16 from, u16 to) { + if (from != to) { s16 i; struct ItemSlot firstSlot = itemSlots[from]; - if (to > from) - { + if (to > from) { to--; - for (i = (s16)from; i < (s16)to; i++) - { + for (i = (s16)from; i < (s16)to; i++) { itemSlots[i] = itemSlots[i + 1]; } - } - else - { - for (i = (s16)from; i > (s16)to; i--) - { + } else { + for (i = (s16)from; i > (s16)to; i--) { itemSlots[i] = itemSlots[i - 1]; } } @@ -689,65 +686,67 @@ void MoveItemSlotInList(struct ItemSlot * itemSlots, u16 from, u16 to) } } -u16 GetItemIndexMapping(u16 a0, u16 a1) -{ - switch (a1) - { +u16 GetItemIndexMapping(u16 a0, u16 a1) { + switch (a1) { case 0: - if (a0 == 0) + if (a0 == 0) { break; - if (a0 == 0xFFFF) + } + if (a0 == 0xFFFF) { break; + } return sItemIndexMappings[a0][0]; case 1: - if (a0 == 0) + if (a0 == 0) { return 699; - if (a0 == 0xFFFF) + } + if (a0 == 0xFFFF) { return 701; + } return sItemIndexMappings[a0][1]; case 2: - if (a0 == 0) + if (a0 == 0) { return 700; - if (a0 == 0xFFFF) + } + if (a0 == 0xFFFF) { return 702; + } return sItemIndexMappings[a0][2]; case 3: - if (a0 == 0) + if (a0 == 0) { break; - if (a0 == 0xFFFF) + } + if (a0 == 0xFFFF) { break; + } return sItemIndexMappings[a0][3]; } return 0; } -u16 UpConvertItemId_Gen3to4(u16 a0) -{ +u16 UpConvertItemId_Gen3to4(u16 a0) { u16 i; - for (i = 1; i <= NELEMS(sItemIndexMappings) - 1; i++) - { - if (a0 == sItemIndexMappings[i][3]) + for (i = 1; i <= NELEMS(sItemIndexMappings) - 1; i++) { + if (a0 == sItemIndexMappings[i][3]) { return i; + } } return 0; } -int sub_0206E708() -{ +int sub_0206E708() { return 1; } -int sub_0206E70C() -{ +int sub_0206E70C() { return 0; } -void * LoadItemDataOrGfx(u16 a0, u16 a1, HeapID heapId) -{ - if (a0 > NELEMS(sItemIndexMappings) - 1) +void *LoadItemDataOrGfx(u16 a0, u16 a1, HeapID heapId) { + if (a0 > NELEMS(sItemIndexMappings) - 1) { a0 = 0; - switch (a1) - { + } + switch (a1) { case 0: return AllocAndReadWholeNarcMemberByIdPair(NARC_ITEMTOOL_ITEMDATA_ITEM_DATA, sItemIndexMappings[a0][0], heapId); case 1: @@ -759,33 +758,28 @@ void * LoadItemDataOrGfx(u16 a0, u16 a1, HeapID heapId) } } -void GetItemNameIntoString(struct String * dest, u16 item_id, HeapID heapId) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0344_bin, heapId); +void GetItemNameIntoString(struct String *dest, u16 item_id, HeapID heapId) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0344_bin, heapId); ReadMsgDataIntoString(msgData, item_id, dest); DestroyMsgData(msgData); } -void GetItemDescIntoString(struct String * dest, u16 item_id, HeapID heapId) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0343_bin, heapId); +void GetItemDescIntoString(struct String *dest, u16 item_id, HeapID heapId) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0343_bin, heapId); ReadMsgDataIntoString(msgData, item_id, dest); DestroyMsgData(msgData); } -u32 GetItemAttr(u16 item, u32 attr, HeapID heapId) -{ +u32 GetItemAttr(u16 item, u32 attr, HeapID heapId) { u32 ret; - struct ItemData * itemData = (struct ItemData *)LoadItemDataOrGfx(item, 0, heapId); - ret = GetItemAttr_PreloadedItemData(itemData, attr); + struct ItemData *itemData = (struct ItemData *)LoadItemDataOrGfx(item, 0, heapId); + ret = GetItemAttr_PreloadedItemData(itemData, attr); FreeToHeapExplicit(heapId, itemData); return ret; } -u32 GetItemAttr_PreloadedItemData(struct ItemData * itemData, u32 attr) -{ - switch (attr) - { +u32 GetItemAttr_PreloadedItemData(struct ItemData *itemData, u32 attr) { + switch (attr) { case ITEMATTR_PRICE: return itemData->price; case ITEMATTR_HOLD_EFFECT: @@ -817,8 +811,7 @@ u32 GetItemAttr_PreloadedItemData(struct ItemData * itemData, u32 attr) case ITEMATTR_PARTY_USE: return itemData->partyUse; default: - switch (itemData->partyUse) - { + switch (itemData->partyUse) { case 0: return itemData->partyUseParam.flat; case 1: @@ -829,10 +822,8 @@ u32 GetItemAttr_PreloadedItemData(struct ItemData * itemData, u32 attr) } } -u32 GetItemAttrSub(struct ItemPartyUseParam * sub, u32 attr) -{ - switch (attr) - { +u32 GetItemAttrSub(struct ItemPartyUseParam *sub, u32 attr) { + switch (attr) { case ITEMATTR_SLP_HEAL: return sub->slp_heal; case ITEMATTR_PSN_HEAL: @@ -926,101 +917,91 @@ u32 GetItemAttrSub(struct ItemPartyUseParam * sub, u32 attr) } } -u16 TMHMGetMove(u16 a0) -{ - if (a0 < ITEM_TM01 || a0 > ITEM_HM08) +u16 TMHMGetMove(u16 a0) { + if (a0 < ITEM_TM01 || a0 > ITEM_HM08) { return MOVE_NONE; + } a0 -= ITEM_TM01; return sTMHMMoves[a0]; } -BOOL MoveIsHM(u16 a0) -{ +BOOL MoveIsHM(u16 a0) { u8 i; - for (i = 0; i < 8; i++) - { - if (a0 == sTMHMMoves[i + NUM_TMS]) + for (i = 0; i < 8; i++) { + if (a0 == sTMHMMoves[i + NUM_TMS]) { return TRUE; + } } return FALSE; } -u8 ItemToTMHMId(u16 a0) -{ - if (a0 < ITEM_TM01 || a0 > ITEM_HM08) +u8 ItemToTMHMId(u16 a0) { + if (a0 < ITEM_TM01 || a0 > ITEM_HM08) { return 0; + } return (u8)(a0 - ITEM_TM01); } -BOOL ItemIdIsMail(u16 a0) -{ +BOOL ItemIdIsMail(u16 a0) { u32 i; - for (i = 0; i < 12; i++) - { - if (a0 == sMailIdxs[i]) + for (i = 0; i < 12; i++) { + if (a0 == sMailIdxs[i]) { return TRUE; + } } return FALSE; } -u8 ItemToMailId(u16 a0) -{ +u8 ItemToMailId(u16 a0) { u32 i; - for (i = 0; i < 12; i++) - { - if (a0 == sMailIdxs[i]) + for (i = 0; i < 12; i++) { + if (a0 == sMailIdxs[i]) { return (u8)i; + } } return 0; } -u16 MailToItemId(u8 i) -{ - if (i >= 12) +u16 MailToItemId(u8 i) { + if (i >= 12) { return 0; + } return sMailIdxs[i]; } -BOOL ItemIdIsBerry(u16 a0) -{ +BOOL ItemIdIsBerry(u16 a0) { u32 i; - for (i = 0; i < 64; i++) - { - if (a0 == sBerryIdxs[i]) + for (i = 0; i < 64; i++) { + if (a0 == sBerryIdxs[i]) { return TRUE; + } } return FALSE; } -u8 ItemToBerryId(u16 item_id) -{ - if (item_id < FIRST_BERRY_IDX) +u8 ItemToBerryId(u16 item_id) { + if (item_id < FIRST_BERRY_IDX) { return 0xFF; + } return (u8)(item_id - FIRST_BERRY_IDX); } -u16 BerryToItemId(u8 a0) -{ - if (a0 >= NUM_BERRIES) +u16 BerryToItemId(u8 a0) { + if (a0 >= NUM_BERRIES) { return 0xFFFF; + } return sBerryIdxs[a0]; } -u8 ItemIsBitter(u16 item_id) -{ - return item_id == ITEM_ENERGYPOWDER || - item_id == ITEM_ENERGY_ROOT || - item_id == ITEM_HEAL_POWDER || - item_id == ITEM_REVIVAL_HERB; +u8 ItemIsBitter(u16 item_id) { + return item_id == ITEM_ENERGYPOWDER || item_id == ITEM_ENERGY_ROOT || item_id == ITEM_HEAL_POWDER || item_id == ITEM_REVIVAL_HERB; } -struct ItemData * LoadAllItemData(HeapID heapId) -{ +struct ItemData *LoadAllItemData(HeapID heapId) { return AllocAndReadFromNarcMemberByIdPair(NARC_ITEMTOOL_ITEMDATA_ITEM_DATA, 0, heapId, 0, sizeof(struct ItemData) * GetItemIndexMapping(ITEM_SECRETPOTION, 0)); } -struct ItemData * GetItemDataPtrFromArray(struct ItemData * a0, u16 item_id) -{ +struct ItemData *GetItemDataPtrFromArray(struct ItemData *a0, u16 item_id) { return a0 + item_id; } diff --git a/arm9/src/list_menu.c b/arm9/src/list_menu.c index 3f65d5ef2..3b13ac5ca 100644 --- a/arm9/src/list_menu.c +++ b/arm9/src/list_menu.c @@ -1,35 +1,37 @@ +#include "list_menu.h" + #include "global.h" + +#include "font.h" #include "heap.h" #include "main.h" -#include "list_menu.h" #include "text.h" -#include "font.h" -void ListMenuPrintEntries(struct ListMenu * list, u16 startIndex, u16 yOffset, u16 count); -void ListMenuDrawCursor(struct ListMenu * list); -BOOL ListMenuChangeSelection(struct ListMenu * list, u8 updateCursorAndCallCallback, u8 count, u8 movingDown); -void ListMenuCallSelectionChangedCallback(struct ListMenu * list, u8 onInit); - -struct ListMenu * ListMenuInit(const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u8 heapId) -{ - struct ListMenu * list = AllocFromHeap((HeapID)heapId, sizeof(struct ListMenu)); - list->template = *template; - list->cursor = ListMenuCursorNew((HeapID)heapId); - list->cursorPos = cursorPos; - list->itemsAbove = itemsAbove; - list->unk_30 = 0; - list->unk_31 = 0; - list->taskId = 0xFF; - list->unk_33 = 0; - list->heapId = heapId; - list->cursorPal = list->template.cursorPal; - list->fillValue = list->template.fillValue; +void ListMenuPrintEntries(struct ListMenu *list, u16 startIndex, u16 yOffset, u16 count); +void ListMenuDrawCursor(struct ListMenu *list); +BOOL ListMenuChangeSelection(struct ListMenu *list, u8 updateCursorAndCallCallback, u8 count, u8 movingDown); +void ListMenuCallSelectionChangedCallback(struct ListMenu *list, u8 onInit); + +struct ListMenu *ListMenuInit(const struct ListMenuTemplate *template, u16 cursorPos, u16 itemsAbove, u8 heapId) { + struct ListMenu *list = AllocFromHeap((HeapID)heapId, sizeof(struct ListMenu)); + list->template = *template; + list->cursor = ListMenuCursorNew((HeapID)heapId); + list->cursorPos = cursorPos; + list->itemsAbove = itemsAbove; + list->unk_30 = 0; + list->unk_31 = 0; + list->taskId = 0xFF; + list->unk_33 = 0; + list->heapId = heapId; + list->cursorPal = list->template.cursorPal; + list->fillValue = list->template.fillValue; list->cursorShadowPal = list->template.cursorShadowPal; - list->lettersSpacing = list->template.lettersSpacing; - list->fontId = list->template.fontId; + list->lettersSpacing = list->template.lettersSpacing; + list->fontId = list->template.fontId; list->overrideEnabled = FALSE; - if (list->template.totalItems < list->template.maxShowed) + if (list->template.totalItems < list->template.maxShowed) { list->template.maxShowed = list->template.totalItems; + } ListMenuCursorSetColor(list->cursor, MAKE_TEXT_COLOR(list->template.cursorPal, list->template.cursorShadowPal, list->template.fillValue)); FillWindowPixelBuffer(list->template.window, list->template.fillValue); ListMenuPrintEntries(list, list->cursorPos, 0, list->template.maxShowed); @@ -39,150 +41,131 @@ struct ListMenu * ListMenuInit(const struct ListMenuTemplate * template, u16 cur return list; } -s32 ListMenu_ProcessInput(struct ListMenu * list) -{ +s32 ListMenu_ProcessInput(struct ListMenu *list) { list->unk_33 = 0; if (gSystem.newKeys & REG_PAD_KEYINPUT_A_MASK) { return list->template.items[list->cursorPos + list->itemsAbove].value; - } - else if (gSystem.newKeys & REG_PAD_KEYINPUT_B_MASK) { + } else if (gSystem.newKeys & REG_PAD_KEYINPUT_B_MASK) { return LIST_CANCEL; - } - else if (gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_UP_MASK) { - if (!ListMenuChangeSelection(list, TRUE, 1, FALSE)) + } else if (gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_UP_MASK) { + if (!ListMenuChangeSelection(list, TRUE, 1, FALSE)) { list->unk_33 = 1; + } return LIST_NOTHING_CHOSEN; - } - else if (gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_DOWN_MASK) { - if (!ListMenuChangeSelection(list, TRUE, 1, TRUE)) + } else if (gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_DOWN_MASK) { + if (!ListMenuChangeSelection(list, TRUE, 1, TRUE)) { list->unk_33 = 2; + } return LIST_NOTHING_CHOSEN; - } - else - { + } else { u16 rightButton, leftButton; - switch (list->template.scrollMultiple) - { + switch (list->template.scrollMultiple) { case LIST_NO_MULTIPLE_SCROLL: default: - leftButton = FALSE; + leftButton = FALSE; rightButton = FALSE; break; case LIST_MULTIPLE_SCROLL_DPAD: - leftButton = (u16)(gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_LEFT_MASK); + leftButton = (u16)(gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_LEFT_MASK); rightButton = (u16)(gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_RIGHT_MASK); break; case LIST_MULTIPLE_SCROLL_L_R: - leftButton = (u16)(gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_L_MASK); + leftButton = (u16)(gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_L_MASK); rightButton = (u16)(gSystem.newAndRepeatedKeys & REG_PAD_KEYINPUT_R_MASK); break; } - if (leftButton) - { - if (!ListMenuChangeSelection(list, TRUE, (u8)list->template.maxShowed, FALSE)) + if (leftButton) { + if (!ListMenuChangeSelection(list, TRUE, (u8)list->template.maxShowed, FALSE)) { list->unk_33 = 3; + } return LIST_NOTHING_CHOSEN; - } - else if (rightButton) - { - if (!ListMenuChangeSelection(list, TRUE, (u8)list->template.maxShowed, TRUE)) + } else if (rightButton) { + if (!ListMenuChangeSelection(list, TRUE, (u8)list->template.maxShowed, TRUE)) { list->unk_33 = 4; + } return LIST_NOTHING_CHOSEN; - } - else - { + } else { return LIST_NOTHING_CHOSEN; } } } -void DestroyListMenu(struct ListMenu * list, u16 * cursorPos, u16 * itemsAbove) -{ - if (cursorPos != NULL) +void DestroyListMenu(struct ListMenu *list, u16 *cursorPos, u16 *itemsAbove) { + if (cursorPos != NULL) { *cursorPos = list->cursorPos; - if (itemsAbove != NULL) + } + if (itemsAbove != NULL) { *itemsAbove = list->itemsAbove; + } DestroyListMenuCursorObj(list->cursor); FreeToHeapExplicit((HeapID)list->heapId, list); } -void RedrawListMenu(struct ListMenu * list) -{ +void RedrawListMenu(struct ListMenu *list) { FillWindowPixelBuffer(list->template.window, list->template.fillValue); ListMenuPrintEntries(list, list->cursorPos, 0, list->template.maxShowed); ListMenuDrawCursor(list); CopyWindowToVram(list->template.window); } -s32 ListMenuTestInputInternal(struct ListMenu * list, const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u16 updateFlag, u16 input, u16 *newCursorPos, u16 *newItemsAbove) -{ - if (template != NULL) +s32 ListMenuTestInputInternal(struct ListMenu *list, const struct ListMenuTemplate *template, u16 cursorPos, u16 itemsAbove, u16 updateFlag, u16 input, u16 *newCursorPos, u16 *newItemsAbove) { + if (template != NULL) { list->template = *template; - list->cursorPos = cursorPos; + } + list->cursorPos = cursorPos; list->itemsAbove = itemsAbove; - list->unk_30 = 0; - list->unk_31 = 0; + list->unk_30 = 0; + list->unk_31 = 0; - if (input == REG_PAD_KEYINPUT_UP_MASK) - { + if (input == REG_PAD_KEYINPUT_UP_MASK) { ListMenuChangeSelection(list, (u8)updateFlag, 1, FALSE); - } - else if (input == REG_PAD_KEYINPUT_DOWN_MASK) - { + } else if (input == REG_PAD_KEYINPUT_DOWN_MASK) { ListMenuChangeSelection(list, (u8)updateFlag, 1, TRUE); } - if (newCursorPos != NULL) - { + if (newCursorPos != NULL) { *newCursorPos = list->cursorPos; } - if (newItemsAbove != NULL) - { + if (newItemsAbove != NULL) { *newItemsAbove = list->itemsAbove; } return -1; } -s32 ListMenuTestInput(struct ListMenu * list, const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u16 input, u16 *newCursorPos, u16 *newItemsAbove) -{ +s32 ListMenuTestInput(struct ListMenu *list, const struct ListMenuTemplate *template, u16 cursorPos, u16 itemsAbove, u16 input, u16 *newCursorPos, u16 *newItemsAbove) { return ListMenuTestInputInternal(list, template, cursorPos, itemsAbove, FALSE, input, newCursorPos, newItemsAbove); } -void ListMenuOverrideSetColors(struct ListMenu * list, u8 cursorPal, u8 fillValue, u8 cursorShadowPal) -{ - list->cursorPal = cursorPal; - list->fillValue = fillValue; +void ListMenuOverrideSetColors(struct ListMenu *list, u8 cursorPal, u8 fillValue, u8 cursorShadowPal) { + list->cursorPal = cursorPal; + list->fillValue = fillValue; list->cursorShadowPal = cursorShadowPal; list->overrideEnabled = TRUE; } -void ListMenuGetCurrentItemArrayId(struct ListMenu * list, u16 * index_p) -{ +void ListMenuGetCurrentItemArrayId(struct ListMenu *list, u16 *index_p) { *index_p = (u16)(list->cursorPos + list->itemsAbove); } -void ListMenuGetScrollAndRow(struct ListMenu * list, u16 * cursorPos_p, u16 * itemsAbove_p) -{ - if (cursorPos_p != NULL) +void ListMenuGetScrollAndRow(struct ListMenu *list, u16 *cursorPos_p, u16 *itemsAbove_p) { + if (cursorPos_p != NULL) { *cursorPos_p = list->cursorPos; - if (itemsAbove_p != NULL) + } + if (itemsAbove_p != NULL) { *itemsAbove_p = list->itemsAbove; + } } -u8 ListMenuGetUnk33(struct ListMenu * list) -{ +u8 ListMenuGetUnk33(struct ListMenu *list) { return list->unk_33; } -s32 ListMenuGetValueByArrayId(struct ListMenu * list, s32 index) -{ +s32 ListMenuGetValueByArrayId(struct ListMenu *list, s32 index) { return list->template.items[index].value; } -s32 ListMenuGetTemplateField(struct ListMenu * list, u32 attr) -{ - switch (attr) - { +s32 ListMenuGetTemplateField(struct ListMenu *list, u32 attr) { + switch (attr) { case 0: return (s32)list->template.moveCursorFunc; case 1: @@ -228,10 +211,8 @@ s32 ListMenuGetTemplateField(struct ListMenu * list, u32 attr) return -1; } -void ListMenuSetTemplateField(struct ListMenu * list, u32 attr, s32 value) -{ - switch (attr) - { +void ListMenuSetTemplateField(struct ListMenu *list, u32 attr, s32 value) { + switch (attr) { case 0: list->template.moveCursorFunc = (LM_MoveCursorFunc_t)value; break; @@ -293,53 +274,45 @@ void ListMenuSetTemplateField(struct ListMenu * list, u32 attr, s32 value) } } -void ListMenuGetItemStr(struct ListMenu * list, struct ListMenuItem * items) -{ +void ListMenuGetItemStr(struct ListMenu *list, struct ListMenuItem *items) { list->template.items = items; } -void ListMenuPrint(struct ListMenu * list, struct String * str, u8 x, u8 y) -{ - if (str != NULL) - { - if (list->overrideEnabled) - { +void ListMenuPrint(struct ListMenu *list, struct String *str, u8 x, u8 y) { + if (str != NULL) { + if (list->overrideEnabled) { AddTextPrinterParameterized3(list->template.window, list->fontId, str, x, y, 0xFF, MAKE_TEXT_COLOR(list->cursorPal, list->cursorShadowPal, list->fillValue), list->lettersSpacing, 0, NULL); - } - else - { + } else { AddTextPrinterParameterized3(list->template.window, list->template.fontId, str, x, y, 0xFF, MAKE_TEXT_COLOR(list->template.cursorPal, list->template.cursorShadowPal, list->template.fillValue), list->template.lettersSpacing, 0, NULL); } } } -void ListMenuPrintEntries(struct ListMenu * list, u16 startIndex, u16 yOffset, u16 count) -{ +void ListMenuPrintEntries(struct ListMenu *list, u16 startIndex, u16 yOffset, u16 count) { s32 i; u8 x, y; u8 yMultiplier = (u8)(GetFontAttribute((u8)list->template.fontId, 1) + list->template.itemVerticalPadding); - for (i = 0; i < count; i++) - { - if (list->template.items[startIndex].value != LIST_HEADER) + for (i = 0; i < count; i++) { + if (list->template.items[startIndex].value != LIST_HEADER) { x = list->template.item_X; - else + } else { x = list->template.header_X; + } y = (u8)((yOffset + i) * yMultiplier + list->template.upText_Y); - if (list->template.itemPrintFunc != NULL) + if (list->template.itemPrintFunc != NULL) { list->template.itemPrintFunc(list, list->template.items[startIndex].value, y); + } ListMenuPrint(list, list->template.items[startIndex].text, x, y); startIndex++; } } -void ListMenuDrawCursor(struct ListMenu * list) -{ +void ListMenuDrawCursor(struct ListMenu *list) { u8 yMultiplier = (u8)(GetFontAttribute((u8)list->template.fontId, 1) + list->template.itemVerticalPadding); - u8 x = list->template.cursor_X; - u8 y = (u8)(list->itemsAbove * yMultiplier + list->template.upText_Y); - switch (list->template.cursorKind) - { + u8 x = list->template.cursor_X; + u8 y = (u8)(list->itemsAbove * yMultiplier + list->template.upText_Y); + switch (list->template.cursorKind) { case 0: ListMenuUpdateCursorObj(list->cursor, list->template.window, x, y); break; @@ -350,20 +323,18 @@ void ListMenuDrawCursor(struct ListMenu * list) } } -void ListMenuErasePrintedCursor(struct ListMenu * list, u16 itemsAbove) -{ - switch (list->template.cursorKind) - { +void ListMenuErasePrintedCursor(struct ListMenu *list, u16 itemsAbove) { + switch (list->template.cursorKind) { case 0: u8 yMultiplier = (u8)(GetFontAttribute(list->template.fontId, 1) + list->template.itemVerticalPadding); - u8 width = 8; - u8 height = 16; + u8 width = 8; + u8 height = 16; FillWindowPixelRect(list->template.window, - list->template.fillValue, - list->template.cursor_X, - (u16)(itemsAbove * yMultiplier + list->template.upText_Y), - width, - height); + list->template.fillValue, + list->template.cursor_X, + (u16)(itemsAbove * yMultiplier + list->template.upText_Y), + width, + height); break; case 1: case 2: // leftover @@ -372,115 +343,95 @@ void ListMenuErasePrintedCursor(struct ListMenu * list, u16 itemsAbove) } } -u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, u8 movingDown) -{ +u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, u8 movingDown) { u32 cursorPos; u16 itemsAbove; u16 newRow; itemsAbove = list->itemsAbove; - cursorPos = list->cursorPos; + cursorPos = list->cursorPos; - if (!movingDown) - { - if (list->template.maxShowed == 1) + if (!movingDown) { + if (list->template.maxShowed == 1) { newRow = 0; - else + } else { newRow = (u16)(list->template.maxShowed - ((list->template.maxShowed / 2) + (list->template.maxShowed % 2)) - 1); + } - if (cursorPos == 0) - { - while (itemsAbove != 0) - { + if (cursorPos == 0) { + while (itemsAbove != 0) { itemsAbove--; - if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) - { + if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) { list->itemsAbove = itemsAbove; return 1; } } return 0; - } - else - { - while (itemsAbove > newRow) - { + } else { + while (itemsAbove > newRow) { itemsAbove--; - if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) - { + if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) { list->itemsAbove = itemsAbove; return 1; } } list->itemsAbove = newRow; - list->cursorPos = (u16)(cursorPos - 1); + list->cursorPos = (u16)(cursorPos - 1); } - } - else - { - if (list->template.maxShowed == 1) + } else { + if (list->template.maxShowed == 1) { newRow = 0; - else + } else { newRow = (u16)((list->template.maxShowed / 2) + (list->template.maxShowed % 2)); + } - if (cursorPos == list->template.totalItems - list->template.maxShowed) - { - while (itemsAbove < list->template.maxShowed - 1) - { + if (cursorPos == list->template.totalItems - list->template.maxShowed) { + while (itemsAbove < list->template.maxShowed - 1) { itemsAbove++; - if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) - { + if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) { list->itemsAbove = itemsAbove; return 1; } } return 0; - } - else - { - while (itemsAbove < newRow) - { + } else { + while (itemsAbove < newRow) { itemsAbove++; - if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) - { + if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER) { list->itemsAbove = itemsAbove; return 1; } } list->itemsAbove = newRow; - list->cursorPos = (u16)(cursorPos + 1); + list->cursorPos = (u16)(cursorPos + 1); } } return 2; } -void ListMenuScroll(struct ListMenu * list, u8 count, u8 movingDown) -{ - if (count >= list->template.maxShowed) - { +void ListMenuScroll(struct ListMenu *list, u8 count, u8 movingDown) { + if (count >= list->template.maxShowed) { FillWindowPixelBuffer(list->template.window, list->template.fillValue); ListMenuPrintEntries(list, list->cursorPos, 0, list->template.maxShowed); - } - else - { + } else { u8 yMultiplier = (u8)(GetFontAttribute((u8)list->template.fontId, 1) + list->template.itemVerticalPadding); - if (!movingDown) - { + if (!movingDown) { u16 y, width, height; ScrollWindow(list->template.window, 1, (u8)(count * yMultiplier), (u8)((list->template.fillValue << 4) | list->template.fillValue)); ListMenuPrintEntries(list, list->cursorPos, 0, count); - y = (u16)((list->template.maxShowed * yMultiplier) + list->template.upText_Y); - width = GetWindowWidth(list->template.window); + y = (u16)((list->template.maxShowed * yMultiplier) + list->template.upText_Y); + width = GetWindowWidth(list->template.window); height = GetWindowHeight(list->template.window); FillWindowPixelRect(list->template.window, - list->template.fillValue, - 0, y, (u16)(width * 8), (u16)(height * 8 - y)); - } - else - { + list->template.fillValue, + 0, + y, + (u16)(width * 8), + (u16)(height * 8 - y)); + } else { u32 width; ScrollWindow(list->template.window, 0, (u8)(count * yMultiplier), (u8)((list->template.fillValue << 4) | list->template.fillValue)); @@ -488,38 +439,36 @@ void ListMenuScroll(struct ListMenu * list, u8 count, u8 movingDown) width = GetWindowWidth(list->template.window); FillWindowPixelRect(list->template.window, - list->template.fillValue, - 0, 0, (u16)(width * 8), list->template.upText_Y); + list->template.fillValue, + 0, + 0, + (u16)(width * 8), + list->template.upText_Y); } } } -BOOL ListMenuChangeSelection(struct ListMenu * list, u8 updateCursorAndCallCallback, u8 count, u8 movingDown) -{ +BOOL ListMenuChangeSelection(struct ListMenu *list, u8 updateCursorAndCallCallback, u8 count, u8 movingDown) { u16 oldSelectedRow; u8 selectionChange, i, cursorCount; - oldSelectedRow = list->itemsAbove; - cursorCount = 0; + oldSelectedRow = list->itemsAbove; + cursorCount = 0; selectionChange = 0; - for (i = 0; i < count; i++) - { - do - { + for (i = 0; i < count; i++) { + do { u8 ret = ListMenuUpdateSelectedRowIndexAndScrollOffset(list, movingDown); selectionChange |= ret; - if (ret != 2) + if (ret != 2) { break; + } cursorCount++; - } - while (list->template.items[list->cursorPos + list->itemsAbove].value == LIST_HEADER); + } while (list->template.items[list->cursorPos + list->itemsAbove].value == LIST_HEADER); } - if (updateCursorAndCallCallback) - { - switch (selectionChange) - { + if (updateCursorAndCallCallback) { + switch (selectionChange) { case 0: default: return TRUE; @@ -542,15 +491,12 @@ BOOL ListMenuChangeSelection(struct ListMenu * list, u8 updateCursorAndCallCallb return FALSE; } -void ListMenuCallSelectionChangedCallback(struct ListMenu * list, u8 onInit) -{ - if (list->template.moveCursorFunc != NULL) - { +void ListMenuCallSelectionChangedCallback(struct ListMenu *list, u8 onInit) { + if (list->template.moveCursorFunc != NULL) { list->template.moveCursorFunc(list, list->template.items[list->cursorPos + list->itemsAbove].value, onInit); } } -void ListMenuCopyToVram(struct ListMenu * list) -{ +void ListMenuCopyToVram(struct ListMenu *list) { CopyWindowToVram(list->template.window); } diff --git a/arm9/src/list_menu_items.c b/arm9/src/list_menu_items.c index bb8950997..a52b6775e 100644 --- a/arm9/src/list_menu_items.c +++ b/arm9/src/list_menu_items.c @@ -1,73 +1,62 @@ -#include "global.h" #include "list_menu_items.h" -#include "msgdata.h" + +#include "global.h" + #include "heap.h" +#include "msgdata.h" -void ListMenuItems_DestroyMenuStrings(struct ListMenuItem * items); +void ListMenuItems_DestroyMenuStrings(struct ListMenuItem *items); -struct ListMenuItem * ListMenuItems_New(u32 count, HeapID heapId) -{ +struct ListMenuItem *ListMenuItems_New(u32 count, HeapID heapId) { s32 i; - struct ListMenuItem * ret = AllocFromHeap(heapId, (count + 1) * sizeof(struct ListMenuItem)); - if (ret != NULL) - { - for (i = 0; i < count; i++) - { - ret[i].text = NULL; + struct ListMenuItem *ret = AllocFromHeap(heapId, (count + 1) * sizeof(struct ListMenuItem)); + if (ret != NULL) { + for (i = 0; i < count; i++) { + ret[i].text = NULL; ret[i].value = 0; } - ret[i].text = (struct String *)-1u; + ret[i].text = (struct String *)-1u; ret[i].value = (s32)heapId; } return ret; } -void ListMenuItems_Delete(struct ListMenuItem * items) -{ +void ListMenuItems_Delete(struct ListMenuItem *items) { ListMenuItems_DestroyMenuStrings(items); FreeToHeap(items); } -void ListMenuItems_AppendFromMsgData(struct ListMenuItem * items, struct MsgData * msgData, u32 msgNo, s32 value) -{ +void ListMenuItems_AppendFromMsgData(struct ListMenuItem *items, struct MsgData *msgData, u32 msgNo, s32 value) { HeapID heapId; - struct ListMenuItem * newItem = ListMenuItems_SeekEnd(items, &heapId); - if (newItem != NULL) - { - newItem->text = NewString_ReadMsgData(msgData, msgNo); + struct ListMenuItem *newItem = ListMenuItems_SeekEnd(items, &heapId); + if (newItem != NULL) { + newItem->text = NewString_ReadMsgData(msgData, msgNo); newItem->value = value; } } -void ListMenuItems_AddItem(struct ListMenuItem * items, struct String * str, s32 value) -{ +void ListMenuItems_AddItem(struct ListMenuItem *items, struct String *str, s32 value) { HeapID heapId; - struct ListMenuItem * newItem = ListMenuItems_SeekEnd(items, &heapId); - if (newItem != NULL) - { - newItem->text = StringDup(str, heapId); + struct ListMenuItem *newItem = ListMenuItems_SeekEnd(items, &heapId); + if (newItem != NULL) { + newItem->text = StringDup(str, heapId); newItem->value = value; } } -void ListMenuItems_CopyItem(struct ListMenuItem * items, struct ListMenuItem * src) -{ +void ListMenuItems_CopyItem(struct ListMenuItem *items, struct ListMenuItem *src) { HeapID heapId; - struct ListMenuItem * newItem = ListMenuItems_SeekEnd(items, &heapId); - if (newItem != NULL) - { - newItem->text = src->text; + struct ListMenuItem *newItem = ListMenuItems_SeekEnd(items, &heapId); + if (newItem != NULL) { + newItem->text = src->text; newItem->value = src->value; } } -struct ListMenuItem * ListMenuItems_SeekEnd(struct ListMenuItem * items, HeapID *heapIdPtr) -{ - struct ListMenuItem * ret; - for (; items->text != NULL; items++) - { - if (items->text == (struct String *)-1u) - { +struct ListMenuItem *ListMenuItems_SeekEnd(struct ListMenuItem *items, HeapID *heapIdPtr) { + struct ListMenuItem *ret; + for (; items->text != NULL; items++) { + if (items->text == (struct String *)-1u) { GF_ASSERT(0); return NULL; } @@ -79,13 +68,12 @@ struct ListMenuItem * ListMenuItems_SeekEnd(struct ListMenuItem * items, HeapID return ret; } -void ListMenuItems_DestroyMenuStrings(struct ListMenuItem * items) -{ +void ListMenuItems_DestroyMenuStrings(struct ListMenuItem *items) { s32 i; - for (i = 0; items[i].text != (struct String *)-1u; i++) - { - if (items[i].text == NULL) + for (i = 0; items[i].text != (struct String *)-1u; i++) { + if (items[i].text == NULL) { break; + } String_Delete(items[i].text); items[i].text = NULL; } diff --git a/arm9/src/mail.c b/arm9/src/mail.c index 5c53a83da..0016e6904 100644 --- a/arm9/src/mail.c +++ b/arm9/src/mail.c @@ -1,131 +1,117 @@ -#include "global.h" #include "mail.h" -#include "heap.h" -#include "string_util.h" + +#include "global.h" + #include "MI_memory.h" -#include "save.h" +#include "heap.h" #include "party.h" #include "player_data.h" +#include "save.h" +#include "string_util.h" -extern u32 sub_0206B6C8(struct Pokemon * pokemon); +extern u32 sub_0206B6C8(struct Pokemon *pokemon); extern u16 sub_0206B7BC(u16 species, u32 form, BOOL is_egg); -void Mail_Init(struct Mail * mail) -{ +void Mail_Init(struct Mail *mail) { s32 i; - mail->author_otId = 0; - mail->author_gender = 0; + mail->author_otId = 0; + mail->author_gender = 0; mail->author_language = (u8)gGameLanguage; - mail->author_version = (u8)gGameVersion; - mail->mail_type = 0xFF; + mail->author_version = (u8)gGameVersion; + mail->mail_type = 0xFF; StringFillEOS(mail->author_name, 8); - for (i = 0; i < 3; i++) - { + for (i = 0; i < 3; i++) { mail->unk_18[i].raw = 0xFFFF; } - for (i = 0; i < 3; i++) - { + for (i = 0; i < 3; i++) { MailMsg_Init(&mail->unk_20[i]); } } -BOOL Mail_TypeIsValid(struct Mail * mail) -{ +BOOL Mail_TypeIsValid(struct Mail *mail) { return mail->mail_type <= 11; } -struct Mail * Mail_New(HeapID heapId) -{ - struct Mail * ret = (struct Mail *)AllocFromHeapAtEnd(heapId, sizeof(struct Mail)); +struct Mail *Mail_New(HeapID heapId) { + struct Mail *ret = (struct Mail *)AllocFromHeapAtEnd(heapId, sizeof(struct Mail)); Mail_Init(ret); return ret; } -void Mail_Copy(const struct Mail * src, struct Mail * dest) -{ +void Mail_Copy(const struct Mail *src, struct Mail *dest) { MI_CpuCopy8(src, dest, sizeof(struct Mail)); } -void Mail_SetNewMessageDetails(struct Mail * mail, u8 type, u8 monIdx, struct SaveData * save) -{ +void Mail_SetNewMessageDetails(struct Mail *mail, u8 type, u8 monIdx, struct SaveData *save) { u32 sp10; u32 form; BOOL is_egg; u16 species; - struct Party * party; - PlayerProfile * profile; - struct Pokemon * pokemon; + struct Party *party; + PlayerProfile *profile; + struct Pokemon *pokemon; u16 r7; u8 i; Mail_Init(mail); mail->mail_type = type; - party = SaveArray_Party_Get(save); - profile = Save_PlayerData_GetProfileAddr(save); + party = SaveArray_Party_Get(save); + profile = Save_PlayerData_GetProfileAddr(save); CopyU16StringArray(mail->author_name, PlayerProfile_GetNamePtr(profile)); mail->author_gender = (u8)PlayerProfile_GetTrainerGender(profile); - mail->author_otId = PlayerProfile_GetTrainerID(profile); - for (i = 0; monIdx < Party_GetCount(party); monIdx++) - { - union MailPatternData * ptr; - pokemon = Party_GetMonByIndex(party, monIdx); - species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); - is_egg = (BOOL)GetMonData(pokemon, MON_DATA_IS_EGG, NULL); - form = GetMonData(pokemon, MON_DATA_FORM, NULL); - sp10 = sub_0206B6C8(pokemon); - r7 = sub_0206B7BC(species, form, is_egg); - ptr = &mail->unk_18[i]; + mail->author_otId = PlayerProfile_GetTrainerID(profile); + for (i = 0; monIdx < Party_GetCount(party); monIdx++) { + union MailPatternData *ptr; + pokemon = Party_GetMonByIndex(party, monIdx); + species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); + is_egg = (BOOL)GetMonData(pokemon, MON_DATA_IS_EGG, NULL); + form = GetMonData(pokemon, MON_DATA_FORM, NULL); + sp10 = sub_0206B6C8(pokemon); + r7 = sub_0206B7BC(species, form, is_egg); + ptr = &mail->unk_18[i]; ptr->bits.unk_0 = sp10; i++; ptr->bits.unk_C = r7; - if (i >= 3) + if (i >= 3) { break; + } } } -u32 Mail_GetOTID(struct Mail * mail) -{ +u32 Mail_GetOTID(struct Mail *mail) { return mail->author_otId; } -u16 * Mail_GetAuthorNamePtr(struct Mail * mail) -{ +u16 *Mail_GetAuthorNamePtr(struct Mail *mail) { return mail->author_name; } -u8 Mail_GetAuthorGender(struct Mail * mail) -{ +u8 Mail_GetAuthorGender(struct Mail *mail) { return mail->author_gender; } -u8 Mail_GetType(struct Mail * mail) -{ +u8 Mail_GetType(struct Mail *mail) { return mail->mail_type; } -void Mail_SetType(struct Mail * mail, u8 type) -{ - if (type < 12) +void Mail_SetType(struct Mail *mail, u8 type) { + if (type < 12) { mail->mail_type = type; + } } -u8 Mail_GetLanguage(struct Mail * mail) -{ +u8 Mail_GetLanguage(struct Mail *mail) { return mail->author_language; } -u8 Mail_GetVersion(struct Mail * mail) -{ +u8 Mail_GetVersion(struct Mail *mail) { return mail->author_version; } -u16 Mail_GetAttrFromUnk18Array(struct Mail * mail, u32 idx, u32 attr) -{ - if (idx < 3) - { - switch (attr) - { +u16 Mail_GetAttrFromUnk18Array(struct Mail *mail, u32 idx, u32 attr) { + if (idx < 3) { + switch (attr) { case 0: return mail->unk_18[idx].bits.unk_0; case 1: @@ -138,43 +124,37 @@ u16 Mail_GetAttrFromUnk18Array(struct Mail * mail, u32 idx, u32 attr) return 0; } -struct MailMessage * Mail_GetUnk20Array(struct Mail * mail, u32 idx) -{ - if (idx < 3) +struct MailMessage *Mail_GetUnk20Array(struct Mail *mail, u32 idx) { + if (idx < 3) { return &mail->unk_20[idx]; - else + } else { return &mail->unk_20[0]; + } } -void Mail_CopyToUnk20Array(struct Mail * mail, const struct MailMessage * src, u32 idx) -{ - if (idx < 3) +void Mail_CopyToUnk20Array(struct Mail *mail, const struct MailMessage *src, u32 idx) { + if (idx < 3) { MailMsg_Copy(&mail->unk_20[idx], src); + } } -struct Mail * Save_Mailbox_Get(struct SaveData * save) -{ +struct Mail *Save_Mailbox_Get(struct SaveData *save) { return (struct Mail *)SaveArray_Get(save, 15); } -u32 Save_Mailbox_sizeof(void) -{ +u32 Save_Mailbox_sizeof(void) { return 20 * sizeof(struct Mail); } -void Save_Mailbox_Init(struct Mail * mail) -{ +void Save_Mailbox_Init(struct Mail *mail) { s32 i; - for (i = 0; i < 20; i++) - { + for (i = 0; i < 20; i++) { Mail_Init(&mail[i]); } } -s32 Mailbox_GetFirstEmptySlotIdx(struct Mail * mail, BOOL r1) -{ - switch (r1) - { +s32 Mailbox_GetFirstEmptySlotIdx(struct Mail *mail, BOOL r1) { + switch (r1) { case 0: return MailArray_GetFirstEmptySlotIdx(mail, 20); default: @@ -182,24 +162,22 @@ s32 Mailbox_GetFirstEmptySlotIdx(struct Mail * mail, BOOL r1) } } -void Mailbox_DeleteSlotI(struct Mail * mail, BOOL r1, s32 idx) -{ +void Mailbox_DeleteSlotI(struct Mail *mail, BOOL r1, s32 idx) { mail = Mailbox_GetPtrToSlotI(mail, r1, idx); - if (mail != NULL) + if (mail != NULL) { Mail_Init(mail); + } } -void Mailbox_CopyMailToSlotI(struct Mail * mail, BOOL r1, s32 idx, const struct Mail * src) -{ +void Mailbox_CopyMailToSlotI(struct Mail *mail, BOOL r1, s32 idx, const struct Mail *src) { mail = Mailbox_GetPtrToSlotI(mail, r1, idx); - if (mail != NULL) + if (mail != NULL) { Mail_Copy(src, mail); + } } -s32 Mailbox_CountMessages(struct Mail * mail, BOOL r1) -{ - switch (r1) - { +s32 Mailbox_CountMessages(struct Mail *mail, BOOL r1) { + switch (r1) { case 0: return MailArray_CountMessages(mail, 20); default: @@ -207,56 +185,53 @@ s32 Mailbox_CountMessages(struct Mail * mail, BOOL r1) } } -struct Mail * Mailbox_AllocAndFetchMailI(struct Mail * mail, BOOL r1, s32 idx, HeapID heapId) -{ - struct Mail * ret; +struct Mail *Mailbox_AllocAndFetchMailI(struct Mail *mail, BOOL r1, s32 idx, HeapID heapId) { + struct Mail *ret; mail = Mailbox_GetPtrToSlotI(mail, r1, idx); - ret = Mail_New(heapId); - if (mail != NULL) + ret = Mail_New(heapId); + if (mail != NULL) { Mail_Copy(mail, ret); + } return ret; } -void Mailbox_FetchMailIToBuffer(struct Mail * mail, BOOL r1, s32 idx, struct Mail * dest) -{ +void Mailbox_FetchMailIToBuffer(struct Mail *mail, BOOL r1, s32 idx, struct Mail *dest) { mail = Mailbox_GetPtrToSlotI(mail, r1, idx); - if (mail == NULL) + if (mail == NULL) { Mail_Init(dest); - else + } else { Mail_Copy(mail, dest); + } } -s32 MailArray_GetFirstEmptySlotIdx(struct Mail * mail, s32 count) -{ +s32 MailArray_GetFirstEmptySlotIdx(struct Mail *mail, s32 count) { s32 i; - for (i = 0; i < count; i++) - { - if (!Mail_TypeIsValid(&mail[i])) + for (i = 0; i < count; i++) { + if (!Mail_TypeIsValid(&mail[i])) { return i; + } } return -1; } -s32 MailArray_CountMessages(struct Mail * mail, s32 count) -{ +s32 MailArray_CountMessages(struct Mail *mail, s32 count) { s32 ret = 0; s32 i; - for (i = 0; i < count; i++) - { - if (Mail_TypeIsValid(&mail[i])) + for (i = 0; i < count; i++) { + if (Mail_TypeIsValid(&mail[i])) { ret++; + } } return ret; } -struct Mail * Mailbox_GetPtrToSlotI(struct Mail * mail, BOOL r1, s32 idx) -{ - struct Mail * ret = NULL; - switch (r1) - { +struct Mail *Mailbox_GetPtrToSlotI(struct Mail *mail, BOOL r1, s32 idx) { + struct Mail *ret = NULL; + switch (r1) { case 0: - if (idx < 20) + if (idx < 20) { ret = &mail[idx]; + } break; } return ret; diff --git a/arm9/src/mail_message.c b/arm9/src/mail_message.c index e55c5d927..492194975 100644 --- a/arm9/src/mail_message.c +++ b/arm9/src/mail_message.c @@ -1,13 +1,16 @@ -#include "global.h" #include "mail_message.h" + +#include "global.h" + +#include "constants/easy_chat.h" + +#include "msgdata/msg.naix" + #include "message_format.h" #include "msgdata.h" -#include "msgdata/msg.naix" #include "string_control_code.h" -#include "constants/easy_chat.h" -struct UnkStruct_020ED556 -{ +struct UnkStruct_020ED556 { u8 unk_0; u8 unk_1; s16 unk_2; @@ -27,175 +30,155 @@ static const u16 sMessageBanks[] = { }; const struct UnkStruct_020ED556 UNK_020ED556[] = { - { 0, 0, 0x184, 7, -1, 0 }, + { 0, 0, 0x184, 7, -1, 0 }, { 1, 0, 0x184, 33, -1, 0 }, { 2, 0, 0x188, 10, -1, 0 }, - { 1, 4, 0x184, 1, -1, 0 } + { 1, 4, 0x184, 1, -1, 0 } }; -void MailMsg_Init(struct MailMessage * mailMsg) -{ +void MailMsg_Init(struct MailMessage *mailMsg) { s32 i; mailMsg->msg_bank = MAILMSG_BANK_NONE; - for (i = 0; i < 2; i++) - { + for (i = 0; i < 2; i++) { mailMsg->fields[i] = EC_WORD_NULL; } } -void MailMsg_Init_WithBank(struct MailMessage * mailMsg, u16 bank) -{ +void MailMsg_Init_WithBank(struct MailMessage *mailMsg, u16 bank) { s32 i; mailMsg->msg_bank = bank; - mailMsg->msg_no = 0; - for (i = 0; i < MAILMSG_FIELDS_MAX; i++) - { + mailMsg->msg_no = 0; + for (i = 0; i < MAILMSG_FIELDS_MAX; i++) { mailMsg->fields[i] = EC_WORD_NULL; } } -void MailMsg_Init_Default(struct MailMessage * mailMsg) -{ +void MailMsg_Init_Default(struct MailMessage *mailMsg) { MailMsg_Init_WithBank(mailMsg, 4); mailMsg->msg_no = 5; } -void MailMsg_Init_FromTemplate(struct MailMessage * mailMsg, u32 a1) -{ +void MailMsg_Init_FromTemplate(struct MailMessage *mailMsg, u32 a1) { GF_ASSERT(a1 < 4); - if (a1 < 4) - { + if (a1 < 4) { MailMsg_Init_WithBank(mailMsg, UNK_020ED556[a1].unk_0); mailMsg->msg_no = UNK_020ED556[a1].unk_1; - if (UNK_020ED556[a1].unk_2 != -1) + if (UNK_020ED556[a1].unk_2 != -1) { mailMsg->fields[0] = GetECWordIndexByPair(UNK_020ED556[a1].unk_2, UNK_020ED556[a1].unk_4); - if (UNK_020ED556[a1].unk_6 != -1) + } + if (UNK_020ED556[a1].unk_6 != -1) { mailMsg->fields[1] = GetECWordIndexByPair(UNK_020ED556[a1].unk_6, UNK_020ED556[a1].unk_8); + } } } -struct String * MailMsg_GetExpandedString(struct MailMessage * mailMsg, HeapID heapId) -{ +struct String *MailMsg_GetExpandedString(struct MailMessage *mailMsg, HeapID heapId) { s32 i; - MessageFormat * messageFormat = MessageFormat_New(heapId); - struct MsgData * msgData; - struct String * ret; - for (i = 0; i < MAILMSG_FIELDS_MAX; i++) - { - if (mailMsg->fields[i] == EC_WORD_NULL) + MessageFormat *messageFormat = MessageFormat_New(heapId); + struct MsgData *msgData; + struct String *ret; + for (i = 0; i < MAILMSG_FIELDS_MAX; i++) { + if (mailMsg->fields[i] == EC_WORD_NULL) { break; + } BufferECWord(messageFormat, (u32)i, mailMsg->fields[i]); } msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, sMessageBanks[mailMsg->msg_bank], heapId); - ret = ReadMsgData_ExpandPlaceholders(messageFormat, msgData, mailMsg->msg_no, heapId); + ret = ReadMsgData_ExpandPlaceholders(messageFormat, msgData, mailMsg->msg_no, heapId); DestroyMsgData(msgData); MessageFormat_Delete(messageFormat); return ret; } -struct String * MailMsg_GetRawString(struct MailMessage * mailMsg, HeapID heapId) -{ +struct String *MailMsg_GetRawString(struct MailMessage *mailMsg, HeapID heapId) { return ReadMsgData_NewNarc_NewString(NARC_MSGDATA_MSG, sMessageBanks[mailMsg->msg_bank], mailMsg->msg_no, heapId); } -BOOL MailMsg_IsInit(struct MailMessage * mailMsg) -{ +BOOL MailMsg_IsInit(struct MailMessage *mailMsg) { return mailMsg->msg_bank != MAILMSG_BANK_NONE; } -BOOL MailMsg_AllFieldsAreInit(struct MailMessage * mailMsg) -{ +BOOL MailMsg_AllFieldsAreInit(struct MailMessage *mailMsg) { s32 i; u32 n = MailMsg_NumFields(mailMsg->msg_bank, mailMsg->msg_no); - for (i = 0; i < n; i++) - { - if (mailMsg->fields[i] == EC_WORD_NULL) + for (i = 0; i < n; i++) { + if (mailMsg->fields[i] == EC_WORD_NULL) { return FALSE; + } } return TRUE; } -u32 MailMsg_NumFields(u16 bank, u16 num) -{ - struct String * str; - const u16 * cstr; +u32 MailMsg_NumFields(u16 bank, u16 num) { + struct String *str; + const u16 *cstr; u32 count; GF_ASSERT(bank < NELEMS(sMessageBanks)); GF_ASSERT(num < MailMsg_NumMsgsInBank(bank)); - str = ReadMsgData_NewNarc_NewString(NARC_MSGDATA_MSG, sMessageBanks[bank], num, HEAP_ID_DEFAULT); - cstr = String_c_str(str); + str = ReadMsgData_NewNarc_NewString(NARC_MSGDATA_MSG, sMessageBanks[bank], num, HEAP_ID_DEFAULT); + cstr = String_c_str(str); count = 0; - while (*cstr != EOS) - { - if (*cstr == EXT_CTRL_CODE_BEGIN) - { - if (MsgArray_ControlCodeIsStrVar(cstr)) + while (*cstr != EOS) { + if (*cstr == EXT_CTRL_CODE_BEGIN) { + if (MsgArray_ControlCodeIsStrVar(cstr)) { count++; + } cstr = MsgArray_SkipControlCode(cstr); - } - else + } else { cstr++; + } } String_Delete(str); return count; } -u16 MailMsg_GetFieldI(struct MailMessage * mailMsg, u32 a1) -{ +u16 MailMsg_GetFieldI(struct MailMessage *mailMsg, u32 a1) { return mailMsg->fields[a1]; } -u16 MailMsg_GetMsgBank(struct MailMessage * mailMsg) -{ +u16 MailMsg_GetMsgBank(struct MailMessage *mailMsg) { return mailMsg->msg_bank; } -u16 MailMsg_GetMsgNo(struct MailMessage * mailMsg) -{ +u16 MailMsg_GetMsgNo(struct MailMessage *mailMsg) { return mailMsg->msg_no; } -BOOL MailMsg_Compare(const struct MailMessage *mailMsg, const struct MailMessage *a1) -{ +BOOL MailMsg_Compare(const struct MailMessage *mailMsg, const struct MailMessage *a1) { s32 i; - if (mailMsg->msg_bank != a1->msg_bank || mailMsg->msg_no != a1->msg_no) + if (mailMsg->msg_bank != a1->msg_bank || mailMsg->msg_no != a1->msg_no) { return FALSE; - for (i = 0; i < MAILMSG_FIELDS_MAX; i++) - { - if (mailMsg->fields[i] != a1->fields[i]) + } + for (i = 0; i < MAILMSG_FIELDS_MAX; i++) { + if (mailMsg->fields[i] != a1->fields[i]) { return FALSE; + } } return TRUE; } -void MailMsg_Copy(struct MailMessage * mailMsg, const struct MailMessage * a1) -{ +void MailMsg_Copy(struct MailMessage *mailMsg, const struct MailMessage *a1) { *mailMsg = *a1; } -u32 MailMsg_NumMsgsInBank(u16 bank) -{ +u32 MailMsg_NumMsgsInBank(u16 bank) { return (u32)((bank < NELEMS(sMessageBanks)) ? 20 : 0); } -void MailMsg_SetMsgBankAndNum(struct MailMessage * mailMsg, u16 bank, u16 num) -{ +void MailMsg_SetMsgBankAndNum(struct MailMessage *mailMsg, u16 bank, u16 num) { GF_ASSERT(bank < NELEMS(sMessageBanks)); mailMsg->msg_bank = bank; - mailMsg->msg_no = num; + mailMsg->msg_no = num; } -void MailMsg_SetFieldI(struct MailMessage * mailMsg, u32 idx, u16 word) -{ +void MailMsg_SetFieldI(struct MailMessage *mailMsg, u32 idx, u16 word) { GF_ASSERT(idx < MAILMSG_FIELDS_MAX); mailMsg->fields[idx] = word; } -void MailMsg_SetTrailingFieldsEmpty(struct MailMessage * mailMsg) -{ +void MailMsg_SetTrailingFieldsEmpty(struct MailMessage *mailMsg) { u32 n; - for (n = MailMsg_NumFields(mailMsg->msg_bank, mailMsg->msg_no); n < MAILMSG_FIELDS_MAX; n++) - { + for (n = MailMsg_NumFields(mailMsg->msg_bank, mailMsg->msg_no); n < MAILMSG_FIELDS_MAX; n++) { mailMsg->fields[n] = EC_WORD_NULL; } } diff --git a/arm9/src/main.c b/arm9/src/main.c index d8f850f7b..a5a73769d 100644 --- a/arm9/src/main.c +++ b/arm9/src/main.c @@ -1,26 +1,28 @@ #define IN_MAIN_C +#include "main.h" + #include "global.h" -#include "SPI_pm.h" + #include "CARD_backup.h" #include "CARD_pullOut.h" #include "CTRDG_common.h" -#include "communication_error.h" #include "PAD_pad.h" -#include "main.h" +#include "SPI_pm.h" +#include "brightness.h" +#include "communication_error.h" +#include "font.h" #include "game_init.h" -#include "poke_overlay.h" +#include "heap.h" +#include "overlay_52.h" #include "player_data.h" +#include "poke_overlay.h" #include "save_data_read_error.h" #include "sound.h" #include "timer3.h" -#include "unk_02031734.h" #include "unk_0202F150.h" +#include "unk_02031734.h" #include "wfc_user_info_warning.h" -#include "overlay_52.h" -#include "font.h" -#include "brightness.h" -#include "heap.h" FS_EXTERN_OVERLAY(OVERLAY_52); FS_EXTERN_OVERLAY(OVERLAY_63); @@ -46,11 +48,9 @@ extern struct OverlayManagerTemplate ov63_021DBE18; extern u8 SDK_STATIC_BSS_START[]; const int gGameLanguage = GAME_LANGUAGE; -const int gGameVersion = GAME_VERSION; +const int gGameVersion = GAME_VERSION; -__declspec(noreturn) -void NitroMain(void) -{ +__declspec(noreturn) void NitroMain(void) { InitSystemForTheGame(); InitGraphicMemory(); InitKeypadAndTouchpad(); @@ -66,19 +66,16 @@ void NitroMain(void) sub_02002C50(1, HEAP_ID_MAIN); sub_02002C50(3, HEAP_ID_MAIN); UNK_02016FA8.unk10 = -1; - UNK_02016FA8.save = SaveData_New(); + UNK_02016FA8.save = SaveData_New(); InitSoundData(Save_Chatot_Get(UNK_02016FA8.save), Save_PlayerData_GetOptionsAddr(UNK_02016FA8.save)); Init_Timer3(); - if (sub_020337E8(3) == 3) + if (sub_020337E8(3) == 3) { ShowWFCUserInfoWarning(HEAP_ID_MAIN, 0); - if (sub_020227FC(UNK_02016FA8.save) == 0) - { - ShowSaveDataReadError(HEAP_ID_DEFAULT); } - else - { - switch (OS_GetResetParameter()) - { + if (sub_020227FC(UNK_02016FA8.save) == 0) { + ShowSaveDataReadError(HEAP_ID_DEFAULT); + } else { + switch (OS_GetResetParameter()) { case 0: // Title Demo UNK_02016FA8.unk14 = 0; @@ -100,8 +97,7 @@ void NitroMain(void) ScreenBrightnessData_InitAll(); PlayTimerInit(); UNK_02016FA4 = 0; - for (;;) - { + for (;;) { sub_02000EE8(); HandleDSLidAction(); ReadKeypadAndTocuhpad(); @@ -109,13 +105,11 @@ void NitroMain(void) { DoSoftReset(0); // soft reset? } - if (sub_0202FB80()) - { + if (sub_0202FB80()) { Main_RunOverlayManager(); sub_0201B5CC(gSystem.unk18); sub_0201B5CC(gSystem.unk24); - if (!gSystem.unk30) - { + if (!gSystem.unk30) { OS_WaitIrq(1, 1); gSystem.unk2C++; } @@ -129,74 +123,69 @@ void NitroMain(void) gSystem.unk30 = 0; DoAllScreenBrightnessTransitionStep(); sub_0200E2D8(); - if (gSystem.vBlankIntr) + if (gSystem.vBlankIntr) { gSystem.vBlankIntr(gSystem.vBlankIntrArg); + } DoSoundUpdateFrame(); sub_0201B5CC(gSystem.unk20); } } -void sub_02000DF4(void) -{ - UNK_02016FA8.mainOverlayId = SDK_OVERLAY_INVALID_ID; - UNK_02016FA8.overlayManager = NULL; +void sub_02000DF4(void) { + UNK_02016FA8.mainOverlayId = SDK_OVERLAY_INVALID_ID; + UNK_02016FA8.overlayManager = NULL; UNK_02016FA8.queuedMainOverlayId = SDK_OVERLAY_INVALID_ID; // overlay invalid - UNK_02016FA8.template = NULL; + UNK_02016FA8.template = NULL; } -void Main_RunOverlayManager(void) -{ - if (UNK_02016FA8.overlayManager == NULL) - { - if (UNK_02016FA8.template == NULL) +void Main_RunOverlayManager(void) { + if (UNK_02016FA8.overlayManager == NULL) { + if (UNK_02016FA8.template == NULL) { return; - if (UNK_02016FA8.queuedMainOverlayId != SDK_OVERLAY_INVALID_ID) + } + if (UNK_02016FA8.queuedMainOverlayId != SDK_OVERLAY_INVALID_ID) { HandleLoadOverlay(UNK_02016FA8.queuedMainOverlayId, 0); - UNK_02016FA8.mainOverlayId = UNK_02016FA8.queuedMainOverlayId; - UNK_02016FA8.overlayManager = OverlayManager_New(UNK_02016FA8.template, &UNK_02016FA8.unk10, HEAP_ID_DEFAULT); + } + UNK_02016FA8.mainOverlayId = UNK_02016FA8.queuedMainOverlayId; + UNK_02016FA8.overlayManager = OverlayManager_New(UNK_02016FA8.template, &UNK_02016FA8.unk10, HEAP_ID_DEFAULT); UNK_02016FA8.queuedMainOverlayId = SDK_OVERLAY_INVALID_ID; - UNK_02016FA8.template = NULL; + UNK_02016FA8.template = NULL; } - if (OverlayManager_Run(UNK_02016FA8.overlayManager)) - { + if (OverlayManager_Run(UNK_02016FA8.overlayManager)) { OverlayManager_Delete(UNK_02016FA8.overlayManager); UNK_02016FA8.overlayManager = NULL; - if (UNK_02016FA8.mainOverlayId != SDK_OVERLAY_INVALID_ID) + if (UNK_02016FA8.mainOverlayId != SDK_OVERLAY_INVALID_ID) { UnloadOverlayByID(UNK_02016FA8.mainOverlayId); + } } } -void RegisterMainOverlay(FSOverlayID id, const struct OverlayManagerTemplate *template) -{ +void RegisterMainOverlay(FSOverlayID id, const struct OverlayManagerTemplate *template) { GF_ASSERT(UNK_02016FA8.template == NULL); UNK_02016FA8.queuedMainOverlayId = id; - UNK_02016FA8.template = template; + UNK_02016FA8.template = template; } -void sub_02000E9C(void) -{ +void sub_02000E9C(void) { sub_0202FB80(); OS_WaitIrq(TRUE, OS_IE_VBLANK); gSystem.unk2C++; gSystem.unk30 = 0; - if (gSystem.vBlankIntr != NULL) + if (gSystem.vBlankIntr != NULL) { gSystem.vBlankIntr(gSystem.vBlankIntrArg); + } } -void sub_02000EC8(u32 parameter) -{ - if (sub_02033678() && CARD_TryWaitBackupAsync() == TRUE) - { +void sub_02000EC8(u32 parameter) { + if (sub_02033678() && CARD_TryWaitBackupAsync() == TRUE) { OS_ResetSystem(parameter); } sub_02000E9C(); } -void sub_02000EE8(void) -{ +void sub_02000EE8(void) { u32 r1 = sub_020335B8(); - switch (r1) - { + switch (r1) { case 1: sub_02000F4C(1, r1); break; @@ -211,43 +200,33 @@ void sub_02000EE8(void) extern void sub_0200E3A0(PMLCDTarget, int); -__declspec(noreturn) -void DoSoftReset(u32 parameter) -{ +__declspec(noreturn) void DoSoftReset(u32 parameter) { sub_0200E3A0(PM_LCD_TOP, 0x7FFF); sub_0200E3A0(PM_LCD_BOTTOM, 0x7FFF); - if (sub_02032DAC()) - { + if (sub_02032DAC()) { sub_0202287C(sub_020225F8()); } - do - { + do { HandleDSLidAction(); sub_02000EC8(parameter); } while (1); } -void sub_02000F4C(u32 arg0, u32 arg1) -{ - if (arg1 == 3) - { +void sub_02000F4C(u32 arg0, u32 arg1) { + if (arg1 == 3) { ShowCommunicationError(HEAP_ID_DEFAULT, 3, 0); - } - else if (arg0 == 0) - { + } else if (arg0 == 0) { ShowCommunicationError(HEAP_ID_DEFAULT, 2, 0); - } - else - { + } else { ShowCommunicationError(HEAP_ID_DEFAULT, 0, 0); } sub_02032DAC(); - while (TRUE) - { + while (TRUE) { HandleDSLidAction(); ReadKeypadAndTocuhpad(); - if (gSystem.newKeys & 1) + if (gSystem.newKeys & 1) { break; + } sub_02000E9C(); } DoSoftReset(arg0); @@ -257,8 +236,7 @@ extern void GF_RTC_CopyDateTime(struct Unk21C4818 *, struct Unk21C4828 *); extern void SetMTRNGSeed(u32); extern void SetLCRNGSeed(u32); -void InitializeMainRNG(void) -{ +void InitializeMainRNG(void) { struct Unk21C4818 spC; struct Unk21C4828 sp0; GF_RTC_CopyDateTime(&spC, &sp0); @@ -273,53 +251,44 @@ void InitializeMainRNG(void) extern void sub_0201CE04(void); extern void sub_0201CDD0(void); -void HandleDSLidAction(void) -{ +void HandleDSLidAction(void) { PMBackLightSwitch top, bottom; - if (PAD_DetectFold()) - { - if (!gSystem.unk67) - { + if (PAD_DetectFold()) { + if (!gSystem.unk67) { sub_0201CE04(); - if (CTRDG_IsPulledOut() == TRUE) - { + if (CTRDG_IsPulledOut() == TRUE) { UNK_02016FA4 = 1; } { int r1 = UNK_02016FA4; - while (1) - { + while (1) { PMWakeUpTrigger trigger = PM_TRIGGER_COVER_OPEN | PM_TRIGGER_CARD; - if (gSystem.gbaCartId && !r1) + if (gSystem.gbaCartId && !r1) { trigger |= PM_TRIGGER_CARTRIDGE; + } PM_GoSleepMode(trigger, PM_PAD_LOGIC_OR, 0); - if (CARD_IsPulledOut()) - { + if (CARD_IsPulledOut()) { PM_ForceToPowerOff(); break; - } - else if (PAD_DetectFold()) - { + } else if (PAD_DetectFold()) { r1 = UNK_02016FA4 = 1; - } - else + } else { break; + } } sub_0201CDD0(); return; } - } - else - { + } else { PM_GetBackLight(&top, &bottom); - if (top == PM_BACKLIGHT_ON) + if (top == PM_BACKLIGHT_ON) { PM_SetBackLight(PM_LCD_ALL, PM_BACKLIGHT_OFF); + } } - } - else - { + } else { PM_GetBackLight(&top, &bottom); - if (top == PM_BACKLIGHT_OFF) + if (top == PM_BACKLIGHT_OFF) { PM_SetBackLight(PM_LCD_ALL, gBacklightTop); + } } } diff --git a/arm9/src/map_header.c b/arm9/src/map_header.c index 99b8b172c..71b733f97 100644 --- a/arm9/src/map_header.c +++ b/arm9/src/map_header.c @@ -1,19 +1,23 @@ -#include "global.h" #include "map_header.h" + +#include "global.h" + #include "constants/map_sections.h" -#include "pokemon.h" -#include "msgdata/msg.naix" -#include "fielddata/script/scr_seq_release.naix" +#include "constants/maps.h" +#include "constants/sndseq.h" + #include "fielddata/areadata/area_data.naix" -#include "fielddata/mm_list/move_model_list.naix" -#include "fielddata/eventdata/zone_event_release.naix" #include "fielddata/encountdata/d_enc_data.naix" #include "fielddata/encountdata/p_enc_data.naix" +#include "fielddata/eventdata/zone_event_release.naix" #include "fielddata/mapmatrix/map_matrix.naix" -#include "constants/sndseq.h" -#include "constants/maps.h" +#include "fielddata/mm_list/move_model_list.naix" +#include "fielddata/script/scr_seq_release.naix" +#include "msgdata/msg.naix" -#define ENCDATA(dia,pea) ((GAME_VERSION == VERSION_DIAMOND) ? (dia) : (pea)) +#include "pokemon.h" + +#define ENCDATA(dia, pea) ((GAME_VERSION == VERSION_DIAMOND) ? (dia) : (pea)) // Static decls u32 MapNumberBoundsCheck(u32 mapno); @@ -40,801 +44,786 @@ static const u16 sPokemonCenterSecondFloorMaps[] = { }; static const u16 sMapEvolutionMethods[] = { - MAP_R217, EVO_ROUTE217, - MAP_D03R0101, EVO_ETERNA, - MAP_D05R0101, EVO_CORONET, - MAP_D05R0102, EVO_CORONET, - MAP_D05R0103, EVO_CORONET, - MAP_D05R0104, EVO_CORONET, - MAP_D05R0105, EVO_CORONET, - MAP_D05R0106, EVO_CORONET, - MAP_D05R0107, EVO_CORONET, - MAP_D05R0108, EVO_CORONET, - MAP_D05R0109, EVO_CORONET, - MAP_D05R0110, EVO_CORONET, - MAP_D05R0111, EVO_CORONET, - MAP_D05R0112, EVO_CORONET, - MAP_D05R0113, EVO_CORONET, - MAP_D05R0114, EVO_CORONET, - MAP_D05R0115, EVO_CORONET, + MAP_R217, + EVO_ROUTE217, + MAP_D03R0101, + EVO_ETERNA, + MAP_D05R0101, + EVO_CORONET, + MAP_D05R0102, + EVO_CORONET, + MAP_D05R0103, + EVO_CORONET, + MAP_D05R0104, + EVO_CORONET, + MAP_D05R0105, + EVO_CORONET, + MAP_D05R0106, + EVO_CORONET, + MAP_D05R0107, + EVO_CORONET, + MAP_D05R0108, + EVO_CORONET, + MAP_D05R0109, + EVO_CORONET, + MAP_D05R0110, + EVO_CORONET, + MAP_D05R0111, + EVO_CORONET, + MAP_D05R0112, + EVO_CORONET, + MAP_D05R0113, + EVO_CORONET, + MAP_D05R0114, + EVO_CORONET, + MAP_D05R0115, + EVO_CORONET, }; static const struct MapHeader sMapHeaders[] = { - {NARC_area_data_narc_0000_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, TRUE, FALSE}, // MAP_EVERYWHERE - {NARC_area_data_narc_0000_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 0, 3, FALSE, FALSE, FALSE, FALSE}, // MAP_NOTHING - {NARC_area_data_narc_0002_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0002_bin, NARC_scr_seq_release_narc_1043_bin, NARC_scr_seq_release_narc_0970_bin, NARC_msg_narc_0566_bin, SEQ_TANKOU, SEQ_TANKOU, 0xFFFF, NARC_zone_event_release_narc_0001_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 6, 3, FALSE, FALSE, FALSE, FALSE}, // MAP_UG - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0002_bin, NARC_scr_seq_release_narc_0465_bin, NARC_msg_narc_0018_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0002_bin, MAPSEC_JUBILIFE_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C01 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0003_bin, NARC_scr_seq_release_narc_0466_bin, NARC_msg_narc_0019_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0003_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01FS0101 - {NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0004_bin, NARC_scr_seq_release_narc_0467_bin, NARC_msg_narc_0020_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0004_bin, MAPSEC_JUBILIFE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01GYM0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0005_bin, NARC_scr_seq_release_narc_0468_bin, NARC_msg_narc_0021_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0005_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0006_bin, NARC_scr_seq_release_narc_0469_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0006_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01PC0102 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0141_bin, NARC_scr_seq_release_narc_0008_bin, NARC_scr_seq_release_narc_0471_bin, NARC_msg_narc_0022_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0007_bin, MAPSEC_POKETCH_CO, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0142_bin, NARC_scr_seq_release_narc_0009_bin, NARC_scr_seq_release_narc_0472_bin, NARC_msg_narc_0023_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0008_bin, MAPSEC_POKETCH_CO, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0102 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0143_bin, NARC_scr_seq_release_narc_0010_bin, NARC_scr_seq_release_narc_0473_bin, NARC_msg_narc_0024_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0009_bin, MAPSEC_POKETCH_CO, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0103 - {NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0148_bin, NARC_scr_seq_release_narc_0011_bin, NARC_scr_seq_release_narc_0474_bin, NARC_msg_narc_0025_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0010_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0201 - {NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0149_bin, NARC_scr_seq_release_narc_0012_bin, NARC_scr_seq_release_narc_0475_bin, NARC_msg_narc_0026_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0011_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0202 - {NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0150_bin, NARC_scr_seq_release_narc_0013_bin, NARC_scr_seq_release_narc_0476_bin, NARC_msg_narc_0027_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0012_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0203 - {NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0151_bin, NARC_scr_seq_release_narc_0014_bin, NARC_scr_seq_release_narc_0477_bin, NARC_msg_narc_0028_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0013_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0204 - {NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0152_bin, NARC_scr_seq_release_narc_0015_bin, NARC_scr_seq_release_narc_0478_bin, NARC_msg_narc_0029_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0014_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0205 - {NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0153_bin, NARC_scr_seq_release_narc_0016_bin, NARC_scr_seq_release_narc_0479_bin, NARC_msg_narc_0030_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0015_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0206 - {NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0154_bin, NARC_scr_seq_release_narc_0017_bin, NARC_scr_seq_release_narc_0480_bin, NARC_msg_narc_0031_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0016_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0207 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0018_bin, NARC_scr_seq_release_narc_0481_bin, NARC_msg_narc_0032_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0017_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0208 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0019_bin, NARC_scr_seq_release_narc_0482_bin, NARC_msg_narc_0033_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0018_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0301 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0020_bin, NARC_scr_seq_release_narc_0483_bin, NARC_msg_narc_0034_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0019_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0302 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0021_bin, NARC_scr_seq_release_narc_0484_bin, NARC_msg_narc_0035_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0020_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0303 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0021_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0304 - {NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0023_bin, NARC_scr_seq_release_narc_0486_bin, NARC_msg_narc_0036_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0022_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0401 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0024_bin, NARC_scr_seq_release_narc_0487_bin, NARC_msg_narc_0037_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0023_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0501 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0025_bin, NARC_scr_seq_release_narc_0488_bin, NARC_msg_narc_0038_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0024_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0502 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0026_bin, NARC_scr_seq_release_narc_0489_bin, NARC_msg_narc_0039_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0025_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0503 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0027_bin, NARC_scr_seq_release_narc_0490_bin, NARC_msg_narc_0040_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0026_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0504 - {NARC_area_data_narc_0040_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0205_bin, NARC_scr_seq_release_narc_0028_bin, NARC_scr_seq_release_narc_0491_bin, NARC_msg_narc_0041_bin, SEQ_BLD_BLD_GTC, SEQ_BLD_BLD_GTC, 0xFFFF, NARC_zone_event_release_narc_0027_bin, MAPSEC_GTS, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0601 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0140_bin, NARC_scr_seq_release_narc_0029_bin, NARC_scr_seq_release_narc_0492_bin, NARC_msg_narc_0042_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0028_bin, MAPSEC_TRAINERS_SCHOOL, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0701 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0030_bin, NARC_scr_seq_release_narc_0493_bin, NARC_msg_narc_0043_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0029_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0801 - {NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0032_bin, NARC_scr_seq_release_narc_0495_bin, NARC_msg_narc_0045_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0030_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0901 - {NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0033_bin, NARC_scr_seq_release_narc_0496_bin, NARC_msg_narc_0046_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0031_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R1001 - {NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0009_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0034_bin, NARC_scr_seq_release_narc_0497_bin, NARC_msg_narc_0047_bin, SEQ_CITY02_D, SEQ_CITY02_N, ENCDATA(NARC_d_enc_data_narc_0000_bin, NARC_p_enc_data_narc_0000_bin), NARC_zone_event_release_narc_0032_bin, MAPSEC_CANALAVE_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C02 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0035_bin, NARC_scr_seq_release_narc_0498_bin, NARC_msg_narc_0048_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0033_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02FS0101 - {NARC_area_data_narc_0024_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0112_bin, NARC_scr_seq_release_narc_0036_bin, NARC_scr_seq_release_narc_0499_bin, NARC_msg_narc_0049_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0034_bin, MAPSEC_CANALAVE_CITY, 0, 3, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02GYM0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0037_bin, NARC_scr_seq_release_narc_0500_bin, NARC_msg_narc_0050_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0035_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0038_bin, NARC_scr_seq_release_narc_0501_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0036_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02PC0102 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0217_bin, NARC_scr_seq_release_narc_0040_bin, NARC_scr_seq_release_narc_0503_bin, NARC_msg_narc_0051_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0037_bin, MAPSEC_CANALAVE_LIBRARY, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0218_bin, NARC_scr_seq_release_narc_0041_bin, NARC_scr_seq_release_narc_0504_bin, NARC_msg_narc_0052_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0038_bin, MAPSEC_CANALAVE_LIBRARY, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0102 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0219_bin, NARC_scr_seq_release_narc_0042_bin, NARC_scr_seq_release_narc_0505_bin, NARC_msg_narc_0053_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0039_bin, MAPSEC_CANALAVE_LIBRARY, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0103 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0043_bin, NARC_scr_seq_release_narc_0506_bin, NARC_msg_narc_0054_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0040_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0044_bin, NARC_scr_seq_release_narc_0507_bin, NARC_msg_narc_0055_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0041_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0301 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0045_bin, NARC_scr_seq_release_narc_0508_bin, NARC_msg_narc_0056_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0042_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0046_bin, NARC_scr_seq_release_narc_0509_bin, NARC_msg_narc_0057_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0043_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0501 - {NARC_area_data_narc_0007_bin, NARC_move_model_list_narc_0001_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0048_bin, NARC_scr_seq_release_narc_0511_bin, NARC_msg_narc_0058_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0044_bin, MAPSEC_OREBURGH_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C03 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0049_bin, NARC_scr_seq_release_narc_0512_bin, NARC_msg_narc_0059_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0045_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03FS0101 - {NARC_area_data_narc_0025_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0113_bin, NARC_scr_seq_release_narc_0050_bin, NARC_scr_seq_release_narc_0513_bin, NARC_msg_narc_0060_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0046_bin, MAPSEC_OREBURGH_CITY, 0, 9, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03GYM0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0051_bin, NARC_scr_seq_release_narc_0514_bin, NARC_msg_narc_0061_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0047_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0052_bin, NARC_scr_seq_release_narc_0515_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0048_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03PC0102 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0054_bin, NARC_scr_seq_release_narc_0517_bin, NARC_msg_narc_0063_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0049_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0055_bin, NARC_scr_seq_release_narc_0518_bin, NARC_msg_narc_0064_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0050_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0102 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0136_bin, NARC_scr_seq_release_narc_0056_bin, NARC_scr_seq_release_narc_0519_bin, NARC_msg_narc_0065_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0051_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0103 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0057_bin, NARC_scr_seq_release_narc_0520_bin, NARC_msg_narc_0066_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0052_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0104 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0058_bin, NARC_scr_seq_release_narc_0521_bin, NARC_msg_narc_0067_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0053_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0201 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0059_bin, NARC_scr_seq_release_narc_0522_bin, NARC_msg_narc_0068_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0054_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0202 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0136_bin, NARC_scr_seq_release_narc_0060_bin, NARC_scr_seq_release_narc_0523_bin, NARC_msg_narc_0069_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0055_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0203 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0061_bin, NARC_scr_seq_release_narc_0524_bin, NARC_msg_narc_0070_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0056_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0204 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0062_bin, NARC_scr_seq_release_narc_0525_bin, NARC_msg_narc_0071_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0057_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0301 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0155_bin, NARC_scr_seq_release_narc_0063_bin, NARC_scr_seq_release_narc_0526_bin, NARC_msg_narc_0072_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0058_bin, MAPSEC_MINING_MUSEUM, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0064_bin, NARC_scr_seq_release_narc_0527_bin, NARC_msg_narc_0073_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0059_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0501 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0065_bin, NARC_scr_seq_release_narc_0528_bin, NARC_msg_narc_0074_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0060_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0601 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0066_bin, NARC_scr_seq_release_narc_0529_bin, NARC_msg_narc_0075_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0061_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0602 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0067_bin, NARC_scr_seq_release_narc_0530_bin, NARC_msg_narc_0076_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0062_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0603 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0068_bin, NARC_scr_seq_release_narc_0531_bin, NARC_msg_narc_0077_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0063_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03R0701 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0069_bin, NARC_scr_seq_release_narc_0532_bin, NARC_msg_narc_0078_bin, SEQ_CITY04_D, SEQ_CITY04_N, ENCDATA(NARC_d_enc_data_narc_0001_bin, NARC_p_enc_data_narc_0001_bin), NARC_zone_event_release_narc_0064_bin, MAPSEC_ETERNA_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C04 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0070_bin, NARC_scr_seq_release_narc_0533_bin, NARC_msg_narc_0079_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0065_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04FS0101 - {NARC_area_data_narc_0026_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0220_bin, NARC_scr_seq_release_narc_0071_bin, NARC_scr_seq_release_narc_0534_bin, NARC_msg_narc_0080_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0066_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04GYM0101 - {NARC_area_data_narc_0026_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0221_bin, NARC_scr_seq_release_narc_0072_bin, NARC_scr_seq_release_narc_0535_bin, NARC_msg_narc_0081_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0067_bin, MAPSEC_ETERNA_CITY, 0, 9, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04GYM0102 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0073_bin, NARC_scr_seq_release_narc_0536_bin, NARC_msg_narc_0082_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0068_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0074_bin, NARC_scr_seq_release_narc_0537_bin, NARC_msg_narc_0083_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0069_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04PC0102 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0138_bin, NARC_scr_seq_release_narc_0076_bin, NARC_scr_seq_release_narc_0539_bin, NARC_msg_narc_0084_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0070_bin, MAPSEC_CYCLE_SHOP, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0077_bin, NARC_scr_seq_release_narc_0540_bin, NARC_msg_narc_0085_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0071_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0201 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0133_bin, NARC_scr_seq_release_narc_0078_bin, NARC_scr_seq_release_narc_0541_bin, NARC_msg_narc_0086_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0072_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0202 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0134_bin, NARC_scr_seq_release_narc_0079_bin, NARC_scr_seq_release_narc_0542_bin, NARC_msg_narc_0087_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0073_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0203 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0080_bin, NARC_scr_seq_release_narc_0543_bin, NARC_msg_narc_0088_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0074_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0204 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0081_bin, NARC_scr_seq_release_narc_0544_bin, NARC_msg_narc_0089_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0075_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0301 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0135_bin, NARC_scr_seq_release_narc_0082_bin, NARC_scr_seq_release_narc_0545_bin, NARC_msg_narc_0090_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0076_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0302 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0083_bin, NARC_scr_seq_release_narc_0546_bin, NARC_msg_narc_0091_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0077_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0303 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0084_bin, NARC_scr_seq_release_narc_0547_bin, NARC_msg_narc_0092_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0078_bin, MAPSEC_ETERNA_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0304 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0159_bin, NARC_scr_seq_release_narc_0085_bin, NARC_scr_seq_release_narc_0548_bin, NARC_msg_narc_0093_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0079_bin, MAPSEC_ROUTE_206, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0170_bin, NARC_scr_seq_release_narc_0086_bin, NARC_scr_seq_release_narc_0549_bin, NARC_msg_narc_0094_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0080_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0501 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0087_bin, NARC_scr_seq_release_narc_0550_bin, NARC_msg_narc_0095_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0081_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0601 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0088_bin, NARC_scr_seq_release_narc_0551_bin, NARC_msg_narc_0096_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0082_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0701 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0089_bin, NARC_scr_seq_release_narc_0552_bin, NARC_msg_narc_0097_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0083_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0801 - {NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0084_bin, MAPSEC_ETERNA_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04R0901 - {NARC_area_data_narc_0009_bin, NARC_move_model_list_narc_0003_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0090_bin, NARC_scr_seq_release_narc_0553_bin, NARC_msg_narc_0098_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0085_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C05 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0091_bin, NARC_scr_seq_release_narc_0554_bin, NARC_msg_narc_0099_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0086_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05FS0101 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0222_bin, NARC_scr_seq_release_narc_0092_bin, NARC_scr_seq_release_narc_0555_bin, NARC_msg_narc_0100_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0087_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0101 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0088_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0102 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0089_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0103 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0224_bin, NARC_scr_seq_release_narc_0093_bin, NARC_scr_seq_release_narc_0556_bin, NARC_msg_narc_0101_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0090_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0104 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0091_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0105 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0224_bin, NARC_scr_seq_release_narc_0094_bin, NARC_scr_seq_release_narc_0557_bin, NARC_msg_narc_0102_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0092_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0106 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0093_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0107 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0224_bin, NARC_scr_seq_release_narc_0095_bin, NARC_scr_seq_release_narc_0558_bin, NARC_msg_narc_0103_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0094_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0108 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0095_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0109 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0096_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0110 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0097_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0111 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0098_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0112 - {NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0225_bin, NARC_scr_seq_release_narc_0096_bin, NARC_scr_seq_release_narc_0559_bin, NARC_msg_narc_0104_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0099_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05GYM0113 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0097_bin, NARC_scr_seq_release_narc_0560_bin, NARC_msg_narc_0105_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0100_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0098_bin, NARC_scr_seq_release_narc_0561_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0101_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05PC0102 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0209_bin, NARC_scr_seq_release_narc_0100_bin, NARC_scr_seq_release_narc_0563_bin, NARC_msg_narc_0106_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0102_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0210_bin, NARC_scr_seq_release_narc_0101_bin, NARC_scr_seq_release_narc_0564_bin, NARC_msg_narc_0107_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0103_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0102 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0102_bin, NARC_scr_seq_release_narc_0565_bin, NARC_msg_narc_0108_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0104_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0103 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0156_bin, NARC_scr_seq_release_narc_0103_bin, NARC_scr_seq_release_narc_0566_bin, NARC_msg_narc_0109_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0105_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0201 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0104_bin, NARC_scr_seq_release_narc_0567_bin, NARC_msg_narc_0110_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0106_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0301 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0105_bin, NARC_scr_seq_release_narc_0568_bin, NARC_msg_narc_0111_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0107_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0401 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0106_bin, NARC_scr_seq_release_narc_0569_bin, NARC_msg_narc_0112_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0108_bin, MAPSEC_ROUTE_208, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0501 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0107_bin, NARC_scr_seq_release_narc_0570_bin, NARC_msg_narc_0113_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0109_bin, MAPSEC_ROUTE_209, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0601 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0108_bin, NARC_scr_seq_release_narc_0571_bin, NARC_msg_narc_0114_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0110_bin, MAPSEC_ROUTE_212, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0701 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0209_bin, NARC_scr_seq_release_narc_0109_bin, NARC_scr_seq_release_narc_0572_bin, NARC_msg_narc_0115_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0111_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0801 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0210_bin, NARC_scr_seq_release_narc_0110_bin, NARC_scr_seq_release_narc_0573_bin, NARC_msg_narc_0116_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0112_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0802 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0111_bin, NARC_scr_seq_release_narc_0574_bin, NARC_msg_narc_0117_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0113_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0803 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0112_bin, NARC_scr_seq_release_narc_0575_bin, NARC_msg_narc_0118_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0114_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R0901 - {NARC_area_data_narc_0037_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0237_bin, NARC_scr_seq_release_narc_0113_bin, NARC_scr_seq_release_narc_0576_bin, NARC_msg_narc_0119_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0115_bin, MAPSEC_POFFIN_HOUSE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R1001 - {NARC_area_data_narc_0032_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0165_bin, NARC_scr_seq_release_narc_0114_bin, NARC_scr_seq_release_narc_0577_bin, NARC_msg_narc_0120_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0116_bin, MAPSEC_CONTEST_HALL, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R1101 - {NARC_area_data_narc_0032_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0166_bin, NARC_scr_seq_release_narc_0115_bin, NARC_scr_seq_release_narc_0578_bin, NARC_msg_narc_0018_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0117_bin, MAPSEC_CONTEST_HALL, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R1102 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0167_bin, NARC_scr_seq_release_narc_0117_bin, NARC_scr_seq_release_narc_0580_bin, NARC_msg_narc_0122_bin, SEQ_SILENCE_FIELD, SEQ_SILENCE_FIELD, 0xFFFF, NARC_zone_event_release_narc_0118_bin, MAPSEC_FOREIGN_BUILDING, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R1201 - {NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0118_bin, NARC_scr_seq_release_narc_0581_bin, NARC_msg_narc_0123_bin, SEQ_CITY06_D, SEQ_CITY06_N, ENCDATA(NARC_d_enc_data_narc_0002_bin, NARC_p_enc_data_narc_0002_bin), NARC_zone_event_release_narc_0119_bin, MAPSEC_PASTORIA_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C06 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0206_bin, NARC_scr_seq_release_narc_0119_bin, NARC_scr_seq_release_narc_0582_bin, NARC_msg_narc_0124_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0120_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06FS0101 - {NARC_area_data_narc_0023_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0111_bin, NARC_scr_seq_release_narc_0120_bin, NARC_scr_seq_release_narc_0583_bin, NARC_msg_narc_0125_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0121_bin, MAPSEC_PASTORIA_CITY, 0, 1, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06GYM0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0121_bin, NARC_scr_seq_release_narc_0584_bin, NARC_msg_narc_0126_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0122_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0122_bin, NARC_scr_seq_release_narc_0585_bin, NARC_msg_narc_0127_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0123_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06PC0102 - {NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0181_bin, NARC_scr_seq_release_narc_0124_bin, NARC_scr_seq_release_narc_0587_bin, NARC_msg_narc_0128_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0124_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06R0101 - {NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0182_bin, NARC_scr_seq_release_narc_0125_bin, NARC_scr_seq_release_narc_0588_bin, NARC_msg_narc_0129_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0125_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06R0102 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0126_bin, NARC_scr_seq_release_narc_0589_bin, NARC_msg_narc_0130_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0126_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0127_bin, NARC_scr_seq_release_narc_0590_bin, NARC_msg_narc_0131_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0127_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06R0301 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0128_bin, NARC_scr_seq_release_narc_0591_bin, NARC_msg_narc_0132_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0128_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0129_bin, NARC_scr_seq_release_narc_0592_bin, NARC_msg_narc_0133_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0129_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06R0501 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0130_bin, NARC_scr_seq_release_narc_0593_bin, NARC_msg_narc_0134_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0130_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06R0601 - {NARC_area_data_narc_0011_bin, NARC_move_model_list_narc_0005_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0131_bin, NARC_scr_seq_release_narc_0594_bin, NARC_msg_narc_0135_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0131_bin, MAPSEC_VEILSTONE_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C07 - {NARC_area_data_narc_0029_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0115_bin, NARC_scr_seq_release_narc_0132_bin, NARC_scr_seq_release_narc_0595_bin, NARC_msg_narc_0136_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0132_bin, MAPSEC_VEILSTONE_CITY, 0, 10, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07GYM0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0133_bin, NARC_scr_seq_release_narc_0596_bin, NARC_msg_narc_0137_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0133_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0134_bin, NARC_scr_seq_release_narc_0597_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0134_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07PC0102 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0139_bin, NARC_scr_seq_release_narc_0136_bin, NARC_scr_seq_release_narc_0599_bin, NARC_msg_narc_0139_bin, SEQ_BLD_GAME, SEQ_BLD_GAME, 0xFFFF, NARC_zone_event_release_narc_0135_bin, MAPSEC_GAME_CORNER, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0101 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0172_bin, NARC_scr_seq_release_narc_0137_bin, NARC_scr_seq_release_narc_0600_bin, NARC_msg_narc_0140_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0136_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0201 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0173_bin, NARC_scr_seq_release_narc_0138_bin, NARC_scr_seq_release_narc_0601_bin, NARC_msg_narc_0141_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0137_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0202 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0174_bin, NARC_scr_seq_release_narc_0139_bin, NARC_scr_seq_release_narc_0602_bin, NARC_msg_narc_0142_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0138_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0203 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0175_bin, NARC_scr_seq_release_narc_0140_bin, NARC_scr_seq_release_narc_0603_bin, NARC_msg_narc_0143_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0139_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0204 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0176_bin, NARC_scr_seq_release_narc_0141_bin, NARC_scr_seq_release_narc_0604_bin, NARC_msg_narc_0144_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0140_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0205 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0142_bin, NARC_scr_seq_release_narc_0605_bin, NARC_msg_narc_0145_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0141_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0206 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0177_bin, NARC_scr_seq_release_narc_0143_bin, NARC_scr_seq_release_narc_0606_bin, NARC_msg_narc_0146_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0142_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0301 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0204_bin, NARC_scr_seq_release_narc_0144_bin, NARC_scr_seq_release_narc_0607_bin, NARC_msg_narc_0147_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0143_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0145_bin, NARC_scr_seq_release_narc_0608_bin, NARC_msg_narc_0148_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0144_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0501 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0146_bin, NARC_scr_seq_release_narc_0609_bin, NARC_msg_narc_0149_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0145_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0601 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0147_bin, NARC_scr_seq_release_narc_0610_bin, NARC_msg_narc_0150_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0146_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0701 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0148_bin, NARC_scr_seq_release_narc_0611_bin, NARC_msg_narc_0151_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0147_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0801 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0149_bin, NARC_scr_seq_release_narc_0612_bin, NARC_msg_narc_0152_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0148_bin, MAPSEC_ROUTE_215, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07R0901 - {NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0007_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0150_bin, NARC_scr_seq_release_narc_0613_bin, NARC_msg_narc_0153_bin, SEQ_CITY08_D, SEQ_CITY08_N, ENCDATA(NARC_d_enc_data_narc_0003_bin, NARC_p_enc_data_narc_0003_bin), NARC_zone_event_release_narc_0149_bin, MAPSEC_SUNYSHORE_CITY, 0, 11, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C08 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0155_bin, NARC_scr_seq_release_narc_0618_bin, NARC_msg_narc_0157_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0150_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0156_bin, NARC_scr_seq_release_narc_0619_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0151_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08PC0102 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0151_bin, NARC_scr_seq_release_narc_0614_bin, NARC_msg_narc_0154_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0152_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08FS0101 - {NARC_area_data_narc_0030_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0226_bin, NARC_scr_seq_release_narc_0152_bin, NARC_scr_seq_release_narc_0615_bin, NARC_msg_narc_0155_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0153_bin, MAPSEC_SUNYSHORE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08GYM0101 - {NARC_area_data_narc_0030_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0227_bin, NARC_scr_seq_release_narc_0153_bin, NARC_scr_seq_release_narc_0616_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0154_bin, MAPSEC_SUNYSHORE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08GYM0102 - {NARC_area_data_narc_0030_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0228_bin, NARC_scr_seq_release_narc_0154_bin, NARC_scr_seq_release_narc_0617_bin, NARC_msg_narc_0156_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0155_bin, MAPSEC_SUNYSHORE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08GYM0103 - {NARC_area_data_narc_0038_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0203_bin, NARC_scr_seq_release_narc_0158_bin, NARC_scr_seq_release_narc_0621_bin, NARC_msg_narc_0158_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0156_bin, MAPSEC_SUNYSHORE_MARKET, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0159_bin, NARC_scr_seq_release_narc_0622_bin, NARC_msg_narc_0159_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0157_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0160_bin, NARC_scr_seq_release_narc_0623_bin, NARC_msg_narc_0160_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0158_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0301 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0161_bin, NARC_scr_seq_release_narc_0624_bin, NARC_msg_narc_0161_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0159_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0162_bin, NARC_scr_seq_release_narc_0625_bin, NARC_msg_narc_0162_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0160_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0501 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0163_bin, NARC_scr_seq_release_narc_0626_bin, NARC_msg_narc_0163_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0161_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0601 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0164_bin, NARC_scr_seq_release_narc_0627_bin, NARC_msg_narc_0164_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0162_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0701 - {NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0230_bin, NARC_scr_seq_release_narc_0165_bin, NARC_scr_seq_release_narc_0628_bin, NARC_msg_narc_0165_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0163_bin, MAPSEC_VISTA_LIGHTHOUSE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0801 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0168_bin, NARC_scr_seq_release_narc_0631_bin, NARC_msg_narc_0167_bin, SEQ_CITY09_D, SEQ_CITY09_N, 0xFFFF, NARC_zone_event_release_narc_0164_bin, MAPSEC_SNOWPOINT_CITY, 28, 0, 1, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_C09 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0169_bin, NARC_scr_seq_release_narc_0632_bin, NARC_msg_narc_0168_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0165_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C09FS0101 - {NARC_area_data_narc_0028_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0114_bin, NARC_scr_seq_release_narc_0170_bin, NARC_scr_seq_release_narc_0633_bin, NARC_msg_narc_0169_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0166_bin, MAPSEC_SNOWPOINT_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C09GYM0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0171_bin, NARC_scr_seq_release_narc_0634_bin, NARC_msg_narc_0170_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0167_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C09PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0172_bin, NARC_scr_seq_release_narc_0635_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0168_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C09PC0102 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0174_bin, NARC_scr_seq_release_narc_0637_bin, NARC_msg_narc_0171_bin, SEQ_CITY09_D, SEQ_CITY09_N, 0xFFFF, NARC_zone_event_release_narc_0169_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C09R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0175_bin, NARC_scr_seq_release_narc_0638_bin, NARC_msg_narc_0172_bin, SEQ_CITY09_D, SEQ_CITY09_N, 0xFFFF, NARC_zone_event_release_narc_0170_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C09R0201 - {NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0010_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0176_bin, NARC_scr_seq_release_narc_0639_bin, NARC_msg_narc_0173_bin, SEQ_CITY10_D, SEQ_CITY10_N, ENCDATA(NARC_d_enc_data_narc_0004_bin, NARC_p_enc_data_narc_0004_bin), NARC_zone_event_release_narc_0171_bin, MAPSEC_POKEMON_LEAGUE, 8, 11, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C10 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0177_bin, NARC_scr_seq_release_narc_0640_bin, NARC_msg_narc_0174_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0172_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C10PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0178_bin, NARC_scr_seq_release_narc_0641_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0173_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C10PC0102 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0144_bin, NARC_scr_seq_release_narc_0180_bin, NARC_scr_seq_release_narc_0643_bin, NARC_msg_narc_0175_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0174_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0101 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0187_bin, NARC_scr_seq_release_narc_0181_bin, NARC_scr_seq_release_narc_0644_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0175_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0102 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0183_bin, NARC_scr_seq_release_narc_0182_bin, NARC_scr_seq_release_narc_0645_bin, NARC_msg_narc_0176_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0176_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0103 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0188_bin, NARC_scr_seq_release_narc_0183_bin, NARC_scr_seq_release_narc_0646_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0177_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0104 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0184_bin, NARC_scr_seq_release_narc_0184_bin, NARC_scr_seq_release_narc_0647_bin, NARC_msg_narc_0177_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0178_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0105 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0188_bin, NARC_scr_seq_release_narc_0185_bin, NARC_scr_seq_release_narc_0648_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0179_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0106 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0185_bin, NARC_scr_seq_release_narc_0186_bin, NARC_scr_seq_release_narc_0649_bin, NARC_msg_narc_0178_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0180_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0107 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0188_bin, NARC_scr_seq_release_narc_0187_bin, NARC_scr_seq_release_narc_0650_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0181_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0108 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0186_bin, NARC_scr_seq_release_narc_0188_bin, NARC_scr_seq_release_narc_0651_bin, NARC_msg_narc_0179_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0182_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0109 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0189_bin, NARC_scr_seq_release_narc_0189_bin, NARC_scr_seq_release_narc_0652_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0183_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0110 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0190_bin, NARC_scr_seq_release_narc_0190_bin, NARC_scr_seq_release_narc_0653_bin, NARC_msg_narc_0180_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0184_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0111 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0192_bin, NARC_scr_seq_release_narc_0191_bin, NARC_scr_seq_release_narc_0654_bin, NARC_msg_narc_0181_bin, SEQ_BLD_DENDO, SEQ_BLD_DENDO, 0xFFFF, NARC_zone_event_release_narc_0185_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0112 - {NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0191_bin, NARC_scr_seq_release_narc_0192_bin, NARC_scr_seq_release_narc_0655_bin, NARC_msg_narc_0182_bin, SEQ_BLD_DENDO, SEQ_BLD_DENDO, 0xFFFF, NARC_zone_event_release_narc_0186_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0113 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0195_bin, NARC_scr_seq_release_narc_0658_bin, NARC_msg_narc_0183_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0187_bin, MAPSEC_FIGHT_AREA, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_C11 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0197_bin, NARC_scr_seq_release_narc_0660_bin, NARC_msg_narc_0185_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0188_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0198_bin, NARC_scr_seq_release_narc_0661_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0189_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11PC0102 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0196_bin, NARC_scr_seq_release_narc_0659_bin, NARC_msg_narc_0184_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0190_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11FS0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0159_bin, NARC_scr_seq_release_narc_0200_bin, NARC_scr_seq_release_narc_0663_bin, NARC_msg_narc_0186_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0191_bin, MAPSEC_BATTLE_PARK, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0201_bin, NARC_scr_seq_release_narc_0664_bin, NARC_msg_narc_0187_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0192_bin, MAPSEC_ROUTE_225, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0202_bin, NARC_scr_seq_release_narc_0665_bin, NARC_msg_narc_0188_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0193_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11R0301 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0203_bin, NARC_scr_seq_release_narc_0666_bin, NARC_msg_narc_0189_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0194_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11R0501 - {NARC_area_data_narc_0045_bin, 45, NARC_map_matrix_narc_0005_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0195_bin, MAPSEC_OREBURGH_MINE, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE}, // MAP_D01 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0005_bin, NARC_scr_seq_release_narc_0208_bin, NARC_scr_seq_release_narc_0668_bin, NARC_msg_narc_0208_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0005_bin, NARC_p_enc_data_narc_0005_bin), NARC_zone_event_release_narc_0196_bin, MAPSEC_OREBURGH_MINE, 0, 12, 3, 9, TRUE, FALSE, TRUE, FALSE}, // MAP_D01R0101 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0006_bin, NARC_scr_seq_release_narc_0209_bin, NARC_scr_seq_release_narc_0669_bin, NARC_msg_narc_0209_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0006_bin, NARC_p_enc_data_narc_0006_bin), NARC_zone_event_release_narc_0197_bin, MAPSEC_OREBURGH_MINE, 0, 12, 3, 9, TRUE, FALSE, TRUE, FALSE}, // MAP_D01R0102 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0210_bin, NARC_scr_seq_release_narc_0670_bin, NARC_msg_narc_0210_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0007_bin, NARC_p_enc_data_narc_0007_bin), NARC_zone_event_release_narc_0198_bin, MAPSEC_VALLEY_WINDWORKS, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_D02 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0234_bin, NARC_scr_seq_release_narc_0211_bin, NARC_scr_seq_release_narc_0671_bin, NARC_msg_narc_0211_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0199_bin, MAPSEC_VALLEY_WINDWORKS, 0, 4, 3, 7, FALSE, TRUE, FALSE, FALSE}, // MAP_D02R0101 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0212_bin, NARC_scr_seq_release_narc_0672_bin, NARC_msg_narc_0212_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, 0xFFFF, NARC_zone_event_release_narc_0200_bin, MAPSEC_ETERNA_FOREST, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_D03 - {NARC_area_data_narc_0044_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0007_bin, NARC_scr_seq_release_narc_0213_bin, NARC_scr_seq_release_narc_0673_bin, NARC_msg_narc_0213_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0008_bin, NARC_p_enc_data_narc_0008_bin), NARC_zone_event_release_narc_0201_bin, MAPSEC_ETERNA_FOREST, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_D03R0101 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0214_bin, NARC_scr_seq_release_narc_0674_bin, NARC_msg_narc_0214_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0009_bin, NARC_p_enc_data_narc_0009_bin), NARC_zone_event_release_narc_0202_bin, MAPSEC_FUEGO_IRONWORKS, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_D04 - {NARC_area_data_narc_0057_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0008_bin, NARC_scr_seq_release_narc_0215_bin, NARC_scr_seq_release_narc_0675_bin, NARC_msg_narc_0215_bin, SEQ_D_04, SEQ_D_04, 0xFFFF, NARC_zone_event_release_narc_0203_bin, MAPSEC_FUEGO_IRONWORKS, 0, 4, 3, 7, FALSE, TRUE, FALSE, FALSE}, // MAP_D04R0101 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D05 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0009_bin, NARC_scr_seq_release_narc_0217_bin, NARC_scr_seq_release_narc_0677_bin, NARC_msg_narc_0216_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0010_bin, NARC_p_enc_data_narc_0010_bin), NARC_zone_event_release_narc_0204_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0101 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0010_bin, NARC_scr_seq_release_narc_0218_bin, NARC_scr_seq_release_narc_0678_bin, NARC_msg_narc_0217_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0011_bin, NARC_p_enc_data_narc_0011_bin), NARC_zone_event_release_narc_0205_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0011_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0012_bin, NARC_p_enc_data_narc_0012_bin), NARC_zone_event_release_narc_0206_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0103 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0012_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0013_bin, NARC_p_enc_data_narc_0013_bin), NARC_zone_event_release_narc_0207_bin, MAPSEC_MT_CORONET, 6, 7, 2, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_D05R0104 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0013_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0014_bin, NARC_p_enc_data_narc_0014_bin), NARC_zone_event_release_narc_0208_bin, MAPSEC_MT_CORONET, 6, 6, 2, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_D05R0105 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0014_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0015_bin, NARC_p_enc_data_narc_0015_bin), NARC_zone_event_release_narc_0209_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0106 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0015_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0016_bin, NARC_p_enc_data_narc_0016_bin), NARC_zone_event_release_narc_0210_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0107 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0016_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0017_bin, NARC_p_enc_data_narc_0017_bin), NARC_zone_event_release_narc_0211_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0108 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0017_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0018_bin, NARC_p_enc_data_narc_0018_bin), NARC_zone_event_release_narc_0212_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0109 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0018_bin, NARC_scr_seq_release_narc_0226_bin, NARC_scr_seq_release_narc_0686_bin, NARC_msg_narc_0218_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0019_bin, NARC_p_enc_data_narc_0019_bin), NARC_zone_event_release_narc_0213_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0110 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0019_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0020_bin, NARC_p_enc_data_narc_0020_bin), NARC_zone_event_release_narc_0214_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0111 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0020_bin, NARC_scr_seq_release_narc_0228_bin, NARC_scr_seq_release_narc_0688_bin, NARC_msg_narc_0219_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0021_bin, NARC_p_enc_data_narc_0021_bin), NARC_zone_event_release_narc_0215_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0112 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0021_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0022_bin, NARC_p_enc_data_narc_0022_bin), NARC_zone_event_release_narc_0216_bin, MAPSEC_MT_CORONET, 14, 0, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D05R0113 - {NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0022_bin, NARC_scr_seq_release_narc_0230_bin, NARC_scr_seq_release_narc_0690_bin, NARC_msg_narc_0220_bin, SEQ_D_MOUNT2, SEQ_D_MOUNT2, 0xFFFF, NARC_zone_event_release_narc_0217_bin, MAPSEC_SPEAR_PILLAR, 13, 5, 2, 4, FALSE, TRUE, FALSE, FALSE}, // MAP_D05R0114 - {NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0023_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT2, SEQ_D_MOUNT2, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_SPEAR_PILLAR, 13, 5, 2, 4, FALSE, TRUE, FALSE, FALSE}, // MAP_D05R0115 - {NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D06 - {NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0024_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0218_bin, MAPSEC_PASTORIA_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D06R0101 - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D07 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0025_bin, NARC_scr_seq_release_narc_0241_bin, NARC_scr_seq_release_narc_0701_bin, NARC_msg_narc_0229_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0029_bin, NARC_p_enc_data_narc_0029_bin), NARC_zone_event_release_narc_0219_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0101 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0026_bin, NARC_scr_seq_release_narc_0242_bin, NARC_scr_seq_release_narc_0702_bin, NARC_msg_narc_0230_bin, SEQ_D_02, SEQ_D_02, 0xFFFF, NARC_zone_event_release_narc_0220_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0102 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0040_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0030_bin, NARC_p_enc_data_narc_0030_bin), NARC_zone_event_release_narc_0221_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0103 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0031_bin, NARC_p_enc_data_narc_0031_bin), NARC_zone_event_release_narc_0222_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0104 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0039_bin, NARC_scr_seq_release_narc_0245_bin, NARC_scr_seq_release_narc_0705_bin, NARC_msg_narc_0231_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0032_bin, NARC_p_enc_data_narc_0032_bin), NARC_zone_event_release_narc_0223_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0105 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0033_bin, NARC_p_enc_data_narc_0033_bin), NARC_zone_event_release_narc_0224_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0106 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0034_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0034_bin, NARC_p_enc_data_narc_0034_bin), NARC_zone_event_release_narc_0225_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0107 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0035_bin, NARC_p_enc_data_narc_0035_bin), NARC_zone_event_release_narc_0226_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0108 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0040_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0036_bin, NARC_p_enc_data_narc_0036_bin), NARC_zone_event_release_narc_0227_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0109 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0042_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0037_bin, NARC_p_enc_data_narc_0037_bin), NARC_zone_event_release_narc_0228_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0110 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0038_bin, NARC_p_enc_data_narc_0038_bin), NARC_zone_event_release_narc_0229_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0111 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0039_bin, NARC_p_enc_data_narc_0039_bin), NARC_zone_event_release_narc_0230_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0112 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0036_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0040_bin, NARC_p_enc_data_narc_0040_bin), NARC_zone_event_release_narc_0231_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0113 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0034_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0041_bin, NARC_p_enc_data_narc_0041_bin), NARC_zone_event_release_narc_0232_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0114 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0030_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0042_bin, NARC_p_enc_data_narc_0042_bin), NARC_zone_event_release_narc_0233_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0115 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0041_bin, NARC_scr_seq_release_narc_0256_bin, NARC_scr_seq_release_narc_0716_bin, NARC_msg_narc_0232_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0043_bin, NARC_p_enc_data_narc_0043_bin), NARC_zone_event_release_narc_0234_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0116 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0044_bin, NARC_p_enc_data_narc_0044_bin), NARC_zone_event_release_narc_0235_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0117 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0045_bin, NARC_p_enc_data_narc_0045_bin), NARC_zone_event_release_narc_0236_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0118 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D09 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0043_bin, NARC_scr_seq_release_narc_0259_bin, NARC_scr_seq_release_narc_0719_bin, NARC_msg_narc_0233_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0047_bin, NARC_p_enc_data_narc_0047_bin), NARC_zone_event_release_narc_0237_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D09R0101 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0044_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0048_bin, NARC_p_enc_data_narc_0048_bin), NARC_zone_event_release_narc_0238_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D09R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0045_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0049_bin, NARC_p_enc_data_narc_0049_bin), NARC_zone_event_release_narc_0239_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D09R0103 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0046_bin, NARC_scr_seq_release_narc_0262_bin, NARC_scr_seq_release_narc_0722_bin, NARC_msg_narc_0234_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0050_bin, NARC_p_enc_data_narc_0050_bin), NARC_zone_event_release_narc_0240_bin, MAPSEC_VICTORY_ROAD, 14, 0, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D09R0104 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0047_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0051_bin, NARC_p_enc_data_narc_0051_bin), NARC_zone_event_release_narc_0241_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D09R0105 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0048_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0052_bin, NARC_p_enc_data_narc_0052_bin), NARC_zone_event_release_narc_0242_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D09R0106 - {NARC_area_data_narc_0004_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0049_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0243_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE}, // MAP_D10 - {NARC_area_data_narc_0051_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0049_bin, NARC_scr_seq_release_narc_0265_bin, NARC_scr_seq_release_narc_0725_bin, NARC_msg_narc_0235_bin, SEQ_SILENCE_DUNGEON, SEQ_SILENCE_DUNGEON, 0xFFFF, NARC_zone_event_release_narc_0244_bin, MAPSEC_PAL_PARK, 0, 2, 2, 0, TRUE, FALSE, FALSE, FALSE}, // MAP_D10R0101 - {NARC_area_data_narc_0009_bin, NARC_move_model_list_narc_0003_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D11 - {NARC_area_data_narc_0049_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0050_bin, NARC_scr_seq_release_narc_0266_bin, NARC_scr_seq_release_narc_0726_bin, NARC_msg_narc_0236_bin, SEQ_D_KOUEN, SEQ_D_KOUEN, 0xFFFF, NARC_zone_event_release_narc_0245_bin, MAPSEC_AMITY_SQUARE, 0, 2, 2, 0, FALSE, TRUE, FALSE, FALSE}, // MAP_D11R0101 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0051_bin, NARC_scr_seq_release_narc_0267_bin, NARC_scr_seq_release_narc_0727_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0053_bin, NARC_p_enc_data_narc_0053_bin), NARC_zone_event_release_narc_0246_bin, MAPSEC_RAVAGED_PATH, 0, 12, 3, 9, TRUE, TRUE, TRUE, FALSE}, // MAP_D12R0101 - {NARC_area_data_narc_0044_bin, 44, NARC_map_matrix_narc_0052_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0247_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE}, // MAP_D13 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0052_bin, NARC_scr_seq_release_narc_0269_bin, NARC_scr_seq_release_narc_0729_bin, NARC_msg_narc_0238_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0248_bin, MAPSEC_FLOAROMA_MEADOW, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_D13R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0270_bin, NARC_scr_seq_release_narc_0730_bin, NARC_msg_narc_0239_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0249_bin, MAPSEC_FLOAROMA_MEADOW, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D13R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0003_bin, NARC_scr_seq_release_narc_0271_bin, NARC_scr_seq_release_narc_0731_bin, NARC_msg_narc_0240_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0054_bin, NARC_p_enc_data_narc_0054_bin), NARC_zone_event_release_narc_0250_bin, MAPSEC_OREBURGH_GATE, 0, 12, 3, 9, TRUE, TRUE, TRUE, FALSE}, // MAP_D14R0101 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0004_bin, NARC_scr_seq_release_narc_0272_bin, NARC_scr_seq_release_narc_0732_bin, NARC_msg_narc_0241_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0055_bin, NARC_p_enc_data_narc_0055_bin), NARC_zone_event_release_narc_0251_bin, MAPSEC_OREBURGH_GATE, 1, 12, 3, 9, TRUE, TRUE, TRUE, FALSE}, // MAP_D14R0102 - {NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0273_bin, NARC_scr_seq_release_narc_0733_bin, NARC_msg_narc_0242_bin, SEQ_D_02, SEQ_D_02, 0xFFFF, NARC_zone_event_release_narc_0252_bin, MAPSEC_FULLMOON_ISLAND, 0, 0, 2, 0, FALSE, TRUE, FALSE, TRUE}, // MAP_D15 - {NARC_area_data_narc_0044_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0053_bin, NARC_scr_seq_release_narc_0274_bin, NARC_scr_seq_release_narc_0734_bin, NARC_msg_narc_0243_bin, SEQ_D_02, SEQ_D_02, 0xFFFF, NARC_zone_event_release_narc_0253_bin, MAPSEC_FULLMOON_ISLAND, 0, 2, 3, 3, FALSE, TRUE, FALSE, FALSE}, // MAP_D15R0101 - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0275_bin, NARC_scr_seq_release_narc_0735_bin, NARC_msg_narc_0244_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0056_bin, NARC_p_enc_data_narc_0056_bin), NARC_zone_event_release_narc_0254_bin, MAPSEC_STARK_MOUNTAIN, 9, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_D16 - {NARC_area_data_narc_0047_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0057_bin, NARC_scr_seq_release_narc_0276_bin, NARC_scr_seq_release_narc_0736_bin, NARC_msg_narc_0245_bin, SEQ_D_06, SEQ_D_06, ENCDATA(NARC_d_enc_data_narc_0057_bin, NARC_p_enc_data_narc_0057_bin), NARC_zone_event_release_narc_0255_bin, MAPSEC_STARK_MOUNTAIN, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D16R0101 - {NARC_area_data_narc_0047_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0058_bin, NARC_scr_seq_release_narc_0277_bin, NARC_scr_seq_release_narc_0737_bin, NARC_msg_narc_0246_bin, SEQ_D_06, SEQ_D_06, ENCDATA(NARC_d_enc_data_narc_0058_bin, NARC_p_enc_data_narc_0058_bin), NARC_zone_event_release_narc_0256_bin, MAPSEC_STARK_MOUNTAIN, 0, 8, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D16R0102 - {NARC_area_data_narc_0047_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0059_bin, NARC_scr_seq_release_narc_0278_bin, NARC_scr_seq_release_narc_0738_bin, NARC_msg_narc_0247_bin, SEQ_D_06, SEQ_D_06, 0xFFFF, NARC_zone_event_release_narc_0257_bin, MAPSEC_STARK_MOUNTAIN, 0, 12, 3, 10, TRUE, TRUE, FALSE, FALSE}, // MAP_D16R0103 - {NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D17 - {NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0060_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0059_bin, NARC_p_enc_data_narc_0059_bin), NARC_zone_event_release_narc_0258_bin, MAPSEC_SENDOFF_SPRING, 8, 0, 3, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_D17R0101 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0061_bin, NARC_scr_seq_release_narc_0281_bin, NARC_scr_seq_release_narc_0741_bin, NARC_msg_narc_0248_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0259_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0102 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0062_bin, NARC_scr_seq_release_narc_0282_bin, NARC_scr_seq_release_narc_0742_bin, NARC_msg_narc_0249_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0260_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0103 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0063_bin, NARC_scr_seq_release_narc_0283_bin, NARC_scr_seq_release_narc_0743_bin, NARC_msg_narc_0250_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0261_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0104 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0284_bin, NARC_scr_seq_release_narc_0744_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0063_bin, NARC_p_enc_data_narc_0063_bin), NARC_zone_event_release_narc_0262_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0105 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0285_bin, NARC_scr_seq_release_narc_0745_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0064_bin, NARC_p_enc_data_narc_0064_bin), NARC_zone_event_release_narc_0263_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0106 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0286_bin, NARC_scr_seq_release_narc_0746_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0065_bin, NARC_p_enc_data_narc_0065_bin), NARC_zone_event_release_narc_0264_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0107 - {NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0010_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0302_bin, NARC_scr_seq_release_narc_0762_bin, NARC_msg_narc_0251_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0265_bin, MAPSEC_FLOWER_PARADISE, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_D18 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, FALSE, FALSE, FALSE, FALSE}, // MAP_D18R0101 - {NARC_area_data_narc_0011_bin, NARC_move_model_list_narc_0005_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D19A - {NARC_area_data_narc_0011_bin, NARC_move_model_list_narc_0005_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE}, // MAP_D19B - {NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0068_bin, NARC_scr_seq_release_narc_0304_bin, NARC_scr_seq_release_narc_0764_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0106_bin, NARC_p_enc_data_narc_0106_bin), NARC_zone_event_release_narc_0266_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D20R0101 - {NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0069_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0107_bin, NARC_p_enc_data_narc_0107_bin), NARC_zone_event_release_narc_0267_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D20R0102 - {NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0070_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0108_bin, NARC_p_enc_data_narc_0108_bin), NARC_zone_event_release_narc_0268_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D20R0103 - {NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0071_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0109_bin, NARC_p_enc_data_narc_0109_bin), NARC_zone_event_release_narc_0269_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D20R0104 - {NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0072_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0110_bin, NARC_p_enc_data_narc_0110_bin), NARC_zone_event_release_narc_0270_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D20R0105 - {NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0073_bin, NARC_scr_seq_release_narc_0309_bin, NARC_scr_seq_release_narc_0769_bin, NARC_msg_narc_0252_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0111_bin, NARC_p_enc_data_narc_0111_bin), NARC_zone_event_release_narc_0271_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D20R0106 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0074_bin, NARC_scr_seq_release_narc_0310_bin, NARC_scr_seq_release_narc_0770_bin, NARC_msg_narc_0253_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0112_bin, NARC_p_enc_data_narc_0112_bin), NARC_zone_event_release_narc_0272_bin, MAPSEC_WAYWARD_CAVE, 16, 12, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D21R0101 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0075_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0113_bin, NARC_p_enc_data_narc_0113_bin), NARC_zone_event_release_narc_0273_bin, MAPSEC_WAYWARD_CAVE, 0, 12, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D21R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0076_bin, NARC_scr_seq_release_narc_0312_bin, NARC_scr_seq_release_narc_0772_bin, NARC_msg_narc_0254_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0114_bin, NARC_p_enc_data_narc_0114_bin), NARC_zone_event_release_narc_0274_bin, MAPSEC_RUIN_MANIAC_CAVE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D22R0101 - {NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0079_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0117_bin, NARC_p_enc_data_narc_0117_bin), NARC_zone_event_release_narc_0275_bin, MAPSEC_TROPHY_GARDEN, 0, 2, 2, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_D23R0101 - {NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0316_bin, NARC_scr_seq_release_narc_0776_bin, NARC_msg_narc_0257_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0118_bin, NARC_p_enc_data_narc_0118_bin), NARC_zone_event_release_narc_0276_bin, MAPSEC_IRON_ISLAND, 8, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_D24 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0080_bin, NARC_scr_seq_release_narc_0317_bin, NARC_scr_seq_release_narc_0777_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0119_bin, NARC_p_enc_data_narc_0119_bin), NARC_zone_event_release_narc_0277_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D24R0101 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0081_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0120_bin, NARC_p_enc_data_narc_0120_bin), NARC_zone_event_release_narc_0278_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D24R0102 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0082_bin, NARC_scr_seq_release_narc_0319_bin, NARC_scr_seq_release_narc_0779_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0121_bin, NARC_p_enc_data_narc_0121_bin), NARC_zone_event_release_narc_0279_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D24R0103 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0083_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0122_bin, NARC_p_enc_data_narc_0122_bin), NARC_zone_event_release_narc_0280_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D24R0104 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0084_bin, NARC_scr_seq_release_narc_0321_bin, NARC_scr_seq_release_narc_0781_bin, NARC_msg_narc_0258_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0123_bin, NARC_p_enc_data_narc_0123_bin), NARC_zone_event_release_narc_0281_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D24R0105 - {NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0085_bin, NARC_scr_seq_release_narc_0322_bin, NARC_scr_seq_release_narc_0782_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0124_bin, NARC_p_enc_data_narc_0124_bin), NARC_zone_event_release_narc_0282_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D24R0106 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0086_bin, NARC_scr_seq_release_narc_0324_bin, NARC_scr_seq_release_narc_0784_bin, NARC_msg_narc_0260_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0125_bin, NARC_p_enc_data_narc_0125_bin), NARC_zone_event_release_narc_0283_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0101 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0087_bin, NARC_scr_seq_release_narc_0325_bin, NARC_scr_seq_release_narc_0785_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0126_bin, NARC_p_enc_data_narc_0126_bin), NARC_zone_event_release_narc_0284_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0102 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0088_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0127_bin, NARC_p_enc_data_narc_0127_bin), NARC_zone_event_release_narc_0285_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0103 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0089_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0128_bin, NARC_p_enc_data_narc_0128_bin), NARC_zone_event_release_narc_0286_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0104 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0090_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0129_bin, NARC_p_enc_data_narc_0129_bin), NARC_zone_event_release_narc_0287_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0105 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0091_bin, NARC_scr_seq_release_narc_0329_bin, NARC_scr_seq_release_narc_0789_bin, NARC_msg_narc_0261_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0130_bin, NARC_p_enc_data_narc_0130_bin), NARC_zone_event_release_narc_0288_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0106 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0092_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0131_bin, NARC_p_enc_data_narc_0131_bin), NARC_zone_event_release_narc_0289_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0107 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0093_bin, NARC_scr_seq_release_narc_0331_bin, NARC_scr_seq_release_narc_0791_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0132_bin, NARC_p_enc_data_narc_0132_bin), NARC_zone_event_release_narc_0290_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0108 - {NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0094_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0133_bin, NARC_p_enc_data_narc_0133_bin), NARC_zone_event_release_narc_0291_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R0109 - {NARC_area_data_narc_0031_bin, 31, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, FALSE, FALSE, FALSE, FALSE}, // MAP_D25R1001 - {NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0095_bin, NARC_scr_seq_release_narc_0333_bin, NARC_scr_seq_release_narc_0793_bin, NARC_msg_narc_0262_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0292_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0101 - {NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0096_bin, NARC_scr_seq_release_narc_0334_bin, NARC_scr_seq_release_narc_0794_bin, NARC_msg_narc_0263_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0293_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0102 - {NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0097_bin, NARC_scr_seq_release_narc_0335_bin, NARC_scr_seq_release_narc_0795_bin, NARC_msg_narc_0264_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0294_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0103 - {NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0098_bin, NARC_scr_seq_release_narc_0336_bin, NARC_scr_seq_release_narc_0796_bin, NARC_msg_narc_0265_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0295_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0104 - {NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0100_bin, NARC_scr_seq_release_narc_0337_bin, NARC_scr_seq_release_narc_0797_bin, NARC_msg_narc_0266_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0296_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0105 - {NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0099_bin, NARC_scr_seq_release_narc_0338_bin, NARC_scr_seq_release_narc_0798_bin, NARC_msg_narc_0267_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0297_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0106 - {NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0101_bin, NARC_scr_seq_release_narc_0342_bin, NARC_scr_seq_release_narc_0802_bin, NARC_msg_narc_0270_bin, SEQ_D_LAKE, SEQ_D_LAKE, ENCDATA(NARC_d_enc_data_narc_0134_bin, NARC_p_enc_data_narc_0134_bin), NARC_zone_event_release_narc_0298_bin, MAPSEC_LAKE_VERITY, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_D27R0101 - {NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0102_bin, NARC_scr_seq_release_narc_0343_bin, NARC_scr_seq_release_narc_0803_bin, NARC_msg_narc_0271_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, ENCDATA(NARC_d_enc_data_narc_0135_bin, NARC_p_enc_data_narc_0135_bin), NARC_zone_event_release_narc_0299_bin, MAPSEC_LAKE_VERITY, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_D27R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0103_bin, NARC_scr_seq_release_narc_0344_bin, NARC_scr_seq_release_narc_0804_bin, NARC_msg_narc_0272_bin, SEQ_D_RYAYHY, SEQ_D_RYAYHY, 0xFFFF, NARC_zone_event_release_narc_0300_bin, MAPSEC_VERITY_CAVERN, 0, 12, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D27R0103 - {NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0104_bin, NARC_scr_seq_release_narc_0346_bin, NARC_scr_seq_release_narc_0806_bin, NARC_msg_narc_0273_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0301_bin, MAPSEC_LAKE_VALOR, 0, 2, 3, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_D28R0101 - {NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0105_bin, NARC_scr_seq_release_narc_0347_bin, NARC_scr_seq_release_narc_0807_bin, NARC_msg_narc_0274_bin, SEQ_D_LAKE, SEQ_D_LAKE, ENCDATA(NARC_d_enc_data_narc_0136_bin, NARC_p_enc_data_narc_0136_bin), NARC_zone_event_release_narc_0302_bin, MAPSEC_LAKE_VALOR, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_D28R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0106_bin, NARC_scr_seq_release_narc_0348_bin, NARC_scr_seq_release_narc_0808_bin, NARC_msg_narc_0275_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0303_bin, MAPSEC_VALOR_CAVERN, 0, 12, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D28R0103 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0107_bin, NARC_scr_seq_release_narc_0350_bin, NARC_scr_seq_release_narc_0810_bin, NARC_msg_narc_0276_bin, SEQ_D_LAKE, SEQ_D_LAKE, 0xFFFF, NARC_zone_event_release_narc_0304_bin, MAPSEC_LAKE_ACUITY, 0, 15, 3, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_D29R0101 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0108_bin, NARC_scr_seq_release_narc_0351_bin, NARC_scr_seq_release_narc_0811_bin, NARC_msg_narc_0277_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, ENCDATA(NARC_d_enc_data_narc_0137_bin, NARC_p_enc_data_narc_0137_bin), NARC_zone_event_release_narc_0305_bin, MAPSEC_LAKE_ACUITY, 0, 15, 3, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_D29R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0109_bin, NARC_scr_seq_release_narc_0352_bin, NARC_scr_seq_release_narc_0812_bin, NARC_msg_narc_0278_bin, SEQ_D_RYAYHY, SEQ_D_RYAYHY, 0xFFFF, NARC_zone_event_release_narc_0306_bin, MAPSEC_ACUITY_CAVERN, 0, 12, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D29R0103 - {NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0009_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0353_bin, NARC_scr_seq_release_narc_0813_bin, NARC_msg_narc_0279_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0307_bin, MAPSEC_NEWMOON_ISLAND, 0, 0, 3, 0, FALSE, TRUE, FALSE, FALSE}, // MAP_D30 - {NARC_area_data_narc_0044_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0110_bin, NARC_scr_seq_release_narc_0354_bin, NARC_scr_seq_release_narc_0814_bin, NARC_msg_narc_0280_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0308_bin, MAPSEC_NEWMOON_ISLAND, 0, 2, 3, 3, FALSE, TRUE, FALSE, FALSE}, // MAP_D30R0101 - {NARC_area_data_narc_0054_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0229_bin, NARC_scr_seq_release_narc_0355_bin, NARC_scr_seq_release_narc_0815_bin, NARC_msg_narc_0281_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0309_bin, MAPSEC_BATTLE_PARK, 0, 2, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_D31 - {NARC_area_data_narc_0041_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0231_bin, NARC_scr_seq_release_narc_0356_bin, NARC_scr_seq_release_narc_0816_bin, NARC_msg_narc_0282_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0310_bin, MAPSEC_BATTLE_PARK, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0101 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0232_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0102 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0233_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0103 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0193_bin, NARC_scr_seq_release_narc_0358_bin, NARC_scr_seq_release_narc_0818_bin, NARC_msg_narc_0283_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0311_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0201 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0359_bin, NARC_scr_seq_release_narc_0819_bin, NARC_msg_narc_0018_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0312_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0202 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0194_bin, NARC_scr_seq_release_narc_0360_bin, NARC_scr_seq_release_narc_0820_bin, NARC_msg_narc_0018_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0313_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0203 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0195_bin, NARC_scr_seq_release_narc_0361_bin, NARC_scr_seq_release_narc_0821_bin, NARC_msg_narc_0018_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0314_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0204 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0197_bin, NARC_scr_seq_release_narc_0362_bin, NARC_scr_seq_release_narc_0822_bin, NARC_msg_narc_0284_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0315_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0205 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0198_bin, NARC_scr_seq_release_narc_0363_bin, NARC_scr_seq_release_narc_0823_bin, NARC_msg_narc_0285_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0316_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0206 - {NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0118_bin, NARC_scr_seq_release_narc_0366_bin, NARC_scr_seq_release_narc_0825_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0317_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_DIRECT2 - {NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0121_bin, NARC_scr_seq_release_narc_0367_bin, NARC_scr_seq_release_narc_0826_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0318_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_DIRECT4 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0379_bin, NARC_scr_seq_release_narc_0829_bin, NARC_msg_narc_0352_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, 0xFFFF, NARC_zone_event_release_narc_0319_bin, MAPSEC_VERITY_LAKEFRONT, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_L01 - {NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0380_bin, NARC_scr_seq_release_narc_0830_bin, NARC_msg_narc_0353_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, 0xFFFF, NARC_zone_event_release_narc_0320_bin, MAPSEC_VERITY_LAKEFRONT, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_L01R0101 - {NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0381_bin, NARC_scr_seq_release_narc_0831_bin, NARC_msg_narc_0354_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, ENCDATA(NARC_d_enc_data_narc_0138_bin, NARC_p_enc_data_narc_0138_bin), NARC_zone_event_release_narc_0321_bin, MAPSEC_VALOR_LAKEFRONT, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_L02 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0147_bin, NARC_scr_seq_release_narc_0382_bin, NARC_scr_seq_release_narc_0832_bin, NARC_msg_narc_0355_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0322_bin, MAPSEC_RESTAURANT, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_L02R0101 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0383_bin, NARC_scr_seq_release_narc_0833_bin, NARC_msg_narc_0356_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0323_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_L02R0201 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0384_bin, NARC_scr_seq_release_narc_0834_bin, NARC_msg_narc_0357_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0324_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_L02R0301 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0385_bin, NARC_scr_seq_release_narc_0835_bin, NARC_msg_narc_0358_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, ENCDATA(NARC_d_enc_data_narc_0139_bin, NARC_p_enc_data_narc_0139_bin), NARC_zone_event_release_narc_0325_bin, MAPSEC_ACUITY_LAKEFRONT, 27, 0, 2, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_L03 - {NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0326_bin, MAPSEC_SPRING_PATH, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_L04 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0392_bin, NARC_scr_seq_release_narc_0837_bin, NARC_msg_narc_0415_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, ENCDATA(NARC_d_enc_data_narc_0140_bin, NARC_p_enc_data_narc_0140_bin), NARC_zone_event_release_narc_0327_bin, MAPSEC_ROUTE_201, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R201 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0393_bin, NARC_scr_seq_release_narc_0838_bin, NARC_msg_narc_0416_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, ENCDATA(NARC_d_enc_data_narc_0141_bin, NARC_p_enc_data_narc_0141_bin), NARC_zone_event_release_narc_0328_bin, MAPSEC_ROUTE_202, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R202 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0394_bin, NARC_scr_seq_release_narc_0839_bin, NARC_msg_narc_0417_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0142_bin, NARC_p_enc_data_narc_0142_bin), NARC_zone_event_release_narc_0329_bin, MAPSEC_ROUTE_203, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R203 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0395_bin, NARC_scr_seq_release_narc_0840_bin, NARC_msg_narc_0418_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0143_bin, NARC_p_enc_data_narc_0143_bin), NARC_zone_event_release_narc_0330_bin, MAPSEC_ROUTE_204, 0, 0, 2, 0, TRUE, TRUE, TRUE, TRUE}, // MAP_R204A - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0396_bin, NARC_scr_seq_release_narc_0841_bin, NARC_msg_narc_0419_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0144_bin, NARC_p_enc_data_narc_0144_bin), NARC_zone_event_release_narc_0331_bin, MAPSEC_ROUTE_204, 0, 0, 2, 0, TRUE, TRUE, TRUE, TRUE}, // MAP_R204B - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0397_bin, NARC_scr_seq_release_narc_0842_bin, NARC_msg_narc_0420_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0145_bin, NARC_p_enc_data_narc_0145_bin), NARC_zone_event_release_narc_0332_bin, MAPSEC_ROUTE_205, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R205A - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0398_bin, NARC_scr_seq_release_narc_0843_bin, NARC_msg_narc_0421_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, 0xFFFF, NARC_zone_event_release_narc_0333_bin, MAPSEC_ROUTE_205, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R205AR0101 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0399_bin, NARC_scr_seq_release_narc_0844_bin, NARC_msg_narc_0422_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0146_bin, NARC_p_enc_data_narc_0146_bin), NARC_zone_event_release_narc_0334_bin, MAPSEC_ROUTE_205, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R205B - {NARC_area_data_narc_0007_bin, NARC_move_model_list_narc_0001_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0400_bin, NARC_scr_seq_release_narc_0845_bin, NARC_msg_narc_0423_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0147_bin, NARC_p_enc_data_narc_0147_bin), NARC_zone_event_release_narc_0335_bin, MAPSEC_ROUTE_206, 8, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R206 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0211_bin, NARC_scr_seq_release_narc_0401_bin, NARC_scr_seq_release_narc_0846_bin, NARC_msg_narc_0424_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0336_bin, MAPSEC_ROUTE_206, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R206R0101 - {NARC_area_data_narc_0031_bin, 31, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0402_bin, NARC_scr_seq_release_narc_0847_bin, NARC_msg_narc_0425_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0337_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R206R0201 - {NARC_area_data_narc_0007_bin, NARC_move_model_list_narc_0001_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0403_bin, NARC_scr_seq_release_narc_0848_bin, NARC_msg_narc_0426_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0148_bin, NARC_p_enc_data_narc_0148_bin), NARC_zone_event_release_narc_0338_bin, MAPSEC_ROUTE_207, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R207 - {NARC_area_data_narc_0009_bin, NARC_move_model_list_narc_0003_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0404_bin, NARC_scr_seq_release_narc_0849_bin, NARC_msg_narc_0427_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0149_bin, NARC_p_enc_data_narc_0149_bin), NARC_zone_event_release_narc_0339_bin, MAPSEC_ROUTE_208, 8, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R208 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0405_bin, NARC_scr_seq_release_narc_0850_bin, NARC_msg_narc_0428_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0340_bin, MAPSEC_ROUTE_208, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R208R0101 - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0406_bin, NARC_scr_seq_release_narc_0851_bin, NARC_msg_narc_0429_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0150_bin, NARC_p_enc_data_narc_0150_bin), NARC_zone_event_release_narc_0341_bin, MAPSEC_ROUTE_209, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R209 - {NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0212_bin, NARC_scr_seq_release_narc_0407_bin, NARC_scr_seq_release_narc_0852_bin, NARC_msg_narc_0430_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0151_bin, NARC_p_enc_data_narc_0151_bin), NARC_zone_event_release_narc_0342_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE}, // MAP_R209R0101 - {NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0213_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0152_bin, NARC_p_enc_data_narc_0152_bin), NARC_zone_event_release_narc_0343_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE}, // MAP_R209R0102 - {NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0214_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0153_bin, NARC_p_enc_data_narc_0153_bin), NARC_zone_event_release_narc_0344_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE}, // MAP_R209R0103 - {NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0215_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0154_bin, NARC_p_enc_data_narc_0154_bin), NARC_zone_event_release_narc_0345_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE}, // MAP_R209R0104 - {NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0216_bin, NARC_scr_seq_release_narc_0411_bin, NARC_scr_seq_release_narc_0856_bin, NARC_msg_narc_0431_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0155_bin, NARC_p_enc_data_narc_0155_bin), NARC_zone_event_release_narc_0346_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE}, // MAP_R209R0105 - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0412_bin, NARC_scr_seq_release_narc_0857_bin, NARC_msg_narc_0432_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0156_bin, NARC_p_enc_data_narc_0156_bin), NARC_zone_event_release_narc_0347_bin, MAPSEC_ROUTE_210, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R210A - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0414_bin, NARC_scr_seq_release_narc_0859_bin, NARC_msg_narc_0434_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0157_bin, NARC_p_enc_data_narc_0157_bin), NARC_zone_event_release_narc_0348_bin, MAPSEC_ROUTE_210, 14, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R210B - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0415_bin, NARC_scr_seq_release_narc_0860_bin, NARC_msg_narc_0435_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0349_bin, MAPSEC_ROUTE_210, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R210BR0101 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0416_bin, NARC_scr_seq_release_narc_0861_bin, NARC_msg_narc_0436_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0158_bin, NARC_p_enc_data_narc_0158_bin), NARC_zone_event_release_narc_0350_bin, MAPSEC_ROUTE_211, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R211A - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0417_bin, NARC_scr_seq_release_narc_0862_bin, NARC_msg_narc_0437_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0159_bin, NARC_p_enc_data_narc_0159_bin), NARC_zone_event_release_narc_0351_bin, MAPSEC_ROUTE_211, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R211B - {NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0418_bin, NARC_scr_seq_release_narc_0863_bin, NARC_msg_narc_0438_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0160_bin, NARC_p_enc_data_narc_0160_bin), NARC_zone_event_release_narc_0352_bin, MAPSEC_ROUTE_212, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R212A - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0178_bin, NARC_scr_seq_release_narc_0419_bin, NARC_scr_seq_release_narc_0864_bin, NARC_msg_narc_0439_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0353_bin, MAPSEC_POKEMON_MANSION, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R212AR0101 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0179_bin, NARC_scr_seq_release_narc_0420_bin, NARC_scr_seq_release_narc_0865_bin, NARC_msg_narc_0440_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0354_bin, MAPSEC_POKEMON_MANSION, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R212AR0102 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0180_bin, NARC_scr_seq_release_narc_0421_bin, NARC_scr_seq_release_narc_0866_bin, NARC_msg_narc_0441_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0355_bin, MAPSEC_POKEMON_MANSION, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R212AR0103 - {NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0422_bin, NARC_scr_seq_release_narc_0867_bin, NARC_msg_narc_0442_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0161_bin, NARC_p_enc_data_narc_0161_bin), NARC_zone_event_release_narc_0356_bin, MAPSEC_ROUTE_212, 24, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R212B - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0423_bin, NARC_scr_seq_release_narc_0868_bin, NARC_msg_narc_0443_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0357_bin, MAPSEC_ROUTE_212, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R212BR0101 - {NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0424_bin, NARC_scr_seq_release_narc_0869_bin, NARC_msg_narc_0444_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, ENCDATA(NARC_d_enc_data_narc_0162_bin, NARC_p_enc_data_narc_0162_bin), NARC_zone_event_release_narc_0358_bin, MAPSEC_ROUTE_213, 25, 0, 2, 1, TRUE, TRUE, FALSE, TRUE}, // MAP_R213 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0425_bin, NARC_scr_seq_release_narc_0870_bin, NARC_msg_narc_0445_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0359_bin, MAPSEC_ROUTE_213, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R213R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0426_bin, NARC_scr_seq_release_narc_0871_bin, NARC_msg_narc_0446_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0360_bin, MAPSEC_FOOTSTEP_HOUSE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R213R0201 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0145_bin, NARC_scr_seq_release_narc_0427_bin, NARC_scr_seq_release_narc_0872_bin, NARC_msg_narc_0447_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0361_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R213R0301 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0428_bin, NARC_scr_seq_release_narc_0873_bin, NARC_msg_narc_0448_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0362_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R213R0401 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0429_bin, NARC_scr_seq_release_narc_0874_bin, NARC_msg_narc_0449_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0363_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R213R0501 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0430_bin, NARC_scr_seq_release_narc_0875_bin, NARC_msg_narc_0450_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0364_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R213R0601 - {NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0431_bin, NARC_scr_seq_release_narc_0876_bin, NARC_msg_narc_0451_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0163_bin, NARC_p_enc_data_narc_0163_bin), NARC_zone_event_release_narc_0365_bin, MAPSEC_ROUTE_214, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R214 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0432_bin, NARC_scr_seq_release_narc_0877_bin, NARC_msg_narc_0452_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0366_bin, MAPSEC_ROUTE_214, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R214R0101 - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0433_bin, NARC_scr_seq_release_narc_0878_bin, NARC_msg_narc_0453_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0164_bin, NARC_p_enc_data_narc_0164_bin), NARC_zone_event_release_narc_0367_bin, MAPSEC_ROUTE_215, 2, 0, 2, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_R215 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0434_bin, NARC_scr_seq_release_narc_0879_bin, NARC_msg_narc_0454_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, ENCDATA(NARC_d_enc_data_narc_0165_bin, NARC_p_enc_data_narc_0165_bin), NARC_zone_event_release_narc_0368_bin, MAPSEC_ROUTE_216, 26, 0, 2, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_R216 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0435_bin, NARC_scr_seq_release_narc_0880_bin, NARC_msg_narc_0455_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, 0xFFFF, NARC_zone_event_release_narc_0369_bin, MAPSEC_ROUTE_216, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R216R0101 - {NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0436_bin, NARC_scr_seq_release_narc_0881_bin, NARC_msg_narc_0456_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, ENCDATA(NARC_d_enc_data_narc_0166_bin, NARC_p_enc_data_narc_0166_bin), NARC_zone_event_release_narc_0370_bin, MAPSEC_ROUTE_217, 7, 0, 2, 5, FALSE, TRUE, FALSE, TRUE}, // MAP_R217 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0437_bin, NARC_scr_seq_release_narc_0882_bin, NARC_msg_narc_0457_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, 0xFFFF, NARC_zone_event_release_narc_0371_bin, MAPSEC_ROUTE_217, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R217R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0438_bin, NARC_scr_seq_release_narc_0883_bin, NARC_msg_narc_0458_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, 0xFFFF, NARC_zone_event_release_narc_0372_bin, MAPSEC_ROUTE_217, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R217R0201 - {NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0009_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0439_bin, NARC_scr_seq_release_narc_0884_bin, NARC_msg_narc_0459_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0167_bin, NARC_p_enc_data_narc_0167_bin), NARC_zone_event_release_narc_0373_bin, MAPSEC_ROUTE_218, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R218 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0440_bin, NARC_scr_seq_release_narc_0885_bin, NARC_msg_narc_0460_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, 0xFFFF, NARC_zone_event_release_narc_0374_bin, MAPSEC_ROUTE_218, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R218R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0441_bin, NARC_scr_seq_release_narc_0886_bin, NARC_msg_narc_0461_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, 0xFFFF, NARC_zone_event_release_narc_0375_bin, MAPSEC_ROUTE_218, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R218R0201 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0442_bin, NARC_scr_seq_release_narc_0887_bin, NARC_msg_narc_0462_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, ENCDATA(NARC_d_enc_data_narc_0168_bin, NARC_p_enc_data_narc_0168_bin), NARC_zone_event_release_narc_0376_bin, MAPSEC_ROUTE_219, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R219 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0443_bin, NARC_scr_seq_release_narc_0888_bin, NARC_msg_narc_0463_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0169_bin, NARC_p_enc_data_narc_0169_bin), NARC_zone_event_release_narc_0377_bin, MAPSEC_ROUTE_221, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R221 - {NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0201_bin, NARC_scr_seq_release_narc_0444_bin, NARC_scr_seq_release_narc_0889_bin, NARC_msg_narc_0464_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0378_bin, MAPSEC_PAL_PARK, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R221R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0445_bin, NARC_scr_seq_release_narc_0890_bin, NARC_msg_narc_0465_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0379_bin, MAPSEC_ROUTE_221, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R221R0201 - {NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0446_bin, NARC_scr_seq_release_narc_0891_bin, NARC_msg_narc_0466_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0170_bin, NARC_p_enc_data_narc_0170_bin), NARC_zone_event_release_narc_0380_bin, MAPSEC_ROUTE_222, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R222 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0447_bin, NARC_scr_seq_release_narc_0892_bin, NARC_msg_narc_0467_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0381_bin, MAPSEC_ROUTE_222, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R222R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0448_bin, NARC_scr_seq_release_narc_0893_bin, NARC_msg_narc_0468_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0382_bin, MAPSEC_ROUTE_222, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R222R0201 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0449_bin, NARC_scr_seq_release_narc_0894_bin, NARC_msg_narc_0469_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0383_bin, MAPSEC_ROUTE_222, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R222R0301 - {NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0010_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0450_bin, NARC_scr_seq_release_narc_0895_bin, NARC_msg_narc_0470_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0171_bin, NARC_p_enc_data_narc_0171_bin), NARC_zone_event_release_narc_0384_bin, MAPSEC_ROUTE_224, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE}, // MAP_R224 - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0451_bin, NARC_scr_seq_release_narc_0896_bin, NARC_msg_narc_0471_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0172_bin, NARC_p_enc_data_narc_0172_bin), NARC_zone_event_release_narc_0385_bin, MAPSEC_ROUTE_225, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R225 - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_R226A - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_R226B - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0454_bin, NARC_scr_seq_release_narc_0899_bin, NARC_msg_narc_0474_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0173_bin, NARC_p_enc_data_narc_0173_bin), NARC_zone_event_release_narc_0386_bin, MAPSEC_ROUTE_227, 9, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R227 - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_R227A - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_R227B - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0456_bin, NARC_scr_seq_release_narc_0901_bin, NARC_msg_narc_0476_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, ENCDATA(NARC_d_enc_data_narc_0174_bin, NARC_p_enc_data_narc_0174_bin), NARC_zone_event_release_narc_0387_bin, MAPSEC_ROUTE_228, 10, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_R228 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0460_bin, NARC_scr_seq_release_narc_0905_bin, NARC_msg_narc_0480_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, ENCDATA(NARC_d_enc_data_narc_0175_bin, NARC_p_enc_data_narc_0175_bin), NARC_zone_event_release_narc_0388_bin, MAPSEC_ROUTE_229, 0, 0, 2, 3, TRUE, TRUE, FALSE, TRUE}, // MAP_R229 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_R230 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_R232 - {NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0119_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_RECORD - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0978_bin, NARC_scr_seq_release_narc_0908_bin, NARC_msg_narc_0498_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, ENCDATA(NARC_d_enc_data_narc_0176_bin, NARC_p_enc_data_narc_0176_bin), NARC_zone_event_release_narc_0389_bin, MAPSEC_TWINLEAF_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_T01 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0126_bin, NARC_scr_seq_release_narc_0979_bin, NARC_scr_seq_release_narc_0909_bin, NARC_msg_narc_0499_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0390_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T01R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0127_bin, NARC_scr_seq_release_narc_0980_bin, NARC_scr_seq_release_narc_0910_bin, NARC_msg_narc_0500_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0391_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T01R0102 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0128_bin, NARC_scr_seq_release_narc_0981_bin, NARC_scr_seq_release_narc_0911_bin, NARC_msg_narc_0501_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0392_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T01R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0129_bin, NARC_scr_seq_release_narc_0982_bin, NARC_scr_seq_release_narc_0912_bin, NARC_msg_narc_0502_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0393_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T01R0202 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0983_bin, NARC_scr_seq_release_narc_0913_bin, NARC_msg_narc_0503_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0394_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T01R0301 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0984_bin, NARC_scr_seq_release_narc_0914_bin, NARC_msg_narc_0504_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0395_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T01R0401 - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0985_bin, NARC_scr_seq_release_narc_0915_bin, NARC_msg_narc_0505_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0396_bin, MAPSEC_SANDGEM_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_T02 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0986_bin, NARC_scr_seq_release_narc_0916_bin, NARC_msg_narc_0506_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0397_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02FS0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0987_bin, NARC_scr_seq_release_narc_0917_bin, NARC_msg_narc_0507_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0398_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0988_bin, NARC_scr_seq_release_narc_0918_bin, NARC_msg_narc_0508_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0399_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02PC0102 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0160_bin, NARC_scr_seq_release_narc_0990_bin, NARC_scr_seq_release_narc_0920_bin, NARC_msg_narc_0509_bin, SEQ_KENKYUJO, SEQ_KENKYUJO, 0xFFFF, NARC_zone_event_release_narc_0400_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0130_bin, NARC_scr_seq_release_narc_0991_bin, NARC_scr_seq_release_narc_0921_bin, NARC_msg_narc_0510_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0401_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0131_bin, NARC_scr_seq_release_narc_0992_bin, NARC_scr_seq_release_narc_0922_bin, NARC_msg_narc_0511_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0402_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02R0202 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0993_bin, NARC_scr_seq_release_narc_0923_bin, NARC_msg_narc_0512_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0403_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02R0301 - {NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0994_bin, NARC_scr_seq_release_narc_0924_bin, NARC_msg_narc_0513_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0404_bin, MAPSEC_FLOAROMA_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_T03 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0995_bin, NARC_scr_seq_release_narc_0925_bin, NARC_msg_narc_0514_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0405_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T03FS0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0996_bin, NARC_scr_seq_release_narc_0926_bin, NARC_msg_narc_0515_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0406_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T03PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0997_bin, NARC_scr_seq_release_narc_0927_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0407_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T03PC0102 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0236_bin, NARC_scr_seq_release_narc_0999_bin, NARC_scr_seq_release_narc_0929_bin, NARC_msg_narc_0516_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0408_bin, MAPSEC_FLOWER_SHOP, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T03R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1000_bin, NARC_scr_seq_release_narc_0930_bin, NARC_msg_narc_0517_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0409_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T03R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1001_bin, NARC_scr_seq_release_narc_0931_bin, NARC_msg_narc_0518_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0410_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T03R0301 - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1002_bin, NARC_scr_seq_release_narc_0932_bin, NARC_msg_narc_0519_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0411_bin, MAPSEC_SOLACEON_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_T04 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_1003_bin, NARC_scr_seq_release_narc_0933_bin, NARC_msg_narc_0520_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0412_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04FS0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1004_bin, NARC_scr_seq_release_narc_0934_bin, NARC_msg_narc_0521_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0413_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1005_bin, NARC_scr_seq_release_narc_0935_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0414_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04PC0102 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0137_bin, NARC_scr_seq_release_narc_1007_bin, NARC_scr_seq_release_narc_0937_bin, NARC_msg_narc_0522_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0415_bin, MAPSEC_POKEMON_DAY_CARE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1008_bin, NARC_scr_seq_release_narc_0938_bin, NARC_msg_narc_0523_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0416_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_1009_bin, NARC_scr_seq_release_narc_0939_bin, NARC_msg_narc_0524_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0417_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04R0301 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1010_bin, NARC_scr_seq_release_narc_0940_bin, NARC_msg_narc_0525_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0418_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04R0401 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1011_bin, NARC_scr_seq_release_narc_0941_bin, NARC_msg_narc_0526_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0419_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04R0501 - {NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1012_bin, NARC_scr_seq_release_narc_0942_bin, NARC_msg_narc_0527_bin, SEQ_CITY04_D, SEQ_CITY04_N, ENCDATA(NARC_d_enc_data_narc_0177_bin, NARC_p_enc_data_narc_0177_bin), NARC_zone_event_release_narc_0420_bin, MAPSEC_CELESTIC_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_T05 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1014_bin, NARC_scr_seq_release_narc_0944_bin, NARC_msg_narc_0528_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0421_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1015_bin, NARC_scr_seq_release_narc_0945_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0422_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05PC0102 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0168_bin, NARC_scr_seq_release_narc_1017_bin, NARC_scr_seq_release_narc_0947_bin, NARC_msg_narc_0529_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0423_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0170_bin, NARC_scr_seq_release_narc_1018_bin, NARC_scr_seq_release_narc_0948_bin, NARC_msg_narc_0530_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0424_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_1019_bin, NARC_scr_seq_release_narc_0949_bin, NARC_msg_narc_0531_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0425_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05R0301 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_1020_bin, NARC_scr_seq_release_narc_0950_bin, NARC_msg_narc_0532_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0426_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05R0401 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0169_bin, NARC_scr_seq_release_narc_1021_bin, NARC_scr_seq_release_narc_0951_bin, NARC_msg_narc_0533_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0427_bin, MAPSEC_CELESTIC_TOWN, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05R0501 - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1022_bin, NARC_scr_seq_release_narc_0952_bin, NARC_msg_narc_0534_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0428_bin, MAPSEC_SURVIVAL_AREA, 0, 0, 1, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_T06 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_1023_bin, NARC_scr_seq_release_narc_0953_bin, NARC_msg_narc_0535_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0429_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T06FS0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1024_bin, NARC_scr_seq_release_narc_0954_bin, NARC_msg_narc_0536_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0430_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T06PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1025_bin, NARC_scr_seq_release_narc_0955_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0431_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T06PC0102 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1027_bin, NARC_scr_seq_release_narc_0957_bin, NARC_msg_narc_0537_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0432_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T06R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_1028_bin, NARC_scr_seq_release_narc_0958_bin, NARC_msg_narc_0538_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0433_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T06R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1029_bin, NARC_scr_seq_release_narc_0959_bin, NARC_msg_narc_0539_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0434_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T06R0301 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1030_bin, NARC_scr_seq_release_narc_0960_bin, NARC_msg_narc_0540_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, ENCDATA(NARC_d_enc_data_narc_0178_bin, NARC_p_enc_data_narc_0178_bin), NARC_zone_event_release_narc_0435_bin, MAPSEC_RESORT_AREA, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE}, // MAP_T07 - {NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_1031_bin, NARC_scr_seq_release_narc_0961_bin, NARC_msg_narc_0541_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0436_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T07FS0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1032_bin, NARC_scr_seq_release_narc_0962_bin, NARC_msg_narc_0542_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0437_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T07PC0101 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1033_bin, NARC_scr_seq_release_narc_0963_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0438_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T07PC0102 - {NARC_area_data_narc_0038_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0199_bin, NARC_scr_seq_release_narc_1035_bin, NARC_scr_seq_release_narc_0965_bin, NARC_msg_narc_0543_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0439_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_T07R0101 - {NARC_area_data_narc_0038_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0200_bin, NARC_scr_seq_release_narc_1036_bin, NARC_scr_seq_release_narc_0966_bin, NARC_msg_narc_0544_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0440_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_T07R0102 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_1037_bin, NARC_scr_seq_release_narc_0967_bin, NARC_msg_narc_0545_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0441_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_T07R0103 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1038_bin, NARC_scr_seq_release_narc_0968_bin, NARC_msg_narc_0546_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0442_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T07R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1039_bin, NARC_scr_seq_release_narc_0969_bin, NARC_msg_narc_0547_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0443_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T07R0301 - {NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0120_bin, NARC_scr_seq_release_narc_1044_bin, NARC_scr_seq_release_narc_0971_bin, NARC_msg_narc_0576_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0444_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_UNION - {NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0179_bin, NARC_p_enc_data_narc_0179_bin), NARC_zone_event_release_narc_0445_bin, MAPSEC_ROUTE_220, 0, 0, 2, 1, TRUE, TRUE, FALSE, TRUE}, // MAP_W220 - {NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0007_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0180_bin, NARC_p_enc_data_narc_0180_bin), NARC_zone_event_release_narc_0446_bin, MAPSEC_ROUTE_223, 0, 11, 2, 1, TRUE, TRUE, FALSE, TRUE}, // MAP_W223 - {NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1047_bin, NARC_scr_seq_release_narc_0974_bin, NARC_msg_narc_0583_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0181_bin, NARC_p_enc_data_narc_0181_bin), NARC_zone_event_release_narc_0447_bin, MAPSEC_ROUTE_226, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE}, // MAP_W226 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_W229 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1049_bin, NARC_scr_seq_release_narc_0976_bin, NARC_msg_narc_0585_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, ENCDATA(NARC_d_enc_data_narc_0182_bin, NARC_p_enc_data_narc_0182_bin), NARC_zone_event_release_narc_0448_bin, MAPSEC_ROUTE_230, 0, 0, 2, 1, TRUE, TRUE, FALSE, TRUE}, // MAP_W230 - {NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0449_bin, MAPSEC_SEABREAK_PATH, 0, 0, 2, 1, TRUE, TRUE, FALSE, TRUE}, // MAP_W231 - {NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 1, TRUE, TRUE, FALSE, FALSE}, // MAP_W233 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0007_bin, NARC_scr_seq_release_narc_0470_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0450_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C01PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0039_bin, NARC_scr_seq_release_narc_0502_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0451_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0053_bin, NARC_scr_seq_release_narc_0516_bin, NARC_msg_narc_0062_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0452_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C03PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0075_bin, NARC_scr_seq_release_narc_0538_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0453_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C04PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0099_bin, NARC_scr_seq_release_narc_0562_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0454_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C05PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0123_bin, NARC_scr_seq_release_narc_0586_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0455_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C06PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0135_bin, NARC_scr_seq_release_narc_0598_bin, NARC_msg_narc_0138_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0456_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C07PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0157_bin, NARC_scr_seq_release_narc_0620_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0457_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C08PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0173_bin, NARC_scr_seq_release_narc_0636_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0458_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C09PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0179_bin, NARC_scr_seq_release_narc_0642_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0459_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C10PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0199_bin, NARC_scr_seq_release_narc_0662_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0460_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C11PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0989_bin, NARC_scr_seq_release_narc_0919_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0461_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T02PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0998_bin, NARC_scr_seq_release_narc_0928_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0462_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T03PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1006_bin, NARC_scr_seq_release_narc_0936_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0463_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T04PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1016_bin, NARC_scr_seq_release_narc_0946_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0464_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T05PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1026_bin, NARC_scr_seq_release_narc_0956_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0465_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T06PC0103 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1034_bin, NARC_scr_seq_release_narc_0964_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0466_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_T07PC0103 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0047_bin, NARC_scr_seq_release_narc_0510_bin, NARC_msg_narc_0018_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0467_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C02R0601 - {NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0171_bin, NARC_scr_seq_release_narc_0413_bin, NARC_scr_seq_release_narc_0858_bin, NARC_msg_narc_0433_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0468_bin, MAPSEC_CAFE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_R210AR0101 - {NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0196_bin, NARC_scr_seq_release_narc_0364_bin, NARC_scr_seq_release_narc_0824_bin, NARC_msg_narc_0286_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0469_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D31R0207 - {NARC_area_data_narc_0058_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0238_bin, NARC_scr_seq_release_narc_0339_bin, NARC_scr_seq_release_narc_0799_bin, NARC_msg_narc_0268_bin, SEQ_THE_EVENT04, SEQ_THE_EVENT04, 0xFFFF, NARC_zone_event_release_narc_0470_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0107 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0193_bin, NARC_scr_seq_release_narc_0656_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0471_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0114 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0194_bin, NARC_scr_seq_release_narc_0657_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0472_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_C10R0115 - {NARC_area_data_narc_0058_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0239_bin, NARC_scr_seq_release_narc_0340_bin, NARC_scr_seq_release_narc_0800_bin, NARC_msg_narc_0269_bin, SEQ_THE_EVENT04, SEQ_THE_EVENT04, 0xFFFF, NARC_zone_event_release_narc_0473_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_D26R0108 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0452_bin, NARC_scr_seq_release_narc_0897_bin, NARC_msg_narc_0472_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0474_bin, MAPSEC_ROUTE_225, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R225R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_1048_bin, NARC_scr_seq_release_narc_0975_bin, NARC_msg_narc_0584_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0475_bin, MAPSEC_ROUTE_226, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_W226R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0455_bin, NARC_scr_seq_release_narc_0900_bin, NARC_msg_narc_0475_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0476_bin, MAPSEC_ROUTE_227, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R227R0101 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0457_bin, NARC_scr_seq_release_narc_0902_bin, NARC_msg_narc_0477_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, 0xFFFF, NARC_zone_event_release_narc_0477_bin, MAPSEC_ROUTE_228, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R228R0101 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0458_bin, NARC_scr_seq_release_narc_0903_bin, NARC_msg_narc_0478_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, 0xFFFF, NARC_zone_event_release_narc_0478_bin, MAPSEC_ROUTE_228, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R228R0201 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0459_bin, NARC_scr_seq_release_narc_0904_bin, NARC_msg_narc_0479_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, 0xFFFF, NARC_zone_event_release_narc_0479_bin, MAPSEC_ROUTE_228, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_R228R0301 - {NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0235_bin, NARC_scr_seq_release_narc_0695_bin, NARC_msg_narc_0223_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0023_bin, NARC_p_enc_data_narc_0023_bin), NARC_zone_event_release_narc_0480_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_D06R0201 - {NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0236_bin, NARC_scr_seq_release_narc_0696_bin, NARC_msg_narc_0224_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0024_bin, NARC_p_enc_data_narc_0024_bin), NARC_zone_event_release_narc_0481_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_D06R0202 - {NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0237_bin, NARC_scr_seq_release_narc_0697_bin, NARC_msg_narc_0225_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0025_bin, NARC_p_enc_data_narc_0025_bin), NARC_zone_event_release_narc_0482_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_D06R0203 - {NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0238_bin, NARC_scr_seq_release_narc_0698_bin, NARC_msg_narc_0226_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0026_bin, NARC_p_enc_data_narc_0026_bin), NARC_zone_event_release_narc_0483_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_D06R0204 - {NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0239_bin, NARC_scr_seq_release_narc_0699_bin, NARC_msg_narc_0227_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0027_bin, NARC_p_enc_data_narc_0027_bin), NARC_zone_event_release_narc_0484_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_D06R0205 - {NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0240_bin, NARC_scr_seq_release_narc_0700_bin, NARC_msg_narc_0228_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0028_bin, NARC_p_enc_data_narc_0028_bin), NARC_zone_event_release_narc_0485_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE}, // MAP_D06R0206 - {NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0241_bin, NARC_scr_seq_release_narc_0232_bin, NARC_scr_seq_release_narc_0692_bin, NARC_msg_narc_0221_bin, SEQ_AUS, SEQ_AUS, 0xFFFF, NARC_zone_event_release_narc_0486_bin, MAPSEC_HALL_OF_ORIGIN, 13, 14, 2, 9, FALSE, TRUE, FALSE, FALSE}, // MAP_D05R0116 - {NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0242_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT2, SEQ_D_MOUNT2, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_HALL_OF_ORIGIN, 13, 14, 2, 9, FALSE, TRUE, FALSE, FALSE}, // MAP_D05R0117 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0077_bin, NARC_scr_seq_release_narc_0313_bin, NARC_scr_seq_release_narc_0773_bin, NARC_msg_narc_0255_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0115_bin, NARC_p_enc_data_narc_0115_bin), NARC_zone_event_release_narc_0487_bin, MAPSEC_RUIN_MANIAC_CAVE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D22R0102 - {NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0078_bin, NARC_scr_seq_release_narc_0314_bin, NARC_scr_seq_release_narc_0774_bin, NARC_msg_narc_0256_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0116_bin, NARC_p_enc_data_narc_0116_bin), NARC_zone_event_release_narc_0488_bin, MAPSEC_MANIAC_TUNNEL, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE}, // MAP_D22R0103 - {NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0323_bin, NARC_scr_seq_release_narc_0783_bin, NARC_msg_narc_0259_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, 0xFFFF, NARC_zone_event_release_narc_0489_bin, MAPSEC_IRON_ISLAND, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE}, // MAP_D24R0201 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0046_bin, NARC_p_enc_data_narc_0046_bin), NARC_zone_event_release_narc_0490_bin, MAPSEC_SOLACEON_RUINS, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE}, // MAP_D07R0119 - {NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0166_bin, NARC_scr_seq_release_narc_0629_bin, NARC_msg_narc_0018_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0491_bin, MAPSEC_VISTA_LIGHTHOUSE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE}, // MAP_C08R0802 - {NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0031_bin, NARC_scr_seq_release_narc_0494_bin, NARC_msg_narc_0044_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0492_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C01R0802 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0287_bin, NARC_scr_seq_release_narc_0747_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0066_bin, NARC_p_enc_data_narc_0066_bin), NARC_zone_event_release_narc_0493_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0108 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0288_bin, NARC_scr_seq_release_narc_0748_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0067_bin, NARC_p_enc_data_narc_0067_bin), NARC_zone_event_release_narc_0494_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0109 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0289_bin, NARC_scr_seq_release_narc_0749_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0068_bin, NARC_p_enc_data_narc_0068_bin), NARC_zone_event_release_narc_0495_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0110 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0290_bin, NARC_scr_seq_release_narc_0750_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0069_bin, NARC_p_enc_data_narc_0069_bin), NARC_zone_event_release_narc_0496_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0111 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0291_bin, NARC_scr_seq_release_narc_0751_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0070_bin, NARC_p_enc_data_narc_0070_bin), NARC_zone_event_release_narc_0497_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0112 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0292_bin, NARC_scr_seq_release_narc_0752_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0071_bin, NARC_p_enc_data_narc_0071_bin), NARC_zone_event_release_narc_0498_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0113 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0293_bin, NARC_scr_seq_release_narc_0753_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0072_bin, NARC_p_enc_data_narc_0072_bin), NARC_zone_event_release_narc_0499_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0114 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0294_bin, NARC_scr_seq_release_narc_0754_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0073_bin, NARC_p_enc_data_narc_0073_bin), NARC_zone_event_release_narc_0500_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0115 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0295_bin, NARC_scr_seq_release_narc_0755_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0074_bin, NARC_p_enc_data_narc_0074_bin), NARC_zone_event_release_narc_0501_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0116 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0296_bin, NARC_scr_seq_release_narc_0756_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0075_bin, NARC_p_enc_data_narc_0075_bin), NARC_zone_event_release_narc_0502_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0117 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0297_bin, NARC_scr_seq_release_narc_0757_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0076_bin, NARC_p_enc_data_narc_0076_bin), NARC_zone_event_release_narc_0503_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0118 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0298_bin, NARC_scr_seq_release_narc_0758_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0077_bin, NARC_p_enc_data_narc_0077_bin), NARC_zone_event_release_narc_0504_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0119 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0299_bin, NARC_scr_seq_release_narc_0759_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0078_bin, NARC_p_enc_data_narc_0078_bin), NARC_zone_event_release_narc_0505_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0120 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0300_bin, NARC_scr_seq_release_narc_0760_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0079_bin, NARC_p_enc_data_narc_0079_bin), NARC_zone_event_release_narc_0506_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0121 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0301_bin, NARC_scr_seq_release_narc_0761_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0507_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE}, // MAP_D17R0122 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0123 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0124 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0508_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0125 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0126 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0127 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0128 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0129 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0509_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0130 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0131 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0132 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0133 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0134 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0135 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0510_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0136 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0137 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0138 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0139 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0140 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0141 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0142 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0143 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0144 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0145 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0146 - {NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE}, // MAP_D17R0147 - {NARC_area_data_narc_0032_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0166_bin, NARC_scr_seq_release_narc_0116_bin, NARC_scr_seq_release_narc_0579_bin, NARC_msg_narc_0121_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0511_bin, MAPSEC_CONTEST_HALL, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE}, // MAP_C05R1103 + { NARC_area_data_narc_0000_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, TRUE, FALSE }, // MAP_EVERYWHERE + { NARC_area_data_narc_0000_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 0, 3, FALSE, FALSE, FALSE, FALSE }, // MAP_NOTHING + { NARC_area_data_narc_0002_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0002_bin, NARC_scr_seq_release_narc_1043_bin, NARC_scr_seq_release_narc_0970_bin, NARC_msg_narc_0566_bin, SEQ_TANKOU, SEQ_TANKOU, 0xFFFF, NARC_zone_event_release_narc_0001_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 6, 3, FALSE, FALSE, FALSE, FALSE }, // MAP_UG + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0002_bin, NARC_scr_seq_release_narc_0465_bin, NARC_msg_narc_0018_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0002_bin, MAPSEC_JUBILIFE_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C01 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0003_bin, NARC_scr_seq_release_narc_0466_bin, NARC_msg_narc_0019_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0003_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01FS0101 + { NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0004_bin, NARC_scr_seq_release_narc_0467_bin, NARC_msg_narc_0020_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0004_bin, MAPSEC_JUBILIFE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01GYM0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0005_bin, NARC_scr_seq_release_narc_0468_bin, NARC_msg_narc_0021_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0005_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0006_bin, NARC_scr_seq_release_narc_0469_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0006_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01PC0102 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0141_bin, NARC_scr_seq_release_narc_0008_bin, NARC_scr_seq_release_narc_0471_bin, NARC_msg_narc_0022_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0007_bin, MAPSEC_POKETCH_CO, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0142_bin, NARC_scr_seq_release_narc_0009_bin, NARC_scr_seq_release_narc_0472_bin, NARC_msg_narc_0023_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0008_bin, MAPSEC_POKETCH_CO, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0102 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0143_bin, NARC_scr_seq_release_narc_0010_bin, NARC_scr_seq_release_narc_0473_bin, NARC_msg_narc_0024_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0009_bin, MAPSEC_POKETCH_CO, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0103 + { NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0148_bin, NARC_scr_seq_release_narc_0011_bin, NARC_scr_seq_release_narc_0474_bin, NARC_msg_narc_0025_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0010_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0201 + { NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0149_bin, NARC_scr_seq_release_narc_0012_bin, NARC_scr_seq_release_narc_0475_bin, NARC_msg_narc_0026_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0011_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0202 + { NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0150_bin, NARC_scr_seq_release_narc_0013_bin, NARC_scr_seq_release_narc_0476_bin, NARC_msg_narc_0027_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0012_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0203 + { NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0151_bin, NARC_scr_seq_release_narc_0014_bin, NARC_scr_seq_release_narc_0477_bin, NARC_msg_narc_0028_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0013_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0204 + { NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0152_bin, NARC_scr_seq_release_narc_0015_bin, NARC_scr_seq_release_narc_0478_bin, NARC_msg_narc_0029_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0014_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0205 + { NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0153_bin, NARC_scr_seq_release_narc_0016_bin, NARC_scr_seq_release_narc_0479_bin, NARC_msg_narc_0030_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0015_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0206 + { NARC_area_data_narc_0034_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0154_bin, NARC_scr_seq_release_narc_0017_bin, NARC_scr_seq_release_narc_0480_bin, NARC_msg_narc_0031_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0016_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0207 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0018_bin, NARC_scr_seq_release_narc_0481_bin, NARC_msg_narc_0032_bin, SEQ_BLD_TV, SEQ_BLD_TV, 0xFFFF, NARC_zone_event_release_narc_0017_bin, MAPSEC_JUBILIFE_TV, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0208 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0019_bin, NARC_scr_seq_release_narc_0482_bin, NARC_msg_narc_0033_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0018_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0301 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0020_bin, NARC_scr_seq_release_narc_0483_bin, NARC_msg_narc_0034_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0019_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0302 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0021_bin, NARC_scr_seq_release_narc_0484_bin, NARC_msg_narc_0035_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0020_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0303 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0021_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0304 + { NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0023_bin, NARC_scr_seq_release_narc_0486_bin, NARC_msg_narc_0036_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0022_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0401 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0024_bin, NARC_scr_seq_release_narc_0487_bin, NARC_msg_narc_0037_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0023_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0501 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0025_bin, NARC_scr_seq_release_narc_0488_bin, NARC_msg_narc_0038_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0024_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0502 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0026_bin, NARC_scr_seq_release_narc_0489_bin, NARC_msg_narc_0039_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0025_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0503 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0027_bin, NARC_scr_seq_release_narc_0490_bin, NARC_msg_narc_0040_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0026_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0504 + { NARC_area_data_narc_0040_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0205_bin, NARC_scr_seq_release_narc_0028_bin, NARC_scr_seq_release_narc_0491_bin, NARC_msg_narc_0041_bin, SEQ_BLD_BLD_GTC, SEQ_BLD_BLD_GTC, 0xFFFF, NARC_zone_event_release_narc_0027_bin, MAPSEC_GTS, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0601 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0140_bin, NARC_scr_seq_release_narc_0029_bin, NARC_scr_seq_release_narc_0492_bin, NARC_msg_narc_0042_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0028_bin, MAPSEC_TRAINERS_SCHOOL, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0701 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0030_bin, NARC_scr_seq_release_narc_0493_bin, NARC_msg_narc_0043_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0029_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0801 + { NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0032_bin, NARC_scr_seq_release_narc_0495_bin, NARC_msg_narc_0045_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0030_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0901 + { NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0033_bin, NARC_scr_seq_release_narc_0496_bin, NARC_msg_narc_0046_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0031_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R1001 + { NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0009_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0034_bin, NARC_scr_seq_release_narc_0497_bin, NARC_msg_narc_0047_bin, SEQ_CITY02_D, SEQ_CITY02_N, ENCDATA(NARC_d_enc_data_narc_0000_bin, NARC_p_enc_data_narc_0000_bin), NARC_zone_event_release_narc_0032_bin, MAPSEC_CANALAVE_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C02 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0035_bin, NARC_scr_seq_release_narc_0498_bin, NARC_msg_narc_0048_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0033_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02FS0101 + { NARC_area_data_narc_0024_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0112_bin, NARC_scr_seq_release_narc_0036_bin, NARC_scr_seq_release_narc_0499_bin, NARC_msg_narc_0049_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0034_bin, MAPSEC_CANALAVE_CITY, 0, 3, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02GYM0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0037_bin, NARC_scr_seq_release_narc_0500_bin, NARC_msg_narc_0050_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0035_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0038_bin, NARC_scr_seq_release_narc_0501_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0036_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02PC0102 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0217_bin, NARC_scr_seq_release_narc_0040_bin, NARC_scr_seq_release_narc_0503_bin, NARC_msg_narc_0051_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0037_bin, MAPSEC_CANALAVE_LIBRARY, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0218_bin, NARC_scr_seq_release_narc_0041_bin, NARC_scr_seq_release_narc_0504_bin, NARC_msg_narc_0052_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0038_bin, MAPSEC_CANALAVE_LIBRARY, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0102 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0219_bin, NARC_scr_seq_release_narc_0042_bin, NARC_scr_seq_release_narc_0505_bin, NARC_msg_narc_0053_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0039_bin, MAPSEC_CANALAVE_LIBRARY, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0103 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0043_bin, NARC_scr_seq_release_narc_0506_bin, NARC_msg_narc_0054_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0040_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0044_bin, NARC_scr_seq_release_narc_0507_bin, NARC_msg_narc_0055_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0041_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0301 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0045_bin, NARC_scr_seq_release_narc_0508_bin, NARC_msg_narc_0056_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0042_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0046_bin, NARC_scr_seq_release_narc_0509_bin, NARC_msg_narc_0057_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0043_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0501 + { NARC_area_data_narc_0007_bin, NARC_move_model_list_narc_0001_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0048_bin, NARC_scr_seq_release_narc_0511_bin, NARC_msg_narc_0058_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0044_bin, MAPSEC_OREBURGH_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C03 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0049_bin, NARC_scr_seq_release_narc_0512_bin, NARC_msg_narc_0059_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0045_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03FS0101 + { NARC_area_data_narc_0025_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0113_bin, NARC_scr_seq_release_narc_0050_bin, NARC_scr_seq_release_narc_0513_bin, NARC_msg_narc_0060_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0046_bin, MAPSEC_OREBURGH_CITY, 0, 9, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03GYM0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0051_bin, NARC_scr_seq_release_narc_0514_bin, NARC_msg_narc_0061_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0047_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0052_bin, NARC_scr_seq_release_narc_0515_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0048_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03PC0102 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0054_bin, NARC_scr_seq_release_narc_0517_bin, NARC_msg_narc_0063_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0049_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0055_bin, NARC_scr_seq_release_narc_0518_bin, NARC_msg_narc_0064_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0050_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0102 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0136_bin, NARC_scr_seq_release_narc_0056_bin, NARC_scr_seq_release_narc_0519_bin, NARC_msg_narc_0065_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0051_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0103 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0057_bin, NARC_scr_seq_release_narc_0520_bin, NARC_msg_narc_0066_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0052_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0104 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0058_bin, NARC_scr_seq_release_narc_0521_bin, NARC_msg_narc_0067_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0053_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0201 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0059_bin, NARC_scr_seq_release_narc_0522_bin, NARC_msg_narc_0068_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0054_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0202 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0136_bin, NARC_scr_seq_release_narc_0060_bin, NARC_scr_seq_release_narc_0523_bin, NARC_msg_narc_0069_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0055_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0203 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0061_bin, NARC_scr_seq_release_narc_0524_bin, NARC_msg_narc_0070_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0056_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0204 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0062_bin, NARC_scr_seq_release_narc_0525_bin, NARC_msg_narc_0071_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0057_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0301 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0155_bin, NARC_scr_seq_release_narc_0063_bin, NARC_scr_seq_release_narc_0526_bin, NARC_msg_narc_0072_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0058_bin, MAPSEC_MINING_MUSEUM, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0064_bin, NARC_scr_seq_release_narc_0527_bin, NARC_msg_narc_0073_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0059_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0501 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0065_bin, NARC_scr_seq_release_narc_0528_bin, NARC_msg_narc_0074_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0060_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0601 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0066_bin, NARC_scr_seq_release_narc_0529_bin, NARC_msg_narc_0075_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0061_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0602 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0067_bin, NARC_scr_seq_release_narc_0530_bin, NARC_msg_narc_0076_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0062_bin, MAPSEC_OREBURGH_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0603 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0068_bin, NARC_scr_seq_release_narc_0531_bin, NARC_msg_narc_0077_bin, SEQ_CITY03_D, SEQ_CITY03_N, 0xFFFF, NARC_zone_event_release_narc_0063_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03R0701 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0069_bin, NARC_scr_seq_release_narc_0532_bin, NARC_msg_narc_0078_bin, SEQ_CITY04_D, SEQ_CITY04_N, ENCDATA(NARC_d_enc_data_narc_0001_bin, NARC_p_enc_data_narc_0001_bin), NARC_zone_event_release_narc_0064_bin, MAPSEC_ETERNA_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C04 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0070_bin, NARC_scr_seq_release_narc_0533_bin, NARC_msg_narc_0079_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0065_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04FS0101 + { NARC_area_data_narc_0026_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0220_bin, NARC_scr_seq_release_narc_0071_bin, NARC_scr_seq_release_narc_0534_bin, NARC_msg_narc_0080_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0066_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04GYM0101 + { NARC_area_data_narc_0026_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0221_bin, NARC_scr_seq_release_narc_0072_bin, NARC_scr_seq_release_narc_0535_bin, NARC_msg_narc_0081_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0067_bin, MAPSEC_ETERNA_CITY, 0, 9, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04GYM0102 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0073_bin, NARC_scr_seq_release_narc_0536_bin, NARC_msg_narc_0082_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0068_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0074_bin, NARC_scr_seq_release_narc_0537_bin, NARC_msg_narc_0083_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0069_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04PC0102 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0138_bin, NARC_scr_seq_release_narc_0076_bin, NARC_scr_seq_release_narc_0539_bin, NARC_msg_narc_0084_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0070_bin, MAPSEC_CYCLE_SHOP, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0077_bin, NARC_scr_seq_release_narc_0540_bin, NARC_msg_narc_0085_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0071_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0201 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0133_bin, NARC_scr_seq_release_narc_0078_bin, NARC_scr_seq_release_narc_0541_bin, NARC_msg_narc_0086_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0072_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0202 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0134_bin, NARC_scr_seq_release_narc_0079_bin, NARC_scr_seq_release_narc_0542_bin, NARC_msg_narc_0087_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0073_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0203 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0080_bin, NARC_scr_seq_release_narc_0543_bin, NARC_msg_narc_0088_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0074_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0204 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0132_bin, NARC_scr_seq_release_narc_0081_bin, NARC_scr_seq_release_narc_0544_bin, NARC_msg_narc_0089_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0075_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0301 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0135_bin, NARC_scr_seq_release_narc_0082_bin, NARC_scr_seq_release_narc_0545_bin, NARC_msg_narc_0090_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0076_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0302 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0083_bin, NARC_scr_seq_release_narc_0546_bin, NARC_msg_narc_0091_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0077_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0303 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0084_bin, NARC_scr_seq_release_narc_0547_bin, NARC_msg_narc_0092_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0078_bin, MAPSEC_ETERNA_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0304 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0159_bin, NARC_scr_seq_release_narc_0085_bin, NARC_scr_seq_release_narc_0548_bin, NARC_msg_narc_0093_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0079_bin, MAPSEC_ROUTE_206, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0170_bin, NARC_scr_seq_release_narc_0086_bin, NARC_scr_seq_release_narc_0549_bin, NARC_msg_narc_0094_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0080_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0501 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0087_bin, NARC_scr_seq_release_narc_0550_bin, NARC_msg_narc_0095_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0081_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0601 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0088_bin, NARC_scr_seq_release_narc_0551_bin, NARC_msg_narc_0096_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0082_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0701 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0089_bin, NARC_scr_seq_release_narc_0552_bin, NARC_msg_narc_0097_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0083_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0801 + { NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0084_bin, MAPSEC_ETERNA_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04R0901 + { NARC_area_data_narc_0009_bin, NARC_move_model_list_narc_0003_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0090_bin, NARC_scr_seq_release_narc_0553_bin, NARC_msg_narc_0098_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0085_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C05 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0091_bin, NARC_scr_seq_release_narc_0554_bin, NARC_msg_narc_0099_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0086_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05FS0101 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0222_bin, NARC_scr_seq_release_narc_0092_bin, NARC_scr_seq_release_narc_0555_bin, NARC_msg_narc_0100_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0087_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0101 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0088_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0102 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0089_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0103 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0224_bin, NARC_scr_seq_release_narc_0093_bin, NARC_scr_seq_release_narc_0556_bin, NARC_msg_narc_0101_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0090_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0104 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0091_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0105 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0224_bin, NARC_scr_seq_release_narc_0094_bin, NARC_scr_seq_release_narc_0557_bin, NARC_msg_narc_0102_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0092_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0106 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0093_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0107 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0224_bin, NARC_scr_seq_release_narc_0095_bin, NARC_scr_seq_release_narc_0558_bin, NARC_msg_narc_0103_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0094_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0108 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0095_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0109 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0096_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0110 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0097_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0111 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0223_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0098_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0112 + { NARC_area_data_narc_0027_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0225_bin, NARC_scr_seq_release_narc_0096_bin, NARC_scr_seq_release_narc_0559_bin, NARC_msg_narc_0104_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0099_bin, MAPSEC_HEARTHOME_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05GYM0113 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0097_bin, NARC_scr_seq_release_narc_0560_bin, NARC_msg_narc_0105_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0100_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0098_bin, NARC_scr_seq_release_narc_0561_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0101_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05PC0102 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0209_bin, NARC_scr_seq_release_narc_0100_bin, NARC_scr_seq_release_narc_0563_bin, NARC_msg_narc_0106_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0102_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0210_bin, NARC_scr_seq_release_narc_0101_bin, NARC_scr_seq_release_narc_0564_bin, NARC_msg_narc_0107_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0103_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0102 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0102_bin, NARC_scr_seq_release_narc_0565_bin, NARC_msg_narc_0108_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0104_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0103 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0156_bin, NARC_scr_seq_release_narc_0103_bin, NARC_scr_seq_release_narc_0566_bin, NARC_msg_narc_0109_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0105_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0201 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0104_bin, NARC_scr_seq_release_narc_0567_bin, NARC_msg_narc_0110_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0106_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0301 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0105_bin, NARC_scr_seq_release_narc_0568_bin, NARC_msg_narc_0111_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0107_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0401 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0106_bin, NARC_scr_seq_release_narc_0569_bin, NARC_msg_narc_0112_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0108_bin, MAPSEC_ROUTE_208, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0501 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0107_bin, NARC_scr_seq_release_narc_0570_bin, NARC_msg_narc_0113_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0109_bin, MAPSEC_ROUTE_209, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0601 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0108_bin, NARC_scr_seq_release_narc_0571_bin, NARC_msg_narc_0114_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0110_bin, MAPSEC_ROUTE_212, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0701 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0209_bin, NARC_scr_seq_release_narc_0109_bin, NARC_scr_seq_release_narc_0572_bin, NARC_msg_narc_0115_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0111_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0801 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0210_bin, NARC_scr_seq_release_narc_0110_bin, NARC_scr_seq_release_narc_0573_bin, NARC_msg_narc_0116_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0112_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0802 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0111_bin, NARC_scr_seq_release_narc_0574_bin, NARC_msg_narc_0117_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0113_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0803 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0112_bin, NARC_scr_seq_release_narc_0575_bin, NARC_msg_narc_0118_bin, SEQ_CITY05_D, SEQ_CITY05_N, 0xFFFF, NARC_zone_event_release_narc_0114_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R0901 + { NARC_area_data_narc_0037_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0237_bin, NARC_scr_seq_release_narc_0113_bin, NARC_scr_seq_release_narc_0576_bin, NARC_msg_narc_0119_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0115_bin, MAPSEC_POFFIN_HOUSE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R1001 + { NARC_area_data_narc_0032_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0165_bin, NARC_scr_seq_release_narc_0114_bin, NARC_scr_seq_release_narc_0577_bin, NARC_msg_narc_0120_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0116_bin, MAPSEC_CONTEST_HALL, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R1101 + { NARC_area_data_narc_0032_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0166_bin, NARC_scr_seq_release_narc_0115_bin, NARC_scr_seq_release_narc_0578_bin, NARC_msg_narc_0018_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0117_bin, MAPSEC_CONTEST_HALL, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R1102 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0167_bin, NARC_scr_seq_release_narc_0117_bin, NARC_scr_seq_release_narc_0580_bin, NARC_msg_narc_0122_bin, SEQ_SILENCE_FIELD, SEQ_SILENCE_FIELD, 0xFFFF, NARC_zone_event_release_narc_0118_bin, MAPSEC_FOREIGN_BUILDING, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R1201 + { NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0118_bin, NARC_scr_seq_release_narc_0581_bin, NARC_msg_narc_0123_bin, SEQ_CITY06_D, SEQ_CITY06_N, ENCDATA(NARC_d_enc_data_narc_0002_bin, NARC_p_enc_data_narc_0002_bin), NARC_zone_event_release_narc_0119_bin, MAPSEC_PASTORIA_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C06 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0206_bin, NARC_scr_seq_release_narc_0119_bin, NARC_scr_seq_release_narc_0582_bin, NARC_msg_narc_0124_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0120_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06FS0101 + { NARC_area_data_narc_0023_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0111_bin, NARC_scr_seq_release_narc_0120_bin, NARC_scr_seq_release_narc_0583_bin, NARC_msg_narc_0125_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0121_bin, MAPSEC_PASTORIA_CITY, 0, 1, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06GYM0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0121_bin, NARC_scr_seq_release_narc_0584_bin, NARC_msg_narc_0126_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0122_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0122_bin, NARC_scr_seq_release_narc_0585_bin, NARC_msg_narc_0127_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0123_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06PC0102 + { NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0181_bin, NARC_scr_seq_release_narc_0124_bin, NARC_scr_seq_release_narc_0587_bin, NARC_msg_narc_0128_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0124_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06R0101 + { NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0182_bin, NARC_scr_seq_release_narc_0125_bin, NARC_scr_seq_release_narc_0588_bin, NARC_msg_narc_0129_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0125_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06R0102 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0126_bin, NARC_scr_seq_release_narc_0589_bin, NARC_msg_narc_0130_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0126_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0127_bin, NARC_scr_seq_release_narc_0590_bin, NARC_msg_narc_0131_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0127_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06R0301 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0128_bin, NARC_scr_seq_release_narc_0591_bin, NARC_msg_narc_0132_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0128_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0129_bin, NARC_scr_seq_release_narc_0592_bin, NARC_msg_narc_0133_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0129_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06R0501 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0130_bin, NARC_scr_seq_release_narc_0593_bin, NARC_msg_narc_0134_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0130_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06R0601 + { NARC_area_data_narc_0011_bin, NARC_move_model_list_narc_0005_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0131_bin, NARC_scr_seq_release_narc_0594_bin, NARC_msg_narc_0135_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0131_bin, MAPSEC_VEILSTONE_CITY, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C07 + { NARC_area_data_narc_0029_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0115_bin, NARC_scr_seq_release_narc_0132_bin, NARC_scr_seq_release_narc_0595_bin, NARC_msg_narc_0136_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0132_bin, MAPSEC_VEILSTONE_CITY, 0, 10, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07GYM0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0133_bin, NARC_scr_seq_release_narc_0596_bin, NARC_msg_narc_0137_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0133_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0134_bin, NARC_scr_seq_release_narc_0597_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0134_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07PC0102 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0139_bin, NARC_scr_seq_release_narc_0136_bin, NARC_scr_seq_release_narc_0599_bin, NARC_msg_narc_0139_bin, SEQ_BLD_GAME, SEQ_BLD_GAME, 0xFFFF, NARC_zone_event_release_narc_0135_bin, MAPSEC_GAME_CORNER, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0101 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0172_bin, NARC_scr_seq_release_narc_0137_bin, NARC_scr_seq_release_narc_0600_bin, NARC_msg_narc_0140_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0136_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0201 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0173_bin, NARC_scr_seq_release_narc_0138_bin, NARC_scr_seq_release_narc_0601_bin, NARC_msg_narc_0141_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0137_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0202 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0174_bin, NARC_scr_seq_release_narc_0139_bin, NARC_scr_seq_release_narc_0602_bin, NARC_msg_narc_0142_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0138_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0203 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0175_bin, NARC_scr_seq_release_narc_0140_bin, NARC_scr_seq_release_narc_0603_bin, NARC_msg_narc_0143_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0139_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0204 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0176_bin, NARC_scr_seq_release_narc_0141_bin, NARC_scr_seq_release_narc_0604_bin, NARC_msg_narc_0144_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0140_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0205 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0142_bin, NARC_scr_seq_release_narc_0605_bin, NARC_msg_narc_0145_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0141_bin, MAPSEC_VEILSTONE_STORE, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0206 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0177_bin, NARC_scr_seq_release_narc_0143_bin, NARC_scr_seq_release_narc_0606_bin, NARC_msg_narc_0146_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0142_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0301 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0204_bin, NARC_scr_seq_release_narc_0144_bin, NARC_scr_seq_release_narc_0607_bin, NARC_msg_narc_0147_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0143_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0145_bin, NARC_scr_seq_release_narc_0608_bin, NARC_msg_narc_0148_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0144_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0501 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0146_bin, NARC_scr_seq_release_narc_0609_bin, NARC_msg_narc_0149_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0145_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0601 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0147_bin, NARC_scr_seq_release_narc_0610_bin, NARC_msg_narc_0150_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0146_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0701 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0148_bin, NARC_scr_seq_release_narc_0611_bin, NARC_msg_narc_0151_bin, SEQ_CITY07_D, SEQ_CITY07_N, 0xFFFF, NARC_zone_event_release_narc_0147_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0801 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0149_bin, NARC_scr_seq_release_narc_0612_bin, NARC_msg_narc_0152_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0148_bin, MAPSEC_ROUTE_215, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07R0901 + { NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0007_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0150_bin, NARC_scr_seq_release_narc_0613_bin, NARC_msg_narc_0153_bin, SEQ_CITY08_D, SEQ_CITY08_N, ENCDATA(NARC_d_enc_data_narc_0003_bin, NARC_p_enc_data_narc_0003_bin), NARC_zone_event_release_narc_0149_bin, MAPSEC_SUNYSHORE_CITY, 0, 11, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C08 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0155_bin, NARC_scr_seq_release_narc_0618_bin, NARC_msg_narc_0157_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0150_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0156_bin, NARC_scr_seq_release_narc_0619_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0151_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08PC0102 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0151_bin, NARC_scr_seq_release_narc_0614_bin, NARC_msg_narc_0154_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0152_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08FS0101 + { NARC_area_data_narc_0030_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0226_bin, NARC_scr_seq_release_narc_0152_bin, NARC_scr_seq_release_narc_0615_bin, NARC_msg_narc_0155_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0153_bin, MAPSEC_SUNYSHORE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08GYM0101 + { NARC_area_data_narc_0030_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0227_bin, NARC_scr_seq_release_narc_0153_bin, NARC_scr_seq_release_narc_0616_bin, NARC_msg_narc_0018_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0154_bin, MAPSEC_SUNYSHORE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08GYM0102 + { NARC_area_data_narc_0030_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0228_bin, NARC_scr_seq_release_narc_0154_bin, NARC_scr_seq_release_narc_0617_bin, NARC_msg_narc_0156_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0155_bin, MAPSEC_SUNYSHORE_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08GYM0103 + { NARC_area_data_narc_0038_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0203_bin, NARC_scr_seq_release_narc_0158_bin, NARC_scr_seq_release_narc_0621_bin, NARC_msg_narc_0158_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0156_bin, MAPSEC_SUNYSHORE_MARKET, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0159_bin, NARC_scr_seq_release_narc_0622_bin, NARC_msg_narc_0159_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0157_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0160_bin, NARC_scr_seq_release_narc_0623_bin, NARC_msg_narc_0160_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0158_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0301 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0161_bin, NARC_scr_seq_release_narc_0624_bin, NARC_msg_narc_0161_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0159_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0162_bin, NARC_scr_seq_release_narc_0625_bin, NARC_msg_narc_0162_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0160_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0501 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0163_bin, NARC_scr_seq_release_narc_0626_bin, NARC_msg_narc_0163_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0161_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0601 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0164_bin, NARC_scr_seq_release_narc_0627_bin, NARC_msg_narc_0164_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0162_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0701 + { NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0230_bin, NARC_scr_seq_release_narc_0165_bin, NARC_scr_seq_release_narc_0628_bin, NARC_msg_narc_0165_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0163_bin, MAPSEC_VISTA_LIGHTHOUSE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0801 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0168_bin, NARC_scr_seq_release_narc_0631_bin, NARC_msg_narc_0167_bin, SEQ_CITY09_D, SEQ_CITY09_N, 0xFFFF, NARC_zone_event_release_narc_0164_bin, MAPSEC_SNOWPOINT_CITY, 28, 0, 1, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_C09 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0169_bin, NARC_scr_seq_release_narc_0632_bin, NARC_msg_narc_0168_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0165_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C09FS0101 + { NARC_area_data_narc_0028_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0114_bin, NARC_scr_seq_release_narc_0170_bin, NARC_scr_seq_release_narc_0633_bin, NARC_msg_narc_0169_bin, SEQ_GYM, SEQ_GYM, 0xFFFF, NARC_zone_event_release_narc_0166_bin, MAPSEC_SNOWPOINT_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C09GYM0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0171_bin, NARC_scr_seq_release_narc_0634_bin, NARC_msg_narc_0170_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0167_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C09PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0172_bin, NARC_scr_seq_release_narc_0635_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0168_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C09PC0102 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0174_bin, NARC_scr_seq_release_narc_0637_bin, NARC_msg_narc_0171_bin, SEQ_CITY09_D, SEQ_CITY09_N, 0xFFFF, NARC_zone_event_release_narc_0169_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C09R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0175_bin, NARC_scr_seq_release_narc_0638_bin, NARC_msg_narc_0172_bin, SEQ_CITY09_D, SEQ_CITY09_N, 0xFFFF, NARC_zone_event_release_narc_0170_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C09R0201 + { NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0010_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0176_bin, NARC_scr_seq_release_narc_0639_bin, NARC_msg_narc_0173_bin, SEQ_CITY10_D, SEQ_CITY10_N, ENCDATA(NARC_d_enc_data_narc_0004_bin, NARC_p_enc_data_narc_0004_bin), NARC_zone_event_release_narc_0171_bin, MAPSEC_POKEMON_LEAGUE, 8, 11, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C10 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0177_bin, NARC_scr_seq_release_narc_0640_bin, NARC_msg_narc_0174_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0172_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C10PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0178_bin, NARC_scr_seq_release_narc_0641_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0173_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C10PC0102 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0144_bin, NARC_scr_seq_release_narc_0180_bin, NARC_scr_seq_release_narc_0643_bin, NARC_msg_narc_0175_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0174_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0101 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0187_bin, NARC_scr_seq_release_narc_0181_bin, NARC_scr_seq_release_narc_0644_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0175_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0102 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0183_bin, NARC_scr_seq_release_narc_0182_bin, NARC_scr_seq_release_narc_0645_bin, NARC_msg_narc_0176_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0176_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0103 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0188_bin, NARC_scr_seq_release_narc_0183_bin, NARC_scr_seq_release_narc_0646_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0177_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0104 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0184_bin, NARC_scr_seq_release_narc_0184_bin, NARC_scr_seq_release_narc_0647_bin, NARC_msg_narc_0177_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0178_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0105 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0188_bin, NARC_scr_seq_release_narc_0185_bin, NARC_scr_seq_release_narc_0648_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0179_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0106 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0185_bin, NARC_scr_seq_release_narc_0186_bin, NARC_scr_seq_release_narc_0649_bin, NARC_msg_narc_0178_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0180_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0107 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0188_bin, NARC_scr_seq_release_narc_0187_bin, NARC_scr_seq_release_narc_0650_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0181_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0108 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0186_bin, NARC_scr_seq_release_narc_0188_bin, NARC_scr_seq_release_narc_0651_bin, NARC_msg_narc_0179_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0182_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0109 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0189_bin, NARC_scr_seq_release_narc_0189_bin, NARC_scr_seq_release_narc_0652_bin, NARC_msg_narc_0018_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0183_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0110 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0190_bin, NARC_scr_seq_release_narc_0190_bin, NARC_scr_seq_release_narc_0653_bin, NARC_msg_narc_0180_bin, SEQ_D_LEAGUE, SEQ_D_LEAGUE, 0xFFFF, NARC_zone_event_release_narc_0184_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0111 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0192_bin, NARC_scr_seq_release_narc_0191_bin, NARC_scr_seq_release_narc_0654_bin, NARC_msg_narc_0181_bin, SEQ_BLD_DENDO, SEQ_BLD_DENDO, 0xFFFF, NARC_zone_event_release_narc_0185_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0112 + { NARC_area_data_narc_0036_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0191_bin, NARC_scr_seq_release_narc_0192_bin, NARC_scr_seq_release_narc_0655_bin, NARC_msg_narc_0182_bin, SEQ_BLD_DENDO, SEQ_BLD_DENDO, 0xFFFF, NARC_zone_event_release_narc_0186_bin, MAPSEC_POKEMON_LEAGUE, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0113 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0195_bin, NARC_scr_seq_release_narc_0658_bin, NARC_msg_narc_0183_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0187_bin, MAPSEC_FIGHT_AREA, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_C11 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0197_bin, NARC_scr_seq_release_narc_0660_bin, NARC_msg_narc_0185_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0188_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0198_bin, NARC_scr_seq_release_narc_0661_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0189_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11PC0102 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0196_bin, NARC_scr_seq_release_narc_0659_bin, NARC_msg_narc_0184_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0190_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11FS0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0159_bin, NARC_scr_seq_release_narc_0200_bin, NARC_scr_seq_release_narc_0663_bin, NARC_msg_narc_0186_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0191_bin, MAPSEC_BATTLE_PARK, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0201_bin, NARC_scr_seq_release_narc_0664_bin, NARC_msg_narc_0187_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0192_bin, MAPSEC_ROUTE_225, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0202_bin, NARC_scr_seq_release_narc_0665_bin, NARC_msg_narc_0188_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0193_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11R0301 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0203_bin, NARC_scr_seq_release_narc_0666_bin, NARC_msg_narc_0189_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0194_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11R0501 + { NARC_area_data_narc_0045_bin, 45, NARC_map_matrix_narc_0005_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0195_bin, MAPSEC_OREBURGH_MINE, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE }, // MAP_D01 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0005_bin, NARC_scr_seq_release_narc_0208_bin, NARC_scr_seq_release_narc_0668_bin, NARC_msg_narc_0208_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0005_bin, NARC_p_enc_data_narc_0005_bin), NARC_zone_event_release_narc_0196_bin, MAPSEC_OREBURGH_MINE, 0, 12, 3, 9, TRUE, FALSE, TRUE, FALSE }, // MAP_D01R0101 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0006_bin, NARC_scr_seq_release_narc_0209_bin, NARC_scr_seq_release_narc_0669_bin, NARC_msg_narc_0209_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0006_bin, NARC_p_enc_data_narc_0006_bin), NARC_zone_event_release_narc_0197_bin, MAPSEC_OREBURGH_MINE, 0, 12, 3, 9, TRUE, FALSE, TRUE, FALSE }, // MAP_D01R0102 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0210_bin, NARC_scr_seq_release_narc_0670_bin, NARC_msg_narc_0210_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0007_bin, NARC_p_enc_data_narc_0007_bin), NARC_zone_event_release_narc_0198_bin, MAPSEC_VALLEY_WINDWORKS, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_D02 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0234_bin, NARC_scr_seq_release_narc_0211_bin, NARC_scr_seq_release_narc_0671_bin, NARC_msg_narc_0211_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0199_bin, MAPSEC_VALLEY_WINDWORKS, 0, 4, 3, 7, FALSE, TRUE, FALSE, FALSE }, // MAP_D02R0101 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0212_bin, NARC_scr_seq_release_narc_0672_bin, NARC_msg_narc_0212_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, 0xFFFF, NARC_zone_event_release_narc_0200_bin, MAPSEC_ETERNA_FOREST, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_D03 + { NARC_area_data_narc_0044_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0007_bin, NARC_scr_seq_release_narc_0213_bin, NARC_scr_seq_release_narc_0673_bin, NARC_msg_narc_0213_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0008_bin, NARC_p_enc_data_narc_0008_bin), NARC_zone_event_release_narc_0201_bin, MAPSEC_ETERNA_FOREST, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_D03R0101 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0214_bin, NARC_scr_seq_release_narc_0674_bin, NARC_msg_narc_0214_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0009_bin, NARC_p_enc_data_narc_0009_bin), NARC_zone_event_release_narc_0202_bin, MAPSEC_FUEGO_IRONWORKS, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_D04 + { NARC_area_data_narc_0057_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0008_bin, NARC_scr_seq_release_narc_0215_bin, NARC_scr_seq_release_narc_0675_bin, NARC_msg_narc_0215_bin, SEQ_D_04, SEQ_D_04, 0xFFFF, NARC_zone_event_release_narc_0203_bin, MAPSEC_FUEGO_IRONWORKS, 0, 4, 3, 7, FALSE, TRUE, FALSE, FALSE }, // MAP_D04R0101 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D05 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0009_bin, NARC_scr_seq_release_narc_0217_bin, NARC_scr_seq_release_narc_0677_bin, NARC_msg_narc_0216_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0010_bin, NARC_p_enc_data_narc_0010_bin), NARC_zone_event_release_narc_0204_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0101 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0010_bin, NARC_scr_seq_release_narc_0218_bin, NARC_scr_seq_release_narc_0678_bin, NARC_msg_narc_0217_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0011_bin, NARC_p_enc_data_narc_0011_bin), NARC_zone_event_release_narc_0205_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0011_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0012_bin, NARC_p_enc_data_narc_0012_bin), NARC_zone_event_release_narc_0206_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0103 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0012_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0013_bin, NARC_p_enc_data_narc_0013_bin), NARC_zone_event_release_narc_0207_bin, MAPSEC_MT_CORONET, 6, 7, 2, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_D05R0104 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0013_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0014_bin, NARC_p_enc_data_narc_0014_bin), NARC_zone_event_release_narc_0208_bin, MAPSEC_MT_CORONET, 6, 6, 2, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_D05R0105 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0014_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0015_bin, NARC_p_enc_data_narc_0015_bin), NARC_zone_event_release_narc_0209_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0106 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0015_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0016_bin, NARC_p_enc_data_narc_0016_bin), NARC_zone_event_release_narc_0210_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0107 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0016_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0017_bin, NARC_p_enc_data_narc_0017_bin), NARC_zone_event_release_narc_0211_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0108 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0017_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0018_bin, NARC_p_enc_data_narc_0018_bin), NARC_zone_event_release_narc_0212_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0109 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0018_bin, NARC_scr_seq_release_narc_0226_bin, NARC_scr_seq_release_narc_0686_bin, NARC_msg_narc_0218_bin, SEQ_D_MOUNT1, SEQ_D_MOUNT1, ENCDATA(NARC_d_enc_data_narc_0019_bin, NARC_p_enc_data_narc_0019_bin), NARC_zone_event_release_narc_0213_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0110 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0019_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0020_bin, NARC_p_enc_data_narc_0020_bin), NARC_zone_event_release_narc_0214_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0111 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0020_bin, NARC_scr_seq_release_narc_0228_bin, NARC_scr_seq_release_narc_0688_bin, NARC_msg_narc_0219_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0021_bin, NARC_p_enc_data_narc_0021_bin), NARC_zone_event_release_narc_0215_bin, MAPSEC_MT_CORONET, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0112 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0021_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0022_bin, NARC_p_enc_data_narc_0022_bin), NARC_zone_event_release_narc_0216_bin, MAPSEC_MT_CORONET, 14, 0, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D05R0113 + { NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0022_bin, NARC_scr_seq_release_narc_0230_bin, NARC_scr_seq_release_narc_0690_bin, NARC_msg_narc_0220_bin, SEQ_D_MOUNT2, SEQ_D_MOUNT2, 0xFFFF, NARC_zone_event_release_narc_0217_bin, MAPSEC_SPEAR_PILLAR, 13, 5, 2, 4, FALSE, TRUE, FALSE, FALSE }, // MAP_D05R0114 + { NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0023_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT2, SEQ_D_MOUNT2, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_SPEAR_PILLAR, 13, 5, 2, 4, FALSE, TRUE, FALSE, FALSE }, // MAP_D05R0115 + { NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D06 + { NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0024_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0218_bin, MAPSEC_PASTORIA_CITY, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D06R0101 + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D07 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0025_bin, NARC_scr_seq_release_narc_0241_bin, NARC_scr_seq_release_narc_0701_bin, NARC_msg_narc_0229_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0029_bin, NARC_p_enc_data_narc_0029_bin), NARC_zone_event_release_narc_0219_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0101 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0026_bin, NARC_scr_seq_release_narc_0242_bin, NARC_scr_seq_release_narc_0702_bin, NARC_msg_narc_0230_bin, SEQ_D_02, SEQ_D_02, 0xFFFF, NARC_zone_event_release_narc_0220_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0102 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0040_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0030_bin, NARC_p_enc_data_narc_0030_bin), NARC_zone_event_release_narc_0221_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0103 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0031_bin, NARC_p_enc_data_narc_0031_bin), NARC_zone_event_release_narc_0222_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0104 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0039_bin, NARC_scr_seq_release_narc_0245_bin, NARC_scr_seq_release_narc_0705_bin, NARC_msg_narc_0231_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0032_bin, NARC_p_enc_data_narc_0032_bin), NARC_zone_event_release_narc_0223_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0105 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0033_bin, NARC_p_enc_data_narc_0033_bin), NARC_zone_event_release_narc_0224_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0106 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0034_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0034_bin, NARC_p_enc_data_narc_0034_bin), NARC_zone_event_release_narc_0225_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0107 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0035_bin, NARC_p_enc_data_narc_0035_bin), NARC_zone_event_release_narc_0226_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0108 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0040_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0036_bin, NARC_p_enc_data_narc_0036_bin), NARC_zone_event_release_narc_0227_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0109 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0042_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0037_bin, NARC_p_enc_data_narc_0037_bin), NARC_zone_event_release_narc_0228_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0110 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0038_bin, NARC_p_enc_data_narc_0038_bin), NARC_zone_event_release_narc_0229_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0111 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0039_bin, NARC_p_enc_data_narc_0039_bin), NARC_zone_event_release_narc_0230_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0112 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0036_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0040_bin, NARC_p_enc_data_narc_0040_bin), NARC_zone_event_release_narc_0231_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0113 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0034_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0041_bin, NARC_p_enc_data_narc_0041_bin), NARC_zone_event_release_narc_0232_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0114 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0030_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0042_bin, NARC_p_enc_data_narc_0042_bin), NARC_zone_event_release_narc_0233_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0115 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0041_bin, NARC_scr_seq_release_narc_0256_bin, NARC_scr_seq_release_narc_0716_bin, NARC_msg_narc_0232_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0043_bin, NARC_p_enc_data_narc_0043_bin), NARC_zone_event_release_narc_0234_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0116 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0044_bin, NARC_p_enc_data_narc_0044_bin), NARC_zone_event_release_narc_0235_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0117 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0035_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0045_bin, NARC_p_enc_data_narc_0045_bin), NARC_zone_event_release_narc_0236_bin, MAPSEC_SOLACEON_RUINS, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0118 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D09 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0043_bin, NARC_scr_seq_release_narc_0259_bin, NARC_scr_seq_release_narc_0719_bin, NARC_msg_narc_0233_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0047_bin, NARC_p_enc_data_narc_0047_bin), NARC_zone_event_release_narc_0237_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D09R0101 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0044_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0048_bin, NARC_p_enc_data_narc_0048_bin), NARC_zone_event_release_narc_0238_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D09R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0045_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0049_bin, NARC_p_enc_data_narc_0049_bin), NARC_zone_event_release_narc_0239_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D09R0103 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0046_bin, NARC_scr_seq_release_narc_0262_bin, NARC_scr_seq_release_narc_0722_bin, NARC_msg_narc_0234_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0050_bin, NARC_p_enc_data_narc_0050_bin), NARC_zone_event_release_narc_0240_bin, MAPSEC_VICTORY_ROAD, 14, 0, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D09R0104 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0047_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0051_bin, NARC_p_enc_data_narc_0051_bin), NARC_zone_event_release_narc_0241_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D09R0105 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0048_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, ENCDATA(NARC_d_enc_data_narc_0052_bin, NARC_p_enc_data_narc_0052_bin), NARC_zone_event_release_narc_0242_bin, MAPSEC_VICTORY_ROAD, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D09R0106 + { NARC_area_data_narc_0004_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0049_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0243_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE }, // MAP_D10 + { NARC_area_data_narc_0051_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0049_bin, NARC_scr_seq_release_narc_0265_bin, NARC_scr_seq_release_narc_0725_bin, NARC_msg_narc_0235_bin, SEQ_SILENCE_DUNGEON, SEQ_SILENCE_DUNGEON, 0xFFFF, NARC_zone_event_release_narc_0244_bin, MAPSEC_PAL_PARK, 0, 2, 2, 0, TRUE, FALSE, FALSE, FALSE }, // MAP_D10R0101 + { NARC_area_data_narc_0009_bin, NARC_move_model_list_narc_0003_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D11 + { NARC_area_data_narc_0049_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0050_bin, NARC_scr_seq_release_narc_0266_bin, NARC_scr_seq_release_narc_0726_bin, NARC_msg_narc_0236_bin, SEQ_D_KOUEN, SEQ_D_KOUEN, 0xFFFF, NARC_zone_event_release_narc_0245_bin, MAPSEC_AMITY_SQUARE, 0, 2, 2, 0, FALSE, TRUE, FALSE, FALSE }, // MAP_D11R0101 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0051_bin, NARC_scr_seq_release_narc_0267_bin, NARC_scr_seq_release_narc_0727_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0053_bin, NARC_p_enc_data_narc_0053_bin), NARC_zone_event_release_narc_0246_bin, MAPSEC_RAVAGED_PATH, 0, 12, 3, 9, TRUE, TRUE, TRUE, FALSE }, // MAP_D12R0101 + { NARC_area_data_narc_0044_bin, 44, NARC_map_matrix_narc_0052_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0247_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE }, // MAP_D13 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0052_bin, NARC_scr_seq_release_narc_0269_bin, NARC_scr_seq_release_narc_0729_bin, NARC_msg_narc_0238_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0248_bin, MAPSEC_FLOAROMA_MEADOW, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_D13R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0270_bin, NARC_scr_seq_release_narc_0730_bin, NARC_msg_narc_0239_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0249_bin, MAPSEC_FLOAROMA_MEADOW, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D13R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0003_bin, NARC_scr_seq_release_narc_0271_bin, NARC_scr_seq_release_narc_0731_bin, NARC_msg_narc_0240_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0054_bin, NARC_p_enc_data_narc_0054_bin), NARC_zone_event_release_narc_0250_bin, MAPSEC_OREBURGH_GATE, 0, 12, 3, 9, TRUE, TRUE, TRUE, FALSE }, // MAP_D14R0101 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0004_bin, NARC_scr_seq_release_narc_0272_bin, NARC_scr_seq_release_narc_0732_bin, NARC_msg_narc_0241_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0055_bin, NARC_p_enc_data_narc_0055_bin), NARC_zone_event_release_narc_0251_bin, MAPSEC_OREBURGH_GATE, 1, 12, 3, 9, TRUE, TRUE, TRUE, FALSE }, // MAP_D14R0102 + { NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0273_bin, NARC_scr_seq_release_narc_0733_bin, NARC_msg_narc_0242_bin, SEQ_D_02, SEQ_D_02, 0xFFFF, NARC_zone_event_release_narc_0252_bin, MAPSEC_FULLMOON_ISLAND, 0, 0, 2, 0, FALSE, TRUE, FALSE, TRUE }, // MAP_D15 + { NARC_area_data_narc_0044_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0053_bin, NARC_scr_seq_release_narc_0274_bin, NARC_scr_seq_release_narc_0734_bin, NARC_msg_narc_0243_bin, SEQ_D_02, SEQ_D_02, 0xFFFF, NARC_zone_event_release_narc_0253_bin, MAPSEC_FULLMOON_ISLAND, 0, 2, 3, 3, FALSE, TRUE, FALSE, FALSE }, // MAP_D15R0101 + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0275_bin, NARC_scr_seq_release_narc_0735_bin, NARC_msg_narc_0244_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0056_bin, NARC_p_enc_data_narc_0056_bin), NARC_zone_event_release_narc_0254_bin, MAPSEC_STARK_MOUNTAIN, 9, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_D16 + { NARC_area_data_narc_0047_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0057_bin, NARC_scr_seq_release_narc_0276_bin, NARC_scr_seq_release_narc_0736_bin, NARC_msg_narc_0245_bin, SEQ_D_06, SEQ_D_06, ENCDATA(NARC_d_enc_data_narc_0057_bin, NARC_p_enc_data_narc_0057_bin), NARC_zone_event_release_narc_0255_bin, MAPSEC_STARK_MOUNTAIN, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D16R0101 + { NARC_area_data_narc_0047_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0058_bin, NARC_scr_seq_release_narc_0277_bin, NARC_scr_seq_release_narc_0737_bin, NARC_msg_narc_0246_bin, SEQ_D_06, SEQ_D_06, ENCDATA(NARC_d_enc_data_narc_0058_bin, NARC_p_enc_data_narc_0058_bin), NARC_zone_event_release_narc_0256_bin, MAPSEC_STARK_MOUNTAIN, 0, 8, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D16R0102 + { NARC_area_data_narc_0047_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0059_bin, NARC_scr_seq_release_narc_0278_bin, NARC_scr_seq_release_narc_0738_bin, NARC_msg_narc_0247_bin, SEQ_D_06, SEQ_D_06, 0xFFFF, NARC_zone_event_release_narc_0257_bin, MAPSEC_STARK_MOUNTAIN, 0, 12, 3, 10, TRUE, TRUE, FALSE, FALSE }, // MAP_D16R0103 + { NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D17 + { NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0060_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0059_bin, NARC_p_enc_data_narc_0059_bin), NARC_zone_event_release_narc_0258_bin, MAPSEC_SENDOFF_SPRING, 8, 0, 3, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_D17R0101 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0061_bin, NARC_scr_seq_release_narc_0281_bin, NARC_scr_seq_release_narc_0741_bin, NARC_msg_narc_0248_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0259_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0102 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0062_bin, NARC_scr_seq_release_narc_0282_bin, NARC_scr_seq_release_narc_0742_bin, NARC_msg_narc_0249_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0260_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0103 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0063_bin, NARC_scr_seq_release_narc_0283_bin, NARC_scr_seq_release_narc_0743_bin, NARC_msg_narc_0250_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0261_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0104 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0284_bin, NARC_scr_seq_release_narc_0744_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0063_bin, NARC_p_enc_data_narc_0063_bin), NARC_zone_event_release_narc_0262_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0105 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0285_bin, NARC_scr_seq_release_narc_0745_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0064_bin, NARC_p_enc_data_narc_0064_bin), NARC_zone_event_release_narc_0263_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0106 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0286_bin, NARC_scr_seq_release_narc_0746_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0065_bin, NARC_p_enc_data_narc_0065_bin), NARC_zone_event_release_narc_0264_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0107 + { NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0010_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0302_bin, NARC_scr_seq_release_narc_0762_bin, NARC_msg_narc_0251_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0265_bin, MAPSEC_FLOWER_PARADISE, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_D18 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, FALSE, FALSE, FALSE, FALSE }, // MAP_D18R0101 + { NARC_area_data_narc_0011_bin, NARC_move_model_list_narc_0005_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D19A + { NARC_area_data_narc_0011_bin, NARC_move_model_list_narc_0005_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_01, SEQ_D_01, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, TRUE, TRUE, FALSE, FALSE }, // MAP_D19B + { NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0068_bin, NARC_scr_seq_release_narc_0304_bin, NARC_scr_seq_release_narc_0764_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0106_bin, NARC_p_enc_data_narc_0106_bin), NARC_zone_event_release_narc_0266_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D20R0101 + { NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0069_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0107_bin, NARC_p_enc_data_narc_0107_bin), NARC_zone_event_release_narc_0267_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D20R0102 + { NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0070_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0108_bin, NARC_p_enc_data_narc_0108_bin), NARC_zone_event_release_narc_0268_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D20R0103 + { NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0071_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0109_bin, NARC_p_enc_data_narc_0109_bin), NARC_zone_event_release_narc_0269_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D20R0104 + { NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0072_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0110_bin, NARC_p_enc_data_narc_0110_bin), NARC_zone_event_release_narc_0270_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D20R0105 + { NARC_area_data_narc_0055_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0073_bin, NARC_scr_seq_release_narc_0309_bin, NARC_scr_seq_release_narc_0769_bin, NARC_msg_narc_0252_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0111_bin, NARC_p_enc_data_narc_0111_bin), NARC_zone_event_release_narc_0271_bin, MAPSEC_SNOWPOINT_TEMPLE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D20R0106 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0074_bin, NARC_scr_seq_release_narc_0310_bin, NARC_scr_seq_release_narc_0770_bin, NARC_msg_narc_0253_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0112_bin, NARC_p_enc_data_narc_0112_bin), NARC_zone_event_release_narc_0272_bin, MAPSEC_WAYWARD_CAVE, 16, 12, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D21R0101 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0075_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_05, SEQ_D_05, ENCDATA(NARC_d_enc_data_narc_0113_bin, NARC_p_enc_data_narc_0113_bin), NARC_zone_event_release_narc_0273_bin, MAPSEC_WAYWARD_CAVE, 0, 12, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D21R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0076_bin, NARC_scr_seq_release_narc_0312_bin, NARC_scr_seq_release_narc_0772_bin, NARC_msg_narc_0254_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0114_bin, NARC_p_enc_data_narc_0114_bin), NARC_zone_event_release_narc_0274_bin, MAPSEC_RUIN_MANIAC_CAVE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D22R0101 + { NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0079_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0117_bin, NARC_p_enc_data_narc_0117_bin), NARC_zone_event_release_narc_0275_bin, MAPSEC_TROPHY_GARDEN, 0, 2, 2, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_D23R0101 + { NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0316_bin, NARC_scr_seq_release_narc_0776_bin, NARC_msg_narc_0257_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0118_bin, NARC_p_enc_data_narc_0118_bin), NARC_zone_event_release_narc_0276_bin, MAPSEC_IRON_ISLAND, 8, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_D24 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0080_bin, NARC_scr_seq_release_narc_0317_bin, NARC_scr_seq_release_narc_0777_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0119_bin, NARC_p_enc_data_narc_0119_bin), NARC_zone_event_release_narc_0277_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D24R0101 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0081_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0120_bin, NARC_p_enc_data_narc_0120_bin), NARC_zone_event_release_narc_0278_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D24R0102 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0082_bin, NARC_scr_seq_release_narc_0319_bin, NARC_scr_seq_release_narc_0779_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0121_bin, NARC_p_enc_data_narc_0121_bin), NARC_zone_event_release_narc_0279_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D24R0103 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0083_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0122_bin, NARC_p_enc_data_narc_0122_bin), NARC_zone_event_release_narc_0280_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D24R0104 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0084_bin, NARC_scr_seq_release_narc_0321_bin, NARC_scr_seq_release_narc_0781_bin, NARC_msg_narc_0258_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0123_bin, NARC_p_enc_data_narc_0123_bin), NARC_zone_event_release_narc_0281_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D24R0105 + { NARC_area_data_narc_0045_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0085_bin, NARC_scr_seq_release_narc_0322_bin, NARC_scr_seq_release_narc_0782_bin, NARC_msg_narc_0018_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0124_bin, NARC_p_enc_data_narc_0124_bin), NARC_zone_event_release_narc_0282_bin, MAPSEC_IRON_ISLAND, 0, 13, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D24R0106 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0086_bin, NARC_scr_seq_release_narc_0324_bin, NARC_scr_seq_release_narc_0784_bin, NARC_msg_narc_0260_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0125_bin, NARC_p_enc_data_narc_0125_bin), NARC_zone_event_release_narc_0283_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0101 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0087_bin, NARC_scr_seq_release_narc_0325_bin, NARC_scr_seq_release_narc_0785_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0126_bin, NARC_p_enc_data_narc_0126_bin), NARC_zone_event_release_narc_0284_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0102 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0088_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0127_bin, NARC_p_enc_data_narc_0127_bin), NARC_zone_event_release_narc_0285_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0103 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0089_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0128_bin, NARC_p_enc_data_narc_0128_bin), NARC_zone_event_release_narc_0286_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0104 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0090_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0129_bin, NARC_p_enc_data_narc_0129_bin), NARC_zone_event_release_narc_0287_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0105 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0091_bin, NARC_scr_seq_release_narc_0329_bin, NARC_scr_seq_release_narc_0789_bin, NARC_msg_narc_0261_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0130_bin, NARC_p_enc_data_narc_0130_bin), NARC_zone_event_release_narc_0288_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0106 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0092_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0131_bin, NARC_p_enc_data_narc_0131_bin), NARC_zone_event_release_narc_0289_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0107 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0093_bin, NARC_scr_seq_release_narc_0331_bin, NARC_scr_seq_release_narc_0791_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0132_bin, NARC_p_enc_data_narc_0132_bin), NARC_zone_event_release_narc_0290_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0108 + { NARC_area_data_narc_0056_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0094_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0133_bin, NARC_p_enc_data_narc_0133_bin), NARC_zone_event_release_narc_0291_bin, MAPSEC_OLD_CHATEAU, 0, 4, 3, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R0109 + { NARC_area_data_narc_0031_bin, 31, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 3, 9, FALSE, FALSE, FALSE, FALSE }, // MAP_D25R1001 + { NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0095_bin, NARC_scr_seq_release_narc_0333_bin, NARC_scr_seq_release_narc_0793_bin, NARC_msg_narc_0262_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0292_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0101 + { NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0096_bin, NARC_scr_seq_release_narc_0334_bin, NARC_scr_seq_release_narc_0794_bin, NARC_msg_narc_0263_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0293_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0102 + { NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0097_bin, NARC_scr_seq_release_narc_0335_bin, NARC_scr_seq_release_narc_0795_bin, NARC_msg_narc_0264_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0294_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0103 + { NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0098_bin, NARC_scr_seq_release_narc_0336_bin, NARC_scr_seq_release_narc_0796_bin, NARC_msg_narc_0265_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0295_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0104 + { NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0100_bin, NARC_scr_seq_release_narc_0337_bin, NARC_scr_seq_release_narc_0797_bin, NARC_msg_narc_0266_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0296_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0105 + { NARC_area_data_narc_0048_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0099_bin, NARC_scr_seq_release_narc_0338_bin, NARC_scr_seq_release_narc_0798_bin, NARC_msg_narc_0267_bin, SEQ_D_AGITO, SEQ_D_AGITO, 0xFFFF, NARC_zone_event_release_narc_0297_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0106 + { NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0101_bin, NARC_scr_seq_release_narc_0342_bin, NARC_scr_seq_release_narc_0802_bin, NARC_msg_narc_0270_bin, SEQ_D_LAKE, SEQ_D_LAKE, ENCDATA(NARC_d_enc_data_narc_0134_bin, NARC_p_enc_data_narc_0134_bin), NARC_zone_event_release_narc_0298_bin, MAPSEC_LAKE_VERITY, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_D27R0101 + { NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0102_bin, NARC_scr_seq_release_narc_0343_bin, NARC_scr_seq_release_narc_0803_bin, NARC_msg_narc_0271_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, ENCDATA(NARC_d_enc_data_narc_0135_bin, NARC_p_enc_data_narc_0135_bin), NARC_zone_event_release_narc_0299_bin, MAPSEC_LAKE_VERITY, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_D27R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0103_bin, NARC_scr_seq_release_narc_0344_bin, NARC_scr_seq_release_narc_0804_bin, NARC_msg_narc_0272_bin, SEQ_D_RYAYHY, SEQ_D_RYAYHY, 0xFFFF, NARC_zone_event_release_narc_0300_bin, MAPSEC_VERITY_CAVERN, 0, 12, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D27R0103 + { NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0104_bin, NARC_scr_seq_release_narc_0346_bin, NARC_scr_seq_release_narc_0806_bin, NARC_msg_narc_0273_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0301_bin, MAPSEC_LAKE_VALOR, 0, 2, 3, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_D28R0101 + { NARC_area_data_narc_0052_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0105_bin, NARC_scr_seq_release_narc_0347_bin, NARC_scr_seq_release_narc_0807_bin, NARC_msg_narc_0274_bin, SEQ_D_LAKE, SEQ_D_LAKE, ENCDATA(NARC_d_enc_data_narc_0136_bin, NARC_p_enc_data_narc_0136_bin), NARC_zone_event_release_narc_0302_bin, MAPSEC_LAKE_VALOR, 0, 2, 3, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_D28R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0106_bin, NARC_scr_seq_release_narc_0348_bin, NARC_scr_seq_release_narc_0808_bin, NARC_msg_narc_0275_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, 0xFFFF, NARC_zone_event_release_narc_0303_bin, MAPSEC_VALOR_CAVERN, 0, 12, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D28R0103 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0107_bin, NARC_scr_seq_release_narc_0350_bin, NARC_scr_seq_release_narc_0810_bin, NARC_msg_narc_0276_bin, SEQ_D_LAKE, SEQ_D_LAKE, 0xFFFF, NARC_zone_event_release_narc_0304_bin, MAPSEC_LAKE_ACUITY, 0, 15, 3, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_D29R0101 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0108_bin, NARC_scr_seq_release_narc_0351_bin, NARC_scr_seq_release_narc_0811_bin, NARC_msg_narc_0277_bin, SEQ_D_GINLOBBY, SEQ_D_GINLOBBY, ENCDATA(NARC_d_enc_data_narc_0137_bin, NARC_p_enc_data_narc_0137_bin), NARC_zone_event_release_narc_0305_bin, MAPSEC_LAKE_ACUITY, 0, 15, 3, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_D29R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0109_bin, NARC_scr_seq_release_narc_0352_bin, NARC_scr_seq_release_narc_0812_bin, NARC_msg_narc_0278_bin, SEQ_D_RYAYHY, SEQ_D_RYAYHY, 0xFFFF, NARC_zone_event_release_narc_0306_bin, MAPSEC_ACUITY_CAVERN, 0, 12, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D29R0103 + { NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0009_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0353_bin, NARC_scr_seq_release_narc_0813_bin, NARC_msg_narc_0279_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0307_bin, MAPSEC_NEWMOON_ISLAND, 0, 0, 3, 0, FALSE, TRUE, FALSE, FALSE }, // MAP_D30 + { NARC_area_data_narc_0044_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0110_bin, NARC_scr_seq_release_narc_0354_bin, NARC_scr_seq_release_narc_0814_bin, NARC_msg_narc_0280_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0308_bin, MAPSEC_NEWMOON_ISLAND, 0, 2, 3, 3, FALSE, TRUE, FALSE, FALSE }, // MAP_D30R0101 + { NARC_area_data_narc_0054_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0229_bin, NARC_scr_seq_release_narc_0355_bin, NARC_scr_seq_release_narc_0815_bin, NARC_msg_narc_0281_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0309_bin, MAPSEC_BATTLE_PARK, 0, 2, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_D31 + { NARC_area_data_narc_0041_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0231_bin, NARC_scr_seq_release_narc_0356_bin, NARC_scr_seq_release_narc_0816_bin, NARC_msg_narc_0282_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0310_bin, MAPSEC_BATTLE_PARK, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0101 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0232_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0102 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0233_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0103 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0193_bin, NARC_scr_seq_release_narc_0358_bin, NARC_scr_seq_release_narc_0818_bin, NARC_msg_narc_0283_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0311_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0201 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0359_bin, NARC_scr_seq_release_narc_0819_bin, NARC_msg_narc_0018_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0312_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0202 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0194_bin, NARC_scr_seq_release_narc_0360_bin, NARC_scr_seq_release_narc_0820_bin, NARC_msg_narc_0018_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0313_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0203 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0195_bin, NARC_scr_seq_release_narc_0361_bin, NARC_scr_seq_release_narc_0821_bin, NARC_msg_narc_0018_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0314_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0204 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0197_bin, NARC_scr_seq_release_narc_0362_bin, NARC_scr_seq_release_narc_0822_bin, NARC_msg_narc_0284_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0315_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0205 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0198_bin, NARC_scr_seq_release_narc_0363_bin, NARC_scr_seq_release_narc_0823_bin, NARC_msg_narc_0285_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0316_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0206 + { NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0118_bin, NARC_scr_seq_release_narc_0366_bin, NARC_scr_seq_release_narc_0825_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0317_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_DIRECT2 + { NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0121_bin, NARC_scr_seq_release_narc_0367_bin, NARC_scr_seq_release_narc_0826_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0318_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_DIRECT4 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0379_bin, NARC_scr_seq_release_narc_0829_bin, NARC_msg_narc_0352_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, 0xFFFF, NARC_zone_event_release_narc_0319_bin, MAPSEC_VERITY_LAKEFRONT, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_L01 + { NARC_area_data_narc_0020_bin, 20, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0380_bin, NARC_scr_seq_release_narc_0830_bin, NARC_msg_narc_0353_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, 0xFFFF, NARC_zone_event_release_narc_0320_bin, MAPSEC_VERITY_LAKEFRONT, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_L01R0101 + { NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0381_bin, NARC_scr_seq_release_narc_0831_bin, NARC_msg_narc_0354_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, ENCDATA(NARC_d_enc_data_narc_0138_bin, NARC_p_enc_data_narc_0138_bin), NARC_zone_event_release_narc_0321_bin, MAPSEC_VALOR_LAKEFRONT, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_L02 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0147_bin, NARC_scr_seq_release_narc_0382_bin, NARC_scr_seq_release_narc_0832_bin, NARC_msg_narc_0355_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0322_bin, MAPSEC_RESTAURANT, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_L02R0101 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0383_bin, NARC_scr_seq_release_narc_0833_bin, NARC_msg_narc_0356_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0323_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_L02R0201 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0384_bin, NARC_scr_seq_release_narc_0834_bin, NARC_msg_narc_0357_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0324_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_L02R0301 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0385_bin, NARC_scr_seq_release_narc_0835_bin, NARC_msg_narc_0358_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, ENCDATA(NARC_d_enc_data_narc_0139_bin, NARC_p_enc_data_narc_0139_bin), NARC_zone_event_release_narc_0325_bin, MAPSEC_ACUITY_LAKEFRONT, 27, 0, 2, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_L03 + { NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0326_bin, MAPSEC_SPRING_PATH, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_L04 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0392_bin, NARC_scr_seq_release_narc_0837_bin, NARC_msg_narc_0415_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, ENCDATA(NARC_d_enc_data_narc_0140_bin, NARC_p_enc_data_narc_0140_bin), NARC_zone_event_release_narc_0327_bin, MAPSEC_ROUTE_201, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R201 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0393_bin, NARC_scr_seq_release_narc_0838_bin, NARC_msg_narc_0416_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, ENCDATA(NARC_d_enc_data_narc_0141_bin, NARC_p_enc_data_narc_0141_bin), NARC_zone_event_release_narc_0328_bin, MAPSEC_ROUTE_202, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R202 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0394_bin, NARC_scr_seq_release_narc_0839_bin, NARC_msg_narc_0417_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0142_bin, NARC_p_enc_data_narc_0142_bin), NARC_zone_event_release_narc_0329_bin, MAPSEC_ROUTE_203, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R203 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0395_bin, NARC_scr_seq_release_narc_0840_bin, NARC_msg_narc_0418_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0143_bin, NARC_p_enc_data_narc_0143_bin), NARC_zone_event_release_narc_0330_bin, MAPSEC_ROUTE_204, 0, 0, 2, 0, TRUE, TRUE, TRUE, TRUE }, // MAP_R204A + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0396_bin, NARC_scr_seq_release_narc_0841_bin, NARC_msg_narc_0419_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0144_bin, NARC_p_enc_data_narc_0144_bin), NARC_zone_event_release_narc_0331_bin, MAPSEC_ROUTE_204, 0, 0, 2, 0, TRUE, TRUE, TRUE, TRUE }, // MAP_R204B + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0397_bin, NARC_scr_seq_release_narc_0842_bin, NARC_msg_narc_0420_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0145_bin, NARC_p_enc_data_narc_0145_bin), NARC_zone_event_release_narc_0332_bin, MAPSEC_ROUTE_205, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R205A + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0398_bin, NARC_scr_seq_release_narc_0843_bin, NARC_msg_narc_0421_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, 0xFFFF, NARC_zone_event_release_narc_0333_bin, MAPSEC_ROUTE_205, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R205AR0101 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0399_bin, NARC_scr_seq_release_narc_0844_bin, NARC_msg_narc_0422_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0146_bin, NARC_p_enc_data_narc_0146_bin), NARC_zone_event_release_narc_0334_bin, MAPSEC_ROUTE_205, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R205B + { NARC_area_data_narc_0007_bin, NARC_move_model_list_narc_0001_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0400_bin, NARC_scr_seq_release_narc_0845_bin, NARC_msg_narc_0423_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0147_bin, NARC_p_enc_data_narc_0147_bin), NARC_zone_event_release_narc_0335_bin, MAPSEC_ROUTE_206, 8, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R206 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0211_bin, NARC_scr_seq_release_narc_0401_bin, NARC_scr_seq_release_narc_0846_bin, NARC_msg_narc_0424_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0336_bin, MAPSEC_ROUTE_206, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R206R0101 + { NARC_area_data_narc_0031_bin, 31, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0402_bin, NARC_scr_seq_release_narc_0847_bin, NARC_msg_narc_0425_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0337_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R206R0201 + { NARC_area_data_narc_0007_bin, NARC_move_model_list_narc_0001_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0403_bin, NARC_scr_seq_release_narc_0848_bin, NARC_msg_narc_0426_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0148_bin, NARC_p_enc_data_narc_0148_bin), NARC_zone_event_release_narc_0338_bin, MAPSEC_ROUTE_207, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R207 + { NARC_area_data_narc_0009_bin, NARC_move_model_list_narc_0003_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0404_bin, NARC_scr_seq_release_narc_0849_bin, NARC_msg_narc_0427_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0149_bin, NARC_p_enc_data_narc_0149_bin), NARC_zone_event_release_narc_0339_bin, MAPSEC_ROUTE_208, 8, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R208 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0405_bin, NARC_scr_seq_release_narc_0850_bin, NARC_msg_narc_0428_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0340_bin, MAPSEC_ROUTE_208, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R208R0101 + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0406_bin, NARC_scr_seq_release_narc_0851_bin, NARC_msg_narc_0429_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0150_bin, NARC_p_enc_data_narc_0150_bin), NARC_zone_event_release_narc_0341_bin, MAPSEC_ROUTE_209, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R209 + { NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0212_bin, NARC_scr_seq_release_narc_0407_bin, NARC_scr_seq_release_narc_0852_bin, NARC_msg_narc_0430_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0151_bin, NARC_p_enc_data_narc_0151_bin), NARC_zone_event_release_narc_0342_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE }, // MAP_R209R0101 + { NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0213_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0152_bin, NARC_p_enc_data_narc_0152_bin), NARC_zone_event_release_narc_0343_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE }, // MAP_R209R0102 + { NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0214_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0153_bin, NARC_p_enc_data_narc_0153_bin), NARC_zone_event_release_narc_0344_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE }, // MAP_R209R0103 + { NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0215_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0154_bin, NARC_p_enc_data_narc_0154_bin), NARC_zone_event_release_narc_0345_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE }, // MAP_R209R0104 + { NARC_area_data_narc_0042_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0216_bin, NARC_scr_seq_release_narc_0411_bin, NARC_scr_seq_release_narc_0856_bin, NARC_msg_narc_0431_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0155_bin, NARC_p_enc_data_narc_0155_bin), NARC_zone_event_release_narc_0346_bin, MAPSEC_ROUTE_209, 0, 4, 4, 8, FALSE, FALSE, TRUE, FALSE }, // MAP_R209R0105 + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0412_bin, NARC_scr_seq_release_narc_0857_bin, NARC_msg_narc_0432_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0156_bin, NARC_p_enc_data_narc_0156_bin), NARC_zone_event_release_narc_0347_bin, MAPSEC_ROUTE_210, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R210A + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0414_bin, NARC_scr_seq_release_narc_0859_bin, NARC_msg_narc_0434_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0157_bin, NARC_p_enc_data_narc_0157_bin), NARC_zone_event_release_narc_0348_bin, MAPSEC_ROUTE_210, 14, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R210B + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0415_bin, NARC_scr_seq_release_narc_0860_bin, NARC_msg_narc_0435_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0349_bin, MAPSEC_ROUTE_210, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R210BR0101 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0416_bin, NARC_scr_seq_release_narc_0861_bin, NARC_msg_narc_0436_bin, SEQ_ROAD_C_D, SEQ_ROAD_C_N, ENCDATA(NARC_d_enc_data_narc_0158_bin, NARC_p_enc_data_narc_0158_bin), NARC_zone_event_release_narc_0350_bin, MAPSEC_ROUTE_211, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R211A + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0417_bin, NARC_scr_seq_release_narc_0862_bin, NARC_msg_narc_0437_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0159_bin, NARC_p_enc_data_narc_0159_bin), NARC_zone_event_release_narc_0351_bin, MAPSEC_ROUTE_211, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R211B + { NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0418_bin, NARC_scr_seq_release_narc_0863_bin, NARC_msg_narc_0438_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0160_bin, NARC_p_enc_data_narc_0160_bin), NARC_zone_event_release_narc_0352_bin, MAPSEC_ROUTE_212, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R212A + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0178_bin, NARC_scr_seq_release_narc_0419_bin, NARC_scr_seq_release_narc_0864_bin, NARC_msg_narc_0439_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0353_bin, MAPSEC_POKEMON_MANSION, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R212AR0101 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0179_bin, NARC_scr_seq_release_narc_0420_bin, NARC_scr_seq_release_narc_0865_bin, NARC_msg_narc_0440_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0354_bin, MAPSEC_POKEMON_MANSION, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R212AR0102 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0180_bin, NARC_scr_seq_release_narc_0421_bin, NARC_scr_seq_release_narc_0866_bin, NARC_msg_narc_0441_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0355_bin, MAPSEC_POKEMON_MANSION, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R212AR0103 + { NARC_area_data_narc_0012_bin, NARC_move_model_list_narc_0006_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0422_bin, NARC_scr_seq_release_narc_0867_bin, NARC_msg_narc_0442_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0161_bin, NARC_p_enc_data_narc_0161_bin), NARC_zone_event_release_narc_0356_bin, MAPSEC_ROUTE_212, 24, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R212B + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0423_bin, NARC_scr_seq_release_narc_0868_bin, NARC_msg_narc_0443_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0357_bin, MAPSEC_ROUTE_212, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R212BR0101 + { NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0424_bin, NARC_scr_seq_release_narc_0869_bin, NARC_msg_narc_0444_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, ENCDATA(NARC_d_enc_data_narc_0162_bin, NARC_p_enc_data_narc_0162_bin), NARC_zone_event_release_narc_0358_bin, MAPSEC_ROUTE_213, 25, 0, 2, 1, TRUE, TRUE, FALSE, TRUE }, // MAP_R213 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0425_bin, NARC_scr_seq_release_narc_0870_bin, NARC_msg_narc_0445_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0359_bin, MAPSEC_ROUTE_213, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R213R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0426_bin, NARC_scr_seq_release_narc_0871_bin, NARC_msg_narc_0446_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0360_bin, MAPSEC_FOOTSTEP_HOUSE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R213R0201 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0145_bin, NARC_scr_seq_release_narc_0427_bin, NARC_scr_seq_release_narc_0872_bin, NARC_msg_narc_0447_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0361_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R213R0301 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0428_bin, NARC_scr_seq_release_narc_0873_bin, NARC_msg_narc_0448_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0362_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R213R0401 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0429_bin, NARC_scr_seq_release_narc_0874_bin, NARC_msg_narc_0449_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0363_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R213R0501 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0146_bin, NARC_scr_seq_release_narc_0430_bin, NARC_scr_seq_release_narc_0875_bin, NARC_msg_narc_0450_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0364_bin, MAPSEC_GRAND_LAKE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R213R0601 + { NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0431_bin, NARC_scr_seq_release_narc_0876_bin, NARC_msg_narc_0451_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0163_bin, NARC_p_enc_data_narc_0163_bin), NARC_zone_event_release_narc_0365_bin, MAPSEC_ROUTE_214, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R214 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0157_bin, NARC_scr_seq_release_narc_0432_bin, NARC_scr_seq_release_narc_0877_bin, NARC_msg_narc_0452_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0366_bin, MAPSEC_ROUTE_214, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R214R0101 + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0433_bin, NARC_scr_seq_release_narc_0878_bin, NARC_msg_narc_0453_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0164_bin, NARC_p_enc_data_narc_0164_bin), NARC_zone_event_release_narc_0367_bin, MAPSEC_ROUTE_215, 2, 0, 2, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_R215 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0434_bin, NARC_scr_seq_release_narc_0879_bin, NARC_msg_narc_0454_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, ENCDATA(NARC_d_enc_data_narc_0165_bin, NARC_p_enc_data_narc_0165_bin), NARC_zone_event_release_narc_0368_bin, MAPSEC_ROUTE_216, 26, 0, 2, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_R216 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0435_bin, NARC_scr_seq_release_narc_0880_bin, NARC_msg_narc_0455_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, 0xFFFF, NARC_zone_event_release_narc_0369_bin, MAPSEC_ROUTE_216, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R216R0101 + { NARC_area_data_narc_0014_bin, NARC_move_model_list_narc_0008_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0436_bin, NARC_scr_seq_release_narc_0881_bin, NARC_msg_narc_0456_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, ENCDATA(NARC_d_enc_data_narc_0166_bin, NARC_p_enc_data_narc_0166_bin), NARC_zone_event_release_narc_0370_bin, MAPSEC_ROUTE_217, 7, 0, 2, 5, FALSE, TRUE, FALSE, TRUE }, // MAP_R217 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0437_bin, NARC_scr_seq_release_narc_0882_bin, NARC_msg_narc_0457_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, 0xFFFF, NARC_zone_event_release_narc_0371_bin, MAPSEC_ROUTE_217, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R217R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0438_bin, NARC_scr_seq_release_narc_0883_bin, NARC_msg_narc_0458_bin, SEQ_ROAD_SNOW_D, SEQ_ROAD_SNOW_N, 0xFFFF, NARC_zone_event_release_narc_0372_bin, MAPSEC_ROUTE_217, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R217R0201 + { NARC_area_data_narc_0015_bin, NARC_move_model_list_narc_0009_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0439_bin, NARC_scr_seq_release_narc_0884_bin, NARC_msg_narc_0459_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, ENCDATA(NARC_d_enc_data_narc_0167_bin, NARC_p_enc_data_narc_0167_bin), NARC_zone_event_release_narc_0373_bin, MAPSEC_ROUTE_218, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R218 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0440_bin, NARC_scr_seq_release_narc_0885_bin, NARC_msg_narc_0460_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, 0xFFFF, NARC_zone_event_release_narc_0374_bin, MAPSEC_ROUTE_218, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R218R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0441_bin, NARC_scr_seq_release_narc_0886_bin, NARC_msg_narc_0461_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, 0xFFFF, NARC_zone_event_release_narc_0375_bin, MAPSEC_ROUTE_218, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R218R0201 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0442_bin, NARC_scr_seq_release_narc_0887_bin, NARC_msg_narc_0462_bin, SEQ_ROAD_A_D, SEQ_ROAD_A_N, ENCDATA(NARC_d_enc_data_narc_0168_bin, NARC_p_enc_data_narc_0168_bin), NARC_zone_event_release_narc_0376_bin, MAPSEC_ROUTE_219, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R219 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0443_bin, NARC_scr_seq_release_narc_0888_bin, NARC_msg_narc_0463_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0169_bin, NARC_p_enc_data_narc_0169_bin), NARC_zone_event_release_narc_0377_bin, MAPSEC_ROUTE_221, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R221 + { NARC_area_data_narc_0039_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0201_bin, NARC_scr_seq_release_narc_0444_bin, NARC_scr_seq_release_narc_0889_bin, NARC_msg_narc_0464_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0378_bin, MAPSEC_PAL_PARK, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R221R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0445_bin, NARC_scr_seq_release_narc_0890_bin, NARC_msg_narc_0465_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0379_bin, MAPSEC_ROUTE_221, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R221R0201 + { NARC_area_data_narc_0018_bin, NARC_move_model_list_narc_0012_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0446_bin, NARC_scr_seq_release_narc_0891_bin, NARC_msg_narc_0466_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, ENCDATA(NARC_d_enc_data_narc_0170_bin, NARC_p_enc_data_narc_0170_bin), NARC_zone_event_release_narc_0380_bin, MAPSEC_ROUTE_222, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R222 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0447_bin, NARC_scr_seq_release_narc_0892_bin, NARC_msg_narc_0467_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0381_bin, MAPSEC_ROUTE_222, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R222R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0448_bin, NARC_scr_seq_release_narc_0893_bin, NARC_msg_narc_0468_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0382_bin, MAPSEC_ROUTE_222, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R222R0201 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0449_bin, NARC_scr_seq_release_narc_0894_bin, NARC_msg_narc_0469_bin, SEQ_ROAD_E_D, SEQ_ROAD_E_N, 0xFFFF, NARC_zone_event_release_narc_0383_bin, MAPSEC_ROUTE_222, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R222R0301 + { NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0010_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0450_bin, NARC_scr_seq_release_narc_0895_bin, NARC_msg_narc_0470_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0171_bin, NARC_p_enc_data_narc_0171_bin), NARC_zone_event_release_narc_0384_bin, MAPSEC_ROUTE_224, 0, 0, 2, 0, TRUE, TRUE, FALSE, TRUE }, // MAP_R224 + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0451_bin, NARC_scr_seq_release_narc_0896_bin, NARC_msg_narc_0471_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0172_bin, NARC_p_enc_data_narc_0172_bin), NARC_zone_event_release_narc_0385_bin, MAPSEC_ROUTE_225, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R225 + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_R226A + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_R226B + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0454_bin, NARC_scr_seq_release_narc_0899_bin, NARC_msg_narc_0474_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0173_bin, NARC_p_enc_data_narc_0173_bin), NARC_zone_event_release_narc_0386_bin, MAPSEC_ROUTE_227, 9, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R227 + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_R227A + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_R227B + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0456_bin, NARC_scr_seq_release_narc_0901_bin, NARC_msg_narc_0476_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, ENCDATA(NARC_d_enc_data_narc_0174_bin, NARC_p_enc_data_narc_0174_bin), NARC_zone_event_release_narc_0387_bin, MAPSEC_ROUTE_228, 10, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_R228 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0460_bin, NARC_scr_seq_release_narc_0905_bin, NARC_msg_narc_0480_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, ENCDATA(NARC_d_enc_data_narc_0175_bin, NARC_p_enc_data_narc_0175_bin), NARC_zone_event_release_narc_0388_bin, MAPSEC_ROUTE_229, 0, 0, 2, 3, TRUE, TRUE, FALSE, TRUE }, // MAP_R229 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_R230 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_R232 + { NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0119_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_RECORD + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0978_bin, NARC_scr_seq_release_narc_0908_bin, NARC_msg_narc_0498_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, ENCDATA(NARC_d_enc_data_narc_0176_bin, NARC_p_enc_data_narc_0176_bin), NARC_zone_event_release_narc_0389_bin, MAPSEC_TWINLEAF_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_T01 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0126_bin, NARC_scr_seq_release_narc_0979_bin, NARC_scr_seq_release_narc_0909_bin, NARC_msg_narc_0499_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0390_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T01R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0127_bin, NARC_scr_seq_release_narc_0980_bin, NARC_scr_seq_release_narc_0910_bin, NARC_msg_narc_0500_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0391_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T01R0102 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0128_bin, NARC_scr_seq_release_narc_0981_bin, NARC_scr_seq_release_narc_0911_bin, NARC_msg_narc_0501_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0392_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T01R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0129_bin, NARC_scr_seq_release_narc_0982_bin, NARC_scr_seq_release_narc_0912_bin, NARC_msg_narc_0502_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0393_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T01R0202 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0983_bin, NARC_scr_seq_release_narc_0913_bin, NARC_msg_narc_0503_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0394_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T01R0301 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0984_bin, NARC_scr_seq_release_narc_0914_bin, NARC_msg_narc_0504_bin, SEQ_TOWN01_D, SEQ_TOWN01_N, 0xFFFF, NARC_zone_event_release_narc_0395_bin, MAPSEC_TWINLEAF_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T01R0401 + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0985_bin, NARC_scr_seq_release_narc_0915_bin, NARC_msg_narc_0505_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0396_bin, MAPSEC_SANDGEM_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_T02 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0986_bin, NARC_scr_seq_release_narc_0916_bin, NARC_msg_narc_0506_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0397_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02FS0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0987_bin, NARC_scr_seq_release_narc_0917_bin, NARC_msg_narc_0507_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0398_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0988_bin, NARC_scr_seq_release_narc_0918_bin, NARC_msg_narc_0508_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0399_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02PC0102 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0160_bin, NARC_scr_seq_release_narc_0990_bin, NARC_scr_seq_release_narc_0920_bin, NARC_msg_narc_0509_bin, SEQ_KENKYUJO, SEQ_KENKYUJO, 0xFFFF, NARC_zone_event_release_narc_0400_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0130_bin, NARC_scr_seq_release_narc_0991_bin, NARC_scr_seq_release_narc_0921_bin, NARC_msg_narc_0510_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0401_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0131_bin, NARC_scr_seq_release_narc_0992_bin, NARC_scr_seq_release_narc_0922_bin, NARC_msg_narc_0511_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0402_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02R0202 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0993_bin, NARC_scr_seq_release_narc_0923_bin, NARC_msg_narc_0512_bin, SEQ_TOWN02_D, SEQ_TOWN02_N, 0xFFFF, NARC_zone_event_release_narc_0403_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02R0301 + { NARC_area_data_narc_0008_bin, NARC_move_model_list_narc_0002_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0994_bin, NARC_scr_seq_release_narc_0924_bin, NARC_msg_narc_0513_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0404_bin, MAPSEC_FLOAROMA_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_T03 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_0995_bin, NARC_scr_seq_release_narc_0925_bin, NARC_msg_narc_0514_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0405_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T03FS0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_0996_bin, NARC_scr_seq_release_narc_0926_bin, NARC_msg_narc_0515_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0406_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T03PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0997_bin, NARC_scr_seq_release_narc_0927_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0407_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T03PC0102 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0236_bin, NARC_scr_seq_release_narc_0999_bin, NARC_scr_seq_release_narc_0929_bin, NARC_msg_narc_0516_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0408_bin, MAPSEC_FLOWER_SHOP, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T03R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1000_bin, NARC_scr_seq_release_narc_0930_bin, NARC_msg_narc_0517_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0409_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T03R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1001_bin, NARC_scr_seq_release_narc_0931_bin, NARC_msg_narc_0518_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0410_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T03R0301 + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1002_bin, NARC_scr_seq_release_narc_0932_bin, NARC_msg_narc_0519_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0411_bin, MAPSEC_SOLACEON_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_T04 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_1003_bin, NARC_scr_seq_release_narc_0933_bin, NARC_msg_narc_0520_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0412_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04FS0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1004_bin, NARC_scr_seq_release_narc_0934_bin, NARC_msg_narc_0521_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0413_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1005_bin, NARC_scr_seq_release_narc_0935_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0414_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04PC0102 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0137_bin, NARC_scr_seq_release_narc_1007_bin, NARC_scr_seq_release_narc_0937_bin, NARC_msg_narc_0522_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0415_bin, MAPSEC_POKEMON_DAY_CARE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1008_bin, NARC_scr_seq_release_narc_0938_bin, NARC_msg_narc_0523_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0416_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_1009_bin, NARC_scr_seq_release_narc_0939_bin, NARC_msg_narc_0524_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0417_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04R0301 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1010_bin, NARC_scr_seq_release_narc_0940_bin, NARC_msg_narc_0525_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0418_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04R0401 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1011_bin, NARC_scr_seq_release_narc_0941_bin, NARC_msg_narc_0526_bin, SEQ_CITY06_D, SEQ_CITY06_N, 0xFFFF, NARC_zone_event_release_narc_0419_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04R0501 + { NARC_area_data_narc_0010_bin, NARC_move_model_list_narc_0004_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1012_bin, NARC_scr_seq_release_narc_0942_bin, NARC_msg_narc_0527_bin, SEQ_CITY04_D, SEQ_CITY04_N, ENCDATA(NARC_d_enc_data_narc_0177_bin, NARC_p_enc_data_narc_0177_bin), NARC_zone_event_release_narc_0420_bin, MAPSEC_CELESTIC_TOWN, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_T05 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1014_bin, NARC_scr_seq_release_narc_0944_bin, NARC_msg_narc_0528_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0421_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1015_bin, NARC_scr_seq_release_narc_0945_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0422_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05PC0102 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0168_bin, NARC_scr_seq_release_narc_1017_bin, NARC_scr_seq_release_narc_0947_bin, NARC_msg_narc_0529_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0423_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0170_bin, NARC_scr_seq_release_narc_1018_bin, NARC_scr_seq_release_narc_0948_bin, NARC_msg_narc_0530_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0424_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_1019_bin, NARC_scr_seq_release_narc_0949_bin, NARC_msg_narc_0531_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0425_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05R0301 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_1020_bin, NARC_scr_seq_release_narc_0950_bin, NARC_msg_narc_0532_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0426_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05R0401 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0169_bin, NARC_scr_seq_release_narc_1021_bin, NARC_scr_seq_release_narc_0951_bin, NARC_msg_narc_0533_bin, SEQ_CITY04_D, SEQ_CITY04_N, 0xFFFF, NARC_zone_event_release_narc_0427_bin, MAPSEC_CELESTIC_TOWN, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05R0501 + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1022_bin, NARC_scr_seq_release_narc_0952_bin, NARC_msg_narc_0534_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0428_bin, MAPSEC_SURVIVAL_AREA, 0, 0, 1, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_T06 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_1023_bin, NARC_scr_seq_release_narc_0953_bin, NARC_msg_narc_0535_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0429_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T06FS0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1024_bin, NARC_scr_seq_release_narc_0954_bin, NARC_msg_narc_0536_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0430_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T06PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1025_bin, NARC_scr_seq_release_narc_0955_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0431_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T06PC0102 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1027_bin, NARC_scr_seq_release_narc_0957_bin, NARC_msg_narc_0537_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0432_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T06R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_1028_bin, NARC_scr_seq_release_narc_0958_bin, NARC_msg_narc_0538_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0433_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T06R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1029_bin, NARC_scr_seq_release_narc_0959_bin, NARC_msg_narc_0539_bin, SEQ_CITY11_D, SEQ_CITY11_N, 0xFFFF, NARC_zone_event_release_narc_0434_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T06R0301 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1030_bin, NARC_scr_seq_release_narc_0960_bin, NARC_msg_narc_0540_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, ENCDATA(NARC_d_enc_data_narc_0178_bin, NARC_p_enc_data_narc_0178_bin), NARC_zone_event_release_narc_0435_bin, MAPSEC_RESORT_AREA, 0, 0, 1, 2, TRUE, TRUE, FALSE, TRUE }, // MAP_T07 + { NARC_area_data_narc_0022_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0122_bin, NARC_scr_seq_release_narc_1031_bin, NARC_scr_seq_release_narc_0961_bin, NARC_msg_narc_0541_bin, SEQ_FS, SEQ_FS, 0xFFFF, NARC_zone_event_release_narc_0436_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T07FS0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0116_bin, NARC_scr_seq_release_narc_1032_bin, NARC_scr_seq_release_narc_0962_bin, NARC_msg_narc_0542_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0437_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T07PC0101 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_1033_bin, NARC_scr_seq_release_narc_0963_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0438_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T07PC0102 + { NARC_area_data_narc_0038_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0199_bin, NARC_scr_seq_release_narc_1035_bin, NARC_scr_seq_release_narc_0965_bin, NARC_msg_narc_0543_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0439_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_T07R0101 + { NARC_area_data_narc_0038_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0200_bin, NARC_scr_seq_release_narc_1036_bin, NARC_scr_seq_release_narc_0966_bin, NARC_msg_narc_0544_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0440_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_T07R0102 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_1037_bin, NARC_scr_seq_release_narc_0967_bin, NARC_msg_narc_0545_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0441_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_T07R0103 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1038_bin, NARC_scr_seq_release_narc_0968_bin, NARC_msg_narc_0546_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0442_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T07R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_1039_bin, NARC_scr_seq_release_narc_0969_bin, NARC_msg_narc_0547_bin, SEQ_TOWN07_D, SEQ_TOWN07_N, 0xFFFF, NARC_zone_event_release_narc_0443_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T07R0301 + { NARC_area_data_narc_0005_bin, NARC_move_model_list_narc_0014_bin, NARC_map_matrix_narc_0120_bin, NARC_scr_seq_release_narc_1044_bin, NARC_scr_seq_release_narc_0971_bin, NARC_msg_narc_0576_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0444_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_UNION + { NARC_area_data_narc_0006_bin, NARC_move_model_list_narc_0000_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_D_D, SEQ_ROAD_D_N, ENCDATA(NARC_d_enc_data_narc_0179_bin, NARC_p_enc_data_narc_0179_bin), NARC_zone_event_release_narc_0445_bin, MAPSEC_ROUTE_220, 0, 0, 2, 1, TRUE, TRUE, FALSE, TRUE }, // MAP_W220 + { NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0007_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, ENCDATA(NARC_d_enc_data_narc_0180_bin, NARC_p_enc_data_narc_0180_bin), NARC_zone_event_release_narc_0446_bin, MAPSEC_ROUTE_223, 0, 11, 2, 1, TRUE, TRUE, FALSE, TRUE }, // MAP_W223 + { NARC_area_data_narc_0017_bin, NARC_move_model_list_narc_0011_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1047_bin, NARC_scr_seq_release_narc_0974_bin, NARC_msg_narc_0583_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, ENCDATA(NARC_d_enc_data_narc_0181_bin, NARC_p_enc_data_narc_0181_bin), NARC_zone_event_release_narc_0447_bin, MAPSEC_ROUTE_226, 0, 0, 2, 4, TRUE, TRUE, FALSE, TRUE }, // MAP_W226 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_W229 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_1049_bin, NARC_scr_seq_release_narc_0976_bin, NARC_msg_narc_0585_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, ENCDATA(NARC_d_enc_data_narc_0182_bin, NARC_p_enc_data_narc_0182_bin), NARC_zone_event_release_narc_0448_bin, MAPSEC_ROUTE_230, 0, 0, 2, 1, TRUE, TRUE, FALSE, TRUE }, // MAP_W230 + { NARC_area_data_narc_0013_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_TOWN03_D, SEQ_TOWN03_N, 0xFFFF, NARC_zone_event_release_narc_0449_bin, MAPSEC_SEABREAK_PATH, 0, 0, 2, 1, TRUE, TRUE, FALSE, TRUE }, // MAP_W231 + { NARC_area_data_narc_0019_bin, NARC_move_model_list_narc_0013_bin, NARC_map_matrix_narc_0000_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_DUMMY, SEQ_DUMMY, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_MYSTERY_ZONE, 0, 0, 2, 1, TRUE, TRUE, FALSE, FALSE }, // MAP_W233 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0007_bin, NARC_scr_seq_release_narc_0470_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0450_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C01PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0039_bin, NARC_scr_seq_release_narc_0502_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0451_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0053_bin, NARC_scr_seq_release_narc_0516_bin, NARC_msg_narc_0062_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0452_bin, MAPSEC_OREBURGH_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C03PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0075_bin, NARC_scr_seq_release_narc_0538_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0453_bin, MAPSEC_ETERNA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C04PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0099_bin, NARC_scr_seq_release_narc_0562_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0454_bin, MAPSEC_HEARTHOME_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C05PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0123_bin, NARC_scr_seq_release_narc_0586_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0455_bin, MAPSEC_PASTORIA_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C06PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0135_bin, NARC_scr_seq_release_narc_0598_bin, NARC_msg_narc_0138_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0456_bin, MAPSEC_VEILSTONE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C07PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0157_bin, NARC_scr_seq_release_narc_0620_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0457_bin, MAPSEC_SUNYSHORE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C08PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0173_bin, NARC_scr_seq_release_narc_0636_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0458_bin, MAPSEC_SNOWPOINT_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C09PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0179_bin, NARC_scr_seq_release_narc_0642_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0459_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C10PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0199_bin, NARC_scr_seq_release_narc_0662_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0460_bin, MAPSEC_FIGHT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C11PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0989_bin, NARC_scr_seq_release_narc_0919_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0461_bin, MAPSEC_SANDGEM_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T02PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0998_bin, NARC_scr_seq_release_narc_0928_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0462_bin, MAPSEC_FLOAROMA_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T03PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1006_bin, NARC_scr_seq_release_narc_0936_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0463_bin, MAPSEC_SOLACEON_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T04PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1016_bin, NARC_scr_seq_release_narc_0946_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0464_bin, MAPSEC_CELESTIC_TOWN, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T05PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1026_bin, NARC_scr_seq_release_narc_0956_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0465_bin, MAPSEC_SURVIVAL_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T06PC0103 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_1034_bin, NARC_scr_seq_release_narc_0964_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0466_bin, MAPSEC_RESORT_AREA, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_T07PC0103 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0124_bin, NARC_scr_seq_release_narc_0047_bin, NARC_scr_seq_release_narc_0510_bin, NARC_msg_narc_0018_bin, SEQ_CITY02_D, SEQ_CITY02_N, 0xFFFF, NARC_zone_event_release_narc_0467_bin, MAPSEC_CANALAVE_CITY, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C02R0601 + { NARC_area_data_narc_0035_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0171_bin, NARC_scr_seq_release_narc_0413_bin, NARC_scr_seq_release_narc_0858_bin, NARC_msg_narc_0433_bin, SEQ_ROAD_F_D, SEQ_ROAD_F_N, 0xFFFF, NARC_zone_event_release_narc_0468_bin, MAPSEC_CAFE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_R210AR0101 + { NARC_area_data_narc_0033_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0196_bin, NARC_scr_seq_release_narc_0364_bin, NARC_scr_seq_release_narc_0824_bin, NARC_msg_narc_0286_bin, SEQ_BF_TOWWER, SEQ_BF_TOWWER, 0xFFFF, NARC_zone_event_release_narc_0469_bin, MAPSEC_BATTLE_TOWER, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D31R0207 + { NARC_area_data_narc_0058_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0238_bin, NARC_scr_seq_release_narc_0339_bin, NARC_scr_seq_release_narc_0799_bin, NARC_msg_narc_0268_bin, SEQ_THE_EVENT04, SEQ_THE_EVENT04, 0xFFFF, NARC_zone_event_release_narc_0470_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0107 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0117_bin, NARC_scr_seq_release_narc_0193_bin, NARC_scr_seq_release_narc_0656_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0471_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0114 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0235_bin, NARC_scr_seq_release_narc_0194_bin, NARC_scr_seq_release_narc_0657_bin, NARC_msg_narc_0018_bin, SEQ_PC_01, SEQ_PC_02, 0xFFFF, NARC_zone_event_release_narc_0472_bin, MAPSEC_POKEMON_LEAGUE, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_C10R0115 + { NARC_area_data_narc_0058_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0239_bin, NARC_scr_seq_release_narc_0340_bin, NARC_scr_seq_release_narc_0800_bin, NARC_msg_narc_0269_bin, SEQ_THE_EVENT04, SEQ_THE_EVENT04, 0xFFFF, NARC_zone_event_release_narc_0473_bin, MAPSEC_GALACTIC_HQ, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_D26R0108 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0123_bin, NARC_scr_seq_release_narc_0452_bin, NARC_scr_seq_release_narc_0897_bin, NARC_msg_narc_0472_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0474_bin, MAPSEC_ROUTE_225, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R225R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_1048_bin, NARC_scr_seq_release_narc_0975_bin, NARC_msg_narc_0584_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0475_bin, MAPSEC_ROUTE_226, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_W226R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0455_bin, NARC_scr_seq_release_narc_0900_bin, NARC_msg_narc_0475_bin, SEQ_TOWN06_D, SEQ_TOWN06_N, 0xFFFF, NARC_zone_event_release_narc_0476_bin, MAPSEC_ROUTE_227, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R227R0101 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0158_bin, NARC_scr_seq_release_narc_0457_bin, NARC_scr_seq_release_narc_0902_bin, NARC_msg_narc_0477_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, 0xFFFF, NARC_zone_event_release_narc_0477_bin, MAPSEC_ROUTE_228, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R228R0101 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0244_bin, NARC_scr_seq_release_narc_0458_bin, NARC_scr_seq_release_narc_0903_bin, NARC_msg_narc_0478_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, 0xFFFF, NARC_zone_event_release_narc_0478_bin, MAPSEC_ROUTE_228, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R228R0201 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0125_bin, NARC_scr_seq_release_narc_0459_bin, NARC_scr_seq_release_narc_0904_bin, NARC_msg_narc_0479_bin, SEQ_ROAD_BZA_D, SEQ_ROAD_BZA_N, 0xFFFF, NARC_zone_event_release_narc_0479_bin, MAPSEC_ROUTE_228, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_R228R0301 + { NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0235_bin, NARC_scr_seq_release_narc_0695_bin, NARC_msg_narc_0223_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0023_bin, NARC_p_enc_data_narc_0023_bin), NARC_zone_event_release_narc_0480_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_D06R0201 + { NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0236_bin, NARC_scr_seq_release_narc_0696_bin, NARC_msg_narc_0224_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0024_bin, NARC_p_enc_data_narc_0024_bin), NARC_zone_event_release_narc_0481_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_D06R0202 + { NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0237_bin, NARC_scr_seq_release_narc_0697_bin, NARC_msg_narc_0225_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0025_bin, NARC_p_enc_data_narc_0025_bin), NARC_zone_event_release_narc_0482_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_D06R0203 + { NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0238_bin, NARC_scr_seq_release_narc_0698_bin, NARC_msg_narc_0226_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0026_bin, NARC_p_enc_data_narc_0026_bin), NARC_zone_event_release_narc_0483_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_D06R0204 + { NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0239_bin, NARC_scr_seq_release_narc_0699_bin, NARC_msg_narc_0227_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0027_bin, NARC_p_enc_data_narc_0027_bin), NARC_zone_event_release_narc_0484_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_D06R0205 + { NARC_area_data_narc_0053_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0240_bin, NARC_scr_seq_release_narc_0240_bin, NARC_scr_seq_release_narc_0700_bin, NARC_msg_narc_0228_bin, SEQ_D_SAFARI, SEQ_D_SAFARI, ENCDATA(NARC_d_enc_data_narc_0028_bin, NARC_p_enc_data_narc_0028_bin), NARC_zone_event_release_narc_0485_bin, MAPSEC_GREAT_MARSH, 0, 2, 2, 3, TRUE, TRUE, FALSE, FALSE }, // MAP_D06R0206 + { NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0241_bin, NARC_scr_seq_release_narc_0232_bin, NARC_scr_seq_release_narc_0692_bin, NARC_msg_narc_0221_bin, SEQ_AUS, SEQ_AUS, 0xFFFF, NARC_zone_event_release_narc_0486_bin, MAPSEC_HALL_OF_ORIGIN, 13, 14, 2, 9, FALSE, TRUE, FALSE, FALSE }, // MAP_D05R0116 + { NARC_area_data_narc_0050_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0242_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_MOUNT2, SEQ_D_MOUNT2, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_HALL_OF_ORIGIN, 13, 14, 2, 9, FALSE, TRUE, FALSE, FALSE }, // MAP_D05R0117 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0077_bin, NARC_scr_seq_release_narc_0313_bin, NARC_scr_seq_release_narc_0773_bin, NARC_msg_narc_0255_bin, SEQ_D_04, SEQ_D_04, ENCDATA(NARC_d_enc_data_narc_0115_bin, NARC_p_enc_data_narc_0115_bin), NARC_zone_event_release_narc_0487_bin, MAPSEC_RUIN_MANIAC_CAVE, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D22R0102 + { NARC_area_data_narc_0043_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0078_bin, NARC_scr_seq_release_narc_0314_bin, NARC_scr_seq_release_narc_0774_bin, NARC_msg_narc_0256_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0116_bin, NARC_p_enc_data_narc_0116_bin), NARC_zone_event_release_narc_0488_bin, MAPSEC_MANIAC_TUNNEL, 0, 12, 3, 10, TRUE, TRUE, TRUE, FALSE }, // MAP_D22R0103 + { NARC_area_data_narc_0020_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0243_bin, NARC_scr_seq_release_narc_0323_bin, NARC_scr_seq_release_narc_0783_bin, NARC_msg_narc_0259_bin, SEQ_ROAD_B_D, SEQ_ROAD_B_N, 0xFFFF, NARC_zone_event_release_narc_0489_bin, MAPSEC_IRON_ISLAND, 0, 4, 4, 6, FALSE, FALSE, FALSE, FALSE }, // MAP_D24R0201 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0031_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_02, SEQ_D_02, ENCDATA(NARC_d_enc_data_narc_0046_bin, NARC_p_enc_data_narc_0046_bin), NARC_zone_event_release_narc_0490_bin, MAPSEC_SOLACEON_RUINS, 0, 0, 3, 9, TRUE, TRUE, TRUE, FALSE }, // MAP_D07R0119 + { NARC_area_data_narc_0021_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0207_bin, NARC_scr_seq_release_narc_0166_bin, NARC_scr_seq_release_narc_0629_bin, NARC_msg_narc_0018_bin, SEQ_CITY08_D, SEQ_CITY08_N, 0xFFFF, NARC_zone_event_release_narc_0491_bin, MAPSEC_VISTA_LIGHTHOUSE, 0, 4, 4, 8, FALSE, FALSE, FALSE, FALSE }, // MAP_C08R0802 + { NARC_area_data_narc_0031_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0208_bin, NARC_scr_seq_release_narc_0031_bin, NARC_scr_seq_release_narc_0494_bin, NARC_msg_narc_0044_bin, SEQ_CITY01_D, SEQ_CITY01_N, 0xFFFF, NARC_zone_event_release_narc_0492_bin, MAPSEC_JUBILIFE_CITY, 0, 4, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C01R0802 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0287_bin, NARC_scr_seq_release_narc_0747_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0066_bin, NARC_p_enc_data_narc_0066_bin), NARC_zone_event_release_narc_0493_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0108 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0288_bin, NARC_scr_seq_release_narc_0748_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0067_bin, NARC_p_enc_data_narc_0067_bin), NARC_zone_event_release_narc_0494_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0109 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0289_bin, NARC_scr_seq_release_narc_0749_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0068_bin, NARC_p_enc_data_narc_0068_bin), NARC_zone_event_release_narc_0495_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0110 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0290_bin, NARC_scr_seq_release_narc_0750_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0069_bin, NARC_p_enc_data_narc_0069_bin), NARC_zone_event_release_narc_0496_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0111 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0291_bin, NARC_scr_seq_release_narc_0751_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0070_bin, NARC_p_enc_data_narc_0070_bin), NARC_zone_event_release_narc_0497_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0112 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0292_bin, NARC_scr_seq_release_narc_0752_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0071_bin, NARC_p_enc_data_narc_0071_bin), NARC_zone_event_release_narc_0498_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0113 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0293_bin, NARC_scr_seq_release_narc_0753_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0072_bin, NARC_p_enc_data_narc_0072_bin), NARC_zone_event_release_narc_0499_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0114 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0294_bin, NARC_scr_seq_release_narc_0754_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0073_bin, NARC_p_enc_data_narc_0073_bin), NARC_zone_event_release_narc_0500_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0115 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0295_bin, NARC_scr_seq_release_narc_0755_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0074_bin, NARC_p_enc_data_narc_0074_bin), NARC_zone_event_release_narc_0501_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0116 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0296_bin, NARC_scr_seq_release_narc_0756_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0075_bin, NARC_p_enc_data_narc_0075_bin), NARC_zone_event_release_narc_0502_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0117 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0297_bin, NARC_scr_seq_release_narc_0757_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0076_bin, NARC_p_enc_data_narc_0076_bin), NARC_zone_event_release_narc_0503_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0118 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0298_bin, NARC_scr_seq_release_narc_0758_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0077_bin, NARC_p_enc_data_narc_0077_bin), NARC_zone_event_release_narc_0504_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0119 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0299_bin, NARC_scr_seq_release_narc_0759_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0078_bin, NARC_p_enc_data_narc_0078_bin), NARC_zone_event_release_narc_0505_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0120 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0300_bin, NARC_scr_seq_release_narc_0760_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, ENCDATA(NARC_d_enc_data_narc_0079_bin, NARC_p_enc_data_narc_0079_bin), NARC_zone_event_release_narc_0506_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0121 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0301_bin, NARC_scr_seq_release_narc_0761_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0507_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, FALSE, FALSE }, // MAP_D17R0122 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0123 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0124 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0508_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0125 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0126 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0127 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0128 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0129 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0509_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0130 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0131 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0132 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0133 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0134 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0135 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0510_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0136 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0137 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0138 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0139 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0140 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0141 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0064_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0142 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0143 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0065_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0144 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0145 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0146 + { NARC_area_data_narc_0046_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0066_bin, NARC_scr_seq_release_narc_0368_bin, NARC_scr_seq_release_narc_0827_bin, NARC_msg_narc_0018_bin, SEQ_D_03, SEQ_D_03, 0xFFFF, NARC_zone_event_release_narc_0000_bin, MAPSEC_TURNBACK_CAVE, 14, 0, 3, 11, TRUE, TRUE, TRUE, FALSE }, // MAP_D17R0147 + { NARC_area_data_narc_0032_bin, NARC_move_model_list_narc_0015_bin, NARC_map_matrix_narc_0166_bin, NARC_scr_seq_release_narc_0116_bin, NARC_scr_seq_release_narc_0579_bin, NARC_msg_narc_0121_bin, SEQ_BLD_CON, SEQ_BLD_CON, 0xFFFF, NARC_zone_event_release_narc_0511_bin, MAPSEC_CONTEST_HALL, 0, 0, 4, 7, FALSE, FALSE, FALSE, FALSE }, // MAP_C05R1103 }; -u32 MapNumberBoundsCheck(u32 mapno) -{ - if (mapno >= NELEMS(sMapHeaders)) - { +u32 MapNumberBoundsCheck(u32 mapno) { + if (mapno >= NELEMS(sMapHeaders)) { GF_ASSERT(0); mapno = 3; } return mapno; } -u8 MapHeader_GetAreaDataBank(u32 mapno) -{ +u8 MapHeader_GetAreaDataBank(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].area_data_bank; } -u8 MapHeader_GetMoveModelBank(u32 mapno) -{ +u8 MapHeader_GetMoveModelBank(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].move_model_bank; } -u16 MapHeader_GetMatrixId(u32 mapno) -{ +u16 MapHeader_GetMatrixId(u32 mapno) { u16 ret; mapno = MapNumberBoundsCheck(mapno); - ret = sMapHeaders[mapno].matrix_id; + ret = sMapHeaders[mapno].matrix_id; // Spear Pillar - if (ret == NARC_map_matrix_narc_0022_bin && gGameVersion == VERSION_PEARL) + if (ret == NARC_map_matrix_narc_0022_bin && gGameVersion == VERSION_PEARL) { ret = NARC_map_matrix_narc_0023_bin; + } return ret; } -u16 MapHeader_GetMsgBank(u32 mapno) -{ +u16 MapHeader_GetMsgBank(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].msg_bank; } -u16 MapHeader_GetScriptsBank(u32 mapno) -{ +u16 MapHeader_GetScriptsBank(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].scripts_bank; } -u16 MapHeader_GetLevelScriptsBank(u32 mapno) -{ +u16 MapHeader_GetLevelScriptsBank(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].level_scripts_bank; } -u16 MapHeader_GetDayMusicId(u32 mapno) -{ +u16 MapHeader_GetDayMusicId(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].day_music_id; } -u16 MapHeader_GetNightMusicId(u32 mapno) -{ +u16 MapHeader_GetNightMusicId(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].night_music_id; } -BOOL MapHeader_HasWildEncounters(u32 mapno) -{ +BOOL MapHeader_HasWildEncounters(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].wild_encounter_bank != 0xFFFF; } -u16 MapHeader_GetWildEncounterBank(u32 mapno) -{ +u16 MapHeader_GetWildEncounterBank(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].wild_encounter_bank; } -u16 MapHeader_GetEventsBank(u32 mapno) -{ +u16 MapHeader_GetEventsBank(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].events_bank; } -u16 MapHeader_GetMapSec(u32 mapno) -{ +u16 MapHeader_GetMapSec(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].mapsec; } -u8 MapHeader_GetWeatherType(u32 mapno) -{ +u8 MapHeader_GetWeatherType(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].weather_type; } -u8 MapHeader_GetCameraType(u32 mapno) -{ +u8 MapHeader_GetCameraType(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].camera_type; } -u8 MapHeader_GetBattleBg(u32 mapno) -{ +u8 MapHeader_GetBattleBg(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].battle_bg; } -u8 MapHeader_IsEscapeRopeAllowed(u32 mapno) -{ +u8 MapHeader_IsEscapeRopeAllowed(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].is_escape_rope_allowed; } -u8 MapHeader_IsFlyAllowed(u32 mapno) -{ +u8 MapHeader_IsFlyAllowed(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].is_fly_allowed; } -u8 MapHeader_IsBikeAllowed(u32 mapno) -{ +u8 MapHeader_IsBikeAllowed(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].is_bike_allowed; } -u8 MapHeader_GetMapType(u32 mapno) -{ +u8 MapHeader_GetMapType(u32 mapno) { mapno = MapNumberBoundsCheck(mapno); return sMapHeaders[mapno].map_type; } -BOOL MapHeader_IsOutdoorNotTown(u32 mapno) -{ - if (!MapHeader_IsFlyAllowed(mapno)) +BOOL MapHeader_IsOutdoorNotTown(u32 mapno) { + if (!MapHeader_IsFlyAllowed(mapno)) { return FALSE; - if (MapHeader_GetMapType(mapno) != 1) + } + if (MapHeader_GetMapType(mapno) != 1) { return TRUE; + } return FALSE; } -BOOL MapHeader_MapIsOnMainMatrix(u32 mapno) -{ +BOOL MapHeader_MapIsOnMainMatrix(u32 mapno) { return MapHeader_GetMatrixId(mapno) == NARC_map_matrix_narc_0000_bin; } -BOOL MapHeader_IsPokemonCenter(u32 mapno) -{ +BOOL MapHeader_IsPokemonCenter(u32 mapno) { return MapHeader_GetMapType(mapno) == 5; } -BOOL MapHeader_IsCave(u32 mapno) -{ +BOOL MapHeader_IsCave(u32 mapno) { return MapHeader_GetMapType(mapno) == 3; } -BOOL MapHeader_IsBuilding(u32 mapno) -{ +BOOL MapHeader_IsBuilding(u32 mapno) { return MapHeader_GetMapType(mapno) == 4 || MapHeader_GetMapType(mapno) == 5; } -BOOL MapHeader_IsOutdoor(u32 mapno) -{ +BOOL MapHeader_IsOutdoor(u32 mapno) { return MapHeader_GetMapType(mapno) == 1 || MapHeader_GetMapType(mapno) == 2; } -BOOL MapHeader_MapIsPokemonCenter(u32 mapno) -{ +BOOL MapHeader_MapIsPokemonCenter(u32 mapno) { return MapHeader_IsPokemonCenter(mapno) != FALSE; } -BOOL MapHeader_MapIsUnionRoom(u32 mapno) -{ +BOOL MapHeader_MapIsUnionRoom(u32 mapno) { return mapno == MAP_UNION; } -BOOL MapHeader_MapIsMtCoronetFeebasRoom(u32 mapno) -{ +BOOL MapHeader_MapIsMtCoronetFeebasRoom(u32 mapno) { return mapno == MAP_D05R0113; } -BOOL MapHeader_MapIsTrophyGarden(u32 mapno) -{ +BOOL MapHeader_MapIsTrophyGarden(u32 mapno) { return mapno == MAP_D23R0101; } -BOOL MapHeader_MapIsAmitySquare(u32 mapno) -{ +BOOL MapHeader_MapIsAmitySquare(u32 mapno) { return mapno == MAP_D11R0101; } -BOOL MapHeader_MapIsSpearPillar(u32 mapno) -{ +BOOL MapHeader_MapIsSpearPillar(u32 mapno) { return mapno == MAP_D05R0114; } -BOOL MapHeader_MapIsPokemonCenterSecondFloor(u32 mapno) -{ +BOOL MapHeader_MapIsPokemonCenterSecondFloor(u32 mapno) { int i; - for (i = 0; i < NELEMS(sPokemonCenterSecondFloorMaps); i++) - { - if (mapno == sPokemonCenterSecondFloorMaps[i]) + for (i = 0; i < NELEMS(sPokemonCenterSecondFloorMaps); i++) { + if (mapno == sPokemonCenterSecondFloorMaps[i]) { return TRUE; + } } return FALSE; } -u16 MapHeader_GetMapEvolutionMethod(u32 mapno) -{ +u16 MapHeader_GetMapEvolutionMethod(u32 mapno) { int i; - for (i = 0; i < NELEMS(sMapEvolutionMethods); i += 2) - { - if (mapno == sMapEvolutionMethods[i + 0]) + for (i = 0; i < NELEMS(sMapEvolutionMethods); i += 2) { + if (mapno == sMapEvolutionMethods[i + 0]) { return sMapEvolutionMethods[i + 1]; + } } return EVO_NONE; diff --git a/arm9/src/map_matrix.c b/arm9/src/map_matrix.c index cbd1a880a..ef1318b68 100644 --- a/arm9/src/map_matrix.c +++ b/arm9/src/map_matrix.c @@ -1,59 +1,53 @@ -#include "global.h" #include "map_matrix.h" + +#include "global.h" + #include "MI_memory.h" #include "filesystem.h" #include "heap.h" #include "map_header.h" static void MapMatrix_MapMatrixData_Load( - struct MapMatrixData *map_matrix, u16 file_id, u32 map_id) -{ - map_matrix->width = 0; + struct MapMatrixData *map_matrix, u16 file_id, u32 map_id) { + map_matrix->width = 0; map_matrix->height = 0; s32 i; - for (i = 0; i < MAP_MATRIX_MAX_SIZE; i++) - { - map_matrix->headers[i] = 0; + for (i = 0; i < MAP_MATRIX_MAX_SIZE; i++) { + map_matrix->headers[i] = 0; map_matrix->altitudes[i] = 0; map_matrix->maps.data[i] = 0; } - for (i = 0; i < MAP_MATRIX_MAX_NAME_LENGTH; i++) - { + for (i = 0; i < MAP_MATRIX_MAX_NAME_LENGTH; i++) { map_matrix->name[i] = 0; } - void *buffer = - AllocAtEndAndReadWholeNarcMemberByIdPair(NARC_FIELDDATA_MAPMATRIX_MAP_MATRIX, file_id, HEAP_ID_FIELD); - u8 *cursor = (u8 *)buffer; + void *buffer = AllocAtEndAndReadWholeNarcMemberByIdPair(NARC_FIELDDATA_MAPMATRIX_MAP_MATRIX, file_id, HEAP_ID_FIELD); + u8 *cursor = (u8 *)buffer; - map_matrix->width = *(cursor++); - map_matrix->height = *(cursor++); - u8 has_headers_section = *(cursor++); + map_matrix->width = *(cursor++); + map_matrix->height = *(cursor++); + u8 has_headers_section = *(cursor++); u8 has_altitudes_section = *(cursor++); - u8 name_length = *(cursor++); + u8 name_length = *(cursor++); GF_ASSERT(name_length <= MAP_MATRIX_MAX_NAME_LENGTH); MI_CpuCopy8(cursor, &map_matrix->name, name_length); cursor += name_length; - if (has_headers_section != 0) - { + if (has_headers_section != 0) { MI_CpuCopy8( cursor, &map_matrix->headers, map_matrix->width * map_matrix->height * sizeof(u16)); cursor += map_matrix->width * map_matrix->height * sizeof(u16); - } - else - { + } else { MIi_CpuClear16((u16)map_id, &map_matrix->headers, map_matrix->width * map_matrix->height * sizeof(u16)); } - if (has_altitudes_section != 0) - { + if (has_altitudes_section != 0) { MI_CpuCopy8( cursor, &map_matrix->altitudes, map_matrix->width * map_matrix->height * sizeof(u8)); cursor += map_matrix->width * map_matrix->height * sizeof(u8); @@ -64,57 +58,50 @@ static void MapMatrix_MapMatrixData_Load( FreeToHeap(buffer); } -struct MapMatrix *MapMatrix_New(void) -{ +struct MapMatrix *MapMatrix_New(void) { struct MapMatrix *map_matrix = AllocFromHeap(HEAP_ID_FIELD, sizeof(struct MapMatrix)); - map_matrix->width = 0; - map_matrix->height = 0; + map_matrix->width = 0; + map_matrix->height = 0; map_matrix->matrix_id = 0; return map_matrix; } -void MapMatrix_Load(u16 map_id, struct MapMatrix *map_matrix) -{ +void MapMatrix_Load(u16 map_id, struct MapMatrix *map_matrix) { u16 matrix_id = MapHeader_GetMatrixId(map_id); MapMatrix_MapMatrixData_Load(&map_matrix->data, matrix_id, map_id); map_matrix->matrix_id = (u8)matrix_id; - map_matrix->height = map_matrix->data.height; - map_matrix->width = map_matrix->data.width; + map_matrix->height = map_matrix->data.height; + map_matrix->width = map_matrix->data.width; } -void MapMatrix_Free(struct MapMatrix *map_matrix) -{ +void MapMatrix_Free(struct MapMatrix *map_matrix) { FreeToHeap(map_matrix); } -u16 MapMatrix_GetMapData(s32 map_id, struct MapMatrix *map_matrix) -{ +u16 MapMatrix_GetMapData(s32 map_id, struct MapMatrix *map_matrix) { GF_ASSERT(map_id < map_matrix->width * map_matrix->height); return map_matrix->data.maps.data[map_id]; } -u8 MapMatrix_GetWidth(struct MapMatrix *map_matrix) -{ +u8 MapMatrix_GetWidth(struct MapMatrix *map_matrix) { GF_ASSERT(map_matrix != NULL); return map_matrix->width; } -u8 MapMatrix_GetHeight(struct MapMatrix *map_matrix) -{ +u8 MapMatrix_GetHeight(struct MapMatrix *map_matrix) { GF_ASSERT(map_matrix != NULL); return map_matrix->height; } -u16 MapMatrix_GetMapHeader(struct MapMatrix *map_matrix, s32 x, s32 y) -{ - s32 width = map_matrix->width; +u16 MapMatrix_GetMapHeader(struct MapMatrix *map_matrix, s32 x, s32 y) { + s32 width = map_matrix->width; s32 height = map_matrix->height; GF_ASSERT(x >= 0 && x < width); @@ -123,8 +110,7 @@ u16 MapMatrix_GetMapHeader(struct MapMatrix *map_matrix, s32 x, s32 y) return map_matrix->data.headers[y * width + x]; } -u16 MapMatrix_GetMapHeaderFromID(struct MapMatrix *map_matrix, s32 map_id) -{ +u16 MapMatrix_GetMapHeaderFromID(struct MapMatrix *map_matrix, s32 map_id) { s32 max_map_id = map_matrix->width * map_matrix->height; GF_ASSERT(0 <= map_id && map_id < max_map_id); @@ -132,14 +118,12 @@ u16 MapMatrix_GetMapHeaderFromID(struct MapMatrix *map_matrix, s32 map_id) return map_matrix->data.headers[map_id]; } -u8 MapMatrix_GetMatrixID(struct MapMatrix *map_matrix) -{ +u8 MapMatrix_GetMatrixID(struct MapMatrix *map_matrix) { return map_matrix->matrix_id; } u32 MapMatrix_GetMapAltitude( - struct MapMatrix *map_matrix, u8 param1, s16 x, s16 y, int matrix_width) -{ + struct MapMatrix *map_matrix, u8 param1, s16 x, s16 y, int matrix_width) { #pragma unused(param1) GF_ASSERT(x < matrix_width); GF_ASSERT(y * matrix_width + x < MAP_MATRIX_MAX_SIZE); @@ -147,12 +131,10 @@ u32 MapMatrix_GetMapAltitude( return map_matrix->data.altitudes[y * matrix_width + x]; } -struct MapData *MapMatrix_MapData_New(HeapID heapId) -{ +struct MapData *MapMatrix_MapData_New(HeapID heapId) { struct MapData *map_data = AllocFromHeap(heapId, sizeof(struct MapData)); - void *buffer = - AllocAtEndAndReadWholeNarcMemberByIdPair(NARC_FIELDDATA_MAPMATRIX_MAP_MATRIX, 0, heapId); - u8 *cursor = (u8 *)buffer; + void *buffer = AllocAtEndAndReadWholeNarcMemberByIdPair(NARC_FIELDDATA_MAPMATRIX_MAP_MATRIX, 0, heapId); + u8 *cursor = (u8 *)buffer; cursor += 4; u8 name_length = *cursor; @@ -165,19 +147,16 @@ struct MapData *MapMatrix_MapData_New(HeapID heapId) return map_data; } -void MapMatrix_MapData_Free(struct MapData *map_data) -{ +void MapMatrix_MapData_Free(struct MapData *map_data) { GF_ASSERT(map_data != NULL); FreeToHeap(map_data); } -u16 MapMatrix_MapData_GetData(struct MapData *map_data, s32 x, s32 y) -{ +u16 MapMatrix_MapData_GetData(struct MapData *map_data, s32 x, s32 y) { return map_data->data[MAP_MATRIX_MAX_WIDTH * y + x]; } -u16 GetMapHeader(u32 file_id, u16 x, u16 y) -{ +u16 GetMapHeader(u32 file_id, u16 x, u16 y) { struct MapMatrixData map_matrix; MapMatrix_MapMatrixData_Load(&map_matrix, (u16)file_id, 0); @@ -187,40 +166,35 @@ u16 GetMapHeader(u32 file_id, u16 x, u16 y) return map_matrix.headers[y * map_matrix.width + x]; } -u16 GetMapData(s32 map_id, struct MapMatrix *map_matrix) -{ +u16 GetMapData(s32 map_id, struct MapMatrix *map_matrix) { GF_ASSERT(map_matrix != NULL); return MapMatrix_GetMapData(map_id, map_matrix); } -void sub_02034678(struct MapMatrix *map_matrix) -{ - u16 *maps = map_matrix->data.maps.data; +void sub_02034678(struct MapMatrix *map_matrix) { + u16 *maps = map_matrix->data.maps.data; u8 *altitudes = map_matrix->data.altitudes; - u8 width = map_matrix->width; + u8 width = map_matrix->width; - if (map_matrix->matrix_id != 0) - { + if (map_matrix->matrix_id != 0) { return; } - maps[width * 0x15 + 0x17] = 0xB0; - maps[width * 0x15 + 0x18] = 0xB0; - maps[width * 0x16 + 0x17] = 0xB0; - maps[width * 0x16 + 0x18] = 0xB0; + maps[width * 0x15 + 0x17] = 0xB0; + maps[width * 0x15 + 0x18] = 0xB0; + maps[width * 0x16 + 0x17] = 0xB0; + maps[width * 0x16 + 0x18] = 0xB0; altitudes[width * 0x15 + 0x17] = 2; altitudes[width * 0x15 + 0x18] = 2; altitudes[width * 0x16 + 0x17] = 2; altitudes[width * 0x16 + 0x18] = 2; } -void sub_020346CC(struct MapMatrix *map_matrix) -{ +void sub_020346CC(struct MapMatrix *map_matrix) { u16 *maps = map_matrix->data.maps.data; - u8 width = map_matrix->width; + u8 width = map_matrix->width; - if (map_matrix->matrix_id != 0) - { + if (map_matrix->matrix_id != 0) { return; } diff --git a/arm9/src/map_object.c b/arm9/src/map_object.c index f934170bb..d01246c2c 100644 --- a/arm9/src/map_object.c +++ b/arm9/src/map_object.c @@ -1,8 +1,11 @@ -#include "global.h" #include "map_object.h" + +#include "global.h" + +#include "constants/sprites.h" + #include "field_system.h" #include "heap.h" -#include "constants/sprites.h" #include "unk_0200CA44.h" static MapObjectManager *MapObjectManager_New(u32 objectCount); @@ -212,21 +215,21 @@ void MapObjectManager_Delete(MapObjectManager *manager) { } void sub_020573C8(MapObjectManager *manager, u32 unused, u32 flagId, u32 objectCount, ObjectEvent *objectEvents) { - u32 count = MapObjectManager_GetObjectCount(manager); + u32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = MapObjectManager_GetObjects(manager); for (; count != 0; count--) { if (MapObject_IsInUse(objects) == TRUE) { switch (sub_02057F90(objects, flagId, objectCount, objectEvents)) { - case 0: - if (sub_02058450(objects) != flagId && !MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_UNK10)) { - MapObject_Remove(objects); - } - break; - - case 1: - case 2: - break; + case 0: + if (sub_02058450(objects) != flagId && !MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_UNK10)) { + MapObject_Remove(objects); + } + break; + + case 1: + case 2: + break; } } objects++; @@ -267,7 +270,7 @@ static LocalMapObject *MapObject_CreateFromObjectEvent(MapObjectManager *manager return ret; } } - + ret = MapObjectManager_GetFirstInactiveObject(manager); if (ret == NULL) { return ret; @@ -306,11 +309,11 @@ LocalMapObject *MapObject_Create(MapObjectManager *manager, u32 x, u32 y, u32 di } LocalMapObject *MapObject_CreateFromObjectEventWithId(MapObjectManager *manager, u16 id, u32 objectEventCount, u32 mapNo, const ObjectEvent *events) { - LocalMapObject *ret = NULL; + LocalMapObject *ret = NULL; ObjectEvent *objectEvent = ObjectEvent_GetById(id, objectEventCount, (ObjectEvent *)events); if (objectEvent != NULL) { - u32 flagId = ObjectEvent_GetFlagID(objectEvent); - FieldSystem* fieldSystem = MapObjectManager_GetFieldSystemPtr(manager); + u32 flagId = ObjectEvent_GetFlagID(objectEvent); + FieldSystem *fieldSystem = MapObjectManager_GetFieldSystemPtr(manager); if (FieldSystem_FlagCheck(fieldSystem, (u16)flagId) == FALSE) { ret = MapObject_CreateFromObjectEvent(manager, objectEvent, mapNo); } @@ -344,7 +347,7 @@ void MapObject_Remove(LocalMapObject *object) { } void MapObject_Delete(LocalMapObject *object) { - u32 flagId = MapObject_GetFlagID(object); + u32 flagId = MapObject_GetFlagID(object); FieldSystem *fieldSystem = MapObject_GetFieldSystem(object); FieldSystem_FlagSet(fieldSystem, flagId); MapObject_Remove(object); @@ -366,11 +369,11 @@ void sub_020576A8(LocalMapObject *object) { } void MapObjectManager_RemoveAllActiveObjects(MapObjectManager *manager) { - s32 i = 0; - s32 count = MapObjectManager_GetObjectCount(manager); + s32 i = 0; + s32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = MapObjectManager_GetObjects(manager); - do { //BUG: does not check for if count is zero, and will always execute at least once + do { // BUG: does not check for if count is zero, and will always execute at least once if (MapObject_GetFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) != 0) { MapObject_Remove(objects); } @@ -383,8 +386,8 @@ void MapObjectManager_RemoveAllActiveObjects(MapObjectManager *manager) { void sub_02057750(MapObjectManager *manager) { GF_ASSERT(sub_020587E0(manager) == TRUE); - s32 i = 0; - s32 count = MapObjectManager_GetObjectCount(manager); + s32 i = 0; + s32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = MapObjectManager_GetObjects(manager); do { @@ -401,8 +404,8 @@ void sub_02057750(MapObjectManager *manager) { void sub_020577A8(MapObjectManager *manager) { GF_ASSERT(sub_020587E0(manager) == TRUE); - s32 i = 0; - s32 count = MapObjectManager_GetObjectCount(manager); + s32 i = 0; + s32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = MapObjectManager_GetObjects(manager); do { @@ -425,7 +428,7 @@ void FieldSystem_SyncMapObjectsToSaveEx(FieldSystem *fieldSystem, MapObjectManag s32 index = 0; LocalMapObject *object; - while (MapObjectManager_GetNextObjectWithFlagFromIndex(manager, &object, &index, MAPOBJECTFLAG_ACTIVE)) { //MapObjectManager_GetNextActiveObject? this is an iterator however + while (MapObjectManager_GetNextObjectWithFlagFromIndex(manager, &object, &index, MAPOBJECTFLAG_ACTIVE)) { // MapObjectManager_GetNextActiveObject? this is an iterator however SavedMapObject_InitFromLocalMapObject(fieldSystem, object, savedObjects); count--; @@ -441,7 +444,7 @@ void FieldSystem_SyncMapObjectsToSaveEx(FieldSystem *fieldSystem, MapObjectManag void MapObjectManager_RestoreFromSave(MapObjectManager *manager, SavedMapObject *savedObjects, u32 objectCount) { while (objectCount > 0) { - if ((savedObjects->flags & MAPOBJECTFLAG_ACTIVE)) { + if (savedObjects->flags & MAPOBJECTFLAG_ACTIVE) { LocalMapObject *localObject = MapObjectManager_GetFirstInactiveObject(manager); GF_ASSERT(localObject != NULL); @@ -454,32 +457,32 @@ void MapObjectManager_RestoreFromSave(MapObjectManager *manager, SavedMapObject } static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, LocalMapObject *localObject, SavedMapObject *savedObject) { - savedObject->flags = MapObject_GetFlagsWord(localObject); - savedObject->flags2 = MapObject_GetFlags2Word(localObject); - savedObject->objId = MapObject_GetID(localObject); - savedObject->unk10 = sub_02058450(localObject); - savedObject->spriteId = MapObject_GetSpriteID(localObject); - savedObject->movement = MapObject_GetMovement(localObject); - savedObject->type = MapObject_GetType(localObject); - savedObject->flagId = MapObject_GetFlagID(localObject); - savedObject->script = MapObject_GetScriptID(localObject); + savedObject->flags = MapObject_GetFlagsWord(localObject); + savedObject->flags2 = MapObject_GetFlags2Word(localObject); + savedObject->objId = MapObject_GetID(localObject); + savedObject->unk10 = sub_02058450(localObject); + savedObject->spriteId = MapObject_GetSpriteID(localObject); + savedObject->movement = MapObject_GetMovement(localObject); + savedObject->type = MapObject_GetType(localObject); + savedObject->flagId = MapObject_GetFlagID(localObject); + savedObject->script = MapObject_GetScriptID(localObject); savedObject->initialFacing = MapObject_GetInitialFacingDirection(localObject); savedObject->currentFacing = MapObject_GetFacingDirection(localObject); - savedObject->nextFacing = MapObject_GetNextFacingDirection(localObject); - savedObject->param[0] = MapObject_GetParam(localObject, 0); - savedObject->param[1] = MapObject_GetParam(localObject, 1); - savedObject->param[2] = MapObject_GetParam(localObject, 2); - savedObject->xRange = MapObject_GetXRange(localObject); - savedObject->yRange = MapObject_GetYRange(localObject); - savedObject->initialX = MapObject_GetInitialX(localObject); + savedObject->nextFacing = MapObject_GetNextFacingDirection(localObject); + savedObject->param[0] = MapObject_GetParam(localObject, 0); + savedObject->param[1] = MapObject_GetParam(localObject, 1); + savedObject->param[2] = MapObject_GetParam(localObject, 2); + savedObject->xRange = MapObject_GetXRange(localObject); + savedObject->yRange = MapObject_GetYRange(localObject); + savedObject->initialX = MapObject_GetInitialX(localObject); savedObject->initialHeight = MapObject_GetInitialHeight(localObject); - savedObject->initialY = MapObject_GetInitialY(localObject); - savedObject->currentX = MapObject_GetCurrentX(localObject); + savedObject->initialY = MapObject_GetInitialY(localObject); + savedObject->currentX = MapObject_GetCurrentX(localObject); savedObject->currentHeight = MapObject_GetCurrentHeight(localObject); - savedObject->currentY = MapObject_GetCurrentY(localObject); + savedObject->currentY = MapObject_GetCurrentY(localObject); VecFx32 coords; - sub_02059E60(savedObject->currentX, savedObject->currentY, &coords); //some kind of x y vec copy with convertion between int and fx32 + sub_02059E60(savedObject->currentX, savedObject->currentY, &coords); // some kind of x y vec copy with convertion between int and fx32 coords.y = MapObject_GetPosVecYCoord(localObject); if (!sub_02059EC8(fieldSystem, &coords, MapObject_CheckFlag29(localObject))) { @@ -487,7 +490,7 @@ static void SavedMapObject_InitFromLocalMapObject(FieldSystem *fieldSystem, Loca } else { savedObject->vecY = coords.y; } - + memcpy(savedObject->unk30, sub_020585B0(localObject), 16); memcpy(savedObject->unk40, sub_020585D8(localObject), 16); } @@ -518,7 +521,7 @@ static void LocalMapObject_InitFromSavedMapObject(LocalMapObject *localObject, S MapObject_SetCurrentY(localObject, savedObject->currentY); VecFx32 coords = {}; - coords.y = savedObject->vecY; + coords.y = savedObject->vecY; MapObject_SetPositionVec(localObject, &coords); memcpy(sub_020585B0(localObject), savedObject->unk30, 16); @@ -539,10 +542,7 @@ static void sub_02057AEC(MapObjectManager *manager, LocalMapObject *object) { static void sub_02057B34(LocalMapObject *object) { MapObject_SetFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_UNK2 | MAPOBJECTFLAG_ACTIVE)); - MapObject_ClearFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_IGNORE_HEIGHTS | MAPOBJECTFLAG_UNK22 | - MAPOBJECTFLAG_UNK21 | MAPOBJECTFLAG_UNK19 | MAPOBJECTFLAG_UNK18 | - MAPOBJECTFLAG_UNK17 | MAPOBJECTFLAG_UNK16 | MAPOBJECTFLAG_UNK14 | - MAPOBJECTFLAG_VISIBLE | MAPOBJECTFLAG_MOVEMENT_PAUSED | MAPOBJECTFLAG_UNK3)); + MapObject_ClearFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_IGNORE_HEIGHTS | MAPOBJECTFLAG_UNK22 | MAPOBJECTFLAG_UNK21 | MAPOBJECTFLAG_UNK19 | MAPOBJECTFLAG_UNK18 | MAPOBJECTFLAG_UNK17 | MAPOBJECTFLAG_UNK16 | MAPOBJECTFLAG_UNK14 | MAPOBJECTFLAG_VISIBLE | MAPOBJECTFLAG_MOVEMENT_PAUSED | MAPOBJECTFLAG_UNK3)); sub_0205815C(object); } @@ -550,13 +550,13 @@ static void MapObject_ConvertXYToPositionVec(LocalMapObject *object) { VecFx32 position; MapObject_GetPositionVec(object, &position); - u32 x = MapObject_GetCurrentX(object); + u32 x = MapObject_GetCurrentX(object); position.x = x * FX32_CONST(16) + FX32_CONST(8); MapObject_SetPreviousX(object, x); MapObject_SetPreviousHeight(object, MapObject_GetCurrentHeight(object)); - u32 y = MapObject_GetCurrentY(object); + u32 y = MapObject_GetCurrentY(object); position.z = y * FX32_CONST(16) + FX32_CONST(8); MapObject_SetPreviousY(object, y); @@ -572,22 +572,21 @@ void MapObject_CreateFromMultipleObjectEvents(MapObjectManager *manager, u32 map MapObjectInitArgs *args = AllocFromHeapAtEnd(HEAP_ID_FIELD, sizeof(MapObjectInitArgs)); GF_ASSERT(args != NULL); - args->mapNo = mapNo; + args->mapNo = mapNo; args->objectEventCount = objectEventCount; - args->index = 0; - args->manager = manager; - args->objectEvents = objectEventsCopy; + args->index = 0; + args->manager = manager; + args->objectEvents = objectEventsCopy; MapObject_CreateFromInitArgs(args); } static void MapObject_CreateFromInitArgs(MapObjectInitArgs *args) { - FieldSystem *fieldSystem = MapObjectManager_GetFieldSystemPtr(args->manager); + FieldSystem *fieldSystem = MapObjectManager_GetFieldSystemPtr(args->manager); ObjectEvent *objectEvents = args->objectEvents; - do { //must be do while due to initial check - GF_ASSERT((ObjectEvent_ScriptIDIsUnset(objectEvents) != TRUE && FieldSystem_FlagCheck(fieldSystem, objectEvents->flag) != FALSE) || - MapObject_CreateFromObjectEvent(args->manager, objectEvents, args->mapNo) != NULL); //this is dumb, but is required to match + do { // must be do while due to initial check + GF_ASSERT((ObjectEvent_ScriptIDIsUnset(objectEvents) != TRUE && FieldSystem_FlagCheck(fieldSystem, objectEvents->flag) != FALSE) || MapObject_CreateFromObjectEvent(args->manager, objectEvents, args->mapNo) != NULL); // this is dumb, but is required to match objectEvents++; args->index++; @@ -598,8 +597,8 @@ static void MapObject_CreateFromInitArgs(MapObjectInitArgs *args) { } static LocalMapObject *MapObjectManager_GetFirstInactiveObject(MapObjectManager *manager) { - s32 i = 0; - s32 count = MapObjectManager_GetObjectCount(manager); + s32 i = 0; + s32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = MapObjectManager_GetObjects(manager); do { @@ -614,7 +613,7 @@ static LocalMapObject *MapObjectManager_GetFirstInactiveObject(MapObjectManager return NULL; } -static LocalMapObject *sub_02057C98(MapObjectManager *manager, u32 id, u32 mapNo) { //find corresponding LMO with ID and mapNo? +static LocalMapObject *sub_02057C98(MapObjectManager *manager, u32 id, u32 mapNo) { // find corresponding LMO with ID and mapNo? s32 index = 0; LocalMapObject *object; @@ -660,19 +659,19 @@ static void MapObject_InitFromObjectEvent(LocalMapObject *object, ObjectEvent *o static void MapObject_SetPositionVecFromObjectEvent(LocalMapObject *object, ObjectEvent *objectEvent) { VecFx32 coords; - u16 x = ObjectEvent_GetXCoord(objectEvent); + u16 x = ObjectEvent_GetXCoord(objectEvent); coords.x = x * FX32_CONST(16) + FX32_CONST(8); MapObject_SetInitialX(object, x); MapObject_SetPreviousX(object, x); MapObject_SetCurrentX(object, x); - coords.y = ObjectEvent_GetHeight(objectEvent); + coords.y = ObjectEvent_GetHeight(objectEvent); u32 height = (coords.y >> 3) / FX32_ONE; MapObject_SetInitialHeight(object, height); MapObject_SetPreviousHeight(object, height); MapObject_SetCurrentHeight(object, height); - u16 y = ObjectEvent_GetYCoord(objectEvent); + u16 y = ObjectEvent_GetYCoord(objectEvent); coords.z = y * FX32_CONST(16) + FX32_CONST(8); MapObject_SetInitialY(object, y); MapObject_SetPreviousY(object, y); @@ -681,7 +680,7 @@ static void MapObject_SetPositionVecFromObjectEvent(LocalMapObject *object, Obje MapObject_SetPositionVec(object, &coords); } -static void sub_02057E90(LocalMapObject *object, MapObjectManager *manager) { //setup facing and flags? also sets manager? +static void sub_02057E90(LocalMapObject *object, MapObjectManager *manager) { // setup facing and flags? also sets manager? MapObject_SetFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_UNK12 | MAPOBJECTFLAG_UNK11 | MAPOBJECTFLAG_ACTIVE)); if (MapObject_ScriptIDIsFFFF(object) == TRUE) { MapObject_SetFlag25(object, TRUE); @@ -702,7 +701,7 @@ static void sub_02057E90(LocalMapObject *object, MapObjectManager *manager) { // extern const UnkLMOCallbackStruct2 ov05_021F9080; /*static*/ void sub_02057F18(LocalMapObject *object) { - u32 spriteId = MapObject_GetSpriteID(object); + u32 spriteId = MapObject_GetSpriteID(object); UnkLMOCallbackStruct2 *unk = (spriteId == SPRITE_CAMERA_FOCUS) ? (UnkLMOCallbackStruct2 *)&ov05_021F9080 : sub_02058D4C(spriteId); sub_02058684(object, sub_02058D38(unk)); @@ -724,7 +723,7 @@ static u32 sub_02057F90(LocalMapObject *object, u32 flagId, u32 objectEventCount if (ObjectEvent_ScriptIDIsUnset(objectEvents) == TRUE) { u16 flagIdUnset = ObjectEvent_GetFlagID_AssertScriptIDIsUnset(objectEvents); - if (MapObject_CheckFlag25(object) == TRUE) { //this and the one below cannot be combined as it doesn't match + if (MapObject_CheckFlag25(object) == TRUE) { // this and the one below cannot be combined as it doesn't match if (sub_02058750(object) == flagIdUnset) { return 1; } @@ -739,8 +738,8 @@ static u32 sub_02057F90(LocalMapObject *object, u32 flagId, u32 objectEventCount return 0; } -//TODO: this also gets based on the second param, which is currently labelled as flagId, but is not -//see the note attached to sub_02058450 +// TODO: this also gets based on the second param, which is currently labelled as flagId, but is not +// see the note attached to sub_02058450 static LocalMapObject *MapObjectManager_GetFirstObjectWithID(MapObjectManager *manager, u32 objectId, u32 flagId) { s32 index = 0; LocalMapObject *object; @@ -757,12 +756,10 @@ static LocalMapObject *MapObjectManager_GetFirstObjectWithID(MapObjectManager *m LocalMapObject *MapObjectManager_GetFirstActiveObjectByID(MapObjectManager *manager, u32 id) { GF_ASSERT(manager != NULL); - s32 count = MapObjectManager_GetObjectCount(manager); + s32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = (LocalMapObject *)MapObjectManager_GetConstObjects(manager); do { - if (MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) == TRUE && - MapObject_CheckFlag25(objects) == FALSE && MapObject_GetID(objects) == id) - { + if (MapObject_TestFlagsBits(objects, MAPOBJECTFLAG_ACTIVE) == TRUE && MapObject_CheckFlag25(objects) == FALSE && MapObject_GetID(objects) == id) { return objects; } @@ -774,7 +771,7 @@ LocalMapObject *MapObjectManager_GetFirstActiveObjectByID(MapObjectManager *mana } LocalMapObject *MapObjectManager_GetFirstActiveObjectWithMovement(MapObjectManager *manager, u32 movement) { - s32 count = MapObjectManager_GetObjectCount(manager); + s32 count = MapObjectManager_GetObjectCount(manager); LocalMapObject *objects = (LocalMapObject *)MapObjectManager_GetConstObjects(manager); do { @@ -796,7 +793,7 @@ BOOL MapObjectManager_GetNextObjectWithFlagFromIndex(MapObjectManager *manager, } LocalMapObject *objects = (LocalMapObject *)MapObjectManager_GetConstObjects(manager); - LocalMapObject *object = objects + *index; + LocalMapObject *object = objects + *index; do { (*index)++; @@ -817,8 +814,7 @@ static void sub_02058148(LocalMapObject *object) { } /*static*/ void sub_0205815C(LocalMapObject *object) { - MapObject_ClearFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_UNK26 | MAPOBJECTFLAG_UNK24 | - MAPOBJECTFLAG_UNK20 | MAPOBJECTFLAG_UNK15)); + MapObject_ClearFlagsBits(object, (MapObjectFlagBits)(MAPOBJECTFLAG_UNK26 | MAPOBJECTFLAG_UNK24 | MAPOBJECTFLAG_UNK20 | MAPOBJECTFLAG_UNK15)); } static void MapObject_NoOp(LocalMapObject *object) { @@ -826,8 +822,8 @@ static void MapObject_NoOp(LocalMapObject *object) { } static u32 FieldSystem_ResolveObjectSpriteID(FieldSystem *fieldSystem, s32 spriteId) { - //BUG: index out of range, should be < not <= - //TODO: check these with sprite constants, these should be variable sprites but this starts at 101 not 100 + // BUG: index out of range, should be < not <= + // TODO: check these with sprite constants, these should be variable sprites but this starts at 101 not 100 if (spriteId >= 101 && spriteId <= 117) { spriteId = FieldSystem_VarGetObjectEventGraphicsId(fieldSystem, (u16)(spriteId - 101)); } diff --git a/arm9/src/math_util.c b/arm9/src/math_util.c index fdc10754d..3f7f8c936 100644 --- a/arm9/src/math_util.c +++ b/arm9/src/math_util.c @@ -1,13 +1,13 @@ -#include "global.h" #include "math_util.h" +#include "global.h" + extern const s16 FX_SinCosTable_[]; // temporary until further notice /* * Constant tables */ -const fx32 gSineTable[] = -{ +const fx32 gSineTable[] = { FX32_CONST(0.0), // sin(0) FX32_CONST(0.017333984375), // sin(1) FX32_CONST(0.034912109375), // sin(2) @@ -461,63 +461,12 @@ const fx32 gSineTable[] = }; static const u16 UNK_020EDC7E[] = // rotations? -{ - 0x0000, 0x00B7, 0x016D, 0x0223, 0x02D9, 0x038F, 0x0445, 0x04FB, 0x05B1, 0x0667, - 0x071D, 0x07D3, 0x0889, 0x093F, 0x09F5, 0x0AAB, 0x0B61, 0x0C17, 0x0CCD, 0x0D83, - 0x0E39, 0x0EEF, 0x0FA5, 0x105C, 0x1112, 0x11C8, 0x127E, 0x1334, 0x13EA, 0x14A0, - 0x1556, 0x160C, 0x16C2, 0x1778, 0x182E, 0x18E4, 0x199A, 0x1A50, 0x1B06, 0x1BBC, - 0x1C72, 0x1D28, 0x1DDE, 0x1E94, 0x1F4A, 0x2000, 0x20B7, 0x216D, 0x2223, 0x22D9, - 0x238F, 0x2445, 0x24FB, 0x25B1, 0x2667, 0x271D, 0x27D3, 0x2889, 0x293F, 0x29F5, - 0x2AAB, 0x2B61, 0x2C17, 0x2CCD, 0x2D83, 0x2E39, 0x2EEF, 0x2FA5, 0x305C, 0x3112, - 0x31C8, 0x327E, 0x3334, 0x33EA, 0x34A0, 0x3556, 0x360C, 0x36C2, 0x3778, 0x382E, - 0x38E4, 0x399A, 0x3A50, 0x3B06, 0x3BBC, 0x3C72, 0x3D28, 0x3DDE, 0x3E94, 0x3F4A, - 0x4000, 0x40B7, 0x416D, 0x4223, 0x42D9, 0x438F, 0x4445, 0x44FB, 0x45B1, 0x4667, - 0x471D, 0x47D3, 0x4889, 0x493F, 0x49F5, 0x4AAB, 0x4B61, 0x4C17, 0x4CCD, 0x4D83, - 0x4E39, 0x4EEF, 0x4FA5, 0x505C, 0x5112, 0x51C8, 0x527E, 0x5334, 0x53EA, 0x54A0, - 0x5556, 0x560C, 0x56C2, 0x5778, 0x582E, 0x58E4, 0x599A, 0x5A50, 0x5B06, 0x5BBC, - 0x5C72, 0x5D28, 0x5DDE, 0x5E94, 0x5F4A, 0x6000, 0x60B7, 0x616D, 0x6223, 0x62D9, - 0x638F, 0x6445, 0x64FB, 0x65B1, 0x6667, 0x671D, 0x67D3, 0x6889, 0x693F, 0x69F5, - 0x6AAB, 0x6B61, 0x6C17, 0x6CCD, 0x6D83, 0x6E39, 0x6EEF, 0x6FA5, 0x705C, 0x7112, - 0x71C8, 0x727E, 0x7334, 0x73EA, 0x74A0, 0x7556, 0x760C, 0x76C2, 0x7778, 0x782E, - 0x78E4, 0x799A, 0x7A50, 0x7B06, 0x7BBC, 0x7C72, 0x7D28, 0x7DDE, 0x7E94, 0x7F4A, - 0x8000, 0x80B7, 0x816D, 0x8223, 0x82D9, 0x838F, 0x8445, 0x84FB, 0x85B1, 0x8667, - 0x871D, 0x87D3, 0x8889, 0x893F, 0x89F5, 0x8AAB, 0x8B61, 0x8C17, 0x8CCD, 0x8D83, - 0x8E39, 0x8EEF, 0x8FA5, 0x905C, 0x9112, 0x91C8, 0x927E, 0x9334, 0x93EA, 0x94A0, - 0x9556, 0x960C, 0x96C2, 0x9778, 0x982E, 0x98E4, 0x999A, 0x9A50, 0x9B06, 0x9BBC, - 0x9C72, 0x9D28, 0x9DDE, 0x9E94, 0x9F4A, 0xA000, 0xA0B7, 0xA16D, 0xA223, 0xA2D9, - 0xA38F, 0xA445, 0xA4FB, 0xA5B1, 0xA667, 0xA71D, 0xA7D3, 0xA889, 0xA93F, 0xA9F5, - 0xAAAB, 0xAB61, 0xAC17, 0xACCD, 0xAD83, 0xAE39, 0xAEEF, 0xAFA5, 0xB05C, 0xB112, - 0xB1C8, 0xB27E, 0xB334, 0xB3EA, 0xB4A0, 0xB556, 0xB60C, 0xB6C2, 0xB778, 0xB82E, - 0xB8E4, 0xB99A, 0xBA50, 0xBB06, 0xBBBC, 0xBC72, 0xBD28, 0xBDDE, 0xBE94, 0xBF4A, - 0xC000, 0xC0B7, 0xC16D, 0xC223, 0xC2D9, 0xC38F, 0xC445, 0xC4FB, 0xC5B1, 0xC667, - 0xC71D, 0xC7D3, 0xC889, 0xC93F, 0xC9F5, 0xCAAB, 0xCB61, 0xCC17, 0xCCCD, 0xCD83, - 0xCE39, 0xCEEF, 0xCFA5, 0xD05C, 0xD112, 0xD1C8, 0xD27E, 0xD334, 0xD3EA, 0xD4A0, - 0xD556, 0xD60C, 0xD6C2, 0xD778, 0xD82E, 0xD8E4, 0xD99A, 0xDA50, 0xDB06, 0xDBBC, - 0xDC72, 0xDD28, 0xDDDE, 0xDE94, 0xDF4A, 0xE000, 0xE0B7, 0xE16D, 0xE223, 0xE2D9, - 0xE38F, 0xE445, 0xE4FB, 0xE5B1, 0xE667, 0xE71D, 0xE7D3, 0xE889, 0xE93F, 0xE9F5, - 0xEAAB, 0xEB61, 0xEC17, 0xECCD, 0xED83, 0xEE39, 0xEEEF, 0xEFA5, 0xF05C, 0xF112, - 0xF1C8, 0xF27E, 0xF334, 0xF3EA, 0xF4A0, 0xF556, 0xF60C, 0xF6C2, 0xF778, 0xF82E, - 0xF8E4, 0xF99A, 0xFA50, 0xFB06, 0xFBBC, 0xFC72, 0xFD28, 0xFDDE, 0xFE94, 0xFF4A -}; + { + 0x0000, 0x00B7, 0x016D, 0x0223, 0x02D9, 0x038F, 0x0445, 0x04FB, 0x05B1, 0x0667, 0x071D, 0x07D3, 0x0889, 0x093F, 0x09F5, 0x0AAB, 0x0B61, 0x0C17, 0x0CCD, 0x0D83, 0x0E39, 0x0EEF, 0x0FA5, 0x105C, 0x1112, 0x11C8, 0x127E, 0x1334, 0x13EA, 0x14A0, 0x1556, 0x160C, 0x16C2, 0x1778, 0x182E, 0x18E4, 0x199A, 0x1A50, 0x1B06, 0x1BBC, 0x1C72, 0x1D28, 0x1DDE, 0x1E94, 0x1F4A, 0x2000, 0x20B7, 0x216D, 0x2223, 0x22D9, 0x238F, 0x2445, 0x24FB, 0x25B1, 0x2667, 0x271D, 0x27D3, 0x2889, 0x293F, 0x29F5, 0x2AAB, 0x2B61, 0x2C17, 0x2CCD, 0x2D83, 0x2E39, 0x2EEF, 0x2FA5, 0x305C, 0x3112, 0x31C8, 0x327E, 0x3334, 0x33EA, 0x34A0, 0x3556, 0x360C, 0x36C2, 0x3778, 0x382E, 0x38E4, 0x399A, 0x3A50, 0x3B06, 0x3BBC, 0x3C72, 0x3D28, 0x3DDE, 0x3E94, 0x3F4A, 0x4000, 0x40B7, 0x416D, 0x4223, 0x42D9, 0x438F, 0x4445, 0x44FB, 0x45B1, 0x4667, 0x471D, 0x47D3, 0x4889, 0x493F, 0x49F5, 0x4AAB, 0x4B61, 0x4C17, 0x4CCD, 0x4D83, 0x4E39, 0x4EEF, 0x4FA5, 0x505C, 0x5112, 0x51C8, 0x527E, 0x5334, 0x53EA, 0x54A0, 0x5556, 0x560C, 0x56C2, 0x5778, 0x582E, 0x58E4, 0x599A, 0x5A50, 0x5B06, 0x5BBC, 0x5C72, 0x5D28, 0x5DDE, 0x5E94, 0x5F4A, 0x6000, 0x60B7, 0x616D, 0x6223, 0x62D9, 0x638F, 0x6445, 0x64FB, 0x65B1, 0x6667, 0x671D, 0x67D3, 0x6889, 0x693F, 0x69F5, 0x6AAB, 0x6B61, 0x6C17, 0x6CCD, 0x6D83, 0x6E39, 0x6EEF, 0x6FA5, 0x705C, 0x7112, 0x71C8, 0x727E, 0x7334, 0x73EA, 0x74A0, 0x7556, 0x760C, 0x76C2, 0x7778, 0x782E, 0x78E4, 0x799A, 0x7A50, 0x7B06, 0x7BBC, 0x7C72, 0x7D28, 0x7DDE, 0x7E94, 0x7F4A, 0x8000, 0x80B7, 0x816D, 0x8223, 0x82D9, 0x838F, 0x8445, 0x84FB, 0x85B1, 0x8667, 0x871D, 0x87D3, 0x8889, 0x893F, 0x89F5, 0x8AAB, 0x8B61, 0x8C17, 0x8CCD, 0x8D83, 0x8E39, 0x8EEF, 0x8FA5, 0x905C, 0x9112, 0x91C8, 0x927E, 0x9334, 0x93EA, 0x94A0, 0x9556, 0x960C, 0x96C2, 0x9778, 0x982E, 0x98E4, 0x999A, 0x9A50, 0x9B06, 0x9BBC, 0x9C72, 0x9D28, 0x9DDE, 0x9E94, 0x9F4A, 0xA000, 0xA0B7, 0xA16D, 0xA223, 0xA2D9, 0xA38F, 0xA445, 0xA4FB, 0xA5B1, 0xA667, 0xA71D, 0xA7D3, 0xA889, 0xA93F, 0xA9F5, 0xAAAB, 0xAB61, 0xAC17, 0xACCD, 0xAD83, 0xAE39, 0xAEEF, 0xAFA5, 0xB05C, 0xB112, 0xB1C8, 0xB27E, 0xB334, 0xB3EA, 0xB4A0, 0xB556, 0xB60C, 0xB6C2, 0xB778, 0xB82E, 0xB8E4, 0xB99A, 0xBA50, 0xBB06, 0xBBBC, 0xBC72, 0xBD28, 0xBDDE, 0xBE94, 0xBF4A, 0xC000, 0xC0B7, 0xC16D, 0xC223, 0xC2D9, 0xC38F, 0xC445, 0xC4FB, 0xC5B1, 0xC667, 0xC71D, 0xC7D3, 0xC889, 0xC93F, 0xC9F5, 0xCAAB, 0xCB61, 0xCC17, 0xCCCD, 0xCD83, 0xCE39, 0xCEEF, 0xCFA5, 0xD05C, 0xD112, 0xD1C8, 0xD27E, 0xD334, 0xD3EA, 0xD4A0, 0xD556, 0xD60C, 0xD6C2, 0xD778, 0xD82E, 0xD8E4, 0xD99A, 0xDA50, 0xDB06, 0xDBBC, 0xDC72, 0xDD28, 0xDDDE, 0xDE94, 0xDF4A, 0xE000, 0xE0B7, 0xE16D, 0xE223, 0xE2D9, 0xE38F, 0xE445, 0xE4FB, 0xE5B1, 0xE667, 0xE71D, 0xE7D3, 0xE889, 0xE93F, 0xE9F5, 0xEAAB, 0xEB61, 0xEC17, 0xECCD, 0xED83, 0xEE39, 0xEEEF, 0xEFA5, 0xF05C, 0xF112, 0xF1C8, 0xF27E, 0xF334, 0xF3EA, 0xF4A0, 0xF556, 0xF60C, 0xF6C2, 0xF778, 0xF82E, 0xF8E4, 0xF99A, 0xFA50, 0xFB06, 0xFBBC, 0xFC72, 0xFD28, 0xFDDE, 0xFE94, 0xFF4A + }; -static const u16 UNK_020EDB80[] = -{ - 0x169F, 0x0F14, 0x0B4F, 0x090C, 0x078A, 0x0676, 0x05A7, 0x0506, - 0x0486, 0x041C, 0x03C5, 0x037A, 0x033B, 0x0304, 0x02D3, 0x02A9, - 0x0283, 0x0261, 0x0243, 0x0227, 0x020E, 0x01F7, 0x01E2, 0x01CF, - 0x01BD, 0x01AC, 0x019D, 0x018F, 0x0182, 0x0175, 0x0169, 0x015E, - 0x0154, 0x014A, 0x0141, 0x0139, 0x0130, 0x0128, 0x0121, 0x011A, - 0x0113, 0x010D, 0x0107, 0x0101, 0x00FB, 0x00F6, 0x00F1, 0x00EC, - 0x00E7, 0x00E3, 0x00DE, 0x00DA, 0x00D6, 0x00D2, 0x00CE, 0x00CB, - 0x00C7, 0x00C4, 0x00C1, 0x00BD, 0x00BA, 0x00B7, 0x00B4, 0x00B2, - 0x00AF, 0x00AC, 0x00AA, 0x00A7, 0x00A5, 0x00A3, 0x00A0, 0x009E, - 0x009C, 0x009A, 0x0098, 0x0096, 0x0094, 0x0092, 0x0090, 0x008E, - 0x008D, 0x008B, 0x0089, 0x0088, 0x0086, 0x0085, 0x0083, 0x0082, - 0x0080, 0x007F, 0x007D, 0x007C, 0x007B, 0x0079, 0x0078, 0x0077, - 0x0076, 0x0074, 0x0073, 0x0072, 0x0071, 0x0070, 0x006F, 0x006E, - 0x006D, 0x006C, 0x006B, 0x006A, 0x0069, 0x0068, 0x0067, 0x0066, - 0x0065, 0x0064, 0x0063, 0x0062, 0x0062, 0x0061, 0x0060, 0x005F, - 0x005E, 0x005E, 0x005D, 0x005C, 0x005B, 0x005B, 0x005A +static const u16 UNK_020EDB80[] = { + 0x169F, 0x0F14, 0x0B4F, 0x090C, 0x078A, 0x0676, 0x05A7, 0x0506, 0x0486, 0x041C, 0x03C5, 0x037A, 0x033B, 0x0304, 0x02D3, 0x02A9, 0x0283, 0x0261, 0x0243, 0x0227, 0x020E, 0x01F7, 0x01E2, 0x01CF, 0x01BD, 0x01AC, 0x019D, 0x018F, 0x0182, 0x0175, 0x0169, 0x015E, 0x0154, 0x014A, 0x0141, 0x0139, 0x0130, 0x0128, 0x0121, 0x011A, 0x0113, 0x010D, 0x0107, 0x0101, 0x00FB, 0x00F6, 0x00F1, 0x00EC, 0x00E7, 0x00E3, 0x00DE, 0x00DA, 0x00D6, 0x00D2, 0x00CE, 0x00CB, 0x00C7, 0x00C4, 0x00C1, 0x00BD, 0x00BA, 0x00B7, 0x00B4, 0x00B2, 0x00AF, 0x00AC, 0x00AA, 0x00A7, 0x00A5, 0x00A3, 0x00A0, 0x009E, 0x009C, 0x009A, 0x0098, 0x0096, 0x0094, 0x0092, 0x0090, 0x008E, 0x008D, 0x008B, 0x0089, 0x0088, 0x0086, 0x0085, 0x0083, 0x0082, 0x0080, 0x007F, 0x007D, 0x007C, 0x007B, 0x0079, 0x0078, 0x0077, 0x0076, 0x0074, 0x0073, 0x0072, 0x0071, 0x0070, 0x006F, 0x006E, 0x006D, 0x006C, 0x006B, 0x006A, 0x0069, 0x0068, 0x0067, 0x0066, 0x0065, 0x0064, 0x0063, 0x0062, 0x0062, 0x0061, 0x0060, 0x005F, 0x005E, 0x005E, 0x005D, 0x005C, 0x005B, 0x005B, 0x005A }; /* @@ -539,7 +488,7 @@ u32 PRandom(u32 seed); void SetMTRNGSeed(u32 seed); u32 MTRandom(void); -void MTX22_2DAffine(struct Mtx22 * mtx, u16 radians, fx32 x, fx32 y, u8 type); +void MTX22_2DAffine(struct Mtx22 *mtx, u16 radians, fx32 x, fx32 y, u8 type); s32 CircularDistance(s32 x1, s32 y1, s32 x2, s32 y2); s32 MathUtil_0201BC84(u16 arg0, s32 arg1); @@ -548,43 +497,39 @@ s32 MathUtil_0201BC84(u16 arg0, s32 arg1); * Trigonometric functions */ // Returns the sine of a 16-bit unsigned degree value. -s32 Sin(u16 degrees) -{ - if (degrees >= 360) +s32 Sin(u16 degrees) { + if (degrees >= 360) { return 0; - else + } else { return gSineTable[degrees]; + } } // Returns the cosine of a 16-bit unsigned degree value. -s32 Cos(u16 degrees) -{ - if (degrees >= 360) +s32 Cos(u16 degrees) { + if (degrees >= 360) { return 0; - else + } else { return gSineTable[degrees + 90]; + } } // Returns the wrapped sine of a 16-bit unsigned degree value. -s32 Sin_Wrap(u16 degrees) -{ +s32 Sin_Wrap(u16 degrees) { return gSineTable[degrees % 360]; } // Returns the wrapped cosine of a 16-bit unsigned degree value. -s32 Cos_Wrap(u16 degrees) -{ +s32 Cos_Wrap(u16 degrees) { return gSineTable[(degrees % 360) + 90]; } // Purpose unknown. -u16 MathUtil_0201B9A0(u16 x) -{ +u16 MathUtil_0201B9A0(u16 x) { return UNK_020EDC7E[x % 360]; } // Returns the sine of a 32-bit signed degree value. -s32 Sin32(s32 degrees) -{ +s32 Sin32(s32 degrees) { return gSineTable[(u16)(degrees >> 12) % 360]; } @@ -595,20 +540,17 @@ static u32 sMTRNG_State[624]; // Mersenne Twister seed storage/buffer static u32 sLCRNG_State; // Returns the Linear-congruential buffer in full. -u32 GetLCRNGSeed() -{ +u32 GetLCRNGSeed() { return sLCRNG_State; } // Initializes the Linear-congruential buffer with a 32-bit seed. -void SetLCRNGSeed(u32 seed) -{ +void SetLCRNGSeed(u32 seed) { sLCRNG_State = seed; } // Calculates an unsigned 16-bit random integer using the Linear-congruential algorithm. -u16 LCRandom(void) -{ +u16 LCRandom(void) { // cycle the RNG sLCRNG_State *= 0x41C64E6D; sLCRNG_State += 0x6073; @@ -616,46 +558,42 @@ u16 LCRandom(void) } // Returns a cheap, psuedo-random unsigned 32-bit random integer from a seed. -u32 PRandom(u32 seed) -{ +u32 PRandom(u32 seed) { return seed * 1812433253 + 1; // seed from Mersenne Twister algorithm } -static s32 sMTRNG_Cycles = 625; // Mersenne Twister cycle counter, 625 default value -static u32 sMTRNG_XOR[2] = {0, 0x9908b0df}; // Mersenne Twister XOR mask table +static s32 sMTRNG_Cycles = 625; // Mersenne Twister cycle counter, 625 default value +static u32 sMTRNG_XOR[2] = { 0, 0x9908b0df }; // Mersenne Twister XOR mask table // Initializes the Mersenne Twister buffer with a 32-bit seed. -void SetMTRNGSeed(u32 seed) -{ +void SetMTRNGSeed(u32 seed) { sMTRNG_State[0] = seed; - for (sMTRNG_Cycles = 1; sMTRNG_Cycles < 624; sMTRNG_Cycles++) + for (sMTRNG_Cycles = 1; sMTRNG_Cycles < 624; sMTRNG_Cycles++) { sMTRNG_State[sMTRNG_Cycles] = 1812433253 * (sMTRNG_State[sMTRNG_Cycles - 1] ^ (sMTRNG_State[sMTRNG_Cycles - 1] >> 30)) + sMTRNG_Cycles; + } } // Calculates an unsigned 32-bit random integer using the Mersenne Twister algorithm. -u32 MTRandom(void) -{ +u32 MTRandom(void) { u32 val; s32 i; - if (sMTRNG_Cycles >= 624) - { - if (sMTRNG_Cycles == 625) + if (sMTRNG_Cycles >= 624) { + if (sMTRNG_Cycles == 625) { SetMTRNGSeed(5489); + } - for (i = 0; i < 227; i++) - { - val = (sMTRNG_State[i] & 0x80000000) | (sMTRNG_State[i + 1] & 0x7fffffff); + for (i = 0; i < 227; i++) { + val = (sMTRNG_State[i] & 0x80000000) | (sMTRNG_State[i + 1] & 0x7fffffff); sMTRNG_State[i] = sMTRNG_State[i + 397] ^ (val >> 1) ^ sMTRNG_XOR[val & 0x1]; } - for (; i < 623; i++) - { - val = (sMTRNG_State[i] & 0x80000000) | (sMTRNG_State[i + 1] & 0x7fffffff); + for (; i < 623; i++) { + val = (sMTRNG_State[i] & 0x80000000) | (sMTRNG_State[i + 1] & 0x7fffffff); sMTRNG_State[i] = sMTRNG_State[i + -227] ^ (val >> 1) ^ sMTRNG_XOR[val & 0x1]; } - val = (sMTRNG_State[623] & 0x80000000) | (sMTRNG_State[0] & 0x7fffffff); + val = (sMTRNG_State[623] & 0x80000000) | (sMTRNG_State[0] & 0x7fffffff); sMTRNG_State[623] = sMTRNG_State[396] ^ (val >> 1) ^ sMTRNG_XOR[val & 0x1]; sMTRNG_Cycles = 0; @@ -675,15 +613,15 @@ u32 MTRandom(void) * Nitro FX specific functions */ // Rotates and scales a 2D plane by a number of degrees. -void MTX22_2DAffine(struct Mtx22 * mtx, u16 radians, fx32 x, fx32 y, u8 type) -{ - if (type == 1) +void MTX22_2DAffine(struct Mtx22 *mtx, u16 radians, fx32 x, fx32 y, u8 type) { + if (type == 1) { radians = (u16)((u32)(radians * 65535) >> 8); // shut up the compiler - else if (type == 2) + } else if (type == 2) { radians = (u16)((u32)(radians * 65535) / 360); // shut up the compiler + } MTX_Rot22_(mtx, - FX_SinCosTable_[((radians >> 4) * 2)], // TODO: macros + FX_SinCosTable_[((radians >> 4) * 2)], // TODO: macros FX_SinCosTable_[((radians >> 4) * 2) + 1]); // TODO: macros MTX_ScaleApply22(mtx, mtx, x, y); } @@ -692,8 +630,7 @@ void MTX22_2DAffine(struct Mtx22 * mtx, u16 radians, fx32 x, fx32 y, u8 type) * Vector functions */ // Calculates the circular distance between two vector coordinates. -s32 CircularDistance(s32 x1, s32 y1, s32 x2, s32 y2) -{ +s32 CircularDistance(s32 x1, s32 y1, s32 x2, s32 y2) { struct Vecx32 v1, v2, v3, v4; fx32 f1, f2; s32 ret; @@ -728,23 +665,21 @@ s32 CircularDistance(s32 x1, s32 y1, s32 x2, s32 y2) v2.z = 0; VEC_Subtract(&v2, &v1, &v4); - f2 = VEC_DotProduct(&v3, &v4); + f2 = VEC_DotProduct(&v3, &v4); ret = f2 >> FX32_INT_SHIFT; ret = (ret < 0) ? -ret : ret; - if (f1 <= 0) + if (f1 <= 0) { ret *= -1; + } return ret; } -s32 MathUtil_0201BC84(u16 arg0, s32 arg1) -{ - return (arg1 * 65535) / - (FX32_MUL((arg0 * 2) << FX32_INT_SHIFT, FX32_CONST(3.140f)) >> FX32_INT_SHIFT); +s32 MathUtil_0201BC84(u16 arg0, s32 arg1) { + return (arg1 * 65535) / (FX32_MUL((arg0 * 2) << FX32_INT_SHIFT, FX32_CONST(3.140f)) >> FX32_INT_SHIFT); } // Required to protect UNK_020EDB80 from dead-stripping -s32 CALC_SomeDeadstrippedFunction(s32 arg) -{ +s32 CALC_SomeDeadstrippedFunction(s32 arg) { return UNK_020EDB80[arg]; } diff --git a/arm9/src/message_format.c b/arm9/src/message_format.c index 9f3f9d3ef..c51546cfe 100644 --- a/arm9/src/message_format.c +++ b/arm9/src/message_format.c @@ -1,14 +1,18 @@ +#include "message_format.h" + #include "global.h" -#include "filesystem.h" -#include "gf_gfx_loader.h" + #include "graphic/font.naix" -#include "heap.h" -#include "message_format.h" -#include "msgdata.h" #include "msgdata/msg.naix" #include "msgdata/msg/narc_0199.h" #include "msgdata/msg/narc_0382.h" #include "msgdata/msg/narc_0497.h" + +#include "easy_chat.h" +#include "filesystem.h" +#include "gf_gfx_loader.h" +#include "heap.h" +#include "msgdata.h" #include "player_data.h" #include "pokemon.h" #include "pokemon_storage_system.h" @@ -16,7 +20,6 @@ #include "string_control_code.h" #include "text.h" #include "trainer_data.h" -#include "easy_chat.h" #include "unk_02015CC0.h" #include "unk_02024E64.h" #include "unk_020286F8.h" @@ -40,49 +43,42 @@ const u16 UNK_020ECE64[] = { 0 }; -MessageFormat *MessageFormat_New(HeapID heapId) -{ +MessageFormat *MessageFormat_New(HeapID heapId) { return MessageFormat_New_Custom(8, 32, heapId); } -MessageFormat *MessageFormat_New_Custom(u32 nstr, u32 strlen, HeapID heapId) -{ +MessageFormat *MessageFormat_New_Custom(u32 nstr, u32 strlen, HeapID heapId) { GF_ASSERT(nstr != 0); GF_ASSERT(strlen != 0); MessageFormat *messageFormat = AllocFromHeapAtEnd(heapId, sizeof(MessageFormat)); - if (messageFormat != NULL) - { - messageFormat->count = nstr; + if (messageFormat != NULL) { + messageFormat->count = nstr; messageFormat->heapId = heapId; messageFormat->buffer = String_New(strlen, heapId); - if (messageFormat->buffer != NULL) - { + if (messageFormat->buffer != NULL) { messageFormat->fields = AllocFromHeapAtEnd(heapId, nstr * sizeof(MessageFormatFields)); - if (messageFormat->fields != NULL) - { + if (messageFormat->fields != NULL) { s32 i; - for (i = 0; i < nstr; i++) - { + for (i = 0; i < nstr; i++) { MessageFormat_InitFields(&messageFormat->fields[i]); messageFormat->fields[i].msg = String_New(strlen, heapId); - if (messageFormat->fields[i].msg == NULL) + if (messageFormat->fields[i].msg == NULL) { break; + } } - if (i == nstr) + if (i == nstr) { return messageFormat; + } } } } return NULL; } -void MessageFormat_Delete(MessageFormat *messageFormat) -{ +void MessageFormat_Delete(MessageFormat *messageFormat) { GF_ASSERT(messageFormat->count != 0); - if (messageFormat->fields != NULL) - { - for (s32 i = 0; i < messageFormat->count; i++) - { + if (messageFormat->fields != NULL) { + for (s32 i = 0; i < messageFormat->count; i++) { if (messageFormat->fields[i].msg == NULL) { break; } @@ -90,432 +86,356 @@ void MessageFormat_Delete(MessageFormat *messageFormat) } FreeToHeap(messageFormat->fields); } - if (messageFormat->buffer != NULL) + if (messageFormat->buffer != NULL) { String_Delete(messageFormat->buffer); + } messageFormat->count = 0; FreeToHeap(messageFormat); } -void MessageFormat_InitFields(MessageFormatFields *fields) -{ +void MessageFormat_InitFields(MessageFormatFields *fields) { #pragma unused(fields) } -void SetStringAsPlaceholder(MessageFormat *messageFormat, u32 idx, struct String *str, MessageFormatAttrs *attrs) -{ +void SetStringAsPlaceholder(MessageFormat *messageFormat, u32 idx, struct String *str, MessageFormatAttrs *attrs) { GF_ASSERT(idx < messageFormat->count); - if (idx < messageFormat->count) - { - if (attrs != NULL) - { + if (idx < messageFormat->count) { + if (attrs != NULL) { messageFormat->fields[idx].attrs = *attrs; } StringCopy(messageFormat->fields[idx].msg, str); } } -void BufferString(MessageFormat *messageFormat, u32 idx, struct String * str, u32 a3, u32 a4, u32 a5) -{ -#pragma unused(a3,a4,a5) +void BufferString(MessageFormat *messageFormat, u32 idx, struct String *str, u32 a3, u32 a4, u32 a5) { +#pragma unused(a3, a4, a5) SetStringAsPlaceholder(messageFormat, idx, str, NULL); } -void BufferPlayersName(MessageFormat *messageFormat, u32 idx, PlayerProfile *profile) -{ - u16 * name = PlayerProfile_GetNamePtr(profile); +void BufferPlayersName(MessageFormat *messageFormat, u32 idx, PlayerProfile *profile) { + u16 *name = PlayerProfile_GetNamePtr(profile); CopyU16ArrayToString(messageFormat->buffer, name); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferRivalsName(MessageFormat *messageFormat, u32 idx, struct SaveData * save) -{ - u16 * name = GetRivalNamePtr(sub_02024EC0(save)); +void BufferRivalsName(MessageFormat *messageFormat, u32 idx, struct SaveData *save) { + u16 *name = GetRivalNamePtr(sub_02024EC0(save)); CopyU16ArrayToString(messageFormat->buffer, name); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferFriendsName(MessageFormat *messageFormat, u32 idx, struct SaveData * save) -{ - PlayerProfile *profile = Save_PlayerData_GetProfileAddr(save); - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0497_bin, messageFormat->heapId); - if (PlayerProfile_GetTrainerGender(profile) == PLAYER_GENDER_MALE) - { - ReadMsgDataIntoString(msgData, narc_0497_00001, messageFormat->buffer); //Dawn - } - else - { - ReadMsgDataIntoString(msgData, narc_0497_00000, messageFormat->buffer); //Lucas +void BufferFriendsName(MessageFormat *messageFormat, u32 idx, struct SaveData *save) { + PlayerProfile *profile = Save_PlayerData_GetProfileAddr(save); + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0497_bin, messageFormat->heapId); + if (PlayerProfile_GetTrainerGender(profile) == PLAYER_GENDER_MALE) { + ReadMsgDataIntoString(msgData, narc_0497_00001, messageFormat->buffer); // Dawn + } else { + ReadMsgDataIntoString(msgData, narc_0497_00000, messageFormat->buffer); // Lucas } SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } -void BufferBoxMonSpeciesName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0362_bin, messageFormat->heapId); +void BufferBoxMonSpeciesName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0362_bin, messageFormat->heapId); ReadMsgDataIntoString(msgData, GetBoxMonData(mon, MON_DATA_SPECIES, NULL), messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } -void BufferBoxMonSpeciesNameWithArticle(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon) -{ +void BufferBoxMonSpeciesNameWithArticle(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon) { BufferSpeciesNameWithArticle(messageFormat, idx, GetBoxMonData(mon, MON_DATA_SPECIES, NULL)); } -void BufferSpeciesNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 species) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0363_bin, messageFormat->heapId); +void BufferSpeciesNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 species) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0363_bin, messageFormat->heapId); ReadMsgDataIntoString(msgData, species, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } -void BufferBoxMonNickname(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon) -{ +void BufferBoxMonNickname(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon) { GetBoxMonData(mon, MON_DATA_NICKNAME_3, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferBoxMonOTName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon) -{ +void BufferBoxMonOTName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon) { GetBoxMonData(mon, MON_DATA_OT_NAME_2, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferIntegerAsString(MessageFormat *messageFormat, u32 idx, s32 num, u32 ndigits, enum PrintingMode printingMode, BOOL whichCharset) -{ +void BufferIntegerAsString(MessageFormat *messageFormat, u32 idx, s32 num, u32 ndigits, enum PrintingMode printingMode, BOOL whichCharset) { String16_FormatInteger(messageFormat->buffer, num, ndigits, printingMode, whichCharset); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferMoveName(MessageFormat *messageFormat, u32 idx, u32 move) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0588_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferMoveName(MessageFormat *messageFormat, u32 idx, u32 move) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0588_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, move, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferRibbonNameOrDesc(MessageFormat *messageFormat, u32 idx, u32 ribbon) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0484_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferRibbonNameOrDesc(MessageFormat *messageFormat, u32 idx, u32 ribbon) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0484_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, ribbon, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferAbilityName(MessageFormat *messageFormat, u32 idx, u32 ability) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0552_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferAbilityName(MessageFormat *messageFormat, u32 idx, u32 ability) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0552_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, ability, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferNatureName(MessageFormat *messageFormat, u32 idx, u32 nature) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0190_bin, messageFormat->heapId); +void BufferNatureName(MessageFormat *messageFormat, u32 idx, u32 nature) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0190_bin, messageFormat->heapId); ReadMsgDataIntoString(msgData, nature, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } -void BufferItemName(MessageFormat *messageFormat, u32 idx, u32 item) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0344_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferItemName(MessageFormat *messageFormat, u32 idx, u32 item) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0344_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, item, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferItemNameWithIndefArticle(MessageFormat *messageFormat, u32 idx, u32 item) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0346_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferItemNameWithIndefArticle(MessageFormat *messageFormat, u32 idx, u32 item) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0346_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, item, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferItemNamePlural(MessageFormat *messageFormat, u32 idx, u32 item) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0347_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferItemNamePlural(MessageFormat *messageFormat, u32 idx, u32 item) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0347_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, item, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferPocketName(MessageFormat *messageFormat, u32 idx, u32 pocket) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0349_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferPocketName(MessageFormat *messageFormat, u32 idx, u32 pocket) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0349_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, pocket, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferTypeName(MessageFormat *messageFormat, u32 idx, u32 type) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0565_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferTypeName(MessageFormat *messageFormat, u32 idx, u32 type) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0565_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, type, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferStatName(MessageFormat *messageFormat, u32 idx, u32 stat) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0495_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferStatName(MessageFormat *messageFormat, u32 idx, u32 stat) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0495_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, stat, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferStatusName(MessageFormat *messageFormat, u32 idx, u32 status) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0205_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferStatusName(MessageFormat *messageFormat, u32 idx, u32 status) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0205_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, status, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferFlavorDislikeText(MessageFormat *messageFormat, u32 idx, u32 flavor) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0548_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferFlavorDislikeText(MessageFormat *messageFormat, u32 idx, u32 flavor) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0548_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, flavor, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferLandmarkName(MessageFormat *messageFormat, u32 idx, u32 landmark) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0382_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferLandmarkName(MessageFormat *messageFormat, u32 idx, u32 landmark) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0382_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, landmark, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferPoketchAppName(MessageFormat *messageFormat, u32 idx, u32 app) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0406_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferPoketchAppName(MessageFormat *messageFormat, u32 idx, u32 app) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0406_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, app, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferTrainerClassName(MessageFormat *messageFormat, u32 idx, u32 trclass) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0560_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferTrainerClassName(MessageFormat *messageFormat, u32 idx, u32 trclass) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0560_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, trclass, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferTrainerClassNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 trclass) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0561_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferTrainerClassNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 trclass) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0561_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, trclass, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferTrainerClassNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer * tr) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0560_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferTrainerClassNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer *tr) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0560_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, tr->data.trainerClass, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferTrainerName(MessageFormat *messageFormat, u32 idx, u32 msgno) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0559_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferTrainerName(MessageFormat *messageFormat, u32 idx, u32 msgno) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0559_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, msgno, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferTrainerNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer * trdata) -{ +void BufferTrainerNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer *trdata) { CopyU16ArrayToString(messageFormat->buffer, trdata->name); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferUndergroundItemName(MessageFormat *messageFormat, u32 idx, u32 item) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0569_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferUndergroundItemName(MessageFormat *messageFormat, u32 idx, u32 item) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0569_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, item, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferUndergroundItemNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 item) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0570_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferUndergroundItemNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 item) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0570_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, item, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferUndergroundTrapName(MessageFormat *messageFormat, u32 idx, u32 trap) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0571_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferUndergroundTrapName(MessageFormat *messageFormat, u32 idx, u32 trap) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0571_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, trap, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferUndergroundTrapNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 trap) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0572_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferUndergroundTrapNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 trap) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0572_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, trap, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferContestJudgeName(MessageFormat *messageFormat, u32 idx, u32 judge) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0194_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferContestJudgeName(MessageFormat *messageFormat, u32 idx, u32 judge) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0194_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, judge, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferContestMessage(MessageFormat *messageFormat, u32 idx, u32 msg) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0191_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferContestMessage(MessageFormat *messageFormat, u32 idx, u32 msg) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0191_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, msg, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferContestMessage2(MessageFormat *messageFormat, u32 idx, u32 msg) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0191_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferContestMessage2(MessageFormat *messageFormat, u32 idx, u32 msg) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0191_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, msg, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferInterviewQuestion(MessageFormat *messageFormat, u32 idx, u32 question) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0574_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferInterviewQuestion(MessageFormat *messageFormat, u32 idx, u32 question) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0574_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, question, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferInterviewAnswer(MessageFormat *messageFormat, u32 idx, u32 answer) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0573_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferInterviewAnswer(MessageFormat *messageFormat, u32 idx, u32 answer) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0573_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, answer, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferDecorationName(MessageFormat *messageFormat, u32 idx, u32 decor) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0567_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferDecorationName(MessageFormat *messageFormat, u32 idx, u32 decor) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0567_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, decor, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferDecorationNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 decor) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0568_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferDecorationNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 decor) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0568_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, decor, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferGenderSymbol(MessageFormat *messageFormat, u32 idx, u32 gender) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0199_bin, messageFormat->heapId); - switch (gender) - { +void BufferGenderSymbol(MessageFormat *messageFormat, u32 idx, u32 gender) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0199_bin, messageFormat->heapId); + switch (gender) { case 0: ReadMsgDataIntoString(msgData, narc_0199_00068, messageFormat->buffer); // ♂ break; @@ -530,53 +450,43 @@ void BufferGenderSymbol(MessageFormat *messageFormat, u32 idx, u32 gender) DestroyMsgData(msgData); } -void BufferBoxName(MessageFormat *messageFormat, u32 idx, struct PCStorage * pc, s32 boxno) -{ +void BufferBoxName(MessageFormat *messageFormat, u32 idx, struct PCStorage *pc, s32 boxno) { PCStorage_GetBoxName(pc, boxno, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferGymName(MessageFormat *messageFormat, u32 idx, u32 gym) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0331_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferGymName(MessageFormat *messageFormat, u32 idx, u32 gym) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0331_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, gym, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferTimeOfDayName(MessageFormat *messageFormat, u32 idx, u32 time) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0550_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferTimeOfDayName(MessageFormat *messageFormat, u32 idx, u32 time) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0550_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, time, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferCountryName(MessageFormat *messageFormat, u32 idx, u32 country) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0612_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferCountryName(MessageFormat *messageFormat, u32 idx, u32 country) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0612_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, country, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferCityName(MessageFormat *messageFormat, u32 idx, u32 countryId, u32 cityId) -{ +void BufferCityName(MessageFormat *messageFormat, u32 idx, u32 countryId, u32 cityId) { u32 msgBank = GetCityNamesMsgdataIdByCountry(countryId); - if (msgBank != 0 && cityId != 0) - { + if (msgBank != 0 && cityId != 0) { struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, (s32)msgBank, messageFormat->heapId); - if (msgData != NULL) - { + if (msgData != NULL) { ReadMsgDataIntoString(msgData, cityId, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); @@ -584,43 +494,35 @@ void BufferCityName(MessageFormat *messageFormat, u32 idx, u32 countryId, u32 ci } } -void BufferECWord(MessageFormat *messageFormat, u32 idx, u32 ecWordIdx) -{ +void BufferECWord(MessageFormat *messageFormat, u32 idx, u32 ecWordIdx) { GetECWordIntoStringByIndex(ecWordIdx, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); } -void BufferSealName(MessageFormat *messageFormat, u32 idx, u32 seal) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0010_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferSealName(MessageFormat *messageFormat, u32 idx, u32 seal) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0010_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, seal, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferSealNamePlural(MessageFormat *messageFormat, u32 idx, u32 seal) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0011_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferSealNamePlural(MessageFormat *messageFormat, u32 idx, u32 seal) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0011_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, seal, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferLocationName(MessageFormat *messageFormat, u32 idx, u16 location) -{ - u32 r6 = (u32)sub_02015CC0(location); - u32 r4 = (u32)sub_02015CE0(location); - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, UNK_020ECE64[r6], messageFormat->heapId); - if (msgData != NULL) - { - if (r4 < MsgDataGetCount(msgData)) - { +void BufferLocationName(MessageFormat *messageFormat, u32 idx, u16 location) { + u32 r6 = (u32)sub_02015CC0(location); + u32 r4 = (u32)sub_02015CE0(location); + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, UNK_020ECE64[r6], messageFormat->heapId); + if (msgData != NULL) { + if (r4 < MsgDataGetCount(msgData)) { ReadMsgDataIntoString(msgData, r4, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); @@ -630,8 +532,7 @@ void BufferLocationName(MessageFormat *messageFormat, u32 idx, u16 location) // Fallback: Mystery Zone DestroyMsgData(msgData); msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0382_bin, messageFormat->heapId); - if (msgData != NULL) - { + if (msgData != NULL) { ReadMsgDataIntoString(msgData, narc_0382_00000, messageFormat->buffer); // Mystery Zone SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); @@ -639,125 +540,105 @@ void BufferLocationName(MessageFormat *messageFormat, u32 idx, u16 location) } } -void BufferPoffinName(MessageFormat *messageFormat, u32 idx, u32 poffin) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0414_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferPoffinName(MessageFormat *messageFormat, u32 idx, u32 poffin) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0414_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, poffin, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferFashionName(MessageFormat *messageFormat, u32 idx, u32 fashion) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0338_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferFashionName(MessageFormat *messageFormat, u32 idx, u32 fashion) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0338_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, fashion, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferFashionNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 fashion) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0339_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferFashionNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 fashion) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0339_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, fashion, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferContestBackgroundName(MessageFormat *messageFormat, u32 idx, u32 bg) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0340_bin, messageFormat->heapId); - if (msgData != NULL) - { +void BufferContestBackgroundName(MessageFormat *messageFormat, u32 idx, u32 bg) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0340_bin, messageFormat->heapId); + if (msgData != NULL) { ReadMsgDataIntoString(msgData, bg, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void BufferGroupName(MessageFormat *messageFormat, struct SaveData * save, u32 r5, u32 idx, u32 sp28) -{ - void * r6 = sub_0202881C(save); - u8 sp10 = sub_020287F8(r6, r5); - u8 r7 = sub_02028804(r6, r5); - struct String * r4 = String_New(64, HEAP_ID_4); +void BufferGroupName(MessageFormat *messageFormat, struct SaveData *save, u32 r5, u32 idx, u32 sp28) { + void *r6 = sub_0202881C(save); + u8 sp10 = sub_020287F8(r6, r5); + u8 r7 = sub_02028804(r6, r5); + struct String *r4 = String_New(64, HEAP_ID_4); CopyU16ArrayToString(r4, sub_020287A8(r6, r5, sp28)); BufferString(messageFormat, idx, r4, sp10, 1, r7); String_Delete(r4); } -void BufferMonthNameAbbr(MessageFormat *messageFormat, u32 idx, u32 month) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0364_bin, messageFormat->heapId); - if (msgData != NULL) - { - if (month < 1 || month > 12) +void BufferMonthNameAbbr(MessageFormat *messageFormat, u32 idx, u32 month) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0364_bin, messageFormat->heapId); + if (msgData != NULL) { + if (month < 1 || month > 12) { month = 1; + } ReadMsgDataIntoString(msgData, month - 1, messageFormat->buffer); SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL); DestroyMsgData(msgData); } } -void MessageFormat_UpperFirstChar(MessageFormat *messageFormat, u32 idx) -{ +void MessageFormat_UpperFirstChar(MessageFormat *messageFormat, u32 idx) { StrUpperFirstChar(messageFormat->fields[idx].msg); } -void StringExpandPlaceholders(MessageFormat *messageFormat, struct String * dest, struct String * src) -{ - const u16 * cstr = String_c_str(src); +void StringExpandPlaceholders(MessageFormat *messageFormat, struct String *dest, struct String *src) { + const u16 *cstr = String_c_str(src); String_SetEmpty(dest); - while (*cstr != EOS) - { - if (*cstr == EXT_CTRL_CODE_BEGIN) - { - if (MsgArray_ControlCodeIsStrVar(cstr)) - { + while (*cstr != EOS) { + if (*cstr == EXT_CTRL_CODE_BEGIN) { + if (MsgArray_ControlCodeIsStrVar(cstr)) { u32 idx = MsgArray_ControlCodeGetField(cstr, 0); GF_ASSERT(idx < messageFormat->count); StringCat_HandleTrainerName(dest, messageFormat->fields[idx].msg); cstr = MsgArray_SkipControlCode(cstr); - } - else - { - const u16 * before = cstr; - cstr = MsgArray_SkipControlCode(cstr); - while (before < cstr) + } else { + const u16 *before = cstr; + cstr = MsgArray_SkipControlCode(cstr); + while (before < cstr) { StrAddChar(dest, *before++); + } } - } - else + } else { StrAddChar(dest, *cstr++); + } } } -void MessageFormat_ResetBuffers(MessageFormat *messageFormat) -{ - for (int i = 0; i < messageFormat->count; i++) +void MessageFormat_ResetBuffers(MessageFormat *messageFormat) { + for (int i = 0; i < messageFormat->count; i++) { String_SetEmpty(messageFormat->fields[i].msg); + } } -struct UnkStruct_0200B870 * MessagePrinter_New(u32 color1, u32 color2, u32 color3, HeapID heapId) -{ - struct UnkStruct_0200B870 * sp8 = AllocFromHeap(heapId, sizeof(struct UnkStruct_0200B870)); - if (sp8 != NULL) - { +struct UnkStruct_0200B870 *MessagePrinter_New(u32 color1, u32 color2, u32 color3, HeapID heapId) { + struct UnkStruct_0200B870 *sp8 = AllocFromHeap(heapId, sizeof(struct UnkStruct_0200B870)); + if (sp8 != NULL) { sp8->unk_0 = GfGfxLoader_GetCharData(NARC_GRAPHIC_FONT, NARC_font_narc_0004_NCGR_lz, 1, &sp8->unk_4, heapId); int i; - u8 * ptr = sp8->unk_4->pRawData; - for (i = 0; i < sp8->unk_4->szByte; i++) - { - switch (ptr[i]) - { + u8 *ptr = sp8->unk_4->pRawData; + for (i = 0; i < sp8->unk_4->szByte; i++) { + switch (ptr[i]) { case 0x00: ptr[i] = (u8)((color3 << 4) | color3); break; @@ -792,32 +673,25 @@ struct UnkStruct_0200B870 * MessagePrinter_New(u32 color1, u32 color2, u32 color return sp8; } -void MessagePrinter_Delete(struct UnkStruct_0200B870 * a0) -{ - if (a0 != NULL) - { - if (a0->unk_0 != NULL) +void MessagePrinter_Delete(struct UnkStruct_0200B870 *a0) { + if (a0 != NULL) { + if (a0->unk_0 != NULL) { FreeToHeap(a0->unk_0); + } FreeToHeap(a0); } } -void sub_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, struct Window *a2, int a3, int a4) -{ +void sub_0200B9A8(struct UnkStruct_0200B870 *a0, int a1, struct Window *a2, int a3, int a4) { BlitBitmapRectToWindow(a2, a0->unk_4->pRawData + UNK_020ECE6C[a1][0], 0, 0, UNK_020ECE6C[a1][1], 8, (u16)a3, (u16)a4, UNK_020ECE6C[a1][1], 8); } -void sub_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, struct Window *window, int x, int y) -{ +void sub_0200B9EC(struct UnkStruct_0200B870 *string, u32 value, u32 n, enum PrintingMode mode, struct Window *window, int x, int y) { ConvertUIntToDecimalString(string->data, value, mode, n); - for (int i = 0; string->data[i] != EOS; i++) - { - if (string->data[i] >= CHAR_JP_0 && string->data[i] <= CHAR_JP_9) - { + for (int i = 0; string->data[i] != EOS; i++) { + if (string->data[i] >= CHAR_JP_0 && string->data[i] <= CHAR_JP_9) { BlitBitmapRectToWindow(window, string->unk_4->pRawData + (string->data[i] - CHAR_JP_0) * 32, 0, 0, 8, 8, (u16)x, (u16)y, 8, 8); - } - else - { + } else { FillWindowPixelRect(window, (u8)string->unk_28, (u16)x, (u16)y, 8, 8); } x += 8; diff --git a/arm9/src/move_relearner.c b/arm9/src/move_relearner.c index bf16c256c..75da98e61 100644 --- a/arm9/src/move_relearner.c +++ b/arm9/src/move_relearner.c @@ -1,5 +1,7 @@ -#include "global.h" #include "move_relearner.h" + +#include "global.h" + #include "pokemon.h" MoveRelearner *MoveRelearner_New(HeapID heapId) { @@ -12,10 +14,10 @@ void MoveRelearner_Delete(MoveRelearner *moveRelearner) { FreeToHeap(moveRelearner); } -u16 *MoveRelearner_GetEligibleLevelUpMoves(Pokemon* mon, HeapID heapId) { +u16 *MoveRelearner_GetEligibleLevelUpMoves(Pokemon *mon, HeapID heapId) { u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); - u8 form = GetMonData(mon, MON_DATA_FORM, NULL); - u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL); + u8 form = GetMonData(mon, MON_DATA_FORM, NULL); + u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL); u16 moves[MAX_MON_MOVES]; for (u8 i = 0; i < MAX_MON_MOVES; ++i) { @@ -23,7 +25,7 @@ u16 *MoveRelearner_GetEligibleLevelUpMoves(Pokemon* mon, HeapID heapId) { } u16 *tableFromFile = AllocFromHeap(heapId, LEVEL_UP_LEARNSET_MAX * 2); - u16 *returnTable = AllocFromHeap(heapId, LEVEL_UP_LEARNSET_MAX * 2); + u16 *returnTable = AllocFromHeap(heapId, LEVEL_UP_LEARNSET_MAX * 2); LoadLevelUpLearnset_HandleAlternateForm(species, form, tableFromFile); diff --git a/arm9/src/msgdata.c b/arm9/src/msgdata.c index 159757be1..6a3bfb7eb 100644 --- a/arm9/src/msgdata.c +++ b/arm9/src/msgdata.c @@ -1,78 +1,70 @@ -#include "global.h" -#include "filesystem.h" #include "msgdata.h" + +#include "global.h" + #include "msgdata/msg.naix" -#include "heap.h" + #include "MI_memory.h" +#include "filesystem.h" +#include "heap.h" #include "string16.h" -static void * LoadSingleElementFromNarc(NarcId narc_id, s32 file_id, HeapID heapId); -static void FreeMsgDataRawData(void * data); -static void ReadMsgData_ExistingTable_ExistingArray(struct MsgDataTable * table, u32 num, u16 * dest); -static void ReadMsgData_NewNarc_ExistingArray(NarcId narc_id, u32 group, u32 num, HeapID heapId, u16 * dest); -static void CopyEncryptedMessage16(u16 * dest, const u16 * src, struct MsgDataAlloc * param); -static void ReadMsgData_ExistingTable_ExistingString(struct MsgDataTable * table, u32 num, struct String * dest); -static struct String * ReadMsgData_ExistingTable_NewString(struct MsgDataTable * table, u32 num, HeapID heapId); -static void ReadMsgData_ExistingNarc_ExistingString(NARC * narc, u32 group, u32 num, HeapID heapId, struct String * dest); -static struct String * ReadMsgData_ExistingNarc_NewString(NARC * narc, u32 group, u32 num, HeapID heapId); -static u16 GetMsgCount_ExistingTable(struct MsgDataTable * tbl); +static void *LoadSingleElementFromNarc(NarcId narc_id, s32 file_id, HeapID heapId); +static void FreeMsgDataRawData(void *data); +static void ReadMsgData_ExistingTable_ExistingArray(struct MsgDataTable *table, u32 num, u16 *dest); +static void ReadMsgData_NewNarc_ExistingArray(NarcId narc_id, u32 group, u32 num, HeapID heapId, u16 *dest); +static void CopyEncryptedMessage16(u16 *dest, const u16 *src, struct MsgDataAlloc *param); +static void ReadMsgData_ExistingTable_ExistingString(struct MsgDataTable *table, u32 num, struct String *dest); +static struct String *ReadMsgData_ExistingTable_NewString(struct MsgDataTable *table, u32 num, HeapID heapId); +static void ReadMsgData_ExistingNarc_ExistingString(NARC *narc, u32 group, u32 num, HeapID heapId, struct String *dest); +static struct String *ReadMsgData_ExistingNarc_NewString(NARC *narc, u32 group, u32 num, HeapID heapId); +static u16 GetMsgCount_ExistingTable(struct MsgDataTable *tbl); static u16 GetMsgCount_TableFromNarc(NarcId narc_id, s32 file_id); -static void * LoadSingleElementFromNarc(NarcId narc_id, s32 file_id, HeapID heapId) -{ +static void *LoadSingleElementFromNarc(NarcId narc_id, s32 file_id, HeapID heapId) { return AllocAndReadWholeNarcMemberByIdPair(narc_id, file_id, heapId); } -static void FreeMsgDataRawData(void * data) -{ +static void FreeMsgDataRawData(void *data) { FreeToHeap(data); } -inline static void Decrypt1(struct MsgDataAlloc * arg0, u32 arg1, u32 seed) -{ +inline static void Decrypt1(struct MsgDataAlloc *arg0, u32 arg1, u32 seed) { seed = seed * 765 * (arg1 + 1) & 0xffff; seed |= seed << 16; arg0->offset ^= seed; arg0->length ^= seed; } -inline static void Decrypt2(u16 * arg0, u32 count, u32 arg2) -{ +inline static void Decrypt2(u16 *arg0, u32 count, u32 arg2) { u16 seed = (u16)((arg2 + 1) * 596947); - while (count-- > 0) - { + while (count-- > 0) { *arg0 ^= seed; arg0++; seed += 18749; } } -static void ReadMsgData_ExistingTable_ExistingArray(struct MsgDataTable * table, u32 num, u16 * dest) -{ +static void ReadMsgData_ExistingTable_ExistingArray(struct MsgDataTable *table, u32 num, u16 *dest) { struct MsgDataAlloc sp0; - if (num < table->count) - { + if (num < table->count) { sp0 = table->alloc[num]; Decrypt1(&sp0, num, table->key); CopyEncryptedMessage16(dest, (const u16 *)((u8 *)table + sp0.offset), &sp0); Decrypt2(dest, sp0.length, num); - } - else - { + } else { GF_ASSERT(FALSE); } } -static void ReadMsgData_NewNarc_ExistingArray(NarcId narc_id, u32 group, u32 num, HeapID heapId, u16 * dest) -{ - NARC * narc = NARC_New(narc_id, heapId); +static void ReadMsgData_NewNarc_ExistingArray(NarcId narc_id, u32 group, u32 num, HeapID heapId, u16 *dest) { + NARC *narc = NARC_New(narc_id, heapId); u16 header[2]; struct MsgDataAlloc alloc; - if (narc != NULL) - { + if (narc != NULL) { NARC_ReadFromMember(narc, group, 0, 4, header); NARC_ReadFromMember(narc, group, 8 * num + 4, 8, &alloc); Decrypt1(&alloc, num, header[1]); @@ -82,143 +74,116 @@ static void ReadMsgData_NewNarc_ExistingArray(NarcId narc_id, u32 group, u32 num } } -static void CopyEncryptedMessage16(u16 * dest, const u16 * src, struct MsgDataAlloc * param) -{ +static void CopyEncryptedMessage16(u16 *dest, const u16 *src, struct MsgDataAlloc *param) { MI_CpuCopy16(src, dest, 2 * param->length); } -static void ReadMsgData_ExistingTable_ExistingString(struct MsgDataTable * table, u32 num, struct String * dest) -{ +static void ReadMsgData_ExistingTable_ExistingString(struct MsgDataTable *table, u32 num, struct String *dest) { struct MsgDataAlloc alloc; - u16 * buf; - if (num < table->count) - { + u16 *buf; + if (num < table->count) { alloc = table->alloc[num]; Decrypt1(&alloc, num, table->key); buf = AllocFromHeapAtEnd(HEAP_ID_DEFAULT, 2 * alloc.length); - if (buf != NULL) - { + if (buf != NULL) { MI_CpuCopy16((char *)table + alloc.offset, buf, 2 * alloc.length); Decrypt2(buf, alloc.length, num); CopyU16ArrayToStringN(dest, buf, alloc.length); FreeToHeap(buf); } - } - else - { + } else { GF_ASSERT(FALSE); String_SetEmpty(dest); } } -static struct String * ReadMsgData_ExistingTable_NewString(struct MsgDataTable * table, u32 num, HeapID heapId) -{ +static struct String *ReadMsgData_ExistingTable_NewString(struct MsgDataTable *table, u32 num, HeapID heapId) { struct MsgDataAlloc alloc; - u16 * buf; - struct String * dest; - if (num < table->count) - { + u16 *buf; + struct String *dest; + if (num < table->count) { alloc = table->alloc[num]; Decrypt1(&alloc, num, table->key); buf = AllocFromHeapAtEnd(heapId, 2 * alloc.length); - if (buf != NULL) - { + if (buf != NULL) { MI_CpuCopy16((char *)table + alloc.offset, buf, 2 * alloc.length); Decrypt2(buf, alloc.length, num); dest = String_New(alloc.length, heapId); - if (dest != NULL) + if (dest != NULL) { CopyU16ArrayToStringN(dest, buf, alloc.length); + } FreeToHeap(buf); return dest; - } - else - { + } else { return NULL; } - } - else - { + } else { GF_ASSERT(FALSE); return String_New(4, heapId); } } -void ReadMsgData_NewNarc_ExistingString(NarcId narc_id, u32 group, u32 num, HeapID heapId, struct String * dest) -{ - NARC * narc = NARC_New(narc_id, heapId); - if (narc != NULL) - { +void ReadMsgData_NewNarc_ExistingString(NarcId narc_id, u32 group, u32 num, HeapID heapId, struct String *dest) { + NARC *narc = NARC_New(narc_id, heapId); + if (narc != NULL) { ReadMsgData_ExistingNarc_ExistingString(narc, group, num, heapId, dest); NARC_Delete(narc); } } -static void ReadMsgData_ExistingNarc_ExistingString(NARC * narc, u32 group, u32 num, HeapID heapId, struct String * dest) -{ - u16 * buf; +static void ReadMsgData_ExistingNarc_ExistingString(NARC *narc, u32 group, u32 num, HeapID heapId, struct String *dest) { + u16 *buf; u32 size; u16 sp10[2]; struct MsgDataAlloc alloc; NARC_ReadFromMember(narc, group, 0, 4, sp10); - if (num < sp10[0]) - { + if (num < sp10[0]) { NARC_ReadFromMember(narc, group, 8 * num + 4, 8, &alloc); Decrypt1(&alloc, num, sp10[1]); size = alloc.length * 2; - buf = AllocFromHeapAtEnd(heapId, size); - if (buf != NULL) - { + buf = AllocFromHeapAtEnd(heapId, size); + if (buf != NULL) { NARC_ReadFromMember(narc, group, alloc.offset, size, buf); Decrypt2(buf, alloc.length, num); CopyU16ArrayToStringN(dest, buf, alloc.length); FreeToHeap(buf); return; } - } - else - { + } else { GF_ASSERT(FALSE); String_SetEmpty(dest); } } -struct String * ReadMsgData_NewNarc_NewString(NarcId narc_id, u32 group, u32 num, HeapID heapId) -{ - NARC * narc = NARC_New(narc_id, heapId); - struct String * string; - if (narc != NULL) - { +struct String *ReadMsgData_NewNarc_NewString(NarcId narc_id, u32 group, u32 num, HeapID heapId) { + NARC *narc = NARC_New(narc_id, heapId); + struct String *string; + if (narc != NULL) { string = ReadMsgData_ExistingNarc_NewString(narc, group, num, heapId); NARC_Delete(narc); - } - else - { + } else { string = String_New(4, heapId); } return string; } -static struct String * ReadMsgData_ExistingNarc_NewString(NARC * narc, u32 group, u32 num, HeapID heapId) -{ - struct String * dest; - u16 * buf; +static struct String *ReadMsgData_ExistingNarc_NewString(NARC *narc, u32 group, u32 num, HeapID heapId) { + struct String *dest; + u16 *buf; u32 size; u16 sp10[2]; struct MsgDataAlloc alloc; NARC_ReadFromMember(narc, group, 0, 4, sp10); - if (num < sp10[0]) - { + if (num < sp10[0]) { NARC_ReadFromMember(narc, group, 8 * num + 4, 8, &alloc); Decrypt1(&alloc, num, sp10[1]); dest = String_New(alloc.length, heapId); - if (dest != NULL) - { + if (dest != NULL) { size = alloc.length * 2; - buf = AllocFromHeapAtEnd(heapId, size); - if (buf != NULL) - { + buf = AllocFromHeapAtEnd(heapId, size); + if (buf != NULL) { NARC_ReadFromMember(narc, group, alloc.offset, size, buf); Decrypt2(buf, alloc.length, num); CopyU16ArrayToStringN(dest, buf, alloc.length); @@ -226,58 +191,45 @@ static struct String * ReadMsgData_ExistingNarc_NewString(NARC * narc, u32 group } } return dest; - } - else - { + } else { GF_ASSERT(FALSE); return String_New(4, heapId); } } -static u16 GetMsgCount_ExistingTable(struct MsgDataTable * tbl) -{ +static u16 GetMsgCount_ExistingTable(struct MsgDataTable *tbl) { return tbl->count; } -static u16 GetMsgCount_TableFromNarc(NarcId narc_id, s32 file_id) -{ +static u16 GetMsgCount_TableFromNarc(NarcId narc_id, s32 file_id) { u16 n[2]; ReadFromNarcMemberByIdPair(&n, narc_id, file_id, 0, 4); return n[0]; } -struct MsgData * NewMsgDataFromNarc(MsgDataLoadType type, NarcId narc_id, s32 file_id, HeapID heapId) -{ - struct MsgData * msgData = AllocFromHeapAtEnd(heapId, sizeof(struct MsgData)); - if (msgData != NULL) - { - if (type == MSGDATA_LOAD_DIRECT) - { +struct MsgData *NewMsgDataFromNarc(MsgDataLoadType type, NarcId narc_id, s32 file_id, HeapID heapId) { + struct MsgData *msgData = AllocFromHeapAtEnd(heapId, sizeof(struct MsgData)); + if (msgData != NULL) { + if (type == MSGDATA_LOAD_DIRECT) { msgData->data.raw = LoadSingleElementFromNarc(narc_id, file_id, heapId); - if (msgData->data.raw == NULL) - { + if (msgData->data.raw == NULL) { FreeToHeap(msgData); return NULL; } - } - else - { + } else { msgData->data.narc = NARC_New(narc_id, heapId); } - msgData->type = (u16)type; + msgData->type = (u16)type; msgData->narc_id = (u16)narc_id; msgData->file_id = (u16)file_id; - msgData->heapId = (u16)heapId; + msgData->heapId = (u16)heapId; } return msgData; } -void DestroyMsgData(struct MsgData * msgData) -{ - if (msgData != NULL) - { - switch (msgData->type) - { +void DestroyMsgData(struct MsgData *msgData) { + if (msgData != NULL) { + switch (msgData->type) { case MSGDATA_LOAD_DIRECT: FreeMsgDataRawData(msgData->data.raw); break; @@ -289,10 +241,8 @@ void DestroyMsgData(struct MsgData * msgData) } } -void ReadMsgDataIntoString(struct MsgData * msgData, u32 msg_no, struct String * dest) -{ - switch (msgData->type) - { +void ReadMsgDataIntoString(struct MsgData *msgData, u32 msg_no, struct String *dest) { + switch (msgData->type) { case MSGDATA_LOAD_DIRECT: ReadMsgData_ExistingTable_ExistingString(msgData->data.raw, msg_no, dest); break; @@ -302,10 +252,8 @@ void ReadMsgDataIntoString(struct MsgData * msgData, u32 msg_no, struct String * } } -struct String * NewString_ReadMsgData(struct MsgData * msgData, u32 msg_no) -{ - switch (msgData->type) - { +struct String *NewString_ReadMsgData(struct MsgData *msgData, u32 msg_no) { + switch (msgData->type) { case MSGDATA_LOAD_DIRECT: return ReadMsgData_ExistingTable_NewString(msgData->data.raw, msg_no, (HeapID)msgData->heapId); case MSGDATA_LOAD_LAZY: @@ -315,10 +263,8 @@ struct String * NewString_ReadMsgData(struct MsgData * msgData, u32 msg_no) } } -u16 MsgDataGetCount(struct MsgData * msgData) -{ - switch (msgData->type) - { +u16 MsgDataGetCount(struct MsgData *msgData) { + switch (msgData->type) { case MSGDATA_LOAD_DIRECT: return GetMsgCount_ExistingTable(msgData->data.raw); case MSGDATA_LOAD_LAZY: @@ -328,10 +274,8 @@ u16 MsgDataGetCount(struct MsgData * msgData) } } -void ReadMsgDataIntoU16Array(struct MsgData * msgData, u32 msg_no, u16 * dest) -{ - switch (msgData->type) - { +void ReadMsgDataIntoU16Array(struct MsgData *msgData, u32 msg_no, u16 *dest) { + switch (msgData->type) { case MSGDATA_LOAD_DIRECT: ReadMsgData_ExistingTable_ExistingArray(msgData->data.raw, msg_no, dest); break; @@ -341,23 +285,19 @@ void ReadMsgDataIntoU16Array(struct MsgData * msgData, u32 msg_no, u16 * dest) } } -void GetSpeciesNameIntoArray(u16 species, HeapID heapId, u16 * dest) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0362_bin, heapId); +void GetSpeciesNameIntoArray(u16 species, HeapID heapId, u16 *dest) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0362_bin, heapId); ReadMsgDataIntoU16Array(msgData, species, dest); DestroyMsgData(msgData); } -struct String * ReadMsgData_ExpandPlaceholders(MessageFormat *messageFormat, struct MsgData * msgData, u32 msgno, HeapID heapId) -{ - struct String * ret = NULL; - struct String * r4 = String_New(1024, HEAP_ID_DEFAULT); - struct String * r5; - if (r4 != NULL) - { +struct String *ReadMsgData_ExpandPlaceholders(MessageFormat *messageFormat, struct MsgData *msgData, u32 msgno, HeapID heapId) { + struct String *ret = NULL; + struct String *r4 = String_New(1024, HEAP_ID_DEFAULT); + struct String *r5; + if (r4 != NULL) { r5 = NewString_ReadMsgData(msgData, msgno); - if (r5 != NULL) - { + if (r5 != NULL) { StringExpandPlaceholders(messageFormat, r4, r5); ret = StringDup(r4, heapId); String_Delete(r5); @@ -367,15 +307,12 @@ struct String * ReadMsgData_ExpandPlaceholders(MessageFormat *messageFormat, str return ret; } -struct String * GetMoveName(u32 move, HeapID heapId) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0588_bin, heapId); - struct String * ret; - if (msgData != NULL) - { +struct String *GetMoveName(u32 move, HeapID heapId) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0588_bin, heapId); + struct String *ret; + if (msgData != NULL) { ret = String_New(16, heapId); - if (ret != NULL) - { + if (ret != NULL) { ReadMsgDataIntoString(msgData, move, ret); } DestroyMsgData(msgData); @@ -384,12 +321,10 @@ struct String * GetMoveName(u32 move, HeapID heapId) return NULL; } -struct String * GetSpeciesName(u16 species, HeapID heapId) -{ - struct String * ret; - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0362_bin, heapId); - if (msgData != NULL) - { +struct String *GetSpeciesName(u16 species, HeapID heapId) { + struct String *ret; + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0362_bin, heapId); + if (msgData != NULL) { ret = NewString_ReadMsgData(msgData, species); DestroyMsgData(msgData); return ret; diff --git a/arm9/src/nutdata.c b/arm9/src/nutdata.c index baafc38c7..27025b4d0 100644 --- a/arm9/src/nutdata.c +++ b/arm9/src/nutdata.c @@ -1,41 +1,38 @@ -//TODO: RENAME THIS ENTIRE FILE - WE SHOULD NOT BE USING NUT +// TODO: RENAME THIS ENTIRE FILE - WE SHOULD NOT BE USING NUT + +#include "nutdata.h" #include "global.h" + +#include "constants/items.h" + +#include "msgdata/msg.naix" + #include "filesystem.h" -#include "nutdata.h" #include "msgdata.h" -#include "msgdata/msg.naix" -#include "constants/items.h" -NARC * OpenNutsDataNarc(HeapID heapId) -{ +NARC *OpenNutsDataNarc(HeapID heapId) { return NARC_New(NARC_ITEMTOOL_ITEMDATA_NUTS_DATA, heapId); } -struct NutData * ReadNutDataFromNarc(NARC * narc, u32 berry_idx, HeapID heapId) -{ +struct NutData *ReadNutDataFromNarc(NARC *narc, u32 berry_idx, HeapID heapId) { return NARC_AllocAndReadWholeMember(narc, berry_idx, heapId); } -void CloseNutsDataNarc(NARC * narc) -{ +void CloseNutsDataNarc(NARC *narc) { NARC_Delete(narc); } -struct NutData * LoadNutDataSingle(s32 berry_idx, HeapID heapId) -{ +struct NutData *LoadNutDataSingle(s32 berry_idx, HeapID heapId) { return AllocAndReadWholeNarcMemberByIdPair(NARC_ITEMTOOL_ITEMDATA_NUTS_DATA, berry_idx, heapId); } -struct NutData * LoadNutDataSingleByItemId(s32 item_id, HeapID heapId) -{ +struct NutData *LoadNutDataSingleByItemId(s32 item_id, HeapID heapId) { return LoadNutDataSingle(item_id - FIRST_BERRY_IDX, heapId); } -u32 GetNutAttr(struct NutData * nut, u32 attr) -{ - switch (attr) - { +u32 GetNutAttr(struct NutData *nut, u32 attr) { + switch (attr) { case 0: return nut->size; case 1: @@ -63,18 +60,16 @@ u32 GetNutAttr(struct NutData * nut, u32 attr) } } -struct String * GetNutName(u32 berry_idx, HeapID heapId) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0373_bin, heapId); - struct String * ret = NewString_ReadMsgData(msgData, berry_idx); +struct String *GetNutName(u32 berry_idx, HeapID heapId) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0373_bin, heapId); + struct String *ret = NewString_ReadMsgData(msgData, berry_idx); DestroyMsgData(msgData); return ret; } -struct String * GetNutDesc(u32 berry_idx, HeapID heapId) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0372_bin, heapId); - struct String * ret = NewString_ReadMsgData(msgData, berry_idx); +struct String *GetNutDesc(u32 berry_idx, HeapID heapId) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0372_bin, heapId); + struct String *ret = NewString_ReadMsgData(msgData, berry_idx); DestroyMsgData(msgData); return ret; } diff --git a/arm9/src/oam.c b/arm9/src/oam.c index 712164a12..cfdc3a572 100644 --- a/arm9/src/oam.c +++ b/arm9/src/oam.c @@ -1,5 +1,7 @@ -#include "global.h" #include "oam.h" + +#include "global.h" + #include "GX_g2.h" #include "MI_memory.h" #include "heap.h" @@ -25,33 +27,24 @@ void sub_02009EAC(s32 param0, u32 param5, u32 param6, u32 param7, - HeapID heapId) -{ + HeapID heapId) { s32 r0; - if (param0 < 4) - { + if (param0 < 4) { r0 = 4; - if (param1 > 0x7c) - { + if (param1 > 0x7c) { param1 = param1 - (4 - param0); } - } - else - { + } else { r0 = param0; } s32 r2; - if (param2 < 1) - { + if (param2 < 1) { r2 = 1; - if (param3 > 0x1e) - { + if (param3 > 0x1e) { param3 = param3 - (1 - param2); } - } - else - { + } else { r2 = param2; } @@ -66,8 +59,7 @@ void InitOamData(s32 param0, u32 param5, u32 param6, u32 param7, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(oamData == NULL); oamData = AllocFromHeap(heapId, sizeof(struct OamData)); GF_ASSERT(oamData); @@ -80,17 +72,14 @@ void InitOamData(s32 param0, &oamData->oamManagers[1], (u16)param4, (u16)param5, (u16)param6, (u16)param7, 1)); } -void ApplyAndResetOamManagerBuffer(void) -{ - if (oamData != NULL) - { +void ApplyAndResetOamManagerBuffer(void) { + if (oamData != NULL) { NNS_G2dApplyAndResetOamManagerBuffer(&oamData->oamManagers[0]); NNS_G2dApplyAndResetOamManagerBuffer(&oamData->oamManagers[1]); } } -void DeinitOamData(void) -{ +void DeinitOamData(void) { GF_ASSERT(oamData); sub_0200A064(oamData->heapId); @@ -100,12 +89,10 @@ void DeinitOamData(void) oamData = NULL; } -void sub_02009FD8(void *param0, u32 *param1, u32 param2, u32 param3) -{ +void sub_02009FD8(void *param0, u32 *param1, u32 param2, u32 param3) { GF_ASSERT(oamData); - if (param2 == 1) - { + if (param2 == 1) { sub_0202135C(param0, param1, EntryOamManagerOamWithAffineIdxMainScreen, EntryOamManagerAffineMainScreen, sub_020213A0, param2, param3); return; } @@ -113,55 +100,45 @@ void sub_02009FD8(void *param0, u32 *param1, u32 param2, u32 param3) sub_0202135C(param0, param1, EntryOamManagerOamWithAffineIdxSubScreen, EntryOamManagerAffineSubScreen, sub_020213A0, param2, param3); } -NNSG2dOamManager *GetOamManager(u32 screen) -{ +NNSG2dOamManager *GetOamManager(u32 screen) { GF_ASSERT(oamData); - if (screen == 0) - { + if (screen == 0) { return &oamData->oamManagers[0]; - } - else - { + } else { return &oamData->oamManagers[1]; } } -void sub_0200A064(HeapID heapId) -{ +void sub_0200A064(HeapID heapId) { sub_020203CC(heapId); } -void sub_0200A06C(HeapID heapId) -{ +void sub_0200A06C(HeapID heapId) { sub_02020404(heapId); } -u32 EntryOamManagerOamWithAffineIdxMainScreen(u32 param0, u32 param1) -{ +u32 EntryOamManagerOamWithAffineIdxMainScreen(u32 param0, u32 param1) { u32 res = NNS_G2dEntryOamManagerOamWithAffineIdx(&oamData->oamManagers[0], param0, param1); GF_ASSERT(res); return res; } -u32 EntryOamManagerOamWithAffineIdxSubScreen(u32 param0, u32 param1) -{ +u32 EntryOamManagerOamWithAffineIdxSubScreen(u32 param0, u32 param1) { u32 res = NNS_G2dEntryOamManagerOamWithAffineIdx(&oamData->oamManagers[1], param0, param1); GF_ASSERT(res); return res; } -u32 EntryOamManagerAffineMainScreen(u32 param0) -{ +u32 EntryOamManagerAffineMainScreen(u32 param0) { u32 res = NNS_G2dEntryOamManagerAffine(&oamData->oamManagers[0], param0); GF_ASSERT(res != 0xFFFE); return res; } -u32 EntryOamManagerAffineSubScreen(u32 param0) -{ +u32 EntryOamManagerAffineSubScreen(u32 param0) { u32 res = NNS_G2dEntryOamManagerAffine(&oamData->oamManagers[1], param0); GF_ASSERT(res != 0xFFFE); diff --git a/arm9/src/options.c b/arm9/src/options.c index e4cb1a474..5100fe503 100644 --- a/arm9/src/options.c +++ b/arm9/src/options.c @@ -1,59 +1,61 @@ +#include "options.h" + #include "global.h" + +#include "MI_memory.h" #include "heap.h" #include "main.h" -#include "MI_memory.h" -#include "options.h" #include "player_data.h" -struct Options * Options_New(HeapID heapId) { - struct Options * ret = AllocFromHeap(heapId, sizeof(struct Options)); +struct Options *Options_New(HeapID heapId) { + struct Options *ret = AllocFromHeap(heapId, sizeof(struct Options)); Options_Init(ret); return ret; } -void Options_Copy(struct Options * src, struct Options * dest) { +void Options_Copy(struct Options *src, struct Options *dest) { MI_CpuCopy8(src, dest, sizeof(struct Options)); } -void Options_Init(struct Options * options) { +void Options_Init(struct Options *options) { MI_CpuFill8(options, 0, sizeof(struct Options)); - options->textSpeed = 1; // mid speed + options->textSpeed = 1; // mid speed options->soundMethod = 0; // stereo options->battleStyle = 0; // shift options->battleScene = 0; // on - options->buttonMode = 0; // normal - options->frame = 0; // frame 1 + options->buttonMode = 0; // normal + options->frame = 0; // frame 1 } -void Options_SetButtonModeOnMain(struct SaveData * save, u32 buttonMode) { +void Options_SetButtonModeOnMain(struct SaveData *save, u32 buttonMode) { if (save != NULL) { buttonMode = Options_GetButtonMode(Save_PlayerData_GetOptionsAddr(save)); } switch (buttonMode) { - case 1: - gSystem.buttonMode = 1; - break; - case 2: - gSystem.buttonMode = 3; - break; - case 0: - default: - gSystem.buttonMode = 0; - break; + case 1: + gSystem.buttonMode = 1; + break; + case 2: + gSystem.buttonMode = 3; + break; + case 0: + default: + gSystem.buttonMode = 0; + break; } } -u16 Options_GetTextSpeed(struct Options * options) { +u16 Options_GetTextSpeed(struct Options *options) { return options->textSpeed; } -void Options_SetTextSpeed(struct Options * options, u16 textSpeed) { +void Options_SetTextSpeed(struct Options *options, u16 textSpeed) { options->textSpeed = (u16)(u32)textSpeed; } -u32 Options_GetTextFrameDelay(struct Options * options) { +u32 Options_GetTextFrameDelay(struct Options *options) { u16 textSpeed = Options_GetTextSpeed(options); if (textSpeed == 0) { @@ -67,42 +69,42 @@ u32 Options_GetTextFrameDelay(struct Options * options) { return 1; } -u16 Options_GetSoundMethod(struct Options * options) { +u16 Options_GetSoundMethod(struct Options *options) { return options->soundMethod; } -void Options_SetSoundMethod(struct Options * options, u16 soundMethod) { +void Options_SetSoundMethod(struct Options *options, u16 soundMethod) { options->soundMethod = (u16)(u32)soundMethod; } -u16 Options_GetBattleScene(struct Options * options) { +u16 Options_GetBattleScene(struct Options *options) { return options->battleScene; } -void Options_SetBattleScene(struct Options * options, u16 battleScene) { +void Options_SetBattleScene(struct Options *options, u16 battleScene) { options->battleScene = (u16)(u32)battleScene; } -u16 Options_GetBattleStyle(struct Options * options) { +u16 Options_GetBattleStyle(struct Options *options) { return options->battleStyle; } -void Options_SetBattleStyle(struct Options * options, u16 battleStyle) { +void Options_SetBattleStyle(struct Options *options, u16 battleStyle) { options->battleStyle = (u16)(u32)battleStyle; } -u16 Options_GetButtonMode(struct Options * options) { +u16 Options_GetButtonMode(struct Options *options) { return options->buttonMode; } -void Options_SetButtonMode(struct Options * options, u16 buttonMode) { +void Options_SetButtonMode(struct Options *options, u16 buttonMode) { options->buttonMode = (u16)(u32)buttonMode; } -u16 Options_GetFrame(struct Options * options) { +u16 Options_GetFrame(struct Options *options) { return options->frame; } -void Options_SetFrame(struct Options * options, u16 frame) { +void Options_SetFrame(struct Options *options, u16 frame) { options->frame = (u16)(u32)frame; } diff --git a/arm9/src/overlay_manager.c b/arm9/src/overlay_manager.c index 6773aebb4..4c9a28685 100644 --- a/arm9/src/overlay_manager.c +++ b/arm9/src/overlay_manager.c @@ -1,76 +1,69 @@ +#include "overlay_manager.h" + #include "global.h" + +#include "heap.h" #include "main.h" #include "poke_overlay.h" -#include "heap.h" -#include "overlay_manager.h" -struct OverlayManager * OverlayManager_New(const struct OverlayManagerTemplate *template, s32 * a1, HeapID heapId) -{ - struct OverlayManager * ret = (struct OverlayManager *)AllocFromHeap(heapId, sizeof(struct OverlayManager)); - ret->template = *template; - ret->managerStatus = 0; - ret->overlayStatus = 0; - ret->unk18 = a1; - ret->data = NULL; - ret->save = NULL; - ret->unk24 = 0; +struct OverlayManager *OverlayManager_New(const struct OverlayManagerTemplate *template, s32 *a1, HeapID heapId) { + struct OverlayManager *ret = (struct OverlayManager *)AllocFromHeap(heapId, sizeof(struct OverlayManager)); + ret->template = *template; + ret->managerStatus = 0; + ret->overlayStatus = 0; + ret->unk18 = a1; + ret->data = NULL; + ret->save = NULL; + ret->unk24 = 0; return ret; } -void OverlayManager_Delete(struct OverlayManager * overlayManager) -{ +void OverlayManager_Delete(struct OverlayManager *overlayManager) { FreeToHeap(overlayManager); } -void * OverlayManager_CreateAndGetData(struct OverlayManager * overlayManager, u32 size, HeapID heapId) -{ +void *OverlayManager_CreateAndGetData(struct OverlayManager *overlayManager, u32 size, HeapID heapId) { return overlayManager->data = AllocFromHeap(heapId, size); } -void * OverlayManager_GetData(struct OverlayManager * overlayManager) -{ +void *OverlayManager_GetData(struct OverlayManager *overlayManager) { return overlayManager->data; } -void OverlayManager_FreeData(struct OverlayManager * overlayManager) -{ +void OverlayManager_FreeData(struct OverlayManager *overlayManager) { FreeToHeap(overlayManager->data); overlayManager->data = NULL; } -s32 * OverlayManager_GetField18(struct OverlayManager * overlayManager) -{ +s32 *OverlayManager_GetField18(struct OverlayManager *overlayManager) { return overlayManager->unk18; } -BOOL OverlayManager_Run(struct OverlayManager * overlayManager) -{ - switch (overlayManager->managerStatus) - { +BOOL OverlayManager_Run(struct OverlayManager *overlayManager) { + switch (overlayManager->managerStatus) { case 0: - if (overlayManager->template.ovly != SDK_OVERLAY_INVALID_ID) + if (overlayManager->template.ovly != SDK_OVERLAY_INVALID_ID) { HandleLoadOverlay(overlayManager->template.ovly, 2); + } overlayManager->managerStatus = 1; // fallthrough case 1: - if (overlayManager->template.initFunc(overlayManager, &overlayManager->overlayStatus) == TRUE) - { + if (overlayManager->template.initFunc(overlayManager, &overlayManager->overlayStatus) == TRUE) { overlayManager->managerStatus = 2; overlayManager->overlayStatus = 0; } break; case 2: - if (overlayManager->template.mainFunc(overlayManager, &overlayManager->overlayStatus) == TRUE) - { + if (overlayManager->template.mainFunc(overlayManager, &overlayManager->overlayStatus) == TRUE) { overlayManager->managerStatus = 3; overlayManager->overlayStatus = 0; } break; case 3: - if (overlayManager->template.exitFunc(overlayManager, &overlayManager->overlayStatus) == TRUE) - { - if (overlayManager->template.ovly != SDK_OVERLAY_INVALID_ID) + if (overlayManager->template.exitFunc(overlayManager, &overlayManager->overlayStatus) == TRUE) { + if (overlayManager->template.ovly != SDK_OVERLAY_INVALID_ID) { UnloadOverlayByID(overlayManager->template.ovly); + } return TRUE; } break; diff --git a/arm9/src/palette.c b/arm9/src/palette.c index 605e31353..5ac4e1e0f 100644 --- a/arm9/src/palette.c +++ b/arm9/src/palette.c @@ -1,50 +1,46 @@ -#include "global.h" -#include "MSL.h" #include "palette.h" + +#include "global.h" + #include "MI_memory.h" +#include "MSL.h" #include "gf_gfx_loader.h" #include "unk_0200CA44.h" #include "unk_020222E8.h" -struct PaletteData *sub_02002FD0(HeapID heapId) -{ +struct PaletteData *sub_02002FD0(HeapID heapId) { struct PaletteData *ptr = AllocFromHeap(heapId, sizeof(struct PaletteData)); MI_CpuFill8(ptr, 0, sizeof(struct PaletteData)); return ptr; } -void sub_02002FEC(struct PaletteData *ptr) -{ +void sub_02002FEC(struct PaletteData *ptr) { FreeToHeap(ptr); } void PaletteData_SetBuffers( - struct PaletteData *paletteData, u32 index, void *unfadedBuf, void *fadedBuf, u32 size) -{ + struct PaletteData *paletteData, u32 index, void *unfadedBuf, void *fadedBuf, u32 size) { paletteData->pltt[index].unfadedBuf = unfadedBuf; - paletteData->pltt[index].fadedBuf = fadedBuf; - paletteData->pltt[index].bufSize = size; + paletteData->pltt[index].fadedBuf = fadedBuf; + paletteData->pltt[index].bufSize = size; } void PaletteData_AllocBuffers( - struct PaletteData *paletteData, u32 index, u32 size, HeapID heapId) -{ - void *ptr = AllocFromHeap(heapId, size); + struct PaletteData *paletteData, u32 index, u32 size, HeapID heapId) { + void *ptr = AllocFromHeap(heapId, size); void *ptr2 = AllocFromHeap(heapId, size); PaletteData_SetBuffers(paletteData, index, ptr, ptr2, size); } -void PaletteData_FreeBuffers(struct PaletteData *paletteData, u32 index) -{ +void PaletteData_FreeBuffers(struct PaletteData *paletteData, u32 index) { FreeToHeap(paletteData->pltt[index].unfadedBuf); FreeToHeap(paletteData->pltt[index].fadedBuf); } void PaletteData_LoadPalette( - struct PaletteData *paletteData, const void *src, u32 index, u32 offset, u16 size) -{ + struct PaletteData *paletteData, const void *src, u32 index, u32 offset, u16 size) { MIi_CpuCopy16(src, paletteData->pltt[index].unfadedBuf + offset, size); MIi_CpuCopy16(src, paletteData->pltt[index].fadedBuf + offset, size); } @@ -56,15 +52,13 @@ void PaletteData_LoadFromNarc(struct PaletteData *paletteData, u32 index, u32 size, u16 offset, - u16 param7) -{ + u16 param7) { NNSG2dPaletteData *pltData; void *ptr = GfGfxLoader_GetPlttData(narcId, memberId, &pltData, heapId); GF_ASSERT(ptr != NULL); - if (size == 0) - { + if (size == 0) { size = pltData->szByte; } @@ -80,48 +74,43 @@ void PaletteData_LoadNarc(struct PaletteData *paletteData, HeapID heapId, u32 index, u32 size, - u16 offset) -{ + u16 offset) { PaletteData_LoadFromNarc(paletteData, narcId, memberId, heapId, index, size, offset, 0); } -void sub_02003108(struct PaletteData *paletteData, u32 index, u16 offset, u32 size) -{ +void sub_02003108(struct PaletteData *paletteData, u32 index, u16 offset, u32 size) { GF_ASSERT(offset * 2 + size <= paletteData->pltt[index].bufSize); u16 *ptr; - switch (index) - { - case 0: - ptr = sub_020222E8(); - break; - case 1: - ptr = sub_020222F8(); - break; - case 2: - ptr = sub_02022308(); - break; - case 3: - ptr = sub_02022310(); - break; - default: - GF_ASSERT(FALSE); - return; + switch (index) { + case 0: + ptr = sub_020222E8(); + break; + case 1: + ptr = sub_020222F8(); + break; + case 2: + ptr = sub_02022308(); + break; + case 3: + ptr = sub_02022310(); + break; + default: + GF_ASSERT(FALSE); + return; } PaletteData_LoadPalette(paletteData, ptr + offset, index, offset, (u16)size); } void CopyPaletteFromNarc( - NarcId narcId, s32 memberId, HeapID heapId, u32 size, u16 offset, void *dest) -{ + NarcId narcId, s32 memberId, HeapID heapId, u32 size, u16 offset, void *dest) { NNSG2dPaletteData *pltData; void *ptr = GfGfxLoader_GetPlttData(narcId, memberId, &pltData, heapId); GF_ASSERT(ptr != NULL); - if (size == 0) - { + if (size == 0) { size = pltData->szByte; } @@ -135,8 +124,7 @@ void PaletteData_CopyPalette(struct PaletteData *paletteData, u16 srcOffset, u32 destIdx, u16 destOffset, - u16 size) -{ + u16 size) { MI_CpuCopy16(paletteData->pltt[srcIdx].unfadedBuf + srcOffset, paletteData->pltt[destIdx].unfadedBuf + destOffset, @@ -146,13 +134,11 @@ void PaletteData_CopyPalette(struct PaletteData *paletteData, size); } -u16 *PaletteData_GetUnfadedBuf(struct PaletteData *paletteData, u32 index) -{ +u16 *PaletteData_GetUnfadedBuf(struct PaletteData *paletteData, u32 index) { return paletteData->pltt[index].unfadedBuf; } -u16 *PaletteData_GetFadedBuf(struct PaletteData *paletteData, u32 index) -{ +u16 *PaletteData_GetFadedBuf(struct PaletteData *paletteData, u32 index) { return paletteData->pltt[index].fadedBuf; } @@ -162,21 +148,17 @@ u32 sub_02003210(struct PaletteData *paletteData, s16 delay, u8 startY, u8 targetY, - u16 color) -{ + u16 color) { u16 stc = param2; - u32 r6 = 0; + u32 r6 = 0; - for (u8 i = 0; i < 14; i++) - { - if (IsPaletteSelected(param1, i) != 1) - { + for (u8 i = 0; i < 14; i++) { + if (IsPaletteSelected(param1, i) != 1) { continue; } - if (IsPaletteSelected(paletteData->activeFadePalettes, i) != 0) - { + if (IsPaletteSelected(paletteData->activeFadePalettes, i) != 0) { continue; } @@ -186,28 +168,23 @@ u32 sub_02003210(struct PaletteData *paletteData, sub_02003328(paletteData, i); - if (i >= 4) - { + if (i >= 4) { sub_0200359C(paletteData, i, 0x100); - } - else - { + } else { sub_0200359C(paletteData, i, 0x10); } param2 = stc; - r6 = 1; + r6 = 1; } - if (r6 == 1) - { + if (r6 == 1) { paletteData->activeFadePalettes |= param1; - if (paletteData->unk11a_e == 0) - { + if (paletteData->unk11a_e == 0) { paletteData->unk11a_e = 1; paletteData->unk118_0 = 1; - paletteData->unk11c = 0; + paletteData->unk11c = 0; SysTask_CreateOnMainQueue((SysTaskFunc)sub_02003464, (void *)paletteData, (u32)(-2)); } @@ -216,40 +193,31 @@ u32 sub_02003210(struct PaletteData *paletteData, return r6; } -u8 IsPaletteSelected(u16 selectedPalettes, u16 index) -{ +u8 IsPaletteSelected(u16 selectedPalettes, u16 index) { u32 r3 = 1; - if ((selectedPalettes & (1 << index)) == 0) - { + if ((selectedPalettes & (1 << index)) == 0) { r3 = 0; } return (u8)r3; } -void sub_02003328(struct PaletteData *param0, u16 param1) -{ - if (IsPaletteSelected(param0->unk11a_0, param1) != 1) - { +void sub_02003328(struct PaletteData *param0, u16 param1) { + if (IsPaletteSelected(param0->unk11a_0, param1) != 1) { param0->unk11a_0 |= 1 << param1; } } -void sub_02003368(s32 param0, struct Palette *param1, u16 *param2) -{ +void sub_02003368(s32 param0, struct Palette *param1, u16 *param2) { u8 r0; - if (param0 < 4) - { + if (param0 < 4) { r0 = (u8)(param1->bufSize >> 5); - } - else - { + } else { r0 = (u8)(param1->bufSize >> 9); } u16 r4 = 0; - for (u8 i = 0; i < r0; i++) - { + for (u8 i = 0; i < r0; i++) { r4 += 1 << i; } @@ -261,83 +229,66 @@ void sub_020033A4(struct PaletteFadeControl *paletteFade, s16 delay, u8 startY, u8 targetY, - u16 color) -{ - if (delay < 0) - { + u16 color) { + if (delay < 0) { paletteFade->deltaY = abs(delay) + 2; - paletteFade->delay = 0; - } - else - { + paletteFade->delay = 0; + } else { paletteFade->deltaY = 2; - paletteFade->delay = delay; + paletteFade->delay = delay; } paletteFade->selectedPalettes = selectedPalettes; - paletteFade->y = startY; - paletteFade->targetY = targetY; - paletteFade->blendColor = color; + paletteFade->y = startY; + paletteFade->targetY = targetY; + paletteFade->blendColor = color; paletteFade->delayCounter = paletteFade->delay; - if (startY < targetY) - { + if (startY < targetY) { paletteFade->yDec = 0; return; } paletteFade->yDec = 1; } -void sub_02003464(SysTask *task, struct PaletteData *param1) -{ - if (param1->unk11c == 1) - { - param1->unk11c = 0; - param1->unk11a_0 = 0; +void sub_02003464(SysTask *task, struct PaletteData *param1) { + if (param1->unk11c == 1) { + param1->unk11c = 0; + param1->unk11a_0 = 0; param1->activeFadePalettes = 0; - param1->unk11a_e = 0; + param1->unk11a_e = 0; sub_0200CAB4((s32)task); return; } - if (param1->unk118_0 == 1) - { + if (param1->unk118_0 == 1) { param1->unk11a_0 = param1->activeFadePalettes; sub_02003500(param1); sub_02003520(param1); - if (param1->activeFadePalettes == 0) - { + if (param1->activeFadePalettes == 0) { param1->unk11a_e = 0; sub_0200CAB4((s32)task); } } } -void sub_02003500(struct PaletteData *param0) -{ - for (u8 i = 0; i < 4; i++) - { +void sub_02003500(struct PaletteData *param0) { + for (u8 i = 0; i < 4; i++) { sub_02003540(param0, i, 0x10); } } -void sub_02003520(struct PaletteData *param0) -{ - for (u8 i = 4; i < 14; i++) - { +void sub_02003520(struct PaletteData *param0) { + for (u8 i = 4; i < 14; i++) { sub_02003540(param0, i, 0x100); } } -void sub_02003540(struct PaletteData *paletteData, u8 index, u32 param2) -{ - if (IsPaletteSelected(paletteData->activeFadePalettes, index) != 0) - { - if (paletteData->pltt[index].fadeCtrl.delayCounter < - paletteData->pltt[index].fadeCtrl.delay) - { +void sub_02003540(struct PaletteData *paletteData, u8 index, u32 param2) { + if (IsPaletteSelected(paletteData->activeFadePalettes, index) != 0) { + if (paletteData->pltt[index].fadeCtrl.delayCounter < paletteData->pltt[index].fadeCtrl.delay) { paletteData->pltt[index].fadeCtrl.delayCounter++; return; } @@ -347,13 +298,10 @@ void sub_02003540(struct PaletteData *paletteData, u8 index, u32 param2) } } -void sub_0200359C(struct PaletteData *paletteData, u32 index, u32 param2) -{ +void sub_0200359C(struct PaletteData *paletteData, u32 index, u32 param2) { - for (u32 i = 0; i < 0x10; i++) - { - if (IsPaletteSelected(paletteData->pltt[index].fadeCtrl.selectedPalettes, (u16)i) != 0) - { + for (u32 i = 0; i < 0x10; i++) { + if (IsPaletteSelected(paletteData->pltt[index].fadeCtrl.selectedPalettes, (u16)i) != 0) { sub_020035F8(paletteData->pltt[index].unfadedBuf + param2 * i, paletteData->pltt[index].fadedBuf + param2 * i, &paletteData->pltt[index].fadeCtrl, @@ -365,33 +313,21 @@ void sub_0200359C(struct PaletteData *paletteData, u32 index, u32 param2) } void sub_020035F8( - u16 *src, u16 *dest, struct PaletteFadeControl *fadeCtrl, u32 numEntries) -{ - for (u32 i = 0; i < numEntries; i++) - { - u8 lo = (u8)((src[i] & 0x1f) + - ((((fadeCtrl->blendColor & 0x1f) - (src[i] & 0x1f)) * fadeCtrl->y) >> 4)); - - u8 hi = (u8)(((src[i] >> 10) & 0x1f) + - (((((fadeCtrl->blendColor >> 10) & 0x1f) - ((src[i] >> 10) & 0x1f)) * - fadeCtrl->y) >> - 4)); - u8 mid = - (u8)(((src[i] >> 5) & 0x1f) + - (((((fadeCtrl->blendColor >> 5) & 0x1f) - ((src[i] >> 5) & 0x1f)) * fadeCtrl->y) >> - 4)); + u16 *src, u16 *dest, struct PaletteFadeControl *fadeCtrl, u32 numEntries) { + for (u32 i = 0; i < numEntries; i++) { + u8 lo = (u8)((src[i] & 0x1f) + ((((fadeCtrl->blendColor & 0x1f) - (src[i] & 0x1f)) * fadeCtrl->y) >> 4)); + + u8 hi = (u8)(((src[i] >> 10) & 0x1f) + (((((fadeCtrl->blendColor >> 10) & 0x1f) - ((src[i] >> 10) & 0x1f)) * fadeCtrl->y) >> 4)); + u8 mid = (u8)(((src[i] >> 5) & 0x1f) + (((((fadeCtrl->blendColor >> 5) & 0x1f) - ((src[i] >> 5) & 0x1f)) * fadeCtrl->y) >> 4)); dest[i] = (u16)((hi << 10) | (mid << 5) | lo); } } void sub_02003684( - struct PaletteData *paletteData, u8 index, struct PaletteFadeControl *fadeCtrl) -{ - if (fadeCtrl->y == fadeCtrl->targetY) - { - if ((paletteData->activeFadePalettes & (1 << index)) == 0) - { + struct PaletteData *paletteData, u8 index, struct PaletteFadeControl *fadeCtrl) { + if (fadeCtrl->y == fadeCtrl->targetY) { + if ((paletteData->activeFadePalettes & (1 << index)) == 0) { return; } @@ -401,12 +337,10 @@ void sub_02003684( } s16 val; - if (fadeCtrl->yDec == 0) - { + if (fadeCtrl->yDec == 0) { val = (s16)fadeCtrl->y; val += fadeCtrl->deltaY; - if (val > fadeCtrl->targetY) - { + if (val > fadeCtrl->targetY) { val = (s16)fadeCtrl->targetY; } @@ -416,121 +350,110 @@ void sub_02003684( val = (s16)fadeCtrl->y; val -= fadeCtrl->deltaY; - if (val < fadeCtrl->targetY) - { + if (val < fadeCtrl->targetY) { val = (s16)fadeCtrl->targetY; } fadeCtrl->y = val; } -void sub_0200372C(struct PaletteData *paletteData) -{ - if (paletteData->unk11a_f == 0 && paletteData->unk118_0 != 1) - { +void sub_0200372C(struct PaletteData *paletteData) { + if (paletteData->unk11a_f == 0 && paletteData->unk118_0 != 1) { return; } - for (s32 i = 0; i < 14; i++) - { - if (paletteData->unk11a_f != 0 || - (paletteData->pltt[i].fadedBuf != 0 && - IsPaletteSelected(paletteData->unk11a_0, (u16)i) != 0)) - { + for (s32 i = 0; i < 14; i++) { + if (paletteData->unk11a_f != 0 || (paletteData->pltt[i].fadedBuf != 0 && IsPaletteSelected(paletteData->unk11a_0, (u16)i) != 0)) { DC_FlushRange(paletteData->pltt[i].fadedBuf, paletteData->pltt[i].bufSize); - switch (i) - { - case 0: - GX_LoadBGPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - break; - case 1: - GXS_LoadBGPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - break; - case 2: - GX_LoadOBJPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - break; - case 3: - GXS_LoadOBJPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - break; - case 4: - GX_BeginLoadBGExtPltt(); - GX_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - GX_EndLoadBGExtPltt(); - break; - case 5: - GX_BeginLoadBGExtPltt(); - GX_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0x2000, paletteData->pltt[i].bufSize); - GX_EndLoadBGExtPltt(); - break; - case 6: - GX_BeginLoadBGExtPltt(); - GX_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0x4000, paletteData->pltt[i].bufSize); - GX_EndLoadBGExtPltt(); - break; - case 7: - GX_BeginLoadBGExtPltt(); - GX_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0x6000, paletteData->pltt[i].bufSize); - GX_EndLoadBGExtPltt(); - break; - case 8: - GXS_BeginLoadBGExtPltt(); - GXS_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - GXS_EndLoadBGExtPltt(); - break; - case 9: - GXS_BeginLoadBGExtPltt(); - GXS_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0x2000, paletteData->pltt[i].bufSize); - GXS_EndLoadBGExtPltt(); - break; - case 10: - GXS_BeginLoadBGExtPltt(); - GXS_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0x4000, paletteData->pltt[i].bufSize); - GXS_EndLoadBGExtPltt(); - break; - case 11: - GXS_BeginLoadBGExtPltt(); - GXS_LoadBGExtPltt( - paletteData->pltt[i].fadedBuf, 0x6000, paletteData->pltt[i].bufSize); - GXS_EndLoadBGExtPltt(); - break; - case 12: - GX_BeginLoadOBJExtPltt(); - GX_LoadOBJExtPltt( - paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - GX_EndLoadOBJExtPltt(); - break; - case 13: - GXS_BeginLoadOBJExtPltt(); - GXS_LoadOBJExtPltt( - paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); - GXS_EndLoadOBJExtPltt(); - break; + switch (i) { + case 0: + GX_LoadBGPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + break; + case 1: + GXS_LoadBGPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + break; + case 2: + GX_LoadOBJPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + break; + case 3: + GXS_LoadOBJPltt(paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + break; + case 4: + GX_BeginLoadBGExtPltt(); + GX_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + GX_EndLoadBGExtPltt(); + break; + case 5: + GX_BeginLoadBGExtPltt(); + GX_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0x2000, paletteData->pltt[i].bufSize); + GX_EndLoadBGExtPltt(); + break; + case 6: + GX_BeginLoadBGExtPltt(); + GX_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0x4000, paletteData->pltt[i].bufSize); + GX_EndLoadBGExtPltt(); + break; + case 7: + GX_BeginLoadBGExtPltt(); + GX_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0x6000, paletteData->pltt[i].bufSize); + GX_EndLoadBGExtPltt(); + break; + case 8: + GXS_BeginLoadBGExtPltt(); + GXS_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + GXS_EndLoadBGExtPltt(); + break; + case 9: + GXS_BeginLoadBGExtPltt(); + GXS_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0x2000, paletteData->pltt[i].bufSize); + GXS_EndLoadBGExtPltt(); + break; + case 10: + GXS_BeginLoadBGExtPltt(); + GXS_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0x4000, paletteData->pltt[i].bufSize); + GXS_EndLoadBGExtPltt(); + break; + case 11: + GXS_BeginLoadBGExtPltt(); + GXS_LoadBGExtPltt( + paletteData->pltt[i].fadedBuf, 0x6000, paletteData->pltt[i].bufSize); + GXS_EndLoadBGExtPltt(); + break; + case 12: + GX_BeginLoadOBJExtPltt(); + GX_LoadOBJExtPltt( + paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + GX_EndLoadOBJExtPltt(); + break; + case 13: + GXS_BeginLoadOBJExtPltt(); + GXS_LoadOBJExtPltt( + paletteData->pltt[i].fadedBuf, 0, paletteData->pltt[i].bufSize); + GXS_EndLoadOBJExtPltt(); + break; } } } paletteData->unk11a_0 = paletteData->activeFadePalettes; - if (paletteData->unk11a_0 == 0) - { + if (paletteData->unk11a_0 == 0) { paletteData->unk118_0 = 0; } } -u16 sub_020038E4(struct PaletteData *paletteData) -{ +u16 sub_020038E4(struct PaletteData *paletteData) { return paletteData->activeFadePalettes; } -void sub_020038F0(struct PaletteData *paletteData, u32 param1) -{ +void sub_020038F0(struct PaletteData *paletteData, u32 param1) { paletteData->unk11a_f = param1; } @@ -539,38 +462,31 @@ void PaletteData_FillPalette(struct PaletteData *paletteData, u32 selection, u16 value, u16 startOffset, - u16 endOffset) -{ + u16 endOffset) { GF_ASSERT(endOffset * 2 <= paletteData->pltt[index].bufSize); - if (selection == 1 || selection == 2) - { + if (selection == 1 || selection == 2) { MI_CpuFill16(&paletteData->pltt[index].unfadedBuf[startOffset], value, (u32)((endOffset - startOffset) * 2)); } - if (selection == 0 || selection == 2) - { + if (selection == 0 || selection == 2) { MI_CpuFill16(&paletteData->pltt[index].fadedBuf[startOffset], value, (u32)((endOffset - startOffset) * 2)); } } -void BlendPalette(u16 *src, u16 *dest, u16 numEntries, u8 coeff, u16 blendColor) -{ +void BlendPalette(u16 *src, u16 *dest, u16 numEntries, u8 coeff, u16 blendColor) { s32 r2 = ((struct PlttData *)&blendColor)->r; s32 g2 = ((struct PlttData *)&blendColor)->g; s32 b2 = ((struct PlttData *)&blendColor)->b; - for (u16 i = 0; i < numEntries; i++) - { + for (u16 i = 0; i < numEntries; i++) { s32 r = ((struct PlttData *)&src[i])->r; s32 g = ((struct PlttData *)&src[i])->g; s32 b = ((struct PlttData *)&src[i])->b; - dest[i] = - (u16)(((r + (((r2 - r) * coeff) >> 4)) << 0) | ((g + (((g2 - g) * coeff) >> 4)) << 5) | - ((b + (((b2 - b) * coeff) >> 4)) << 10)); + dest[i] = (u16)(((r + (((r2 - r) * coeff) >> 4)) << 0) | ((g + (((g2 - g) * coeff) >> 4)) << 5) | ((b + (((b2 - b) * coeff) >> 4)) << 10)); } } @@ -579,11 +495,9 @@ void BlendPaletteUnfaded(struct PaletteData *paletteData, u16 offset, u16 numEntries, u8 coeff, - u16 blendColor) -{ + u16 blendColor) { BOOL r0 = FALSE; - if (paletteData->pltt[index].unfadedBuf != 0 && paletteData->pltt[index].fadedBuf != 0) - { + if (paletteData->pltt[index].unfadedBuf != 0 && paletteData->pltt[index].fadedBuf != 0) { r0 = TRUE; } @@ -596,12 +510,9 @@ void BlendPaletteUnfaded(struct PaletteData *paletteData, blendColor); } -void BlendPalettes(u16 *src, u16 *dest, u16 selectedPalettes, u8 coeff, u16 blendColor) -{ - while (selectedPalettes != 0) - { - if ((selectedPalettes & 1) != 0) - { +void BlendPalettes(u16 *src, u16 *dest, u16 selectedPalettes, u8 coeff, u16 blendColor) { + while (selectedPalettes != 0) { + if ((selectedPalettes & 1) != 0) { BlendPalette(src, dest, 0x10, coeff, blendColor); } @@ -612,21 +523,17 @@ void BlendPalettes(u16 *src, u16 *dest, u16 selectedPalettes, u8 coeff, u16 blen } void BlendPalettesUnfaded( - struct PaletteData *paletteData, u32 index, u16 selectedPalettes, u8 coeff, u16 blendColor) -{ - u32 r4 = 0; + struct PaletteData *paletteData, u32 index, u16 selectedPalettes, u8 coeff, u16 blendColor) { + u32 r4 = 0; BOOL r0 = FALSE; - if (paletteData->pltt[index].unfadedBuf != 0 && paletteData->pltt[index].fadedBuf != 0) - { + if (paletteData->pltt[index].unfadedBuf != 0 && paletteData->pltt[index].fadedBuf != 0) { r0 = TRUE; } GF_ASSERT(r0); - while (selectedPalettes != 0) - { - if ((selectedPalettes & 1) != 0) - { + while (selectedPalettes != 0) { + if ((selectedPalettes & 1) != 0) { BlendPaletteUnfaded(paletteData, index, (u16)r4, 0x10, coeff, blendColor); } @@ -635,29 +542,30 @@ void BlendPalettesUnfaded( } } -void TintPalette_CustomTone(u16 *palette, s32 count, s32 rTone, s32 gTone, s32 bTone) -{ +void TintPalette_CustomTone(u16 *palette, s32 count, s32 rTone, s32 gTone, s32 bTone) { s32 r, g, b, i; u32 gray; - for (i = 0; i < count; i++) - { + for (i = 0; i < count; i++) { r = (*palette >> 0) & 0x1F; g = (*palette >> 5) & 0x1F; b = (*palette >> 10) & 0x1F; gray = (u32)((r * 76 + g * 151 + b * 29) >> 8); - r = (u16)((rTone * gray)) >> 8; - g = (u16)((gTone * gray)) >> 8; - b = (u16)((bTone * gray)) >> 8; + r = (u16)(rTone * gray) >> 8; + g = (u16)(gTone * gray) >> 8; + b = (u16)(bTone * gray) >> 8; - if (r > 31) + if (r > 31) { r = 31; - if (g > 31) + } + if (g > 31) { g = 31; - if (b > 31) + } + if (b > 31) { b = 31; + } *palette++ = (u16)((b << 10) | (g << 5) | (r << 0)); } @@ -672,14 +580,12 @@ void sub_02003B40(struct PaletteData *paletteData, u16 offset, s32 rTone, s32 gTone, - s32 bTone) -{ + s32 bTone) { NNSG2dPaletteData *pltData; void *ptr = GfGfxLoader_GetPlttData(narcId, memberId, &pltData, heapId); GF_ASSERT(ptr != NULL); - if (size == 0) - { + if (size == 0) { size = pltData->szByte; } diff --git a/arm9/src/party.c b/arm9/src/party.c index fa7afa0c0..84c1e8b81 100644 --- a/arm9/src/party.c +++ b/arm9/src/party.c @@ -1,49 +1,47 @@ -#include "global.h" #include "party.h" + +#include "global.h" + #include "heap.h" -void SaveArray_Party_Init(struct Party * party); -void Party_InitWithMaxSize(struct Party * party, int count); +void SaveArray_Party_Init(struct Party *party); +void Party_InitWithMaxSize(struct Party *party, int count); -u32 SaveArray_Party_sizeof(void) -{ +u32 SaveArray_Party_sizeof(void) { return sizeof(struct Party); } -struct Party * SaveArray_Party_Alloc(HeapID heapId) -{ - struct Party * ret = (struct Party *)AllocFromHeap(heapId, sizeof(struct Party)); +struct Party *SaveArray_Party_Alloc(HeapID heapId) { + struct Party *ret = (struct Party *)AllocFromHeap(heapId, sizeof(struct Party)); SaveArray_Party_Init(ret); return ret; } -void SaveArray_Party_Init(struct Party * party) -{ +void SaveArray_Party_Init(struct Party *party) { Party_InitWithMaxSize(party, PARTY_SIZE); } -void Party_InitWithMaxSize(struct Party * party, int count) -{ +void Party_InitWithMaxSize(struct Party *party, int count) { int i; GF_ASSERT(count <= PARTY_SIZE); memset(party, 0, sizeof(struct Party)); party->curCount = 0; party->maxCount = count; - for (i = 0; i < PARTY_SIZE; i++) + for (i = 0; i < PARTY_SIZE; i++) { ZeroMonData(&party->mons[i]); + } } -BOOL Party_AddMon(struct Party * party, struct Pokemon * pokemon) -{ - if (party->curCount >= party->maxCount) +BOOL Party_AddMon(struct Party *party, struct Pokemon *pokemon) { + if (party->curCount >= party->maxCount) { return FALSE; + } party->mons[party->curCount] = *pokemon; party->curCount++; return TRUE; } -BOOL Party_RemoveMon(struct Party * party, int pos) -{ +BOOL Party_RemoveMon(struct Party *party, int pos) { int i; GF_ASSERT(pos >= 0); @@ -51,8 +49,7 @@ BOOL Party_RemoveMon(struct Party * party, int pos) GF_ASSERT(pos < party->maxCount); GF_ASSERT(party->curCount > 0); - for (i = pos; i < party->curCount - 1; i++) - { + for (i = pos; i < party->curCount - 1; i++) { party->mons[i] = party->mons[i + 1]; } @@ -61,64 +58,57 @@ BOOL Party_RemoveMon(struct Party * party, int pos) return TRUE; } -int Party_GetCount(struct Party * party) -{ +int Party_GetCount(struct Party *party) { return party->curCount; } -struct Pokemon * Party_GetMonByIndex(struct Party * party, int pos) -{ +struct Pokemon *Party_GetMonByIndex(struct Party *party, int pos) { GF_ASSERT(pos >= 0); GF_ASSERT(pos < party->curCount); GF_ASSERT(pos < party->maxCount); return &party->mons[pos]; } -void ReplacePartySlotWithMon(struct Party * party, int pos, struct Pokemon * pokemon) -{ +void ReplacePartySlotWithMon(struct Party *party, int pos, struct Pokemon *pokemon) { int r2; GF_ASSERT(pos >= 0); GF_ASSERT(pos < party->curCount); GF_ASSERT(pos < party->maxCount); - r2 = (int)(GetMonData(&party->mons[pos], MON_DATA_SPECIES_EXISTS, NULL) - GetMonData(pokemon, MON_DATA_SPECIES_EXISTS, NULL)); + r2 = (int)(GetMonData(&party->mons[pos], MON_DATA_SPECIES_EXISTS, NULL) - GetMonData(pokemon, MON_DATA_SPECIES_EXISTS, NULL)); party->mons[pos] = *pokemon; party->curCount += r2; } -BOOL SwapSlotsInParty(struct Party * party, int pos1, int pos2) -{ - struct Pokemon * buffer; +BOOL SwapSlotsInParty(struct Party *party, int pos1, int pos2) { + struct Pokemon *buffer; GF_ASSERT(pos1 >= 0); GF_ASSERT(pos1 < party->curCount); GF_ASSERT(pos1 < party->maxCount); GF_ASSERT(pos2 >= 0); GF_ASSERT(pos2 < party->curCount); GF_ASSERT(pos2 < party->maxCount); - buffer = AllocFromHeap(HEAP_ID_DEFAULT, sizeof(struct Pokemon)); - *buffer = party->mons[pos1]; + buffer = AllocFromHeap(HEAP_ID_DEFAULT, sizeof(struct Pokemon)); + *buffer = party->mons[pos1]; party->mons[pos1] = party->mons[pos2]; party->mons[pos2] = *buffer; FreeToHeap(buffer); return FALSE; } -void CopyParty(struct Party * src, struct Party * dest) -{ +void CopyParty(struct Party *src, struct Party *dest) { *dest = *src; } -BOOL Party_HasMon(struct Party * party, u16 species) -{ +BOOL Party_HasMon(struct Party *party, u16 species) { int i; - for (i = 0; i < party->curCount; i++) - { - if (species == GetMonData(&party->mons[i], MON_DATA_SPECIES, NULL)) + for (i = 0; i < party->curCount; i++) { + if (species == GetMonData(&party->mons[i], MON_DATA_SPECIES, NULL)) { break; + } } return i != party->curCount; } -struct Party * SaveArray_Party_Get(struct SaveData * ptr) -{ +struct Party *SaveArray_Party_Get(struct SaveData *ptr) { return (struct Party *)SaveArray_Get(ptr, 2); } diff --git a/arm9/src/play_timer.c b/arm9/src/play_timer.c index e76bc8bca..66debea2d 100644 --- a/arm9/src/play_timer.c +++ b/arm9/src/play_timer.c @@ -1,36 +1,32 @@ -#include "global.h" #include "play_timer.h" +#include "global.h" + u64 sTimer3Start; u64 sUnused; u64 sDuration; -struct IGT * sIGT_p; +struct IGT *sIGT_p; BOOL sTimerActive; -void PlayTimerInit() -{ +void PlayTimerInit() { sTimerActive = FALSE; } -void PlayTimerStart(struct IGT *igt) -{ +void PlayTimerStart(struct IGT *igt) { sTimerActive = TRUE; - sUnused = 0; - sDuration = 0; - sIGT_p = igt; + sUnused = 0; + sDuration = 0; + sIGT_p = igt; sTimer3Start = GetTimer3Count(); } -void PlayTimerUpdate(void) -{ - if (sTimerActive) - { +void PlayTimerUpdate(void) { + if (sTimerActive) { u64 res = Timer3CountToSeconds(GetTimer3Count() - sTimer3Start); - if (sDuration < res) - { + if (sDuration < res) { AddIGTSeconds(sIGT_p, (u32)(res - sDuration)); sDuration = res; } diff --git a/arm9/src/player_data.c b/arm9/src/player_data.c index a6e4cecfc..8a171eb44 100644 --- a/arm9/src/player_data.c +++ b/arm9/src/player_data.c @@ -1,21 +1,21 @@ -#include "global.h" -#include "save.h" #include "player_data.h" + +#include "global.h" + #include "MI_memory.h" +#include "coins.h" #include "heap.h" -#include "string16.h" #include "options.h" -#include "coins.h" +#include "save.h" +#include "string16.h" void PlayerProfile_Init(PlayerProfile *data); -u32 Save_PlayerData_sizeof(void) -{ +u32 Save_PlayerData_sizeof(void) { return sizeof(PlayerData); } -void Save_PlayerData_Init(PlayerData * pds) -{ +void Save_PlayerData_Init(PlayerData *pds) { MI_CpuClearFast(pds, sizeof(PlayerData)); Options_Init(&pds->options); PlayerProfile_Init(&pds->profile); @@ -23,208 +23,176 @@ void Save_PlayerData_Init(PlayerData * pds) InitIGT(&pds->igt); } -PlayerProfile * Save_PlayerData_GetProfileAddr(struct SaveData * save) -{ +PlayerProfile *Save_PlayerData_GetProfileAddr(struct SaveData *save) { return &((PlayerData *)SaveArray_Get(save, 1))->profile; } -struct Options * Save_PlayerData_GetOptionsAddr(struct SaveData * save) -{ +struct Options *Save_PlayerData_GetOptionsAddr(struct SaveData *save) { return &((PlayerData *)SaveArray_Get(save, 1))->options; } -u16 * Save_PlayerData_GetCoinsAddr(struct SaveData * save) -{ +u16 *Save_PlayerData_GetCoinsAddr(struct SaveData *save) { return &((PlayerData *)SaveArray_Get(save, 1))->coins; } -struct IGT * Save_PlayerData_GetIGTAddr(struct SaveData * save) -{ +struct IGT *Save_PlayerData_GetIGTAddr(struct SaveData *save) { return &((PlayerData *)SaveArray_Get(save, 1))->igt; } -u32 PlayerProfile_sizeof(void) -{ +u32 PlayerProfile_sizeof(void) { return sizeof(PlayerProfile); } -PlayerProfile * PlayerProfile_New(HeapID heapId) -{ - PlayerProfile * ret = (PlayerProfile *)AllocFromHeap(heapId, sizeof(PlayerProfile)); +PlayerProfile *PlayerProfile_New(HeapID heapId) { + PlayerProfile *ret = (PlayerProfile *)AllocFromHeap(heapId, sizeof(PlayerProfile)); PlayerProfile_Init(ret); return ret; } -void PlayerProfile_Copy(const PlayerProfile * src, PlayerProfile * dest) -{ +void PlayerProfile_Copy(const PlayerProfile *src, PlayerProfile *dest) { MI_CpuCopy8(src, dest, sizeof(PlayerProfile)); } -void PlayerProfile_Init(PlayerProfile * data) -{ +void PlayerProfile_Init(PlayerProfile *data) { memset(data, 0, sizeof(PlayerProfile)); data->language = LANGUAGE_ENGLISH; } -void CopyPlayerName(u16 * dest, PlayerProfile * data) -{ +void CopyPlayerName(u16 *dest, PlayerProfile *data) { GF_ASSERT((s32)StringLength(data->playerName) < PLAYER_NAME_LENGTH + 1); CopyU16StringArray(dest, data->playerName); } -void PlayerName_StringToFlat(PlayerProfile * data, struct String * str) -{ +void PlayerName_StringToFlat(PlayerProfile *data, struct String *str) { CopyStringToU16Array(str, data->playerName, PLAYER_NAME_LENGTH + 1); } -u16 * PlayerProfile_GetNamePtr(PlayerProfile * data) -{ +u16 *PlayerProfile_GetNamePtr(PlayerProfile *data) { return data->playerName; } -void PlayerName_FlatToString(PlayerProfile * data, struct String * str) -{ +void PlayerName_FlatToString(PlayerProfile *data, struct String *str) { CopyU16ArrayToString(str, data->playerName); } -struct String * PlayerProfile_GetPlayerName_NewString(PlayerProfile * data, HeapID heapId) -{ - struct String * str = String_New(PLAYER_NAME_LENGTH + 1, heapId); +struct String *PlayerProfile_GetPlayerName_NewString(PlayerProfile *data, HeapID heapId) { + struct String *str = String_New(PLAYER_NAME_LENGTH + 1, heapId); PlayerName_FlatToString(data, str); return str; } -void PlayerProfile_SetTrainerID(PlayerProfile * data, u32 otid) -{ +void PlayerProfile_SetTrainerID(PlayerProfile *data, u32 otid) { data->playerId = otid; } -u32 PlayerProfile_GetTrainerID(PlayerProfile * data) -{ +u32 PlayerProfile_GetTrainerID(PlayerProfile *data) { return data->playerId; } -u16 PlayerProfile_GetTrainerID_VisibleHalf(PlayerProfile * data) -{ +u16 PlayerProfile_GetTrainerID_VisibleHalf(PlayerProfile *data) { return (u16)data->playerId; } -void PlayerProfile_SetTrainerGender(PlayerProfile * data, PlayerGender gender) -{ +void PlayerProfile_SetTrainerGender(PlayerProfile *data, PlayerGender gender) { data->gender = gender; } -PlayerGender PlayerProfile_GetTrainerGender(PlayerProfile * data) -{ +PlayerGender PlayerProfile_GetTrainerGender(PlayerProfile *data) { return (PlayerGender)data->gender; } -BOOL PlayerProfile_TestBadgeFlag(PlayerProfile * data, u32 badgeno) -{ +BOOL PlayerProfile_TestBadgeFlag(PlayerProfile *data, u32 badgeno) { return (data->badges & (1 << badgeno)) != 0; } -void PlayerProfile_SetBadgeFlag(PlayerProfile * data, u32 badgeno) -{ +void PlayerProfile_SetBadgeFlag(PlayerProfile *data, u32 badgeno) { data->badges |= (1 << badgeno); } -u32 PlayerProfile_CountBadges(PlayerProfile * data) -{ +u32 PlayerProfile_CountBadges(PlayerProfile *data) { u32 count; u32 badges; - for (count = 0, badges = data->badges; badges != 0; badges >>= 1) - { - if (badges & 1) + for (count = 0, badges = data->badges; badges != 0; badges >>= 1) { + if (badges & 1) { count++; + } } return count; } -u32 PlayerProfile_GetMoney(PlayerProfile * data) -{ +u32 PlayerProfile_GetMoney(PlayerProfile *data) { return data->money; } -u32 PlayerProfile_SetMoney(PlayerProfile * data, u32 amount) -{ - if (amount > MAX_MONEY) +u32 PlayerProfile_SetMoney(PlayerProfile *data, u32 amount) { + if (amount > MAX_MONEY) { amount = MAX_MONEY; + } data->money = amount; return amount; } -u8 PlayerProfile_GetAvatar(PlayerProfile * data) -{ +u8 PlayerProfile_GetAvatar(PlayerProfile *data) { return data->avatar; } -void PlayerProfile_SetAvatar(PlayerProfile * data, u8 avatar) -{ +void PlayerProfile_SetAvatar(PlayerProfile *data, u8 avatar) { data->avatar = avatar; } -u32 PlayerProfile_AddMoney(PlayerProfile * data, u32 amount) -{ - if (amount > MAX_MONEY) +u32 PlayerProfile_AddMoney(PlayerProfile *data, u32 amount) { + if (amount > MAX_MONEY) { data->money = MAX_MONEY; - else + } else { data->money += amount; - if (data->money > MAX_MONEY) + } + if (data->money > MAX_MONEY) { data->money = MAX_MONEY; + } return data->money; } -u32 PlayerProfile_SubMoney(PlayerProfile * data, u32 amount) -{ - if (data->money < amount) +u32 PlayerProfile_SubMoney(PlayerProfile *data, u32 amount) { + if (data->money < amount) { data->money = 0; - else + } else { data->money -= amount; + } return data->money; } -u8 PlayerProfile_GetVersion(PlayerProfile * data) -{ +u8 PlayerProfile_GetVersion(PlayerProfile *data) { return data->version; } -void PlayerProfile_SetVersion(PlayerProfile * data, u8 a1) -{ +void PlayerProfile_SetVersion(PlayerProfile *data, u8 a1) { data->version = a1; } -u8 PlayerProfile_GetLanguage(PlayerProfile * data) -{ +u8 PlayerProfile_GetLanguage(PlayerProfile *data) { return data->language; } -void PlayerProfile_SetLanguage(PlayerProfile * data, u8 language) -{ +void PlayerProfile_SetLanguage(PlayerProfile *data, u8 language) { data->language = language; } -void PlayerProfile_SetGameClearFlag(PlayerProfile * data) -{ +void PlayerProfile_SetGameClearFlag(PlayerProfile *data) { data->gameCleared = TRUE; } -BOOL PlayerProfile_GetGameClearFlag(PlayerProfile * data) -{ +BOOL PlayerProfile_GetGameClearFlag(PlayerProfile *data) { return data->gameCleared; } -void PlayerProfile_SetNatDexFlag(PlayerProfile * data) -{ +void PlayerProfile_SetNatDexFlag(PlayerProfile *data) { data->nationalDex = TRUE; } -BOOL PlayerProfile_GetNatDexFlag(PlayerProfile * data) -{ +BOOL PlayerProfile_GetNatDexFlag(PlayerProfile *data) { return data->nationalDex; } -BOOL PlayerProfile_NameAndOTIDMatchPlayer(PlayerProfile * a, PlayerProfile * b) -{ +BOOL PlayerProfile_NameAndOTIDMatchPlayer(PlayerProfile *a, PlayerProfile *b) { return !StringNotEqualN(a->playerName, b->playerName, PLAYER_NAME_LENGTH) && a->playerId == b->playerId; } diff --git a/arm9/src/poke_overlay.c b/arm9/src/poke_overlay.c index 2bf2b592b..ba4278419 100644 --- a/arm9/src/poke_overlay.c +++ b/arm9/src/poke_overlay.c @@ -1,83 +1,77 @@ +#include "poke_overlay.h" + #include "global.h" -#include "nitro.h" + #include "FS_file.h" #include "FS_rom.h" -#include "poke_overlay.h" +#include "nitro.h" static struct LoadedOverlay gLoadedOverlays[3][8]; -void FreeOverlayAllocation(struct LoadedOverlay * loaded) -{ +void FreeOverlayAllocation(struct LoadedOverlay *loaded) { GF_ASSERT(loaded->active == TRUE); GF_ASSERT(FS_UnloadOverlay(MI_PROCESSOR_ARM9, loaded->id) == TRUE); loaded->active = FALSE; } -void UnloadOverlayByID(FSOverlayID id) -{ - struct LoadedOverlay * loaded = GetLoadedOverlaysInRegion(GetOverlayLoadDestination(id)); +void UnloadOverlayByID(FSOverlayID id) { + struct LoadedOverlay *loaded = GetLoadedOverlaysInRegion(GetOverlayLoadDestination(id)); int i; - for (i = 0; i < 8; i++) - { - if (loaded[i].active == TRUE && loaded[i].id == id) - { + for (i = 0; i < 8; i++) { + if (loaded[i].active == TRUE && loaded[i].id == id) { FreeOverlayAllocation(&loaded[i]); break; } } } -s32 GetOverlayLoadDestination(FSOverlayID id) -{ +s32 GetOverlayLoadDestination(FSOverlayID id) { FSOverlayInfo info; u8 *end; u8 *start; GF_ASSERT(FS_LoadOverlayInfo(&info, MI_PROCESSOR_ARM9, id) == TRUE); start = (u8 *)HW_ITCM_IMAGE; - end = (u8 *)HW_ITCM_END; - if (info.header.ram_address <= end && info.header.ram_address >= start) + end = (u8 *)HW_ITCM_END; + if (info.header.ram_address <= end && info.header.ram_address >= start) { return OVERLAY_LOAD_ITCM; + } start = (u8 *)HW_DTCM; - end = start + HW_DTCM_SIZE; - if (info.header.ram_address <= end && info.header.ram_address >= start) + end = start + HW_DTCM_SIZE; + if (info.header.ram_address <= end && info.header.ram_address >= start) { return OVERLAY_LOAD_DTCM; + } return OVERLAY_LOAD_WRAM; } -BOOL HandleLoadOverlay(FSOverlayID id, s32 a1) -{ +BOOL HandleLoadOverlay(FSOverlayID id, s32 a1) { u32 sp0 = FS_DMA_NOT_USE; struct LoadedOverlay *r3; int r7; int r6; BOOL result; - if (!CanOverlayBeLoaded(id)) + if (!CanOverlayBeLoaded(id)) { return FALSE; + } r7 = GetOverlayLoadDestination(id); r3 = GetLoadedOverlaysInRegion(r7); - for (r6 = 0; r6 < 8; r6++) - { - if (!r3[r6].active) - { - struct LoadedOverlay * ovly; - ovly = &r3[r6]; + for (r6 = 0; r6 < 8; r6++) { + if (!r3[r6].active) { + struct LoadedOverlay *ovly; + ovly = &r3[r6]; ovly->active = TRUE; - ovly->id = id; + ovly->id = id; break; } } - if (r6 >= 8) - { + if (r6 >= 8) { GF_ASSERT(0); return FALSE; } - if (r7 == OVERLAY_LOAD_ITCM || r7 == OVERLAY_LOAD_DTCM) - { + if (r7 == OVERLAY_LOAD_ITCM || r7 == OVERLAY_LOAD_DTCM) { sp0 = FS_SetDefaultDMA(FS_DMA_NOT_USE); } - switch (a1) - { + switch (a1) { case 0: result = LoadOverlayNormal(MI_PROCESSOR_ARM9, id); break; @@ -91,32 +85,27 @@ BOOL HandleLoadOverlay(FSOverlayID id, s32 a1) GF_ASSERT(0); return FALSE; } - if (r7 == OVERLAY_LOAD_ITCM || r7 == OVERLAY_LOAD_DTCM) - { + if (r7 == OVERLAY_LOAD_ITCM || r7 == OVERLAY_LOAD_DTCM) { FS_SetDefaultDMA(sp0); } - if (result == 0) - { + if (result == 0) { GF_ASSERT(0); return FALSE; } return TRUE; } -BOOL CanOverlayBeLoaded(FSOverlayID id) -{ +BOOL CanOverlayBeLoaded(FSOverlayID id) { void *start, *end, *start2, *end2; struct LoadedOverlay *r5; int i; - if (!GetOverlayRamBounds(id, &start, &end)) + if (!GetOverlayRamBounds(id, &start, &end)) { return FALSE; + } r5 = GetLoadedOverlaysInRegion(GetOverlayLoadDestination(id)); - for (i = 0; i < 8; i++) - { - if (r5[i].active == TRUE && GetOverlayRamBounds(r5[i].id, &start2, &end2) == TRUE) - { - if ((start >= start2 && start < end2) || (end > start2 && end <= end2) || (start <= start2 && end >= end2)) - { + for (i = 0; i < 8; i++) { + if (r5[i].active == TRUE && GetOverlayRamBounds(r5[i].id, &start2, &end2) == TRUE) { + if ((start >= start2 && start < end2) || (end > start2 && end <= end2) || (start <= start2 && end >= end2)) { GF_ASSERT(0); return FALSE; } @@ -125,10 +114,8 @@ BOOL CanOverlayBeLoaded(FSOverlayID id) return TRUE; } -struct LoadedOverlay* GetLoadedOverlaysInRegion(s32 a0) -{ - switch (a0) - { +struct LoadedOverlay *GetLoadedOverlaysInRegion(s32 a0) { + switch (a0) { case OVERLAY_LOAD_WRAM: default: return gLoadedOverlays[0]; @@ -139,40 +126,39 @@ struct LoadedOverlay* GetLoadedOverlaysInRegion(s32 a0) } } -BOOL GetOverlayRamBounds(FSOverlayID id, void ** start, void ** end) -{ +BOOL GetOverlayRamBounds(FSOverlayID id, void **start, void **end) { FSOverlayInfo info; if (!FS_LoadOverlayInfo(&info, MI_PROCESSOR_ARM9, id)) { GF_ASSERT(0); return FALSE; } *start = (void *)info.header.ram_address; - *end = (char *)*start + (info.header.ram_size + info.header.bss_size); + *end = (char *)*start + (info.header.ram_size + info.header.bss_size); return TRUE; } -BOOL LoadOverlayNormal(MIProcessor target, FSOverlayID id) -{ +BOOL LoadOverlayNormal(MIProcessor target, FSOverlayID id) { return FS_LoadOverlay(target, id); } -BOOL LoadOverlayNoInit(MIProcessor target, FSOverlayID id) -{ +BOOL LoadOverlayNoInit(MIProcessor target, FSOverlayID id) { FSOverlayInfo info; - if (!FS_LoadOverlayInfo(&info, target, id)) + if (!FS_LoadOverlayInfo(&info, target, id)) { return FALSE; - if (!FS_LoadOverlayImage(&info)) + } + if (!FS_LoadOverlayImage(&info)) { return FALSE; + } FS_StartOverlay(&info); return TRUE; } -BOOL LoadOverlayNoInitAsync(MIProcessor target, FSOverlayID id) -{ +BOOL LoadOverlayNoInitAsync(MIProcessor target, FSOverlayID id) { FSOverlayInfo info; FSFile file; - if (!FS_LoadOverlayInfo(&info, target, id)) + if (!FS_LoadOverlayInfo(&info, target, id)) { return FALSE; + } FS_InitFile(&file); FS_LoadOverlayImageAsync(&info, &file); FS_WaitAsync(&file); diff --git a/arm9/src/pokedex.c b/arm9/src/pokedex.c index f179afb50..a7f57bdea 100644 --- a/arm9/src/pokedex.c +++ b/arm9/src/pokedex.c @@ -1,323 +1,284 @@ +#include "pokedex.h" + #include "global.h" -#include "save.h" -#include "heap.h" + +#include "constants/species.h" + #include "MI_memory.h" +#include "heap.h" #include "pokemon.h" -#include "pokedex.h" +#include "save.h" #include "unk_02087A1C.h" -#include "constants/species.h" -static inline BOOL CheckDexFlag(u8 * flagArray, u16 species) -{ +static inline BOOL CheckDexFlag(u8 *flagArray, u16 species) { species--; return (flagArray[species >> 3] & (1 << (species & 7))) != 0; } -static inline void UpdateDexFlag(u8 * flagArray, u16 species, u8 state) -{ +static inline void UpdateDexFlag(u8 *flagArray, u16 species, u8 state) { GF_ASSERT(state < 2); species--; flagArray[species >> 3] &= ~(1 << (species & 7)); flagArray[species >> 3] |= (state << (species & 7)); } -static inline void SetDexFlag(u8 * flagArray, u16 species) -{ +static inline void SetDexFlag(u8 *flagArray, u16 species) { species--; flagArray[species >> 3] |= (1 << (species & 7)); } -static inline s32 CheckDexFlagPair(u8 * flagArray, u16 offset) -{ +static inline s32 CheckDexFlagPair(u8 *flagArray, u16 offset) { return (flagArray[offset >> 2] >> (2 * (offset & 3))) & 3; } -static inline void UpdateDexFlagPair(u8 * flagArray, u16 offset, u8 state) -{ +static inline void UpdateDexFlagPair(u8 *flagArray, u16 offset, u8 state) { GF_ASSERT(state < 4); flagArray[offset >> 2] &= ~(3 << (2 * (offset & 3))); flagArray[offset >> 2] |= (state << (2 * (offset & 3))); } -u32 Save_Pokedex_sizeof(void) -{ +u32 Save_Pokedex_sizeof(void) { return sizeof(struct Pokedex); } -struct Pokedex * Save_Pokedex_New(HeapID heapId) -{ - struct Pokedex * ret = (struct Pokedex *)AllocFromHeap(heapId, sizeof(struct Pokedex)); +struct Pokedex *Save_Pokedex_New(HeapID heapId) { + struct Pokedex *ret = (struct Pokedex *)AllocFromHeap(heapId, sizeof(struct Pokedex)); Save_Pokedex_Init(ret); return ret; } -void Save_Pokedex_Copy(const struct Pokedex * src, struct Pokedex * dest) -{ +void Save_Pokedex_Copy(const struct Pokedex *src, struct Pokedex *dest) { MI_CpuCopy8(src, dest, sizeof(struct Pokedex)); } -s32 Pokedex_CountSeenShellosOrGastrodon_Internal(struct Pokedex * pokedex, u32 species) -{ +s32 Pokedex_CountSeenShellosOrGastrodon_Internal(struct Pokedex *pokedex, u32 species) { GF_ASSERT(species == SPECIES_SHELLOS || species == SPECIES_GASTRODON); - if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) + if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) { return 0; + } u8 *flags = species == SPECIES_SHELLOS ? &pokedex->shellosGastrodon[0] : &pokedex->shellosGastrodon[1]; - BOOL r2 = CheckDexFlag(flags, 1); - BOOL r0 = CheckDexFlag(flags, 2); + BOOL r2 = CheckDexFlag(flags, 1); + BOOL r0 = CheckDexFlag(flags, 2); return (r2 == r0) ? 1 : 2; } -BOOL Pokedex_HasSeenShellosOrGastrodonForm(struct Pokedex * pokedex, u32 species, u8 state) -{ +BOOL Pokedex_HasSeenShellosOrGastrodonForm(struct Pokedex *pokedex, u32 species, u8 state) { GF_ASSERT(species == SPECIES_SHELLOS || species == SPECIES_GASTRODON); - if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) + if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) { return FALSE; + } u8 *flags = species == SPECIES_SHELLOS ? &pokedex->shellosGastrodon[0] : &pokedex->shellosGastrodon[1]; - u32 r0 = (u32)Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, species); - for (int i = 0; i < r0; i++) - { + u32 r0 = (u32)Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, species); + for (int i = 0; i < r0; i++) { BOOL r2 = CheckDexFlag(flags, (u16)(i + 1)); - if (r2 == state) + if (r2 == state) { return TRUE; + } } return FALSE; } -void Pokedex_SetSeenShellosOrGastrodonForm(struct Pokedex * pokedex, u32 species, u32 state) -{ +void Pokedex_SetSeenShellosOrGastrodonForm(struct Pokedex *pokedex, u32 species, u32 state) { GF_ASSERT(species == SPECIES_SHELLOS || species == SPECIES_GASTRODON); - if (Pokedex_HasSeenShellosOrGastrodonForm(pokedex, species, (u8)state)) + if (Pokedex_HasSeenShellosOrGastrodonForm(pokedex, species, (u8)state)) { return; + } u8 *flags = species == SPECIES_SHELLOS ? &pokedex->shellosGastrodon[0] : &pokedex->shellosGastrodon[1]; - s32 r5 = Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, species); - if (r5 < 2) - { + s32 r5 = Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, species); + if (r5 < 2) { UpdateDexFlag(flags, (u16)(r5 + 1), (u8)state); - if (r5 == 0) - { + if (r5 == 0) { UpdateDexFlag(flags, (u16)(r5 + 2), (u8)state); } } } -s32 Pokedex_CountSeenBurmyOrWormadam_Internal(struct Pokedex * pokedex, u32 species) -{ +s32 Pokedex_CountSeenBurmyOrWormadam_Internal(struct Pokedex *pokedex, u32 species) { GF_ASSERT(species == SPECIES_BURMY || species == SPECIES_WORMADAM); - if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) + if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) { return 0; + } u8 *flags = species == SPECIES_BURMY ? &pokedex->burmyWormadam[0] : &pokedex->burmyWormadam[1]; s32 i; - for (i = 0; i < 3; i++) - { + for (i = 0; i < 3; i++) { s32 r2 = CheckDexFlagPair(flags, (u16)i); - if (r2 == 3) + if (r2 == 3) { break; + } } return i; } -BOOL Pokedex_HasSeenBurmyOrWormadamForm(struct Pokedex * pokedex, u32 species, u8 state) -{ +BOOL Pokedex_HasSeenBurmyOrWormadamForm(struct Pokedex *pokedex, u32 species, u8 state) { GF_ASSERT(species == SPECIES_BURMY || species == SPECIES_WORMADAM); - if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) + if (!Pokedex_CheckMonSeenFlag(pokedex, (u16)species)) { return FALSE; + } u8 *flags = species == SPECIES_BURMY ? &pokedex->burmyWormadam[0] : &pokedex->burmyWormadam[1]; s32 i; - for (i = 0; i < 3; i++) - { + for (i = 0; i < 3; i++) { s32 r2 = CheckDexFlagPair(flags, (u16)i); - if (r2 == state) + if (r2 == state) { return TRUE; + } } return FALSE; } -void Pokedex_SetSeenBurmyOrWormadamForm(struct Pokedex * pokedex, u32 species, s32 state) -{ +void Pokedex_SetSeenBurmyOrWormadamForm(struct Pokedex *pokedex, u32 species, s32 state) { GF_ASSERT(species == SPECIES_BURMY || species == SPECIES_WORMADAM); - if (Pokedex_HasSeenBurmyOrWormadamForm(pokedex, species, (u8)state)) + if (Pokedex_HasSeenBurmyOrWormadamForm(pokedex, species, (u8)state)) { return; + } u8 *flags = species == SPECIES_BURMY ? &pokedex->burmyWormadam[0] : &pokedex->burmyWormadam[1]; - s32 r5 = Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, species); - if (r5 >= 3) + s32 r5 = Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, species); + if (r5 >= 3) { return; + } UpdateDexFlagPair(flags, (u16)r5, (u8)state); } -static inline void SetDeoxysFormFlag(struct Pokedex * pokedex, u8 r4, u8 r6) -{ +static inline void SetDeoxysFormFlag(struct Pokedex *pokedex, u8 r4, u8 r6) { GF_ASSERT(r6 < 4); GF_ASSERT(r4 <= 15); - if (r6 < 2) - { + if (r6 < 2) { pokedex->caughtFlagsHi_Deoxys1 &= ~(15 << (24 + 4 * r6)); pokedex->caughtFlagsHi_Deoxys1 |= r4 << (24 + 4 * r6); - } - else - { + } else { r6 -= 2; pokedex->seenFlagsHi_Deoxys2 &= ~(15 << (24 + 4 * r6)); pokedex->seenFlagsHi_Deoxys2 |= r4 << (24 + 4 * r6); } } -void Pokedex_SetSeenDeoxysFormAt(struct Pokedex * pokedex, u8 r4, u8 r6) -{ +void Pokedex_SetSeenDeoxysFormAt(struct Pokedex *pokedex, u8 r4, u8 r6) { SetDeoxysFormFlag(pokedex, r4, r6); } -static inline u32 GetDeoxysFormFlag_Internal(struct Pokedex * pokedex, u8 r6) -{ - if (r6 < 2) - { +static inline u32 GetDeoxysFormFlag_Internal(struct Pokedex *pokedex, u8 r6) { + if (r6 < 2) { return (pokedex->caughtFlagsHi_Deoxys1 >> (24 + 4 * r6)) & 15; - } - else - { + } else { r6 -= 2; return (pokedex->seenFlagsHi_Deoxys2 >> (24 + 4 * r6)) & 15; } } -s32 Pokedex_CountSeenDeoxysForms_Internal(struct Pokedex * pokedex) -{ +s32 Pokedex_CountSeenDeoxysForms_Internal(struct Pokedex *pokedex) { s32 i; - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { u32 r2 = GetDeoxysFormFlag_Internal(pokedex, (u8)i); - if (r2 == 15) + if (r2 == 15) { break; + } } return i; } -BOOL Pokedex_HasSeenDeoxysForm(struct Pokedex * pokedex, u32 state) -{ +BOOL Pokedex_HasSeenDeoxysForm(struct Pokedex *pokedex, u32 state) { s32 i; - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { u32 r4 = GetDeoxysFormFlag_Internal(pokedex, (u8)i); - if (state == r4) + if (state == r4) { return TRUE; + } } return FALSE; } -void Pokedex_TrySetSeenDeoxysForm(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon) -{ +void Pokedex_TrySetSeenDeoxysForm(struct Pokedex *pokedex, u16 species, struct Pokemon *pokemon) { u8 form = (u8)GetMonData(pokemon, MON_DATA_FORM, NULL); - if (species == SPECIES_DEOXYS && !Pokedex_HasSeenDeoxysForm(pokedex, form)) - { + if (species == SPECIES_DEOXYS && !Pokedex_HasSeenDeoxysForm(pokedex, form)) { s32 r2 = Pokedex_CountSeenDeoxysForms_Internal(pokedex); Pokedex_SetSeenDeoxysFormAt(pokedex, form, (u8)r2); } } -void Pokedex_InitSeenDeoxysFormsArray(struct Pokedex * pokedex) -{ +void Pokedex_InitSeenDeoxysFormsArray(struct Pokedex *pokedex) { s32 i; - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { Pokedex_SetSeenDeoxysFormAt(pokedex, 15, (u8)i); } } -static inline BOOL HasUnownLetterBeenSeen(struct Pokedex * pokedex, u8 letter) -{ +static inline BOOL HasUnownLetterBeenSeen(struct Pokedex *pokedex, u8 letter) { s32 i; - u8 * arr; - for (i = 0, arr = (u8 *)pokedex; i < 28; i++, arr++) - { - if (letter == *(arr + 0x10C)) + u8 *arr; + for (i = 0, arr = (u8 *)pokedex; i < 28; i++, arr++) { + if (letter == *(arr + 0x10C)) { return TRUE; + } } return FALSE; } -static inline s32 FindFirstAvailableUnownLetterSlot(struct Pokedex * pokedex) -{ +static inline s32 FindFirstAvailableUnownLetterSlot(struct Pokedex *pokedex) { s32 i; - u8 * arr; - for (i = 0, arr = (u8 *)pokedex; i < 28; i++, arr++) - { - if (*(arr + 0x10C) == 0xFF) + u8 *arr; + for (i = 0, arr = (u8 *)pokedex; i < 28; i++, arr++) { + if (*(arr + 0x10C) == 0xFF) { break; + } } return i; } -static inline void SetSeenUnownLetter(struct Pokedex * pokedex, u32 species, s32 letter) -{ +static inline void SetSeenUnownLetter(struct Pokedex *pokedex, u32 species, s32 letter) { #pragma unused(species) s32 idx; - if (HasUnownLetterBeenSeen(pokedex, (u8)letter)) + if (HasUnownLetterBeenSeen(pokedex, (u8)letter)) { return; + } idx = FindFirstAvailableUnownLetterSlot(pokedex); - if (idx >= 28) + if (idx >= 28) { return; + } pokedex->seenUnown[idx] = (u8)letter; } -void Pokedex_SetMonSeenForm(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon) -{ - if (species == SPECIES_UNOWN) - { +void Pokedex_SetMonSeenForm(struct Pokedex *pokedex, u16 species, struct Pokemon *pokemon) { + if (species == SPECIES_UNOWN) { SetSeenUnownLetter(pokedex, species, GetMonUnownLetter(pokemon)); - } - else if (species == SPECIES_BURMY) - { + } else if (species == SPECIES_BURMY) { Pokedex_SetSeenBurmyOrWormadamForm(pokedex, species, (s32)GetMonData(pokemon, MON_DATA_FORM, NULL)); - } - else if (species == SPECIES_WORMADAM) - { + } else if (species == SPECIES_WORMADAM) { Pokedex_SetSeenBurmyOrWormadamForm(pokedex, species, (s32)GetMonData(pokemon, MON_DATA_FORM, NULL)); - } - else if (species == SPECIES_SHELLOS) - { + } else if (species == SPECIES_SHELLOS) { Pokedex_SetSeenShellosOrGastrodonForm(pokedex, species, GetMonData(pokemon, MON_DATA_FORM, NULL)); - } - else if (species == SPECIES_GASTRODON) - { + } else if (species == SPECIES_GASTRODON) { Pokedex_SetSeenShellosOrGastrodonForm(pokedex, species, GetMonData(pokemon, MON_DATA_FORM, NULL)); - } - else if (species == SPECIES_DEOXYS) - { + } else if (species == SPECIES_DEOXYS) { Pokedex_TrySetSeenDeoxysForm(pokedex, species, pokemon); } } -void Pokedex_SetMeisterFlagBySpeciesAndLanguage(struct Pokedex * pokedex, u32 species, u32 language) -{ +void Pokedex_SetMeisterFlagBySpeciesAndLanguage(struct Pokedex *pokedex, u32 species, u32 language) { s32 r4 = GetMeisterSpeciesIdx(species); s32 r0 = GetMeisterLanguageIdx(language); - if (r4 != 14 && r0 != 6) - { + if (r4 != 14 && r0 != 6) { pokedex->meister[r4] |= (1 << r0); } } -s32 sub_020242C8(struct Pokedex * pokedex, u16 species, s32 r4) -{ +s32 sub_020242C8(struct Pokedex *pokedex, u16 species, s32 r4) { u8 r0; u8 r1; - if (GetMonBaseStat(species, BASE_GENDER_RATIO) == MON_RATIO_UNKNOWN) - { + if (GetMonBaseStat(species, BASE_GENDER_RATIO) == MON_RATIO_UNKNOWN) { return r4 == 0 ? 2 : -1; } r1 = (u8)CheckDexFlag(pokedex->field_0084, species); - if (r4 == 1) - { + if (r4 == 1) { r0 = (u8)CheckDexFlag(pokedex->field_00C4, species); - if (r0 == r1) + if (r0 == r1) { return -1; - else + } else { return r0; + } } return r1; } -BOOL Pokedex_SpeciesIsNotMythical(u16 species) -{ +BOOL Pokedex_SpeciesIsNotMythical(u16 species) { static const u16 sSinnohDexMythicalMons[] = { SPECIES_MANAPHY }; @@ -338,314 +299,294 @@ BOOL Pokedex_SpeciesIsNotMythical(u16 species) s32 i; BOOL ret = TRUE; - for (i = 0; i < (s32)NELEMS(sNationalDexMythicalMons); i++) - { - if (species == sNationalDexMythicalMons[i]) + for (i = 0; i < (s32)NELEMS(sNationalDexMythicalMons); i++) { + if (species == sNationalDexMythicalMons[i]) { ret = FALSE; + } } return ret; } -BOOL Pokedex_SpeciesIsNotSinnohMythical(u16 species) -{ +BOOL Pokedex_SpeciesIsNotSinnohMythical(u16 species) { BOOL ret = TRUE; - if (species == SPECIES_MANAPHY) + if (species == SPECIES_MANAPHY) { ret = FALSE; + } return ret; } -void Save_Pokedex_Init(struct Pokedex * pokedex) -{ +void Save_Pokedex_Init(struct Pokedex *pokedex) { memset(pokedex, 0, sizeof(struct Pokedex)); - pokedex->magic = 0xBEEFCAFE; + pokedex->magic = 0xBEEFCAFE; pokedex->unlockedNationalDex = 0; memset(pokedex->seenUnown, 0xFF, 28); pokedex->shellosGastrodon[0] = 0xFF; pokedex->shellosGastrodon[1] = 0xFF; - pokedex->burmyWormadam[0] = 0xFF; - pokedex->burmyWormadam[1] = 0xFF; + pokedex->burmyWormadam[0] = 0xFF; + pokedex->burmyWormadam[1] = 0xFF; Pokedex_InitSeenDeoxysFormsArray(pokedex); } -u16 Pokedex_CountNationalDexOwned(struct Pokedex * pokedex) -{ +u16 Pokedex_CountNationalDexOwned(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); s32 i; s32 count = 0; - for (i = 1; i <= NATIONAL_DEX_COUNT; i++) - { - if (Pokedex_CheckMonCaughtFlag(pokedex, (u16)i) == TRUE) + for (i = 1; i <= NATIONAL_DEX_COUNT; i++) { + if (Pokedex_CheckMonCaughtFlag(pokedex, (u16)i) == TRUE) { count++; + } } return (u16)count; } -u16 Pokedex_CountNationalDexSeen(struct Pokedex * pokedex) -{ +u16 Pokedex_CountNationalDexSeen(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); s32 i; s32 count = 0; - for (i = 1; i <= NATIONAL_DEX_COUNT; i++) - { - if (Pokedex_CheckMonSeenFlag(pokedex, (u16)i) == TRUE) + for (i = 1; i <= NATIONAL_DEX_COUNT; i++) { + if (Pokedex_CheckMonSeenFlag(pokedex, (u16)i) == TRUE) { count++; + } } return (u16)count; } -u16 Pokedex_CountSeenMons(struct Pokedex * pokedex) -{ - if (Pokedex_GetNatDexFlag(pokedex)) +u16 Pokedex_CountSeenMons(struct Pokedex *pokedex) { + if (Pokedex_GetNatDexFlag(pokedex)) { return Pokedex_CountNationalDexSeen(pokedex); - else + } else { return Pokedex_CountSinnohDexSeen(pokedex); + } } -u16 Pokedex_CountSinnohDexOwned(struct Pokedex * pokedex) -{ +u16 Pokedex_CountSinnohDexOwned(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); s32 i; s32 count = 0; - for (i = 1; i <= NATIONAL_DEX_COUNT; i++) - { - if (Pokedex_CheckMonCaughtFlag(pokedex, (u16)i) == TRUE && SpeciesToSinnohDexNo((u16)i) != 0) + for (i = 1; i <= NATIONAL_DEX_COUNT; i++) { + if (Pokedex_CheckMonCaughtFlag(pokedex, (u16)i) == TRUE && SpeciesToSinnohDexNo((u16)i) != 0) { count++; + } } return (u16)count; } -u16 Pokedex_CountSinnohDexSeen(struct Pokedex * pokedex) -{ +u16 Pokedex_CountSinnohDexSeen(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); s32 i; s32 count = 0; - for (i = 1; i <= NATIONAL_DEX_COUNT; i++) - { - if (Pokedex_CheckMonSeenFlag(pokedex, (u16)i) == TRUE && SpeciesToSinnohDexNo((u16)i) != 0) + for (i = 1; i <= NATIONAL_DEX_COUNT; i++) { + if (Pokedex_CheckMonSeenFlag(pokedex, (u16)i) == TRUE && SpeciesToSinnohDexNo((u16)i) != 0) { count++; + } } return (u16)count; } -BOOL Pokedex_NationalDexIsComplete(struct Pokedex * pokedex) -{ +BOOL Pokedex_NationalDexIsComplete(struct Pokedex *pokedex) { return Pokedex_CountNationalDexOwned_OmitMythicals(pokedex) >= 482; } -BOOL Pokedex_SinnohDexIsComplete(struct Pokedex * pokedex) -{ +BOOL Pokedex_SinnohDexIsComplete(struct Pokedex *pokedex) { return Pokedex_CountSinnohDexSeen_OmitMythicals(pokedex) >= 150; } -u16 Pokedex_CountNationalDexOwned_OmitMythicals(struct Pokedex * pokedex) -{ +u16 Pokedex_CountNationalDexOwned_OmitMythicals(struct Pokedex *pokedex) { s32 i; u16 count = 0; - for (i = 1; i <= NATIONAL_DEX_COUNT; i++) - { - if (Pokedex_CheckMonCaughtFlag(pokedex, (u16)i) == TRUE && Pokedex_SpeciesIsNotMythical((u16)i) == TRUE) + for (i = 1; i <= NATIONAL_DEX_COUNT; i++) { + if (Pokedex_CheckMonCaughtFlag(pokedex, (u16)i) == TRUE && Pokedex_SpeciesIsNotMythical((u16)i) == TRUE) { count++; + } } return count; } -u16 Pokedex_CountSinnohDexSeen_OmitMythicals(struct Pokedex * pokedex) -{ +u16 Pokedex_CountSinnohDexSeen_OmitMythicals(struct Pokedex *pokedex) { s32 i; u16 count = 0; - for (i = 1; i <= NATIONAL_DEX_COUNT; i++) - { - if (Pokedex_CheckMonSeenFlag(pokedex, (u16)i) == TRUE && SpeciesToSinnohDexNo((u16)i) != 0 && Pokedex_SpeciesIsNotSinnohMythical((u16)i) == TRUE) + for (i = 1; i <= NATIONAL_DEX_COUNT; i++) { + if (Pokedex_CheckMonSeenFlag(pokedex, (u16)i) == TRUE && SpeciesToSinnohDexNo((u16)i) != 0 && Pokedex_SpeciesIsNotSinnohMythical((u16)i) == TRUE) { count++; + } } return count; } -static inline BOOL DexSpeciesIsInvalid(u16 species) -{ - if (species == SPECIES_NONE || species > NATIONAL_DEX_COUNT) - { +static inline BOOL DexSpeciesIsInvalid(u16 species) { + if (species == SPECIES_NONE || species > NATIONAL_DEX_COUNT) { GF_ASSERT(0); return TRUE; } return FALSE; } -BOOL Pokedex_CheckMonCaughtFlag(struct Pokedex * pokedex, u16 species) -{ +BOOL Pokedex_CheckMonCaughtFlag(struct Pokedex *pokedex, u16 species) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (DexSpeciesIsInvalid(species)) + if (DexSpeciesIsInvalid(species)) { return FALSE; - if (!CheckDexFlag(pokedex->caughtFlags, species) || !CheckDexFlag(pokedex->seenFlags, species)) + } + if (!CheckDexFlag(pokedex->caughtFlags, species) || !CheckDexFlag(pokedex->seenFlags, species)) { return FALSE; + } return TRUE; } -BOOL Pokedex_CheckMonSeenFlag(struct Pokedex * pokedex, u16 species) -{ +BOOL Pokedex_CheckMonSeenFlag(struct Pokedex *pokedex, u16 species) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (DexSpeciesIsInvalid(species)) + if (DexSpeciesIsInvalid(species)) { return FALSE; + } return CheckDexFlag(pokedex->seenFlags, species); } -u32 Pokedex_GetSeenSpindaPersonality(struct Pokedex * pokedex, u32 a1) -{ +u32 Pokedex_GetSeenSpindaPersonality(struct Pokedex *pokedex, u32 a1) { u32 r6; GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (a1 == 0) + if (a1 == 0) { r6 = (u32)pokedex->spindaPersonality; - else + } else { GF_ASSERT(0); // r6 is not initialized because execution should halt here + } return r6; } -s32 sub_02024674(struct Pokedex * pokedex, u16 species, s32 r6) -{ +s32 sub_02024674(struct Pokedex *pokedex, u16 species, s32 r6) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (DexSpeciesIsInvalid(species)) + if (DexSpeciesIsInvalid(species)) { return -1; - if (CheckDexFlag(pokedex->seenFlags, species)) + } + if (CheckDexFlag(pokedex->seenFlags, species)) { return sub_020242C8(pokedex, species, r6); - else + } else { return -1; + } } -static inline s32 FindFirstAvailableUnownLetterSlot_2(struct Pokedex * pokedex) -{ +static inline s32 FindFirstAvailableUnownLetterSlot_2(struct Pokedex *pokedex) { s32 i; - for (i = 0; i < 28; i++) - { - if (pokedex->seenUnown[i] == 0xFF) + for (i = 0; i < 28; i++) { + if (pokedex->seenUnown[i] == 0xFF) { break; + } } return i; } -s32 Pokedex_GetSeenUnownI(struct Pokedex * pokedex, s32 a1) -{ +s32 Pokedex_GetSeenUnownI(struct Pokedex *pokedex, s32 a1) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); s32 i; i = FindFirstAvailableUnownLetterSlot_2(pokedex); - if (i <= a1) + if (i <= a1) { return -1; + } return pokedex->seenUnown[a1]; } -s32 Pokedex_CountSeenUnown(struct Pokedex * pokedex) -{ +s32 Pokedex_CountSeenUnown(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return FindFirstAvailableUnownLetterSlot_2(pokedex); } -BOOL Pokedex_GetSeenShellosForm(struct Pokedex * pokedex, s32 a1) -{ +BOOL Pokedex_GetSeenShellosForm(struct Pokedex *pokedex, s32 a1) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, SPECIES_SHELLOS) <= a1) + if (Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, SPECIES_SHELLOS) <= a1) { return -1; + } GF_ASSERT(a1 < 2); return CheckDexFlag(&pokedex->shellosGastrodon[0], (u16)(a1 + 1)); } -s32 Pokedex_CountSeenShellos(struct Pokedex * pokedex) -{ +s32 Pokedex_CountSeenShellos(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, SPECIES_SHELLOS); } -BOOL Pokedex_GetSeenGastrodonForm(struct Pokedex * pokedex, s32 a1) -{ +BOOL Pokedex_GetSeenGastrodonForm(struct Pokedex *pokedex, s32 a1) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, SPECIES_GASTRODON) <= a1) + if (Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, SPECIES_GASTRODON) <= a1) { return -1; + } GF_ASSERT(a1 < 2); return CheckDexFlag(&pokedex->shellosGastrodon[1], (u16)(a1 + 1)); } -s32 Pokedex_CountSeenGastrodon(struct Pokedex * pokedex) -{ +s32 Pokedex_CountSeenGastrodon(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return Pokedex_CountSeenShellosOrGastrodon_Internal(pokedex, SPECIES_GASTRODON); } -s32 Pokedex_GetSeenBurmyForm(struct Pokedex * pokedex, s32 a1) -{ +s32 Pokedex_GetSeenBurmyForm(struct Pokedex *pokedex, s32 a1) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, SPECIES_BURMY) <= a1) + if (Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, SPECIES_BURMY) <= a1) { return -1; + } GF_ASSERT(a1 < 3); return CheckDexFlagPair(&pokedex->burmyWormadam[0], (u16)a1); } -s32 Pokedex_CountSeenBurmy(struct Pokedex * pokedex) -{ +s32 Pokedex_CountSeenBurmy(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, SPECIES_BURMY); } -s32 Pokedex_GetSeenWormadamForm(struct Pokedex * pokedex, s32 a1) -{ +s32 Pokedex_GetSeenWormadamForm(struct Pokedex *pokedex, s32 a1) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, SPECIES_WORMADAM) <= a1) + if (Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, SPECIES_WORMADAM) <= a1) { return -1; + } GF_ASSERT(a1 < 3); return CheckDexFlagPair(&pokedex->burmyWormadam[1], (u16)a1); } -s32 Pokedex_CountSeenWormadam(struct Pokedex * pokedex) -{ +s32 Pokedex_CountSeenWormadam(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return Pokedex_CountSeenBurmyOrWormadam_Internal(pokedex, SPECIES_WORMADAM); } -s32 Pokedex_GetSeenDeoxysForm(struct Pokedex * pokedex, s32 a1) -{ +s32 Pokedex_GetSeenDeoxysForm(struct Pokedex *pokedex, s32 a1) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return (s32)GetDeoxysFormFlag_Internal(pokedex, (u8)a1); } -s32 Pokedex_CountSeenDeoxys(struct Pokedex * pokedex) -{ +s32 Pokedex_CountSeenDeoxys(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return Pokedex_CountSeenDeoxysForms_Internal(pokedex); } -static inline void SetSeenCaughtGender(struct Pokedex * pokedex, u16 species, u8 gender) -{ +static inline void SetSeenCaughtGender(struct Pokedex *pokedex, u16 species, u8 gender) { GF_ASSERT(gender <= 2); - if (gender == 2) + if (gender == 2) { gender = 0; + } UpdateDexFlag(pokedex->field_00C4, species, gender); UpdateDexFlag(pokedex->field_0084, species, gender); } -static inline void SetSeenGender(struct Pokedex * pokedex, u16 species, u8 gender) -{ +static inline void SetSeenGender(struct Pokedex *pokedex, u16 species, u8 gender) { GF_ASSERT(gender <= 2); - if (gender == 2) + if (gender == 2) { gender = 0; + } UpdateDexFlag(pokedex->field_00C4, species, gender); } -void Pokedex_SetMonSeenFlag(struct Pokedex * pokedex, struct Pokemon * pokemon) -{ - u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); +void Pokedex_SetMonSeenFlag(struct Pokedex *pokedex, struct Pokemon *pokemon) { + u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); u32 personality = GetMonData(pokemon, MON_DATA_PERSONALITY, NULL); - u32 gender = GetMonGender(pokemon); + u32 gender = GetMonGender(pokemon); GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (DexSpeciesIsInvalid(species)) + if (DexSpeciesIsInvalid(species)) { return; - if (!CheckDexFlag(pokedex->seenFlags, species)) - { - if (species == SPECIES_SPINDA) + } + if (!CheckDexFlag(pokedex->seenFlags, species)) { + if (species == SPECIES_SPINDA) { pokedex->spindaPersonality = personality; + } SetSeenCaughtGender(pokedex, species, (u8)gender); - } - else - { + } else { u8 seen_gender = (u8)CheckDexFlag(pokedex->field_0084, species); - if (seen_gender != gender) - { + if (seen_gender != gender) { SetSeenGender(pokedex, species, (u8)gender); } } @@ -653,31 +594,28 @@ void Pokedex_SetMonSeenFlag(struct Pokedex * pokedex, struct Pokemon * pokemon) SetDexFlag(pokedex->seenFlags, species); } -void Pokedex_SetMonCaughtFlag(struct Pokedex * pokedex, struct Pokemon * pokemon) -{ - u32 language; // sp08 +void Pokedex_SetMonCaughtFlag(struct Pokedex *pokedex, struct Pokemon *pokemon) { + u32 language; // sp08 u32 personality; // sp04 - u32 gender; // r7 - u16 species; // r6 + u32 gender; // r7 + u16 species; // r6 - species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); - language = GetMonData(pokemon, MON_DATA_GAME_LANGUAGE, NULL); + species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); + language = GetMonData(pokemon, MON_DATA_GAME_LANGUAGE, NULL); personality = GetMonData(pokemon, MON_DATA_PERSONALITY, NULL); - gender = GetMonGender(pokemon); + gender = GetMonGender(pokemon); GF_ASSERT(pokedex->magic == 0xBEEFCAFE); - if (DexSpeciesIsInvalid(species)) + if (DexSpeciesIsInvalid(species)) { return; - if (!CheckDexFlag(pokedex->seenFlags, species)) - { - if (species == SPECIES_SPINDA) + } + if (!CheckDexFlag(pokedex->seenFlags, species)) { + if (species == SPECIES_SPINDA) { pokedex->spindaPersonality = personality; + } SetSeenCaughtGender(pokedex, species, (u8)gender); - } - else - { + } else { u8 seen_gender = (u8)CheckDexFlag(pokedex->field_0084, species); - if (seen_gender != gender) - { + if (seen_gender != gender) { SetSeenGender(pokedex, species, (u8)gender); } } @@ -687,95 +625,90 @@ void Pokedex_SetMonCaughtFlag(struct Pokedex * pokedex, struct Pokemon * pokemon SetDexFlag(pokedex->seenFlags, species); } -void Pokedex_SetNatDexFlag(struct Pokedex * pokedex) -{ +void Pokedex_SetNatDexFlag(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); pokedex->unlockedNationalDex = 1; } -BOOL Pokedex_GetNatDexFlag(struct Pokedex * pokedex) -{ +BOOL Pokedex_GetNatDexFlag(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return pokedex->unlockedNationalDex; } -BOOL Pokedex_GetGenderEntriesFlag(struct Pokedex * pokedex) -{ +BOOL Pokedex_GetGenderEntriesFlag(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return pokedex->unlockedGenderEntries; } -void Pokedex_SetGenderEntriesFlag(struct Pokedex * pokedex) -{ +void Pokedex_SetGenderEntriesFlag(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); pokedex->unlockedGenderEntries = 1; } -s32 Pokedex_GetMeisterFlagBySpeciesAndLanguage(struct Pokedex * pokedex, u32 species, u32 language) -{ +s32 Pokedex_GetMeisterFlagBySpeciesAndLanguage(struct Pokedex *pokedex, u32 species, u32 language) { GF_ASSERT(language < 8); GF_ASSERT(pokedex->magic == 0xBEEFCAFE); s32 r5 = GetMeisterSpeciesIdx(species); - if (r5 == 14) + if (r5 == 14) { return 0; + } s32 r0 = GetMeisterLanguageIdx(language); return pokedex->meister[r5] & (1 << r0); } -void Pokedex_SetForeignEntriesFlag(struct Pokedex * pokedex) -{ +void Pokedex_SetForeignEntriesFlag(struct Pokedex *pokedex) { pokedex->unlockedForeignEntries = 1; } -BOOL Pokedex_GetForeignEntriesFlag(struct Pokedex * pokedex) -{ +BOOL Pokedex_GetForeignEntriesFlag(struct Pokedex *pokedex) { return pokedex->unlockedForeignEntries; } -BOOL Pokedex_GetSinnohDexFlag(struct Pokedex * pokedex) -{ +BOOL Pokedex_GetSinnohDexFlag(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); return pokedex->unlockedSinnohDex; } -void Pokedex_SetSinnohDexFlag(struct Pokedex * pokedex) -{ +void Pokedex_SetSinnohDexFlag(struct Pokedex *pokedex) { GF_ASSERT(pokedex->magic == 0xBEEFCAFE); pokedex->unlockedSinnohDex = 1; } -struct Pokedex * Save_Pokedex_Get(struct SaveData * save) -{ +struct Pokedex *Save_Pokedex_Get(struct SaveData *save) { return (struct Pokedex *)SaveArray_Get(save, 7); } -s32 Pokedex_GetSeenMonForm(struct Pokedex * pokedex, s32 species, u32 form) -{ - switch (species) - { +s32 Pokedex_GetSeenMonForm(struct Pokedex *pokedex, s32 species, u32 form) { + switch (species) { case SPECIES_UNOWN: - if (form < Pokedex_CountSeenUnown(pokedex)) + if (form < Pokedex_CountSeenUnown(pokedex)) { return Pokedex_GetSeenUnownI(pokedex, (s32)form); + } break; case SPECIES_SHELLOS: - if (form < Pokedex_CountSeenShellos(pokedex)) + if (form < Pokedex_CountSeenShellos(pokedex)) { return Pokedex_GetSeenShellosForm(pokedex, (s32)form); + } break; case SPECIES_GASTRODON: - if (form < Pokedex_CountSeenGastrodon(pokedex)) + if (form < Pokedex_CountSeenGastrodon(pokedex)) { return Pokedex_GetSeenGastrodonForm(pokedex, (s32)form); + } break; case SPECIES_BURMY: - if (form < Pokedex_CountSeenBurmy(pokedex)) + if (form < Pokedex_CountSeenBurmy(pokedex)) { return Pokedex_GetSeenBurmyForm(pokedex, (s32)form); + } break; case SPECIES_WORMADAM: - if (form < Pokedex_CountSeenWormadam(pokedex)) + if (form < Pokedex_CountSeenWormadam(pokedex)) { return Pokedex_GetSeenWormadamForm(pokedex, (s32)form); + } break; case SPECIES_DEOXYS: - if (form < Pokedex_CountSeenDeoxys(pokedex)) + if (form < Pokedex_CountSeenDeoxys(pokedex)) { return Pokedex_GetSeenDeoxysForm(pokedex, (s32)form); + } break; } return 0; diff --git a/arm9/src/pokemon.c b/arm9/src/pokemon.c index e072a5321..c5f22cee7 100644 --- a/arm9/src/pokemon.c +++ b/arm9/src/pokemon.c @@ -1,79 +1,77 @@ #include "global.h" #define IN_POKEMON_C -#include "proto.h" -#include "party.h" -#include "player_data.h" -#include "pokemon.h" -#include "filesystem.h" -#include "heap.h" -#include "MI_memory.h" -#include "math_util.h" -#include "move_data.h" -#include "string_util.h" -#include "seal.h" -#include "msgdata.h" -#include "itemtool.h" #include "constants/abilities.h" #include "constants/items.h" #include "constants/moves.h" #include "constants/sinnoh_dex.h" #include "constants/trainer_classes.h" -#include "unk_020051F4.h" + +#include "MI_memory.h" +#include "filesystem.h" +#include "heap.h" +#include "itemtool.h" +#include "math_util.h" +#include "move_data.h" +#include "msgdata.h" +#include "party.h" +#include "player_data.h" +#include "pokemon.h" +#include "proto.h" +#include "seal.h" #include "sound_chatot.h" +#include "string_util.h" +#include "unk_020051F4.h" -u32 GetMonDataInternal(struct Pokemon * pokemon, int attr, void * ptr); -u32 GetBoxMonDataInternal(struct BoxPokemon * pokemon, int attr, void * ptr); -void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * ptr); -void SetBoxMonDataInternal(struct BoxPokemon * pokemon, int attr, void * ptr); -void AddMonDataInternal(struct Pokemon * pokemon, int attr, int amount); -void AddBoxMonData(struct BoxPokemon * pokemon, int attr, int amount); -u32 CalcBoxMonExpToNextLevel(struct BoxPokemon * boxmon); +u32 GetMonDataInternal(struct Pokemon *pokemon, int attr, void *ptr); +u32 GetBoxMonDataInternal(struct BoxPokemon *pokemon, int attr, void *ptr); +void SetMonDataInternal(struct Pokemon *pokemon, int attr, void *ptr); +void SetBoxMonDataInternal(struct BoxPokemon *pokemon, int attr, void *ptr); +void AddMonDataInternal(struct Pokemon *pokemon, int attr, int amount); +void AddBoxMonData(struct BoxPokemon *pokemon, int attr, int amount); +u32 CalcBoxMonExpToNextLevel(struct BoxPokemon *boxmon); u16 ModifyStatByNature(u8 nature, u16 statval, u8 statno); -u8 GetGenderBySpeciesAndPersonality_PreloadedPersonal(struct BaseStats * personal, u16 species, u32 pid); -u8 BoxMonIsShiny(struct BoxPokemon * boxmon); +u8 GetGenderBySpeciesAndPersonality_PreloadedPersonal(struct BaseStats *personal, u16 species, u32 pid); +u8 BoxMonIsShiny(struct BoxPokemon *boxmon); u8 CalcShininessByOtIdAndPersonality(u32 otid, u32 pid); -void InitBoxMonMoveset(struct BoxPokemon * boxmon); -u32 sub_020696A8(struct BoxPokemon * boxmon, u16 move); -void sub_02069718(struct BoxPokemon * boxmon, u16 move); -void BoxMonSetMoveInSlot(struct BoxPokemon * boxmon, u16 move, u8 slot); -void sub_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2); -s8 BoxMonGetFlavorPreference(struct BoxPokemon * boxmon, int flavor); +void InitBoxMonMoveset(struct BoxPokemon *boxmon); +u32 sub_020696A8(struct BoxPokemon *boxmon, u16 move); +void sub_02069718(struct BoxPokemon *boxmon, u16 move); +void BoxMonSetMoveInSlot(struct BoxPokemon *boxmon, u16 move, u8 slot); +void sub_020698E8(struct BoxPokemon *boxmon, int slot1, int slot2); +s8 BoxMonGetFlavorPreference(struct BoxPokemon *boxmon, int flavor); s8 GetFlavorPreferenceFromPID(u32 personality, int flavor); -u8 Party_MaskMonsWithPokerus(struct Party * party_p, u8 mask); -BOOL BoxMon_HasPokerus(struct BoxPokemon * boxmon); -BOOL BoxMon_IsImmuneToPokerus(struct BoxPokemon * boxmon); -void BoxMon_UpdateArceusForm(struct BoxPokemon * boxmon); +u8 Party_MaskMonsWithPokerus(struct Party *party_p, u8 mask); +BOOL BoxMon_HasPokerus(struct BoxPokemon *boxmon); +BOOL BoxMon_IsImmuneToPokerus(struct BoxPokemon *boxmon); +void BoxMon_UpdateArceusForm(struct BoxPokemon *boxmon); void LoadLevelUpLearnset_HandleAlternateForm(int species, int form, u16 *levelUpLearnset); -void sub_0206A054(struct BoxPokemon * boxmon, PlayerProfile * a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId); -BOOL MonHasMove(struct Pokemon * pokemon, u16 move); -BOOL sub_0206A144(struct BoxPokemon * boxmon, u32 a1); +void sub_0206A054(struct BoxPokemon *boxmon, PlayerProfile *a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId); +BOOL MonHasMove(struct Pokemon *pokemon, u16 move); +BOOL sub_0206A144(struct BoxPokemon *boxmon, u32 a1); BOOL sub_0206A16C(u16 species, int form, u32 a2); -void sub_0206A1CC(struct BoxPokemon * boxmon); +void sub_0206A1CC(struct BoxPokemon *boxmon); u32 MaskOfFlagNo(int flagno); -void LoadMonPersonal(int species, struct BaseStats * personal); -void LoadMonEvolutionTable(u16 species, struct Evolution * dest); +void LoadMonPersonal(int species, struct BaseStats *personal); +void LoadMonEvolutionTable(u16 species, struct Evolution *dest); int ResolveMonForm(int species, int form); -void MonEncryptSegment(u16 * datap, u32 size, u32 key); -void MonDecryptSegment(u16 * datap, u32 size, u32 key); -u16 MonEncryptionLCRNG(u32 * seed); -u16 CalcMonChecksum(u16 * datap, u32 size); -PokemonDataBlock * GetSubstruct(struct BoxPokemon * boxmon, u32 personality, u8 which_struct); -void LoadMonBaseStats_HandleAlternateForm(int species, int form, struct BaseStats * baseStats); -u8 GetBoxMonUnownLetter(struct BoxPokemon * boxmon); - -#define ENCRY_ARGS_PTY(mon) (u16 *)&(mon)->party, sizeof((mon)->party), (mon)->box.pid +void MonEncryptSegment(u16 *datap, u32 size, u32 key); +void MonDecryptSegment(u16 *datap, u32 size, u32 key); +u16 MonEncryptionLCRNG(u32 *seed); +u16 CalcMonChecksum(u16 *datap, u32 size); +PokemonDataBlock *GetSubstruct(struct BoxPokemon *boxmon, u32 personality, u8 which_struct); +void LoadMonBaseStats_HandleAlternateForm(int species, int form, struct BaseStats *baseStats); +u8 GetBoxMonUnownLetter(struct BoxPokemon *boxmon); + +#define ENCRY_ARGS_PTY(mon) (u16 *)&(mon)->party, sizeof((mon)->party), (mon)->box.pid #define ENCRY_ARGS_BOX(boxmon) (u16 *)&(boxmon)->substructs, sizeof((boxmon)->substructs), (boxmon)->checksum -#define ENCRYPT_PTY(mon) MonEncryptSegment(ENCRY_ARGS_PTY(mon)) -#define ENCRYPT_BOX(boxmon) MonEncryptSegment(ENCRY_ARGS_BOX(boxmon)) -#define DECRYPT_PTY(mon) MonDecryptSegment(ENCRY_ARGS_PTY(mon)) -#define DECRYPT_BOX(boxmon) MonDecryptSegment(ENCRY_ARGS_BOX(boxmon)) -#define CHECKSUM(boxmon) CalcMonChecksum((u16 *)(boxmon)->substructs, sizeof((boxmon)->substructs)) -#define SHINY_CHECK(otid, pid) (( \ - ((((otid) & 0xFFFF0000u) >> 16u)) ^ \ - (((otid) & 0xFFFFu)) ^ \ - ((((pid) & 0xFFFF0000u) >> 16u))^ \ - (((pid) & 0xFFFFu))) \ +#define ENCRYPT_PTY(mon) MonEncryptSegment(ENCRY_ARGS_PTY(mon)) +#define ENCRYPT_BOX(boxmon) MonEncryptSegment(ENCRY_ARGS_BOX(boxmon)) +#define DECRYPT_PTY(mon) MonDecryptSegment(ENCRY_ARGS_PTY(mon)) +#define DECRYPT_BOX(boxmon) MonDecryptSegment(ENCRY_ARGS_BOX(boxmon)) +#define CHECKSUM(boxmon) CalcMonChecksum((u16 *)(boxmon)->substructs, sizeof((boxmon)->substructs)) +#define SHINY_CHECK(otid, pid) (( \ + ((((otid) & 0xFFFF0000u) >> 16u)) ^ (((otid) & 0xFFFFu)) ^ ((((pid) & 0xFFFF0000u) >> 16u)) ^ (((pid) & 0xFFFFu))) \ < 8u) #define CALC_UNOWN_LETTER(pid) ((u32)((((pid) & 0x3000000) >> 18) | (((pid) & 0x30000) >> 12) | (((pid) & 0x300) >> 6) | (((pid) & 0x3) >> 0)) % 28u) @@ -83,16 +81,16 @@ const u16 sItemOdds[2][2] = { }; const s8 sFriendshipModTable[][3] = { - { 5, 3, 2 }, - { 5, 3, 2 }, - { 1, 1, 0 }, - { 3, 2, 1 }, - { 1, 1, 0 }, - { 1, 1, 1 }, - { -1, -1, -1 }, + { 5, 3, 2 }, + { 5, 3, 2 }, + { 1, 1, 0 }, + { 3, 2, 1 }, + { 1, 1, 0 }, + { 1, 1, 1 }, + { -1, -1, -1 }, { -5, -5, -10 }, { -5, -5, -10 }, - { 3, 2, 1 }, + { 3, 2, 1 }, }; const u16 sLegendaryMonsList[] = { @@ -118,111 +116,103 @@ const u16 sLegendaryMonsList[] = { const s8 sFlavorPreferencesByNature[][5] = { // Spicy, Dry, Sweet, Bitter, Sour - { 0, 0, 0, 0, 0 }, // NATURE_HARDY - { 1, 0, 0, 0, -1 }, // NATURE_LONELY - { 1, 0, -1, 0, 0 }, // NATURE_BRAVE - { 1, -1, 0, 0, 0 }, // NATURE_ADAMANT - { 1, 0, 0, -1, 0 }, // NATURE_NAUGHTY - { -1, 0, 0, 0, 1 }, // NATURE_BOLD - { 0, 0, 0, 0, 0 }, // NATURE_DOCILE - { 0, 0, -1, 0, 1 }, // NATURE_RELAXED - { 0, -1, 0, 0, 1 }, // NATURE_IMPISH - { 0, 0, 0, -1, 1 }, // NATURE_LAX - { -1, 0, 1, 0, 0 }, // NATURE_TIMID - { 0, 0, 1, 0, -1 }, // NATURE_HASTY - { 0, 0, 0, 0, 0 }, // NATURE_SERIOUS - { 0, -1, 1, 0, 0 }, // NATURE_JOLLY - { 0, 0, 1, -1, 0 }, // NATURE_NAIVE - { -1, 1, 0, 0, 0 }, // NATURE_MODEST - { 0, 1, 0, 0, -1 }, // NATURE_MILD - { 0, 1, -1, 0, 0 }, // NATURE_QUIET - { 0, 0, 0, 0, 0 }, // NATURE_BASHFUL - { 0, 1, 0, -1, 0 }, // NATURE_RASH - { -1, 0, 0, 1, 0 }, // NATURE_CALM - { 0, 0, 0, 1, -1 }, // NATURE_GENTLE - { 0, 0, -1, 1, 0 }, // NATURE_SASSY - { 0, -1, 0, 1, 0 }, // NATURE_CAREFUL - { 0, 0, 0, 0, 0 }, // NATURE_QUIRKY + { 0, 0, 0, 0, 0 }, // NATURE_HARDY + { 1, 0, 0, 0, -1 }, // NATURE_LONELY + { 1, 0, -1, 0, 0 }, // NATURE_BRAVE + { 1, -1, 0, 0, 0 }, // NATURE_ADAMANT + { 1, 0, 0, -1, 0 }, // NATURE_NAUGHTY + { -1, 0, 0, 0, 1 }, // NATURE_BOLD + { 0, 0, 0, 0, 0 }, // NATURE_DOCILE + { 0, 0, -1, 0, 1 }, // NATURE_RELAXED + { 0, -1, 0, 0, 1 }, // NATURE_IMPISH + { 0, 0, 0, -1, 1 }, // NATURE_LAX + { -1, 0, 1, 0, 0 }, // NATURE_TIMID + { 0, 0, 1, 0, -1 }, // NATURE_HASTY + { 0, 0, 0, 0, 0 }, // NATURE_SERIOUS + { 0, -1, 1, 0, 0 }, // NATURE_JOLLY + { 0, 0, 1, -1, 0 }, // NATURE_NAIVE + { -1, 1, 0, 0, 0 }, // NATURE_MODEST + { 0, 1, 0, 0, -1 }, // NATURE_MILD + { 0, 1, -1, 0, 0 }, // NATURE_QUIET + { 0, 0, 0, 0, 0 }, // NATURE_BASHFUL + { 0, 1, 0, -1, 0 }, // NATURE_RASH + { -1, 0, 0, 1, 0 }, // NATURE_CALM + { 0, 0, 0, 1, -1 }, // NATURE_GENTLE + { 0, 0, -1, 1, 0 }, // NATURE_SASSY + { 0, -1, 0, 1, 0 }, // NATURE_CAREFUL + { 0, 0, 0, 0, 0 }, // NATURE_QUIRKY }; const s8 sNatureStatMods[][5] = { // Atk, Def, Speed, SpAtk, SpDef - { 0, 0, 0, 0, 0 }, // NATURE_HARDY - { 1, -1, 0, 0, 0 }, // NATURE_LONELY - { 1, 0, -1, 0, 0 }, // NATURE_BRAVE - { 1, 0, 0, -1, 0 }, // NATURE_ADAMANT - { 1, 0, 0, 0, -1 }, // NATURE_NAUGHTY - { -1, 1, 0, 0, 0 }, // NATURE_BOLD - { 0, 0, 0, 0, 0 }, // NATURE_DOCILE - { 0, 1, -1, 0, 0 }, // NATURE_RELAXED - { 0, 1, 0, -1, 0 }, // NATURE_IMPISH - { 0, 1, 0, 0, -1 }, // NATURE_LAX - { -1, 0, 1, 0, 0 }, // NATURE_TIMID - { 0, -1, 1, 0, 0 }, // NATURE_HASTY - { 0, 0, 0, 0, 0 }, // NATURE_SERIOUS - { 0, 0, 1, -1, 0 }, // NATURE_JOLLY - { 0, 0, 1, 0, -1 }, // NATURE_NAIVE - { -1, 0, 0, 1, 0 }, // NATURE_MODEST - { 0, -1, 0, 1, 0 }, // NATURE_MILD - { 0, 0, -1, 1, 0 }, // NATURE_QUIET - { 0, 0, 0, 0, 0 }, // NATURE_BASHFUL - { 0, 0, 0, 1, -1 }, // NATURE_RASH - { -1, 0, 0, 0, 1 }, // NATURE_CALM - { 0, -1, 0, 0, 1 }, // NATURE_GENTLE - { 0, 0, -1, 0, 1 }, // NATURE_SASSY - { 0, 0, 0, -1, 1 }, // NATURE_CAREFUL - { 0, 0, 0, 0, 0 }, // NATURE_QUIRKY + { 0, 0, 0, 0, 0 }, // NATURE_HARDY + { 1, -1, 0, 0, 0 }, // NATURE_LONELY + { 1, 0, -1, 0, 0 }, // NATURE_BRAVE + { 1, 0, 0, -1, 0 }, // NATURE_ADAMANT + { 1, 0, 0, 0, -1 }, // NATURE_NAUGHTY + { -1, 1, 0, 0, 0 }, // NATURE_BOLD + { 0, 0, 0, 0, 0 }, // NATURE_DOCILE + { 0, 1, -1, 0, 0 }, // NATURE_RELAXED + { 0, 1, 0, -1, 0 }, // NATURE_IMPISH + { 0, 1, 0, 0, -1 }, // NATURE_LAX + { -1, 0, 1, 0, 0 }, // NATURE_TIMID + { 0, -1, 1, 0, 0 }, // NATURE_HASTY + { 0, 0, 0, 0, 0 }, // NATURE_SERIOUS + { 0, 0, 1, -1, 0 }, // NATURE_JOLLY + { 0, 0, 1, 0, -1 }, // NATURE_NAIVE + { -1, 0, 0, 1, 0 }, // NATURE_MODEST + { 0, -1, 0, 1, 0 }, // NATURE_MILD + { 0, 0, -1, 1, 0 }, // NATURE_QUIET + { 0, 0, 0, 0, 0 }, // NATURE_BASHFUL + { 0, 0, 0, 1, -1 }, // NATURE_RASH + { -1, 0, 0, 0, 1 }, // NATURE_CALM + { 0, -1, 0, 0, 1 }, // NATURE_GENTLE + { 0, 0, -1, 0, 1 }, // NATURE_SASSY + { 0, 0, 0, -1, 1 }, // NATURE_CAREFUL + { 0, 0, 0, 0, 0 }, // NATURE_QUIRKY }; -void ZeroMonData(struct Pokemon * pokemon) -{ +void ZeroMonData(struct Pokemon *pokemon) { MI_CpuClearFast(pokemon, sizeof(struct Pokemon)); ENCRYPT_BOX(&pokemon->box); ENCRYPT_PTY(pokemon); } -void ZeroBoxMonData(struct BoxPokemon * boxmon) -{ +void ZeroBoxMonData(struct BoxPokemon *boxmon) { MI_CpuClearFast(boxmon, sizeof(struct BoxPokemon)); ENCRYPT_BOX(boxmon); } -u32 SizeOfStructPokemon(void) -{ +u32 SizeOfStructPokemon(void) { return sizeof(struct Pokemon); } -struct Pokemon * AllocMonZeroed(HeapID heapId) -{ - struct Pokemon * pokemon = (struct Pokemon *)AllocFromHeap(heapId, sizeof(struct Pokemon)); +struct Pokemon *AllocMonZeroed(HeapID heapId) { + struct Pokemon *pokemon = (struct Pokemon *)AllocFromHeap(heapId, sizeof(struct Pokemon)); ZeroMonData(pokemon); return pokemon; } -BOOL AcquireMonLock(struct Pokemon * mon) -{ +BOOL AcquireMonLock(struct Pokemon *mon) { BOOL ret = FALSE; - if (!mon->box.party_lock) - { + if (!mon->box.party_lock) { ret = TRUE; GF_ASSERT(!mon->box.box_lock); mon->box.party_lock = TRUE; - mon->box.box_lock = TRUE; + mon->box.box_lock = TRUE; DECRYPT_PTY(mon); DECRYPT_BOX(&mon->box); } return ret; } -BOOL ReleaseMonLock(struct Pokemon * mon, BOOL decrypt_result) -{ +BOOL ReleaseMonLock(struct Pokemon *mon, BOOL decrypt_result) { BOOL ret = FALSE; - if (mon->box.party_lock == TRUE && decrypt_result == TRUE) - { - ret = TRUE; + if (mon->box.party_lock == TRUE && decrypt_result == TRUE) { + ret = TRUE; mon->box.party_lock = FALSE; - mon->box.box_lock = FALSE; + mon->box.box_lock = FALSE; ENCRYPT_PTY(mon); mon->box.checksum = CHECKSUM(&mon->box); ENCRYPT_BOX(&mon->box); @@ -230,25 +220,21 @@ BOOL ReleaseMonLock(struct Pokemon * mon, BOOL decrypt_result) return ret; } -BOOL AcquireBoxMonLock(struct BoxPokemon * mon) -{ +BOOL AcquireBoxMonLock(struct BoxPokemon *mon) { BOOL ret = FALSE; - if (!mon->box_lock) - { - ret = TRUE; + if (!mon->box_lock) { + ret = TRUE; mon->box_lock = TRUE; DECRYPT_BOX(mon); } return ret; } -BOOL ReleaseBoxMonLock(struct BoxPokemon * mon, BOOL decrypt_result) -{ +BOOL ReleaseBoxMonLock(struct BoxPokemon *mon, BOOL decrypt_result) { BOOL ret = FALSE; - if (mon->box_lock == TRUE && decrypt_result == TRUE) - { - ret = TRUE; + if (mon->box_lock == TRUE && decrypt_result == TRUE) { + ret = TRUE; mon->box_lock = FALSE; mon->checksum = CHECKSUM(mon); ENCRYPT_BOX(mon); @@ -256,9 +242,8 @@ BOOL ReleaseBoxMonLock(struct BoxPokemon * mon, BOOL decrypt_result) return ret; } -void CreateMon(struct Pokemon * pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId) -{ - struct Mail * mail; +void CreateMon(struct Pokemon *pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId) { + struct Mail *mail; u32 capsule; u8 seal_coords[0x18]; ZeroMonData(pokemon); @@ -277,27 +262,23 @@ void CreateMon(struct Pokemon * pokemon, int species, int level, int fixedIV, in CalcMonLevelAndStats(pokemon); } -void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId) -{ +void CreateBoxMon(struct BoxPokemon *boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId) { BOOL decry; u32 exp; u32 iv; ZeroBoxMonData(boxPokemon); decry = AcquireBoxMonLock(boxPokemon); - if (hasFixedPersonality == 0) - { + if (hasFixedPersonality == 0) { fixedPersonality = (LCRandom() | (LCRandom() << 16)); } SetBoxMonData(boxPokemon, MON_DATA_PERSONALITY, &fixedPersonality); - if (otIdType == 2) - { - do - { + if (otIdType == 2) { + do { fixedOtId = (LCRandom() | (LCRandom() << 16)); } while (SHINY_CHECK(fixedOtId, fixedPersonality)); - } - else if (otIdType != 1) + } else if (otIdType != 1) { fixedOtId = 0; + } SetBoxMonData(boxPokemon, MON_DATA_OTID, &fixedOtId); SetBoxMonData(boxPokemon, MON_DATA_GAME_LANGUAGE, (void *)&gGameLanguage); SetBoxMonData(boxPokemon, MON_DATA_SPECIES, &species); @@ -310,26 +291,23 @@ void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fi SetBoxMonData(boxPokemon, MON_DATA_GAME_VERSION, (void *)&gGameVersion); exp = ITEM_POKE_BALL; SetBoxMonData(boxPokemon, MON_DATA_POKEBALL, &exp); - if (fixedIV < 0x20) - { + if (fixedIV < 0x20) { SetBoxMonData(boxPokemon, MON_DATA_HP_IV, &fixedIV); SetBoxMonData(boxPokemon, MON_DATA_ATK_IV, &fixedIV); SetBoxMonData(boxPokemon, MON_DATA_DEF_IV, &fixedIV); SetBoxMonData(boxPokemon, MON_DATA_SPEED_IV, &fixedIV); SetBoxMonData(boxPokemon, MON_DATA_SPATK_IV, &fixedIV); SetBoxMonData(boxPokemon, MON_DATA_SPDEF_IV, &fixedIV); - } - else - { + } else { exp = LCRandom(); - iv = exp & 0x1F; + iv = exp & 0x1F; SetBoxMonData(boxPokemon, MON_DATA_HP_IV, &iv); iv = (exp & 0x3E0) >> 5; SetBoxMonData(boxPokemon, MON_DATA_ATK_IV, &iv); iv = (exp & 0x7C00) >> 10; SetBoxMonData(boxPokemon, MON_DATA_DEF_IV, &iv); exp = LCRandom(); - iv = exp & 0x1F; + iv = exp & 0x1F; SetBoxMonData(boxPokemon, MON_DATA_SPEED_IV, &iv); iv = (exp & 0x3E0) >> 5; SetBoxMonData(boxPokemon, MON_DATA_SPATK_IV, &iv); @@ -337,64 +315,55 @@ void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fi SetBoxMonData(boxPokemon, MON_DATA_SPDEF_IV, &iv); } exp = (u32)GetMonBaseStat(species, BASE_ABILITY_1); - iv = (u32)GetMonBaseStat(species, BASE_ABILITY_2); - if (iv != 0) - { - if (fixedPersonality & 1) + iv = (u32)GetMonBaseStat(species, BASE_ABILITY_2); + if (iv != 0) { + if (fixedPersonality & 1) { SetBoxMonData(boxPokemon, MON_DATA_ABILITY, &iv); - else + } else { SetBoxMonData(boxPokemon, MON_DATA_ABILITY, &exp); - } - else + } + } else { SetBoxMonData(boxPokemon, MON_DATA_ABILITY, &exp); + } exp = GetBoxMonGender(boxPokemon); SetBoxMonData(boxPokemon, MON_DATA_GENDER, &exp); InitBoxMonMoveset(boxPokemon); ReleaseBoxMonLock(boxPokemon, decry); } -void CreateMonWithNature(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 nature) -{ +void CreateMonWithNature(struct Pokemon *pokemon, u16 species, u8 level, u8 fixedIv, u8 nature) { u32 personality; - do - { + do { personality = (u32)(LCRandom() | (LCRandom() << 16)); } while (nature != GetNatureFromPersonality(personality)); CreateMon(pokemon, (int)species, (int)level, (int)fixedIv, 1, (int)personality, (int)0, (int)0); } // FIXME: stack storage of pokemon, fixedIv swapped -void CreateMonWithGenderNatureLetter(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 gender, u8 nature, u8 letter) -{ - u32 pid = 0; +void CreateMonWithGenderNatureLetter(struct Pokemon *pokemon, u16 species, u8 level, u8 fixedIv, u8 gender, u8 nature, u8 letter) { + u32 pid = 0; u16 test = 0; - if (letter != 0 && letter < 29) - { + if (letter != 0 && letter < 29) { do { - pid = (u32)(LCRandom() | (LCRandom() << 16)); + pid = (u32)(LCRandom() | (LCRandom() << 16)); test = (u16)CALC_UNOWN_LETTER(pid); } while (nature != GetNatureFromPersonality(pid) || gender != GetGenderBySpeciesAndPersonality(species, pid) || test != letter - 1); - } - else - { + } else { pid = GenPersonalityByGenderAndNature(species, gender, nature); } CreateMon(pokemon, (int)species, (int)level, (int)fixedIv, 1, (int)pid, 0, 0); } -u32 GenPersonalityByGenderAndNature(u16 species, u8 gender, u8 nature) -{ - int pid = nature; +u32 GenPersonalityByGenderAndNature(u16 species, u8 gender, u8 nature) { + int pid = nature; u8 ratio = (u8)GetMonBaseStat(species, BASE_GENDER_RATIO); - switch (ratio) - { + switch (ratio) { case MON_RATIO_MALE: case MON_RATIO_FEMALE: case MON_RATIO_UNKNOWN: break; default: - if (gender == MON_MALE) - { + if (gender == MON_MALE) { // Smallest increment that forces the low byte to exceed the // gender ratio, thus making the mon male pid = 25 * ((ratio / 25) + 1); @@ -405,25 +374,22 @@ u32 GenPersonalityByGenderAndNature(u16 species, u8 gender, u8 nature) return (u32)pid; } -void CreateMonWithFixedIVs(struct Pokemon * pokemon, int species, int level, int ivs, int personality) -{ +void CreateMonWithFixedIVs(struct Pokemon *pokemon, int species, int level, int ivs, int personality) { CreateMon(pokemon, species, level, 0, 1, personality, 0, 0); SetMonData(pokemon, MON_DATA_IVS_WORD, &ivs); CalcMonLevelAndStats(pokemon); } -void CalcMonLevelAndStats(struct Pokemon * pokemon) -{ +void CalcMonLevelAndStats(struct Pokemon *pokemon) { BOOL decry = AcquireMonLock(pokemon); - u32 level = (u32)CalcMonLevel(pokemon); + u32 level = (u32)CalcMonLevel(pokemon); SetMonData(pokemon, MON_DATA_LEVEL, &level); CalcMonStats(pokemon); ReleaseMonLock(pokemon, decry); } -void CalcMonStats(struct Pokemon * pokemon) -{ - struct BaseStats * baseStats; +void CalcMonStats(struct Pokemon *pokemon) { + struct BaseStats *baseStats; int level; int maxHp; int hpIv; @@ -448,31 +414,30 @@ void CalcMonStats(struct Pokemon * pokemon) int newSpatk; int newSpdef; BOOL decry = AcquireMonLock(pokemon); - level = (int)GetMonData(pokemon, MON_DATA_LEVEL, NULL); - maxHp = (int)GetMonData(pokemon, MON_DATA_MAXHP, NULL); - hp = (int)GetMonData(pokemon, MON_DATA_HP, NULL); - hpIv = (int)GetMonData(pokemon, MON_DATA_HP_IV, NULL); - hpEv = (int)GetMonData(pokemon, MON_DATA_HP_EV, NULL); - atkIv = (int)GetMonData(pokemon, MON_DATA_ATK_IV, NULL); - atkEv = (int)GetMonData(pokemon, MON_DATA_ATK_EV, NULL); - defIv = (int)GetMonData(pokemon, MON_DATA_DEF_IV, NULL); - defEv = (int)GetMonData(pokemon, MON_DATA_DEF_EV, NULL); - speedIv = (int)GetMonData(pokemon, MON_DATA_SPEED_IV, NULL); - speedEv = (int)GetMonData(pokemon, MON_DATA_SPEED_EV, NULL); - spatkIv = (int)GetMonData(pokemon, MON_DATA_SPATK_IV, NULL); - spatkEv = (int)GetMonData(pokemon, MON_DATA_SPATK_EV, NULL); - spdefIv = (int)GetMonData(pokemon, MON_DATA_SPDEF_IV, NULL); - spdefEv = (int)GetMonData(pokemon, MON_DATA_SPDEF_EV, NULL); - form = (int)GetMonData(pokemon, MON_DATA_FORM, NULL); - species = (int)GetMonData(pokemon, MON_DATA_SPECIES, NULL); + level = (int)GetMonData(pokemon, MON_DATA_LEVEL, NULL); + maxHp = (int)GetMonData(pokemon, MON_DATA_MAXHP, NULL); + hp = (int)GetMonData(pokemon, MON_DATA_HP, NULL); + hpIv = (int)GetMonData(pokemon, MON_DATA_HP_IV, NULL); + hpEv = (int)GetMonData(pokemon, MON_DATA_HP_EV, NULL); + atkIv = (int)GetMonData(pokemon, MON_DATA_ATK_IV, NULL); + atkEv = (int)GetMonData(pokemon, MON_DATA_ATK_EV, NULL); + defIv = (int)GetMonData(pokemon, MON_DATA_DEF_IV, NULL); + defEv = (int)GetMonData(pokemon, MON_DATA_DEF_EV, NULL); + speedIv = (int)GetMonData(pokemon, MON_DATA_SPEED_IV, NULL); + speedEv = (int)GetMonData(pokemon, MON_DATA_SPEED_EV, NULL); + spatkIv = (int)GetMonData(pokemon, MON_DATA_SPATK_IV, NULL); + spatkEv = (int)GetMonData(pokemon, MON_DATA_SPATK_EV, NULL); + spdefIv = (int)GetMonData(pokemon, MON_DATA_SPDEF_IV, NULL); + spdefEv = (int)GetMonData(pokemon, MON_DATA_SPDEF_EV, NULL); + form = (int)GetMonData(pokemon, MON_DATA_FORM, NULL); + species = (int)GetMonData(pokemon, MON_DATA_SPECIES, NULL); baseStats = (struct BaseStats *)AllocFromHeap(HEAP_ID_DEFAULT, sizeof(struct BaseStats)); LoadMonBaseStats_HandleAlternateForm(species, form, baseStats); - if (species == SPECIES_SHEDINJA) + if (species == SPECIES_SHEDINJA) { newMaxHp = 1; - else - { + } else { newMaxHp = (baseStats->hp * 2 + hpIv + hpEv / 4) * level / 100 + level + 10; } SetMonData(pokemon, MON_DATA_MAXHP, &newMaxHp); @@ -499,48 +464,43 @@ void CalcMonStats(struct Pokemon * pokemon) FreeToHeap(baseStats); - if (hp != 0 || maxHp == 0) - { - if (species == SPECIES_SHEDINJA) + if (hp != 0 || maxHp == 0) { + if (species == SPECIES_SHEDINJA) { hp = 1; - else if (hp == 0) + } else if (hp == 0) { hp = newMaxHp; - else + } else { hp += newMaxHp - maxHp; + } } - if (hp != 0) + if (hp != 0) { SetMonData(pokemon, MON_DATA_HP, &hp); + } ReleaseMonLock(pokemon, decry); } -u32 GetMonData(struct Pokemon * pokemon, int attr, void * dest) -{ +u32 GetMonData(struct Pokemon *pokemon, int attr, void *dest) { u32 ret; u32 checksum; - if (!pokemon->box.party_lock) - { + if (!pokemon->box.party_lock) { DECRYPT_PTY(pokemon); DECRYPT_BOX(&pokemon->box); checksum = CHECKSUM(&pokemon->box); - if (checksum != pokemon->box.checksum) - { + if (checksum != pokemon->box.checksum) { GF_ASSERT(checksum == pokemon->box.checksum); pokemon->box.checksum_fail = TRUE; } } ret = GetMonDataInternal(pokemon, attr, dest); - if (!pokemon->box.party_lock) - { + if (!pokemon->box.party_lock) { ENCRYPT_PTY(pokemon); ENCRYPT_BOX(&pokemon->box); } return ret; } -u32 GetMonDataInternal(struct Pokemon * pokemon, int attr, void * dest) -{ - switch (attr) - { +u32 GetMonDataInternal(struct Pokemon *pokemon, int attr, void *dest) { + switch (attr) { case MON_DATA_STATUS: return pokemon->party.status; case MON_DATA_LEVEL: @@ -572,38 +532,32 @@ u32 GetMonDataInternal(struct Pokemon * pokemon, int attr, void * dest) } } -u32 GetBoxMonData(struct BoxPokemon * boxmon, int attr, void * dest) -{ +u32 GetBoxMonData(struct BoxPokemon *boxmon, int attr, void *dest) { u32 ret; u32 checksum; - if (!boxmon->box_lock) - { + if (!boxmon->box_lock) { DECRYPT_BOX(boxmon); checksum = CHECKSUM(boxmon); - if (checksum != boxmon->checksum) - { + if (checksum != boxmon->checksum) { GF_ASSERT(checksum == boxmon->checksum); boxmon->checksum_fail = TRUE; } } ret = GetBoxMonDataInternal(boxmon, attr, dest); - if (!boxmon->box_lock) - { + if (!boxmon->box_lock) { ENCRYPT_BOX(boxmon); } return ret; } -u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) -{ - u32 ret = 0; - PokemonDataBlockA * blockA = &GetSubstruct(boxmon, boxmon->pid, 0)->blockA; - PokemonDataBlockB * blockB = &GetSubstruct(boxmon, boxmon->pid, 1)->blockB; - PokemonDataBlockC * blockC = &GetSubstruct(boxmon, boxmon->pid, 2)->blockC; - PokemonDataBlockD * blockD = &GetSubstruct(boxmon, boxmon->pid, 3)->blockD; +u32 GetBoxMonDataInternal(struct BoxPokemon *boxmon, int attr, void *dest) { + u32 ret = 0; + PokemonDataBlockA *blockA = &GetSubstruct(boxmon, boxmon->pid, 0)->blockA; + PokemonDataBlockB *blockB = &GetSubstruct(boxmon, boxmon->pid, 1)->blockB; + PokemonDataBlockC *blockC = &GetSubstruct(boxmon, boxmon->pid, 2)->blockC; + PokemonDataBlockD *blockD = &GetSubstruct(boxmon, boxmon->pid, 3)->blockD; - switch (attr) - { + switch (attr) { default: ret = 0; break; @@ -623,29 +577,33 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) ret = boxmon->checksum; break; case MON_DATA_SPECIES_EXISTS: - if (blockA->species != SPECIES_NONE) + if (blockA->species != SPECIES_NONE) { ret = TRUE; - else + } else { ret = FALSE; + } break; case MON_DATA_SANITY_IS_EGG: ret = boxmon->checksum_fail; - if (!ret) + if (!ret) { ret = blockB->isEgg; + } break; case MON_DATA_SPECIES2: ret = blockA->species; - if (ret != SPECIES_NONE && (blockB->isEgg || boxmon->checksum_fail)) + if (ret != SPECIES_NONE && (blockB->isEgg || boxmon->checksum_fail)) { ret = SPECIES_EGG; + } break; case MON_DATA_LEVEL: ret = (u32)CalcLevelBySpeciesAndExp(blockA->species, blockA->exp); break; case MON_DATA_SPECIES: - if (boxmon->checksum_fail) + if (boxmon->checksum_fail) { ret = SPECIES_EGG; - else + } else { ret = blockA->species; + } break; case MON_DATA_HELD_ITEM: ret = blockA->heldItem; @@ -732,18 +690,13 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) case MON_DATA_CARNIVAL_RIBBON: case MON_DATA_CLASSIC_RIBBON: case MON_DATA_PREMIER_RIBBON: - case MON_DATA_SINNOH_RIBBON_53: - { - if (blockA->sinnohRibbons & (1ll << (attr - MON_DATA_SINNOH_CHAMP_RIBBON))) - { + case MON_DATA_SINNOH_RIBBON_53: { + if (blockA->sinnohRibbons & (1ll << (attr - MON_DATA_SINNOH_CHAMP_RIBBON))) { ret = TRUE; - } - else - { + } else { ret = FALSE; } - } - break; + } break; case MON_DATA_MOVE1: case MON_DATA_MOVE2: case MON_DATA_MOVE3: @@ -788,8 +741,9 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) break; case MON_DATA_IS_EGG: ret = boxmon->checksum_fail; - if (!ret) + if (!ret) { ret = blockB->isEgg; + } break; case MON_DATA_HAS_NICKNAME: ret = blockB->isNicknamed; @@ -826,10 +780,11 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) case MON_DATA_HOENN_NATIONAL_RIBBON: case MON_DATA_HOENN_EARTH_RIBBON: case MON_DATA_HOENN_WORLD_RIBBON: - if (blockB->ribbonFlags & (1ll << (attr - MON_DATA_HOENN_COOL_RIBBON))) + if (blockB->ribbonFlags & (1ll << (attr - MON_DATA_HOENN_COOL_RIBBON))) { ret = TRUE; - else + } else { ret = FALSE; + } break; case MON_DATA_FATEFUL_ENCOUNTER: ret = blockB->fatefulEncounter; @@ -847,13 +802,11 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) ret = blockB->Unused; break; case MON_DATA_NICKNAME: - if (boxmon->checksum_fail) + if (boxmon->checksum_fail) { GetSpeciesNameIntoArray(SPECIES_MANAPHY_EGG, HEAP_ID_DEFAULT, dest); - else - { - u16 * dest16 = (u16 *)dest; - for (ret = 0; ret < POKEMON_NAME_LENGTH; ret++) - { + } else { + u16 *dest16 = (u16 *)dest; + for (ret = 0; ret < POKEMON_NAME_LENGTH; ret++) { dest16[ret] = blockC->nickname[ret]; } dest16[ret] = EOS; @@ -863,14 +816,11 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) ret = blockB->isNicknamed; // fallthrough case MON_DATA_NICKNAME_3: - if (boxmon->checksum_fail) - { - struct String * buffer = GetSpeciesName(SPECIES_MANAPHY_EGG, HEAP_ID_DEFAULT); + if (boxmon->checksum_fail) { + struct String *buffer = GetSpeciesName(SPECIES_MANAPHY_EGG, HEAP_ID_DEFAULT); StringCopy(dest, buffer); String_Delete(buffer); - } - else - { + } else { CopyU16ArrayToString(dest, blockC->nickname); } break; @@ -901,19 +851,19 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) case MON_DATA_TOUGH_RIBBON_ULTRA: case MON_DATA_TOUGH_RIBBON_MASTER: case MON_DATA_SINNOH_RIBBON_142: - if (blockC->sinnohRibbons2 & (1ll << (attr - MON_DATA_COOL_RIBBON))) + if (blockC->sinnohRibbons2 & (1ll << (attr - MON_DATA_COOL_RIBBON))) { ret = TRUE; - else + } else { ret = FALSE; + } break; - case MON_DATA_OT_NAME: - { - u16 * dest16 = (u16 *)dest; - for (ret = 0; ret < PLAYER_NAME_LENGTH; ret++) + case MON_DATA_OT_NAME: { + u16 *dest16 = (u16 *)dest; + for (ret = 0; ret < PLAYER_NAME_LENGTH; ret++) { dest16[ret] = blockD->otTrainerName[ret]; + } dest16[ret] = EOS; - } - break; + } break; case MON_DATA_OT_NAME_2: CopyU16ArrayToString(dest, blockD->otTrainerName); break; @@ -960,25 +910,20 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) ret = blockD->HGSS_Pokeball; break; case MON_DATA_IVS_WORD: - ret = (blockB->hpIV) | \ - (blockB->atkIV << 5) | \ - (blockB->defIV << 10) | \ - (blockB->spdIV << 15) | \ - (blockB->spatkIV << 20) | \ - (blockB->spdefIV << 25); + ret = (blockB->hpIV) | (blockB->atkIV << 5) | (blockB->defIV << 10) | (blockB->spdIV << 15) | (blockB->spatkIV << 20) | (blockB->spdefIV << 25); break; case MON_DATA_UNK_175: - if ((blockA->species == SPECIES_NIDORAN_F || blockA->species == SPECIES_NIDORAN_M) && !blockB->isNicknamed) + if ((blockA->species == SPECIES_NIDORAN_F || blockA->species == SPECIES_NIDORAN_M) && !blockB->isNicknamed) { ret = FALSE; - else + } else { ret = TRUE; + } break; case MON_DATA_TYPE_1: case MON_DATA_TYPE_2: - if (blockA->species == SPECIES_ARCEUS && blockA->ability == ABILITY_MULTITYPE) + if (blockA->species == SPECIES_ARCEUS && blockA->ability == ABILITY_MULTITYPE) { ret = (u32)GetArceusTypeByHeldItemEffect((u16)GetItemAttr(blockA->heldItem, 1, HEAP_ID_DEFAULT)); - else - { + } else { ret = (u32)GetMonBaseStat_HandleFormConversion(blockA->species, blockB->alternateForm, (enum BaseStat)(attr - MON_DATA_TYPE_1 + BASE_TYPE1)); } break; @@ -989,16 +934,13 @@ u32 GetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * dest) return ret; } -void SetMonData(struct Pokemon * pokemon, int attr, void * value) -{ +void SetMonData(struct Pokemon *pokemon, int attr, void *value) { u16 checksum; - if (!pokemon->box.party_lock) - { + if (!pokemon->box.party_lock) { DECRYPT_PTY(pokemon); DECRYPT_BOX(&pokemon->box); checksum = CHECKSUM(&pokemon->box); - if (checksum != pokemon->box.checksum) - { + if (checksum != pokemon->box.checksum) { GF_ASSERT(checksum == pokemon->box.checksum); pokemon->box.checksum_fail = TRUE; ENCRYPT_BOX(&pokemon->box); @@ -1006,19 +948,16 @@ void SetMonData(struct Pokemon * pokemon, int attr, void * value) } } SetMonDataInternal(pokemon, attr, value); - if (!pokemon->box.party_lock) - { + if (!pokemon->box.party_lock) { ENCRYPT_PTY(pokemon); pokemon->box.checksum = CHECKSUM(&pokemon->box); ENCRYPT_BOX(&pokemon->box); } } -void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * value) -{ +void SetMonDataInternal(struct Pokemon *pokemon, int attr, void *value) { #define VALUE(type) (*(const type *)value) - switch (attr) - { + switch (attr) { case MON_DATA_STATUS: pokemon->party.status = VALUE(u32); break; @@ -1062,15 +1001,12 @@ void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * value) #undef VALUE } -void SetBoxMonData(struct BoxPokemon * boxmon, int attr, void * value) -{ +void SetBoxMonData(struct BoxPokemon *boxmon, int attr, void *value) { u16 checksum; - if (!boxmon->box_lock) - { + if (!boxmon->box_lock) { DECRYPT_BOX(boxmon); checksum = CHECKSUM(boxmon); - if (checksum != boxmon->checksum) - { + if (checksum != boxmon->checksum) { GF_ASSERT(checksum == boxmon->checksum); boxmon->checksum_fail = TRUE; ENCRYPT_BOX(boxmon); @@ -1078,16 +1014,13 @@ void SetBoxMonData(struct BoxPokemon * boxmon, int attr, void * value) } } SetBoxMonDataInternal(boxmon, attr, value); - if (!boxmon->box_lock) - { + if (!boxmon->box_lock) { boxmon->checksum = CHECKSUM(boxmon); ENCRYPT_BOX(boxmon); } } - -void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) -{ +void SetBoxMonDataInternal(struct BoxPokemon *boxmon, int attr, void *value) { #define VALUE(type) (*(const type *)value) u8 flag; u64 mask; @@ -1095,15 +1028,14 @@ void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) u16 namebuf[POKEMON_NAME_LENGTH + 1]; u16 namebuf2[POKEMON_NAME_LENGTH + 1]; u16 namebuf3[POKEMON_NAME_LENGTH + 1]; - struct String * speciesName; + struct String *speciesName; PokemonDataBlockA *blockA = &GetSubstruct(boxmon, boxmon->pid, 0)->blockA; PokemonDataBlockB *blockB = &GetSubstruct(boxmon, boxmon->pid, 1)->blockB; PokemonDataBlockC *blockC = &GetSubstruct(boxmon, boxmon->pid, 2)->blockC; PokemonDataBlockD *blockD = &GetSubstruct(boxmon, boxmon->pid, 3)->blockD; - switch (attr) - { + switch (attr) { case MON_DATA_PERSONALITY: boxmon->pid = VALUE(u32); break; @@ -1212,10 +1144,11 @@ void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) case MON_DATA_SINNOH_RIBBON_53: flag = VALUE(u8); mask = (u64)flag << (attr - MON_DATA_SINNOH_CHAMP_RIBBON); - if (flag) + if (flag) { blockA->sinnohRibbons |= mask; - else + } else { blockA->sinnohRibbons &= -1ull ^ mask; + } break; case MON_DATA_MOVE1: case MON_DATA_MOVE2: @@ -1293,10 +1226,11 @@ void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) case MON_DATA_HOENN_WORLD_RIBBON: flag = VALUE(u8); mask = (u64)flag << (attr - MON_DATA_HOENN_COOL_RIBBON); - if (flag) + if (flag) { blockB->ribbonFlags |= mask; - else + } else { blockB->ribbonFlags &= -1ull ^ mask; + } break; case MON_DATA_FATEFUL_ENCOUNTER: blockB->fatefulEncounter = VALUE(u8); @@ -1318,9 +1252,9 @@ void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) blockB->isNicknamed = StringNotEqual(namebuf, value); // fallthrough case MON_DATA_NICKNAME: - for (i = 0; i < POKEMON_NAME_LENGTH + 1; i++) - { - blockC->nickname[i] = VALUE(u16); value = (void *const )((char *)value + 2); + for (i = 0; i < POKEMON_NAME_LENGTH + 1; i++) { + blockC->nickname[i] = VALUE(u16); + value = (void *const)((char *)value + 2); } break; case MON_DATA_NICKNAME_4: @@ -1360,15 +1294,16 @@ void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) case MON_DATA_SINNOH_RIBBON_142: flag = VALUE(u8); mask = (u64)flag << (attr - MON_DATA_COOL_RIBBON); - if (flag) + if (flag) { blockC->sinnohRibbons2 |= mask; - else + } else { blockC->sinnohRibbons2 &= -1ull ^ mask; + } break; case MON_DATA_OT_NAME: - for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) - { - blockD->otTrainerName[i] = VALUE(u16); value = (void *)((char *)value + 2); + for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) { + blockD->otTrainerName[i] = VALUE(u16); + value = (void *)((char *)value + 2); } break; case MON_DATA_OT_NAME_2: @@ -1417,8 +1352,8 @@ void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) blockD->HGSS_Pokeball = VALUE(u16); break; case MON_DATA_IVS_WORD: - blockB->hpIV = (VALUE(u32) >> 0) & 0x1F; - blockB->atkIV = (VALUE(u32) >> 5) & 0x1F; + blockB->hpIV = (VALUE(u32) >> 0) & 0x1F; + blockB->atkIV = (VALUE(u32) >> 5) & 0x1F; blockB->defIV = (VALUE(u32) >> 10) & 0x1F; blockB->spdIV = (VALUE(u32) >> 15) & 0x1F; blockB->spatkIV = (VALUE(u32) >> 20) & 0x1F; @@ -1433,41 +1368,36 @@ void SetBoxMonDataInternal(struct BoxPokemon * boxmon, int attr, void * value) #undef VALUE } -void AddMonData(struct Pokemon * pokemon, int attr, int value) -{ +void AddMonData(struct Pokemon *pokemon, int attr, int value) { u16 checksum; - if (!pokemon->box.party_lock) - { + if (!pokemon->box.party_lock) { DECRYPT_PTY(pokemon); DECRYPT_BOX(&pokemon->box); checksum = CHECKSUM(&pokemon->box); - if (checksum != pokemon->box.checksum) - { + if (checksum != pokemon->box.checksum) { GF_ASSERT(checksum == pokemon->box.checksum); ENCRYPT_BOX(&pokemon->box); return; } } AddMonDataInternal(pokemon, attr, value); - if (!pokemon->box.party_lock) - { + if (!pokemon->box.party_lock) { ENCRYPT_PTY(pokemon); pokemon->box.checksum = CHECKSUM(&pokemon->box); ENCRYPT_BOX(&pokemon->box); } } -void AddMonDataInternal(struct Pokemon * pokemon, int attr, int value) -{ +void AddMonDataInternal(struct Pokemon *pokemon, int attr, int value) { s32 maxHp; - switch (attr) - { + switch (attr) { case MON_DATA_HP: maxHp = pokemon->party.maxHp; - if ((s32)(pokemon->party.hp + value) > maxHp) + if ((s32)(pokemon->party.hp + value) > maxHp) { pokemon->party.hp = (u16)maxHp; - else + } else { pokemon->party.hp += value; + } break; case MON_DATA_STATUS: case MON_DATA_LEVEL: @@ -1479,7 +1409,7 @@ void AddMonDataInternal(struct Pokemon * pokemon, int attr, int value) case MON_DATA_SPATK: case MON_DATA_SPDEF: case MON_DATA_MAIL_STRUCT: - // case MON_DATA_SEAL_COORDS: + // case MON_DATA_SEAL_COORDS: GF_ASSERT(0); break; default: @@ -1488,26 +1418,26 @@ void AddMonDataInternal(struct Pokemon * pokemon, int attr, int value) } } -void AddBoxMonData(struct BoxPokemon * boxmon, int attr, int value) -{ +void AddBoxMonData(struct BoxPokemon *boxmon, int attr, int value) { PokemonDataBlockA *blockA = &GetSubstruct(boxmon, boxmon->pid, 0)->blockA; PokemonDataBlockB *blockB = &GetSubstruct(boxmon, boxmon->pid, 1)->blockB; PokemonDataBlockC *blockC = &GetSubstruct(boxmon, boxmon->pid, 2)->blockC; PokemonDataBlockD *blockD = &GetSubstruct(boxmon, boxmon->pid, 3)->blockD; - switch (attr) - { + switch (attr) { case MON_DATA_EXPERIENCE: - if (blockA->exp + value > GetMonExpBySpeciesAndLevel(blockA->species, 100)) + if (blockA->exp + value > GetMonExpBySpeciesAndLevel(blockA->species, 100)) { blockA->exp = GetMonExpBySpeciesAndLevel(blockA->species, 100); - else + } else { blockA->exp += value; + } break; case MON_DATA_FRIENDSHIP: - if (blockA->friendship + value > 255) + if (blockA->friendship + value > 255) { blockA->friendship = 255; - else + } else { blockA->friendship += value; + } break; case MON_DATA_HP_EV: blockA->hpEV += value; @@ -1528,58 +1458,66 @@ void AddBoxMonData(struct BoxPokemon * boxmon, int attr, int value) blockA->spdefEV += value; break; case MON_DATA_COOL: - if (blockA->coolStat + value > 255) + if (blockA->coolStat + value > 255) { blockA->coolStat = 255; - else + } else { blockA->coolStat += value; + } break; case MON_DATA_BEAUTY: - if (blockA->beautyStat + value > 255) + if (blockA->beautyStat + value > 255) { blockA->beautyStat = 255; - else + } else { blockA->beautyStat += value; + } break; case MON_DATA_CUTE: - if (blockA->cuteStat + value > 255) + if (blockA->cuteStat + value > 255) { blockA->cuteStat = 255; - else + } else { blockA->cuteStat += value; + } break; case MON_DATA_SMART: - if (blockA->smartStat + value > 255) + if (blockA->smartStat + value > 255) { blockA->smartStat = 255; - else + } else { blockA->smartStat += value; + } break; case MON_DATA_TOUGH: - if (blockA->toughStat + value > 255) + if (blockA->toughStat + value > 255) { blockA->toughStat = 255; - else + } else { blockA->toughStat += value; + } break; case MON_DATA_SHEEN: - if (blockA->sheen + value > 255) + if (blockA->sheen + value > 255) { blockA->sheen = 255; - else + } else { blockA->sheen += value; + } break; case MON_DATA_MOVE1PP: case MON_DATA_MOVE2PP: case MON_DATA_MOVE3PP: case MON_DATA_MOVE4PP: - if (blockB->movePP[attr - MON_DATA_MOVE1PP] + value > WazaGetMaxPp(blockB->moves[attr - MON_DATA_MOVE1PP], blockB->movePpUps[attr - MON_DATA_MOVE1PP])) + if (blockB->movePP[attr - MON_DATA_MOVE1PP] + value > WazaGetMaxPp(blockB->moves[attr - MON_DATA_MOVE1PP], blockB->movePpUps[attr - MON_DATA_MOVE1PP])) { blockB->movePP[attr - MON_DATA_MOVE1PP] = (u8)WazaGetMaxPp(blockB->moves[attr - MON_DATA_MOVE1PP], blockB->movePpUps[attr - MON_DATA_MOVE1PP]); - else + } else { blockB->movePP[attr - MON_DATA_MOVE1PP] += value; + } break; case MON_DATA_MOVE1PPUP: case MON_DATA_MOVE2PPUP: case MON_DATA_MOVE3PPUP: case MON_DATA_MOVE4PPUP: - if (blockB->movePpUps[attr - MON_DATA_MOVE1PPUP] + value > 3) + if (blockB->movePpUps[attr - MON_DATA_MOVE1PPUP] + value > 3) { blockB->movePpUps[attr - MON_DATA_MOVE1PPUP] = 3; - else + } else { blockB->movePpUps[attr - MON_DATA_MOVE1PPUP] += value; + } break; case MON_DATA_MOVE1MAXPP: case MON_DATA_MOVE2MAXPP: @@ -1587,40 +1525,46 @@ void AddBoxMonData(struct BoxPokemon * boxmon, int attr, int value) case MON_DATA_MOVE4MAXPP: break; case MON_DATA_HP_IV: - if (blockB->hpIV + value > 31) + if (blockB->hpIV + value > 31) { blockB->hpIV = 31; - else + } else { blockB->hpIV += value; + } break; case MON_DATA_ATK_IV: - if (blockB->atkIV + value > 31) + if (blockB->atkIV + value > 31) { blockB->atkIV = 31; - else + } else { blockB->atkIV += value; + } break; case MON_DATA_DEF_IV: - if (blockB->defIV + value > 31) + if (blockB->defIV + value > 31) { blockB->defIV = 31; - else + } else { blockB->defIV += value; + } break; case MON_DATA_SPEED_IV: - if (blockB->spdIV + value > 31) + if (blockB->spdIV + value > 31) { blockB->spdIV = 31; - else + } else { blockB->spdIV += value; + } break; case MON_DATA_SPATK_IV: - if (blockB->spatkIV + value > 31) + if (blockB->spatkIV + value > 31) { blockB->spatkIV = 31; - else + } else { blockB->spatkIV += value; + } break; case MON_DATA_SPDEF_IV: - if (blockB->spdefIV + value > 31) + if (blockB->spdefIV + value > 31) { blockB->spdefIV = 31; - else + } else { blockB->spdefIV += value; + } break; case MON_DATA_PERSONALITY: case MON_DATA_PARTY_LOCK: @@ -1774,19 +1718,16 @@ void AddBoxMonData(struct BoxPokemon * boxmon, int attr, int value) } } -struct BaseStats * AllocAndLoadMonPersonal(int species, HeapID heapId) -{ - struct BaseStats * baseStats = (struct BaseStats *)AllocFromHeap(heapId, sizeof(struct BaseStats)); +struct BaseStats *AllocAndLoadMonPersonal(int species, HeapID heapId) { + struct BaseStats *baseStats = (struct BaseStats *)AllocFromHeap(heapId, sizeof(struct BaseStats)); LoadMonPersonal(species, baseStats); return baseStats; } -int GetPersonalAttr(struct BaseStats * baseStats, enum BaseStat attr) -{ +int GetPersonalAttr(struct BaseStats *baseStats, enum BaseStat attr) { int ret; GF_ASSERT(baseStats != NULL); - switch (attr) - { + switch (attr) { case BASE_HP: ret = baseStats->hp; break; @@ -1890,77 +1831,67 @@ int GetPersonalAttr(struct BaseStats * baseStats, enum BaseStat attr) return ret; } -void FreeMonPersonal(struct BaseStats * personal) -{ +void FreeMonPersonal(struct BaseStats *personal) { GF_ASSERT(personal != NULL); FreeToHeap(personal); } -int GetMonBaseStat_HandleFormConversion(int species, int form, enum BaseStat attr) -{ +int GetMonBaseStat_HandleFormConversion(int species, int form, enum BaseStat attr) { int ret; - struct BaseStats * personal = AllocAndLoadMonPersonal(ResolveMonForm(species, form), HEAP_ID_DEFAULT); - ret = GetPersonalAttr(personal, attr); + struct BaseStats *personal = AllocAndLoadMonPersonal(ResolveMonForm(species, form), HEAP_ID_DEFAULT); + ret = GetPersonalAttr(personal, attr); FreeMonPersonal(personal); return ret; } -int GetMonBaseStat(int species, enum BaseStat attr) -{ +int GetMonBaseStat(int species, enum BaseStat attr) { int ret; - struct BaseStats * personal = AllocAndLoadMonPersonal(species, HEAP_ID_DEFAULT); - ret = GetPersonalAttr(personal, attr); + struct BaseStats *personal = AllocAndLoadMonPersonal(species, HEAP_ID_DEFAULT); + ret = GetPersonalAttr(personal, attr); FreeMonPersonal(personal); return ret; } -u8 GetPercentProgressTowardsNextLevel(struct Pokemon * pokemon) -{ - BOOL decry = AcquireMonLock(pokemon); +u8 GetPercentProgressTowardsNextLevel(struct Pokemon *pokemon) { + BOOL decry = AcquireMonLock(pokemon); u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); - u8 level = (u8)GetMonData(pokemon, MON_DATA_LEVEL, NULL); - u32 lo = GetMonExpBySpeciesAndLevel(species, level); - u32 hi = GetMonExpBySpeciesAndLevel(species, level + 1); - u32 cur = GetMonData(pokemon, MON_DATA_EXPERIENCE, NULL); + u8 level = (u8)GetMonData(pokemon, MON_DATA_LEVEL, NULL); + u32 lo = GetMonExpBySpeciesAndLevel(species, level); + u32 hi = GetMonExpBySpeciesAndLevel(species, level + 1); + u32 cur = GetMonData(pokemon, MON_DATA_EXPERIENCE, NULL); ReleaseMonLock(pokemon, decry); return (u8)(100 * (cur - lo) / (hi - lo)); } -u32 CalcMonExpToNextLevel(struct Pokemon * pokemon) -{ +u32 CalcMonExpToNextLevel(struct Pokemon *pokemon) { return CalcBoxMonExpToNextLevel(&pokemon->box); } -u32 CalcBoxMonExpToNextLevel(struct BoxPokemon * boxmon) -{ +u32 CalcBoxMonExpToNextLevel(struct BoxPokemon *boxmon) { u16 species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); - u16 level = (u16)(CalcBoxMonLevel(boxmon) + 1); - u32 cur = GetBoxMonData(boxmon, MON_DATA_EXPERIENCE, NULL); - u32 hi = GetMonExpBySpeciesAndLevel(species, level); + u16 level = (u16)(CalcBoxMonLevel(boxmon) + 1); + u32 cur = GetBoxMonData(boxmon, MON_DATA_EXPERIENCE, NULL); + u32 hi = GetMonExpBySpeciesAndLevel(species, level); return hi - cur; } -u32 GetMonBaseExperienceAtCurrentLevel(struct Pokemon * pokemon) -{ +u32 GetMonBaseExperienceAtCurrentLevel(struct Pokemon *pokemon) { int species = (int)GetMonData(pokemon, MON_DATA_SPECIES, NULL); - int level = (int)GetMonData(pokemon, MON_DATA_LEVEL, NULL); + int level = (int)GetMonData(pokemon, MON_DATA_LEVEL, NULL); return GetMonExpBySpeciesAndLevel(species, level); } -u32 GetMonExpBySpeciesAndLevel(int species, int level) -{ +u32 GetMonExpBySpeciesAndLevel(int species, int level) { return GetExpByGrowthRateAndLevel(GetMonBaseStat(species, BASE_GROWTH_RATE), level); } -void LoadGrowthTable(int growthRate, u32 * dest) -{ +void LoadGrowthTable(int growthRate, u32 *dest) { GF_ASSERT(growthRate < 8); ReadWholeNarcMemberByIdPair(dest, NARC_POKETOOL_PERSONAL_GROWTBL, growthRate); } -u32 GetExpByGrowthRateAndLevel(int growthRate, int level) -{ - u32 * table; +u32 GetExpByGrowthRateAndLevel(int growthRate, int level) { + u32 *table; u32 ret; GF_ASSERT(growthRate < 8); GF_ASSERT(level <= 101); @@ -1971,71 +1902,63 @@ u32 GetExpByGrowthRateAndLevel(int growthRate, int level) return ret; } -int CalcMonLevel(struct Pokemon * pokemon) -{ +int CalcMonLevel(struct Pokemon *pokemon) { return CalcBoxMonLevel(&pokemon->box); } -int CalcBoxMonLevel(struct BoxPokemon * boxmon) -{ - BOOL decry = AcquireBoxMonLock(boxmon); +int CalcBoxMonLevel(struct BoxPokemon *boxmon) { + BOOL decry = AcquireBoxMonLock(boxmon); int species = (int)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); - int exp = (int)GetBoxMonData(boxmon, MON_DATA_EXPERIENCE, NULL); + int exp = (int)GetBoxMonData(boxmon, MON_DATA_EXPERIENCE, NULL); ReleaseBoxMonLock(boxmon, decry); return CalcLevelBySpeciesAndExp((u16)species, (u32)exp); } -int CalcLevelBySpeciesAndExp(u16 species, u32 exp) -{ +int CalcLevelBySpeciesAndExp(u16 species, u32 exp) { int level; - struct BaseStats * personal = AllocAndLoadMonPersonal(species, HEAP_ID_DEFAULT); - level = CalcLevelBySpeciesAndExp_PreloadedPersonal(personal, species, exp); + struct BaseStats *personal = AllocAndLoadMonPersonal(species, HEAP_ID_DEFAULT); + level = CalcLevelBySpeciesAndExp_PreloadedPersonal(personal, species, exp); FreeMonPersonal(personal); return level; } -int CalcLevelBySpeciesAndExp_PreloadedPersonal(struct BaseStats * personal, u16 species, u32 exp) -{ +int CalcLevelBySpeciesAndExp_PreloadedPersonal(struct BaseStats *personal, u16 species, u32 exp) { #pragma unused(species) static u32 table[101]; int i; LoadGrowthTable(GetPersonalAttr(personal, BASE_GROWTH_RATE), table); - for (i = 1; i < 101; i++) - { - if (table[i] > exp) + for (i = 1; i < 101; i++) { + if (table[i] > exp) { break; + } } return i - 1; } -u8 GetMonNature(struct Pokemon * pokemon) -{ +u8 GetMonNature(struct Pokemon *pokemon) { return GetBoxMonNature(&pokemon->box); } -u8 GetBoxMonNature(struct BoxPokemon * boxmon) -{ - BOOL decry = AcquireBoxMonLock(boxmon); +u8 GetBoxMonNature(struct BoxPokemon *boxmon) { + BOOL decry = AcquireBoxMonLock(boxmon); u32 personality = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); ReleaseBoxMonLock(boxmon, decry); return GetNatureFromPersonality(personality); } -u8 GetNatureFromPersonality(u32 pid) -{ +u8 GetNatureFromPersonality(u32 pid) { return (u8)(pid % 25); } -u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex) -{ +u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex) { u16 retVal; // Dont modify HP, Accuracy, or Evasion by nature - if (statIndex < 1 || statIndex > 5) + if (statIndex < 1 || statIndex > 5) { return n; + } - switch (sNatureStatMods[nature][statIndex - 1]) - { + switch (sNatureStatMods[nature][statIndex - 1]) { case 1: retVal = (u16)((u16)(n * 110) / 100); // NOTE: will overflow for n > 595 because the intermediate value is cast to u16 before the division. Fix by removing (u16) cast break; @@ -2049,71 +1972,74 @@ u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex) return retVal; } -void MonApplyFriendshipMod(struct Pokemon * pokemon, u32 kind, u32 location) -{ +void MonApplyFriendshipMod(struct Pokemon *pokemon, u32 kind, u32 location) { u16 species; u8 effect; u8 r4; s16 friendship; s8 mod; - if (kind == 5 && (LCRandom() & 1)) + if (kind == 5 && (LCRandom() & 1)) { return; + } species = (u16)GetMonData(pokemon, MON_DATA_SPECIES2, NULL); - if (species == SPECIES_NONE || species == SPECIES_EGG) + if (species == SPECIES_NONE || species == SPECIES_EGG) { return; + } - effect = (u8)GetItemAttr((u16)GetMonData(pokemon, MON_DATA_HELD_ITEM, NULL), 1, HEAP_ID_DEFAULT); - r4 = 0; + effect = (u8)GetItemAttr((u16)GetMonData(pokemon, MON_DATA_HELD_ITEM, NULL), 1, HEAP_ID_DEFAULT); + r4 = 0; friendship = (s16)GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL); - if (friendship >= 100) + if (friendship >= 100) { r4++; - if (friendship >= 200) + } + if (friendship >= 200) { r4++; + } mod = sFriendshipModTable[kind][r4]; - if (mod > 0 && GetMonData(pokemon, MON_DATA_POKEBALL, NULL) == ITEM_LUXURY_BALL) + if (mod > 0 && GetMonData(pokemon, MON_DATA_POKEBALL, NULL) == ITEM_LUXURY_BALL) { mod++; - if (mod > 0 && GetMonData(pokemon, MON_DATA_EGG_MET_LOCATION, NULL) == location) + } + if (mod > 0 && GetMonData(pokemon, MON_DATA_EGG_MET_LOCATION, NULL) == location) { mod++; - if (mod > 0 && effect == 52) // Soothe Bell effect? + } + if (mod > 0 && effect == 52) { // Soothe Bell effect? mod = (s8)(mod * 150 / 100); + } friendship += mod; - if (friendship < 0) + if (friendship < 0) { friendship = 0; - if (friendship > 255) + } + if (friendship > 255) { friendship = 255; + } SetMonData(pokemon, MON_DATA_FRIENDSHIP, &friendship); } -u8 GetMonGender(struct Pokemon * pokemon) -{ +u8 GetMonGender(struct Pokemon *pokemon) { return GetBoxMonGender(&pokemon->box); } -u8 GetBoxMonGender(struct BoxPokemon * boxmon) -{ - BOOL decry = AcquireBoxMonLock(boxmon); - u16 species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); +u8 GetBoxMonGender(struct BoxPokemon *boxmon) { + BOOL decry = AcquireBoxMonLock(boxmon); + u16 species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); u32 personality = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); ReleaseBoxMonLock(boxmon, decry); return GetGenderBySpeciesAndPersonality(species, personality); } -u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid) -{ - struct BaseStats * personal = AllocAndLoadMonPersonal(species, HEAP_ID_DEFAULT); - u8 gender = GetGenderBySpeciesAndPersonality_PreloadedPersonal(personal, species, pid); +u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid) { + struct BaseStats *personal = AllocAndLoadMonPersonal(species, HEAP_ID_DEFAULT); + u8 gender = GetGenderBySpeciesAndPersonality_PreloadedPersonal(personal, species, pid); FreeMonPersonal(personal); return gender; } -u8 GetGenderBySpeciesAndPersonality_PreloadedPersonal(struct BaseStats * personal, u16 species, u32 pid) -{ +u8 GetGenderBySpeciesAndPersonality_PreloadedPersonal(struct BaseStats *personal, u16 species, u32 pid) { #pragma unused(species) u8 ratio = (u8)GetPersonalAttr(personal, BASE_GENDER_RATIO); - switch (ratio) - { + switch (ratio) { case MON_RATIO_MALE: return MON_MALE; case MON_RATIO_FEMALE: @@ -2121,49 +2047,43 @@ u8 GetGenderBySpeciesAndPersonality_PreloadedPersonal(struct BaseStats * persona case MON_RATIO_UNKNOWN: return MON_GENDERLESS; default: - if (ratio > (u8)pid) + if (ratio > (u8)pid) { return MON_FEMALE; - else + } else { return MON_MALE; + } } } -u8 MonIsShiny(struct Pokemon * pokemon) -{ +u8 MonIsShiny(struct Pokemon *pokemon) { return BoxMonIsShiny(&pokemon->box); } -u8 BoxMonIsShiny(struct BoxPokemon * boxmon) -{ +u8 BoxMonIsShiny(struct BoxPokemon *boxmon) { u32 otid = GetBoxMonData(boxmon, MON_DATA_OTID, NULL); - u32 pid = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); + u32 pid = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); return CalcShininessByOtIdAndPersonality(otid, pid); } -u8 CalcShininessByOtIdAndPersonality(u32 otid, u32 pid) -{ +u8 CalcShininessByOtIdAndPersonality(u32 otid, u32 pid) { return SHINY_CHECK(otid, pid); } -u32 GenerateShinyPersonality(u32 otid) -{ +u32 GenerateShinyPersonality(u32 otid) { int r4; u16 r6; u16 r5; otid = (u32)((((otid & 0xFFFF0000) >> 16) ^ (otid & 0xFFFF)) >> 3u); - r6 = (u16)(LCRandom() & 7); - r5 = (u16)(LCRandom() & 7); - for (r4 = 0; r4 < 13; r4++) - { - if (MaskOfFlagNo(r4) & otid) - { - if (LCRandom() & 1) + r6 = (u16)(LCRandom() & 7); + r5 = (u16)(LCRandom() & 7); + for (r4 = 0; r4 < 13; r4++) { + if (MaskOfFlagNo(r4) & otid) { + if (LCRandom() & 1) { r6 |= MaskOfFlagNo(r4 + 3); - else + } else { r5 |= MaskOfFlagNo(r4 + 3); - } - else if (LCRandom() & 1) - { + } + } else if (LCRandom() & 1) { r6 |= MaskOfFlagNo(r4 + 3); r5 |= MaskOfFlagNo(r4 + 3); } @@ -2171,105 +2091,111 @@ u32 GenerateShinyPersonality(u32 otid) return (u32)((r5 << 16) | r6); } -void sub_02068B68(struct SomeDrawPokemonStruct * spC, struct Pokemon * pokemon, u8 sp10) -{ +void sub_02068B68(struct SomeDrawPokemonStruct *spC, struct Pokemon *pokemon, u8 sp10) { sub_02068B70(spC, &pokemon->box, sp10); } -void sub_02068B70(struct SomeDrawPokemonStruct * spC, struct BoxPokemon * boxmon, u8 sp10) -{ - BOOL decry = AcquireBoxMonLock(boxmon); - u16 species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES2, NULL); - u8 gender = GetBoxMonGender(boxmon); - u8 shiny = BoxMonIsShiny(boxmon); +void sub_02068B70(struct SomeDrawPokemonStruct *spC, struct BoxPokemon *boxmon, u8 sp10) { + BOOL decry = AcquireBoxMonLock(boxmon); + u16 species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES2, NULL); + u8 gender = GetBoxMonGender(boxmon); + u8 shiny = BoxMonIsShiny(boxmon); u32 personality = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); u8 form; - if (species == SPECIES_EGG) - { - if (GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL) == SPECIES_MANAPHY) + if (species == SPECIES_EGG) { + if (GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL) == SPECIES_MANAPHY) { form = 1; - else + } else { form = 0; - } - else + } + } else { form = (u8)GetBoxMonData(boxmon, MON_DATA_FORM, NULL); + } sub_02068C00(spC, species, gender, sp10, shiny, form, personality); ReleaseBoxMonLock(boxmon, decry); } -void sub_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 sp10, u8 shiny, u8 form, u32 personality) -{ +void sub_02068C00(struct SomeDrawPokemonStruct *spC, int species, u8 gender, u8 sp10, u8 shiny, u8 form, u32 personality) { spC->unk6 = 0; spC->unk8 = 0; spC->unkC = 0; - switch (species) - { + switch (species) { case SPECIES_BURMY: - if (form > 2) + if (form > 2) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 / 2 + 0x48 + form * 2); spC->unk4 = (u16)(shiny + 0x92 + form * 2); break; case SPECIES_WORMADAM: - if (form > 2) + if (form > 2) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 / 2 + 0x4E + form * 2); spC->unk4 = (u16)(shiny + 0x98 + form * 2); break; case SPECIES_SHELLOS: - if (form > 1) + if (form > 1) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 + 0x54 + form); spC->unk4 = (u16)(shiny + 0x9E + form * 2); break; case SPECIES_GASTRODON: - if (form > 1) + if (form > 1) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 + 0x58 + form); spC->unk4 = (u16)(shiny + 0xA2 + form * 2); break; case SPECIES_CHERRIM: - if (form > 1) + if (form > 1) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 + 0x5C + form); spC->unk4 = (u16)(shiny * 2 + 0xA6 + form); break; case SPECIES_ARCEUS: - if (form > 17) + if (form > 17) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 / 2 + 0x60 + form * 2); spC->unk4 = (u16)(shiny + 0xAA + form * 2); break; case SPECIES_CASTFORM: - if (form > 3) + if (form > 3) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 * 2 + 0x40 + form); spC->unk4 = (u16)(shiny * 4 + 0x8A + form); break; case SPECIES_DEOXYS: - if (form > 3) + if (form > 3) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 / 2 + form * 2); spC->unk4 = (u16)(shiny + 0x86); break; case SPECIES_UNOWN: - if (form >= 28) + if (form >= 28) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(sp10 / 2 + 0x8 + form * 2); spC->unk4 = (u16)(shiny + 0x88); break; case SPECIES_EGG: - if (form > 1) + if (form > 1) { form = 0; + } spC->unk0 = NARC_POKETOOL_POKEGRA_OTHERPOKE; spC->unk2 = (u16)(0x84 + form); spC->unk4 = (u16)(0xCE + form); @@ -2283,8 +2209,7 @@ void sub_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 spC->unk0 = 0x4; spC->unk2 = (u16)(species * 6 + sp10 + (gender == MON_FEMALE ? 0 : 1)); spC->unk4 = (u16)(shiny + (species * 6 + 4)); - if (species == SPECIES_SPINDA && sp10 == 2) - { + if (species == SPECIES_SPINDA && sp10 == 2) { spC->unk6 = SPECIES_SPINDA; spC->unk8 = 0; spC->unkC = personality; @@ -2293,103 +2218,109 @@ void sub_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 } } -u8 sub_02068E14(struct Pokemon * pokemon, u32 a1) -{ +u8 sub_02068E14(struct Pokemon *pokemon, u32 a1) { return sub_02068E1C(&pokemon->box, a1); } -u8 sub_02068E1C(struct BoxPokemon * boxmon, u32 a1) -{ +u8 sub_02068E1C(struct BoxPokemon *boxmon, u32 a1) { u16 species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES2, NULL); - u8 gender = GetBoxMonGender(boxmon); - u32 pid = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); + u8 gender = GetBoxMonGender(boxmon); + u32 pid = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); u8 form; - if (species == SPECIES_EGG) - { - if (GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL) == SPECIES_MANAPHY) + if (species == SPECIES_EGG) { + if (GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL) == SPECIES_MANAPHY) { form = 1; - else + } else { form = 0; - } - else + } + } else { form = (u8)GetBoxMonData(boxmon, MON_DATA_FORM, NULL); + } return sub_02068E88(species, gender, a1, form, pid); } -u8 sub_02068E88(int species, u8 gender, u32 a1, u8 form, u32 pid) -{ +u8 sub_02068E88(int species, u8 gender, u32 a1, u8 form, u32 pid) { #pragma unused(pid) u8 ret; s32 fileId; enum NarcId narc; - switch (species) - { + switch (species) { case SPECIES_BURMY: - if (form > 2) + if (form > 2) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 / 2 + 0x48 + form * 2); break; case SPECIES_WORMADAM: - if (form > 2) + if (form > 2) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 / 2 + 0x4E + form * 2); break; case SPECIES_SHELLOS: - if (form > 1) + if (form > 1) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 + 0x54 + form); break; case SPECIES_GASTRODON: - if (form > 1) + if (form > 1) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 + 0x58 + form); break; case SPECIES_CHERRIM: - if (form > 1) + if (form > 1) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 + 0x5C + form); break; case SPECIES_ARCEUS: - if (form > 17) + if (form > 17) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 / 2 + 0x60 + 2 * form); break; case SPECIES_CASTFORM: - if (form > 3) + if (form > 3) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 * 2 + 0x40 + form); break; case SPECIES_DEOXYS: - if (form > 3) + if (form > 3) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 / 2 + form * 2); break; case SPECIES_UNOWN: - if (form >= 28) + if (form >= 28) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(a1 / 2 + 0x8 + form * 2); break; case SPECIES_EGG: - if (form > 1) + if (form > 1) { form = 0; - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + } + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = (s32)(0x84 + form); break; case SPECIES_MANAPHY_EGG: - narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; + narc = NARC_POKETOOL_POKEGRA_HEIGHT_O; fileId = 0x84; break; default: - narc = NARC_POKETOOL_POKEGRA_HEIGHT; + narc = NARC_POKETOOL_POKEGRA_HEIGHT; fileId = (s32)(4 * species + a1 + (gender != MON_FEMALE ? 1 : 0)); break; } @@ -2397,14 +2328,12 @@ u8 sub_02068E88(int species, u8 gender, u32 a1, u8 form, u32 pid) return ret; } -void sub_02068FE0(struct SomeDrawPokemonStruct * a0, u16 a1, int a2) -{ - if (a2 == 2) +void sub_02068FE0(struct SomeDrawPokemonStruct *a0, u16 a1, int a2) { + if (a2 == 2) { a0->unk0 = NARC_POKETOOL_TRGRA_TRFGRA; - else - { + } else { a0->unk0 = NARC_POKETOOL_TRGRA_TRBGRA; - a1 = (u16)sub_0206AA30(a1); + a1 = (u16)sub_0206AA30(a1); } a0->unk2 = (u16)(a1 * 2); a0->unk4 = (u16)(a1 * 2 + 1); @@ -2413,25 +2342,20 @@ void sub_02068FE0(struct SomeDrawPokemonStruct * a0, u16 a1, int a2) a0->unkC = 0; } -void sub_02069010(void * dest, int a1) -{ +void sub_02069010(void *dest, int a1) { struct Pokeanm buffer; ReadFromNarcMemberByIdPair(&buffer, NARC_POKETOOL_POKEANM_POKEANM, 0, (u32)(28 * a1), 28); MI_CpuCopy8(buffer.unk8, dest, 20); } -void sub_02069038(u32 a0, u32 a1, u32 a2, s32 a3, u32 a4, u32 a5, u32 a6) -{ +void sub_02069038(u32 a0, u32 a1, u32 a2, s32 a3, u32 a4, u32 a5, u32 a6) { struct UnkStruct_02069038 sp4; ReadFromNarcMemberByIdPair(&sp4.anim, NARC_POKETOOL_POKEANM_POKEANM, 0, (u32)(a2 * 28), 28); - if (a3 == 2) - { + if (a3 == 2) { sp4.unk0 = sp4.anim.unk0[0].unk0; sp4.unk2 = sp4.anim.unk0[0].unk1; sp4.unk4 = (u8)a5; - } - else - { + } else { a3 = sub_02014C3C((u8)a4); GF_ASSERT(a3 < 3); sp4.unk0 = sp4.anim.unk0[a3 + 1].unk0; @@ -2441,8 +2365,7 @@ void sub_02069038(u32 a0, u32 a1, u32 a2, s32 a3, u32 a4, u32 a5, u32 a6) sub_02014C54((int)a0, (int)a1, &sp4, (u8)a6); } -void sub_020690AC(struct SomeDrawPokemonStruct * a0, u32 a1) -{ +void sub_020690AC(struct SomeDrawPokemonStruct *a0, u32 a1) { a0->unk0 = NARC_POKETOOL_TRGRA_TRFGRA; a0->unk2 = (u16)(a1 * 2); a0->unk4 = (u16)(a1 * 2 + 1); @@ -2451,55 +2374,48 @@ void sub_020690AC(struct SomeDrawPokemonStruct * a0, u32 a1) a0->unkC = 0; } -u32 sub_020690C4(void) -{ +u32 sub_020690C4(void) { return sizeof(struct Pokemon); } -u32 sub_020690C8(void) -{ +u32 sub_020690C8(void) { return sizeof(struct BoxPokemon); } -u8 GetMonUnownLetter(struct Pokemon * pokemon) //not just used for unown +u8 GetMonUnownLetter(struct Pokemon *pokemon) // not just used for unown { return GetBoxMonUnownLetter(&pokemon->box); } -u8 GetBoxMonUnownLetter(struct BoxPokemon * boxmon) -{ +u8 GetBoxMonUnownLetter(struct BoxPokemon *boxmon) { return (u8)GetBoxMonData(boxmon, MON_DATA_FORM, NULL); } -struct BoxPokemon * sub_020690E4(struct Pokemon * pokemon) -{ +struct BoxPokemon *sub_020690E4(struct Pokemon *pokemon) { return &pokemon->box; } -BOOL sub_020690E8(struct Pokemon * pokemon) -{ - u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); - u8 level = (u8)(GetMonData(pokemon, MON_DATA_LEVEL, NULL) + 1); - u32 exp = GetMonData(pokemon, MON_DATA_EXPERIENCE, NULL); +BOOL sub_020690E8(struct Pokemon *pokemon) { + u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); + u8 level = (u8)(GetMonData(pokemon, MON_DATA_LEVEL, NULL) + 1); + u32 exp = GetMonData(pokemon, MON_DATA_EXPERIENCE, NULL); u32 growthrate = (u32)GetMonBaseStat(species, BASE_GROWTH_RATE); - u32 maxexp = GetExpByGrowthRateAndLevel((int)growthrate, 100); - if (exp > maxexp) - { + u32 maxexp = GetExpByGrowthRateAndLevel((int)growthrate, 100); + if (exp > maxexp) { exp = maxexp; SetMonData(pokemon, MON_DATA_EXPERIENCE, &exp); } - if (level > 100) + if (level > 100) { return FALSE; - if (exp >= GetExpByGrowthRateAndLevel((int)growthrate, level)) - { + } + if (exp >= GetExpByGrowthRateAndLevel((int)growthrate, level)) { SetMonData(pokemon, MON_DATA_LEVEL, &level); return TRUE; } return FALSE; } -u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret) -{ +u16 GetMonEvolution(struct Party *party, struct Pokemon *pokemon, u32 context, u32 usedItem, u32 *method_ret) { u16 target = SPECIES_NONE; u32 sp40; u16 species; @@ -2510,57 +2426,52 @@ u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, u8 level; u16 friendship; u16 pid_hi; - struct Evolution * evoTable; + struct Evolution *evoTable; u8 r1; - species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); - heldItem = (u16)GetMonData(pokemon, MON_DATA_HELD_ITEM, NULL); + species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); + heldItem = (u16)GetMonData(pokemon, MON_DATA_HELD_ITEM, NULL); personality = GetMonData(pokemon, MON_DATA_PERSONALITY, NULL); - beauty = (u8)GetMonData(pokemon, MON_DATA_BEAUTY, NULL); - pid_hi = (u16)((personality & 0xFFFF0000) >> 16); - r1 = (u8)GetItemAttr(heldItem, 1, HEAP_ID_DEFAULT); - if (species != SPECIES_KADABRA && r1 == HOLD_EFFECT_NO_EVOLVE && context != 3) + beauty = (u8)GetMonData(pokemon, MON_DATA_BEAUTY, NULL); + pid_hi = (u16)((personality & 0xFFFF0000) >> 16); + r1 = (u8)GetItemAttr(heldItem, 1, HEAP_ID_DEFAULT); + if (species != SPECIES_KADABRA && r1 == HOLD_EFFECT_NO_EVOLVE && context != 3) { return SPECIES_NONE; - if (method_ret == NULL) + } + if (method_ret == NULL) { method_ret = &sp40; + } evoTable = AllocFromHeap(HEAP_ID_DEFAULT, 7 * sizeof(struct Evolution)); LoadMonEvolutionTable(species, evoTable); - switch (context) - { + switch (context) { case 0: - level = (u8)GetMonData(pokemon, MON_DATA_LEVEL, NULL); + level = (u8)GetMonData(pokemon, MON_DATA_LEVEL, NULL); friendship = (u16)GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL); - for (i = 0; i < 7; i++) - { - switch (evoTable[i].method) - { + for (i = 0; i < 7; i++) { + switch (evoTable[i].method) { case EVO_NONE: break; case EVO_FRIENDSHIP: - if (friendship >= 220) - { - target = evoTable[i].target; + if (friendship >= 220) { + target = evoTable[i].target; *method_ret = EVO_FRIENDSHIP; } break; case EVO_FRIENDSHIP_DAY: - if (IsNighttime() == 0 && friendship >= 220) - { - target = evoTable[i].target; + if (IsNighttime() == 0 && friendship >= 220) { + target = evoTable[i].target; *method_ret = EVO_FRIENDSHIP_DAY; } break; case EVO_FRIENDSHIP_NIGHT: - if (IsNighttime() == 1 && friendship >= 220) - { - target = evoTable[i].target; + if (IsNighttime() == 1 && friendship >= 220) { + target = evoTable[i].target; *method_ret = EVO_FRIENDSHIP_NIGHT; } break; case EVO_LEVEL: - if (evoTable[i].param <= level) - { - target = evoTable[i].target; + if (evoTable[i].param <= level) { + target = evoTable[i].target; *method_ret = EVO_LEVEL; } break; @@ -2571,44 +2482,38 @@ u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, case EVO_STONE: break; case EVO_LEVEL_ATK_GT_DEF: - if (evoTable[i].param <= level && GetMonData(pokemon, MON_DATA_ATK, NULL) > GetMonData(pokemon, MON_DATA_DEF, NULL)) - { - target = evoTable[i].target; + if (evoTable[i].param <= level && GetMonData(pokemon, MON_DATA_ATK, NULL) > GetMonData(pokemon, MON_DATA_DEF, NULL)) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_ATK_GT_DEF; } break; case EVO_LEVEL_ATK_EQ_DEF: - if (evoTable[i].param <= level && GetMonData(pokemon, MON_DATA_ATK, NULL) == GetMonData(pokemon, MON_DATA_DEF, NULL)) - { - target = evoTable[i].target; + if (evoTable[i].param <= level && GetMonData(pokemon, MON_DATA_ATK, NULL) == GetMonData(pokemon, MON_DATA_DEF, NULL)) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_ATK_EQ_DEF; } break; case EVO_LEVEL_ATK_LT_DEF: - if (evoTable[i].param <= level && GetMonData(pokemon, MON_DATA_ATK, NULL) < GetMonData(pokemon, MON_DATA_DEF, NULL)) - { - target = evoTable[i].target; + if (evoTable[i].param <= level && GetMonData(pokemon, MON_DATA_ATK, NULL) < GetMonData(pokemon, MON_DATA_DEF, NULL)) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_ATK_LT_DEF; } break; case EVO_LEVEL_PID_LO: - if (evoTable[i].param <= level && pid_hi % 10 < 5) - { - target = evoTable[i].target; + if (evoTable[i].param <= level && pid_hi % 10 < 5) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_PID_LO; } break; case EVO_LEVEL_PID_HI: - if (evoTable[i].param <= level && pid_hi % 10 >= 5) - { - target = evoTable[i].target; + if (evoTable[i].param <= level && pid_hi % 10 >= 5) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_PID_HI; } break; case EVO_LEVEL_NINJASK: - if (evoTable[i].param <= level) - { - target = evoTable[i].target; + if (evoTable[i].param <= level) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_NINJASK; } break; @@ -2616,9 +2521,8 @@ u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, *method_ret = EVO_LEVEL_SHEDINJA; break; case EVO_BEAUTY: - if (evoTable[i].param <= beauty) - { - target = evoTable[i].target; + if (evoTable[i].param <= beauty) { + target = evoTable[i].target; *method_ret = EVO_BEAUTY; } break; @@ -2627,113 +2531,99 @@ u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, case EVO_STONE_FEMALE: break; case EVO_ITEM_DAY: - if (IsNighttime() == 0 && evoTable[i].param == heldItem) - { - target = evoTable[i].target; + if (IsNighttime() == 0 && evoTable[i].param == heldItem) { + target = evoTable[i].target; *method_ret = EVO_ITEM_DAY; } break; case EVO_ITEM_NIGHT: - if (IsNighttime() == 1 && evoTable[i].param == heldItem) - { - target = evoTable[i].target; + if (IsNighttime() == 1 && evoTable[i].param == heldItem) { + target = evoTable[i].target; *method_ret = EVO_ITEM_NIGHT; } break; case EVO_HAS_MOVE: - if (MonHasMove(pokemon, evoTable[i].param) == TRUE) - { - target = evoTable[i].target; + if (MonHasMove(pokemon, evoTable[i].param) == TRUE) { + target = evoTable[i].target; *method_ret = EVO_HAS_MOVE; } break; case EVO_OTHER_PARTY_MON: - if (party != NULL && Party_HasMon(party, evoTable[i].param) == 1) - { - target = evoTable[i].target; + if (party != NULL && Party_HasMon(party, evoTable[i].param) == 1) { + target = evoTable[i].target; *method_ret = EVO_OTHER_PARTY_MON; } break; case EVO_LEVEL_MALE: - if (GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_MALE && evoTable[i].param <= level) - { - target = evoTable[i].target; + if (GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_MALE && evoTable[i].param <= level) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_MALE; } break; case EVO_LEVEL_FEMALE: - if (GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_FEMALE && evoTable[i].param <= level) - { - target = evoTable[i].target; + if (GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_FEMALE && evoTable[i].param <= level) { + target = evoTable[i].target; *method_ret = EVO_LEVEL_FEMALE; } break; case EVO_CORONET: - if (usedItem == evoTable[i].method) - { - target = evoTable[i].target; + if (usedItem == evoTable[i].method) { + target = evoTable[i].target; *method_ret = EVO_CORONET; } break; case EVO_ETERNA: - if (usedItem == evoTable[i].method) - { - target = evoTable[i].target; + if (usedItem == evoTable[i].method) { + target = evoTable[i].target; *method_ret = EVO_ETERNA; } break; case EVO_ROUTE217: - if (usedItem == evoTable[i].method) - { - target = evoTable[i].target; + if (usedItem == evoTable[i].method) { + target = evoTable[i].target; *method_ret = EVO_ROUTE217; } break; } - if (target != SPECIES_NONE) + if (target != SPECIES_NONE) { break; + } } break; case 1: - for (i = 0; i < 7; i++) - { - switch (evoTable[i].method) - { + for (i = 0; i < 7; i++) { + switch (evoTable[i].method) { case EVO_TRADE: - target = evoTable[i].target; + target = evoTable[i].target; *method_ret = EVO_TRADE; break; case EVO_TRADE_ITEM: - if (heldItem == evoTable[i].param) - { - target = evoTable[i].target; + if (heldItem == evoTable[i].param) { + target = evoTable[i].target; *method_ret = EVO_TRADE_ITEM; } break; } - if (target != SPECIES_NONE) + if (target != SPECIES_NONE) { break; + } } break; case 2: case 3: - for (i = 0; i < 7; i++) - { - if (evoTable[i].method == EVO_STONE && usedItem == evoTable[i].param) - { - target = evoTable[i].target; + for (i = 0; i < 7; i++) { + if (evoTable[i].method == EVO_STONE && usedItem == evoTable[i].param) { + target = evoTable[i].target; *method_ret = 0; break; } - if (evoTable[i].method == EVO_STONE_MALE && GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_MALE && usedItem == evoTable[i].param) - { - target = evoTable[i].target; + if (evoTable[i].method == EVO_STONE_MALE && GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_MALE && usedItem == evoTable[i].param) { + target = evoTable[i].target; *method_ret = 0; break; } - if (evoTable[i].method == EVO_STONE_FEMALE && GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_FEMALE && usedItem == evoTable[i].param) - { - target = evoTable[i].target; + if (evoTable[i].method == EVO_STONE_FEMALE && GetMonData(pokemon, MON_DATA_GENDER, NULL) == MON_FEMALE && usedItem == evoTable[i].param) { + target = evoTable[i].target; *method_ret = 0; break; } @@ -2744,25 +2634,22 @@ u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, return target; } -u16 ReadFromPersonalPmsNarc(u16 species) -{ +u16 ReadFromPersonalPmsNarc(u16 species) { u16 ret = SPECIES_NONE; GF_ASSERT(species < SPECIES_EGG); { - FSFile file; - FS_InitFile(&file); - FS_OpenFile(&file, "poketool/personal/pms.narc"); - FS_SeekFile(&file, (s32)(species * sizeof(u16)), FS_SEEK_SET); - FS_ReadFile(&file, &ret, sizeof(u16)); - FS_CloseFile(&file); + FSFile file; + FS_InitFile(&file); + FS_OpenFile(&file, "poketool/personal/pms.narc"); + FS_SeekFile(&file, (s32)(species * sizeof(u16)), FS_SEEK_SET); + FS_ReadFile(&file, &ret, sizeof(u16)); + FS_CloseFile(&file); } return ret; } -u16 GetEggSpecies(u16 species) -{ - switch (species) - { +u16 GetEggSpecies(u16 species) { + switch (species) { case SPECIES_SUDOWOODO: case SPECIES_MARILL: case SPECIES_MR_MIME: @@ -2778,8 +2665,7 @@ u16 GetEggSpecies(u16 species) } } -void InitBoxMonMoveset(struct BoxPokemon * boxmon) -{ +void InitBoxMonMoveset(struct BoxPokemon *boxmon) { BOOL decry; u16 *levelUpLearnset; int i; @@ -2788,45 +2674,41 @@ void InitBoxMonMoveset(struct BoxPokemon * boxmon) u8 level; u16 move; levelUpLearnset = AllocFromHeap(HEAP_ID_DEFAULT, MAX_LEARNED_MOVES * sizeof(u16)); - decry = AcquireBoxMonLock(boxmon); - species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); - form = GetBoxMonData(boxmon, MON_DATA_FORM, NULL); - level = (u8)CalcBoxMonLevel(boxmon); + decry = AcquireBoxMonLock(boxmon); + species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); + form = GetBoxMonData(boxmon, MON_DATA_FORM, NULL); + level = (u8)CalcBoxMonLevel(boxmon); LoadLevelUpLearnset_HandleAlternateForm(species, (int)form, levelUpLearnset); - for (i = 0; levelUpLearnset[i] != LEVEL_UP_LEARNSET_END; i++) - { - if ((levelUpLearnset[i] & LEVEL_UP_LEARNSET_LEVEL_MASK) > (level << LEVEL_UP_LEARNSET_LEVEL_SHIFT)) + for (i = 0; levelUpLearnset[i] != LEVEL_UP_LEARNSET_END; i++) { + if ((levelUpLearnset[i] & LEVEL_UP_LEARNSET_LEVEL_MASK) > (level << LEVEL_UP_LEARNSET_LEVEL_SHIFT)) { break; + } move = LEVEL_UP_LEARNSET_MOVE(levelUpLearnset[i]); - if (sub_020696A8(boxmon, move) == 0xFFFF) + if (sub_020696A8(boxmon, move) == 0xFFFF) { sub_02069718(boxmon, move); + } } FreeToHeap(levelUpLearnset); ReleaseBoxMonLock(boxmon, decry); } -u32 sub_02069698(struct Pokemon * pokemon, u16 move) -{ +u32 sub_02069698(struct Pokemon *pokemon, u16 move) { return sub_020696A8(sub_020690E4(pokemon), move); } -u32 sub_020696A8(struct BoxPokemon * boxmon, u16 move) -{ +u32 sub_020696A8(struct BoxPokemon *boxmon, u16 move) { u32 ret = 0xFFFF; int i; BOOL decry = AcquireBoxMonLock(boxmon); u16 cur_move; - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { cur_move = (u16)GetBoxMonData(boxmon, MON_DATA_MOVE1 + i, NULL); - if (cur_move == MOVE_NONE) - { + if (cur_move == MOVE_NONE) { BoxMonSetMoveInSlot(boxmon, move, (u8)i); ret = move; break; } - if (cur_move == move) - { + if (cur_move == move) { ret = 0xFFFE; break; } @@ -2835,32 +2717,28 @@ u32 sub_020696A8(struct BoxPokemon * boxmon, u16 move) return ret; } -void sub_02069708(struct Pokemon * pokemon, u16 move) -{ +void sub_02069708(struct Pokemon *pokemon, u16 move) { sub_02069718(sub_020690E4(pokemon), move); } -void sub_02069718(struct BoxPokemon * boxmon, u16 move) -{ +void sub_02069718(struct BoxPokemon *boxmon, u16 move) { BOOL decry = AcquireBoxMonLock(boxmon); int i; u16 moves[4]; u8 pp[4]; u8 ppUp[4]; - for (i = 0; i < 3; i++) - { + for (i = 0; i < 3; i++) { moves[i] = (u16)GetBoxMonData(boxmon, MON_DATA_MOVE1 + i + 1, NULL); - pp[i] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PP + i + 1, NULL); - ppUp[i] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + i + 1, NULL); + pp[i] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PP + i + 1, NULL); + ppUp[i] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + i + 1, NULL); } moves[3] = move; - pp[3] = (u8)GetWazaAttr(move, MOVEATTR_PP); - ppUp[3] = 0; + pp[3] = (u8)GetWazaAttr(move, MOVEATTR_PP); + ppUp[3] = 0; - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { SetBoxMonData(boxmon, MON_DATA_MOVE1 + i, &moves[i]); SetBoxMonData(boxmon, MON_DATA_MOVE1PP + i, &pp[i]); SetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + i, &ppUp[i]); @@ -2869,48 +2747,40 @@ void sub_02069718(struct BoxPokemon * boxmon, u16 move) ReleaseBoxMonLock(boxmon, decry); } -void MonSetMoveInSlot(struct Pokemon * pokemon, u16 move, u8 slot) -{ +void MonSetMoveInSlot(struct Pokemon *pokemon, u16 move, u8 slot) { BoxMonSetMoveInSlot(&pokemon->box, move, slot); } -void BoxMonSetMoveInSlot(struct BoxPokemon * boxmon, u16 move, u8 slot) -{ +void BoxMonSetMoveInSlot(struct BoxPokemon *boxmon, u16 move, u8 slot) { u8 ppUp; u8 pp; SetBoxMonData(boxmon, MON_DATA_MOVE1 + slot, &move); ppUp = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + slot, NULL); - pp = (u8)WazaGetMaxPp(move, ppUp); + pp = (u8)WazaGetMaxPp(move, ppUp); SetBoxMonData(boxmon, MON_DATA_MOVE1PP + slot, &pp); } -u32 sub_02069818(struct Pokemon * pokemon, u32 * r5, u16 * sp0) -{ - u32 ret = 0; +u32 sub_02069818(struct Pokemon *pokemon, u32 *r5, u16 *sp0) { + u32 ret = 0; u16 *levelUpLearnset = AllocFromHeap(HEAP_ID_DEFAULT, MAX_LEARNED_MOVES * sizeof(u16)); - u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); - u32 form = GetMonData(pokemon, MON_DATA_FORM, NULL); - u8 level = (u8)GetMonData(pokemon, MON_DATA_LEVEL, NULL); + u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); + u32 form = GetMonData(pokemon, MON_DATA_FORM, NULL); + u8 level = (u8)GetMonData(pokemon, MON_DATA_LEVEL, NULL); LoadLevelUpLearnset_HandleAlternateForm(species, (int)form, levelUpLearnset); - - if (levelUpLearnset[*r5] == 0xFFFF) - { + if (levelUpLearnset[*r5] == 0xFFFF) { FreeToHeap(levelUpLearnset); return 0; } - while ((levelUpLearnset[*r5] & LEVEL_UP_LEARNSET_LEVEL_MASK) != (level << LEVEL_UP_LEARNSET_LEVEL_SHIFT)) - { + while ((levelUpLearnset[*r5] & LEVEL_UP_LEARNSET_LEVEL_MASK) != (level << LEVEL_UP_LEARNSET_LEVEL_SHIFT)) { (*r5)++; - if (levelUpLearnset[*r5] == 0xFFFF) - { + if (levelUpLearnset[*r5] == 0xFFFF) { FreeToHeap(levelUpLearnset); return 0; } } - if ((levelUpLearnset[*r5] & LEVEL_UP_LEARNSET_LEVEL_MASK) == (level << LEVEL_UP_LEARNSET_LEVEL_SHIFT)) - { + if ((levelUpLearnset[*r5] & LEVEL_UP_LEARNSET_LEVEL_MASK) == (level << LEVEL_UP_LEARNSET_LEVEL_SHIFT)) { *sp0 = LEVEL_UP_LEARNSET_MOVE(levelUpLearnset[*r5]); (*r5)++; ret = sub_02069698(pokemon, *sp0); @@ -2919,23 +2789,21 @@ u32 sub_02069818(struct Pokemon * pokemon, u32 * r5, u16 * sp0) return ret; } -void sub_020698E0(struct Pokemon * pokemon, int slot1, int slot2) -{ +void sub_020698E0(struct Pokemon *pokemon, int slot1, int slot2) { sub_020698E8(&pokemon->box, slot1, slot2); } -void sub_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2) -{ +void sub_020698E8(struct BoxPokemon *boxmon, int slot1, int slot2) { u16 moves[2]; u8 pp[2]; u8 ppUp[2]; moves[0] = (u16)GetBoxMonData(boxmon, MON_DATA_MOVE1 + slot1, NULL); - pp[0] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PP + slot1, NULL); - ppUp[0] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + slot1, NULL); + pp[0] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PP + slot1, NULL); + ppUp[0] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + slot1, NULL); moves[1] = (u16)GetBoxMonData(boxmon, MON_DATA_MOVE1 + slot2, NULL); - pp[1] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PP + slot2, NULL); - ppUp[1] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + slot2, NULL); + pp[1] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PP + slot2, NULL); + ppUp[1] = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + slot2, NULL); SetBoxMonData(boxmon, MON_DATA_MOVE1 + slot1, &moves[1]); SetBoxMonData(boxmon, MON_DATA_MOVE1PP + slot1, &pp[1]); @@ -2945,50 +2813,48 @@ void sub_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2) SetBoxMonData(boxmon, MON_DATA_MOVE1PPUP + slot2, &ppUp[0]); } -void sub_020699A4(struct Pokemon * pokemon, u32 slot) -{ +void sub_020699A4(struct Pokemon *pokemon, u32 slot) { u16 move; u8 pp; u8 ppUp; - for (; slot < 3; slot++) - { + for (; slot < 3; slot++) { move = (u16)GetMonData(pokemon, (int)(MON_DATA_MOVE1 + slot + 1), NULL); - pp = (u8)GetMonData(pokemon, (int)(MON_DATA_MOVE1PP + slot + 1), NULL); + pp = (u8)GetMonData(pokemon, (int)(MON_DATA_MOVE1PP + slot + 1), NULL); ppUp = (u8)GetMonData(pokemon, (int)(MON_DATA_MOVE1PPUP + slot + 1), NULL); SetMonData(pokemon, (int)(MON_DATA_MOVE1 + slot), &move); SetMonData(pokemon, (int)(MON_DATA_MOVE1PP + slot), &pp); SetMonData(pokemon, (int)(MON_DATA_MOVE1PPUP + slot), &ppUp); } move = MOVE_NONE; - pp = 0; + pp = 0; ppUp = 0; SetMonData(pokemon, MON_DATA_MOVE1 + 3, &move); SetMonData(pokemon, MON_DATA_MOVE1PP + 3, &pp); SetMonData(pokemon, MON_DATA_MOVE1PPUP + 3, &ppUp); } -BOOL MonHasMove(struct Pokemon * pokemon, u16 move) -{ +BOOL MonHasMove(struct Pokemon *pokemon, u16 move) { int i; - for (i = 0; i < 4; i++) - { - if (GetMonData(pokemon, MON_DATA_MOVE1 + i, NULL) == move) + for (i = 0; i < 4; i++) { + if (GetMonData(pokemon, MON_DATA_MOVE1 + i, NULL) == move) { break; + } } - if (i != 4) + if (i != 4) { return TRUE; - else + } else { return FALSE; + } } -void CopyBoxPokemonToPokemon(struct BoxPokemon * src, struct Pokemon * dest) -{ +void CopyBoxPokemonToPokemon(struct BoxPokemon *src, struct Pokemon *dest) { u32 sp0 = 0; CapsuleArray sp4; - struct Mail * mail; + struct Mail *mail; dest->box = *src; - if (dest->box.box_lock) + if (dest->box.box_lock) { dest->box.party_lock = TRUE; + } SetMonData(dest, MON_DATA_STATUS, &sp0); SetMonData(dest, MON_DATA_HP, &sp0); SetMonData(dest, MON_DATA_MAXHP, &sp0); @@ -3001,109 +2867,94 @@ void CopyBoxPokemonToPokemon(struct BoxPokemon * src, struct Pokemon * dest) CalcMonLevelAndStats(dest); } -u8 Party_GetMaxLevel(struct Party * party) -{ +u8 Party_GetMaxLevel(struct Party *party) { int i; int r7 = Party_GetCount(party); u8 ret = 1; u8 level; - for (i = 0; i < r7; i++) - { - struct Pokemon * pokemon = Party_GetMonByIndex(party, i); + for (i = 0; i < r7; i++) { + struct Pokemon *pokemon = Party_GetMonByIndex(party, i); if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_NONE - && !GetMonData(pokemon, MON_DATA_IS_EGG, NULL)) - { + && !GetMonData(pokemon, MON_DATA_IS_EGG, NULL)) { level = (u8)GetMonData(pokemon, MON_DATA_LEVEL, NULL); - if (level > ret) + if (level > ret) { ret = level; + } } } return ret; } -u16 SpeciesToSinnohDexNo(u16 species) -{ +u16 SpeciesToSinnohDexNo(u16 species) { u16 ret; ReadFromNarcMemberByIdPair(&ret, NARC_POKETOOL_POKEZUKAN, 0, species * sizeof(u16), sizeof(u16)); return ret; } -u16 SinnohDexNoToSpecies(u16 sinnoh_dex) -{ +u16 SinnohDexNoToSpecies(u16 sinnoh_dex) { u16 ret = SPECIES_NONE; - if (sinnoh_dex <= SINNOH_DEX_COUNT) + if (sinnoh_dex <= SINNOH_DEX_COUNT) { ReadFromNarcMemberByIdPair(&ret, NARC_POKETOOL_SHINZUKAN, 0, sinnoh_dex * sizeof(u16), sizeof(u16)); + } return ret; } -void CopyPokemonToPokemon(struct Pokemon * src, struct Pokemon * dest) -{ +void CopyPokemonToPokemon(struct Pokemon *src, struct Pokemon *dest) { *dest = *src; } -void CopyPokemonToBoxPokemon(struct Pokemon * src, struct BoxPokemon * dest) -{ +void CopyPokemonToBoxPokemon(struct Pokemon *src, struct BoxPokemon *dest) { *dest = src->box; } -void CopyBoxPokemonToBoxPokemon(struct BoxPokemon * src, struct BoxPokemon * dest) -{ +void CopyBoxPokemonToBoxPokemon(struct BoxPokemon *src, struct BoxPokemon *dest) { *dest = *src; } -s8 MonGetFlavorPreference(struct Pokemon * pokemon, int flavor) -{ +s8 MonGetFlavorPreference(struct Pokemon *pokemon, int flavor) { return BoxMonGetFlavorPreference(&pokemon->box, flavor); } -s8 BoxMonGetFlavorPreference(struct BoxPokemon * boxmon, int flavor) -{ +s8 BoxMonGetFlavorPreference(struct BoxPokemon *boxmon, int flavor) { u32 personality = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); return GetFlavorPreferenceFromPID(personality, flavor); } -s8 GetFlavorPreferenceFromPID(u32 personality, int flavor) -{ +s8 GetFlavorPreferenceFromPID(u32 personality, int flavor) { return sFlavorPreferencesByNature[GetNatureFromPersonality(personality)][flavor]; } -int Species_LoadLearnsetTable(u16 species, u32 form, u16 * dest) -{ +int Species_LoadLearnsetTable(u16 species, u32 form, u16 *dest) { int i; - u16 * levelUpLearnset = AllocFromHeap(HEAP_ID_DEFAULT, MAX_LEARNED_MOVES * sizeof(u16)); + u16 *levelUpLearnset = AllocFromHeap(HEAP_ID_DEFAULT, MAX_LEARNED_MOVES * sizeof(u16)); LoadLevelUpLearnset_HandleAlternateForm(species, (int)form, levelUpLearnset); - for (i = 0; levelUpLearnset[i] != LEVEL_UP_LEARNSET_END; i++) - { + for (i = 0; levelUpLearnset[i] != LEVEL_UP_LEARNSET_END; i++) { dest[i] = LEVEL_UP_LEARNSET_MOVE(levelUpLearnset[i]); } FreeToHeap(levelUpLearnset); return i; } -void Party_GivePokerusAtRandom(struct Party * party) -{ +void Party_GivePokerusAtRandom(struct Party *party) { int count = Party_GetCount(party); int idx; - struct Pokemon * pokemon; + struct Pokemon *pokemon; u8 sp0; - switch (LCRandom()) - { + switch (LCRandom()) { case 0x4000: case 0x8000: case 0xC000: - do - { - idx = LCRandom() % count; + do { + idx = LCRandom() % count; pokemon = Party_GetMonByIndex(party, idx); } while (GetMonData(pokemon, MON_DATA_SPECIES, NULL) == SPECIES_NONE || GetMonData(pokemon, MON_DATA_IS_EGG, NULL)); - if (!Party_MaskMonsWithPokerus(party, (u8)MaskOfFlagNo(idx))) - { - do - { + if (!Party_MaskMonsWithPokerus(party, (u8)MaskOfFlagNo(idx))) { + do { sp0 = (u8)LCRandom(); } while (!(sp0 & 7)); - if (sp0 & 0xF0) + if (sp0 & 0xF0) { sp0 &= 7; + } sp0 |= sp0 << 4; sp0 &= 0xF3; sp0++; @@ -3112,90 +2963,76 @@ void Party_GivePokerusAtRandom(struct Party * party) } } -u8 Party_MaskMonsWithPokerus(struct Party * party, u8 mask) -{ - int i = 0; +u8 Party_MaskMonsWithPokerus(struct Party *party, u8 mask) { + int i = 0; u32 flag = 1; - u8 ret = 0; - struct Pokemon * pokemon; - if (mask != 0) - { - do - { - if (mask & 1) - { + u8 ret = 0; + struct Pokemon *pokemon; + if (mask != 0) { + do { + if (mask & 1) { pokemon = Party_GetMonByIndex(party, i); - if (GetMonData(pokemon, MON_DATA_POKERUS, NULL)) + if (GetMonData(pokemon, MON_DATA_POKERUS, NULL)) { ret |= flag; + } } i++; flag <<= 1; mask >>= 1; - } - while (mask != 0); - } - else - { + } while (mask != 0); + } else { pokemon = Party_GetMonByIndex(party, 0); - if (GetMonData(pokemon, MON_DATA_POKERUS, NULL)) + if (GetMonData(pokemon, MON_DATA_POKERUS, NULL)) { ret++; + } } return ret; } -void Party_UpdatePokerus(struct Party * party, int r5) -{ +void Party_UpdatePokerus(struct Party *party, int r5) { int i; u8 pokerus; - struct Pokemon * pokemon; + struct Pokemon *pokemon; int count = Party_GetCount(party); - for (i = 0; i < count; i++) - { + for (i = 0; i < count; i++) { pokemon = Party_GetMonByIndex(party, i); - if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_NONE) - { + if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_NONE) { pokerus = (u8)GetMonData(pokemon, MON_DATA_POKERUS, NULL); - if (pokerus & 0xF) - { - if ((pokerus & 0xF) < r5 || r5 > 4) + if (pokerus & 0xF) { + if ((pokerus & 0xF) < r5 || r5 > 4) { pokerus &= 0xF0; - else + } else { pokerus -= r5; - if (pokerus == 0) + } + if (pokerus == 0) { pokerus = 0x10; // immune + } SetMonData(pokemon, MON_DATA_POKERUS, &pokerus); } } } } -void Party_SpreadPokerus(struct Party * party) -{ +void Party_SpreadPokerus(struct Party *party) { int count = Party_GetCount(party); int i; - struct Pokemon * pokemon; + struct Pokemon *pokemon; u8 pokerus; - if ((LCRandom() % 3) == 0) - { - for (i = 0; i < count; i++) - { + if ((LCRandom() % 3) == 0) { + for (i = 0; i < count; i++) { pokemon = Party_GetMonByIndex(party, i); - if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_NONE) - { + if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_NONE) { pokerus = (u8)GetMonData(pokemon, MON_DATA_POKERUS, NULL); - if (pokerus & 0xF) - { - if (i != 0) - { + if (pokerus & 0xF) { + if (i != 0) { pokemon = Party_GetMonByIndex(party, i - 1); - if (!(GetMonData(pokemon, MON_DATA_POKERUS, NULL) & 0xF0)) + if (!(GetMonData(pokemon, MON_DATA_POKERUS, NULL) & 0xF0)) { SetMonData(pokemon, MON_DATA_POKERUS, &pokerus); + } } - if (i < count - 1) - { + if (i < count - 1) { pokemon = Party_GetMonByIndex(party, i + 1); - if (!(GetMonData(pokemon, MON_DATA_POKERUS, NULL) & 0xF0)) - { + if (!(GetMonData(pokemon, MON_DATA_POKERUS, NULL) & 0xF0)) { SetMonData(pokemon, MON_DATA_POKERUS, &pokerus); i++; // don't infect the rest of the party } @@ -3206,53 +3043,46 @@ void Party_SpreadPokerus(struct Party * party) } } -BOOL Pokemon_HasPokerus(struct Pokemon * pokemon) -{ +BOOL Pokemon_HasPokerus(struct Pokemon *pokemon) { return BoxMon_HasPokerus(&pokemon->box); } -BOOL BoxMon_HasPokerus(struct BoxPokemon * boxmon) -{ +BOOL BoxMon_HasPokerus(struct BoxPokemon *boxmon) { return !!(GetBoxMonData(boxmon, MON_DATA_POKERUS, NULL) & 0xF); } -BOOL Pokemon_IsImmuneToPokerus(struct Pokemon * pokemon) -{ +BOOL Pokemon_IsImmuneToPokerus(struct Pokemon *pokemon) { return BoxMon_IsImmuneToPokerus(&pokemon->box); } -BOOL BoxMon_IsImmuneToPokerus(struct BoxPokemon * boxmon) -{ +BOOL BoxMon_IsImmuneToPokerus(struct BoxPokemon *boxmon) { u8 pokerus = (u8)GetBoxMonData(boxmon, MON_DATA_POKERUS, NULL); - if (pokerus & 0xF) + if (pokerus & 0xF) { return FALSE; - if (pokerus & 0xF0) + } + if (pokerus & 0xF0) { return TRUE; + } return FALSE; } -void Pokemon_UpdateArceusForm(struct Pokemon * pokemon) -{ +void Pokemon_UpdateArceusForm(struct Pokemon *pokemon) { BoxMon_UpdateArceusForm(&pokemon->box); } -void BoxMon_UpdateArceusForm(struct BoxPokemon * boxmon) -{ - u32 species = GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); - u32 ability = GetBoxMonData(boxmon, MON_DATA_ABILITY, NULL); +void BoxMon_UpdateArceusForm(struct BoxPokemon *boxmon) { + u32 species = GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); + u32 ability = GetBoxMonData(boxmon, MON_DATA_ABILITY, NULL); u32 heldItem = GetBoxMonData(boxmon, MON_DATA_HELD_ITEM, NULL); u32 form; - if (species == SPECIES_ARCEUS && ability == ABILITY_MULTITYPE) - { + if (species == SPECIES_ARCEUS && ability == ABILITY_MULTITYPE) { form = GetArceusTypeByHeldItemEffect((u16)GetItemAttr((u16)heldItem, 1, HEAP_ID_DEFAULT)); SetBoxMonData(boxmon, MON_DATA_FORM, &form); } } -u32 GetArceusTypeByHeldItemEffect(u16 heldEffect) -{ - switch (heldEffect) - { +u32 GetArceusTypeByHeldItemEffect(u16 heldEffect) { + switch (heldEffect) { case HOLD_EFFECT_ARCEUS_FIRE: return TYPE_FIRE; case HOLD_EFFECT_ARCEUS_WATER: @@ -3290,39 +3120,30 @@ u32 GetArceusTypeByHeldItemEffect(u16 heldEffect) } } -void LoadLevelUpLearnset_HandleAlternateForm(int species, int form, u16 *levelUpLearnset) -{ +void LoadLevelUpLearnset_HandleAlternateForm(int species, int form, u16 *levelUpLearnset) { ReadWholeNarcMemberByIdPair(levelUpLearnset, NARC_POKETOOL_PERSONAL_WOTBL, ResolveMonForm(species, form)); } -void sub_02069FB0(struct SaveChatotSoundClip *r7, u32 r5, u16 r4, s32 r6, s32 sp18, u32 sp1C, HeapID heapId) -{ - if (r4 == SPECIES_CHATOT) - { - if (!sub_02005F14((int)r5)) - { +void sub_02069FB0(struct SaveChatotSoundClip *r7, u32 r5, u16 r4, s32 r6, s32 sp18, u32 sp1C, HeapID heapId) { + if (r4 == SPECIES_CHATOT) { + if (!sub_02005F14((int)r5)) { sub_02005E80(1); sub_020056AC(r5, r4, r6, sp18, heapId); - } - else - { - if (sp1C) + } else { + if (sp1C) { sub_02005E80(1); + } sub_02005E90(r7, 0, sp18, r6); } - } - else - { + } else { sub_020056AC(r5, r4, r6, sp18, heapId); } } -void sub_0206A014(struct Pokemon * pokemon, PlayerProfile * a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId) -{ +void sub_0206A014(struct Pokemon *pokemon, PlayerProfile *a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId) { u32 hp; sub_0206A054(&pokemon->box, a1, pokeball, a3, encounterType, heapId); - if (pokeball == ITEM_HEAL_BALL) - { + if (pokeball == ITEM_HEAL_BALL) { hp = GetMonData(pokemon, MON_DATA_MAXHP, NULL); SetMonData(pokemon, MON_DATA_HP, &hp); hp = 0; @@ -3330,41 +3151,32 @@ void sub_0206A014(struct Pokemon * pokemon, PlayerProfile * a1, u32 pokeball, u3 } } -void sub_0206A054(struct BoxPokemon * boxmon, PlayerProfile * a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId) -{ +void sub_0206A054(struct BoxPokemon *boxmon, PlayerProfile *a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId) { sub_020808AC(boxmon, a1, 0, a3, heapId); SetBoxMonData(boxmon, MON_DATA_GAME_VERSION, (void *)&gGameVersion); SetBoxMonData(boxmon, MON_DATA_POKEBALL, &pokeball); SetBoxMonData(boxmon, MON_DATA_ENCOUNTER_TYPE, &encounterType); } -void sub_0206A094(struct Pokemon * pokemon, u32 a1, u32 a2) -{ +void sub_0206A094(struct Pokemon *pokemon, u32 a1, u32 a2) { u32 chance; u16 species; u16 form; u16 item1; u16 item2; if (!(a1 & 0x81)) { - chance = (u32)(LCRandom() % 100); + chance = (u32)(LCRandom() % 100); species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, 0); - form = (u16)GetMonData(pokemon, MON_DATA_FORM, 0); - item1 = (u16)GetMonBaseStat_HandleFormConversion(species, form, BASE_ITEM_1); - item2 = (u16)GetMonBaseStat_HandleFormConversion(species, form, BASE_ITEM_2); - if (item1 == item2 && item1 != ITEM_NONE) - { + form = (u16)GetMonData(pokemon, MON_DATA_FORM, 0); + item1 = (u16)GetMonBaseStat_HandleFormConversion(species, form, BASE_ITEM_1); + item2 = (u16)GetMonBaseStat_HandleFormConversion(species, form, BASE_ITEM_2); + if (item1 == item2 && item1 != ITEM_NONE) { SetMonData(pokemon, MON_DATA_HELD_ITEM, &item1); - } - else - { - if (chance >= sItemOdds[a2][0]) - { - if (chance < sItemOdds[a2][1]) - { + } else { + if (chance >= sItemOdds[a2][0]) { + if (chance < sItemOdds[a2][1]) { SetMonData(pokemon, MON_DATA_HELD_ITEM, &item1); - } - else - { + } else { SetMonData(pokemon, MON_DATA_HELD_ITEM, &item2); } } @@ -3372,91 +3184,79 @@ void sub_0206A094(struct Pokemon * pokemon, u32 a1, u32 a2) } } -BOOL sub_0206A13C(struct Pokemon * pokemon, u32 a1) -{ +BOOL sub_0206A13C(struct Pokemon *pokemon, u32 a1) { return sub_0206A144(&pokemon->box, a1); } -BOOL sub_0206A144(struct BoxPokemon * boxmon, u32 a1) -{ +BOOL sub_0206A144(struct BoxPokemon *boxmon, u32 a1) { u16 species = (u16)GetBoxMonData(boxmon, MON_DATA_SPECIES2, NULL); - int form = (int)GetBoxMonData(boxmon, MON_DATA_FORM, NULL); + int form = (int)GetBoxMonData(boxmon, MON_DATA_FORM, NULL); return sub_0206A16C(species, form, a1); } -BOOL sub_0206A16C(u16 species, int form, u32 a2) -{ +BOOL sub_0206A16C(u16 species, int form, u32 a2) { u32 r4; enum BaseStat r2; - if (species == SPECIES_EGG) + if (species == SPECIES_EGG) { return FALSE; - if (a2 < 32) - { + } + if (a2 < 32) { r4 = 1ul << a2; r2 = BASE_TMHM_1; - } - else if (a2 < 64) - { + } else if (a2 < 64) { r4 = 1ul << (a2 - 32); r2 = BASE_TMHM_2; - } - else if (a2 < 96) - { + } else if (a2 < 96) { r4 = 1ul << (a2 - 64); r2 = BASE_TMHM_3; - } - else - { + } else { r4 = 1ul << (a2 - 96); r2 = BASE_TMHM_4; } return !!(GetMonBaseStat_HandleFormConversion(species, form, r2) & r4); } -void sub_0206A1C4(struct Pokemon * pokemon) -{ +void sub_0206A1C4(struct Pokemon *pokemon) { sub_0206A1CC(&pokemon->box); } -void sub_0206A1CC(struct BoxPokemon * boxmon) -{ - BOOL decry = AcquireBoxMonLock(boxmon); - int species = (int)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); - int pid = (int)GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); +void sub_0206A1CC(struct BoxPokemon *boxmon) { + BOOL decry = AcquireBoxMonLock(boxmon); + int species = (int)GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); + int pid = (int)GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL); int ability1 = (int)GetMonBaseStat(species, BASE_ABILITY_1); int ability2 = (int)GetMonBaseStat(species, BASE_ABILITY_2); - if (ability2 != ABILITY_NONE) - { - if (pid & 1) + if (ability2 != ABILITY_NONE) { + if (pid & 1) { SetBoxMonData(boxmon, MON_DATA_ABILITY, &ability2); - else + } else { SetBoxMonData(boxmon, MON_DATA_ABILITY, &ability1); - } - else + } + } else { SetBoxMonData(boxmon, MON_DATA_ABILITY, &ability1); + } ReleaseBoxMonLock(boxmon, decry); } -void sub_0206A23C(struct Pokemon * r5, u32 personality) -{ - PokemonDataBlockA * r4; - PokemonDataBlockB * r6; - PokemonDataBlockC * r7; - PokemonDataBlockD * sp8; - PokemonDataBlockA * spC; - PokemonDataBlockB * sp10; - PokemonDataBlockC * sp14; - PokemonDataBlockD * sp18; - struct Pokemon * sp4; +void sub_0206A23C(struct Pokemon *r5, u32 personality) { + PokemonDataBlockA *r4; + PokemonDataBlockB *r6; + PokemonDataBlockC *r7; + PokemonDataBlockD *sp8; + PokemonDataBlockA *spC; + PokemonDataBlockB *sp10; + PokemonDataBlockC *sp14; + PokemonDataBlockD *sp18; + struct Pokemon *sp4; sp4 = AllocMonZeroed(HEAP_ID_DEFAULT); CopyPokemonToPokemon(r5, sp4); - r4 = &GetSubstruct(&sp4->box, r5->box.pid, 0)->blockA; - r6 = &GetSubstruct(&sp4->box, r5->box.pid, 1)->blockB; - r7 = &GetSubstruct(&sp4->box, r5->box.pid, 2)->blockC; - sp8 = &GetSubstruct(&sp4->box, r5->box.pid, 3)->blockD; - spC = &GetSubstruct(&r5->box, personality, 0)->blockA; + r4 = &GetSubstruct(&sp4->box, r5->box.pid, 0)->blockA; + r6 = &GetSubstruct(&sp4->box, r5->box.pid, 1)->blockB; + r7 = &GetSubstruct(&sp4->box, r5->box.pid, 2)->blockC; + sp8 = &GetSubstruct(&sp4->box, r5->box.pid, 3)->blockD; + spC = &GetSubstruct(&r5->box, personality, 0)->blockA; sp10 = &GetSubstruct(&r5->box, personality, 1)->blockB; sp14 = &GetSubstruct(&r5->box, personality, 2)->blockC; sp18 = &GetSubstruct(&r5->box, personality, 3)->blockD; @@ -3464,235 +3264,219 @@ void sub_0206A23C(struct Pokemon * r5, u32 personality) DECRYPT_BOX(&sp4->box); DECRYPT_PTY(r5); DECRYPT_BOX(&r5->box); - r5->box.pid = personality; - *spC = *r4; - *sp10 = *r6; - *sp14 = *r7; - *sp18 = *sp8; + r5->box.pid = personality; + *spC = *r4; + *sp10 = *r6; + *sp14 = *r7; + *sp18 = *sp8; r5->box.checksum = CHECKSUM(&r5->box); ENCRYPT_BOX(&r5->box); ENCRYPT_PTY(r5); FreeToHeap(sp4); } -void LoadMonPersonal(int species, struct BaseStats * personal) -{ +void LoadMonPersonal(int species, struct BaseStats *personal) { ReadWholeNarcMemberByIdPair(personal, NARC_POKETOOL_PERSONAL_PERSONAL, species); } -void LoadMonBaseStats_HandleAlternateForm(int species, int form, struct BaseStats * personal) -{ +void LoadMonBaseStats_HandleAlternateForm(int species, int form, struct BaseStats *personal) { ReadWholeNarcMemberByIdPair(personal, NARC_POKETOOL_PERSONAL_PERSONAL, ResolveMonForm(species, form)); } -void LoadMonEvolutionTable(u16 species, struct Evolution * evo) -{ +void LoadMonEvolutionTable(u16 species, struct Evolution *evo) { ReadWholeNarcMemberByIdPair(evo, NARC_POKETOOL_PERSONAL_EVO, species); } - -void MonEncryptSegment(u16 * data, u32 size, u32 seed) { +void MonEncryptSegment(u16 *data, u32 size, u32 seed) { int i; - for (i = 0; i < size / 2; i++) - { + for (i = 0; i < size / 2; i++) { data[i] ^= MonEncryptionLCRNG(&seed); } } -void MonDecryptSegment(u16 * data, u32 size, u32 seed) { +void MonDecryptSegment(u16 *data, u32 size, u32 seed) { MonEncryptSegment(data, size, seed); } -u16 MonEncryptionLCRNG(u32 * seed) -{ +u16 MonEncryptionLCRNG(u32 *seed) { *seed = *seed * 1103515245 + 24691; return (u16)(*seed >> 16); } -u16 CalcMonChecksum(u16 * data, u32 size) -{ +u16 CalcMonChecksum(u16 *data, u32 size) { int i; u16 ret = 0; - for (i = 0; i < size / 2; i++) - { + for (i = 0; i < size / 2; i++) { ret += data[i]; } return ret; } -#define SUBSTRUCT_CASE(v1, v2, v3, v4) \ -{ \ - PokemonDataBlock *substructs = boxMon->substructs; \ - switch (substructType) \ - { \ - case 0: \ - result = &substructs[v1]; \ - break; \ - case 1: \ - result = &substructs[v2]; \ - break; \ - case 2: \ - result = &substructs[v3]; \ - break; \ - case 3: \ - result = &substructs[v4]; \ - break; \ - } \ - \ - break; \ -} - -PokemonDataBlock *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType) -{ +#define SUBSTRUCT_CASE(v1, v2, v3, v4) \ + { \ + PokemonDataBlock *substructs = boxMon->substructs; \ + switch (substructType) { \ + case 0: \ + result = &substructs[v1]; \ + break; \ + case 1: \ + result = &substructs[v2]; \ + break; \ + case 2: \ + result = &substructs[v3]; \ + break; \ + case 3: \ + result = &substructs[v4]; \ + break; \ + } \ + \ + break; \ + } + +PokemonDataBlock *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType) { PokemonDataBlock *result; - switch ((personality & 0x3E000) >> 13) - { - case 0: + switch ((personality & 0x3E000) >> 13) { + case 0: case 24: - SUBSTRUCT_CASE(0,1,2,3) - case 1: + SUBSTRUCT_CASE(0, 1, 2, 3) + case 1: case 25: - SUBSTRUCT_CASE(0,1,3,2) - case 2: + SUBSTRUCT_CASE(0, 1, 3, 2) + case 2: case 26: - SUBSTRUCT_CASE(0,2,1,3) - case 3: + SUBSTRUCT_CASE(0, 2, 1, 3) + case 3: case 27: - SUBSTRUCT_CASE(0,3,1,2) - case 4: + SUBSTRUCT_CASE(0, 3, 1, 2) + case 4: case 28: - SUBSTRUCT_CASE(0,2,3,1) - case 5: + SUBSTRUCT_CASE(0, 2, 3, 1) + case 5: case 29: - SUBSTRUCT_CASE(0,3,2,1) - case 6: + SUBSTRUCT_CASE(0, 3, 2, 1) + case 6: case 30: - SUBSTRUCT_CASE(1,0,2,3) - case 7: + SUBSTRUCT_CASE(1, 0, 2, 3) + case 7: case 31: - SUBSTRUCT_CASE(1,0,3,2) - case 8: - SUBSTRUCT_CASE(2,0,1,3) - case 9: - SUBSTRUCT_CASE(3,0,1,2) + SUBSTRUCT_CASE(1, 0, 3, 2) + case 8: + SUBSTRUCT_CASE(2, 0, 1, 3) + case 9: + SUBSTRUCT_CASE(3, 0, 1, 2) case 10: - SUBSTRUCT_CASE(2,0,3,1) + SUBSTRUCT_CASE(2, 0, 3, 1) case 11: - SUBSTRUCT_CASE(3,0,2,1) + SUBSTRUCT_CASE(3, 0, 2, 1) case 12: - SUBSTRUCT_CASE(1,2,0,3) + SUBSTRUCT_CASE(1, 2, 0, 3) case 13: - SUBSTRUCT_CASE(1,3,0,2) + SUBSTRUCT_CASE(1, 3, 0, 2) case 14: - SUBSTRUCT_CASE(2,1,0,3) + SUBSTRUCT_CASE(2, 1, 0, 3) case 15: - SUBSTRUCT_CASE(3,1,0,2) + SUBSTRUCT_CASE(3, 1, 0, 2) case 16: - SUBSTRUCT_CASE(2,3,0,1) + SUBSTRUCT_CASE(2, 3, 0, 1) case 17: - SUBSTRUCT_CASE(3,2,0,1) + SUBSTRUCT_CASE(3, 2, 0, 1) case 18: - SUBSTRUCT_CASE(1,2,3,0) + SUBSTRUCT_CASE(1, 2, 3, 0) case 19: - SUBSTRUCT_CASE(1,3,2,0) + SUBSTRUCT_CASE(1, 3, 2, 0) case 20: - SUBSTRUCT_CASE(2,1,3,0) + SUBSTRUCT_CASE(2, 1, 3, 0) case 21: - SUBSTRUCT_CASE(3,1,2,0) + SUBSTRUCT_CASE(3, 1, 2, 0) case 22: - SUBSTRUCT_CASE(2,3,1,0) + SUBSTRUCT_CASE(2, 3, 1, 0) case 23: - SUBSTRUCT_CASE(3,2,1,0) + SUBSTRUCT_CASE(3, 2, 1, 0) } return result; } -int ResolveMonForm(int species, int form) -{ - switch (species) - { +int ResolveMonForm(int species, int form) { + switch (species) { case SPECIES_DEOXYS: - if (form != 0 && form <= 3) + if (form != 0 && form <= 3) { return SPECIES_DEOXYS_ATK + form - 1; + } break; case SPECIES_WORMADAM: - if (form != 0 && form <= 2) + if (form != 0 && form <= 2) { return SPECIES_WORMADAM_SANDY + form - 1; + } break; } return species; } -u32 MaskOfFlagNo(int flagno) -{ +u32 MaskOfFlagNo(int flagno) { // This is completely inane. int i; u32 ret = 1; GF_ASSERT(flagno < 32); - for (i = 0; i < flagno; i++) + for (i = 0; i < flagno; i++) { ret <<= 1; + } return ret; } -int LowestFlagNo(u32 mask) -{ +int LowestFlagNo(u32 mask) { int i; u32 bit = 1; - for (i = 0; i < 32; i++) - { - if (mask & bit) + for (i = 0; i < 32; i++) { + if (mask & bit) { break; + } bit <<= 1; } return i; } -BOOL IsPokemonLegendaryOrMythical(u16 species) -{ +BOOL IsPokemonLegendaryOrMythical(u16 species) { int i; - for (i = 0; i < NELEMS(sLegendaryMonsList); i++) - { - if (species == sLegendaryMonsList[i]) + for (i = 0; i < NELEMS(sLegendaryMonsList); i++) { + if (species == sLegendaryMonsList[i]) { return TRUE; + } } return FALSE; } -u16 GetLegendaryMon(u32 idx) -{ - if (idx >= NELEMS(sLegendaryMonsList)) +u16 GetLegendaryMon(u32 idx) { + if (idx >= NELEMS(sLegendaryMonsList)) { idx = 0; + } return sLegendaryMonsList[idx]; } -BOOL sub_0206A998(struct Pokemon * pokemon) -{ +BOOL sub_0206A998(struct Pokemon *pokemon) { u16 species = (u16)GetMonData(pokemon, MON_DATA_SPECIES, NULL); return IsPokemonLegendaryOrMythical(species); } -BOOL sub_0206A9AC(struct BoxPokemon * boxmon, PlayerProfile * sb2, HeapID heapId) -{ - u32 myId = PlayerProfile_GetTrainerID(sb2); - u32 otId = GetBoxMonData(boxmon, MON_DATA_OTID, NULL); - u32 myGender = PlayerProfile_GetTrainerGender(sb2); - u32 otGender = GetBoxMonData(boxmon, MON_DATA_MET_GENDER, NULL); - struct String * r7 = PlayerProfile_GetPlayerName_NewString(sb2, heapId); - struct String * r6 = String_New(PLAYER_NAME_LENGTH + 1, heapId); - BOOL ret = FALSE; +BOOL sub_0206A9AC(struct BoxPokemon *boxmon, PlayerProfile *sb2, HeapID heapId) { + u32 myId = PlayerProfile_GetTrainerID(sb2); + u32 otId = GetBoxMonData(boxmon, MON_DATA_OTID, NULL); + u32 myGender = PlayerProfile_GetTrainerGender(sb2); + u32 otGender = GetBoxMonData(boxmon, MON_DATA_MET_GENDER, NULL); + struct String *r7 = PlayerProfile_GetPlayerName_NewString(sb2, heapId); + struct String *r6 = String_New(PLAYER_NAME_LENGTH + 1, heapId); + BOOL ret = FALSE; GetBoxMonData(boxmon, MON_DATA_OT_NAME_2, r6); - if (myId == otId && myGender == otGender && String_Compare(r7, r6) == 0) + if (myId == otId && myGender == otGender && String_Compare(r7, r6) == 0) { ret = TRUE; + } String_Delete(r6); String_Delete(r7); return ret; } -int sub_0206AA30(int x) -{ - switch (x) - { +int sub_0206AA30(int x) { + switch (x) { case TRAINER_CLASS_PKMN_TRAINER_BARRY: return TRAINER_BACKPIC_BARRY; case TRAINER_CLASS_PKMN_TRAINER_CHERYL: @@ -3702,18 +3486,18 @@ int sub_0206AA30(int x) case TRAINER_CLASS_PKMN_TRAINER_MIRA: return x - TRAINER_CLASS_PKMN_TRAINER_CHERYL + TRAINER_BACKPIC_CHERYL; default: - if (TrainerClass_GetGenderOrTrainerCount(x) == 1) + if (TrainerClass_GetGenderOrTrainerCount(x) == 1) { return TRAINER_BACKPIC_DAWN; - else + } else { return TRAINER_BACKPIC_LUCAS; + } case TRAINER_CLASS_PKMN_TRAINER_M: case TRAINER_CLASS_PKMN_TRAINER_F: return x - TRAINER_CLASS_PKMN_TRAINER_M + TRAINER_BACKPIC_LUCAS; } } -void Pokemon_RemoveCapsule(struct Pokemon * pokemon) -{ +void Pokemon_RemoveCapsule(struct Pokemon *pokemon) { u8 sp0 = 0; CapsuleArray sp1; MI_CpuClearFast(&sp1, sizeof(sp1)); @@ -3721,15 +3505,12 @@ void Pokemon_RemoveCapsule(struct Pokemon * pokemon) SetMonData(pokemon, MON_DATA_SEAL_COORDS, &sp1); } -void RestoreBoxMonPP(struct BoxPokemon * boxmon) -{ +void RestoreBoxMonPP(struct BoxPokemon *boxmon) { int i; u8 pp; BOOL decry = AcquireBoxMonLock(boxmon); - for (i = 0; i < 4; i++) - { - if (GetBoxMonData(boxmon, MON_DATA_MOVE1 + i, NULL) != MOVE_NONE) - { + for (i = 0; i < 4; i++) { + if (GetBoxMonData(boxmon, MON_DATA_MOVE1 + i, NULL) != MOVE_NONE) { pp = (u8)GetBoxMonData(boxmon, MON_DATA_MOVE1MAXPP + i, NULL); SetBoxMonData(boxmon, MON_DATA_MOVE1PP + i, &pp); } diff --git a/arm9/src/pokemon_storage_system.c b/arm9/src/pokemon_storage_system.c index 55dd00e40..1ba743598 100644 --- a/arm9/src/pokemon_storage_system.c +++ b/arm9/src/pokemon_storage_system.c @@ -1,45 +1,41 @@ +#include "pokemon_storage_system.h" + #include "global.h" + +#include "msgdata/msg.naix" + +#include "msgdata.h" #include "pokemon.h" #include "save.h" -#include "pokemon_storage_system.h" -#include "msgdata.h" -#include "msgdata/msg.naix" #include "string16.h" -void PCStorage_Init(struct PCStorage * pc) -{ +void PCStorage_Init(struct PCStorage *pc) { PCStorage_InitializeBoxes(pc); Save_SetDirtyBit(); } -u32 PCStorage_sizeof(void) -{ +u32 PCStorage_sizeof(void) { return sizeof(struct PCStorage); } -void PCStorage_InitializeBoxes(struct PCStorage * pc) -{ +void PCStorage_InitializeBoxes(struct PCStorage *pc) { int i, j; - for (i = 0; i < NUM_BOXES; i++) - { - for (j = 0; j < MONS_PER_BOX; j++) - { + for (i = 0; i < NUM_BOXES; i++) { + for (j = 0; j < MONS_PER_BOX; j++) { ZeroBoxMonData(&pc->boxes[i][j]); } } - for (i = 0, j = 0; i < NUM_BOXES; i++) - { + for (i = 0, j = 0; i < NUM_BOXES; i++) { pc->wallpapers[i] = (u8)j; j++; - if (j >= NUM_DEFAULT_WALLPAPERS) + if (j >= NUM_DEFAULT_WALLPAPERS) { j = 0; + } } - pc->unlockedWallpapers = 0; - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0014_bin, HEAP_ID_DEFAULT); - if (msgData != NULL) - { - for (i = 0; i < NUM_BOXES; i++) - { + pc->unlockedWallpapers = 0; + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0014_bin, HEAP_ID_DEFAULT); + if (msgData != NULL) { + for (i = 0; i < NUM_BOXES; i++) { ReadMsgDataIntoU16Array(msgData, (u32)(i + 6), pc->names[i]); } DestroyMsgData(msgData); @@ -47,33 +43,29 @@ void PCStorage_InitializeBoxes(struct PCStorage * pc) pc->curBox = 0; } -BOOL PCStorage_PlaceMonInFirstEmptySlotInAnyBox(struct PCStorage * pc, struct BoxPokemon * boxmon) -{ +BOOL PCStorage_PlaceMonInFirstEmptySlotInAnyBox(struct PCStorage *pc, struct BoxPokemon *boxmon) { int i = (int)pc->curBox; - do - { + do { RestoreBoxMonPP(boxmon); - if (PCStorage_PlaceMonInBoxFirstEmptySlot(pc, i, boxmon)) - { + if (PCStorage_PlaceMonInBoxFirstEmptySlot(pc, i, boxmon)) { Save_SetDirtyBit(); return TRUE; } i++; - if (i >= NUM_BOXES) + if (i >= NUM_BOXES) { i = 0; + } } while (i != pc->curBox); return FALSE; } -BOOL PCStorage_PlaceMonInBoxFirstEmptySlot(struct PCStorage * pc, int boxno, struct BoxPokemon * boxmon) -{ +BOOL PCStorage_PlaceMonInBoxFirstEmptySlot(struct PCStorage *pc, int boxno, struct BoxPokemon *boxmon) { RestoreBoxMonPP(boxmon); - if (boxno == -1) + if (boxno == -1) { boxno = (int)pc->curBox; - for (int i = 0; i < MONS_PER_BOX; i++) - { - if (GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_SPECIES, NULL) == SPECIES_NONE) - { + } + for (int i = 0; i < MONS_PER_BOX; i++) { + if (GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_SPECIES, NULL) == SPECIES_NONE) { pc->boxes[boxno][i] = *boxmon; Save_SetDirtyBit(); return TRUE; @@ -82,13 +74,12 @@ BOOL PCStorage_PlaceMonInBoxFirstEmptySlot(struct PCStorage * pc, int boxno, str return FALSE; } -BOOL PCStorage_PlaceMonInBoxByIndexPair(struct PCStorage * pc, int boxno, int slotno, struct BoxPokemon * boxmon) -{ +BOOL PCStorage_PlaceMonInBoxByIndexPair(struct PCStorage *pc, int boxno, int slotno, struct BoxPokemon *boxmon) { RestoreBoxMonPP(boxmon); - if (boxno == -1) + if (boxno == -1) { boxno = (int)pc->curBox; - if (boxno < NUM_BOXES && slotno < MONS_PER_BOX) - { + } + if (boxno < NUM_BOXES && slotno < MONS_PER_BOX) { pc->boxes[boxno][slotno] = *boxmon; Save_SetDirtyBit(); return TRUE; @@ -97,12 +88,11 @@ BOOL PCStorage_PlaceMonInBoxByIndexPair(struct PCStorage * pc, int boxno, int sl return FALSE; } -void PCStorage_DeleteBoxMonByIndexPair(struct PCStorage * pc, int boxno, int slotno) -{ - if (boxno == -1) +void PCStorage_DeleteBoxMonByIndexPair(struct PCStorage *pc, int boxno, int slotno) { + if (boxno == -1) { boxno = (int)pc->curBox; - if (slotno < MONS_PER_BOX && boxno < NUM_BOXES) - { + } + if (slotno < MONS_PER_BOX && boxno < NUM_BOXES) { ZeroBoxMonData(&pc->boxes[boxno][slotno]); Save_SetDirtyBit(); return; @@ -110,74 +100,67 @@ void PCStorage_DeleteBoxMonByIndexPair(struct PCStorage * pc, int boxno, int slo GF_ASSERT(0); } -int PCStorage_GetActiveBox(struct PCStorage * pc) -{ +int PCStorage_GetActiveBox(struct PCStorage *pc) { return (int)pc->curBox; } -int PCStorage_FindFirstBoxWithEmptySlot(struct PCStorage * pc) -{ +int PCStorage_FindFirstBoxWithEmptySlot(struct PCStorage *pc) { int i, j; i = (int)pc->curBox; - do - { - for (j = 0; j < (int)MONS_PER_BOX; j++) - { - if (!GetBoxMonData(&pc->boxes[i][j], MON_DATA_SPECIES_EXISTS, NULL)) + do { + for (j = 0; j < (int)MONS_PER_BOX; j++) { + if (!GetBoxMonData(&pc->boxes[i][j], MON_DATA_SPECIES_EXISTS, NULL)) { return i; + } } i++; - if (i >= (int)NUM_BOXES) + if (i >= (int)NUM_BOXES) { i = 0; + } } while (i != pc->curBox); return (int)NUM_BOXES; } -BOOL PCStorage_FindFirstEmptySlot(struct PCStorage * pc, int * boxno, int * slotno) -{ - if (*boxno == -1) +BOOL PCStorage_FindFirstEmptySlot(struct PCStorage *pc, int *boxno, int *slotno) { + if (*boxno == -1) { *boxno = (int)pc->curBox; + } int i = *boxno, j = *slotno; - do - { - while (j < (int)MONS_PER_BOX) - { - if (!GetBoxMonData(&pc->boxes[i][j], MON_DATA_SPECIES_EXISTS, NULL)) - { - *boxno = i; + do { + while (j < (int)MONS_PER_BOX) { + if (!GetBoxMonData(&pc->boxes[i][j], MON_DATA_SPECIES_EXISTS, NULL)) { + *boxno = i; *slotno = j; return TRUE; } j++; } i++; - if (i >= (int)NUM_BOXES) + if (i >= (int)NUM_BOXES) { i = 0; - if (i == *boxno) + } + if (i == *boxno) { break; + } j = 0; } while (1); return (int)NUM_BOXES; // bug: should return FALSE if reached } -int PCStorage_CountMonsAndEggsInAllBoxes(struct PCStorage * pc) -{ +int PCStorage_CountMonsAndEggsInAllBoxes(struct PCStorage *pc) { int i, j, count = 0; - for (i = 0; i < (int)NUM_BOXES; i++) - { - for (j = 0; j < (int)MONS_PER_BOX; j++) - { - if (GetBoxMonData(&pc->boxes[i][j], MON_DATA_SPECIES_EXISTS, NULL)) + for (i = 0; i < (int)NUM_BOXES; i++) { + for (j = 0; j < (int)MONS_PER_BOX; j++) { + if (GetBoxMonData(&pc->boxes[i][j], MON_DATA_SPECIES_EXISTS, NULL)) { count++; + } } } return count; } -void PCStorage_SetActiveBox(struct PCStorage * pc, int boxno) -{ - if (boxno < NUM_BOXES) - { +void PCStorage_SetActiveBox(struct PCStorage *pc, int boxno) { + if (boxno < NUM_BOXES) { pc->curBox = (u32)boxno; Save_SetDirtyBit(); return; @@ -185,20 +168,19 @@ void PCStorage_SetActiveBox(struct PCStorage * pc, int boxno) GF_ASSERT(0); } -u8 PCStorage_GetBoxWallpaper(struct PCStorage * pc, int boxno) -{ - if (boxno < NUM_BOXES) +u8 PCStorage_GetBoxWallpaper(struct PCStorage *pc, int boxno) { + if (boxno < NUM_BOXES) { return pc->wallpapers[boxno]; + } GF_ASSERT(0); return 0; } -void PCStorage_SetBoxWallpaper(struct PCStorage * pc, int boxno, u8 wallpaper) -{ - if (boxno == -1) +void PCStorage_SetBoxWallpaper(struct PCStorage *pc, int boxno, u8 wallpaper) { + if (boxno == -1) { boxno = (int)pc->curBox; - if (boxno < NUM_BOXES && wallpaper < NUM_WALLPAPERS) - { + } + if (boxno < NUM_BOXES && wallpaper < NUM_WALLPAPERS) { pc->wallpapers[boxno] = wallpaper; Save_SetDirtyBit(); return; @@ -206,40 +188,37 @@ void PCStorage_SetBoxWallpaper(struct PCStorage * pc, int boxno, u8 wallpaper) GF_ASSERT(0); } -void PCStorage_GetBoxName(struct PCStorage * pc, int boxno, struct String * ret) -{ - if (boxno == -1) +void PCStorage_GetBoxName(struct PCStorage *pc, int boxno, struct String *ret) { + if (boxno == -1) { boxno = (int)pc->curBox; - if (boxno < NUM_BOXES) - { + } + if (boxno < NUM_BOXES) { CopyU16ArrayToString(ret, pc->names[boxno]); return; } GF_ASSERT(0); } -void PCStorage_SetBoxName(struct PCStorage * pc, int boxno, struct String * src) -{ - if (boxno == -1) +void PCStorage_SetBoxName(struct PCStorage *pc, int boxno, struct String *src) { + if (boxno == -1) { boxno = (int)pc->curBox; - if (boxno < NUM_BOXES) - { + } + if (boxno < NUM_BOXES) { CopyStringToU16Array(src, pc->names[boxno], BOX_NAME_LENGTH); Save_SetDirtyBit(); } } -int PCStorage_CountMonsAndEggsInBox(struct PCStorage * pc, int boxno) -{ - if (boxno == -1) +int PCStorage_CountMonsAndEggsInBox(struct PCStorage *pc, int boxno) { + if (boxno == -1) { boxno = (int)pc->curBox; - if (boxno < NUM_BOXES) - { + } + if (boxno < NUM_BOXES) { int i, count = 0; - for (i = 0; i < (int)MONS_PER_BOX; i++) - { - if (GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_SPECIES_EXISTS, NULL)) + for (i = 0; i < (int)MONS_PER_BOX; i++) { + if (GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_SPECIES_EXISTS, NULL)) { count++; + } } return count; } @@ -247,17 +226,16 @@ int PCStorage_CountMonsAndEggsInBox(struct PCStorage * pc, int boxno) return 0; } -int PCStorage_CountMonsInBox(struct PCStorage * pc, int boxno) -{ - if (boxno == -1) +int PCStorage_CountMonsInBox(struct PCStorage *pc, int boxno) { + if (boxno == -1) { boxno = (int)pc->curBox; - if (boxno < NUM_BOXES) - { + } + if (boxno < NUM_BOXES) { int i, count = 0; - for (i = 0; i < (int)MONS_PER_BOX; i++) - { - if (GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_SPECIES_EXISTS, NULL) && !GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_IS_EGG, NULL)) + for (i = 0; i < (int)MONS_PER_BOX; i++) { + if (GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_SPECIES_EXISTS, NULL) && !GetBoxMonData(&pc->boxes[boxno][i], MON_DATA_IS_EGG, NULL)) { count++; + } } return count; } @@ -265,57 +243,54 @@ int PCStorage_CountMonsInBox(struct PCStorage * pc, int boxno) return 0; } -int PCStorage_CountMonsInAllBoxes(struct PCStorage * pc) -{ +int PCStorage_CountMonsInAllBoxes(struct PCStorage *pc) { int count, i; - for (i = 0, count = 0; i < NUM_BOXES; i++) - { + for (i = 0, count = 0; i < NUM_BOXES; i++) { count += PCStorage_CountMonsInBox(pc, i); } return count; } -void PCStorage_SetBoxMonDataByIndexPair(struct PCStorage * pc, int boxno, int slotno, u32 attr, void * value) -{ - if (boxno >= NUM_BOXES) +void PCStorage_SetBoxMonDataByIndexPair(struct PCStorage *pc, int boxno, int slotno, u32 attr, void *value) { + if (boxno >= NUM_BOXES) { GF_ASSERT(boxno == -1); + } GF_ASSERT(slotno < MONS_PER_BOX); - if (boxno == -1) + if (boxno == -1) { boxno = (int)pc->curBox; + } SetBoxMonData(&pc->boxes[boxno][slotno], (int)attr, value); Save_SetDirtyBit(); } -struct BoxPokemon * PCStorage_GetMonByIndexPair(struct PCStorage * pc, int boxno, int slotno) -{ - if (boxno >= NUM_BOXES) +struct BoxPokemon *PCStorage_GetMonByIndexPair(struct PCStorage *pc, int boxno, int slotno) { + if (boxno >= NUM_BOXES) { GF_ASSERT(boxno == -1); + } GF_ASSERT(slotno < MONS_PER_BOX); - if (boxno == -1) + if (boxno == -1) { boxno = (int)pc->curBox; + } return &pc->boxes[boxno][slotno]; } -void PCStorage_UnlockBonusWallpaper(struct PCStorage * pc, int wallpaper) -{ +void PCStorage_UnlockBonusWallpaper(struct PCStorage *pc, int wallpaper) { GF_ASSERT(wallpaper < NUM_BONUS_WALLPAPERS); pc->unlockedWallpapers |= (1u << wallpaper); Save_SetDirtyBit(); } -BOOL PCStorage_IsBonusWallpaperUnlocked(struct PCStorage * pc, int wallpaper) -{ +BOOL PCStorage_IsBonusWallpaperUnlocked(struct PCStorage *pc, int wallpaper) { GF_ASSERT(wallpaper < NUM_BONUS_WALLPAPERS); return (pc->unlockedWallpapers & (1u << wallpaper)) != 0; } -int PCStorage_CountUnlockedBonusWallpapers(struct PCStorage * pc) -{ +int PCStorage_CountUnlockedBonusWallpapers(struct PCStorage *pc) { int i, count; - for (i = 0, count = 0; i < NUM_BONUS_WALLPAPERS; i++) - { - if (PCStorage_IsBonusWallpaperUnlocked(pc, i)) + for (i = 0, count = 0; i < NUM_BONUS_WALLPAPERS; i++) { + if (PCStorage_IsBonusWallpaperUnlocked(pc, i)) { count++; + } } return count; } diff --git a/arm9/src/poketch.c b/arm9/src/poketch.c index d8df97ca5..3e8d3d620 100644 --- a/arm9/src/poketch.c +++ b/arm9/src/poketch.c @@ -1,9 +1,11 @@ +#include "poketch.h" + #include "global.h" + #include "MI_memory.h" #include "pokemon.h" -#include "poketch.h" -extern u16 BoxMon_GetAlternateForm(struct BoxPokemon * mon); +extern u16 BoxMon_GetAlternateForm(struct BoxPokemon *mon); static const u8 sMarkingMapInitialPos[][2] = { { 0x68, 0x98 }, @@ -14,37 +16,32 @@ static const u8 sMarkingMapInitialPos[][2] = { { 0xB8, 0x98 }, }; -u32 Save_Poketch_sizeof(void) -{ +u32 Save_Poketch_sizeof(void) { return sizeof(struct Poketch); } -void Save_Poketch_Init(struct Poketch * poketch) -{ +void Save_Poketch_Init(struct Poketch *poketch) { int i; - for (i = 0; i < 32; i++) - { + for (i = 0; i < 32; i++) { poketch->unlockedApps[i] = 0; } - poketch->numApps = 0; - poketch->selectedApp = 0; - poketch->isGiven = 0; - poketch->color = 0; + poketch->numApps = 0; + poketch->selectedApp = 0; + poketch->isGiven = 0; + poketch->color = 0; poketch->pedometerActive = 0; - poketch->stepCounter = 0; - poketch->alarmActive = 0; - poketch->alarmHour = 0; - poketch->alarmMinute = 0; - poketch->calendarMonth = 1; // January - poketch->calendarFlags = 0; - for (i = 0; i < 6; i++) - { + poketch->stepCounter = 0; + poketch->alarmActive = 0; + poketch->alarmHour = 0; + poketch->alarmMinute = 0; + poketch->calendarMonth = 1; // January + poketch->calendarFlags = 0; + for (i = 0; i < 6; i++) { poketch->markingMapPos[i][0] = sMarkingMapInitialPos[i][0]; poketch->markingMapPos[i][1] = sMarkingMapInitialPos[i][1]; } - for (i = 0; i < 12; i++) - { + for (i = 0; i < 12; i++) { poketch->pokemonHistory[i][0] = SPECIES_NONE; poketch->pokemonHistory[i][1] = 0; } @@ -52,26 +49,21 @@ void Save_Poketch_Init(struct Poketch * poketch) Save_Poketch_UnlockApp(poketch, POKETCH_DIGITAL_WATCH); } -void Save_Poketch_Give(struct Poketch * poketch) -{ +void Save_Poketch_Give(struct Poketch *poketch) { poketch->isGiven = TRUE; } -BOOL Save_Poketch_IsGiven(struct Poketch * poketch) -{ +BOOL Save_Poketch_IsGiven(struct Poketch *poketch) { return poketch->isGiven; } -u8 Save_Poketch_AppIsUnlocked(struct Poketch * poketch, PoketchApp app) -{ +u8 Save_Poketch_AppIsUnlocked(struct Poketch *poketch, PoketchApp app) { return poketch->unlockedApps[app]; } -BOOL Save_Poketch_UnlockApp(struct Poketch * poketch, PoketchApp app) -{ +BOOL Save_Poketch_UnlockApp(struct Poketch *poketch, PoketchApp app) { GF_ASSERT(app >= FIRST_POKETCH_APP_ID && app < NUM_POKETCH_APPS); - if (poketch->numApps < NUM_POKETCH_APPS && !poketch->unlockedApps[app]) - { + if (poketch->numApps < NUM_POKETCH_APPS && !poketch->unlockedApps[app]) { poketch->unlockedApps[app] = TRUE; poketch->numApps++; if (app == POKETCH_PEDOMETER) // pedometer @@ -83,149 +75,122 @@ BOOL Save_Poketch_UnlockApp(struct Poketch * poketch, PoketchApp app) return FALSE; } -PoketchApp Save_Poketch_GetSelectedApp(struct Poketch * poketch) -{ +PoketchApp Save_Poketch_GetSelectedApp(struct Poketch *poketch) { return (PoketchApp)poketch->selectedApp; } -PoketchApp Save_Poketch_CycleNextApp(struct Poketch * poketch) -{ - PoketchApp app = (PoketchApp)poketch->selectedApp; +PoketchApp Save_Poketch_CycleNextApp(struct Poketch *poketch) { + PoketchApp app = (PoketchApp)poketch->selectedApp; PoketchApp prev = app; - while (1) - { - if (++app >= NUM_POKETCH_APPS) + while (1) { + if (++app >= NUM_POKETCH_APPS) { app = FIRST_POKETCH_APP_ID; - if (app == prev) + } + if (app == prev) { break; - if (poketch->unlockedApps[app]) + } + if (poketch->unlockedApps[app]) { break; + } } poketch->selectedApp = (s8)app; return (PoketchApp)poketch->selectedApp; } -u8 Save_Poketch_GetScreenTint(struct Poketch * poketch) -{ +u8 Save_Poketch_GetScreenTint(struct Poketch *poketch) { GF_ASSERT(poketch != NULL); return poketch->color; } -void Save_Poketch_SetScreenTint(struct Poketch * poketch, u32 color) -{ +void Save_Poketch_SetScreenTint(struct Poketch *poketch, u32 color) { GF_ASSERT(poketch != NULL); GF_ASSERT(color < 8); poketch->color = (u8)color; } -u32 Save_Poketch_GetStepCounter(struct Poketch * poketch) -{ +u32 Save_Poketch_GetStepCounter(struct Poketch *poketch) { return poketch->stepCounter; } -void Save_Poketch_SetStepCounter(struct Poketch * poketch, u32 steps) -{ - if (poketch->pedometerActive) +void Save_Poketch_SetStepCounter(struct Poketch *poketch, u32 steps) { + if (poketch->pedometerActive) { poketch->stepCounter = steps; + } } -BOOL Save_Poketch_GetAlarmState(struct Poketch * poketch) -{ +BOOL Save_Poketch_GetAlarmState(struct Poketch *poketch) { return poketch->alarmActive; } -void Save_Poketch_GetAlarmSetTime(struct Poketch * poketch, u32 * hour_p, u32 * min_p) -{ +void Save_Poketch_GetAlarmSetTime(struct Poketch *poketch, u32 *hour_p, u32 *min_p) { *hour_p = poketch->alarmHour; - *min_p = poketch->alarmMinute; + *min_p = poketch->alarmMinute; } -void Save_Poketch_SetAlarm(struct Poketch * poketch, BOOL enabled, u32 hour, u32 minute) -{ +void Save_Poketch_SetAlarm(struct Poketch *poketch, BOOL enabled, u32 hour, u32 minute) { poketch->alarmActive = enabled; - poketch->alarmHour = hour; + poketch->alarmHour = hour; poketch->alarmMinute = minute; } -void Save_Poketch_CalendarDateHighlight(struct Poketch * poketch, u32 month, u32 day) -{ - if (poketch->calendarMonth == month) - { +void Save_Poketch_CalendarDateHighlight(struct Poketch *poketch, u32 month, u32 day) { + if (poketch->calendarMonth == month) { poketch->calendarFlags |= (1u << (day - 1)); - } - else - { + } else { poketch->calendarMonth = (u8)month; poketch->calendarFlags = (1u << (day - 1)); } } -void Save_Poketch_CalendarDateUnhighlight(struct Poketch * poketch, u32 month, u32 day) -{ - if (poketch->calendarMonth == month) - { +void Save_Poketch_CalendarDateUnhighlight(struct Poketch *poketch, u32 month, u32 day) { + if (poketch->calendarMonth == month) { poketch->calendarFlags &= ~(1u << (day - 1)); - } - else - { + } else { poketch->calendarMonth = (u8)month; poketch->calendarFlags = 0; } } -BOOL Save_Poketch_CalendarDateIsHighlighted(struct Poketch * poketch, u32 month, u32 day) -{ - if (poketch->calendarMonth == month) - { +BOOL Save_Poketch_CalendarDateIsHighlighted(struct Poketch *poketch, u32 month, u32 day) { + if (poketch->calendarMonth == month) { return (BOOL)((poketch->calendarFlags >> (day - 1)) & 1); - } - else - { + } else { return FALSE; } } -void Save_Poketch_MarkingMapSetPos(struct Poketch * poketch, s32 mark, u8 x, u8 y) -{ +void Save_Poketch_MarkingMapSetPos(struct Poketch *poketch, s32 mark, u8 x, u8 y) { GF_ASSERT(mark < 6); poketch->markingMapPos[mark][0] = x; poketch->markingMapPos[mark][1] = y; } -void Save_Poketch_MarkingMapGetPos(struct Poketch * poketch, s32 mark, u8 * x_p, u8 * y_p) -{ +void Save_Poketch_MarkingMapGetPos(struct Poketch *poketch, s32 mark, u8 *x_p, u8 *y_p) { GF_ASSERT(mark < 6); *x_p = poketch->markingMapPos[mark][0]; *y_p = poketch->markingMapPos[mark][1]; } -u32 Save_Poketch_DotArtistIsEnabled(struct Poketch * poketch) -{ +u32 Save_Poketch_DotArtistIsEnabled(struct Poketch *poketch) { return poketch->dotArtistEnabled; } -void Save_Poketch_DotArtistGetDrawing(struct Poketch * poketch, void * grid) -{ - if (poketch->dotArtistEnabled) - { +void Save_Poketch_DotArtistGetDrawing(struct Poketch *poketch, void *grid) { + if (poketch->dotArtistEnabled) { MI_CpuCopy8(poketch->dotArtistGrid, grid, DOT_ARTIST_SIZE); } } -void Save_Poketch_DotArtistSetDrawingAndEnable(struct Poketch * poketch, void * grid) -{ +void Save_Poketch_DotArtistSetDrawingAndEnable(struct Poketch *poketch, void *grid) { MI_CpuCopy8(grid, poketch->dotArtistGrid, DOT_ARTIST_SIZE); poketch->dotArtistEnabled = TRUE; } -void Save_Poketch_PokemonHistoryAddMon(struct Poketch * poketch, struct BoxPokemon * mon) -{ +void Save_Poketch_PokemonHistoryAddMon(struct Poketch *poketch, struct BoxPokemon *mon) { int i = Save_Poketch_PokemonHistoryGetFirstEmptySlot(poketch); - if (i >= 12) - { - for (i = 0; i < 11; i++) - { + if (i >= 12) { + for (i = 0; i < 11; i++) { poketch->pokemonHistory[i][0] = poketch->pokemonHistory[i + 1][0]; poketch->pokemonHistory[i][1] = poketch->pokemonHistory[i + 1][1]; } @@ -235,26 +200,23 @@ void Save_Poketch_PokemonHistoryAddMon(struct Poketch * poketch, struct BoxPokem poketch->pokemonHistory[i][1] = BoxMon_GetAlternateForm(mon); } -int Save_Poketch_PokemonHistoryGetFirstEmptySlot(struct Poketch * poketch) -{ +int Save_Poketch_PokemonHistoryGetFirstEmptySlot(struct Poketch *poketch) { int i; - for (i = 0; i < 12; i++) - { - if (poketch->pokemonHistory[i][0] == SPECIES_NONE) + for (i = 0; i < 12; i++) { + if (poketch->pokemonHistory[i][0] == SPECIES_NONE) { return i; + } } return i; } -void Save_Poketch_PokemonHistoryGetSlotN(struct Poketch * poketch, s32 i, u32 * species_p, u32 * form_p) -{ +void Save_Poketch_PokemonHistoryGetSlotN(struct Poketch *poketch, s32 i, u32 *species_p, u32 *form_p) { GF_ASSERT(i < 12); GF_ASSERT(poketch->pokemonHistory[i][0] != SPECIES_NONE); *species_p = poketch->pokemonHistory[i][0]; - *form_p = poketch->pokemonHistory[i][1]; + *form_p = poketch->pokemonHistory[i][1]; } -struct Poketch * Save_Poketch_Get(struct SaveData * save) -{ +struct Poketch *Save_Poketch_Get(struct SaveData *save) { return (struct Poketch *)SaveArray_Get(save, 5); } diff --git a/arm9/src/render_text.c b/arm9/src/render_text.c index 0e507ea5c..f44c7dd46 100644 --- a/arm9/src/render_text.c +++ b/arm9/src/render_text.c @@ -1,6 +1,9 @@ -#include "global.h" #include "render_text.h" + +#include "global.h" + #include "constants/sndseq.h" + #include "font.h" #include "game_init.h" #include "string_control_code.h" @@ -14,335 +17,285 @@ TextFlags gTextFlags; const u8 UNK_020ECB50[] = { 0, 1, 2, 1 }; -u32 RenderText(struct TextPrinter *printer) -{ +u32 RenderText(struct TextPrinter *printer) { - struct TextPrinterSubStruct *subStruct = - (struct TextPrinterSubStruct *)(&printer->subStructFields); + struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&printer->subStructFields); u16 currentChar; - switch (printer->state) - { - case 0: - if (((gSystem.heldKeys & 3) != 0 && subStruct->hasPrintBeenSpedUp != 0) || - (gSystem.touchHeld != 0 && gTextFlags.unk0_4 != 0)) - { - printer->delayCounter = 0; - if (printer->textSpeedBottom != 0) - { - gTextFlags.unk0_6 = 1; + switch (printer->state) { + case 0: + if (((gSystem.heldKeys & 3) != 0 && subStruct->hasPrintBeenSpedUp != 0) || (gSystem.touchHeld != 0 && gTextFlags.unk0_4 != 0)) { + printer->delayCounter = 0; + if (printer->textSpeedBottom != 0) { + gTextFlags.unk0_6 = 1; + } + } + + if (printer->delayCounter && printer->textSpeedBottom) { + printer->delayCounter--; + + if (gTextFlags.canABSpeedUpPrint != 0) { + if ((gSystem.newKeys & 3) || (gSystem.touchNew != 0 && gTextFlags.unk0_4)) { + subStruct->hasPrintBeenSpedUp = 1; + printer->delayCounter = 0; } } - if (printer->delayCounter && printer->textSpeedBottom) - { - printer->delayCounter--; + return 3; + } + + printer->delayCounter = printer->textSpeedBottom; + currentChar = *printer->printerTemplate.currentChar.raw; + printer->printerTemplate.currentChar.raw++; + + GF_ASSERT(currentChar != 0xF100); + + switch (currentChar) { + case EOS: + return 1; + case CHAR_LF: + printer->printerTemplate.currentX = printer->printerTemplate.x; + s32 fontAttribute = GetFontAttribute(printer->printerTemplate.fontId, 1); + + printer->printerTemplate.currentY += printer->printerTemplate.lineSpacing + fontAttribute; + + return 2; - if (gTextFlags.canABSpeedUpPrint != 0) - { - if ((gSystem.newKeys & 3) || (gSystem.touchNew != 0 && gTextFlags.unk0_4)) - { - subStruct->hasPrintBeenSpedUp = 1; - printer->delayCounter = 0; + case 0xF0FD: + printer->printerTemplate.currentChar.raw++; + return 2; + case EXT_CTRL_CODE_BEGIN: + printer->printerTemplate.currentChar.raw--; + switch ((u16)MsgArray_GetControlCode(printer->printerTemplate.currentChar.raw)) { + case 0xFF00: + u16 field = (u16)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + if (field == 0xff) { + u8 r2 = printer->printerTemplate.unk4; + printer->printerTemplate.unk4 = (u8)((printer->printerTemplate.fgColor - 1) / 2 + 100); + + if (!(r2 >= 100 && r2 < 107)) { + break; + } + + field = (u16)(r2 - 100); + } else { + if (field >= 0x64) { + printer->printerTemplate.unk4 = (u8)field; + break; } } + printer->printerTemplate.fgColor = (u8)(field * 2 + 1); + printer->printerTemplate.shadowColor = (u8)(field * 2 + 2); + + GenerateFontHalfRowLookupTable(printer->printerTemplate.fgColor, + printer->printerTemplate.bgColor, + printer->printerTemplate.shadowColor); + + break; + + case 0x200: + field = (u16)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + + sub_0201C1EC(printer, + printer->printerTemplate.currentX, + printer->printerTemplate.currentY, + field); + if (printer->textSpeedTop != 0) { + CopyWindowToVram(printer->printerTemplate.window); + } + + break; + case 0x201: + printer->delayCounter = (u8)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + printer->printerTemplate.currentChar.raw = MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); + printer->state = 6; + return 3; - } + case 0x202: + printer->Unk2A = (u16)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + printer->printerTemplate.currentChar.raw = MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); - printer->delayCounter = printer->textSpeedBottom; - currentChar = *printer->printerTemplate.currentChar.raw; - printer->printerTemplate.currentChar.raw++; + return 3; + case 0x203: + printer->printerTemplate.currentX = (u8)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + break; + case 0x204: + printer->printerTemplate.currentY = (u8)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + break; + + case 0xFF01: + field = (u16)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + + switch (field) { + case 100: + printer->printerTemplate.unk2 = 0; + printer->printerTemplate.unk3 = 0; + break; + case 200: + printer->printerTemplate.unk2 = 0xFFFC; + printer->printerTemplate.unk3 = 0; + break; + } - GF_ASSERT(currentChar != 0xF100); - - switch (currentChar) - { - case EOS: - return 1; - case CHAR_LF: - printer->printerTemplate.currentX = printer->printerTemplate.x; - s32 fontAttribute = GetFontAttribute(printer->printerTemplate.fontId, 1); - - printer->printerTemplate.currentY += - printer->printerTemplate.lineSpacing + fontAttribute; - - return 2; - - case 0xF0FD: - printer->printerTemplate.currentChar.raw++; - return 2; - case EXT_CTRL_CODE_BEGIN: - printer->printerTemplate.currentChar.raw--; - switch ((u16)MsgArray_GetControlCode(printer->printerTemplate.currentChar.raw)) - { - case 0xFF00: - u16 field = (u16)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - if (field == 0xff) - { - u8 r2 = printer->printerTemplate.unk4; - printer->printerTemplate.unk4 = - (u8)((printer->printerTemplate.fgColor - 1) / 2 + 100); - - if (!(r2 >= 100 && r2 < 107)) - { - break; - } - - field = (u16)(r2 - 100); - } - else - { - if (field >= 0x64) - { - printer->printerTemplate.unk4 = (u8)field; - break; - } - } - - printer->printerTemplate.fgColor = (u8)(field * 2 + 1); - printer->printerTemplate.shadowColor = (u8)(field * 2 + 2); - - GenerateFontHalfRowLookupTable(printer->printerTemplate.fgColor, - printer->printerTemplate.bgColor, - printer->printerTemplate.shadowColor); - - break; - - case 0x200: - field = (u16)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - - sub_0201C1EC(printer, - printer->printerTemplate.currentX, - printer->printerTemplate.currentY, - field); - if (printer->textSpeedTop != 0) - { - CopyWindowToVram(printer->printerTemplate.window); - } - - break; - case 0x201: - printer->delayCounter = (u8)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - printer->printerTemplate.currentChar.raw = - MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); - printer->state = 6; - - return 3; - case 0x202: - printer->Unk2A = (u16)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - printer->printerTemplate.currentChar.raw = - MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); - - return 3; - case 0x203: - printer->printerTemplate.currentX = (u8)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - break; - case 0x204: - printer->printerTemplate.currentY = (u8)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - break; - - case 0xFF01: - field = (u16)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - - switch (field) - { - case 100: - printer->printerTemplate.unk2 = 0; - printer->printerTemplate.unk3 = 0; - break; - case 200: - printer->printerTemplate.unk2 = 0xFFFC; - printer->printerTemplate.unk3 = 0; - break; - } - - break; - - case 0xFE06: - field = (u16)MsgArray_ControlCodeGetField( - printer->printerTemplate.currentChar.raw, 0); - if (field != 0xFE00) - { - if (field != 0xFE01) - { - break; - } - - printer->state = 2; - TextPrinterInitDownArrowCounters(printer); - printer->printerTemplate.currentChar.raw = MsgArray_SkipControlCode( - printer->printerTemplate.currentChar.raw); - - return 3; - } - - printer->state = 3; - TextPrinterInitDownArrowCounters(printer); - printer->printerTemplate.currentChar.raw = - MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); - - return 3; - } + break; - printer->printerTemplate.currentChar.raw = - MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); - return 2; + case 0xFE06: + field = (u16)MsgArray_ControlCodeGetField( + printer->printerTemplate.currentChar.raw, 0); + if (field != 0xFE00) { + if (field != 0xFE01) { + break; + } - case 0x25BC: printer->state = 2; TextPrinterInitDownArrowCounters(printer); - return 3; + printer->printerTemplate.currentChar.raw = MsgArray_SkipControlCode( + printer->printerTemplate.currentChar.raw); - case 0x25BD: - printer->state = 3; - TextPrinterInitDownArrowCounters(printer); return 3; - } - - struct UnkStruct_02002C14_sub *r5 = sub_02002D94(subStruct->glyphId, currentChar); - CopyGlyphToWindow(printer->printerTemplate.window, - r5->buf, - r5->width, - r5->height, - printer->printerTemplate.currentX, - printer->printerTemplate.currentY, - printer->printerTemplate.unk2); - - printer->printerTemplate.currentX += r5->width + printer->printerTemplate.letterSpacing; + } - return 0; - case 1: - if (TextPrinterWait(printer) != 0) - { - TextPrinterClearDownArrow(printer); + printer->state = 3; + TextPrinterInitDownArrowCounters(printer); + printer->printerTemplate.currentChar.raw = MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); - printer->state = 0; + return 3; } - return 3; - case 2: - if (TextPrinterWaitWithDownArrow(printer) != 0) - { - TextPrinterClearDownArrow(printer); - FillWindowPixelBuffer( - printer->printerTemplate.window, printer->printerTemplate.bgColor); - printer->printerTemplate.currentX = printer->printerTemplate.x; - printer->printerTemplate.currentY = printer->printerTemplate.y; - printer->state = 0; - } + printer->printerTemplate.currentChar.raw = MsgArray_SkipControlCode(printer->printerTemplate.currentChar.raw); + return 2; + case 0x25BC: + printer->state = 2; + TextPrinterInitDownArrowCounters(printer); return 3; - case 3: - if (TextPrinterWaitWithDownArrow(printer) != 0) - { - TextPrinterClearDownArrow(printer); - printer->scrollDistance = - (u8)(GetFontAttribute(printer->printerTemplate.fontId, 1) + - printer->printerTemplate.lineSpacing); - printer->printerTemplate.currentX = printer->printerTemplate.x; - printer->state = 4; - } + case 0x25BD: + printer->state = 3; + TextPrinterInitDownArrowCounters(printer); return 3; - case 4: - if (printer->scrollDistance != 0) - { - if ((int)printer->scrollDistance < 4) - { - ScrollWindow(printer->printerTemplate.window, - 0, - printer->scrollDistance, - (u8)(printer->printerTemplate.bgColor | - (printer->printerTemplate.bgColor << 4))); - printer->scrollDistance = 0; - } - else - { - ScrollWindow(printer->printerTemplate.window, - 0, - 4, - (u8)(printer->printerTemplate.bgColor | - (printer->printerTemplate.bgColor << 4))); - - printer->scrollDistance -= 4; - } + } - CopyWindowToVram(printer->printerTemplate.window); - } - else - { - printer->state = 0; - } + struct UnkStruct_02002C14_sub *r5 = sub_02002D94(subStruct->glyphId, currentChar); + CopyGlyphToWindow(printer->printerTemplate.window, + r5->buf, + r5->width, + r5->height, + printer->printerTemplate.currentX, + printer->printerTemplate.currentY, + printer->printerTemplate.unk2); + + printer->printerTemplate.currentX += r5->width + printer->printerTemplate.letterSpacing; + + return 0; + case 1: + if (TextPrinterWait(printer) != 0) { + TextPrinterClearDownArrow(printer); - return 3; - case 5: printer->state = 0; - return 3; - case 6: - if (printer->delayCounter != 0) - { - printer->delayCounter--; - } - else - { - printer->state = 0; + } + + return 3; + case 2: + if (TextPrinterWaitWithDownArrow(printer) != 0) { + TextPrinterClearDownArrow(printer); + FillWindowPixelBuffer( + printer->printerTemplate.window, printer->printerTemplate.bgColor); + printer->printerTemplate.currentX = printer->printerTemplate.x; + printer->printerTemplate.currentY = printer->printerTemplate.y; + printer->state = 0; + } + + return 3; + case 3: + if (TextPrinterWaitWithDownArrow(printer) != 0) { + TextPrinterClearDownArrow(printer); + printer->scrollDistance = (u8)(GetFontAttribute(printer->printerTemplate.fontId, 1) + printer->printerTemplate.lineSpacing); + printer->printerTemplate.currentX = printer->printerTemplate.x; + printer->state = 4; + } + + return 3; + case 4: + if (printer->scrollDistance != 0) { + if ((int)printer->scrollDistance < 4) { + ScrollWindow(printer->printerTemplate.window, + 0, + printer->scrollDistance, + (u8)(printer->printerTemplate.bgColor | (printer->printerTemplate.bgColor << 4))); + printer->scrollDistance = 0; + } else { + ScrollWindow(printer->printerTemplate.window, + 0, + 4, + (u8)(printer->printerTemplate.bgColor | (printer->printerTemplate.bgColor << 4))); + + printer->scrollDistance -= 4; } - return 3; + CopyWindowToVram(printer->printerTemplate.window); + } else { + printer->state = 0; + } + + return 3; + case 5: + printer->state = 0; + return 3; + case 6: + if (printer->delayCounter != 0) { + printer->delayCounter--; + } else { + printer->state = 0; + } + + return 3; } return 1; } -void sub_02002840(u16 flag) -{ +void sub_02002840(u16 flag) { unk00 = flag; } -void TextPrinterInitDownArrowCounters(struct TextPrinter *printer) -{ - struct TextPrinterSubStruct *subStruct = - (struct TextPrinterSubStruct *)(&printer->subStructFields); +void TextPrinterInitDownArrowCounters(struct TextPrinter *printer) { + struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&printer->subStructFields); - if (gTextFlags.autoScroll) - { + if (gTextFlags.autoScroll) { subStruct->autoScrollDelay = 0; return; } subStruct->downArrowYPosIdx = 0; - subStruct->downArrowDelay = 0; + subStruct->downArrowDelay = 0; } -void TextPrinterDrawDownArrow(struct TextPrinter *printer) -{ - struct TextPrinterSubStruct *subStruct = - (struct TextPrinterSubStruct *)(&printer->subStructFields); +void TextPrinterDrawDownArrow(struct TextPrinter *printer) { + struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&printer->subStructFields); - if (gTextFlags.autoScroll) - { + if (gTextFlags.autoScroll) { return; } - if (subStruct->downArrowDelay != 0) - { + if (subStruct->downArrowDelay != 0) { subStruct->downArrowDelay--; return; } u8 bg_id = GetWindowBgId(printer->printerTemplate.window); - u8 x = GetWindowX(printer->printerTemplate.window); - u8 y = GetWindowY(printer->printerTemplate.window); + u8 x = GetWindowX(printer->printerTemplate.window); + u8 y = GetWindowY(printer->printerTemplate.window); u8 width = GetWindowWidth(printer->printerTemplate.window); - u16 r6 = unk00; + u16 r6 = unk00; FillBgTilemapRect(printer->printerTemplate.window->bgConfig, bg_id, @@ -383,13 +336,12 @@ void TextPrinterDrawDownArrow(struct TextPrinter *printer) subStruct->downArrowYPosIdx++; } -void TextPrinterClearDownArrow(struct TextPrinter *printer) -{ +void TextPrinterClearDownArrow(struct TextPrinter *printer) { u8 bg_id = GetWindowBgId(printer->printerTemplate.window); - u8 x = GetWindowX(printer->printerTemplate.window); - u8 y = GetWindowY(printer->printerTemplate.window); + u8 x = GetWindowX(printer->printerTemplate.window); + u8 y = GetWindowY(printer->printerTemplate.window); u8 width = GetWindowWidth(printer->printerTemplate.window); - u16 r6 = unk00; + u16 r6 = unk00; FillBgTilemapRect(printer->printerTemplate.window->bgConfig, bg_id, @@ -410,11 +362,9 @@ void TextPrinterClearDownArrow(struct TextPrinter *printer) BgCommitTilemapBufferToVram(printer->printerTemplate.window->bgConfig, bg_id); } -BOOL TextPrinterContinue(struct TextPrinter *printer) -{ +BOOL TextPrinterContinue(struct TextPrinter *printer) { #pragma unused(printer) - if ((gSystem.newKeys & 3) != 0 || (gSystem.touchNew != 0 && gTextFlags.unk0_4 != 0)) - { + if ((gSystem.newKeys & 3) != 0 || (gSystem.touchNew != 0 && gTextFlags.unk0_4 != 0)) { PlaySE(SEQ_SE_DP_SELECT); gTextFlags.unk0_7 = 1; @@ -425,29 +375,23 @@ BOOL TextPrinterContinue(struct TextPrinter *printer) return FALSE; } -BOOL TextPrinterWaitAutoMode(struct TextPrinter *printer) -{ - struct TextPrinterSubStruct *subStruct = - (struct TextPrinterSubStruct *)(&printer->subStructFields); +BOOL TextPrinterWaitAutoMode(struct TextPrinter *printer) { + struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&printer->subStructFields); - if (subStruct->autoScrollDelay == 100) - { + if (subStruct->autoScrollDelay == 100) { return TRUE; } subStruct->autoScrollDelay++; - if (gTextFlags.unk0_5) - { + if (gTextFlags.unk0_5) { return TextPrinterContinue(printer); } return FALSE; } -BOOL TextPrinterWaitWithDownArrow(struct TextPrinter *printer) -{ - if (gTextFlags.autoScroll) - { +BOOL TextPrinterWaitWithDownArrow(struct TextPrinter *printer) { + if (gTextFlags.autoScroll) { return TextPrinterWaitAutoMode(printer); } TextPrinterDrawDownArrow(printer); @@ -455,48 +399,39 @@ BOOL TextPrinterWaitWithDownArrow(struct TextPrinter *printer) return TextPrinterContinue(printer); } -u8 TextPrinterWait(struct TextPrinter *printer) -{ - if (gTextFlags.autoScroll) - { +u8 TextPrinterWait(struct TextPrinter *printer) { + if (gTextFlags.autoScroll) { return (u8)TextPrinterWaitAutoMode(printer); } return (u8)TextPrinterContinue(printer); } -void TextFlags_SetCanABSpeedUpPrint(BOOL param0) -{ +void TextFlags_SetCanABSpeedUpPrint(BOOL param0) { gTextFlags.canABSpeedUpPrint = param0; } -void sub_02002B7C(s32 param0) -{ +void sub_02002B7C(s32 param0) { gTextFlags.autoScroll = param0 & 1; - gTextFlags.unk0_5 = (param0 >> 1) & 1; + gTextFlags.unk0_5 = (param0 >> 1) & 1; } -void sub_02002BB8(u32 param0) -{ +void sub_02002BB8(u32 param0) { gTextFlags.unk0_4 = param0; } -u8 sub_02002BD4() -{ +u8 sub_02002BD4() { return gTextFlags.unk0_6; } -void sub_02002BE4() -{ +void sub_02002BE4() { gTextFlags.unk0_6 = 0; } -u8 sub_02002BF4() -{ +u8 sub_02002BF4() { return gTextFlags.unk0_7; } -void sub_02002C04() -{ +void sub_02002C04() { gTextFlags.unk0_7 = 0; } diff --git a/arm9/src/render_window.c b/arm9/src/render_window.c index a18e79048..f1c273416 100644 --- a/arm9/src/render_window.c +++ b/arm9/src/render_window.c @@ -1,15 +1,18 @@ -#include "global.h" #include "render_window.h" -#include "filesystem.h" -#include "gf_gfx_loader.h" + +#include "global.h" + #include "graphic/field_board.naix" #include "graphic/winframe.naix" + +#include "filesystem.h" +#include "gf_gfx_loader.h" #include "pokemon.h" #include "render_text.h" #include "unk_020061E8.h" +#include "unk_02006D98.h" #include "unk_0200BB14.h" #include "unk_0200CA44.h" -#include "unk_02006D98.h" const struct UnkStruct_0200CABC_3 UNK_020ECE88 = { 10, @@ -54,10 +57,8 @@ extern u32 NNS_G2dGetImageLocation(u32, u32); extern void *sub_02012470(u16, u16, u16); extern u32 NNS_G2dGetImagePaletteLocation(u32, u32); -u32 sub_0200CABC(struct BgConfig *bgConfig, u32 layer, u32 numTiles, u32 param3, HeapID heapId) -{ - if (param3 == 0) - { +u32 sub_0200CABC(struct BgConfig *bgConfig, u32 layer, u32 numTiles, u32 param3, HeapID heapId) { + if (param3 == 0) { return GfGfxLoader_LoadCharData(NARC_GRAPHIC_WINFRAME, NARC_winframe_narc_0000_NCGR, bgConfig, @@ -78,36 +79,27 @@ u32 sub_0200CABC(struct BgConfig *bgConfig, u32 layer, u32 numTiles, u32 param3, heapId); } -s32 sub_0200CAFC(void) -{ +s32 sub_0200CAFC(void) { return NARC_winframe_narc_0024_NCLR; } -void LoadUserFrameGfx1(struct BgConfig *bg_config, enum GFBgLayer layer, u32 num_tiles, u32 paletteNumber, u8 frame_id, HeapID heapId) -{ +void LoadUserFrameGfx1(struct BgConfig *bg_config, enum GFBgLayer layer, u32 num_tiles, u32 paletteNumber, u8 frame_id, HeapID heapId) { s32 r1; - if (frame_id != 0) - { + if (frame_id != 0) { r1 = NARC_winframe_narc_0001_NCGR; - } - else - { + } else { r1 = NARC_winframe_narc_0000_NCGR; } GfGfxLoader_LoadCharData(NARC_GRAPHIC_WINFRAME, r1, bg_config, layer, num_tiles, 0, FALSE, heapId); - if (frame_id == 2) - { + if (frame_id == 2) { r1 = NARC_winframe_narc_0045_NCLR; - } - else - { + } else { r1 = NARC_winframe_narc_0024_NCLR; } - if ((u32)layer < GF_BG_LYR_SUB_FIRST) - { + if ((u32)layer < GF_BG_LYR_SUB_FIRST) { GfGfxLoader_GXLoadPal(NARC_GRAPHIC_WINFRAME, r1, GF_PAL_LOCATION_MAIN_BG, (enum GFPalSlotOffset)(paletteNumber << 5), 32, heapId); return; } @@ -122,8 +114,7 @@ void DrawFrame1(struct BgConfig *bgConfig, u8 width, u8 height, u8 paletteNum, - u16 fillValue) -{ + u16 fillValue) { FillBgTilemapRect(bgConfig, bgId, fillValue, (u8)(x - 1), (u8)(y - 1), 1, 1, paletteNum); FillBgTilemapRect(bgConfig, bgId, (u16)(fillValue + 1), x, (u8)(y - 1), width, 1, paletteNum); FillBgTilemapRect( @@ -140,8 +131,7 @@ void DrawFrame1(struct BgConfig *bgConfig, } void DrawFrameAndWindow1( - struct Window *window, BOOL copy_to_vram, u16 fill_value, u8 palette_num) -{ + struct Window *window, BOOL copy_to_vram, u16 fill_value, u8 palette_num) { DrawFrame1(window->bgConfig, GetWindowBgId(window), GetWindowX(window), @@ -151,14 +141,12 @@ void DrawFrameAndWindow1( palette_num, fill_value); - if (!copy_to_vram) - { + if (!copy_to_vram) { CopyWindowToVram(window); } } -void ClearFrameAndWindow1(struct Window *window, BOOL copy_to_vram) -{ +void ClearFrameAndWindow1(struct Window *window, BOOL copy_to_vram) { FillBgTilemapRect(window->bgConfig, GetWindowBgId(window), @@ -169,30 +157,25 @@ void ClearFrameAndWindow1(struct Window *window, BOOL copy_to_vram) (u8)(GetWindowHeight(window) + 2), 0); - if (!copy_to_vram) - { + if (!copy_to_vram) { ClearWindowTilemapAndCopyToVram(window); } } -s32 sub_0200CD60(s32 param0) -{ +s32 sub_0200CD60(s32 param0) { return param0 + 2; } -s32 sub_0200CD64(s32 param0) -{ +s32 sub_0200CD64(s32 param0) { return param0 + 25; } -void sub_0200CD68(struct BgConfig *bg_config, u32 layer, u32 num_tiles, u32 palNumber, u8 frame_id, HeapID heapId) -{ +void sub_0200CD68(struct BgConfig *bg_config, u32 layer, u32 num_tiles, u32 palNumber, u8 frame_id, HeapID heapId) { GfGfxLoader_LoadCharData( NARC_GRAPHIC_WINFRAME, sub_0200CD60(frame_id), bg_config, layer, num_tiles, 0, FALSE, heapId); - if (layer < GF_BG_LYR_SUB_FIRST) - { + if (layer < GF_BG_LYR_SUB_FIRST) { GfGfxLoader_GXLoadPal(NARC_GRAPHIC_WINFRAME, sub_0200CD64(frame_id), GF_PAL_LOCATION_MAIN_BG, (enum GFPalSlotOffset)(palNumber << 5), 32, heapId); return; } @@ -207,8 +190,7 @@ void DrawFrame2(struct BgConfig *bgConfig, u8 width, u8 height, u8 paletteNum, - u16 fillValue) -{ + u16 fillValue) { FillBgTilemapRect(bgConfig, bgId, fillValue, (u8)(x - 2), (u8)(y - 1), 1, 1, paletteNum); FillBgTilemapRect( bgConfig, bgId, (u16)(fillValue + 1), (u8)(x - 1), (u8)(y - 1), 1, 1, paletteNum); @@ -253,8 +235,7 @@ void DrawFrame2(struct BgConfig *bgConfig, paletteNum); } -void DrawWindowFrame2(struct Window *window, u32 fill_value, u32 palette_num) -{ +void DrawWindowFrame2(struct Window *window, u32 fill_value, u32 palette_num) { DrawFrame2(window->bgConfig, GetWindowBgId(window), GetWindowX(window), @@ -266,19 +247,16 @@ void DrawWindowFrame2(struct Window *window, u32 fill_value, u32 palette_num) } void DrawFrameAndWindow2( - struct Window *window, BOOL copy_to_vram, u16 fill_value, u8 palette_num) -{ + struct Window *window, BOOL copy_to_vram, u16 fill_value, u8 palette_num) { DrawWindowFrame2(window, fill_value, palette_num); - if (!copy_to_vram) - { + if (!copy_to_vram) { CopyWindowToVram(window); } sub_0200D18C(window, fill_value); } -void ClearFrameAndWindow2(struct Window *window, BOOL param1) -{ +void ClearFrameAndWindow2(struct Window *window, BOOL param1) { FillBgTilemapRect(window->bgConfig, GetWindowBgId(window), 0, @@ -288,8 +266,7 @@ void ClearFrameAndWindow2(struct Window *window, BOOL param1) (u8)(GetWindowHeight(window) + 2), 0); - if (!param1) - { + if (!param1) { ClearWindowTilemapAndCopyToVram(window); } } @@ -305,27 +282,25 @@ void BlitRect4Bit(u8 *srcPixels, u16 dstX, u16 dstY, u16 width, - u16 height) -{ + u16 height) { struct Bitmap src; src.pixels = srcPixels; - src.width = srcWidth; + src.width = srcWidth; src.height = srcHeight; struct Bitmap dst; dst.pixels = dstPixels; - dst.width = dstWidth; + dst.width = dstWidth; dst.height = dstHeight; BlitBitmapRect4Bit(&src, &dst, srcX, srcY, dstX, dstY, width, height, 0); } -void sub_0200D18C(struct Window *window, u16 fill_value) -{ +void sub_0200D18C(struct Window *window, u16 fill_value) { HeapID heapId = BgConfig_GetHeapId(window->bgConfig); - u8 bg_id = GetWindowBgId(window); + u8 bg_id = GetWindowBgId(window); - void *ptr = AllocFromHeap(heapId, 0x180); + void *ptr = AllocFromHeap(heapId, 0x180); void *charptr = BgGetCharPtr((u8)bg_id); NNSG2dCharacterData *pCharData; @@ -335,8 +310,7 @@ void sub_0200D18C(struct Window *window, u16 fill_value) NARC_GRAPHIC_WINFRAME, NARC_winframe_narc_0022_NCGR, FALSE, &pCharData, heapId); st30 = pCharData->pRawData; - for (u8 i = 0; i < 3; i++) - { + for (u8 i = 0; i < 3; i++) { memcpy(ptr + (i << 7), charptr + ((fill_value + 10) << 5), 0x20); memcpy(ptr + ((i << 7) + 0x20), charptr + ((fill_value + 11) << 5), 0x20); memcpy(ptr + ((i << 7) + 0x40), charptr + ((fill_value + 10) << 5), 0x20); @@ -351,8 +325,7 @@ void sub_0200D18C(struct Window *window, u16 fill_value) } void sub_0200D274( - struct BgConfig *bg_config, u8 bg_id, u16 param2, u8 param3, u8 param4, HeapID heapId) -{ + struct BgConfig *bg_config, u8 bg_id, u16 param2, u8 param3, u8 param4, HeapID heapId) { NNSG2dCharacterData *pCharData; void *stc = GfGfxLoader_GetCharData( @@ -360,16 +333,13 @@ void sub_0200D274( u8 *ptr = AllocFromHeap(heapId, 0x240); memcpy(ptr, pCharData->pRawData, 0x240); - for (u32 r3 = 0; r3 < 0x240; r3++) - { + for (u32 r3 = 0; r3 < 0x240; r3++) { u8 r6 = (u8)(ptr[r3] >> 4); u8 r2 = (u8)(ptr[r3] & 0xf); - if (r6 == 0) - { + if (r6 == 0) { r6 = param3; } - if (r2 == 0) - { + if (r2 == 0) { r2 = param3; } @@ -386,7 +356,7 @@ void sub_0200D300(struct BgConfig *bg_config, u8 bg_id, u16 numtiles, u8 palInde NNSG2dPaletteData *pPltData; void *st14; - st14 = AllocAndReadWholeNarcMemberByIdPair( NARC_GRAPHIC_FIELD_BOARD, NARC_field_board_narc_0001_NCLR, heapId); + st14 = AllocAndReadWholeNarcMemberByIdPair(NARC_GRAPHIC_FIELD_BOARD, NARC_field_board_narc_0001_NCLR, heapId); NNS_G2dGetUnpackedPaletteData(st14, &pPltData); BG_LoadPlttData(bg_id, pPltData->pRawData + param4 * 0x20, 0x20, (enum GFPalSlotOffset)(u16)(palIndex << 5)); FreeToHeapExplicit(heapId, st14); @@ -397,14 +367,10 @@ void sub_0200D300(struct BgConfig *bg_config, u8 bg_id, u16 numtiles, u8 palInde } void sub_0200D378( - struct BgConfig *bg_config, u8 bg_id, u16 numtiles, u8 param3, u16 param4, HeapID heapId) -{ - if (param3 == 0) - { + struct BgConfig *bg_config, u8 bg_id, u16 numtiles, u8 param3, u16 param4, HeapID heapId) { + if (param3 == 0) { param4 += 33; - } - else - { + } else { param4 += 2; } @@ -418,8 +384,7 @@ void DrawFrame3(struct BgConfig *bgConfig, u8 width, u8 height, u8 paletteNum, - u16 fillValue) -{ + u16 fillValue) { FillBgTilemapRect(bgConfig, bgId, fillValue, (u8)(x - 9), (u8)(y - 1), 1, 1, paletteNum); FillBgTilemapRect( bgConfig, bgId, (u16)(fillValue + 1), (u8)(x - 8), (u8)(y - 1), 1, 1, paletteNum); @@ -478,20 +443,17 @@ void DrawFrame3(struct BgConfig *bgConfig, paletteNum); } -void DrawWindowCorner(struct Window *window, u16 fillValue, u8 paletteNum) -{ +void DrawWindowCorner(struct Window *window, u16 fillValue, u8 paletteNum) { u16 i, j; u16 x, y; u8 bg_id; bg_id = GetWindowBgId(window); - x = (u16)(GetWindowX(window) - 7); - y = GetWindowY(window); + x = (u16)(GetWindowX(window) - 7); + y = GetWindowY(window); - for (i = 0; i < 4; i++) - { - for (j = 0; j < 6; j++) - { + for (i = 0; i < 4; i++) { + for (j = 0; j < 6; j++) { FillBgTilemapRect(window->bgConfig, bg_id, (u16)(fillValue + 6 * i + j), @@ -505,11 +467,9 @@ void DrawWindowCorner(struct Window *window, u16 fillValue, u8 paletteNum) } void DrawFrameAndWindow3( - struct Window *window, BOOL copy_to_vram, u16 fillValue, u8 paletteNum, u8 param4) -{ + struct Window *window, BOOL copy_to_vram, u16 fillValue, u8 paletteNum, u8 param4) { u8 bg_id = GetWindowBgId(window); - if (param4 <= 1) - { + if (param4 <= 1) { DrawFrame3(window->bgConfig, bg_id, GetWindowX(window), @@ -519,9 +479,7 @@ void DrawFrameAndWindow3( paletteNum, fillValue); DrawWindowCorner(window, (u16)(fillValue + 30), paletteNum); - } - else - { + } else { DrawFrame2(window->bgConfig, bg_id, GetWindowX(window), @@ -532,19 +490,16 @@ void DrawFrameAndWindow3( fillValue); } - if (!copy_to_vram) - { + if (!copy_to_vram) { CopyWindowToVram(window); } sub_0200D18C(window, fillValue); } -void ClearFrameAndWindow3(struct Window *window, u8 param1, BOOL copy_to_vram) -{ +void ClearFrameAndWindow3(struct Window *window, u8 param1, BOOL copy_to_vram) { u8 bg_id = GetWindowBgId(window); - if (param1 <= 1) - { + if (param1 <= 1) { FillBgTilemapRect(window->bgConfig, bg_id, 0, @@ -553,9 +508,7 @@ void ClearFrameAndWindow3(struct Window *window, u8 param1, BOOL copy_to_vram) (u8)(GetWindowWidth(window) + 11), (u8)(GetWindowHeight(window) + 2), 0); - } - else - { + } else { FillBgTilemapRect(window->bgConfig, bg_id, 0, @@ -566,8 +519,7 @@ void ClearFrameAndWindow3(struct Window *window, u8 param1, BOOL copy_to_vram) 0); } - if (!copy_to_vram) - { + if (!copy_to_vram) { ClearWindowTilemapAndCopyToVram(window); } } @@ -594,11 +546,11 @@ WaitingIcon *WaitingIcon_New(struct Window *window, u32 param1) { BlitRect4Bit(pCharData->pRawData, 0, 0, 0x10, 0x80, waitingIcon->unk004[0], 0x10, 0x80, 0, 0, 0x10, 0x80); FreeToHeap(r5); - waitingIcon->window = window; + waitingIcon->window = window; waitingIcon->fillValue = (u16)param1; - waitingIcon->unk486 = 0; - waitingIcon->unk487 = 0; - waitingIcon->unk488 = 0; + waitingIcon->unk486 = 0; + waitingIcon->unk487 = 0; + waitingIcon->unk488 = 0; sub_0200CA60(sub_0200DB7C, waitingIcon, 0); sub_0200D980(waitingIcon, 1); @@ -608,8 +560,8 @@ WaitingIcon *WaitingIcon_New(struct Window *window, u32 param1) { void sub_0200D980(WaitingIcon *waitingIcon, u32 param1) { u8 bg_id = GetWindowBgId(waitingIcon->window); - u8 x = GetWindowX(waitingIcon->window); - u8 y = GetWindowY(waitingIcon->window); + u8 x = GetWindowX(waitingIcon->window); + u8 y = GetWindowY(waitingIcon->window); u8 width = GetWindowWidth(waitingIcon->window); if (param1 == 2) { @@ -633,7 +585,7 @@ void sub_0200D980(WaitingIcon *waitingIcon, u32 param1) { } void sub_0200DB7C(u32 param0, void *param1) { - WaitingIcon *waitingIcon = (WaitingIcon *)param1; //todo: see if this matches using a param + WaitingIcon *waitingIcon = (WaitingIcon *)param1; // todo: see if this matches using a param if (waitingIcon->unk488 != 0) { if (waitingIcon->unk488 == 1) { @@ -666,9 +618,8 @@ void sub_0200DC24(WaitingIcon *waitingIcon) { waitingIcon->unk488 = 2; } -PokepicManager *DrawPokemonPicFromSpecies(struct BgConfig *bg_config, u8 bg_id, u8 param2, u8 param3, u8 param4, u16 numTiles, u16 species, u8 gender, HeapID heapId) -{ - s32 heap = heapId; //weirdness needed for matching +PokepicManager *DrawPokemonPicFromSpecies(struct BgConfig *bg_config, u8 bg_id, u8 param2, u8 param3, u8 param4, u16 numTiles, u16 species, u8 gender, HeapID heapId) { + s32 heap = heapId; // weirdness needed for matching struct UnkStruct_0200CABC_2 *r4 = sub_0200DD70(bg_config, bg_id, param2, param3, (HeapID)heap); sub_0200DDAC(r4, (HeapID)heap); sub_0200DDD8(r4); @@ -680,9 +631,8 @@ PokepicManager *DrawPokemonPicFromSpecies(struct BgConfig *bg_config, u8 bg_id, return &r4->pokepicManager; } -PokepicManager *DrawPokemonPicFromMon(struct BgConfig *bg_config, u8 bg_id, u8 param2, u8 param3, u8 param4, u16 numTiles, struct Pokemon *mon, HeapID heapId) -{ - s32 heap = heapId; //weirdness needed for matching +PokepicManager *DrawPokemonPicFromMon(struct BgConfig *bg_config, u8 bg_id, u8 param2, u8 param3, u8 param4, u16 numTiles, struct Pokemon *mon, HeapID heapId) { + s32 heap = heapId; // weirdness needed for matching struct UnkStruct_0200CABC_2 *r4 = sub_0200DD70(bg_config, bg_id, param2, param3, (HeapID)heap); sub_0200DDAC(r4, (HeapID)heap); sub_0200DDD8(r4); @@ -694,26 +644,23 @@ PokepicManager *DrawPokemonPicFromMon(struct BgConfig *bg_config, u8 bg_id, u8 p return &r4->pokepicManager; } -void sub_0200DCF8(SysTask *task, void *param1) -{ +void sub_0200DCF8(SysTask *task, void *param1) { struct UnkStruct_0200CABC_2 *unk = (struct UnkStruct_0200CABC_2 *)param1; - switch (unk->pokepicManager.unk00) - { - case 1: - ClearFramed10x10Square(unk); - sub_0200C3DC(unk->unk164); - ov05_021D99F8(unk); - sub_0200621C((s32)task); - return; - case 2: - unk->pokepicManager.unk00 = 3; - sub_02020130(*unk->unk164, 1); - break; - case 3: - if (sub_0202022C(*unk->unk164) == 6) - { - unk->pokepicManager.unk00 = 0; - } + switch (unk->pokepicManager.unk00) { + case 1: + ClearFramed10x10Square(unk); + sub_0200C3DC(unk->unk164); + ov05_021D99F8(unk); + sub_0200621C((s32)task); + return; + case 2: + unk->pokepicManager.unk00 = 3; + sub_02020130(*unk->unk164, 1); + break; + case 3: + if (sub_0202022C(*unk->unk164) == 6) { + unk->pokepicManager.unk00 = 0; + } } sub_020201E4(*unk->unk164, 0x1000); @@ -721,21 +668,19 @@ void sub_0200DCF8(SysTask *task, void *param1) } struct UnkStruct_0200CABC_2 *sub_0200DD70( - struct BgConfig *bg_config, u8 bg_id, u8 param2, u8 param3, HeapID heapId) -{ + struct BgConfig *bg_config, u8 bg_id, u8 param2, u8 param3, HeapID heapId) { struct UnkStruct_0200CABC_2 *res = sub_0201B6C8(sub_020061E8((SysTaskFunc)sub_0200DCF8, 0x170, 0, heapId)); res->pokepicManager.unk00 = 0; - res->bgConfig = bg_config; - res->bgId = bg_id; - res->x = param2; - res->y = param3; + res->bgConfig = bg_config; + res->bgId = bg_id; + res->x = param2; + res->y = param3; return res; } -void sub_0200DDAC(struct UnkStruct_0200CABC_2 *param0, HeapID heapId) -{ +void sub_0200DDAC(struct UnkStruct_0200CABC_2 *param0, HeapID heapId) { const u32 UNK_020ECEA8[] = { 0x01, @@ -748,16 +693,14 @@ void sub_0200DDAC(struct UnkStruct_0200CABC_2 *param0, HeapID heapId) ov05_021D959C(param0, UNK_020ECEA8, 1, heapId); } -void sub_0200DDD8(struct UnkStruct_0200CABC_2 *param0) -{ +void sub_0200DDD8(struct UnkStruct_0200CABC_2 *param0) { ov05_021D967C(param0, NARC_GRAPHIC_WINFRAME, NARC_winframe_narc_0049_NCLR, 0, 1, 1, 0x15CD5); ov05_021D96F4(param0, NARC_GRAPHIC_WINFRAME, NARC_winframe_narc_0047_NCER, 0, 0x15CD5); ov05_021D9708(param0, NARC_GRAPHIC_WINFRAME, NARC_winframe_narc_0046_NANR, 0, 0x15CD5); ov05_021D971C(param0, NARC_GRAPHIC_WINFRAME, NARC_winframe_narc_0048_NCGR, 0, 1, 0x15CD5); } -void sub_0200DE30(struct UnkStruct_0200CABC_2 *param0, u8 param1, u8 param2) -{ +void sub_0200DE30(struct UnkStruct_0200CABC_2 *param0, u8 param1, u8 param2) { u32 UNK_020ECEC0[] = { 0x00, 0x00, @@ -775,13 +718,12 @@ void sub_0200DE30(struct UnkStruct_0200CABC_2 *param0, u8 param1, u8 param2) }; ((u16 *)UNK_020ECEC0)[0] = (u16)((param1 + 5) * 8); ((u16 *)UNK_020ECEC0)[1] = (u16)((param2 + 5) * 8); - param0->unk164 = ov05_021D9820(param0, UNK_020ECEC0); + param0->unk164 = ov05_021D9820(param0, UNK_020ECEC0); sub_0201FDEC(param0->unk000); GfGfx_EngineBTogglePlanes(0x10, GX_PLANE_TOGGLE_ON); } -void sub_0200DE80(struct UnkStruct_0200CABC_2 *param0, u16 param1, u8 param2) -{ +void sub_0200DE80(struct UnkStruct_0200CABC_2 *param0, u16 param1, u8 param2) { struct UnkStruct_02006D98 *r7 = sub_02006D98((HeapID)param0->unk162); struct SomeDrawPokemonStruct stc; sub_02068C00(&stc, param1, param2, 2, 0, 0, 0); @@ -789,8 +731,7 @@ void sub_0200DE80(struct UnkStruct_0200CABC_2 *param0, u16 param1, u8 param2) sub_020072E8(r7); } -void sub_0200DEC0(struct UnkStruct_0200CABC_2 *param0, struct Pokemon *param1) -{ +void sub_0200DEC0(struct UnkStruct_0200CABC_2 *param0, struct Pokemon *param1) { struct UnkStruct_02006D98 *r6 = sub_02006D98((HeapID)param0->unk162); struct SomeDrawPokemonStruct st0; sub_02068B68(&st0, param1, 2); @@ -799,8 +740,7 @@ void sub_0200DEC0(struct UnkStruct_0200CABC_2 *param0, struct Pokemon *param1) } void sub_0200DEF4( - struct UnkStruct_0200CABC_2 *param0, struct SomeDrawPokemonStruct *param1) -{ + struct UnkStruct_0200CABC_2 *param0, struct SomeDrawPokemonStruct *param1) { void *r4 = AllocFromHeap((HeapID)param0->unk162, 0x1900); struct UnkStruct_0200CABC_3 st18 = UNK_020ECE98; @@ -817,16 +757,14 @@ void sub_0200DEF4( FreeToHeap(r4); void *res = sub_02012470(param1->unk0, param1->unk4, param0->unk162); - u32 r5 = - NNS_G2dGetImagePaletteLocation(sub_02009E54(sub_020094F0(param0->unk134, 0x15CD5), st4), 1); + u32 r5 = NNS_G2dGetImagePaletteLocation(sub_02009E54(sub_020094F0(param0->unk134, 0x15CD5), st4), 1); DC_FlushRange(res, 0x20); GX_LoadOBJPltt(res, r5, 0x20); FreeToHeap(res); } void DrawFramed10x10Square( - struct UnkStruct_0200CABC_2 *param0, u8 paletteNum, u16 fillValue) -{ + struct UnkStruct_0200CABC_2 *param0, u8 paletteNum, u16 fillValue) { FillBgTilemapRect(param0->bgConfig, param0->bgId, fillValue, @@ -903,8 +841,7 @@ void DrawFramed10x10Square( ScheduleBgTilemapBufferTransfer(param0->bgConfig, param0->bgId); } -void ClearFramed10x10Square(struct UnkStruct_0200CABC_2 *param0) -{ +void ClearFramed10x10Square(struct UnkStruct_0200CABC_2 *param0) { FillBgTilemapRect( param0->bgConfig, param0->bgId, 0, (u8)(param0->x - 1), (u8)(param0->y - 1), 12, 12, 0); ScheduleBgTilemapBufferTransfer(param0->bgConfig, param0->bgId); diff --git a/arm9/src/rs_migrate_string.c b/arm9/src/rs_migrate_string.c index 9a5516669..418dfa385 100644 --- a/arm9/src/rs_migrate_string.c +++ b/arm9/src/rs_migrate_string.c @@ -1,261 +1,261 @@ +#include "rs_migrate_string.h" + #include "global.h" + #include "string_util.h" -#include "rs_migrate_string.h" static const u16 conversion_table[][2] = { - {0x0001, 0x01DE}, // - {0x0003, 0x0003}, // あ - {0x0005, 0x0005}, // い - {0x0007, 0x0007}, // う - {0x0009, 0x0009}, // え - {0x000B, 0x000B}, // お - {0x000C, 0x000C}, // か - {0x000E, 0x000E}, // き - {0x0010, 0x0010}, // く - {0x0012, 0x0012}, // け - {0x0014, 0x0014}, // こ - {0x0016, 0x0016}, // さ - {0x0018, 0x0018}, // し - {0x001A, 0x001A}, // す - {0x001C, 0x001C}, // せ - {0x001E, 0x001E}, // そ - {0x0020, 0x0020}, // た - {0x0022, 0x0022}, // ち - {0x0025, 0x0025}, // つ - {0x0027, 0x0027}, // て - {0x0029, 0x0029}, // と - {0x002B, 0x002B}, // な - {0x002C, 0x002C}, // に - {0x002D, 0x002D}, // ぬ - {0x002E, 0x002E}, // ね - {0x002F, 0x002F}, // の - {0x0030, 0x0030}, // は - {0x0033, 0x0033}, // ひ - {0x0036, 0x0036}, // ふ - {0x0039, 0x0039}, // へ - {0x003C, 0x003C}, // ほ - {0x003F, 0x003F}, // ま - {0x0040, 0x0040}, // み - {0x0041, 0x0041}, // む - {0x0042, 0x0042}, // め - {0x0043, 0x0043}, // も - {0x0045, 0x0045}, // や - {0x0047, 0x0047}, // ゆ - {0x0049, 0x0049}, // よ - {0x004A, 0x004A}, // ら - {0x004B, 0x004B}, // り - {0x004C, 0x004C}, // る - {0x004D, 0x004D}, // れ - {0x004E, 0x004E}, // ろ - {0x004F, 0x004F}, // わ - {0x0050, 0x0050}, // を - {0x0051, 0x0051}, // ん - {0x0002, 0x0002}, // ぁ - {0x0004, 0x0004}, // ぃ - {0x0006, 0x0006}, // ぅ - {0x0008, 0x0008}, // ぇ - {0x000A, 0x000A}, // ぉ - {0x0044, 0x0044}, // ゃ - {0x0046, 0x0046}, // ゅ - {0x0048, 0x0048}, // ょ - {0x000D, 0x000D}, // が - {0x000F, 0x000F}, // ぎ - {0x0011, 0x0011}, // ぐ - {0x0013, 0x0013}, // げ - {0x0015, 0x0015}, // ご - {0x0017, 0x0017}, // ざ - {0x0019, 0x0019}, // じ - {0x001B, 0x001B}, // ず - {0x001D, 0x001D}, // ぜ - {0x001F, 0x001F}, // ぞ - {0x0021, 0x0021}, // だ - {0x0023, 0x0023}, // ぢ - {0x0026, 0x0026}, // づ - {0x0028, 0x0028}, // で - {0x002A, 0x002A}, // ど - {0x0031, 0x0031}, // ば - {0x0034, 0x0034}, // び - {0x0037, 0x0037}, // ぶ - {0x003A, 0x003A}, // べ - {0x003D, 0x003D}, // ぼ - {0x0032, 0x0032}, // ぱ - {0x0035, 0x0035}, // ぴ - {0x0038, 0x0038}, // ぷ - {0x003B, 0x003B}, // ぺ - {0x003E, 0x003E}, // ぽ - {0x0024, 0x0024}, // っ - {0x0053, 0x0053}, // ア - {0x0055, 0x0055}, // イ - {0x0057, 0x0057}, // ウ - {0x0059, 0x0059}, // エ - {0x005B, 0x005B}, // オ - {0x005C, 0x005C}, // カ - {0x005E, 0x005E}, // キ - {0x0060, 0x0060}, // ク - {0x0062, 0x0062}, // ケ - {0x0064, 0x0064}, // コ - {0x0066, 0x0066}, // サ - {0x0068, 0x0068}, // シ - {0x006A, 0x006A}, // ス - {0x006C, 0x006C}, // セ - {0x006E, 0x006E}, // ソ - {0x0070, 0x0070}, // タ - {0x0072, 0x0072}, // チ - {0x0075, 0x0075}, // ツ - {0x0077, 0x0077}, // テ - {0x0079, 0x0079}, // ト - {0x007B, 0x007B}, // ナ - {0x007C, 0x007C}, // ニ - {0x007D, 0x007D}, // ヌ - {0x007E, 0x007E}, // ネ - {0x007F, 0x007F}, // ノ - {0x0080, 0x0080}, // ハ - {0x0083, 0x0083}, // ヒ - {0x0086, 0x0086}, // フ - {0x0089, 0x0089}, // ヘ - {0x008C, 0x008C}, // ホ - {0x008F, 0x008F}, // マ - {0x0090, 0x0090}, // ミ - {0x0091, 0x0091}, // ム - {0x0092, 0x0092}, // メ - {0x0093, 0x0093}, // モ - {0x0095, 0x0095}, // ヤ - {0x0097, 0x0097}, // ユ - {0x0099, 0x0099}, // ヨ - {0x009A, 0x009A}, // ラ - {0x009B, 0x009B}, // リ - {0x009C, 0x009C}, // ル - {0x009D, 0x009D}, // レ - {0x009E, 0x009E}, // ロ - {0x009F, 0x009F}, // ワ - {0x00A0, 0x00A0}, // ヲ - {0x00A1, 0x00A1}, // ン - {0x0052, 0x0052}, // ァ - {0x0054, 0x0054}, // ィ - {0x0056, 0x0056}, // ゥ - {0x0058, 0x0058}, // ェ - {0x005A, 0x005A}, // ォ - {0x0094, 0x0094}, // ャ - {0x0096, 0x0096}, // ュ - {0x0098, 0x0098}, // ョ - {0x005D, 0x005D}, // ガ - {0x005F, 0x005F}, // ギ - {0x0061, 0x0061}, // グ - {0x0063, 0x0063}, // ゲ - {0x0065, 0x0065}, // ゴ - {0x0067, 0x0067}, // ザ - {0x0069, 0x0069}, // ジ - {0x006B, 0x006B}, // ズ - {0x006D, 0x006D}, // ゼ - {0x006F, 0x006F}, // ゾ - {0x0071, 0x0071}, // ダ - {0x0073, 0x0073}, // ヂ - {0x0076, 0x0076}, // ヅ - {0x0078, 0x0078}, // デ - {0x007A, 0x007A}, // ド - {0x0081, 0x0081}, // バ - {0x0084, 0x0084}, // ビ - {0x0087, 0x0087}, // ブ - {0x008A, 0x008A}, // ベ - {0x008D, 0x008D}, // ボ - {0x0082, 0x0082}, // パ - {0x0085, 0x0085}, // ピ - {0x0088, 0x0088}, // プ - {0x008B, 0x008B}, // ペ - {0x008E, 0x008E}, // ポ - {0x0074, 0x0074}, // ッ - {0x00A2, 0x0121}, // 0 - {0x00A3, 0x0122}, // 1 - {0x00A4, 0x0123}, // 2 - {0x00A5, 0x0124}, // 3 - {0x00A6, 0x0125}, // 4 - {0x00A7, 0x0126}, // 5 - {0x00A8, 0x0127}, // 6 - {0x00A9, 0x0128}, // 7 - {0x00AA, 0x0129}, // 8 - {0x00AB, 0x012A}, // 9 - {0x00E1, 0x01AB}, // ! - {0x00E2, 0x01AC}, // ? - {0x00E4, 0x01AE}, // . - {0x00F1, 0x01BE}, // - - {0x00E6, 0x01B0}, // · - {0x00E5, 0x01AF}, // … - {0x00EA, 0x00EA}, // “ - {0x00EB, 0x00EB}, // ” - {0x00E8, 0x01B2}, // ‘ - {0x00E9, 0x01B3}, // ' - {0x00EE, 0x01BB}, // ♂ - {0x00EF, 0x01BC}, // ♀ - {0x0112, 0x0112}, // ¥ - {0x00E3, 0x01AD}, // , - {0x00F2, 0x0176}, // × - {0x00E7, 0x01B1}, // / - {0x00AC, 0x012B}, // A - {0x00AD, 0x012C}, // B - {0x00AE, 0x012D}, // C - {0x00AF, 0x012E}, // D - {0x00B0, 0x012F}, // E - {0x00B1, 0x0130}, // F - {0x00B2, 0x0131}, // G - {0x00B3, 0x0132}, // H - {0x00B4, 0x0133}, // I - {0x00B5, 0x0134}, // J - {0x00B6, 0x0135}, // K - {0x00B7, 0x0136}, // L - {0x00B8, 0x0137}, // M - {0x00B9, 0x0138}, // N - {0x00BA, 0x0139}, // O - {0x00BB, 0x013A}, // P - {0x00BC, 0x013B}, // Q - {0x00BD, 0x013C}, // R - {0x00BE, 0x013D}, // S - {0x00BF, 0x013E}, // T - {0x00C0, 0x013F}, // U - {0x00C1, 0x0140}, // V - {0x00C2, 0x0141}, // W - {0x00C3, 0x0142}, // X - {0x00C4, 0x0143}, // Y - {0x00C5, 0x0144}, // Z - {0x00C6, 0x0145}, // a - {0x00C7, 0x0146}, // b - {0x00C8, 0x0147}, // c - {0x00C9, 0x0148}, // d - {0x00CA, 0x0149}, // e - {0x00CB, 0x014A}, // f - {0x00CC, 0x014B}, // g - {0x00CD, 0x014C}, // h - {0x00CE, 0x014D}, // i - {0x00CF, 0x014E}, // j - {0x00D0, 0x014F}, // k - {0x00D1, 0x0150}, // l - {0x00D2, 0x0151}, // m - {0x00D3, 0x0152}, // n - {0x00D4, 0x0153}, // o - {0x00D5, 0x0154}, // p - {0x00D6, 0x0155}, // q - {0x00D7, 0x0156}, // r - {0x00D8, 0x0157}, // s - {0x00D9, 0x0158}, // t - {0x00DA, 0x0159}, // u - {0x00DB, 0x015A}, // v - {0x00DC, 0x015B}, // w - {0x00DD, 0x015C}, // x - {0x00DE, 0x015D}, // y - {0x00DF, 0x015E}, // z - {0x011F, 0x011F}, // ▶ - {0x00F6, 0x01C4}, // : - {0x0163, 0x0163}, // Ä - {0x0175, 0x0175}, // Ö - {0x017B, 0x017B}, // Ü - {0x0183, 0x0183}, // ä - {0x0195, 0x0195}, // ö - {0x019B, 0x019B}, // ü + { 0x0001, 0x01DE }, // + { 0x0003, 0x0003 }, // あ + { 0x0005, 0x0005 }, // い + { 0x0007, 0x0007 }, // う + { 0x0009, 0x0009 }, // え + { 0x000B, 0x000B }, // お + { 0x000C, 0x000C }, // か + { 0x000E, 0x000E }, // き + { 0x0010, 0x0010 }, // く + { 0x0012, 0x0012 }, // け + { 0x0014, 0x0014 }, // こ + { 0x0016, 0x0016 }, // さ + { 0x0018, 0x0018 }, // し + { 0x001A, 0x001A }, // す + { 0x001C, 0x001C }, // せ + { 0x001E, 0x001E }, // そ + { 0x0020, 0x0020 }, // た + { 0x0022, 0x0022 }, // ち + { 0x0025, 0x0025 }, // つ + { 0x0027, 0x0027 }, // て + { 0x0029, 0x0029 }, // と + { 0x002B, 0x002B }, // な + { 0x002C, 0x002C }, // に + { 0x002D, 0x002D }, // ぬ + { 0x002E, 0x002E }, // ね + { 0x002F, 0x002F }, // の + { 0x0030, 0x0030 }, // は + { 0x0033, 0x0033 }, // ひ + { 0x0036, 0x0036 }, // ふ + { 0x0039, 0x0039 }, // へ + { 0x003C, 0x003C }, // ほ + { 0x003F, 0x003F }, // ま + { 0x0040, 0x0040 }, // み + { 0x0041, 0x0041 }, // む + { 0x0042, 0x0042 }, // め + { 0x0043, 0x0043 }, // も + { 0x0045, 0x0045 }, // や + { 0x0047, 0x0047 }, // ゆ + { 0x0049, 0x0049 }, // よ + { 0x004A, 0x004A }, // ら + { 0x004B, 0x004B }, // り + { 0x004C, 0x004C }, // る + { 0x004D, 0x004D }, // れ + { 0x004E, 0x004E }, // ろ + { 0x004F, 0x004F }, // わ + { 0x0050, 0x0050 }, // を + { 0x0051, 0x0051 }, // ん + { 0x0002, 0x0002 }, // ぁ + { 0x0004, 0x0004 }, // ぃ + { 0x0006, 0x0006 }, // ぅ + { 0x0008, 0x0008 }, // ぇ + { 0x000A, 0x000A }, // ぉ + { 0x0044, 0x0044 }, // ゃ + { 0x0046, 0x0046 }, // ゅ + { 0x0048, 0x0048 }, // ょ + { 0x000D, 0x000D }, // が + { 0x000F, 0x000F }, // ぎ + { 0x0011, 0x0011 }, // ぐ + { 0x0013, 0x0013 }, // げ + { 0x0015, 0x0015 }, // ご + { 0x0017, 0x0017 }, // ざ + { 0x0019, 0x0019 }, // じ + { 0x001B, 0x001B }, // ず + { 0x001D, 0x001D }, // ぜ + { 0x001F, 0x001F }, // ぞ + { 0x0021, 0x0021 }, // だ + { 0x0023, 0x0023 }, // ぢ + { 0x0026, 0x0026 }, // づ + { 0x0028, 0x0028 }, // で + { 0x002A, 0x002A }, // ど + { 0x0031, 0x0031 }, // ば + { 0x0034, 0x0034 }, // び + { 0x0037, 0x0037 }, // ぶ + { 0x003A, 0x003A }, // べ + { 0x003D, 0x003D }, // ぼ + { 0x0032, 0x0032 }, // ぱ + { 0x0035, 0x0035 }, // ぴ + { 0x0038, 0x0038 }, // ぷ + { 0x003B, 0x003B }, // ぺ + { 0x003E, 0x003E }, // ぽ + { 0x0024, 0x0024 }, // っ + { 0x0053, 0x0053 }, // ア + { 0x0055, 0x0055 }, // イ + { 0x0057, 0x0057 }, // ウ + { 0x0059, 0x0059 }, // エ + { 0x005B, 0x005B }, // オ + { 0x005C, 0x005C }, // カ + { 0x005E, 0x005E }, // キ + { 0x0060, 0x0060 }, // ク + { 0x0062, 0x0062 }, // ケ + { 0x0064, 0x0064 }, // コ + { 0x0066, 0x0066 }, // サ + { 0x0068, 0x0068 }, // シ + { 0x006A, 0x006A }, // ス + { 0x006C, 0x006C }, // セ + { 0x006E, 0x006E }, // ソ + { 0x0070, 0x0070 }, // タ + { 0x0072, 0x0072 }, // チ + { 0x0075, 0x0075 }, // ツ + { 0x0077, 0x0077 }, // テ + { 0x0079, 0x0079 }, // ト + { 0x007B, 0x007B }, // ナ + { 0x007C, 0x007C }, // ニ + { 0x007D, 0x007D }, // ヌ + { 0x007E, 0x007E }, // ネ + { 0x007F, 0x007F }, // ノ + { 0x0080, 0x0080 }, // ハ + { 0x0083, 0x0083 }, // ヒ + { 0x0086, 0x0086 }, // フ + { 0x0089, 0x0089 }, // ヘ + { 0x008C, 0x008C }, // ホ + { 0x008F, 0x008F }, // マ + { 0x0090, 0x0090 }, // ミ + { 0x0091, 0x0091 }, // ム + { 0x0092, 0x0092 }, // メ + { 0x0093, 0x0093 }, // モ + { 0x0095, 0x0095 }, // ヤ + { 0x0097, 0x0097 }, // ユ + { 0x0099, 0x0099 }, // ヨ + { 0x009A, 0x009A }, // ラ + { 0x009B, 0x009B }, // リ + { 0x009C, 0x009C }, // ル + { 0x009D, 0x009D }, // レ + { 0x009E, 0x009E }, // ロ + { 0x009F, 0x009F }, // ワ + { 0x00A0, 0x00A0 }, // ヲ + { 0x00A1, 0x00A1 }, // ン + { 0x0052, 0x0052 }, // ァ + { 0x0054, 0x0054 }, // ィ + { 0x0056, 0x0056 }, // ゥ + { 0x0058, 0x0058 }, // ェ + { 0x005A, 0x005A }, // ォ + { 0x0094, 0x0094 }, // ャ + { 0x0096, 0x0096 }, // ュ + { 0x0098, 0x0098 }, // ョ + { 0x005D, 0x005D }, // ガ + { 0x005F, 0x005F }, // ギ + { 0x0061, 0x0061 }, // グ + { 0x0063, 0x0063 }, // ゲ + { 0x0065, 0x0065 }, // ゴ + { 0x0067, 0x0067 }, // ザ + { 0x0069, 0x0069 }, // ジ + { 0x006B, 0x006B }, // ズ + { 0x006D, 0x006D }, // ゼ + { 0x006F, 0x006F }, // ゾ + { 0x0071, 0x0071 }, // ダ + { 0x0073, 0x0073 }, // ヂ + { 0x0076, 0x0076 }, // ヅ + { 0x0078, 0x0078 }, // デ + { 0x007A, 0x007A }, // ド + { 0x0081, 0x0081 }, // バ + { 0x0084, 0x0084 }, // ビ + { 0x0087, 0x0087 }, // ブ + { 0x008A, 0x008A }, // ベ + { 0x008D, 0x008D }, // ボ + { 0x0082, 0x0082 }, // パ + { 0x0085, 0x0085 }, // ピ + { 0x0088, 0x0088 }, // プ + { 0x008B, 0x008B }, // ペ + { 0x008E, 0x008E }, // ポ + { 0x0074, 0x0074 }, // ッ + { 0x00A2, 0x0121 }, // 0 + { 0x00A3, 0x0122 }, // 1 + { 0x00A4, 0x0123 }, // 2 + { 0x00A5, 0x0124 }, // 3 + { 0x00A6, 0x0125 }, // 4 + { 0x00A7, 0x0126 }, // 5 + { 0x00A8, 0x0127 }, // 6 + { 0x00A9, 0x0128 }, // 7 + { 0x00AA, 0x0129 }, // 8 + { 0x00AB, 0x012A }, // 9 + { 0x00E1, 0x01AB }, // ! + { 0x00E2, 0x01AC }, // ? + { 0x00E4, 0x01AE }, // . + { 0x00F1, 0x01BE }, // - + { 0x00E6, 0x01B0 }, // · + { 0x00E5, 0x01AF }, // … + { 0x00EA, 0x00EA }, // “ + { 0x00EB, 0x00EB }, // ” + { 0x00E8, 0x01B2 }, // ‘ + { 0x00E9, 0x01B3 }, // ' + { 0x00EE, 0x01BB }, // ♂ + { 0x00EF, 0x01BC }, // ♀ + { 0x0112, 0x0112 }, // ¥ + { 0x00E3, 0x01AD }, // , + { 0x00F2, 0x0176 }, // × + { 0x00E7, 0x01B1 }, // / + { 0x00AC, 0x012B }, // A + { 0x00AD, 0x012C }, // B + { 0x00AE, 0x012D }, // C + { 0x00AF, 0x012E }, // D + { 0x00B0, 0x012F }, // E + { 0x00B1, 0x0130 }, // F + { 0x00B2, 0x0131 }, // G + { 0x00B3, 0x0132 }, // H + { 0x00B4, 0x0133 }, // I + { 0x00B5, 0x0134 }, // J + { 0x00B6, 0x0135 }, // K + { 0x00B7, 0x0136 }, // L + { 0x00B8, 0x0137 }, // M + { 0x00B9, 0x0138 }, // N + { 0x00BA, 0x0139 }, // O + { 0x00BB, 0x013A }, // P + { 0x00BC, 0x013B }, // Q + { 0x00BD, 0x013C }, // R + { 0x00BE, 0x013D }, // S + { 0x00BF, 0x013E }, // T + { 0x00C0, 0x013F }, // U + { 0x00C1, 0x0140 }, // V + { 0x00C2, 0x0141 }, // W + { 0x00C3, 0x0142 }, // X + { 0x00C4, 0x0143 }, // Y + { 0x00C5, 0x0144 }, // Z + { 0x00C6, 0x0145 }, // a + { 0x00C7, 0x0146 }, // b + { 0x00C8, 0x0147 }, // c + { 0x00C9, 0x0148 }, // d + { 0x00CA, 0x0149 }, // e + { 0x00CB, 0x014A }, // f + { 0x00CC, 0x014B }, // g + { 0x00CD, 0x014C }, // h + { 0x00CE, 0x014D }, // i + { 0x00CF, 0x014E }, // j + { 0x00D0, 0x014F }, // k + { 0x00D1, 0x0150 }, // l + { 0x00D2, 0x0151 }, // m + { 0x00D3, 0x0152 }, // n + { 0x00D4, 0x0153 }, // o + { 0x00D5, 0x0154 }, // p + { 0x00D6, 0x0155 }, // q + { 0x00D7, 0x0156 }, // r + { 0x00D8, 0x0157 }, // s + { 0x00D9, 0x0158 }, // t + { 0x00DA, 0x0159 }, // u + { 0x00DB, 0x015A }, // v + { 0x00DC, 0x015B }, // w + { 0x00DD, 0x015C }, // x + { 0x00DE, 0x015D }, // y + { 0x00DF, 0x015E }, // z + { 0x011F, 0x011F }, // ▶ + { 0x00F6, 0x01C4 }, // : + { 0x0163, 0x0163 }, // Ä + { 0x0175, 0x0175 }, // Ö + { 0x017B, 0x017B }, // Ü + { 0x0183, 0x0183 }, // ä + { 0x0195, 0x0195 }, // ö + { 0x019B, 0x019B }, // ü }; -static u16 GetOpeningQuote(u32 language) -{ - switch (language) - { +static u16 GetOpeningQuote(u32 language) { + switch (language) { default: return 0xEA; case LANGUAGE_ENGLISH: @@ -269,10 +269,8 @@ static u16 GetOpeningQuote(u32 language) } } -static u16 GetClosingQuote(u32 language) -{ - switch (language) - { +static u16 GetClosingQuote(u32 language) { + switch (language) { default: return 0xEB; case LANGUAGE_ENGLISH: @@ -286,31 +284,28 @@ static u16 GetClosingQuote(u32 language) } } -BOOL ConvertRSStringToDPStringInternational(const u8 * rs_str, u16 * dp_str, u32 length, u32 language) -{ +BOOL ConvertRSStringToDPStringInternational(const u8 *rs_str, u16 *dp_str, u32 length, u32 language) { BOOL notFullWidth; u32 i; notFullWidth = (language != LANGUAGE_JAPANESE); - for (i = 0; i < length - 1; i++) - { - if (rs_str[i] == 0xFF) // RS: EOS + for (i = 0; i < length - 1; i++) { + if (rs_str[i] == 0xFF) { // RS: EOS break; + } if (rs_str[i] >= 0xF7) // RS: DYNAMIC { // If we're here, the provided name is corrupt. // Fill it with question marks. s32 r3 = (s32)((length - 1) < 10 ? (length - 1) : 10); s32 r1; - for (r1 = 0; r1 < r3; r1++) - { + for (r1 = 0; r1 < r3; r1++) { dp_str[r1] = 0x1AC; // DP: ? } dp_str[r1] = EOS; return FALSE; } - switch (conversion_table[rs_str[i]][notFullWidth]) - { + switch (conversion_table[rs_str[i]][notFullWidth]) { case 0xEA: // RS: Opening double quote dp_str[i] = GetOpeningQuote(language); break; diff --git a/arm9/src/sav_chatot.c b/arm9/src/sav_chatot.c index cfc766f60..be8ed9272 100644 --- a/arm9/src/sav_chatot.c +++ b/arm9/src/sav_chatot.c @@ -1,90 +1,79 @@ +#include "sav_chatot.h" + #include "global.h" + #include "MI_memory.h" #include "heap.h" -#include "sav_chatot.h" -u32 Save_Chatot_sizeof(void) -{ +u32 Save_Chatot_sizeof(void) { return sizeof(struct SaveChatotSoundClip); } -void Save_Chatot_Init(struct SaveChatotSoundClip * chatot) -{ +void Save_Chatot_Init(struct SaveChatotSoundClip *chatot) { MI_CpuClear32(chatot, sizeof(struct SaveChatotSoundClip)); chatot->exists = FALSE; } -struct SaveChatotSoundClip * Chatot_New(HeapID heapId) -{ - struct SaveChatotSoundClip * ret = (struct SaveChatotSoundClip *)AllocFromHeap(heapId, sizeof(struct SaveChatotSoundClip)); +struct SaveChatotSoundClip *Chatot_New(HeapID heapId) { + struct SaveChatotSoundClip *ret = (struct SaveChatotSoundClip *)AllocFromHeap(heapId, sizeof(struct SaveChatotSoundClip)); Save_Chatot_Init(ret); return ret; } -struct SaveChatotSoundClip * Save_Chatot_Get(struct SaveData * save) -{ - return (struct SaveChatotSoundClip *) SaveArray_Get(save, 22); +struct SaveChatotSoundClip *Save_Chatot_Get(struct SaveData *save) { + return (struct SaveChatotSoundClip *)SaveArray_Get(save, 22); } -BOOL Chatot_Exists(struct SaveChatotSoundClip * chatot) -{ +BOOL Chatot_Exists(struct SaveChatotSoundClip *chatot) { return chatot->exists; } -void Chatot_Invalidate(struct SaveChatotSoundClip * chatot) -{ +void Chatot_Invalidate(struct SaveChatotSoundClip *chatot) { chatot->exists = FALSE; } -s8 * Chatot_GetData(struct SaveChatotSoundClip * chatot) -{ +s8 *Chatot_GetData(struct SaveChatotSoundClip *chatot) { return chatot->data; } -static inline s8 transform(u8 value) -{ +static inline s8 transform(u8 value) { return (s8)(value - 8); } -void Chatot_Decode(s8 * dest, const s8 * data) -{ +void Chatot_Decode(s8 *dest, const s8 *data) { s32 i; s32 dest_i; u8 val; s8 val2; - for (dest_i = 0, i = 0; i < 1000; i++, dest_i += 2) - { - val = (u8)(data[i] & 0xF); - val2 = transform(val); + for (dest_i = 0, i = 0; i < 1000; i++, dest_i += 2) { + val = (u8)(data[i] & 0xF); + val2 = transform(val); dest[dest_i + 0] = (s8)(val2 << 4); - val = (u8)(data[i] >> 4); - val2 = transform(val); + val = (u8)(data[i] >> 4); + val2 = transform(val); dest[dest_i + 1] = (s8)(val2 << 4); } } -static inline u8 untransform(s8 val) -{ +static inline u8 untransform(s8 val) { val /= 16; return (u8)(val + 8); } -void Chatot_Encode(struct SaveChatotSoundClip * chatot, const s8 * data) -{ +void Chatot_Encode(struct SaveChatotSoundClip *chatot, const s8 *data) { s32 src_i; s32 i = 0; u8 val2; s8 val; chatot->exists = TRUE; - for (src_i = 0; src_i < 2000; src_i += 2) - { - val = data[src_i + 0]; - val2 = untransform(val); + for (src_i = 0; src_i < 2000; src_i += 2) { + val = data[src_i + 0]; + val2 = untransform(val); chatot->data[i] = (s8)val2; - val = data[src_i + 1]; + val = data[src_i + 1]; val2 = untransform(val); chatot->data[i] |= val2 << 4; @@ -92,7 +81,6 @@ void Chatot_Encode(struct SaveChatotSoundClip * chatot, const s8 * data) } } -void Chatot_Copy(struct SaveChatotSoundClip * dest, const struct SaveChatotSoundClip * src) -{ +void Chatot_Copy(struct SaveChatotSoundClip *dest, const struct SaveChatotSoundClip *src) { MI_CpuCopyFast(src, dest, sizeof(struct SaveChatotSoundClip)); } diff --git a/arm9/src/save.c b/arm9/src/save.c index 2ab62d393..ab9274f05 100644 --- a/arm9/src/save.c +++ b/arm9/src/save.c @@ -1,9 +1,11 @@ -#include "global.h" -#include "MI_memory.h" #include "save.h" -#include "heap.h" + +#include "global.h" + #include "CARD_backup.h" +#include "MI_memory.h" #include "OS_spinLock.h" +#include "heap.h" #include "save_data_read_error.h" #include "save_data_write_error.h" @@ -16,28 +18,26 @@ extern void sub_02016454(u8 mask); static BOOL saveWritten; static SaveData *sSaveDataPtr; -struct SaveData * SaveData_New(void) -{ - struct SaveData * save = AllocFromHeap(HEAP_ID_1, sizeof(struct SaveData)); +struct SaveData *SaveData_New(void) { + struct SaveData *save = AllocFromHeap(HEAP_ID_1, sizeof(struct SaveData)); MI_CpuClearFast(save, sizeof(struct SaveData)); - sSaveDataPtr = save; - save->flashOkay = SaveDetectFlash(); - save->saveFileExists = 0; - save->isNewGame = 1; + sSaveDataPtr = save; + save->flashOkay = SaveDetectFlash(); + save->saveFileExists = 0; + save->isNewGame = 1; save->largeSectorChanged = 1; MATH_CRC16InitTable(&save->crcTable); SaveData_InitSubstructs(save->arrayHeaders); sub_02023160(save->saveSlotSpecs, save->arrayHeaders); MI_CpuClearFast(save->unk_20218, 8); - switch (save->unk_00010 = sub_02022AD8(save)) - { + switch (save->unk_00010 = sub_02022AD8(save)) { case 1: save->largeSectorChanged = 0; // fallthrough case 2: Save_LoadDynamicRegion(save); save->saveFileExists = 1; - save->isNewGame = 0; + save->isNewGame = 0; break; case 0: case 3: @@ -47,37 +47,32 @@ struct SaveData * SaveData_New(void) return save; } -struct SaveData * sub_020225F8(void) -{ +struct SaveData *sub_020225F8(void) { GF_ASSERT(sSaveDataPtr != NULL); return sSaveDataPtr; } -void * SaveArray_Get(struct SaveData * save, int idx) -{ +void *SaveArray_Get(struct SaveData *save, int idx) { GF_ASSERT(idx < 36); return (void *)(save->dynamic_region + save->arrayHeaders[idx].offset); } -void * sub_02022634(struct SaveData * save, int idx) -{ +void *sub_02022634(struct SaveData *save, int idx) { return SaveArray_Get(save, idx); } // Sets bits at 0x021C491 // Clears bits at 0x021C491 -BOOL sub_0202263C(struct SaveData * save) -{ - u8 * r6 = AllocFromHeapAtEnd(HEAP_ID_MAIN, 0x1000); +BOOL sub_0202263C(struct SaveData *save) { + u8 *r6 = AllocFromHeapAtEnd(HEAP_ID_MAIN, 0x1000); sub_02016444(1); FlashClobberChunkFooter(save, 0, (u32)(save->unk_20220[0] == 0 ? 1 : 0)); FlashClobberChunkFooter(save, 1, (u32)(save->unk_20220[1] == 0 ? 1 : 0)); FlashClobberChunkFooter(save, 0, (u32)(save->unk_20220[0])); FlashClobberChunkFooter(save, 1, (u32)(save->unk_20220[1])); MI_CpuFillFast(r6, -1u, 0x1000); - for (int i = 0; i < 64; i++) - { + for (int i = 0; i < 64; i++) { FlashWriteChunk((u32)(0x1000 * i), r6, 0x1000); FlashWriteChunk((u32)(0x1000 * (i + 0x40)), r6, 0x1000); } @@ -88,25 +83,23 @@ BOOL sub_0202263C(struct SaveData * save) return TRUE; } -BOOL sub_020226FC(struct SaveData * save) -{ - if (save->flashOkay == 0) +BOOL sub_020226FC(struct SaveData *save) { + if (save->flashOkay == 0) { return FALSE; - if (Save_LoadDynamicRegion(save)) - { + } + if (Save_LoadDynamicRegion(save)) { save->saveFileExists = 1; - save->isNewGame = 0; + save->isNewGame = 0; return TRUE; } return FALSE; } -int SaveGame(struct SaveData * save) -{ - if (save->flashOkay == 0) +int SaveGame(struct SaveData *save) { + if (save->flashOkay == 0) { return 3; - if (save->isNewGame) - { + } + if (save->isNewGame) { sub_02016444(1); FlashClobberChunkFooter(save, 0, (u32)(save->unk_20220[0] == 0 ? 1 : 0)); FlashClobberChunkFooter(save, 1, (u32)(save->unk_20220[1] == 0 ? 1 : 0)); @@ -115,242 +108,207 @@ int SaveGame(struct SaveData * save) sub_02016454(1); } int ret = sub_02023044(save); - if (ret == 2) - { + if (ret == 2) { save->saveFileExists = 1; - save->isNewGame = 0; + save->isNewGame = 0; } return ret; } -void sub_020227A0(struct SaveData * save, int a1) -{ +void sub_020227A0(struct SaveData *save, int a1) { GF_ASSERT(a1 < 2); GF_ASSERT(save->isNewGame == 0); GF_ASSERT(save->saveFileExists == 1); sub_02022840(save, a1); int res; - do - { + do { res = sub_02022854(save); } while (res == 0 || res == 1); } -void Save_InitDynamicRegion(struct SaveData * save) -{ - save->isNewGame = 1; +void Save_InitDynamicRegion(struct SaveData *save) { + save->isNewGame = 1; save->largeSectorChanged = 1; Save_InitDynamicRegion_Internal(save->dynamic_region, save->arrayHeaders); } -int sub_020227FC(struct SaveData * save) -{ +int sub_020227FC(struct SaveData *save) { return save->flashOkay; } -int sub_02022800(struct SaveData * save) -{ +int sub_02022800(struct SaveData *save) { return save->unk_00010; } -u32 Save_FileExists(struct SaveData * save) -{ +u32 Save_FileExists(struct SaveData *save) { return save->saveFileExists; } -u32 Save_IsNewGame(struct SaveData * save) -{ +u32 Save_IsNewGame(struct SaveData *save) { return save->isNewGame; } -BOOL Save_FileDoesNotBelongToPlayer(struct SaveData * save) -{ - return (Save_IsNewGame(save) != 0 && Save_FileExists(save) != 0); +BOOL Save_FileDoesNotBelongToPlayer(struct SaveData *save) { + return Save_IsNewGame(save) != 0 && Save_FileExists(save) != 0; } -int Save_GetDirtyBit(struct SaveData * save) -{ +int Save_GetDirtyBit(struct SaveData *save) { return save->largeSectorChanged; } -void Save_SetDirtyBit(void) -{ +void Save_SetDirtyBit(void) { sSaveDataPtr->largeSectorChanged = 1; } -void sub_02022840(struct SaveData * save, int a1) -{ +void sub_02022840(struct SaveData *save, int a1) { sub_02022DFC(save, &save->asyncWriteMan, a1); } -int sub_02022854(struct SaveData * save) -{ +int sub_02022854(struct SaveData *save) { int r4 = sub_02022E78(save, &save->asyncWriteMan); - if (r4 != 0 && r4 != 1) - { + if (r4 != 0 && r4 != 1) { sub_02022F80(save, &save->asyncWriteMan, r4); } return r4; } -void sub_0202287C(struct SaveData * save) -{ +void sub_0202287C(struct SaveData *save) { sub_02022FF0(save, &save->asyncWriteMan); } -void sub_0202288C(struct UnkStruct_0202288C * header) -{ - header->unk_0 = 0; +void sub_0202288C(struct UnkStruct_0202288C *header) { + header->unk_0 = 0; header->offset = 0; - header->size = 0; + header->size = 0; } -u16 sub_02022898(struct SaveData * save, void * data, u32 size) -{ +u16 sub_02022898(struct SaveData *save, void *data, u32 size) { return MATH_CalcCRC16CCITT(&save->crcTable, data, size - 20); } -u32 GetChunkOffsetFromCurrentSaveSlot(u32 slot, struct SaveSlotSpec * header) -{ +u32 GetChunkOffsetFromCurrentSaveSlot(u32 slot, struct SaveSlotSpec *header) { u32 offset; - if (slot == 0) + if (slot == 0) { offset = 0; - else + } else { offset = 0x40000; + } return offset + header->offset; } -struct SaveChunkFooter * sub_020228B8(struct SaveData * save, u8 * offset, int idx) -{ - u8 * r4; - struct SaveSlotSpec * spec; +struct SaveChunkFooter *sub_020228B8(struct SaveData *save, u8 *offset, int idx) { + u8 *r4; + struct SaveSlotSpec *spec; spec = &save->saveSlotSpecs[idx]; - r4 = offset + spec->offset; + r4 = offset + spec->offset; GF_ASSERT(spec->size != 0); return (struct SaveChunkFooter *)(r4 + spec->size - 20); } -BOOL sub_020228E0(struct SaveData * save, void * data, int idx) -{ - struct SaveChunkFooter * r4; - struct SaveSlotSpec * spec; +BOOL sub_020228E0(struct SaveData *save, void *data, int idx) { + struct SaveChunkFooter *r4; + struct SaveSlotSpec *spec; - spec = &save->saveSlotSpecs[idx]; - r4 = sub_020228B8(save, data, idx); - u32 size = spec->size; + spec = &save->saveSlotSpecs[idx]; + r4 = sub_020228B8(save, data, idx); + u32 size = spec->size; u32 offset = spec->offset; - if (r4->size != size) + if (r4->size != size) { return FALSE; - if (r4->magic != 0x20060623) + } + if (r4->magic != 0x20060623) { return FALSE; - if (r4->unk_10 != idx) + } + if (r4->unk_10 != idx) { return FALSE; + } return r4->crc == sub_02022898(save, (u8 *)data + offset, size); } -void sub_0202293C(struct UnkStruct_0202288C * r5, struct SaveData * save, void * data, int idx) -{ - struct SaveChunkFooter * r4; - r4 = sub_020228B8(save, data, idx); - r5->unk_0 = sub_020228E0(save, data, idx); +void sub_0202293C(struct UnkStruct_0202288C *r5, struct SaveData *save, void *data, int idx) { + struct SaveChunkFooter *r4; + r4 = sub_020228B8(save, data, idx); + r5->unk_0 = sub_020228E0(save, data, idx); r5->offset = r4->unk_0; - r5->size = r4->offset; + r5->size = r4->offset; } -void sub_02022968(struct SaveData * save, void * data, int idx) -{ - struct SaveChunkFooter * r4; - struct SaveSlotSpec * spec; +void sub_02022968(struct SaveData *save, void *data, int idx) { + struct SaveChunkFooter *r4; + struct SaveSlotSpec *spec; - spec = &save->saveSlotSpecs[idx]; - r4 = sub_020228B8(save, data, idx); - data = (void *)((u8 *)data + spec->offset); - r4->unk_0 = save->unk_20214; + spec = &save->saveSlotSpecs[idx]; + r4 = sub_020228B8(save, data, idx); + data = (void *)((u8 *)data + spec->offset); + r4->unk_0 = save->unk_20214; r4->offset = save->unk_20218[idx]; - r4->size = spec->size; - r4->magic = 0x20060623; + r4->size = spec->size; + r4->magic = 0x20060623; r4->unk_10 = (u8)idx; - r4->crc = sub_02022898(save, data, spec->size); + r4->crc = sub_02022898(save, data, spec->size); } -int sub_020229B8(u32 x, u32 y) -{ - if (x == -1u && y == 0) +int sub_020229B8(u32 x, u32 y) { + if (x == -1u && y == 0) { return -1; - if (x == 0 && y == -1u) + } + if (x == 0 && y == -1u) { return 1; - if (x > y) + } + if (x > y) { return 1; + } return -(x < y); } -int sub_020229F0(struct UnkStruct_0202288C * r7, struct UnkStruct_0202288C * r6, u32 * r5, u32 * r4) -{ +int sub_020229F0(struct UnkStruct_0202288C *r7, struct UnkStruct_0202288C *r6, u32 *r5, u32 *r4) { int sp0 = sub_020229B8(r7->offset, r6->offset); - int r0 = sub_020229B8(r7->size, r6->size); - if (r7->unk_0 != 0 && r6->unk_0 != 0) - { - if (sp0 > 0) - { + int r0 = sub_020229B8(r7->size, r6->size); + if (r7->unk_0 != 0 && r6->unk_0 != 0) { + if (sp0 > 0) { GF_ASSERT(r0 > 0); *r5 = 0; *r4 = 1; - } - else if (sp0 < 0) - { + } else if (sp0 < 0) { GF_ASSERT(r0 < 0); *r5 = 1; *r4 = 0; - } - else if (r0 > 0) - { + } else if (r0 > 0) { *r5 = 0; *r4 = 1; - } - else if (r0 < 0) - { + } else if (r0 < 0) { *r5 = 1; *r4 = 0; - } - else - { + } else { *r5 = 0; *r4 = 1; } return 2; - } - else if (r7->unk_0 != 0 && r6->unk_0 == 0) - { + } else if (r7->unk_0 != 0 && r6->unk_0 == 0) { *r5 = 0; *r4 = 2; return 1; - } - else if (r7->unk_0 == 0 && r6->unk_0 != 0) - { + } else if (r7->unk_0 == 0 && r6->unk_0 != 0) { *r5 = 1; *r4 = 2; return 1; - } - else - { + } else { *r5 = 2; *r4 = 2; return 0; } } -void sub_02022AA0(struct SaveData * save, struct UnkStruct_0202288C * a1, struct UnkStruct_0202288C * a2, u32 a3, u32 a4) -{ - save->unk_20214 = a1[a3].offset; +void sub_02022AA0(struct SaveData *save, struct UnkStruct_0202288C *a1, struct UnkStruct_0202288C *a2, u32 a3, u32 a4) { + save->unk_20214 = a1[a3].offset; save->unk_20218[0] = a1[a3].size; save->unk_20218[1] = a2[a4].size; save->unk_20220[0] = (u8)a3; save->unk_20220[1] = (u8)a4; } -int sub_02022AD8(struct SaveData * save) -{ +int sub_02022AD8(struct SaveData *save) { struct UnkStruct_0202288C sp2C[2]; struct UnkStruct_0202288C sp14[2]; u32 sp10; @@ -360,23 +318,17 @@ int sub_02022AD8(struct SaveData * save) { u8 *r6 = AllocFromHeapAtEnd(HEAP_ID_MAIN, 0x20000); u8 *r4 = AllocFromHeapAtEnd(HEAP_ID_MAIN, 0x20000); - if (FlashLoadChunk(0, r6, 0x20000)) - { + if (FlashLoadChunk(0, r6, 0x20000)) { sub_0202293C(&sp2C[0], save, r6, 0); sub_0202293C(&sp14[0], save, r6, 1); - } - else - { + } else { sub_0202288C(&sp2C[0]); sub_0202288C(&sp14[0]); } - if (FlashLoadChunk(0x40000, r4, 0x20000)) - { + if (FlashLoadChunk(0x40000, r4, 0x20000)) { sub_0202293C(&sp2C[1], save, r4, 0); sub_0202293C(&sp14[1], save, r4, 1); - } - else - { + } else { sub_0202288C(&sp2C[1]); sub_0202288C(&sp14[1]); } @@ -387,61 +339,41 @@ int sub_02022AD8(struct SaveData * save) int r4, r0; r4 = sub_020229F0(&sp2C[0], &sp2C[1], &sp10, &sp8); r0 = sub_020229F0(&sp14[0], &sp14[1], &spC, &sp4); - if (r4 == 0 && r0 == 0) + if (r4 == 0 && r0 == 0) { return 0; - else if (r4 == 0 || r0 == 0) + } else if (r4 == 0 || r0 == 0) { return 3; - else if (r4 == 2 && r0 == 2) - { - if (sp2C[sp10].offset == sp14[spC].offset) - { + } else if (r4 == 2 && r0 == 2) { + if (sp2C[sp10].offset == sp14[spC].offset) { sub_02022AA0(save, sp2C, sp14, sp10, spC); return 1; - } - else - { + } else { sub_02022AA0(save, sp2C, sp14, sp8, spC); return 2; } - } - else if (r4 == 1 && r0 == 2) - { - if (sp2C[sp10].offset == sp14[spC].offset) - { + } else if (r4 == 1 && r0 == 2) { + if (sp2C[sp10].offset == sp14[spC].offset) { sub_02022AA0(save, sp2C, sp14, sp10, spC); return 2; - } - else if (sp2C[sp10].offset == sp14[sp4].offset) - { + } else if (sp2C[sp10].offset == sp14[sp4].offset) { sub_02022AA0(save, sp2C, sp14, sp10, sp4); return 2; - } - else - { + } else { return 3; } - } - else if (r4 == 2 && r0 == 1) - { - if (sp2C[sp10].offset == sp14[spC].offset) - { + } else if (r4 == 2 && r0 == 1) { + if (sp2C[sp10].offset == sp14[spC].offset) { sub_02022AA0(save, sp2C, sp14, sp10, spC); return 1; - } - else - { + } else { sub_02022AA0(save, sp2C, sp14, sp8, spC); return 2; } - } - else if (r4 == 1 && r0 == 1 && sp10 == spC) - { + } else if (r4 == 1 && r0 == 1 && sp10 == spC) { GF_ASSERT(sp2C[sp10].offset == sp14[spC].offset); sub_02022AA0(save, sp2C, sp14, sp10, spC); return 1; - } - else - { + } else { GF_ASSERT(sp2C[sp10].offset == sp14[spC].offset); sub_02022AA0(save, sp2C, sp14, sp10, spC); return 2; @@ -449,92 +381,82 @@ int sub_02022AD8(struct SaveData * save) } } -BOOL FlashLoadChunkIntoDynamicRegionFromHeader(u32 slot, struct SaveSlotSpec * header, u8 * dest) -{ +BOOL FlashLoadChunkIntoDynamicRegionFromHeader(u32 slot, struct SaveSlotSpec *header, u8 *dest) { return FlashLoadChunk(GetChunkOffsetFromCurrentSaveSlot(slot, header), dest + header->offset, header->size); } -BOOL Save_LoadDynamicRegion(struct SaveData * save) -{ - for (int i = 0; i < 2; i++) - { - if (!FlashLoadChunkIntoDynamicRegionFromHeader(save->unk_20220[i], &save->saveSlotSpecs[i], save->dynamic_region)) return FALSE; - if (!sub_020228E0(save, save->dynamic_region, i)) return FALSE; +BOOL Save_LoadDynamicRegion(struct SaveData *save) { + for (int i = 0; i < 2; i++) { + if (!FlashLoadChunkIntoDynamicRegionFromHeader(save->unk_20220[i], &save->saveSlotSpecs[i], save->dynamic_region)) { + return FALSE; + } + if (!sub_020228E0(save, save->dynamic_region, i)) { + return FALSE; + } } return TRUE; } -int sub_02022D54(struct SaveData * save, int chunk, u8 slot) -{ - struct SaveSlotSpec * header = &save->saveSlotSpecs[chunk]; +int sub_02022D54(struct SaveData *save, int chunk, u8 slot) { + struct SaveSlotSpec *header = &save->saveSlotSpecs[chunk]; sub_02022968(save, save->dynamic_region, chunk); return FlashWriteChunkInternal(GetChunkOffsetFromCurrentSaveSlot(slot, header), save->dynamic_region + header->offset, header->size - 20); } -int sub_02022D94(struct SaveData * save, int chunk, u8 slot) -{ - struct SaveSlotSpec * header = &save->saveSlotSpecs[chunk]; - u32 size = header->size; +int sub_02022D94(struct SaveData *save, int chunk, u8 slot) { + struct SaveSlotSpec *header = &save->saveSlotSpecs[chunk]; + u32 size = header->size; return FlashWriteChunkInternal(GetChunkOffsetFromCurrentSaveSlot(slot, header) + size - 20, save->dynamic_region + header->offset + size - 20, 20); } -int sub_02022DC8(struct SaveData * save, int chunk, u8 slot) -{ - struct SaveSlotSpec * header = &save->saveSlotSpecs[chunk]; - u32 size = header->size; +int sub_02022DC8(struct SaveData *save, int chunk, u8 slot) { + struct SaveSlotSpec *header = &save->saveSlotSpecs[chunk]; + u32 size = header->size; return FlashWriteChunkInternal(GetChunkOffsetFromCurrentSaveSlot(slot, header) + size - 12, save->dynamic_region + header->offset + size - 12, 8); } -void sub_02022DFC(struct SaveData * save, struct AsyncWriteManager * a1, int a2) -{ - for (int i = 0; i < 2; i++) - { +void sub_02022DFC(struct SaveData *save, struct AsyncWriteManager *a1, int a2) { + for (int i = 0; i < 2; i++) { a1->unk_1C[i] = save->unk_20218[i]; save->unk_20218[i]++; } - a1->state = 0; + a1->state = 0; a1->rollbackCounter = 0; - if (a2 == 2) - { - if (save->largeSectorChanged) - { + if (a2 == 2) { + if (save->largeSectorChanged) { a1->rollbackCounter = 1; - a1->count = save->unk_20214; + a1->count = save->unk_20214; save->unk_20214++; - a1->unk_4 = 0; - a1->curSector = 0; + a1->unk_4 = 0; + a1->curSector = 0; a1->numSectors = 2; - } - else - { - a1->unk_4 = 0; - a1->curSector = 0; + } else { + a1->unk_4 = 0; + a1->curSector = 0; a1->numSectors = 1; } - } - else - { - a1->unk_4 = a2; - a1->curSector = a2; + } else { + a1->unk_4 = a2; + a1->curSector = a2; a1->numSectors = a2 + 1; } sub_02016444(1); } -int sub_02022E78(struct SaveData * save, struct AsyncWriteManager * a1) -{ +int sub_02022E78(struct SaveData *save, struct AsyncWriteManager *a1) { BOOL sp0; - switch (a1->state) - { + switch (a1->state) { case 0: a1->lockId = sub_02022D54(save, a1->curSector, (u8)(save->unk_20220[a1->curSector] == 0)); a1->state++; // fallthrough case 1: - if (!WaitFlashWrite(a1->lockId, &sp0)) + if (!WaitFlashWrite(a1->lockId, &sp0)) { break; - if (sp0 == 0) + } + if (sp0 == 0) { return 3; + } a1->state++; // fallthrough case 2: @@ -542,69 +464,66 @@ int sub_02022E78(struct SaveData * save, struct AsyncWriteManager * a1) a1->state++; // fallthrough case 3: - if (!WaitFlashWrite(a1->lockId, &sp0)) + if (!WaitFlashWrite(a1->lockId, &sp0)) { break; - if (sp0 == 0) + } + if (sp0 == 0) { return 3; + } a1->state++; - if (a1->curSector + 1 == a1->numSectors) + if (a1->curSector + 1 == a1->numSectors) { return 1; + } // fallthrough case 4: a1->lockId = sub_02022D94(save, a1->curSector, (u8)(save->unk_20220[a1->curSector] == 0)); a1->state++; // fallthrough case 5: - if (!WaitFlashWrite(a1->lockId, &sp0)) + if (!WaitFlashWrite(a1->lockId, &sp0)) { break; - if (sp0 == 0) + } + if (sp0 == 0) { return 3; + } a1->curSector++; - if (a1->curSector == a1->numSectors) + if (a1->curSector == a1->numSectors) { return 2; + } a1->state = 0; break; } return 0; } -void sub_02022F80(struct SaveData * save, struct AsyncWriteManager * a1, int a2) -{ +void sub_02022F80(struct SaveData *save, struct AsyncWriteManager *a1, int a2) { int i; - if (a2 == 3) - { - if (a1->rollbackCounter) - { + if (a2 == 3) { + if (a1->rollbackCounter) { save->unk_20214 = a1->count; } - for (i = 0; i < 2; i++) - { + for (i = 0; i < 2; i++) { save->unk_20218[i] = a1->unk_1C[i]; } - } - else - { - for (i = a1->unk_4; i < a1->numSectors; i++) - { + } else { + for (i = a1->unk_4; i < a1->numSectors; i++) { save->unk_20220[i] = (u8)(save->unk_20220[i] == 0); } - save->saveFileExists = 1; - save->isNewGame = 0; + save->saveFileExists = 1; + save->isNewGame = 0; save->largeSectorChanged = 0; } sub_02016454(1); } -void sub_02022FF0(struct SaveData * save, struct AsyncWriteManager * a1) -{ - if (a1->rollbackCounter) +void sub_02022FF0(struct SaveData *save, struct AsyncWriteManager *a1) { + if (a1->rollbackCounter) { save->unk_20214 = a1->count; - for (int i = 0; i < 2; i++) - { + } + for (int i = 0; i < 2; i++) { save->unk_20218[i] = a1->unk_1C[i]; } - if (!CARD_TryWaitBackupAsync()) - { + if (!CARD_TryWaitBackupAsync()) { CARD_CancelBackupAsync(); CARD_UnlockBackup((u16)a1->lockId); OS_ReleaseLockID((u16)a1->lockId); @@ -612,75 +531,67 @@ void sub_02022FF0(struct SaveData * save, struct AsyncWriteManager * a1) sub_02016454(1); } -int sub_02023044(struct SaveData * save) -{ +int sub_02023044(struct SaveData *save) { int r4; struct AsyncWriteManager sp0; sub_02022DFC(save, &sp0, 2); - do - { + do { r4 = sub_02022E78(save, &sp0); } while (r4 == 0 || r4 == 1); sub_02022F80(save, &sp0, r4); return r4; } -int FlashClobberChunkFooter(struct SaveData * save, int x, u32 y) -{ +int FlashClobberChunkFooter(struct SaveData *save, int x, u32 y) { u8 sp0[20]; - struct SaveSlotSpec * spec = &save->saveSlotSpecs[x]; + struct SaveSlotSpec *spec = &save->saveSlotSpecs[x]; MI_CpuFill8(sp0, 0xFF, 20); return FlashWriteChunk((u32)(GetChunkOffsetFromCurrentSaveSlot(y, spec) + spec->size - 20), sp0, 20); } -u32 SaveArray_sizeof(int idx) -{ - const struct SaveChunkHeader * sch = UNK_020EE700; +u32 SaveArray_sizeof(int idx) { + const struct SaveChunkHeader *sch = UNK_020EE700; GF_ASSERT(idx < UNK_020EE6DC); s32 ret = (s32)sch[idx].sizeFunc(); ret += (4 - (ret % 4)); return (u32)ret; } -void SaveData_InitSubstructs(struct SaveArrayHeader * headers) -{ - const struct SaveChunkHeader * sch = UNK_020EE700; - s32 offset = 0; +void SaveData_InitSubstructs(struct SaveArrayHeader *headers) { + const struct SaveChunkHeader *sch = UNK_020EE700; + s32 offset = 0; GF_ASSERT(UNK_020EE6DC == 36); - for (int i = 0; i < UNK_020EE6DC; i++) - { + for (int i = 0; i < UNK_020EE6DC; i++) { GF_ASSERT(i == sch[i].id); - headers[i].id = sch[i].id; - headers[i].size = SaveArray_sizeof(i); + headers[i].id = sch[i].id; + headers[i].size = SaveArray_sizeof(i); headers[i].offset = (u32)offset; - headers[i].crc = 0; - headers[i].slot = (u16)sch[i].linkedId; + headers[i].crc = 0; + headers[i].slot = (u16)sch[i].linkedId; offset += headers[i].size; - if (i == UNK_020EE6DC - 1 || sch[i].linkedId != sch[i + 1].linkedId) + if (i == UNK_020EE6DC - 1 || sch[i].linkedId != sch[i + 1].linkedId) { offset += 20; + } } GF_ASSERT(offset <= 0x20000); } -void sub_02023160(struct SaveSlotSpec * spec, struct SaveArrayHeader * headers) -{ - int i = 0; +void sub_02023160(struct SaveSlotSpec *spec, struct SaveArrayHeader *headers) { + int i = 0; int sp4 = 0; u32 r12 = 0; - int j = 0; - for (i = 0; i < 2; i++) - { - spec[i].id = (u8)i; + int j = 0; + for (i = 0; i < 2; i++) { + spec[i].id = (u8)i; spec[i].size = 0; - while (i == headers[j].slot && j < UNK_020EE6DC) - { + while (i == headers[j].slot && j < UNK_020EE6DC) { spec[i].size += headers[j].size; j++; } spec[i].size += 20; spec[i].firstPage = (u8)sp4; - spec[i].offset = r12; - spec[i].numPages = (u8)((spec[i].size + 0xFFF) / 0x1000); + spec[i].offset = r12; + spec[i].numPages = (u8)((spec[i].size + 0xFFF) / 0x1000); sp4 += spec[i].numPages; r12 += spec[i].size; } @@ -688,65 +599,59 @@ void sub_02023160(struct SaveSlotSpec * spec, struct SaveArrayHeader * headers) GF_ASSERT(sp4 <= 32); } -void Save_InitDynamicRegion_Internal(u8 * dynamic_region, struct SaveArrayHeader * headers) -{ - const struct SaveChunkHeader * sch = UNK_020EE700; +void Save_InitDynamicRegion_Internal(u8 *dynamic_region, struct SaveArrayHeader *headers) { + const struct SaveChunkHeader *sch = UNK_020EE700; MI_CpuClearFast(dynamic_region, 0x20000); - for (int i = 0; i < UNK_020EE6DC; i++) - { + for (int i = 0; i < UNK_020EE6DC; i++) { u32 offset = headers[i].offset; MI_CpuClearFast(dynamic_region + offset, headers[i].size); sch[i].initFunc((void *)(dynamic_region + offset)); } } -void CreateChunkFooter(struct SaveData * save, u8 * data, int id, u32 size) -{ - struct SaveArrayFooter * footer = (struct SaveArrayFooter *)(data + size); - footer->magic = 0x20060623; - footer->saveno = save->unk_204A4 + 1; - footer->size = size; - footer->idx = (u16)id; - footer->crc = MATH_CalcCRC16CCITT(&save->crcTable, data, size + 14); +void CreateChunkFooter(struct SaveData *save, u8 *data, int id, u32 size) { + struct SaveArrayFooter *footer = (struct SaveArrayFooter *)(data + size); + footer->magic = 0x20060623; + footer->saveno = save->unk_204A4 + 1; + footer->size = size; + footer->idx = (u16)id; + footer->crc = MATH_CalcCRC16CCITT(&save->crcTable, data, size + 14); } -BOOL ValidateChunk(struct SaveData * save, u8 * data, int id, u32 size) -{ - struct SaveArrayFooter * footer = (struct SaveArrayFooter *)(data + size); - if (footer->magic != 0x20060623) +BOOL ValidateChunk(struct SaveData *save, u8 *data, int id, u32 size) { + struct SaveArrayFooter *footer = (struct SaveArrayFooter *)(data + size); + if (footer->magic != 0x20060623) { return FALSE; - if (footer->size != size) + } + if (footer->size != size) { return FALSE; - if (footer->idx != id) + } + if (footer->idx != id) { return FALSE; - return (footer->crc == MATH_CalcCRC16CCITT(&save->crcTable, data, size + 14)); + } + return footer->crc == MATH_CalcCRC16CCITT(&save->crcTable, data, size + 14); } -u32 sub_020232B4(u8 * data, u32 size) -{ - struct SaveArrayFooter * footer = (struct SaveArrayFooter *)(data + size); +u32 sub_020232B4(u8 *data, u32 size) { + struct SaveArrayFooter *footer = (struct SaveArrayFooter *)(data + size); return footer->saveno; } -int WriteSaveFileToFlash(struct SaveData * save, int idx, u8 * data) -{ +int WriteSaveFileToFlash(struct SaveData *save, int idx, u8 *data) { sub_02016444(1); GF_ASSERT(idx < UNK_020EE6D8); - const struct SaveChunkHeader * sch = &UNK_020EE6E0[idx]; + const struct SaveChunkHeader *sch = &UNK_020EE6E0[idx]; GF_ASSERT(sch->id == idx); u32 sp4 = sch->sizeFunc() + 16; int sp0; - if (save->unk_204A0 == 1) - { + if (save->unk_204A0 == 1) { CreateChunkFooter(save, data, idx, sch->sizeFunc()); sp0 = FlashWriteChunk((u32)(sch->linkedId << 12), data, sp4); GF_ASSERT(ValidateChunk(save, data, idx, sch->sizeFunc()) == 1); CreateChunkFooter(save, data, idx, sch->sizeFunc()); sp0 |= FlashWriteChunk((u32)((sch->linkedId + 0x40) << 12), data, sp4); GF_ASSERT(ValidateChunk(save, data, idx, sch->sizeFunc()) == 1); - } - else - { + } else { CreateChunkFooter(save, data, idx, sch->sizeFunc()); sp0 = FlashWriteChunk((u32)((sch->linkedId + 0x40) << 12), data, sp4); GF_ASSERT(ValidateChunk(save, data, idx, sch->sizeFunc()) == 1); @@ -754,8 +659,7 @@ int WriteSaveFileToFlash(struct SaveData * save, int idx, u8 * data) sp0 |= FlashWriteChunk((u32)(sch->linkedId << 12), data, sp4); GF_ASSERT(ValidateChunk(save, data, idx, sch->sizeFunc()) == 1); } - if (sp0 == 1) - { + if (sp0 == 1) { sub_02016454(1); return 2; } @@ -763,42 +667,37 @@ int WriteSaveFileToFlash(struct SaveData * save, int idx, u8 * data) return 3; } -u8 * ReadSaveFileFromFlash(struct SaveData * save, HeapID heapId, int idx, int * ret_p) -{ +u8 *ReadSaveFileFromFlash(struct SaveData *save, HeapID heapId, int idx, int *ret_p) { GF_ASSERT(idx < UNK_020EE6D8); - const struct SaveChunkHeader * sch = &UNK_020EE6E0[idx]; + const struct SaveChunkHeader *sch = &UNK_020EE6E0[idx]; GF_ASSERT(sch->id == idx); u32 sp10 = sch->sizeFunc() + 16; int spC; u32 sp8; int r7; u32 sp4; - u8 * r6 = AllocFromHeap(heapId, sp10); + u8 *r6 = AllocFromHeap(heapId, sp10); FlashLoadChunk((u32)(sch->linkedId << 12), r6, sp10); spC = ValidateChunk(save, r6, idx, sch->sizeFunc()); sp8 = sub_020232B4(r6, sch->sizeFunc()); FlashLoadChunk((u32)((sch->linkedId + 0x40) << 12), r6, sp10); - r7 = ValidateChunk(save, r6, idx, sch->sizeFunc()); - sp4 = sub_020232B4(r6, sch->sizeFunc()); + r7 = ValidateChunk(save, r6, idx, sch->sizeFunc()); + sp4 = sub_020232B4(r6, sch->sizeFunc()); *ret_p = 1; - if (spC == 1 && r7 == 0) - { + if (spC == 1 && r7 == 0) { save->unk_204A0 = 0; save->unk_204A4 = sp8; FlashLoadChunk((u32)(sch->linkedId << 12), r6, sp10); return r6; } - if (spC == 0 && r7 == 1) - { + if (spC == 0 && r7 == 1) { save->unk_204A0 = 1; save->unk_204A4 = sp4; FlashLoadChunk((u32)((sch->linkedId + 0x40) << 12), r6, sp10); return r6; } - if (spC == 1 && r7 == 1) - { - if (sub_020229B8(sp8, sp4) != -1) - { + if (spC == 1 && r7 == 1) { + if (sub_020229B8(sp8, sp4) != -1) { save->unk_204A0 = 0; save->unk_204A4 = sp8; FlashLoadChunk((u32)(sch->linkedId << 12), r6, sp10); @@ -809,31 +708,30 @@ u8 * ReadSaveFileFromFlash(struct SaveData * save, HeapID heapId, int idx, int * FlashLoadChunk((u32)((sch->linkedId + 0x40) << 12), r6, sp10); return r6; } - *ret_p = 2; + *ret_p = 2; save->unk_204A0 = 0; save->unk_204A4 = 0; return r6; } -BOOL SaveDetectFlash(void) -{ +BOOL SaveDetectFlash(void) { int lock = OS_GetLockID(); GF_ASSERT(lock != -3); CARD_LockBackup((u16)lock); u16 flash_type; - if (CARD_IdentifyBackup(CARD_BACKUP_TYPE_FLASH_4MBITS)) + if (CARD_IdentifyBackup(CARD_BACKUP_TYPE_FLASH_4MBITS)) { flash_type = CARD_BACKUP_TYPE_FLASH_4MBITS; - else if (CARD_IdentifyBackup(CARD_BACKUP_TYPE_FLASH_2MBITS)) + } else if (CARD_IdentifyBackup(CARD_BACKUP_TYPE_FLASH_2MBITS)) { flash_type = CARD_BACKUP_TYPE_FLASH_2MBITS; - else + } else { flash_type = 0; + } CARD_UnlockBackup((u16)lock); OS_ReleaseLockID((u16)lock); return flash_type != 0; } -int FlashWriteChunk(u32 offset, u8 * data, u32 size) -{ +int FlashWriteChunk(u32 offset, u8 *data, u32 size) { int ret; int id = FlashWriteChunkInternal(offset, data, size); while (!WaitFlashWrite(id, &ret)) @@ -841,8 +739,7 @@ int FlashWriteChunk(u32 offset, u8 * data, u32 size) return ret; } -BOOL FlashLoadChunk(u32 src, void * dest, u32 size) -{ +BOOL FlashLoadChunk(u32 src, void *dest, u32 size) { int lock = OS_GetLockID(); GF_ASSERT(lock != -3); CARD_LockBackup((u16)lock); @@ -850,41 +747,36 @@ BOOL FlashLoadChunk(u32 src, void * dest, u32 size) BOOL r5 = CARD_WaitBackupAsync(); CARD_UnlockBackup((u16)lock); OS_ReleaseLockID((u16)lock); - if (!r5) - { + if (!r5) { FreeToHeap(sSaveDataPtr); ShowSaveDataReadError(HEAP_ID_1); } return r5; } -void FlashWriteCommandCallback(void * arg) -{ +void FlashWriteCommandCallback(void *arg) { #pragma unused(arg) saveWritten = TRUE; } -int FlashWriteChunkInternal(u32 dest, void * src, u32 size) -{ +int FlashWriteChunkInternal(u32 dest, void *src, u32 size) { int lock = OS_GetLockID(); GF_ASSERT(lock != -3); CARD_LockBackup((u16)lock); int sp14; - if (!CARDi_ReadBackup(0, &sp14, 4, NULL, NULL, FALSE)) + if (!CARDi_ReadBackup(0, &sp14, 4, NULL, NULL, FALSE)) { SaveErrorHandling(lock, 1); + } saveWritten = FALSE; CARDi_WriteAndVerifyBackup(dest, src, size, FlashWriteCommandCallback, NULL, TRUE); return lock; } -BOOL WaitFlashWrite(int lock, BOOL * res) -{ - if (saveWritten == TRUE) - { +BOOL WaitFlashWrite(int lock, BOOL *res) { + if (saveWritten == TRUE) { CARD_UnlockBackup((u16)lock); OS_ReleaseLockID((u16)lock); - switch (CARD_GetResultCode()) - { + switch (CARD_GetResultCode()) { case CARD_RESULT_SUCCESS: *res = TRUE; break; @@ -902,8 +794,7 @@ BOOL WaitFlashWrite(int lock, BOOL * res) return FALSE; } -void SaveErrorHandling(int lock, u32 errno) -{ +void SaveErrorHandling(int lock, u32 errno) { CARD_UnlockBackup((u16)lock); OS_ReleaseLockID((u16)lock); FreeToHeap(sSaveDataPtr); diff --git a/arm9/src/save_arrays.c b/arm9/src/save_arrays.c index 1cef02f49..c0c71ac52 100644 --- a/arm9/src/save_arrays.c +++ b/arm9/src/save_arrays.c @@ -1,21 +1,22 @@ #include "global.h" + #include "bag.h" -#include "player_data.h" -#include "save.h" +#include "daycare.h" +#include "easy_chat.h" +#include "hall_of_fame.h" #include "party.h" -#include "save_vars_flags.h" +#include "player_data.h" +#include "pokedex.h" #include "pokemon_storage_system.h" -#include "save_system_info.h" #include "poketch.h" -#include "hall_of_fame.h" -#include "unk_020286F8.h" -#include "unk_020254B8.h" -#include "daycare.h" -#include "pokedex.h" +#include "sav_chatot.h" +#include "save.h" +#include "save_system_info.h" +#include "save_vars_flags.h" #include "seal.h" -#include "easy_chat.h" #include "unk_02024E64.h" -#include "sav_chatot.h" +#include "unk_020254B8.h" +#include "unk_020286F8.h" #include "unk_0202A1E0.h" extern u32 sub_0202AC20(void); @@ -60,46 +61,46 @@ extern void sub_0202C0E4(void *); const struct SaveChunkHeader UNK_020EE6E0[] = { { 0, 32, (SAVSIZEFN)Save_HOF_sizeof, (SAVINITFN)Save_HOF_Init }, - { 1, 35, (SAVSIZEFN)sub_0202AC20, (SAVINITFN)sub_0202AC28 } + { 1, 35, (SAVSIZEFN)sub_0202AC20, (SAVINITFN)sub_0202AC28 } }; const struct SaveChunkHeader UNK_020EE700[] = { - { 0, 0, (SAVSIZEFN)Save_SysInfo_sizeof, (SAVINITFN)Save_SysInfo_Init }, - { 1, 0, (SAVSIZEFN)Save_PlayerData_sizeof, (SAVINITFN)Save_PlayerData_Init }, - { 2, 0, (SAVSIZEFN)SaveArray_Party_sizeof, (SAVINITFN)SaveArray_Party_Init }, - { 3, 0, (SAVSIZEFN)Save_Bag_sizeof, (SAVINITFN)Save_Bag_Init }, - { 4, 0, (SAVSIZEFN)Save_VarsFlags_sizeof, (SAVINITFN)Save_VarsFlags_Init }, - { 5, 0, (SAVSIZEFN)Save_Poketch_sizeof, (SAVINITFN)Save_Poketch_Init }, - { 6, 0, (SAVSIZEFN)sub_02034D7C, (SAVINITFN)sub_02034D98 }, - { 7, 0, (SAVSIZEFN)Save_Pokedex_sizeof, (SAVINITFN)Save_Pokedex_Init }, - { 8, 0, (SAVSIZEFN)Save_Daycare_sizeof, (SAVINITFN)Save_Daycare_Init }, - { 9, 0, (SAVSIZEFN)sub_020254B8, (SAVINITFN)sub_020254CC }, - { 10, 0, (SAVSIZEFN)sub_02024E64, (SAVINITFN)sub_02024E6C }, - { 11, 0, (SAVSIZEFN)sub_02034D80, (SAVINITFN)sub_02034D88 }, - { 12, 0, (SAVSIZEFN)sub_02025954, (SAVINITFN)sub_0202597C }, - { 13, 0, (SAVSIZEFN)sub_02023AC8, (SAVINITFN)sub_02023AD8 }, - { 14, 0, (SAVSIZEFN)sub_02026FD8, (SAVINITFN)sub_02026F60 }, - { 15, 0, (SAVSIZEFN)Save_Mailbox_sizeof, (SAVINITFN)Save_Mailbox_Init }, - { 16, 0, (SAVSIZEFN)sub_02028054, (SAVINITFN)sub_0202805C }, - { 17, 0, (SAVSIZEFN)sub_020286F8, (SAVINITFN)sub_02028724 }, - { 18, 0, (SAVSIZEFN)sub_02028980, (SAVINITFN)sub_02028994 }, - { 19, 0, (SAVSIZEFN)sub_02029A84, (SAVINITFN)sub_02029A8C }, - { 20, 0, (SAVSIZEFN)Save_GameStats_sizeof, (SAVINITFN)Save_GameStats_Init }, - { 21, 0, (SAVSIZEFN)Save_SealCase_sizeof, (SAVINITFN)Save_SealCase_Init }, - { 22, 0, (SAVSIZEFN)Save_Chatot_sizeof, (SAVINITFN)Save_Chatot_Init }, - { 23, 0, (SAVSIZEFN)SaveStruct23_sizeof, (SAVINITFN)SaveStruct23_Init }, - { 24, 0, (SAVSIZEFN)sub_0202A8F4, (SAVINITFN)sub_0202A8F8 }, - { 25, 0, (SAVSIZEFN)sub_0202A924, (SAVINITFN)sub_0202A92C }, - { 26, 0, (SAVSIZEFN)sub_0202ABC8, (SAVINITFN)sub_0202ABCC }, - { 27, 0, (SAVSIZEFN)sub_0202B374, (SAVINITFN)sub_0202B37C }, - { 28, 0, (SAVSIZEFN)sub_0202B8B0, (SAVINITFN)sub_0202B8B8 }, - { 29, 0, (SAVSIZEFN)sub_020281E0, (SAVINITFN)sub_020281E8 }, - { 30, 0, (SAVSIZEFN)sub_02029AE0, (SAVINITFN)sub_02029AE8 }, - { 31, 0, (SAVSIZEFN)sub_0202AC20, (SAVINITFN)sub_0202AC28 }, - { 32, 0, (SAVSIZEFN)sub_0202BE98, (SAVINITFN)sub_0202BEA0 }, - { 33, 0, (SAVSIZEFN)sub_0202C0E0, (SAVINITFN)sub_0202C0E4 }, - { 34, 0, (SAVSIZEFN)Save_EasyChat_sizeof, (SAVINITFN)Save_EasyChat_Init }, - { 35, 1, (SAVSIZEFN)PCStorage_sizeof, (SAVINITFN)PCStorage_Init }, + { 0, 0, (SAVSIZEFN)Save_SysInfo_sizeof, (SAVINITFN)Save_SysInfo_Init }, + { 1, 0, (SAVSIZEFN)Save_PlayerData_sizeof, (SAVINITFN)Save_PlayerData_Init }, + { 2, 0, (SAVSIZEFN)SaveArray_Party_sizeof, (SAVINITFN)SaveArray_Party_Init }, + { 3, 0, (SAVSIZEFN)Save_Bag_sizeof, (SAVINITFN)Save_Bag_Init }, + { 4, 0, (SAVSIZEFN)Save_VarsFlags_sizeof, (SAVINITFN)Save_VarsFlags_Init }, + { 5, 0, (SAVSIZEFN)Save_Poketch_sizeof, (SAVINITFN)Save_Poketch_Init }, + { 6, 0, (SAVSIZEFN)sub_02034D7C, (SAVINITFN)sub_02034D98 }, + { 7, 0, (SAVSIZEFN)Save_Pokedex_sizeof, (SAVINITFN)Save_Pokedex_Init }, + { 8, 0, (SAVSIZEFN)Save_Daycare_sizeof, (SAVINITFN)Save_Daycare_Init }, + { 9, 0, (SAVSIZEFN)sub_020254B8, (SAVINITFN)sub_020254CC }, + { 10, 0, (SAVSIZEFN)sub_02024E64, (SAVINITFN)sub_02024E6C }, + { 11, 0, (SAVSIZEFN)sub_02034D80, (SAVINITFN)sub_02034D88 }, + { 12, 0, (SAVSIZEFN)sub_02025954, (SAVINITFN)sub_0202597C }, + { 13, 0, (SAVSIZEFN)sub_02023AC8, (SAVINITFN)sub_02023AD8 }, + { 14, 0, (SAVSIZEFN)sub_02026FD8, (SAVINITFN)sub_02026F60 }, + { 15, 0, (SAVSIZEFN)Save_Mailbox_sizeof, (SAVINITFN)Save_Mailbox_Init }, + { 16, 0, (SAVSIZEFN)sub_02028054, (SAVINITFN)sub_0202805C }, + { 17, 0, (SAVSIZEFN)sub_020286F8, (SAVINITFN)sub_02028724 }, + { 18, 0, (SAVSIZEFN)sub_02028980, (SAVINITFN)sub_02028994 }, + { 19, 0, (SAVSIZEFN)sub_02029A84, (SAVINITFN)sub_02029A8C }, + { 20, 0, (SAVSIZEFN)Save_GameStats_sizeof, (SAVINITFN)Save_GameStats_Init }, + { 21, 0, (SAVSIZEFN)Save_SealCase_sizeof, (SAVINITFN)Save_SealCase_Init }, + { 22, 0, (SAVSIZEFN)Save_Chatot_sizeof, (SAVINITFN)Save_Chatot_Init }, + { 23, 0, (SAVSIZEFN)SaveStruct23_sizeof, (SAVINITFN)SaveStruct23_Init }, + { 24, 0, (SAVSIZEFN)sub_0202A8F4, (SAVINITFN)sub_0202A8F8 }, + { 25, 0, (SAVSIZEFN)sub_0202A924, (SAVINITFN)sub_0202A92C }, + { 26, 0, (SAVSIZEFN)sub_0202ABC8, (SAVINITFN)sub_0202ABCC }, + { 27, 0, (SAVSIZEFN)sub_0202B374, (SAVINITFN)sub_0202B37C }, + { 28, 0, (SAVSIZEFN)sub_0202B8B0, (SAVINITFN)sub_0202B8B8 }, + { 29, 0, (SAVSIZEFN)sub_020281E0, (SAVINITFN)sub_020281E8 }, + { 30, 0, (SAVSIZEFN)sub_02029AE0, (SAVINITFN)sub_02029AE8 }, + { 31, 0, (SAVSIZEFN)sub_0202AC20, (SAVINITFN)sub_0202AC28 }, + { 32, 0, (SAVSIZEFN)sub_0202BE98, (SAVINITFN)sub_0202BEA0 }, + { 33, 0, (SAVSIZEFN)sub_0202C0E0, (SAVINITFN)sub_0202C0E4 }, + { 34, 0, (SAVSIZEFN)Save_EasyChat_sizeof, (SAVINITFN)Save_EasyChat_Init }, + { 35, 1, (SAVSIZEFN)PCStorage_sizeof, (SAVINITFN)PCStorage_Init }, }; const int UNK_020EE6D8 = NELEMS(UNK_020EE6E0); diff --git a/arm9/src/save_data_read_error.c b/arm9/src/save_data_read_error.c index 9632ba1f7..bf632e906 100644 --- a/arm9/src/save_data_read_error.c +++ b/arm9/src/save_data_read_error.c @@ -1,67 +1,70 @@ +#include "save_data_read_error.h" + #include "global.h" + +#include "constants/rgb.h" + +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0005.h" + #include "bg_window.h" #include "brightness.h" -#include "constants/rgb.h" #include "font.h" #include "game_init.h" #include "msgdata.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0005.h" -#include "save_data_read_error.h" -#include "text.h" #include "render_window.h" +#include "text.h" extern void SetMasterBrightnessNeutral(BOOL set_brightness_on_bottom_screen); extern void sub_0200E3A0(BOOL set_brightness_on_bottom_screen, s32); static const struct WindowTemplate sSaveDataReadErrorWindowTemplate = { - .bgId = GF_BG_LYR_MAIN_0, - .left = 3, - .top = 3, - .width = 26, - .height = 18, - .palette = 1, + .bgId = GF_BG_LYR_MAIN_0, + .left = 3, + .top = 3, + .width = 26, + .height = 18, + .palette = 1, .baseTile = 0x23, }; static const struct GraphicsModes sSaveDataReadErrorGraphicsModes = { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, ._2d3dMode = GX_BG0_AS_2D, }; static const struct BgTemplate sSaveDataReadErrorBgTemplate = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0, - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, + .baseTile = 0, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x18000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE, + .charBase = GX_BG_CHARBASE_0x18000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE, }; static const struct GraphicsBanks sSaveDataReadErrorGraphicsBanks = { - .bg = GX_VRAM_BG_256_AB, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_NONE, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_NONE, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_NONE, + .bg = GX_VRAM_BG_256_AB, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_NONE, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_NONE, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_NONE, .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_NONE, - .texpltt = GX_VRAM_TEXPLTT_NONE, + .tex = GX_VRAM_TEX_NONE, + .texpltt = GX_VRAM_TEXPLTT_NONE, }; -void ShowSaveDataReadError(HeapID heapId) -{ +void ShowSaveDataReadError(HeapID heapId) { struct Window window; sub_0200E3A0(PM_LCD_TOP, 0); @@ -86,7 +89,7 @@ void ShowSaveDataReadError(HeapID heapId) GXS_SetVisibleWnd(0); GfGfx_SetBanks(&sSaveDataReadErrorGraphicsBanks); - struct BgConfig* bg_config = BgConfig_Alloc(heapId); + struct BgConfig *bg_config = BgConfig_Alloc(heapId); SetBothScreensModesAndDisable(&sSaveDataReadErrorGraphicsModes); @@ -98,8 +101,8 @@ void ShowSaveDataReadError(HeapID heapId) BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); - struct MsgData* msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0005_bin, heapId); - struct String* str = String_New(384, heapId); + struct MsgData *msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0005_bin, heapId); + struct String *str = String_New(384, heapId); ResetAllTextPrinters(); @@ -116,15 +119,13 @@ void ShowSaveDataReadError(HeapID heapId) SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); - while (TRUE) - { + while (TRUE) { HandleDSLidAction(); OS_WaitIrq(TRUE, OS_IE_VBLANK); } } -void ShowGBACartRemovedError(HeapID heapId) -{ +void ShowGBACartRemovedError(HeapID heapId) { struct Window window; sub_0200E3A0(PM_LCD_TOP, 0); @@ -149,7 +150,7 @@ void ShowGBACartRemovedError(HeapID heapId) GXS_SetVisibleWnd(0); GfGfx_SetBanks(&sSaveDataReadErrorGraphicsBanks); - struct BgConfig* bg_config = BgConfig_Alloc(heapId); + struct BgConfig *bg_config = BgConfig_Alloc(heapId); SetBothScreensModesAndDisable(&sSaveDataReadErrorGraphicsModes); @@ -161,8 +162,8 @@ void ShowGBACartRemovedError(HeapID heapId) BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); - struct MsgData* msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0005_bin, heapId); - struct String* str = String_New(384, heapId); + struct MsgData *msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0005_bin, heapId); + struct String *str = String_New(384, heapId); ResetAllTextPrinters(); @@ -179,8 +180,7 @@ void ShowGBACartRemovedError(HeapID heapId) SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); - while (TRUE) - { + while (TRUE) { HandleDSLidAction(); OS_WaitIrq(TRUE, OS_IE_VBLANK); } diff --git a/arm9/src/save_data_write_error.c b/arm9/src/save_data_write_error.c index 9bd162843..1c5df29ce 100644 --- a/arm9/src/save_data_write_error.c +++ b/arm9/src/save_data_write_error.c @@ -1,67 +1,70 @@ +#include "save_data_write_error.h" + #include "global.h" + +#include "constants/rgb.h" + +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0006.h" + #include "bg_window.h" #include "brightness.h" -#include "constants/rgb.h" #include "font.h" #include "game_init.h" #include "msgdata.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0006.h" -#include "save_data_write_error.h" -#include "text.h" #include "render_window.h" +#include "text.h" extern void SetMasterBrightnessNeutral(BOOL set_brightness_on_bottom_screen); extern void sub_0200E3A0(BOOL set_brightness_on_bottom_screen, s32); static const struct WindowTemplate sSaveDataWriteErrorWindowTemplate = { - .bgId = GF_BG_LYR_MAIN_0, - .left = 3, - .top = 3, - .width = 26, - .height = 18, - .palette = 1, + .bgId = GF_BG_LYR_MAIN_0, + .left = 3, + .top = 3, + .width = 26, + .height = 18, + .palette = 1, .baseTile = 0x23, }; static const struct GraphicsModes sSaveDataWriteErrorGraphicsModes = { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, ._2d3dMode = GX_BG0_AS_2D, }; static const struct BgTemplate sSaveDataWriteErrorBgTemplate = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0, - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, + .baseTile = 0, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x18000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE, + .charBase = GX_BG_CHARBASE_0x18000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE, }; static const struct GraphicsBanks sSaveDataWriteErrorGraphicsBanks = { - .bg = GX_VRAM_BG_256_AB, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_NONE, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_NONE, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_NONE, + .bg = GX_VRAM_BG_256_AB, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_NONE, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_NONE, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_NONE, .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_NONE, - .texpltt = GX_VRAM_TEXPLTT_NONE, + .tex = GX_VRAM_TEX_NONE, + .texpltt = GX_VRAM_TEXPLTT_NONE, }; -void ShowSaveDataWriteError(HeapID heapId, u32 err_no) -{ +void ShowSaveDataWriteError(HeapID heapId, u32 err_no) { struct Window window; u32 msg_no; @@ -94,7 +97,7 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) GXS_SetVisibleWnd(0); GfGfx_SetBanks(&sSaveDataWriteErrorGraphicsBanks); - struct BgConfig* bg_config = BgConfig_Alloc(heapId); + struct BgConfig *bg_config = BgConfig_Alloc(heapId); SetBothScreensModesAndDisable(&sSaveDataWriteErrorGraphicsModes); @@ -106,8 +109,8 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); - struct MsgData* msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0006_bin, heapId); - struct String* str = String_New(384, heapId); + struct MsgData *msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0006_bin, heapId); + struct String *str = String_New(384, heapId); ResetAllTextPrinters(); @@ -124,8 +127,7 @@ void ShowSaveDataWriteError(HeapID heapId, u32 err_no) SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); - while (TRUE) - { + while (TRUE) { HandleDSLidAction(); OS_WaitIrq(TRUE, OS_IE_VBLANK); } diff --git a/arm9/src/save_system_info.c b/arm9/src/save_system_info.c index f8b306a69..5248132e2 100644 --- a/arm9/src/save_system_info.c +++ b/arm9/src/save_system_info.c @@ -1,119 +1,107 @@ +#include "save_system_info.h" + #include "global.h" -#include "save.h" + #include "MI_memory.h" #include "OS_ownerInfo.h" #include "RTC_api.h" #include "RTC_convert.h" -#include "save_system_info.h" +#include "save.h" extern void GF_RTC_CopyDateTime(RTCDate *, RTCTime *); -u32 Save_SysInfo_sizeof(void) -{ +u32 Save_SysInfo_sizeof(void) { return sizeof(struct SaveSysInfo); } -void Save_SysInfo_Init(struct SaveSysInfo * unk) -{ +void Save_SysInfo_Init(struct SaveSysInfo *unk) { MI_CpuClearFast(unk, sizeof(struct SaveSysInfo)); Save_SysInfo_RTC_Init(&unk->rtcInfo); } -struct SaveSysInfo * Save_SysInfo_Get(struct SaveData * save) -{ +struct SaveSysInfo *Save_SysInfo_Get(struct SaveData *save) { return (struct SaveSysInfo *)SaveArray_Get(save, 0); } -SysInfo_RTC * Save_SysInfo_RTC_Get(struct SaveData * save) -{ +SysInfo_RTC *Save_SysInfo_RTC_Get(struct SaveData *save) { return &Save_SysInfo_Get(save)->rtcInfo; } -void Save_SysInfo_InitFromSystem(struct SaveSysInfo * unk) -{ +void Save_SysInfo_InitFromSystem(struct SaveSysInfo *unk) { OSOwnerInfo info; unk->rtcOffset = OS_GetOwnerRtcOffset(); OS_GetMacAddress(unk->macAddr); OS_GetOwnerInfo(&info); unk->birthMonth = info.birthday.month; - unk->birthDay = info.birthday.day; + unk->birthDay = info.birthday.day; } -BOOL Save_SysInfo_MacAddressIsMine(struct SaveSysInfo * unk) -{ +BOOL Save_SysInfo_MacAddressIsMine(struct SaveSysInfo *unk) { u8 macAddr[6]; OS_GetMacAddress(macAddr); - for (int i = 0; i < 6; i++) - { - if (macAddr[i] != unk->macAddr[i]) + for (int i = 0; i < 6; i++) { + if (macAddr[i] != unk->macAddr[i]) { return FALSE; + } } return TRUE; } -BOOL Save_SysInfo_RTCOffsetIsMine(struct SaveSysInfo * unk) -{ +BOOL Save_SysInfo_RTCOffsetIsMine(struct SaveSysInfo *unk) { return OS_GetOwnerRtcOffset() == unk->rtcOffset; } -u8 Save_SysInfo_GetBirthMonth(struct SaveSysInfo * unk) -{ +u8 Save_SysInfo_GetBirthMonth(struct SaveSysInfo *unk) { return unk->birthMonth; } -u8 Save_SysInfo_GetBirthDay(struct SaveSysInfo * unk) -{ +u8 Save_SysInfo_GetBirthDay(struct SaveSysInfo *unk) { return unk->birthDay; } -u8 Save_SysInfo_GetMysteryGiftActive(struct SaveSysInfo * unk) -{ +u8 Save_SysInfo_GetMysteryGiftActive(struct SaveSysInfo *unk) { return unk->mysteryGiftActive; } -void Save_SysInfo_SetMysteryGiftActive(struct SaveSysInfo * unk, u8 val) -{ +void Save_SysInfo_SetMysteryGiftActive(struct SaveSysInfo *unk, u8 val) { unk->mysteryGiftActive = val; } -u32 sub_02023830(struct SaveSysInfo * unk) -{ +u32 sub_02023830(struct SaveSysInfo *unk) { return unk->field_4C; } -void sub_02023834(struct SaveSysInfo * unk, u32 val) -{ - if (unk->field_4C == 0) +void sub_02023834(struct SaveSysInfo *unk, u32 val) { + if (unk->field_4C == 0) { unk->field_4C = val; + } } -void Save_SysInfo_RTC_Init(SysInfo_RTC * sub) -{ +void Save_SysInfo_RTC_Init(SysInfo_RTC *sub) { sub->field_00 = 1; GF_RTC_CopyDateTime(&sub->date, &sub->time); - sub->daysSinceNitroEpoch = RTC_ConvertDateToDay(&sub->date); + sub->daysSinceNitroEpoch = RTC_ConvertDateToDay(&sub->date); sub->secondsSinceNitroEpoch = RTC_ConvertDateTimeToSecond(&sub->date, &sub->time); - sub->field_2C = 0; - sub->field_34 = 0; + sub->field_2C = 0; + sub->field_34 = 0; } -BOOL sub_02023874(SysInfo_RTC * sub) -{ +BOOL sub_02023874(SysInfo_RTC *sub) { return sub->field_34 != 0; } -void sub_02023884(SysInfo_RTC * sub, u32 a1) -{ - if (sub->field_34 > 1440) +void sub_02023884(SysInfo_RTC *sub, u32 a1) { + if (sub->field_34 > 1440) { sub->field_34 = 1440; - if (sub->field_34 < a1) + } + if (sub->field_34 < a1) { sub->field_34 = 0; - else + } else { sub->field_34 -= a1; + } } -void sub_020238A4(SysInfo_RTC * sub) -{ +void sub_020238A4(SysInfo_RTC *sub) { sub->field_34 = 1440; GF_RTC_CopyDateTime(&sub->date, &sub->time); sub->daysSinceNitroEpoch = RTC_ConvertDateToDay(&sub->date); diff --git a/arm9/src/save_vars_flags.c b/arm9/src/save_vars_flags.c index c29dea921..4f9a3daea 100644 --- a/arm9/src/save_vars_flags.c +++ b/arm9/src/save_vars_flags.c @@ -1,7 +1,8 @@ -#include "global.h" #include "save_vars_flags.h" -static u8 sTempFlags[NUM_TEMP_FLAGS / 8] = {0}; +#include "global.h" + +static u8 sTempFlags[NUM_TEMP_FLAGS / 8] = { 0 }; u32 Save_VarsFlags_sizeof(void) { return sizeof(SaveVarsFlags); @@ -53,7 +54,7 @@ u8 *Save_VarsFlags_GetFlagAddr(SaveVarsFlags *varsFlags, u16 flagId) { } } -u16 *Save_VarsFlags_GetVarAddr(SaveVarsFlags * varsFlags, u16 varId) { +u16 *Save_VarsFlags_GetVarAddr(SaveVarsFlags *varsFlags, u16 varId) { GF_ASSERT((varId - VAR_BASE) < NUM_VARS); return &varsFlags->vars[varId - VAR_BASE]; } diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c index 36c50f226..f44c832be 100644 --- a/arm9/src/scrcmd.c +++ b/arm9/src/scrcmd.c @@ -1,14 +1,20 @@ -#include "global.h" #include "scrcmd.h" + +#include "global.h" + +#include "constants/global_fieldmap.h" +#include "constants/items.h" +#include "constants/sndseq.h" +#include "constants/weather.h" + +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0327.h" + #include "PAD_pad.h" #include "bag.h" #include "bg_window.h" #include "blackout.h" #include "camera.h" -#include "constants/global_fieldmap.h" -#include "constants/items.h" -#include "constants/sndseq.h" -#include "constants/weather.h" #include "easy_chat.h" #include "encounter.h" #include "fashion_case.h" @@ -19,14 +25,12 @@ #include "math_util.h" #include "message_format.h" #include "msgdata.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0327.h" #include "options.h" #include "party.h" #include "player_data.h" -#include "poketch.h" #include "pokedex.h" #include "pokemon_storage_system.h" +#include "poketch.h" #include "render_window.h" #include "safari_zone.h" #include "save.h" @@ -146,8 +150,8 @@ extern u32 sub_02027008(SaveFashionData *fashionData, u32 param1); extern void sub_02027478(u32 param0, u16 param1); extern void ShowGeonetScreen(FieldSystem *fieldSystem); extern void ShowSealCapsuleEditor(TaskManager *taskManager, SaveData *save); -extern void sub_0205F7A0(FieldSystem *fieldSystem, TownMapAppData *townMap, u32 param2); //TownMap_Init? -extern void sub_02037E90(FieldSystem *fieldSystem, TownMapAppData *townMap); //ShowTownMap? +extern void sub_0205F7A0(FieldSystem *fieldSystem, TownMapAppData *townMap, u32 param2); // TownMap_Init? +extern void sub_02037E90(FieldSystem *fieldSystem, TownMapAppData *townMap); // ShowTownMap? extern SavePoffinData *Save_PoffinData_Get(SaveData *save); extern u32 sub_020281B8(SavePoffinData *savePoffinData); extern void sub_02037FE4(FieldSystem *fieldSystem, ScrCmdUnkStruct01D9 *param1); @@ -160,7 +164,7 @@ extern void CallTask_GameClear(TaskManager *taskManager); extern HallOfFame *sub_02038824(FieldSystem *fieldSystem); extern void sub_020386E0(FieldSystem *fieldSystem, u16 param1); extern void sub_0206F3D8(TaskManager *taskManager, u16 *param1); -extern void sub_020386A4(FieldSystem *fieldSystem, StarterSelectionData *starterSelectionData); +extern void sub_020386A4(FieldSystem *fieldSystem, StarterSelectionData *starterSelectionData); extern void sub_0205F378(SaveVarsFlags *flags, u16 state); extern BagScreenAppData *sub_0203789C(FieldSystem *fieldSystem, u8 mode); extern u16 sub_020378FC(BagScreenAppData *bagScreenAppData); @@ -390,7 +394,7 @@ extern u8 *UNK_020F34E0; extern const u32 UNK_020F34FC[PARTY_SIZE]; extern const u16 UNK_020F3538[18]; -BOOL sub_0203BC04(ScriptContext *ctx); //can't be static, referenced in scrcmd_move_relearner.c +BOOL sub_0203BC04(ScriptContext *ctx); // can't be static, referenced in scrcmd_move_relearner.c static BOOL RunPauseTimer(ScriptContext *ctx); static u32 Compare(u16 a, u16 b); @@ -433,201 +437,194 @@ static void Script_SetMonSeenFlagBySpecies(FieldSystem *fieldSystem, u16 species extern u8 sScriptConditionTable[6][3]; -BOOL ScrCmd_Nop(ScriptContext *ctx) //0000 +BOOL ScrCmd_Nop(ScriptContext *ctx) // 0000 { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Dummy(ScriptContext *ctx) //0001 +BOOL ScrCmd_Dummy(ScriptContext *ctx) // 0001 { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_End(ScriptContext *ctx) //0002 +BOOL ScrCmd_End(ScriptContext *ctx) // 0002 { StopScript(ctx); return FALSE; } -BOOL ScrCmd_Wait(ScriptContext *ctx) //0003 +BOOL ScrCmd_Wait(ScriptContext *ctx) // 0003 { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 num = ScriptReadHalfword(ctx); - u16 wk = ScriptReadHalfword(ctx); - u16* VarPointer = GetVarPointer(fieldSystem, wk); - *VarPointer = num; - ctx->data[0] = wk; + u16 num = ScriptReadHalfword(ctx); + u16 wk = ScriptReadHalfword(ctx); + u16 *VarPointer = GetVarPointer(fieldSystem, wk); + *VarPointer = num; + ctx->data[0] = wk; SetupNativeScript(ctx, RunPauseTimer); return TRUE; } -static BOOL RunPauseTimer(ScriptContext *ctx) -{ - u16* VarPointer = GetVarPointer(ctx->fieldSystem, (u16)ctx->data[0]); - *VarPointer = (u16)(*VarPointer - 1); +static BOOL RunPauseTimer(ScriptContext *ctx) { + u16 *VarPointer = GetVarPointer(ctx->fieldSystem, (u16)ctx->data[0]); + *VarPointer = (u16)(*VarPointer - 1); return !(*VarPointer); } -BOOL ScrCmd_DebugWatch(ScriptContext *ctx) //01F9 +BOOL ScrCmd_DebugWatch(ScriptContext *ctx) // 01F9 { ScriptGetVar(ctx); return FALSE; } -BOOL ScrCmd_LoadByte(ScriptContext *ctx) //0004 +BOOL ScrCmd_LoadByte(ScriptContext *ctx) // 0004 { - u8 index = ScriptReadByte(ctx); + u8 index = ScriptReadByte(ctx); ctx->data[index] = ScriptReadByte(ctx); return FALSE; } -BOOL ScrCmd_LoadWord(ScriptContext *ctx) //0005 +BOOL ScrCmd_LoadWord(ScriptContext *ctx) // 0005 { - u8 index = ScriptReadByte(ctx); + u8 index = ScriptReadByte(ctx); ctx->data[index] = ScriptReadWord(ctx); return FALSE; } -BOOL ScrCmd_LoadByteFromAddr(ScriptContext *ctx) //0006 +BOOL ScrCmd_LoadByteFromAddr(ScriptContext *ctx) // 0006 { - u8 index = ScriptReadByte(ctx); + u8 index = ScriptReadByte(ctx); ctx->data[index] = *(u8 *)ScriptReadWord(ctx); return FALSE; } -BOOL ScrCmd_WriteByteToAddr(ScriptContext *ctx) //0007 +BOOL ScrCmd_WriteByteToAddr(ScriptContext *ctx) // 0007 { - u8* ptr = (u8*)ScriptReadWord(ctx); - *ptr = ScriptReadByte(ctx); + u8 *ptr = (u8 *)ScriptReadWord(ctx); + *ptr = ScriptReadByte(ctx); return FALSE; } -BOOL ScrCmd_SetPtrByte(ScriptContext *ctx) //0008 +BOOL ScrCmd_SetPtrByte(ScriptContext *ctx) // 0008 { - u8* ptr = (u8*)ScriptReadWord(ctx); - *ptr = (u8)ctx->data[ScriptReadByte(ctx)]; + u8 *ptr = (u8 *)ScriptReadWord(ctx); + *ptr = (u8)ctx->data[ScriptReadByte(ctx)]; return FALSE; } -BOOL ScrCmd_CopyLocal(ScriptContext *ctx) //0009 +BOOL ScrCmd_CopyLocal(ScriptContext *ctx) // 0009 { - u8 index_store = ScriptReadByte(ctx); - u8 index_load = ScriptReadByte(ctx); + u8 index_store = ScriptReadByte(ctx); + u8 index_load = ScriptReadByte(ctx); ctx->data[index_store] = ctx->data[index_load]; return FALSE; } -BOOL ScrCmd_CopyByte(ScriptContext *ctx) //000A +BOOL ScrCmd_CopyByte(ScriptContext *ctx) // 000A { u8 *target = (u8 *)ScriptReadWord(ctx); u8 *source = (u8 *)ScriptReadWord(ctx); - *target = *source; + *target = *source; return FALSE; } -static u32 Compare(u16 a, u16 b) -{ - if (a < b) - { +static u32 Compare(u16 a, u16 b) { + if (a < b) { return 0; - } - else if (a == b) - { + } else if (a == b) { return 1; - } - else - { + } else { return 2; } } -BOOL ScrCmd_CompareLocalToLocal(ScriptContext *ctx) //000B +BOOL ScrCmd_CompareLocalToLocal(ScriptContext *ctx) // 000B { - u8 a = (u8)ctx->data[ScriptReadByte(ctx)]; - u8 b = (u8)ctx->data[ScriptReadByte(ctx)]; + u8 a = (u8)ctx->data[ScriptReadByte(ctx)]; + u8 b = (u8)ctx->data[ScriptReadByte(ctx)]; ctx->comparisonResult = (u8)Compare(a, b); return FALSE; } -BOOL ScrCmd_CompareLocalToValue(ScriptContext *ctx) //000C +BOOL ScrCmd_CompareLocalToValue(ScriptContext *ctx) // 000C { - u8 a = (u8)ctx->data[ScriptReadByte(ctx)]; - u8 b = ScriptReadByte(ctx); + u8 a = (u8)ctx->data[ScriptReadByte(ctx)]; + u8 b = ScriptReadByte(ctx); ctx->comparisonResult = (u8)Compare(a, b); return FALSE; } -BOOL ScrCmd_CompareLocalToAddr(ScriptContext *ctx) //000D +BOOL ScrCmd_CompareLocalToAddr(ScriptContext *ctx) // 000D { - u8 a = (u8)ctx->data[ScriptReadByte(ctx)]; - u8 b = *(u8*)ScriptReadWord(ctx); + u8 a = (u8)ctx->data[ScriptReadByte(ctx)]; + u8 b = *(u8 *)ScriptReadWord(ctx); ctx->comparisonResult = (u8)Compare(a, b); return FALSE; } -BOOL ScrCmd_CompareAddrToLocal(ScriptContext *ctx) //000E +BOOL ScrCmd_CompareAddrToLocal(ScriptContext *ctx) // 000E { - u8 a = *(u8*)ScriptReadWord(ctx); - u8 b = (u8)ctx->data[ScriptReadByte(ctx)]; + u8 a = *(u8 *)ScriptReadWord(ctx); + u8 b = (u8)ctx->data[ScriptReadByte(ctx)]; ctx->comparisonResult = (u8)Compare(a, b); return FALSE; } -BOOL ScrCmd_CompareAddrToValue(ScriptContext *ctx) //000F +BOOL ScrCmd_CompareAddrToValue(ScriptContext *ctx) // 000F { - u8 a = *(u8*)ScriptReadWord(ctx); - u8 b = (u8)ScriptReadByte(ctx); + u8 a = *(u8 *)ScriptReadWord(ctx); + u8 b = (u8)ScriptReadByte(ctx); ctx->comparisonResult = (u8)Compare(a, b); return FALSE; } -BOOL ScrCmd_CompareAddrToAddr(ScriptContext *ctx) //0010 +BOOL ScrCmd_CompareAddrToAddr(ScriptContext *ctx) // 0010 { - u8 a = *(u8*)ScriptReadWord(ctx); - u8 b = *(u8*)ScriptReadWord(ctx); + u8 a = *(u8 *)ScriptReadWord(ctx); + u8 b = *(u8 *)ScriptReadWord(ctx); ctx->comparisonResult = (u8)Compare(a, b); return FALSE; } -BOOL ScrCmd_CompareVarToValue(ScriptContext *ctx) //0011 +BOOL ScrCmd_CompareVarToValue(ScriptContext *ctx) // 0011 { - u16 a = *ScriptGetVarPointer(ctx); - u16 b = ScriptReadHalfword(ctx); + u16 a = *ScriptGetVarPointer(ctx); + u16 b = ScriptReadHalfword(ctx); ctx->comparisonResult = (u8)Compare(a, b); return FALSE; } -BOOL ScrCmd_CompareVarToVar(ScriptContext *ctx) //0012 +BOOL ScrCmd_CompareVarToVar(ScriptContext *ctx) // 0012 { - u16 *a = ScriptGetVarPointer(ctx); - u16 *b = ScriptGetVarPointer(ctx); + u16 *a = ScriptGetVarPointer(ctx); + u16 *b = ScriptGetVarPointer(ctx); ctx->comparisonResult = (u8)Compare(*a, *b); return FALSE; } -BOOL ScrCmd_RunScript(ScriptContext *ctx) //0013 +BOOL ScrCmd_RunScript(ScriptContext *ctx) // 0013 { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; u8 *activeScriptContextsNumber = (u8 *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_ACTIVE_SCRIPTCONTEXT_COUNT); ScriptContext **scriptContext1 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SCRIPT_CONTEXT_1); - u16 id = ScriptReadHalfword(ctx); + u16 id = ScriptReadHalfword(ctx); *scriptContext1 = CreateScriptContext(fieldSystem, id); (*activeScriptContextsNumber)++; return TRUE; } -BOOL ScrCmd_RunScriptWait(ScriptContext *ctx) //0014 +BOOL ScrCmd_RunScriptWait(ScriptContext *ctx) // 0014 { - FieldSystem *fieldSystem = ctx->fieldSystem; - u8 *unk1 = (u8 *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_05); + FieldSystem *fieldSystem = ctx->fieldSystem; + u8 *unk1 = (u8 *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_05); u8 *activeScriptContextsNumber = (u8 *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_ACTIVE_SCRIPTCONTEXT_COUNT); ScriptContext **scriptContext1 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SCRIPT_CONTEXT_1); - u16 id = ScriptReadHalfword(ctx); - *unk1 = 1; + u16 id = ScriptReadHalfword(ctx); + *unk1 = 1; *scriptContext1 = CreateScriptContext(fieldSystem, id); (*activeScriptContextsNumber)++; @@ -635,232 +632,225 @@ BOOL ScrCmd_RunScriptWait(ScriptContext *ctx) //0014 return TRUE; } -static BOOL sub_02039CC8(ScriptContext *ctx) -{ - u8* unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_UNKNOWN_05); +static BOOL sub_02039CC8(ScriptContext *ctx) { + u8 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_UNKNOWN_05); - if (*unk == 0) - { + if (*unk == 0) { return TRUE; } return FALSE; } -BOOL ScrCmd_RestartCurrentScript(ScriptContext *ctx) //0015 +BOOL ScrCmd_RestartCurrentScript(ScriptContext *ctx) // 0015 { - u8* unk = (u8 *)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_UNKNOWN_05); + u8 *unk = (u8 *)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_UNKNOWN_05); *unk = 0; return FALSE; } -BOOL ScrCmd_GoTo(ScriptContext *ctx) //0016 +BOOL ScrCmd_GoTo(ScriptContext *ctx) // 0016 { s32 offset = (s32)ScriptReadWord(ctx); ScriptJump(ctx, ctx->scriptPtr + offset); return FALSE; } -BOOL ScrCmd_ObjectGoTo(ScriptContext *ctx) //0017 +BOOL ScrCmd_ObjectGoTo(ScriptContext *ctx) // 0017 { LocalMapObject **lastInteracted = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u8 id = ScriptReadByte(ctx); - s32 offset = (s32)ScriptReadWord(ctx); - if (MapObject_GetID(*lastInteracted) == id) - { + u8 id = ScriptReadByte(ctx); + s32 offset = (s32)ScriptReadWord(ctx); + if (MapObject_GetID(*lastInteracted) == id) { ScriptJump(ctx, ctx->scriptPtr + offset); } return FALSE; } -BOOL ScrCmd_BgGoTo(ScriptContext *ctx) //0018 +BOOL ScrCmd_BgGoTo(ScriptContext *ctx) // 0018 { - u32 bgId = sub_02046534(ctx->taskManager); - u8 id = ScriptReadByte(ctx); + u32 bgId = sub_02046534(ctx->taskManager); + u8 id = ScriptReadByte(ctx); s32 offset = (s32)ScriptReadWord(ctx); - if (bgId == id) - { + if (bgId == id) { ScriptJump(ctx, ctx->scriptPtr + offset); } return FALSE; } -BOOL ScrCmd_DirectionGoTo(ScriptContext *ctx) //0019 +BOOL ScrCmd_DirectionGoTo(ScriptContext *ctx) // 0019 { u32 *playerDirection = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_FACING_DIRECTION); - u8 dir = ScriptReadByte(ctx); - s32 offset = (s32)ScriptReadWord(ctx); + u8 dir = ScriptReadByte(ctx); + s32 offset = (s32)ScriptReadWord(ctx); - if (*playerDirection == dir) - { + if (*playerDirection == dir) { ScriptJump(ctx, ctx->scriptPtr + offset); } return FALSE; } -BOOL ScrCmd_Call(ScriptContext *ctx) //001A +BOOL ScrCmd_Call(ScriptContext *ctx) // 001A { s32 offset = (s32)ScriptReadWord(ctx); ScriptCall(ctx, ctx->scriptPtr + offset); return FALSE; } -BOOL ScrCmd_Return(ScriptContext *ctx) //001B +BOOL ScrCmd_Return(ScriptContext *ctx) // 001B { ScriptReturn(ctx); return FALSE; } -BOOL ScrCmd_GoToIf(ScriptContext *ctx) //001C +BOOL ScrCmd_GoToIf(ScriptContext *ctx) // 001C { u8 compareType = ScriptReadByte(ctx); - s32 offset = (s32)ScriptReadWord(ctx); + s32 offset = (s32)ScriptReadWord(ctx); - if (sScriptConditionTable[compareType][ctx->comparisonResult] == TRUE) - { + if (sScriptConditionTable[compareType][ctx->comparisonResult] == TRUE) { ScriptJump(ctx, ctx->scriptPtr + offset); } return FALSE; } -BOOL ScrCmd_CallIf(ScriptContext *ctx) //001D +BOOL ScrCmd_CallIf(ScriptContext *ctx) // 001D { u8 compareType = ScriptReadByte(ctx); - s32 offset = (s32)ScriptReadWord(ctx); + s32 offset = (s32)ScriptReadWord(ctx); - if (sScriptConditionTable[compareType][ctx->comparisonResult] == TRUE) - { + if (sScriptConditionTable[compareType][ctx->comparisonResult] == TRUE) { ScriptCall(ctx, ctx->scriptPtr + offset); } return FALSE; } -BOOL ScrCmd_SetFlag(ScriptContext *ctx) //001E +BOOL ScrCmd_SetFlag(ScriptContext *ctx) // 001E { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 flag = ScriptReadHalfword(ctx); + u16 flag = ScriptReadHalfword(ctx); FieldSystem_FlagSet(fieldSystem, flag); return FALSE; } -BOOL ScrCmd_ClearFlag(ScriptContext *ctx) //001F +BOOL ScrCmd_ClearFlag(ScriptContext *ctx) // 001F { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 flag = ScriptReadHalfword(ctx); + u16 flag = ScriptReadHalfword(ctx); FlagClear(fieldSystem, flag); return FALSE; } -BOOL ScrCmd_CheckFlag(ScriptContext *ctx) //0020 +BOOL ScrCmd_CheckFlag(ScriptContext *ctx) // 0020 { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 flag = ScriptReadHalfword(ctx); - ctx->comparisonResult = FieldSystem_FlagCheck(fieldSystem, flag); + u16 flag = ScriptReadHalfword(ctx); + ctx->comparisonResult = FieldSystem_FlagCheck(fieldSystem, flag); return FALSE; } -BOOL ScrCmd_CheckFlagVar(ScriptContext *ctx) //0021 +BOOL ScrCmd_CheckFlagVar(ScriptContext *ctx) // 0021 { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *wk1 = ScriptGetVarPointer(ctx); - u16 *wk2 = ScriptGetVarPointer(ctx); - *wk2 = FieldSystem_FlagCheck(fieldSystem, *wk1); + u16 *wk1 = ScriptGetVarPointer(ctx); + u16 *wk2 = ScriptGetVarPointer(ctx); + *wk2 = FieldSystem_FlagCheck(fieldSystem, *wk1); return FALSE; } -BOOL ScrCmd_SetFlagVar(ScriptContext *ctx) //0022 +BOOL ScrCmd_SetFlagVar(ScriptContext *ctx) // 0022 { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *wk = ScriptGetVarPointer(ctx); + u16 *wk = ScriptGetVarPointer(ctx); FieldSystem_FlagSet(fieldSystem, *wk); return FALSE; } -BOOL ScrCmd_SetTrainerFlag(ScriptContext *ctx) //0023 +BOOL ScrCmd_SetTrainerFlag(ScriptContext *ctx) // 0023 { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 flag = ScriptGetVar(ctx); + u16 flag = ScriptGetVar(ctx); TrainerFieldSystem_FlagSet(fieldSystem, flag); return FALSE; } -BOOL ScrCmd_ClearTrainerFlag(ScriptContext *ctx) //0024 +BOOL ScrCmd_ClearTrainerFlag(ScriptContext *ctx) // 0024 { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 flag = ScriptGetVar(ctx); + u16 flag = ScriptGetVar(ctx); TrainerFlagClear(fieldSystem, flag); return FALSE; } -BOOL ScrCmd_CheckTrainerFlag(ScriptContext *ctx) //0025 +BOOL ScrCmd_CheckTrainerFlag(ScriptContext *ctx) // 0025 { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 flag = ScriptGetVar(ctx); - ctx->comparisonResult = TrainerFieldSystem_FlagCheck(fieldSystem, flag); + u16 flag = ScriptGetVar(ctx); + ctx->comparisonResult = TrainerFieldSystem_FlagCheck(fieldSystem, flag); return FALSE; } -BOOL ScrCmd_AddVar(ScriptContext *ctx) //0026 +BOOL ScrCmd_AddVar(ScriptContext *ctx) // 0026 { u16 *wk1 = ScriptGetVarPointer(ctx); - u16 wk2 = ScriptGetVar(ctx); - *wk1 = (u16)(*wk1 + wk2); + u16 wk2 = ScriptGetVar(ctx); + *wk1 = (u16)(*wk1 + wk2); return FALSE; } -BOOL ScrCmd_SubVar(ScriptContext *ctx) //0027 +BOOL ScrCmd_SubVar(ScriptContext *ctx) // 0027 { u16 *wk1 = ScriptGetVarPointer(ctx); - u16 wk2 = ScriptGetVar(ctx); - *wk1 = (u16)(*wk1 - wk2); + u16 wk2 = ScriptGetVar(ctx); + *wk1 = (u16)(*wk1 - wk2); return FALSE; } -BOOL ScrCmd_SetVar(ScriptContext *ctx) //0028 +BOOL ScrCmd_SetVar(ScriptContext *ctx) // 0028 { u16 *wk = ScriptGetVarPointer(ctx); - *wk = ScriptReadHalfword(ctx); + *wk = ScriptReadHalfword(ctx); return FALSE; } -BOOL ScrCmd_CopyVar(ScriptContext *ctx) //0029 +BOOL ScrCmd_CopyVar(ScriptContext *ctx) // 0029 { u16 *wk1 = ScriptGetVarPointer(ctx); u16 *wk2 = ScriptGetVarPointer(ctx); - *wk1 = *wk2; + *wk1 = *wk2; return FALSE; } -BOOL ScrCmd_SetOrCopyVar(ScriptContext *ctx) //002A - todo: better name +BOOL ScrCmd_SetOrCopyVar(ScriptContext *ctx) // 002A - todo: better name { u16 *wk1 = ScriptGetVarPointer(ctx); - u16 wk2 = ScriptGetVar(ctx); - *wk1 = wk2; + u16 wk2 = ScriptGetVar(ctx); + *wk1 = wk2; return FALSE; } -BOOL ScrCmd_Message(ScriptContext *ctx) //002B - todo: MessageAll? +BOOL ScrCmd_Message(ScriptContext *ctx) // 002B - todo: MessageAll? { u8 id = ScriptReadByte(ctx); ov05_ShowMessageInField(ctx, ctx->msgData, id); return FALSE; } -BOOL ScrCmd_MessageFrom(ScriptContext *ctx) //01FA - todo: MessageAllFromNarc? +BOOL ScrCmd_MessageFrom(ScriptContext *ctx) // 01FA - todo: MessageAllFromNarc? { - u16 arc = ScriptGetVar(ctx); - u16 msg = ScriptGetVar(ctx); + u16 arc = ScriptGetVar(ctx); + u16 msg = ScriptGetVar(ctx); MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, arc, HEAP_ID_32); ov05_ShowMessageInField(ctx, msgData, msg); DestroyMsgData(msgData); return FALSE; } -BOOL ScrCmd_MessageFrom2(ScriptContext *ctx) //01FB - todo: MessageFromNarc? +BOOL ScrCmd_MessageFrom2(ScriptContext *ctx) // 01FB - todo: MessageFromNarc? { - u16 arc = ScriptGetVar(ctx); - u16 msg = ScriptGetVar(ctx); + u16 arc = ScriptGetVar(ctx); + u16 msg = ScriptGetVar(ctx); MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, arc, HEAP_ID_32); ov05_021E2BD0(ctx, msgData, msg, 1, NULL); DestroyMsgData(msgData); @@ -868,10 +858,10 @@ BOOL ScrCmd_MessageFrom2(ScriptContext *ctx) //01FB - todo: MessageFromNarc? return TRUE; } -BOOL ScrCmd_Unk01FC(ScriptContext *ctx) //01FC +BOOL ScrCmd_Unk01FC(ScriptContext *ctx) // 01FC { - u16 typ = ScriptReadHalfword(ctx); - u16 id = ScriptReadHalfword(ctx); + u16 typ = ScriptReadHalfword(ctx); + u16 id = ScriptReadHalfword(ctx); u16 word1 = ScriptReadHalfword(ctx); s16 word2 = (s16)ScriptReadHalfword(ctx); @@ -879,10 +869,10 @@ BOOL ScrCmd_Unk01FC(ScriptContext *ctx) //01FC return FALSE; } -BOOL ScrCmd_Unk01FD(ScriptContext *ctx) //01FD +BOOL ScrCmd_Unk01FD(ScriptContext *ctx) // 01FD { - u16 typ = ScriptReadHalfword(ctx); - u16 id = ScriptReadHalfword(ctx); + u16 typ = ScriptReadHalfword(ctx); + u16 id = ScriptReadHalfword(ctx); u16 word1 = ScriptReadHalfword(ctx); s16 word2 = (s16)ScriptReadHalfword(ctx); @@ -891,38 +881,34 @@ BOOL ScrCmd_Unk01FD(ScriptContext *ctx) //01FD return TRUE; } -BOOL ScrCmd_Unk01FE(ScriptContext *ctx) //01FE +BOOL ScrCmd_Unk01FE(ScriptContext *ctx) // 01FE { u8 id = ScriptReadByte(ctx); - if (ctx->fieldSystem->unkA8 == NULL) - { + if (ctx->fieldSystem->unkA8 == NULL) { return FALSE; } u16 *unkArr = ctx->fieldSystem->unkA8->unk90[id].unk0; - if (unkArr[0] == 0xFFFF) - { + if (unkArr[0] == 0xFFFF) { MsgData *msgdata = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0555_bin, HEAP_ID_32); ov05_021E2BD0(ctx, msgdata, unkArr[1], 1, NULL); DestroyMsgData(msgdata); - } - else - { + } else { ov05_021E2C58(ctx, unkArr[0], unkArr[1], unkArr[2], (s16)unkArr[3], 1); } SetupNativeScript(ctx, sub_0203A2F0); return TRUE; } -BOOL ScrCmd_Unk01FF(ScriptContext *ctx) //01FF +BOOL ScrCmd_Unk01FF(ScriptContext *ctx) // 01FF { FieldSystem *fieldSystem = ctx->fieldSystem; - u8 msg = ScriptReadByte(ctx); - u16 poke = ScriptGetVar(ctx); - u16 sex = ScriptReadHalfword(ctx); - u8 flag = ScriptReadByte(ctx); - u8 unk = 0; + u8 msg = ScriptReadByte(ctx); + u16 poke = ScriptGetVar(ctx); + u16 sex = ScriptReadHalfword(ctx); + u8 flag = ScriptReadByte(ctx); + u8 unk = 0; MessageFormat *messageFormat = ov06_02244210(fieldSystem->saveData, poke, sex, flag, &unk); ov05_021E2CBC(ctx, messageFormat, (u8)(msg + unk), 1); @@ -932,7 +918,7 @@ BOOL ScrCmd_Unk01FF(ScriptContext *ctx) //01FF return TRUE; } -BOOL ScrCmd_MessageUnown(ScriptContext *ctx) //026D +BOOL ScrCmd_MessageUnown(ScriptContext *ctx) // 026D { UnkStruct_0203A288 unkStruct; u16 msg = ScriptReadHalfword(ctx); @@ -946,7 +932,7 @@ BOOL ScrCmd_MessageUnown(ScriptContext *ctx) //026D return TRUE; } -BOOL ScrCmd_Unk002C(ScriptContext *ctx) //002C - todo: Message? +BOOL ScrCmd_Unk002C(ScriptContext *ctx) // 002C - todo: Message? { u8 msg = ScriptReadByte(ctx); ov05_021E2BD0(ctx, ctx->msgData, msg, 1, NULL); @@ -954,13 +940,12 @@ BOOL ScrCmd_Unk002C(ScriptContext *ctx) //002C - todo: Message? return TRUE; } -static BOOL sub_0203A2F0(ScriptContext *ctx) -{ +static BOOL sub_0203A2F0(ScriptContext *ctx) { u8 *textPrinterNumber = (u8 *)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_TEXT_PRINTER_NUMBER); return sub_020546C8(*textPrinterNumber); } -BOOL ScrCmd_Unk002D(ScriptContext *ctx) //002D - todo: MessageFromVar? MessageFlex? +BOOL ScrCmd_Unk002D(ScriptContext *ctx) // 002D - todo: MessageFromVar? MessageFlex? { u16 msg = ScriptGetVar(ctx); ov05_021E2BD0(ctx, ctx->msgData, (u8)msg, 1, NULL); @@ -968,7 +953,7 @@ BOOL ScrCmd_Unk002D(ScriptContext *ctx) //002D - todo: MessageFromVar? MessageFl return TRUE; } -BOOL ScrCmd_Unk02C0(ScriptContext *ctx) //02C0 +BOOL ScrCmd_Unk02C0(ScriptContext *ctx) // 02C0 { UnkStruct_0203A288 unkStruct; u16 msg = ScriptGetVar(ctx); @@ -982,7 +967,7 @@ BOOL ScrCmd_Unk02C0(ScriptContext *ctx) //02C0 return TRUE; } -BOOL ScrCmd_Unk002E(ScriptContext *ctx) //002E - todo: MessageWait? MessageNoSkip? +BOOL ScrCmd_Unk002E(ScriptContext *ctx) // 002E - todo: MessageWait? MessageNoSkip? { u16 msg = ScriptGetVar(ctx); ov05_021E2BD0(ctx, ctx->msgData, (u8)msg, 0, NULL); @@ -990,25 +975,22 @@ BOOL ScrCmd_Unk002E(ScriptContext *ctx) //002E - todo: MessageWait? MessageNoSki return TRUE; } -BOOL ScrCmd_Unk020C(ScriptContext *ctx) //020C +BOOL ScrCmd_Unk020C(ScriptContext *ctx) // 020C { LocalMapObject **lastInteracted = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u8 msg = (u8)MapObject_GetType(*lastInteracted); + u8 msg = (u8)MapObject_GetType(*lastInteracted); ov05_021E2BD0(ctx, ctx->msgData, msg, 1, NULL); SetupNativeScript(ctx, sub_0203A2F0); return TRUE; } -BOOL ScrCmd_Unk002F(ScriptContext *ctx) //002F +BOOL ScrCmd_Unk002F(ScriptContext *ctx) // 002F { u8 msg = ScriptReadByte(ctx); - if (!sub_02030F40()) - { + if (!sub_02030F40()) { ov05_021E2BD0(ctx, ctx->msgData, msg, 1, NULL); - } - else - { + } else { UnkStruct_0203A288 unkStruct; ov05_021E2BB8(&unkStruct, ctx); unkStruct.unk0 = 1; @@ -1020,141 +1002,120 @@ BOOL ScrCmd_Unk002F(ScriptContext *ctx) //002F return TRUE; } -BOOL ScrCmd_WaitButtonAB(ScriptContext *ctx) //0030 +BOOL ScrCmd_WaitButtonAB(ScriptContext *ctx) // 0030 { SetupNativeScript(ctx, sub_0203A46C); return TRUE; } -static BOOL sub_0203A46C(ScriptContext *ctx) -{ +static BOOL sub_0203A46C(ScriptContext *ctx) { #pragma unused(ctx) - if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) - { + if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return TRUE; } return FALSE; } -BOOL ScrCmd_WaitButtonABTime(ScriptContext *ctx) //0190 +BOOL ScrCmd_WaitButtonABTime(ScriptContext *ctx) // 0190 { ctx->data[0] = ScriptGetVar(ctx); SetupNativeScript(ctx, sub_0203A4AC); return TRUE; } -static BOOL sub_0203A4AC(ScriptContext *ctx) -{ - if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) - { +static BOOL sub_0203A4AC(ScriptContext *ctx) { + if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return TRUE; } ctx->data[0] = ctx->data[0] - 1; - if (ctx->data[0] == 0) - { + if (ctx->data[0] == 0) { return TRUE; } return FALSE; } -BOOL ScrCmd_WaitButton(ScriptContext *ctx) //0031 +BOOL ScrCmd_WaitButton(ScriptContext *ctx) // 0031 { SetupNativeScript(ctx, sub_0203A4E0); return TRUE; } -static BOOL sub_0203A4E0(ScriptContext *ctx) -{ - if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) - { +static BOOL sub_0203A4E0(ScriptContext *ctx) { + if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return TRUE; - } - else if (gSystem.newKeys & PAD_KEY_UP) - { + } else if (gSystem.newKeys & PAD_KEY_UP) { sub_02055304(ctx->fieldSystem->playerAvatar, 0); - } - else if (gSystem.newKeys & PAD_KEY_DOWN) - { + } else if (gSystem.newKeys & PAD_KEY_DOWN) { sub_02055304(ctx->fieldSystem->playerAvatar, 1); - } - else if (gSystem.newKeys & PAD_KEY_LEFT) - { + } else if (gSystem.newKeys & PAD_KEY_LEFT) { sub_02055304(ctx->fieldSystem->playerAvatar, 2); - } - else if (gSystem.newKeys & PAD_KEY_RIGHT) - { + } else if (gSystem.newKeys & PAD_KEY_RIGHT) { sub_02055304(ctx->fieldSystem->playerAvatar, 3); - } - else if (gSystem.newKeys & PAD_BUTTON_X) - { + } else if (gSystem.newKeys & PAD_BUTTON_X) { sub_02039460(ctx->fieldSystem); - } - else - { + } else { return FALSE; } return TRUE; } -BOOL ScrCmd_WaitButtonABPad(ScriptContext *ctx) //0032 +BOOL ScrCmd_WaitButtonABPad(ScriptContext *ctx) // 0032 { SetupNativeScript(ctx, sub_0203A570); return TRUE; } -static BOOL sub_0203A570(ScriptContext *ctx) -{ +static BOOL sub_0203A570(ScriptContext *ctx) { #pragma unused(ctx) if (gSystem.newKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return TRUE; - } - else if (gSystem.newKeys & (PAD_KEY_RIGHT | PAD_KEY_LEFT | PAD_KEY_UP | PAD_KEY_DOWN)) { + } else if (gSystem.newKeys & (PAD_KEY_RIGHT | PAD_KEY_LEFT | PAD_KEY_UP | PAD_KEY_DOWN)) { return TRUE; } return FALSE; } -BOOL ScrCmd_Unk0033(ScriptContext *ctx) //0033 - todo: OpenMessageBox? +BOOL ScrCmd_Unk0033(ScriptContext *ctx) // 0033 - todo: OpenMessageBox? { FieldSystem *fieldSystem = ctx->fieldSystem; - u8 *unk = (u8 *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); + u8 *unk = (u8 *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); sub_020545B8(fieldSystem->bgConfig, (Window *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW), 3); sub_02054608((Window *)FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW), Save_PlayerData_GetOptionsAddr(ctx->fieldSystem->saveData)); *unk = 1; return FALSE; } -BOOL ScrCmd_CloseMessageBox(ScriptContext *ctx) //0034 +BOOL ScrCmd_CloseMessageBox(ScriptContext *ctx) // 0034 { FieldSystem *fieldSystem = ctx->fieldSystem; - Window *window = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW); - u8 *unk2 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); + Window *window = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW); + u8 *unk2 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); ClearFrameAndWindow2(window, FALSE); RemoveWindow(window); *unk2 = 0; return FALSE; } -BOOL ScrCmd_Unk0035(ScriptContext *ctx) //0035 - todo: FreezeMessageBox? +BOOL ScrCmd_Unk0035(ScriptContext *ctx) // 0035 - todo: FreezeMessageBox? { FieldSystem *fieldSystem = ctx->fieldSystem; - Window *window = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW); - u8 *unk2 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); + Window *window = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW); + u8 *unk2 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); RemoveWindow(window); *unk2 = 0; return FALSE; } -BOOL ScrCmd_ScrollBg(ScriptContext *ctx) //003C +BOOL ScrCmd_ScrollBg(ScriptContext *ctx) // 003C { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *xval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8008); - u16 *xcnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8004); - u16 *xdir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8009); - u16 *yval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800A); - u16 *ycnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8005); - u16 *ydir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800B); + u16 *xval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8008); + u16 *xcnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8004); + u16 *xdir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8009); + u16 *yval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800A); + u16 *ycnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8005); + u16 *ydir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800B); *xval = ScriptReadByte(ctx); *xcnt = ScriptReadByte(ctx); @@ -1167,63 +1128,51 @@ BOOL ScrCmd_ScrollBg(ScriptContext *ctx) //003C return TRUE; } -static BOOL sub_0203A6C8(ScriptContext *ctx) -{ +static BOOL sub_0203A6C8(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *xval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8008); - u16 *xdir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8009); - u16 *yval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800A); - u16 *ydir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800B); - u16 *xcnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8004); - u16 *ycnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8005); - - if (*xcnt == 0 && *ycnt == 0) - { + u16 *xval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8008); + u16 *xdir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8009); + u16 *yval = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800A); + u16 *ydir = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_800B); + u16 *xcnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8004); + u16 *ycnt = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SPECIAL_VAR_8005); + + if (*xcnt == 0 && *ycnt == 0) { return TRUE; } - if (*xval != 0) - { - if (*xdir == 0) - { + if (*xval != 0) { + if (*xdir == 0) { BgSetPosTextAndCommit(fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, BG_POS_OP_ADD_X, *xval); - } - else - { + } else { BgSetPosTextAndCommit(fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, BG_POS_OP_SUB_X, *xval); } } - if (*yval != 0) - { - if (*ydir == 0) - { + if (*yval != 0) { + if (*ydir == 0) { BgSetPosTextAndCommit(fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, BG_POS_OP_ADD_Y, *yval); - } - else - { + } else { BgSetPosTextAndCommit(fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, BG_POS_OP_SUB_Y, *yval); } } - if (*xcnt != 0) - { + if (*xcnt != 0) { *xcnt = (u16)(*xcnt - 1); } - if (*ycnt != 0) - { + if (*ycnt != 0) { *ycnt = (u16)(*ycnt - 1); } return FALSE; } -BOOL ScrCmd_CreateMessageBox(ScriptContext *ctx) //003C +BOOL ScrCmd_CreateMessageBox(ScriptContext *ctx) // 003C { - FieldSystem *fieldSystem = ctx->fieldSystem; - String **stringBuffer1 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_1); - String **stringBuffer0 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_0); + FieldSystem *fieldSystem = ctx->fieldSystem; + String **stringBuffer1 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_1); + String **stringBuffer0 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_0); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); u8 typ, msg; u16 wk, map; @@ -1231,11 +1180,11 @@ BOOL ScrCmd_CreateMessageBox(ScriptContext *ctx) //003C msg = ScriptReadByte(ctx); typ = ScriptReadByte(ctx); map = ScriptReadHalfword(ctx); - wk = ScriptReadHalfword(ctx); + wk = ScriptReadHalfword(ctx); if (map == 0) { LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); - map = (u16)MapObject_GetParam(*lastInteracted, 0); + map = (u16)MapObject_GetParam(*lastInteracted, 0); } ov05_021E8128(fieldSystem->unk60, typ, map); @@ -1248,11 +1197,11 @@ BOOL ScrCmd_CreateMessageBox(ScriptContext *ctx) //003C return TRUE; } -BOOL ScrCmd_Unk0037(ScriptContext *ctx) //0037 - todo: SetTextBoard? ColourMessageBox? +BOOL ScrCmd_Unk0037(ScriptContext *ctx) // 0037 - todo: SetTextBoard? ColourMessageBox? { FieldSystem *fieldSystem = ctx->fieldSystem; - u8 typ = ScriptReadByte(ctx); - u16 map = ScriptReadHalfword(ctx); + u8 typ = ScriptReadByte(ctx); + u16 map = ScriptReadHalfword(ctx); ov05_021E8128(fieldSystem->unk60, typ, map); ov05_021E8130(fieldSystem->unk60, 1); @@ -1260,14 +1209,14 @@ BOOL ScrCmd_Unk0037(ScriptContext *ctx) //0037 - todo: SetTextBoard? ColourMessa return TRUE; } -BOOL ScrCmd_Unk0038(ScriptContext *ctx) { //0038 - todo: ShowMessageBox? +BOOL ScrCmd_Unk0038(ScriptContext *ctx) { // 0038 - todo: ShowMessageBox? FieldSystem *fieldSystem = ctx->fieldSystem; - u8 req = ScriptReadByte(ctx); + u8 req = ScriptReadByte(ctx); ov05_021E8130(fieldSystem->unk60, req); return TRUE; } -BOOL ScrCmd_Unk0039(ScriptContext *ctx) { //0039 - todo: MessageBoxWait? WaitMessageBox? +BOOL ScrCmd_Unk0039(ScriptContext *ctx) { // 0039 - todo: MessageBoxWait? WaitMessageBox? if (ov05_021E8148(ctx->fieldSystem->unk60) == TRUE) { return FALSE; } @@ -1284,11 +1233,11 @@ static BOOL sub_0203A8A0(ScriptContext *ctx) { return FALSE; } -BOOL ScrCmd_Unk003A(ScriptContext *ctx) { //003A - todo: CreateMessageBoxText? - FieldSystem *fieldSystem = ctx->fieldSystem; - u8 *printerNumber = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_TEXT_PRINTER_NUMBER); - String **stringBuffer1 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_1); - String **stringBuffer0 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_0); +BOOL ScrCmd_Unk003A(ScriptContext *ctx) { // 003A - todo: CreateMessageBoxText? + FieldSystem *fieldSystem = ctx->fieldSystem; + u8 *printerNumber = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_TEXT_PRINTER_NUMBER); + String **stringBuffer1 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_1); + String **stringBuffer0 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_0); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); u8 msg = ScriptReadByte(ctx); @@ -1298,15 +1247,15 @@ BOOL ScrCmd_Unk003A(ScriptContext *ctx) { //003A - todo: CreateMessageBoxText? StringExpandPlaceholders(*messageFormat, *stringBuffer0, *stringBuffer1); *printerNumber = (u8)sub_02054658(ov05_021E8140(fieldSystem->unk60), *stringBuffer0, Save_PlayerData_GetOptionsAddr(ctx->fieldSystem->saveData), 1); - ctx->data[0] = wk; + ctx->data[0] = wk; SetupNativeScript(ctx, sub_0203A94C); return TRUE; } static BOOL sub_0203A94C(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u8 *printerNumber = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_TEXT_PRINTER_NUMBER); - u16 *varPtr = GetVarPointer(fieldSystem, (u16)ctx->data[0]); + u8 *printerNumber = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_TEXT_PRINTER_NUMBER); + u16 *varPtr = GetVarPointer(fieldSystem, (u16)ctx->data[0]); ov05_021E8144(fieldSystem->unk60); u32 tmp = 0xFFFF; @@ -1340,7 +1289,7 @@ static BOOL sub_0203A94C(ScriptContext *ctx) { } } -BOOL ScrCmd_Unk003B(ScriptContext *ctx) { //003B - todo: CloseMessageBox? +BOOL ScrCmd_Unk003B(ScriptContext *ctx) { // 003B - todo: CloseMessageBox? ctx->data[0] = ScriptReadHalfword(ctx); SetupNativeScript(ctx, sub_0203AA0C); @@ -1378,17 +1327,17 @@ static BOOL sub_0203AA0C(ScriptContext *ctx) { } } -BOOL ScrCmd_Menu(ScriptContext *ctx) { //003C +BOOL ScrCmd_Menu(ScriptContext *ctx) { // 003C sub_02039460(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_YesNoMenu(ScriptContext *ctx) { //003E +BOOL ScrCmd_YesNoMenu(ScriptContext *ctx) { // 003E FieldSystem *fieldSystem = ctx->fieldSystem; - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LIST_MENU_2D); - u16 wk = ScriptReadHalfword(ctx); + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LIST_MENU_2D); + u16 wk = ScriptReadHalfword(ctx); LoadUserFrameGfx1(fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, 985, 11, 0, HEAP_ID_4); - *unk = Std_CreateYesNoMenu(fieldSystem->bgConfig, &UNK_020F34E0, 985, 11, 4); + *unk = Std_CreateYesNoMenu(fieldSystem->bgConfig, &UNK_020F34E0, 985, 11, 4); ctx->data[0] = wk; SetupNativeScript(ctx, sub_0203AB00); return TRUE; @@ -1396,9 +1345,9 @@ BOOL ScrCmd_YesNoMenu(ScriptContext *ctx) { //003E static BOOL sub_0203AB00(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LIST_MENU_2D); - u16 *ptr = GetVarPointer(fieldSystem, (u16)ctx->data[0]); - u32 unk2 = sub_020021AC(*unk, 4); + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LIST_MENU_2D); + u16 *ptr = GetVarPointer(fieldSystem, (u16)ctx->data[0]); + u32 unk2 = sub_020021AC(*unk, 4); if (unk2 == -1) { return FALSE; @@ -1412,69 +1361,69 @@ static BOOL sub_0203AB00(ScriptContext *ctx) { return TRUE; } -BOOL ScrCmd_ShowWaitingIcon(ScriptContext *ctx) { //018D - Window *window = (Window *)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); +BOOL ScrCmd_ShowWaitingIcon(ScriptContext *ctx) { // 018D + Window *window = (Window *)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); WaitingIcon **waitingIcon = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WAITING_ICON); - *waitingIcon = WaitingIcon_New(window, 994); + *waitingIcon = WaitingIcon_New(window, 994); return FALSE; } -BOOL ScrCmd_HideWaitingIcon(ScriptContext *ctx) { //018E +BOOL ScrCmd_HideWaitingIcon(ScriptContext *ctx) { // 018E WaitingIcon **waitingIcon = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WAITING_ICON); sub_0200DBFC(*waitingIcon); return FALSE; } -BOOL ScrCmd_Unk0040(ScriptContext *ctx) { //0040 - FieldSystem *fieldSystem = ctx->fieldSystem; - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); +BOOL ScrCmd_Unk0040(ScriptContext *ctx) { // 0040 + FieldSystem *fieldSystem = ctx->fieldSystem; + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 unk3 = ScriptReadByte(ctx); - u8 unk4 = ScriptReadByte(ctx); - u8 unk5 = ScriptReadByte(ctx); - u8 unk6 = ScriptReadByte(ctx); - u16 unk7 = ScriptReadHalfword(ctx); - u16 *ptr = GetVarPointer(fieldSystem, unk7); - Window *window = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); - *unk = ov05_021E1BF8(fieldSystem, unk3, unk4, unk5, unk6, ptr, *messageFormat, window, NULL); - ctx->data[0] = unk7; + u8 unk3 = ScriptReadByte(ctx); + u8 unk4 = ScriptReadByte(ctx); + u8 unk5 = ScriptReadByte(ctx); + u8 unk6 = ScriptReadByte(ctx); + u16 unk7 = ScriptReadHalfword(ctx); + u16 *ptr = GetVarPointer(fieldSystem, unk7); + Window *window = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); + *unk = ov05_021E1BF8(fieldSystem, unk3, unk4, unk5, unk6, ptr, *messageFormat, window, NULL); + ctx->data[0] = unk7; return TRUE; } -BOOL ScrCmd_Unk0041(ScriptContext *ctx) { //0041 - FieldSystem *fieldSystem = ctx->fieldSystem; - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); +BOOL ScrCmd_Unk0041(ScriptContext *ctx) { // 0041 + FieldSystem *fieldSystem = ctx->fieldSystem; + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 unk3 = ScriptReadByte(ctx); - u8 unk4 = ScriptReadByte(ctx); - u8 unk5 = ScriptReadByte(ctx); - u8 unk6 = ScriptReadByte(ctx); - u16 unk7 = ScriptReadHalfword(ctx); - u16 *ptr = GetVarPointer(fieldSystem, unk7); - Window *window = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); - *unk = ov05_021E1BF8(fieldSystem, unk3, unk4, unk5, unk6, ptr, *messageFormat, window, ctx->msgData); - ctx->data[0] = unk7; + u8 unk3 = ScriptReadByte(ctx); + u8 unk4 = ScriptReadByte(ctx); + u8 unk5 = ScriptReadByte(ctx); + u8 unk6 = ScriptReadByte(ctx); + u16 unk7 = ScriptReadHalfword(ctx); + u16 *ptr = GetVarPointer(fieldSystem, unk7); + Window *window = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); + *unk = ov05_021E1BF8(fieldSystem, unk3, unk4, unk5, unk6, ptr, *messageFormat, window, ctx->msgData); + ctx->data[0] = unk7; return TRUE; } -BOOL ScrCmd_Unk0042(ScriptContext *ctx) { //0042 +BOOL ScrCmd_Unk0042(ScriptContext *ctx) { // 0042 u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); - u8 unk2 = ScriptReadByte(ctx); - u8 unk3 = ScriptReadByte(ctx); + u8 unk2 = ScriptReadByte(ctx); + u8 unk3 = ScriptReadByte(ctx); ov05_021E1C4C(*unk, unk2, unk3); return FALSE; } -BOOL ScrCmd_Unk029D(ScriptContext *ctx) { //029D +BOOL ScrCmd_Unk029D(ScriptContext *ctx) { // 029D FieldSystem *fieldSystem = ctx->fieldSystem; - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); - u16 unk2 = ScriptGetVar(ctx); - u16 unk3 = ScriptGetVar(ctx); + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); + u16 unk2 = ScriptGetVar(ctx); + u16 unk3 = ScriptGetVar(ctx); ov05_021E1C4C(*unk, unk2, unk3); return FALSE; } -BOOL ScrCmd_Unk0043(ScriptContext *ctx) { //0043 +BOOL ScrCmd_Unk0043(ScriptContext *ctx) { // 0043 u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); ov05_021E1C54(*unk); SetupNativeScript(ctx, sub_0203AD2C); @@ -1490,7 +1439,7 @@ static BOOL sub_0203AD2C(ScriptContext *ctx) { } } -BOOL ScrCmd_Unk02B9(ScriptContext *ctx) { //02B9 +BOOL ScrCmd_Unk02B9(ScriptContext *ctx) { // 02B9 u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); ov05_021E1C54(*unk); SetupNativeScript(ctx, sub_0203AD78); @@ -1499,8 +1448,8 @@ BOOL ScrCmd_Unk02B9(ScriptContext *ctx) { //02B9 static BOOL sub_0203AD78(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *varPtr = GetVarPointer(fieldSystem, (u16)ctx->data[0]); - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); + u16 *varPtr = GetVarPointer(fieldSystem, (u16)ctx->data[0]); + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); if (*varPtr == 0xEEEE) { if (sub_02052714(fieldSystem->unk78)) { @@ -1515,41 +1464,41 @@ static BOOL sub_0203AD78(ScriptContext *ctx) { } } -BOOL ScrCmd_Unk0044(ScriptContext *ctx) { //0044 - FieldSystem *fieldSystem = ctx->fieldSystem; - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); +BOOL ScrCmd_Unk0044(ScriptContext *ctx) { // 0044 + FieldSystem *fieldSystem = ctx->fieldSystem; + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 unk3 = ScriptReadByte(ctx); - u8 unk4 = ScriptReadByte(ctx); - u8 unk5 = ScriptReadByte(ctx); - u8 unk6 = ScriptReadByte(ctx); + u8 unk3 = ScriptReadByte(ctx); + u8 unk4 = ScriptReadByte(ctx); + u8 unk5 = ScriptReadByte(ctx); + u8 unk6 = ScriptReadByte(ctx); - u16 halfWord = ScriptReadHalfword(ctx); - u16 *varPtr = GetVarPointer(fieldSystem, halfWord); + u16 halfWord = ScriptReadHalfword(ctx); + u16 *varPtr = GetVarPointer(fieldSystem, halfWord); Window *window = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); - *unk = ov05_021E1F34(fieldSystem, unk3, unk4, unk5, unk6, varPtr, *messageFormat, window, NULL); - ctx->data[0] = halfWord; + *unk = ov05_021E1F34(fieldSystem, unk3, unk4, unk5, unk6, varPtr, *messageFormat, window, NULL); + ctx->data[0] = halfWord; return TRUE; } -BOOL ScrCmd_Unk0045(ScriptContext *ctx) { //0045 - FieldSystem *fieldSystem = ctx->fieldSystem; - u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); +BOOL ScrCmd_Unk0045(ScriptContext *ctx) { // 0045 + FieldSystem *fieldSystem = ctx->fieldSystem; + u32 *unk = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MENU_WINDOW); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 unk3 = ScriptReadByte(ctx); - u8 unk4 = ScriptReadByte(ctx); - u8 unk5 = ScriptReadByte(ctx); - u8 unk6 = ScriptReadByte(ctx); + u8 unk3 = ScriptReadByte(ctx); + u8 unk4 = ScriptReadByte(ctx); + u8 unk5 = ScriptReadByte(ctx); + u8 unk6 = ScriptReadByte(ctx); - u16 halfWord = ScriptReadHalfword(ctx); - u16 *varPtr = GetVarPointer(fieldSystem, halfWord); + u16 halfWord = ScriptReadHalfword(ctx); + u16 *varPtr = GetVarPointer(fieldSystem, halfWord); Window *window = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_WINDOW); - *unk = ov05_021E1F34(fieldSystem, unk3, unk4, unk5, unk6, varPtr, *messageFormat, window, ctx->msgData); - ctx->data[0] = halfWord; + *unk = ov05_021E1F34(fieldSystem, unk3, unk4, unk5, unk6, varPtr, *messageFormat, window, ctx->msgData); + ctx->data[0] = halfWord; return TRUE; } -BOOL ScrCmd_Unk0046(ScriptContext *ctx) { //0046 - todo: AddListOption? +BOOL ScrCmd_Unk0046(ScriptContext *ctx) { // 0046 - todo: AddListOption? u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); u16 unk2 = ScriptGetVar(ctx); u16 unk3 = ScriptGetVar(ctx); @@ -1558,40 +1507,40 @@ BOOL ScrCmd_Unk0046(ScriptContext *ctx) { //0046 - todo: AddListOption? return FALSE; } -BOOL ScrCmd_Unk0047(ScriptContext *ctx) { //0047 - todo: ShowList? +BOOL ScrCmd_Unk0047(ScriptContext *ctx) { // 0047 - todo: ShowList? u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); ov05_021E1F60(*unk); SetupNativeScript(ctx, sub_0203AD2C); return TRUE; } -BOOL ScrCmd_Unk0048(ScriptContext *ctx) { //0048 +BOOL ScrCmd_Unk0048(ScriptContext *ctx) { // 0048 u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); ov05_021E26CC(*unk, ScriptReadByte(ctx)); SetupNativeScript(ctx, sub_0203AD2C); return TRUE; } -BOOL ScrCmd_Unk02CF(ScriptContext *ctx) { //02CF +BOOL ScrCmd_Unk02CF(ScriptContext *ctx) { // 02CF u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); ov05_021E2B80(*unk, ScriptReadByte(ctx)); return TRUE; } -BOOL ScrCmd_Unk02D0(ScriptContext *ctx) { //02D0 +BOOL ScrCmd_Unk02D0(ScriptContext *ctx) { // 02D0 u32 *unk = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MENU_WINDOW); ov05_021E2B9C(*unk, ScriptReadByte(ctx)); return TRUE; } -BOOL ScrCmd_Unk005E(ScriptContext *ctx) { //005E - todo: ApplyMovement? - u16 unk = ScriptGetVar(ctx); +BOOL ScrCmd_Unk005E(ScriptContext *ctx) { // 005E - todo: ApplyMovement? + u16 unk = ScriptGetVar(ctx); u32 unk2 = ScriptReadWord(ctx); LocalMapObject *event = sub_0203B120(ctx->fieldSystem, unk); GF_ASSERT(event); - u32 unk4 = sub_0205AEA4(event, ctx->scriptPtr + unk2); + u32 unk4 = sub_0205AEA4(event, ctx->scriptPtr + unk2); u8 *movementCounter = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_ACTIVE_MOVEMENT_COUNTER); (*movementCounter)++; @@ -1599,8 +1548,8 @@ BOOL ScrCmd_Unk005E(ScriptContext *ctx) { //005E - todo: ApplyMovement? return FALSE; } -BOOL ScrCmd_Unk02A1(ScriptContext *ctx) { //02A1 - LocalMapObject *event; //has to be defined first to match +BOOL ScrCmd_Unk02A1(ScriptContext *ctx) { // 02A1 + LocalMapObject *event; // has to be defined first to match u16 unk0 = ScriptGetVar(ctx); u16 unk1 = ScriptGetVar(ctx); u16 unk2 = ScriptGetVar(ctx); @@ -1610,8 +1559,8 @@ BOOL ScrCmd_Unk02A1(ScriptContext *ctx) { //02A1 GF_ASSERT(event); u16 *unk4 = AllocFromHeap(HEAP_ID_4, 0x100); - u16 xVal = (u16)MapObject_GetCurrentX(event); - u16 yVal = (u16)MapObject_GetCurrentY(event); + u16 xVal = (u16)MapObject_GetCurrentX(event); + u16 yVal = (u16)MapObject_GetCurrentY(event); u32 pos = 0; @@ -1626,19 +1575,19 @@ BOOL ScrCmd_Unk02A1(ScriptContext *ctx) { //02A1 } if (yVal < unk2) { - unk4[pos * 2] = 12; + unk4[pos * 2] = 12; unk4[pos * 2 + 1] = (u16)(unk2 - yVal); pos++; } else if (yVal > unk2) { - unk4[pos * 2] = 13; + unk4[pos * 2] = 13; unk4[pos * 2 + 1] = (u16)(yVal - unk2); pos++; } - unk4[pos * 2] = 254; + unk4[pos * 2] = 254; unk4[pos * 2 + 1] = 0; - u32 unk7 = sub_0205AEA4(event, unk4); + u32 unk7 = sub_0205AEA4(event, unk4); u8 *movementCounter = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_ACTIVE_MOVEMENT_COUNTER); (*movementCounter)++; @@ -1658,7 +1607,7 @@ static LocalMapObject *sub_0203B120(FieldSystem *fieldSystem, u16 eventId) { } } -BOOL ScrCmd_WaitForMovement(ScriptContext *ctx) { //005F +BOOL ScrCmd_WaitForMovement(ScriptContext *ctx) { // 005F SetupNativeScript(ctx, IsAllMovementFinished); return TRUE; } @@ -1670,15 +1619,14 @@ static BOOL IsAllMovementFinished(ScriptContext *ctx) { static void sub_0203B174(FieldSystem *fieldSystem, u32 param1, void *param2) { UnkStruct_0203B174 *unkStruct = (UnkStruct_0203B174 *)AllocFromHeap(HEAP_ID_4, sizeof(UnkStruct_0203B174)); - if (unkStruct == NULL) - { + if (unkStruct == NULL) { GF_AssertFail(); return; } unkStruct->fieldSystem = fieldSystem; - unkStruct->Unk04 = param1; - unkStruct->Unk08 = param2; - unkStruct->sysTask = SysTask_CreateOnMainQueue((SysTaskFunc)sub_0203B1A8, unkStruct, 0); + unkStruct->Unk04 = param1; + unkStruct->Unk08 = param2; + unkStruct->sysTask = SysTask_CreateOnMainQueue((SysTaskFunc)sub_0203B1A8, unkStruct, 0); } void sub_0203B1A8(SysTask *task, UnkStruct_0203B174 *param1) { @@ -1705,8 +1653,8 @@ void sub_0203B1A8(SysTask *task, UnkStruct_0203B174 *param1) { } } -BOOL ScrCmd_LockAllEvents(ScriptContext *ctx) { //0060 - FieldSystem *fieldSystem = ctx->fieldSystem; +BOOL ScrCmd_LockAllEvents(ScriptContext *ctx) { // 0060 + FieldSystem *fieldSystem = ctx->fieldSystem; LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); if (*lastInteracted == NULL) { @@ -1718,9 +1666,9 @@ BOOL ScrCmd_LockAllEvents(ScriptContext *ctx) { //0060 } static BOOL sub_0203B218(ScriptContext *ctx) { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); - LocalMapObject *playerAvatar = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); + LocalMapObject *playerAvatar = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (UNK_021C5A0C[0] & 1) { if (sub_0205AE28(playerAvatar) == 1) { sub_02058908(playerAvatar); @@ -1749,20 +1697,19 @@ static BOOL sub_0203B218(ScriptContext *ctx) { } if (UNK_021C5A0C[0] == 0) { return TRUE; - } - else { + } else { return FALSE; } } -BOOL ScrCmd_LockAllEvents2(ScriptContext *ctx) { //02B4 - FieldSystem *fieldSystem = ctx->fieldSystem; - LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); - LocalMapObject *playerAvatar = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); - LocalMapObject *unk1 = MapObjectManager_GetFirstActiveObjectWithMovement(fieldSystem->mapObjectManager, 48); - LocalMapObject *unk2 = sub_0205E7C4(*lastInteracted); +BOOL ScrCmd_LockAllEvents2(ScriptContext *ctx) { // 02B4 + FieldSystem *fieldSystem = ctx->fieldSystem; + LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); + LocalMapObject *playerAvatar = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); + LocalMapObject *unk1 = MapObjectManager_GetFirstActiveObjectWithMovement(fieldSystem->mapObjectManager, 48); + LocalMapObject *unk2 = sub_0205E7C4(*lastInteracted); MapObjectManager *mapObjectManager = fieldSystem->mapObjectManager; - UNK_021C5A0C[0] = 0; + UNK_021C5A0C[0] = 0; MapObjectManager_PauseAllMovement(mapObjectManager); if (sub_0205AE28(playerAvatar) == 0) { @@ -1792,48 +1739,48 @@ BOOL ScrCmd_LockAllEvents2(ScriptContext *ctx) { //02B4 return TRUE; } -BOOL ScrCmd_ReleaseAllEvents(ScriptContext *ctx) { //0061 +BOOL ScrCmd_ReleaseAllEvents(ScriptContext *ctx) { // 0061 MapObjectManager_UnpauseAllMovement(ctx->fieldSystem->mapObjectManager); return TRUE; } -BOOL ScrCmd_LockEvent(ScriptContext *ctx) { //0062 +BOOL ScrCmd_LockEvent(ScriptContext *ctx) { // 0062 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 eventId = ScriptReadHalfword(ctx); + u16 eventId = ScriptReadHalfword(ctx); sub_02058908(MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId)); return FALSE; } -BOOL ScrCmd_ReleaseEvent(ScriptContext *ctx) { //0063 +BOOL ScrCmd_ReleaseEvent(ScriptContext *ctx) { // 0063 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 eventId = ScriptReadHalfword(ctx); + u16 eventId = ScriptReadHalfword(ctx); sub_02058914(MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId)); return FALSE; } -BOOL ScrCmd_AddEvent(ScriptContext *ctx) { //0064 - FieldSystem *fieldSystem = ctx->fieldSystem; - u16 eventId = ScriptGetVar(ctx); - u32 eventCount = sub_02034B64(fieldSystem); +BOOL ScrCmd_AddEvent(ScriptContext *ctx) { // 0064 + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 eventId = ScriptGetVar(ctx); + u32 eventCount = sub_02034B64(fieldSystem); const ObjectEvent *objectEvents = sub_02034B6C(fieldSystem); - LocalMapObject *object = MapObject_CreateFromObjectEventWithId(fieldSystem->mapObjectManager, eventId, eventCount, fieldSystem->location->mapId, objectEvents); + LocalMapObject *object = MapObject_CreateFromObjectEventWithId(fieldSystem->mapObjectManager, eventId, eventCount, fieldSystem->location->mapId, objectEvents); GF_ASSERT(object); return FALSE; } -BOOL ScrCmd_RemoveEvent(ScriptContext *ctx) { //0065 +BOOL ScrCmd_RemoveEvent(ScriptContext *ctx) { // 0065 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 eventId = ScriptGetVar(ctx); + u16 eventId = ScriptGetVar(ctx); MapObject_Delete(MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId)); return FALSE; } -BOOL ScrCmd_LockCamera(ScriptContext *ctx) { //0066 - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); +BOOL ScrCmd_LockCamera(ScriptContext *ctx) { // 0066 + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); LocalMapObject **targetPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_CAMERA_TARGET); - *targetPtr = MapObject_Create(ctx->fieldSystem->mapObjectManager, x, y, 0, 0x2000, 0, ctx->fieldSystem->location->mapId); + *targetPtr = MapObject_Create(ctx->fieldSystem->mapObjectManager, x, y, 0, 0x2000, 0, ctx->fieldSystem->location->mapId); sub_02059D1C(*targetPtr); MapObject_SetVisible(*targetPtr, TRUE); sub_020588B8(*targetPtr, 0); @@ -1843,7 +1790,7 @@ BOOL ScrCmd_LockCamera(ScriptContext *ctx) { //0066 return FALSE; } -BOOL ScrCmd_ReleaseCamera(ScriptContext *ctx) { //0067 +BOOL ScrCmd_ReleaseCamera(ScriptContext *ctx) { // 0067 LocalMapObject **targetPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_CAMERA_TARGET); MapObject_Remove(*targetPtr); VecFx32 *position = sub_02058B7C(MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, 0xff)); @@ -1852,9 +1799,9 @@ BOOL ScrCmd_ReleaseCamera(ScriptContext *ctx) { //0067 return FALSE; } -BOOL ScrCmd_FacePlayer(ScriptContext *ctx) { //0068 - FieldSystem *fieldSystem = ctx->fieldSystem; - u32 unk0 = sub_02059E74(PlayerAvatar_GetFacingDirection(fieldSystem->playerAvatar)); +BOOL ScrCmd_FacePlayer(ScriptContext *ctx) { // 0068 + FieldSystem *fieldSystem = ctx->fieldSystem; + u32 unk0 = sub_02059E74(PlayerAvatar_GetFacingDirection(fieldSystem->playerAvatar)); LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); if (*lastInteracted == NULL) { @@ -1865,7 +1812,7 @@ BOOL ScrCmd_FacePlayer(ScriptContext *ctx) { //0068 return FALSE; } -BOOL ScrCmd_GetPlayerPosition(ScriptContext *ctx) { //0069 +BOOL ScrCmd_GetPlayerPosition(ScriptContext *ctx) { // 0069 FieldSystem *fieldSystem = ctx->fieldSystem; u16 *x = ScriptGetVarPointer(ctx); @@ -1877,10 +1824,10 @@ BOOL ScrCmd_GetPlayerPosition(ScriptContext *ctx) { //0069 return FALSE; } -BOOL ScrCmd_GetEventPosition(ScriptContext *ctx) { //006A +BOOL ScrCmd_GetEventPosition(ScriptContext *ctx) { // 006A FieldSystem *fieldSystem = ctx->fieldSystem; - u16 eventId = ScriptGetVar(ctx); - LocalMapObject *event = MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId); + u16 eventId = ScriptGetVar(ctx); + LocalMapObject *event = MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId); u16 *x = ScriptGetVarPointer(ctx); u16 *y = ScriptGetVarPointer(ctx); @@ -1890,14 +1837,14 @@ BOOL ScrCmd_GetEventPosition(ScriptContext *ctx) { //006A return FALSE; } -BOOL ScrCmd_GetPlayerDirection(ScriptContext *ctx) { //01BD +BOOL ScrCmd_GetPlayerDirection(ScriptContext *ctx) { // 01BD u16 *directionVar = ScriptGetVarPointer(ctx); *directionVar = (u16)PlayerAvatar_GetFacingDirection(ctx->fieldSystem->playerAvatar); return FALSE; } -BOOL ScrCmd_Unk006B(ScriptContext *ctx) { //006B - todo: CheckPersonPosition? +BOOL ScrCmd_Unk006B(ScriptContext *ctx) { // 006B - todo: CheckPersonPosition? u16 x = ScriptGetVar(ctx); u16 y = ScriptGetVar(ctx); u16 z = ScriptGetVar(ctx); @@ -1912,25 +1859,25 @@ BOOL ScrCmd_Unk006B(ScriptContext *ctx) { //006B - todo: CheckPersonPosition? return FALSE; } -BOOL ScrCmd_KeepEvent(ScriptContext *ctx) { //006C - u16 eventId = ScriptGetVar(ctx); +BOOL ScrCmd_KeepEvent(ScriptContext *ctx) { // 006C + u16 eventId = ScriptGetVar(ctx); LocalMapObject *event = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); sub_02058994(event, ScriptReadByte(ctx)); return FALSE; } -BOOL ScrCmd_SetEventMovement(ScriptContext *ctx) { //006D - u16 eventId = ScriptGetVar(ctx); +BOOL ScrCmd_SetEventMovement(ScriptContext *ctx) { // 006D + u16 eventId = ScriptGetVar(ctx); LocalMapObject *event = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); - u16 movement = ScriptReadHalfword(ctx); + u16 movement = ScriptReadHalfword(ctx); sub_02058E90(event, movement); return FALSE; } -BOOL ScrCmd_GetEventMovement(ScriptContext *ctx) { //02AD +BOOL ScrCmd_GetEventMovement(ScriptContext *ctx) { // 02AD u16 *variable = ScriptGetVarPointer(ctx); - *variable = 0; - u16 eventId = ScriptGetVar(ctx); + *variable = 0; + u16 eventId = ScriptGetVar(ctx); LocalMapObject *event = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); if (event != NULL) { @@ -1939,28 +1886,28 @@ BOOL ScrCmd_GetEventMovement(ScriptContext *ctx) { //02AD return FALSE; } -BOOL ScrCmd_EventStopFollowing(ScriptContext *ctx) { //006E +BOOL ScrCmd_EventStopFollowing(ScriptContext *ctx) { // 006E LocalMapObject *event = MapObjectManager_GetFirstActiveObjectWithMovement(ctx->fieldSystem->mapObjectManager, 0x30); sub_02058EB0(event, 0xFE); return FALSE; } -BOOL ScrCmd_Unk02AB(ScriptContext *ctx) { //02AB - u16 *variable = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk02AB(ScriptContext *ctx) { // 02AB + u16 *variable = ScriptGetVarPointer(ctx); SealCase *sealCase = Save_SealCase_Get(ctx->fieldSystem->saveData); - *variable = sub_02029E0C(sealCase); + *variable = sub_02029E0C(sealCase); return FALSE; } -BOOL ScrCmd_GetSealCountFromId(ScriptContext *ctx) { //0093 - u16 sealId = ScriptGetVar(ctx); - u16 *variable = ScriptGetVarPointer(ctx); +BOOL ScrCmd_GetSealCountFromId(ScriptContext *ctx) { // 0093 + u16 sealId = ScriptGetVar(ctx); + u16 *variable = ScriptGetVarPointer(ctx); SealCase *sealCase = Save_SealCase_Get(ctx->fieldSystem->saveData); - *variable = SealCase_CountSealOccurrenceAnywhere(sealCase, sealId); + *variable = SealCase_CountSealOccurrenceAnywhere(sealCase, sealId); return FALSE; } -BOOL ScrCmd_GiveSeals(ScriptContext *ctx) { //0094 +BOOL ScrCmd_GiveSeals(ScriptContext *ctx) { // 0094 u16 sealId = ScriptGetVar(ctx); u16 amount = ScriptGetVar(ctx); @@ -1969,38 +1916,38 @@ BOOL ScrCmd_GiveSeals(ScriptContext *ctx) { //0094 return FALSE; } -BOOL ScrCmd_GetPokemonForm(ScriptContext *ctx) { //0095 +BOOL ScrCmd_GetPokemonForm(ScriptContext *ctx) { // 0095 u16 partyPosition = ScriptGetVar(ctx); - u16 *variable = ScriptGetVarPointer(ctx); + u16 *variable = ScriptGetVarPointer(ctx); Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - *variable = GetMonUnownLetter(Party_GetMonByIndex(party, partyPosition)); + *variable = GetMonUnownLetter(Party_GetMonByIndex(party, partyPosition)); return FALSE; } -BOOL ScrCmd_ChoosePokemonMenu(ScriptContext *ctx) { //0191 +BOOL ScrCmd_ChoosePokemonMenu(ScriptContext *ctx) { // 0191 PartyMenuAppData **partyMenu = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *partyMenu = sub_020379F8(0x20, ctx->fieldSystem); + *partyMenu = sub_020379F8(0x20, ctx->fieldSystem); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_OpenTradeScreen(ScriptContext *ctx) { //02A5 +BOOL ScrCmd_OpenTradeScreen(ScriptContext *ctx) { // 02A5 PartyMenuAppData **partyMenu = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *partyMenu = sub_02037A1C(0x20, ctx->fieldSystem); + *partyMenu = sub_02037A1C(0x20, ctx->fieldSystem); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_UnionChoosePokemonMenu(ScriptContext *ctx) { //0192 +BOOL ScrCmd_UnionChoosePokemonMenu(ScriptContext *ctx) { // 0192 PartyMenuAppData **partyMenu = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *partyMenu = sub_02037B44(ctx->fieldSystem->taskManager, 0x20); + *partyMenu = sub_02037B44(ctx->fieldSystem->taskManager, 0x20); return TRUE; } -BOOL ScrCmd_GetSelectedPartySlot(ScriptContext *ctx) { //0193 - u16 *variable = ScriptGetVarPointer(ctx); +BOOL ScrCmd_GetSelectedPartySlot(ScriptContext *ctx) { // 0193 + u16 *variable = ScriptGetVarPointer(ctx); PartyMenuAppData **partyMenu = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); GF_ASSERT(*partyMenu); @@ -2014,21 +1961,21 @@ BOOL ScrCmd_GetSelectedPartySlot(ScriptContext *ctx) { //0193 return FALSE; } -BOOL ScrCmd_Unk0194(ScriptContext *ctx) { //0194 +BOOL ScrCmd_Unk0194(ScriptContext *ctx) { // 0194 void **runningAppData = (void **)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); - u16 unk2 = ScriptGetVar(ctx); - u16 unk3 = ScriptGetVar(ctx); + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); + u16 unk2 = ScriptGetVar(ctx); + u16 unk3 = ScriptGetVar(ctx); *runningAppData = sub_02037BB0(0x20, ctx->fieldSystem, unk2, unk1, unk3, unk0); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_Unk0195(ScriptContext *ctx) { //0195 - u16 *unk0 = ScriptGetVarPointer(ctx); - u16 *unk1 = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk0195(ScriptContext *ctx) { // 0195 + u16 *unk0 = ScriptGetVarPointer(ctx); + u16 *unk1 = ScriptGetVarPointer(ctx); PartyMenuAppData **partyMenuData = (PartyMenuAppData **)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); GF_ASSERT(*partyMenuData); @@ -2046,17 +1993,17 @@ BOOL ScrCmd_Unk0195(ScriptContext *ctx) { //0195 return FALSE; } -BOOL ScrCmd_Unk0196(ScriptContext *ctx) { //0196 +BOOL ScrCmd_Unk0196(ScriptContext *ctx) { // 0196 void **runningAppData = (void **)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - u16 unk0 = ScriptGetVar(ctx); + u16 unk0 = ScriptGetVar(ctx); *runningAppData = sub_02037C00(0x20, ctx->fieldSystem, unk0); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_Unk0197(ScriptContext *ctx) { //0197 - u16 *unk0 = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk0197(ScriptContext *ctx) { // 0197 + u16 *unk0 = ScriptGetVarPointer(ctx); void **runningAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); GF_ASSERT(*runningAppData); @@ -2068,38 +2015,38 @@ BOOL ScrCmd_Unk0197(ScriptContext *ctx) { //0197 return FALSE; } -BOOL ScrCmd_Unk009B(ScriptContext *ctx) { //009B +BOOL ScrCmd_Unk009B(ScriptContext *ctx) { // 009B LocalMapObject **lastInteracted = (LocalMapObject **)FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16 unk0 = ScriptGetVar(ctx); - u16 *unk1 = ScriptGetVarPointer(ctx); + u16 unk0 = ScriptGetVar(ctx); + u16 *unk1 = ScriptGetVarPointer(ctx); *unk1 = ov05_021E1858(ctx->fieldSystem, *lastInteracted, unk0); return FALSE; } -BOOL ScrCmd_DummySetWeather(ScriptContext *ctx) { //009C +BOOL ScrCmd_DummySetWeather(ScriptContext *ctx) { // 009C #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_DummyInitWeather(ScriptContext *ctx) { //009D +BOOL ScrCmd_DummyInitWeather(ScriptContext *ctx) { // 009D #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_DummyUpdateWeather(ScriptContext *ctx) { //009E +BOOL ScrCmd_DummyUpdateWeather(ScriptContext *ctx) { // 009E #pragma unused(ctx) return TRUE; } -BOOL ScrCmd_DummyGetMapPosition(ScriptContext *ctx) { //009F +BOOL ScrCmd_DummyGetMapPosition(ScriptContext *ctx) { // 009F #pragma unused(ctx) return FALSE; } /*static*/ BOOL sub_0203BB90(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - void **runningAppData = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_RUNNING_APP_DATA); + void **runningAppData = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_RUNNING_APP_DATA); if (FieldSystem_ApplicationIsRunning(fieldSystem)) { return FALSE; @@ -2110,9 +2057,9 @@ BOOL ScrCmd_DummyGetMapPosition(ScriptContext *ctx) { //009F } static BOOL sub_0203BBBC(ScriptContext *ctx) { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; PCBoxAppData **pcBoxDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - PCBoxAppData *pcBoxData = *pcBoxDataPtr; + PCBoxAppData *pcBoxData = *pcBoxDataPtr; if (FieldSystem_ApplicationIsRunning(fieldSystem)) { return FALSE; } @@ -2128,12 +2075,12 @@ BOOL sub_0203BC04(ScriptContext *ctx) { return !FieldSystem_ApplicationIsRunning(ctx->fieldSystem); } -BOOL ScrCmd_RestoreOverworld(ScriptContext *ctx) { //00A1 +BOOL ScrCmd_RestoreOverworld(ScriptContext *ctx) { // 00A1 CallTask_RestoreOverworld(ctx->fieldSystem->taskManager); return TRUE; } -BOOL ScrCmd_TerminateOverworldProcess(ScriptContext *ctx) { //01F8 +BOOL ScrCmd_TerminateOverworldProcess(ScriptContext *ctx) { // 01F8 sub_0204AF3C(ctx->fieldSystem->taskManager); return TRUE; } @@ -2159,70 +2106,70 @@ static FashionAppData *sub_0203BC6C(HeapID heapId, FieldSystem *fieldSystem, BOO } FashionAppData *appData = AllocFromHeap(heapId, sizeof(FashionAppData)); memset(appData, 0, sizeof(FashionAppData)); - appData->fashionData = fashionData; - appData->isContest = isContest; + appData->fashionData = fashionData; + appData->isContest = isContest; appData->portraitSlot = portraitSlot; return appData; } -BOOL ScrCmd_Unk00A2(ScriptContext *ctx) { //00A2 +BOOL ScrCmd_Unk00A2(ScriptContext *ctx) { // 00A2 ov05_021F02C4(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_Unk00A3(ScriptContext *ctx) { //00A3 +BOOL ScrCmd_Unk00A3(ScriptContext *ctx) { // 00A3 sub_0206F3B8(ctx->taskManager); return TRUE; } -BOOL ScrCmd_GetDressupPortraitSlot(ScriptContext *ctx) { //00A4 +BOOL ScrCmd_GetDressupPortraitSlot(ScriptContext *ctx) { // 00A4 FashionAppData **runningAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - u16 *portraitSlotPtr = ScriptGetVarPointer(ctx); - *portraitSlotPtr = (*runningAppData)->portraitSlot; + u16 *portraitSlotPtr = ScriptGetVarPointer(ctx); + *portraitSlotPtr = (*runningAppData)->portraitSlot; FreeToHeap(*runningAppData); return FALSE; } -BOOL ScrCmd_Unk0207(ScriptContext *ctx) { //0207 +BOOL ScrCmd_Unk0207(ScriptContext *ctx) { // 0207 u16 *ptr = ScriptGetVarPointer(ctx); - *ptr = sub_02031190(); + *ptr = sub_02031190(); return TRUE; } -BOOL ScrCmd_ShowPokemonPic(ScriptContext *ctx) { //0208 +BOOL ScrCmd_ShowPokemonPic(ScriptContext *ctx) { // 0208 PokepicManager **pokepicManager = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - u16 species = ScriptGetVar(ctx); - u16 gender = ScriptGetVar(ctx); + u16 species = ScriptGetVar(ctx); + u16 gender = ScriptGetVar(ctx); LoadUserFrameGfx1(ctx->fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, 0x3D9, 11, 0, HEAP_ID_4); *pokepicManager = DrawPokemonPicFromSpecies(ctx->fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, 10, 5, 11, 0x3D9, species, gender, HEAP_ID_4); Script_SetMonSeenFlagBySpecies(ctx->fieldSystem, species); return FALSE; } -BOOL ScrCmd_ShowPartyPokemonPic(ScriptContext *ctx) { //028C +BOOL ScrCmd_ShowPartyPokemonPic(ScriptContext *ctx) { // 028C PokepicManager **pokepicManager = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - u16 partyId = ScriptGetVar(ctx); - Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyId); + u16 partyId = ScriptGetVar(ctx); + Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyId); LoadUserFrameGfx1(ctx->fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, 0x3D9, 11, 0, HEAP_ID_4); *pokepicManager = DrawPokemonPicFromMon(ctx->fieldSystem->bgConfig, GF_BG_LYR_MAIN_3, 10, 5, 11, 0x3D9, mon, HEAP_ID_4); - u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); Script_SetMonSeenFlagBySpecies(ctx->fieldSystem, (u16)species); return FALSE; } -BOOL ScrCmd_Unk0209(ScriptContext *ctx) { //0209 +BOOL ScrCmd_Unk0209(ScriptContext *ctx) { // 0209 PokepicManager **pokepicManager = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - (*pokepicManager)->unk00 = 1; + (*pokepicManager)->unk00 = 1; return TRUE; } -BOOL ScrCmd_Unk028D(ScriptContext *ctx) { //028D +BOOL ScrCmd_Unk028D(ScriptContext *ctx) { // 028D PokepicManager **pokepicManager = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - (*pokepicManager)->unk00 = 2; + (*pokepicManager)->unk00 = 2; return TRUE; } -BOOL ScrCmd_Unk028E(ScriptContext *ctx) { //028E +BOOL ScrCmd_Unk028E(ScriptContext *ctx) { // 028E ctx->data[0] = ScriptReadHalfword(ctx); SetupNativeScript(ctx, sub_0203BE9C); return TRUE; @@ -2230,19 +2177,19 @@ BOOL ScrCmd_Unk028E(ScriptContext *ctx) { //028E static BOOL sub_0203BE9C(ScriptContext *ctx) { PokepicManager **pokepicManager = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); //unused + u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); // unused return (*pokepicManager)->unk00 != 3; } -BOOL ScrCmd_Unk020A(ScriptContext *ctx) { //020A - u16 unk0 = ScriptReadHalfword(ctx); +BOOL ScrCmd_Unk020A(ScriptContext *ctx) { // 020A + u16 unk0 = ScriptReadHalfword(ctx); MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u16 *ptr = GetVarPointer(ctx->fieldSystem, unk0); + u16 *ptr = GetVarPointer(ctx->fieldSystem, unk0); ov05_021E1374(ctx->taskManager, *messageFormat, ptr); return TRUE; } -BOOL ScrCmd_Unk020B(ScriptContext *ctx) { //020B +BOOL ScrCmd_Unk020B(ScriptContext *ctx) { // 020B LocalMapObject **lastInteracted = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); if (*lastInteracted != NULL) { ov05_021E1994(ctx->fieldSystem, *lastInteracted); @@ -2250,24 +2197,24 @@ BOOL ScrCmd_Unk020B(ScriptContext *ctx) { //020B return FALSE; } -BOOL ScrCmd_Unk00A5(ScriptContext *ctx) { //00A5 +BOOL ScrCmd_Unk00A5(ScriptContext *ctx) { // 00A5 sub_0208A338(ctx->taskManager); return TRUE; } -BOOL ScrCmd_DressupPokemon(ScriptContext *ctx) { //00A6 +BOOL ScrCmd_DressupPokemon(ScriptContext *ctx) { // 00A6 u16 partyPos = ScriptGetVar(ctx); - u16 *unk0 = ScriptGetVarPointer(ctx); - u16 unk1 = ScriptGetVar(ctx); + u16 *unk0 = ScriptGetVarPointer(ctx); + u16 unk1 = ScriptGetVar(ctx); sub_020380CC(ctx->fieldSystem->taskManager, unk0, ctx->fieldSystem->saveData, partyPos, unk1); return TRUE; } -BOOL ScrCmd_ShowDressedPokemon(ScriptContext *ctx) { //00A7 +BOOL ScrCmd_ShowDressedPokemon(ScriptContext *ctx) { // 00A7 FashionAppData **fashionAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - u16 portraitSlot = ScriptReadHalfword(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *fashionAppData = sub_0203BC6C(HEAP_ID_FIELD, ctx->fieldSystem, FALSE, portraitSlot); + u16 portraitSlot = ScriptReadHalfword(ctx); + u16 *var = ScriptGetVarPointer(ctx); + *fashionAppData = sub_0203BC6C(HEAP_ID_FIELD, ctx->fieldSystem, FALSE, portraitSlot); if (*fashionAppData == NULL) { *var = 1; return TRUE; @@ -2278,11 +2225,11 @@ BOOL ScrCmd_ShowDressedPokemon(ScriptContext *ctx) { //00A7 return TRUE; } -BOOL ScrCmd_ShowContestPokemon(ScriptContext *ctx) { //00A8 +BOOL ScrCmd_ShowContestPokemon(ScriptContext *ctx) { // 00A8 FashionAppData **fashionAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - u16 portraitSlot = ScriptReadHalfword(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *fashionAppData = sub_0203BC6C(HEAP_ID_FIELD, ctx->fieldSystem, TRUE, portraitSlot); + u16 portraitSlot = ScriptReadHalfword(ctx); + u16 *var = ScriptGetVarPointer(ctx); + *fashionAppData = sub_0203BC6C(HEAP_ID_FIELD, ctx->fieldSystem, TRUE, portraitSlot); if (*fashionAppData == NULL) { *var = 1; return TRUE; @@ -2293,9 +2240,9 @@ BOOL ScrCmd_ShowContestPokemon(ScriptContext *ctx) { //00A8 return TRUE; } -BOOL ScrCmd_CheckPortraitSlot(ScriptContext *ctx) { //012E +BOOL ScrCmd_CheckPortraitSlot(ScriptContext *ctx) { // 012E u16 portraitSlot = ScriptReadHalfword(ctx); - u16 *var = ScriptGetVarPointer(ctx); + u16 *var = ScriptGetVarPointer(ctx); if (Script_CheckPortraitSlotFull(ctx->fieldSystem, FALSE, portraitSlot) == TRUE) { *var = TRUE; return TRUE; @@ -2304,9 +2251,9 @@ BOOL ScrCmd_CheckPortraitSlot(ScriptContext *ctx) { //012E return TRUE; } -BOOL ScrCmd_CheckContestPortraitSlot(ScriptContext *ctx) { //012F +BOOL ScrCmd_CheckContestPortraitSlot(ScriptContext *ctx) { // 012F u16 portraitSlot = ScriptReadHalfword(ctx); - u16 *var = ScriptGetVarPointer(ctx); + u16 *var = ScriptGetVarPointer(ctx); if (Script_CheckPortraitSlotFull(ctx->fieldSystem, TRUE, portraitSlot) == TRUE) { *var = TRUE; return TRUE; @@ -2315,49 +2262,48 @@ BOOL ScrCmd_CheckContestPortraitSlot(ScriptContext *ctx) { //012F return TRUE; } -BOOL ScrCmd_Unk0130(ScriptContext *ctx) { //0130 - u16 unk0 = ScriptGetVar(ctx); +BOOL ScrCmd_Unk0130(ScriptContext *ctx) { // 0130 + u16 unk0 = ScriptGetVar(ctx); SaveFashionData *fashionData = Save_FashionData_Get(ctx->fieldSystem->saveData); sub_02027478(sub_02027008(fashionData, 0), unk0); return TRUE; } -BOOL ScrCmd_ShowGeonetScreen(ScriptContext *ctx) { //0205 +BOOL ScrCmd_ShowGeonetScreen(ScriptContext *ctx) { // 0205 ShowGeonetScreen(ctx->fieldSystem); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_ShowSealCapsuleEditor(ScriptContext *ctx) { //00A9 +BOOL ScrCmd_ShowSealCapsuleEditor(ScriptContext *ctx) { // 00A9 ShowSealCapsuleEditor(ctx->taskManager, ctx->fieldSystem->saveData); return TRUE; } -BOOL ScrCmd_ShowTownMapScreen(ScriptContext *ctx) { //00AA +BOOL ScrCmd_ShowTownMapScreen(ScriptContext *ctx) { // 00AA TownMapAppData **townMap = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *townMap = AllocFromHeap(HEAP_ID_FIELD, sizeof(TownMapAppData)); - sub_0205F7A0(ctx->fieldSystem, *townMap, 2); //TownMap_Init? - sub_02037E90(ctx->fieldSystem, *townMap); //ShowTownMap? + *townMap = AllocFromHeap(HEAP_ID_FIELD, sizeof(TownMapAppData)); + sub_0205F7A0(ctx->fieldSystem, *townMap, 2); // TownMap_Init? + sub_02037E90(ctx->fieldSystem, *townMap); // ShowTownMap? SetupNativeScript(ctx, sub_0203BB90); return TRUE; } -BOOL ScrCmd_Unk01D7(ScriptContext *ctx) { //01D7 - TODO: ShowPoffinCaseScreen? +BOOL ScrCmd_Unk01D7(ScriptContext *ctx) { // 01D7 - TODO: ShowPoffinCaseScreen? PoffinCaseAppData **poffinCaseAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - u8 unk0 = ScriptReadHalfword(ctx); - *poffinCaseAppData = sub_02088960(ctx->fieldSystem, unk0, HEAP_ID_FIELD); + u8 unk0 = ScriptReadHalfword(ctx); + *poffinCaseAppData = sub_02088960(ctx->fieldSystem, unk0, HEAP_ID_FIELD); SetupNativeScript(ctx, sub_0203BB90); return TRUE; } -BOOL ScrCmd_Unk01D8(ScriptContext *ctx) { //01D8 +BOOL ScrCmd_Unk01D8(ScriptContext *ctx) { // 01D8 u16 *unk0 = ScriptGetVarPointer(ctx); - Bag *bag = Save_Bag_Get(ctx->fieldSystem->saveData); + Bag *bag = Save_Bag_Get(ctx->fieldSystem->saveData); if (!Bag_PocketNotEmpty(bag, POCKET_BERRIES)) { *unk0 = 1; return FALSE; - } - else if (sub_020281B8(Save_PoffinData_Get(ctx->fieldSystem->saveData)) >= 0x64) { + } else if (sub_020281B8(Save_PoffinData_Get(ctx->fieldSystem->saveData)) >= 0x64) { *unk0 = 2; return FALSE; } @@ -2365,69 +2311,69 @@ BOOL ScrCmd_Unk01D8(ScriptContext *ctx) { //01D8 return FALSE; } -BOOL ScrCmd_Unk01D9(ScriptContext *ctx) { //01D9 - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); +BOOL ScrCmd_Unk01D9(ScriptContext *ctx) { // 01D9 + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); ScrCmdUnkStruct01D9 **unkStructPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *unkStructPtr = AllocFromHeap(HEAP_ID_FIELD, sizeof(ScrCmdUnkStruct01D9)); - ScrCmdUnkStruct01D9 *unkStruct = *unkStructPtr; - MI_CpuFill8(unkStruct, 0, sizeof(ScrCmdUnkStruct01D9)); //consider inlining as is in heartgold + *unkStructPtr = AllocFromHeap(HEAP_ID_FIELD, sizeof(ScrCmdUnkStruct01D9)); + ScrCmdUnkStruct01D9 *unkStruct = *unkStructPtr; + MI_CpuFill8(unkStruct, 0, sizeof(ScrCmdUnkStruct01D9)); // consider inlining as is in heartgold unkStruct->unk04 = unk0; unkStruct->unk06 = unk1; - unkStruct->save = ctx->fieldSystem->saveData; + unkStruct->save = ctx->fieldSystem->saveData; sub_02037FE4(ctx->fieldSystem, *unkStructPtr); SetupNativeScript(ctx, sub_0203BB90); return TRUE; } -BOOL ScrCmd_ShowPCBoxScreen(ScriptContext *ctx) { //00AB +BOOL ScrCmd_ShowPCBoxScreen(ScriptContext *ctx) { // 00AB PCBoxAppData **pcBoxAppDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - PCBoxAppData *pcBoxAppData = AllocFromHeap(HEAP_ID_FIELD, sizeof(PCBoxAppData)); //also seems inlined - pcBoxAppData->save = ctx->fieldSystem->saveData; - pcBoxAppData->operation = (enum PCBoxOperation)ScriptReadByte(ctx); - *pcBoxAppDataPtr = pcBoxAppData; + PCBoxAppData *pcBoxAppData = AllocFromHeap(HEAP_ID_FIELD, sizeof(PCBoxAppData)); // also seems inlined + pcBoxAppData->save = ctx->fieldSystem->saveData; + pcBoxAppData->operation = (enum PCBoxOperation)ScriptReadByte(ctx); + *pcBoxAppDataPtr = pcBoxAppData; LaunchStoragePCInterface(ctx->fieldSystem, *pcBoxAppDataPtr); SetupNativeScript(ctx, sub_0203BBBC); return TRUE; } -BOOL ScrCmd_Unk00AC(ScriptContext *ctx) { //00AC +BOOL ScrCmd_Unk00AC(ScriptContext *ctx) { // 00AC sub_020383F8(ctx->fieldSystem); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_Unk00AD(ScriptContext *ctx) { //00AD +BOOL ScrCmd_Unk00AD(ScriptContext *ctx) { // 00AD sub_02065344(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_Unk00AE(ScriptContext *ctx) { //00AE +BOOL ScrCmd_Unk00AE(ScriptContext *ctx) { // 00AE sub_020383D8(ctx->fieldSystem->taskManager); return TRUE; } -BOOL ScrCmd_Unk00AF(ScriptContext *ctx) { //00AF - void **appData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); //todo: define an app type for this - *appData = sub_0203842C(ctx->fieldSystem); +BOOL ScrCmd_Unk00AF(ScriptContext *ctx) { // 00AF + void **appData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); // todo: define an app type for this + *appData = sub_0203842C(ctx->fieldSystem); SetupNativeScript(ctx, sub_0203BB90); return TRUE; } -BOOL ScrCmd_ShowEndGameScreen(ScriptContext *ctx) { //00B0 +BOOL ScrCmd_ShowEndGameScreen(ScriptContext *ctx) { // 00B0 CallTask_GameClear(ctx->fieldSystem->taskManager); return TRUE; } -BOOL ScrCmd_InitHallOfFame(ScriptContext *ctx) { //00B1 +BOOL ScrCmd_InitHallOfFame(ScriptContext *ctx) { // 00B1 HallOfFame **hallOfFameData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *hallOfFameData = sub_02038824(ctx->fieldSystem); + *hallOfFameData = sub_02038824(ctx->fieldSystem); SetupNativeScript(ctx, sub_0203BB90); return TRUE; } -BOOL ScrCmd_Unk00B2(ScriptContext *ctx) { //00B2 - u16 unk0 = ScriptGetVar(ctx); +BOOL ScrCmd_Unk00B2(ScriptContext *ctx) { // 00B2 + u16 unk0 = ScriptGetVar(ctx); u16 *unk1 = ScriptGetVarPointer(ctx); if (sub_0203384C(ctx->fieldSystem->saveData)) { *unk1 = 1; @@ -2439,59 +2385,59 @@ BOOL ScrCmd_Unk00B2(ScriptContext *ctx) { //00B2 return TRUE; } -BOOL ScrCmd_Unk00B3(ScriptContext *ctx) { //00B3 +BOOL ScrCmd_Unk00B3(ScriptContext *ctx) { // 00B3 u16 *var = ScriptGetVarPointer(ctx); sub_0206F3D8(ctx->taskManager, var); return TRUE; } -BOOL ScrCmd_StarterSelectionScreen(ScriptContext *ctx) { //00B4 +BOOL ScrCmd_StarterSelectionScreen(ScriptContext *ctx) { // 00B4 StarterSelectionData **starterSelectionPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - *starterSelectionPtr = AllocFromHeap(HEAP_ID_FIELD, sizeof(StarterSelectionData)); - StarterSelectionData *starterSelectionData = *starterSelectionPtr; //consider inlining - starterSelectionData->options = Save_PlayerData_GetOptionsAddr(ctx->fieldSystem->saveData); + *starterSelectionPtr = AllocFromHeap(HEAP_ID_FIELD, sizeof(StarterSelectionData)); + StarterSelectionData *starterSelectionData = *starterSelectionPtr; // consider inlining + starterSelectionData->options = Save_PlayerData_GetOptionsAddr(ctx->fieldSystem->saveData); sub_020386A4(ctx->fieldSystem, *starterSelectionPtr); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_EndStarterSelectionScreen(ScriptContext *ctx) { //00B5 +BOOL ScrCmd_EndStarterSelectionScreen(ScriptContext *ctx) { // 00B5 StarterSelectionData **starterSelectionData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - SaveVarsFlags *flags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + SaveVarsFlags *flags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205F378(flags, (*starterSelectionData)->state); FreeToHeap(*starterSelectionData); return FALSE; } -BOOL ScrCmd_ShowBagScreen(ScriptContext *ctx) { //0178 - BagScreenAppData **bagData; //required for matching +BOOL ScrCmd_ShowBagScreen(ScriptContext *ctx) { // 0178 + BagScreenAppData **bagData; // required for matching u8 mode = ScriptReadByte(ctx) != 0 ? 1 : 0; bagData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); GF_ASSERT(*bagData == NULL); - *bagData = sub_0203789C(ctx->fieldSystem, mode); //BagData_New? + *bagData = sub_0203789C(ctx->fieldSystem, mode); // BagData_New? SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_GetBagScreenSelection(ScriptContext *ctx) { //0179 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_GetBagScreenSelection(ScriptContext *ctx) { // 0179 + u16 *var = ScriptGetVarPointer(ctx); BagScreenAppData **bagData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); GF_ASSERT(*bagData != NULL); - *var = sub_020378FC(*bagData); //BagData_GetSelection? + *var = sub_020378FC(*bagData); // BagData_GetSelection? FreeToHeap(*bagData); *bagData = NULL; return FALSE; } -BOOL ScrCmd_NamePlayerScreen(ScriptContext *ctx) { //00BA +BOOL ScrCmd_NamePlayerScreen(ScriptContext *ctx) { // 00BA u16 *var = ScriptGetVarPointer(ctx); CreateNamingScreen(ctx->taskManager, NAMINGSCREEN_PLAYER, 0, PLAYER_NAME_LENGTH, 0, NULL, var); return TRUE; } -BOOL ScrCmd_NamePokemonScreen(ScriptContext *ctx) { //00BB +BOOL ScrCmd_NamePokemonScreen(ScriptContext *ctx) { // 00BB FieldSystem *fieldSystem = ctx->fieldSystem; u16 partyPos = ScriptGetVar(ctx); @@ -2509,52 +2455,52 @@ BOOL ScrCmd_NamePokemonScreen(ScriptContext *ctx) { //00BB return TRUE; } -BOOL ScrCmd_WriteWhiteRockInscription(ScriptContext *ctx) { //0271 +BOOL ScrCmd_WriteWhiteRockInscription(ScriptContext *ctx) { // 0271 u16 *var = ScriptGetVarPointer(ctx); CreateNamingScreen(ctx->taskManager, NAMINGSCREEN_SHAYMIN_ROCK, 0, POKEMON_NAME_LENGTH, 0, NULL, var); return TRUE; } -BOOL ScrCmd_Unk0243(ScriptContext *ctx) { //0243 +BOOL ScrCmd_Unk0243(ScriptContext *ctx) { // 0243 u16 unused = ScriptGetVar(ctx); - u16 *unk1 = ScriptGetVarPointer(ctx); - u16 *unk2 = ScriptGetVarPointer(ctx); - *unk2 = 0xFFFF; + u16 *unk1 = ScriptGetVarPointer(ctx); + u16 *unk2 = ScriptGetVarPointer(ctx); + *unk2 = 0xFFFF; sub_02037E18(ctx->fieldSystem->taskManager, unk1, unk2, NULL); return TRUE; } -BOOL ScrCmd_Unk0244(ScriptContext *ctx) { //0244 - u16 unk0 = ScriptGetVar(ctx); +BOOL ScrCmd_Unk0244(ScriptContext *ctx) { // 0244 + u16 unk0 = ScriptGetVar(ctx); u16 *unk1 = ScriptGetVarPointer(ctx); u16 *unk2 = ScriptGetVarPointer(ctx); u16 *unk3 = ScriptGetVarPointer(ctx); - *unk2 = 0xFFFF; - *unk3 = 0xFFFF; + *unk2 = 0xFFFF; + *unk3 = 0xFFFF; sub_02037E18(ctx->fieldSystem->taskManager, unk1, unk2, unk3); return TRUE; } -BOOL ScrCmd_Unk0245(ScriptContext *ctx) { //0245 +BOOL ScrCmd_Unk0245(ScriptContext *ctx) { // 0245 MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); BufferECWord(*messageFormat, unk0, unk1); return FALSE; } -BOOL ScrCmd_FadeScreen(ScriptContext *ctx) { //00BC8 +BOOL ScrCmd_FadeScreen(ScriptContext *ctx) { // 00BC8 u16 duration = ScriptReadHalfword(ctx); - u16 speed = ScriptReadHalfword(ctx); - u16 type = ScriptReadHalfword(ctx); - u16 colour = ScriptReadHalfword(ctx); + u16 speed = ScriptReadHalfword(ctx); + u16 type = ScriptReadHalfword(ctx); + u16 colour = ScriptReadHalfword(ctx); BeginNormalPaletteFade(0, type, type, colour, duration, speed, HEAP_ID_4); sub_0200E388(0); sub_0200E388(1); return FALSE; } -BOOL ScrCmd_WaitFadeScreen(ScriptContext *ctx) { //00BD +BOOL ScrCmd_WaitFadeScreen(ScriptContext *ctx) { // 00BD SetupNativeScript(ctx, sub_0203C71C); return TRUE; } @@ -2563,100 +2509,100 @@ static BOOL sub_0203C71C(ScriptContext *ctx) { return IsPaletteFadeFinished() == TRUE; } -BOOL ScrCmd_Warp(ScriptContext *ctx) { //00BE +BOOL ScrCmd_Warp(ScriptContext *ctx) { // 00BE u16 mapId = ScriptReadHalfword(ctx); - u16 door = ScriptReadHalfword(ctx); //unused? - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); - u16 dir = ScriptReadHalfword(ctx); + u16 door = ScriptReadHalfword(ctx); // unused? + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); + u16 dir = ScriptReadHalfword(ctx); CallTask_ScriptWarp(ctx->taskManager, mapId, -1, x, y, dir); return TRUE; } -BOOL ScrCmd_BattleRoomWarp(ScriptContext *ctx) { //0203 +BOOL ScrCmd_BattleRoomWarp(ScriptContext *ctx) { // 0203 u16 mapId = ScriptReadHalfword(ctx); - u16 door = ScriptReadHalfword(ctx); //unused? - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); - u16 dir = ScriptReadHalfword(ctx); + u16 door = ScriptReadHalfword(ctx); // unused? + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); + u16 dir = ScriptReadHalfword(ctx); sub_02049F98(ctx->fieldSystem->taskManager, mapId, -1, x, y, dir); return TRUE; } -BOOL ScrCmd_ExitBattleRoom(ScriptContext *ctx) { //0204 +BOOL ScrCmd_ExitBattleRoom(ScriptContext *ctx) { // 0204 sub_02049FFC(ctx->fieldSystem->taskManager); return TRUE; } -BOOL ScrCmd_GetPreviousMapID(ScriptContext *ctx) { //0200 +BOOL ScrCmd_GetPreviousMapID(ScriptContext *ctx) { // 0200 Location *location = sub_02034DC8(Save_LocalFieldData_Get(ctx->fieldSystem->saveData)); - u16 *var = ScriptGetVarPointer(ctx); - *var = location->mapId; + u16 *var = ScriptGetVarPointer(ctx); + *var = location->mapId; return FALSE; } -BOOL ScrCmd_GetCurrentMapID(ScriptContext *ctx) { //0201 +BOOL ScrCmd_GetCurrentMapID(ScriptContext *ctx) { // 0201 u16 *var = ScriptGetVarPointer(ctx); - *var = ctx->fieldSystem->location->mapId; + *var = ctx->fieldSystem->location->mapId; return FALSE; } -BOOL ScrCmd_RockClimb(ScriptContext *ctx) { //00BF - u16 partyPosition = ScriptGetVar(ctx); +BOOL ScrCmd_RockClimb(ScriptContext *ctx) { // 00BF + u16 partyPosition = ScriptGetVar(ctx); u32 playerDirection = PlayerAvatar_GetFacingDirection(ctx->fieldSystem->playerAvatar); CallFieldTask_RockClimb(ctx->taskManager, playerDirection, partyPosition); return TRUE; } -BOOL ScrCmd_Surf(ScriptContext *ctx) { //00C0 +BOOL ScrCmd_Surf(ScriptContext *ctx) { // 00C0 sub_0205DD40(ctx->fieldSystem->unk90); - u16 partyPosition = ScriptGetVar(ctx); + u16 partyPosition = ScriptGetVar(ctx); u32 playerDirection = PlayerAvatar_GetFacingDirection(ctx->fieldSystem->playerAvatar); CallFieldTask_Surf(ctx->taskManager, playerDirection, partyPosition); return TRUE; } -BOOL ScrCmd_Waterfall(ScriptContext *ctx) { //00C1 - u16 partyPosition = ScriptGetVar(ctx); +BOOL ScrCmd_Waterfall(ScriptContext *ctx) { // 00C1 + u16 partyPosition = ScriptGetVar(ctx); u32 playerDirection = PlayerAvatar_GetFacingDirection(ctx->fieldSystem->playerAvatar); CallFieldTask_Waterfall(ctx->taskManager, playerDirection, partyPosition); return TRUE; } -BOOL ScrCmd_Fly(ScriptContext *ctx) { //00C2 +BOOL ScrCmd_Fly(ScriptContext *ctx) { // 00C2 u16 mapId = ScriptReadHalfword(ctx); - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); - sub_02049274(ctx->fieldSystem, mapId, -1, x, y, DIR_SOUTH); //fly function + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); + sub_02049274(ctx->fieldSystem, mapId, -1, x, y, DIR_SOUTH); // fly function return TRUE; } -BOOL ScrCmd_Flash(ScriptContext *ctx) { //00C3 +BOOL ScrCmd_Flash(ScriptContext *ctx) { // 00C3 LocalFieldData *localFieldData = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); - LocalFieldData_SetWeatherType(localFieldData, WEATHER_SUNNY); //clear weather - ov05_021DC174(ctx->fieldSystem->unk04->unk0C, LocalFieldData_GetWeatherType(localFieldData)); //CallFieldTask_SetWeather? second param is get weather + LocalFieldData_SetWeatherType(localFieldData, WEATHER_SUNNY); // clear weather + ov05_021DC174(ctx->fieldSystem->unk04->unk0C, LocalFieldData_GetWeatherType(localFieldData)); // CallFieldTask_SetWeather? second param is get weather return TRUE; } -BOOL ScrCmd_Defog(ScriptContext *ctx) { //00C4 +BOOL ScrCmd_Defog(ScriptContext *ctx) { // 00C4 LocalFieldData *localFieldData = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); - LocalFieldData_SetWeatherType(localFieldData, WEATHER_SUNNY); //clear weather - ov05_021DC174(ctx->fieldSystem->unk04->unk0C, LocalFieldData_GetWeatherType(localFieldData)); //CallFieldTask_SetWeather? second param is get weather + LocalFieldData_SetWeatherType(localFieldData, WEATHER_SUNNY); // clear weather + ov05_021DC174(ctx->fieldSystem->unk04->unk0C, LocalFieldData_GetWeatherType(localFieldData)); // CallFieldTask_SetWeather? second param is get weather return TRUE; } -BOOL ScrCmd_Cut(ScriptContext *ctx) { //00C5 - void **miscData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); //todo identify +BOOL ScrCmd_Cut(ScriptContext *ctx) { // 00C5 + void **miscData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); // todo identify u16 partyPosition = ScriptGetVar(ctx); - Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition); - u32 gender = PlayerAvatar_GetGender(ctx->fieldSystem->playerAvatar); - *miscData = ov06_0224666C(ctx->fieldSystem, 0, mon, gender); + Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition); + u32 gender = PlayerAvatar_GetGender(ctx->fieldSystem->playerAvatar); + *miscData = ov06_0224666C(ctx->fieldSystem, 0, mon, gender); SetupNativeScript(ctx, sub_0203C9F8); return TRUE; } static BOOL sub_0203C9F8(ScriptContext *ctx) { - void **miscData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); //todo identify + void **miscData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); // todo identify if (ov06_022466A0(*miscData) == TRUE) { ov06_022466AC(*miscData); return TRUE; @@ -2664,12 +2610,12 @@ static BOOL sub_0203C9F8(ScriptContext *ctx) { return FALSE; } -BOOL ScrCmd_ApplyContestDress(ScriptContext *ctx) { //00C6 +BOOL ScrCmd_ApplyContestDress(ScriptContext *ctx) { // 00C6 ov05_021E7030(ctx->taskManager); return TRUE; } -BOOL ScrCmd_CheckBike(ScriptContext *ctx) { //00C7 +BOOL ScrCmd_CheckBike(ScriptContext *ctx) { // 00C7 u16 *var = ScriptGetVarPointer(ctx); if (PlayerAvatar_GetState(ctx->fieldSystem->playerAvatar) == PLAYER_STATE_CYCLING) { *var = TRUE; @@ -2679,7 +2625,7 @@ BOOL ScrCmd_CheckBike(ScriptContext *ctx) { //00C7 return FALSE; } -BOOL ScrCmd_RideBike(ScriptContext *ctx) { //00C8 +BOOL ScrCmd_RideBike(ScriptContext *ctx) { // 00C8 u8 action = ScriptReadByte(ctx); if (action == TRUE) { FieldSystem_SetSavedMusicId(ctx->fieldSystem, SEQ_BICYCLE); @@ -2695,59 +2641,59 @@ BOOL ScrCmd_RideBike(ScriptContext *ctx) { //00C8 return FALSE; } -BOOL ScrCmd_DummyRideBike(ScriptContext *ctx) { //02BF +BOOL ScrCmd_DummyRideBike(ScriptContext *ctx) { // 02BF Field_PlayerAvatar_OrrTransitionFlags(ctx->fieldSystem->playerAvatar, PLAYER_TRANSITION_CYCLING); FieldSystem_SetSavedMusicId(ctx->fieldSystem, SEQ_BICYCLE); return FALSE; } -BOOL ScrCmd_CyclingRoad(ScriptContext *ctx) { //00C9 +BOOL ScrCmd_CyclingRoad(ScriptContext *ctx) { // 00C9 u8 action = ScriptReadByte(ctx); sub_02055720(ctx->fieldSystem->playerAvatar, action); return FALSE; } -BOOL ScrCmd_GetPlayerState(ScriptContext *ctx) { //00CA +BOOL ScrCmd_GetPlayerState(ScriptContext *ctx) { // 00CA u16 *var = ScriptGetVarPointer(ctx); - *var = PlayerAvatar_GetState(ctx->fieldSystem->playerAvatar); + *var = PlayerAvatar_GetState(ctx->fieldSystem->playerAvatar); return FALSE; } -BOOL ScrCmd_SetPlayerState(ScriptContext *ctx) { //00CB +BOOL ScrCmd_SetPlayerState(ScriptContext *ctx) { // 00CB u16 state = ScriptReadHalfword(ctx); PlayerAvatar_OrrTransitionFlags(ctx->fieldSystem->playerAvatar, state); return TRUE; } -BOOL ScrCmd_ApplyPlayerState(ScriptContext *ctx) { //00CC +BOOL ScrCmd_ApplyPlayerState(ScriptContext *ctx) { // 00CC Field_PlayerAvatar_ApplyTransitionFlags(ctx->fieldSystem->playerAvatar); return FALSE; } -BOOL ScrCmd_GetSwarmInfo(ScriptContext *ctx) { //00E3 +BOOL ScrCmd_GetSwarmInfo(ScriptContext *ctx) { // 00E3 RoamerSaveData *roamerData = Save_Roamers_Get(ctx->fieldSystem->saveData); - u16 *map = ScriptGetVarPointer(ctx); - u16 *species = ScriptGetVarPointer(ctx); + u16 *map = ScriptGetVarPointer(ctx); + u16 *species = ScriptGetVarPointer(ctx); GetSwarmInfoFromRand(Roamers_GetRand(roamerData, 2), map, species); return FALSE; } -BOOL ScrCmd_GetStarter(ScriptContext *ctx) { //00DE +BOOL ScrCmd_GetStarter(ScriptContext *ctx) { // 00DE u16 *var = ScriptGetVarPointer(ctx); - *var = Save_VarsFlags_GetStarter(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); + *var = Save_VarsFlags_GetStarter(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_TrainerMessage(ScriptContext *ctx) { //00E6 +BOOL ScrCmd_TrainerMessage(ScriptContext *ctx) { // 00E6 FieldSystem *fieldSystem = ctx->fieldSystem; u16 *scriptNumber = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_ACTIVE_SCRIPT_NUMBER); - String **string = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_0); - void *unk06 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); + String **string = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_STRING_BUFFER_0); + void *unk06 = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_UNKNOWN_06); u8 *printerNumber = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_TEXT_PRINTER_NUMBER); u16 trainerId = ScriptGetVar(ctx); - u16 msgNo = ScriptGetVar(ctx); + u16 msgNo = ScriptGetVar(ctx); GetTrainerMessageByIdPair(trainerId, msgNo, *string, HEAP_ID_FIELD); FillWindowPixelBuffer(FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW), 15); *printerNumber = sub_02054658(FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_WINDOW), *string, Save_PlayerData_GetOptionsAddr(ctx->fieldSystem->saveData), TRUE); @@ -2755,12 +2701,12 @@ BOOL ScrCmd_TrainerMessage(ScriptContext *ctx) { //00E6 return TRUE; } -BOOL ScrCmd_Unk00F2(ScriptContext *ctx) { //00F2 +BOOL ScrCmd_Unk00F2(ScriptContext *ctx) { // 00F2 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); - u16 unk2 = ScriptGetVar(ctx); - u16 unk3 = ScriptReadHalfword(ctx); + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); + u16 unk2 = ScriptGetVar(ctx); + u16 unk3 = ScriptReadHalfword(ctx); ov06_02240790(fieldSystem, unk0, unk1, unk2); ctx->data[0] = unk3; SetupNativeScript(ctx, sub_0203CCF8); @@ -2768,7 +2714,7 @@ BOOL ScrCmd_Unk00F2(ScriptContext *ctx) { //00F2 } static BOOL sub_0203CCF8(ScriptContext *ctx) { - u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); + u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); u32 result = ov06_022407DC(); if (result == 0) { return FALSE; @@ -2778,12 +2724,12 @@ static BOOL sub_0203CCF8(ScriptContext *ctx) { } } -BOOL ScrCmd_Unk00F3(ScriptContext *ctx) { //00F3 +BOOL ScrCmd_Unk00F3(ScriptContext *ctx) { // 00F3 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); - u16 unk2 = ScriptGetVar(ctx); - u16 unk3 = ScriptReadHalfword(ctx); + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); + u16 unk2 = ScriptGetVar(ctx); + u16 unk3 = ScriptReadHalfword(ctx); ov06_022407F8(fieldSystem, unk0, unk1, unk2); ctx->data[0] = unk3; SetupNativeScript(ctx, sub_0203CD90); @@ -2791,7 +2737,7 @@ BOOL ScrCmd_Unk00F3(ScriptContext *ctx) { //00F3 } static BOOL sub_0203CD90(ScriptContext *ctx) { - u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); + u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); u32 result = ov06_02240844(); if (result == 0) { return FALSE; @@ -2801,95 +2747,95 @@ static BOOL sub_0203CD90(ScriptContext *ctx) { } } -BOOL ScrCmd_Unk00F4(ScriptContext *ctx) { //00F4 +BOOL ScrCmd_Unk00F4(ScriptContext *ctx) { // 00F4 u16 unused = ScriptReadHalfword(ctx); return TRUE; } -BOOL ScrCmd_Unk00F5(ScriptContext *ctx) { //00F5 +BOOL ScrCmd_Unk00F5(ScriptContext *ctx) { // 00F5 u16 unused = ScriptReadHalfword(ctx); return TRUE; } -BOOL ScrCmd_Unk00F6(ScriptContext *ctx) { //00F6 +BOOL ScrCmd_Unk00F6(ScriptContext *ctx) { // 00F6 ScrCmdUnkStruct00F4 **appDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - ScrCmdUnkStruct00F4 *appData = *appDataPtr; + ScrCmdUnkStruct00F4 *appData = *appDataPtr; sub_02047174(ctx->fieldSystem->taskManager, &appData->unk2C, 5); FreeToHeap(appData); *appDataPtr = NULL; return TRUE; } -BOOL ScrCmd_Unk00F7(ScriptContext *ctx) { //00F7 +BOOL ScrCmd_Unk00F7(ScriptContext *ctx) { // 00F7 sub_02080C38(ctx->taskManager); return TRUE; } -BOOL ScrCmd_SetDynamicWarp(ScriptContext *ctx) { //011B +BOOL ScrCmd_SetDynamicWarp(ScriptContext *ctx) { // 011B Location warp; - warp.mapId = ScriptGetVar(ctx); - warp.warpId = ScriptGetVar(ctx); - warp.x = ScriptGetVar(ctx); - warp.y = ScriptGetVar(ctx); + warp.mapId = ScriptGetVar(ctx); + warp.warpId = ScriptGetVar(ctx); + warp.x = ScriptGetVar(ctx); + warp.y = ScriptGetVar(ctx); warp.direction = ScriptGetVar(ctx); LocalFieldData_SetDynamicWarp(Save_LocalFieldData_Get(ctx->fieldSystem->saveData), &warp); return FALSE; } -BOOL ScrCmd_GetDynamicWarpFloorNumber(ScriptContext *ctx) { //011C - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_GetDynamicWarpFloorNumber(ScriptContext *ctx) { // 011C + u16 *var = ScriptGetVarPointer(ctx); Location *dynamicWarp = LocalFieldData_GetDynamicWarp(Save_LocalFieldData_Get(ctx->fieldSystem->saveData)); - *var = MapNumToFloorNo(dynamicWarp->mapId); + *var = MapNumToFloorNo(dynamicWarp->mapId); return FALSE; } -BOOL ScrCmd_ShowCurrentFloorNumber(ScriptContext *ctx) { //011D - FieldSystem *fieldSystem = ctx->fieldSystem; +BOOL ScrCmd_ShowCurrentFloorNumber(ScriptContext *ctx) { // 011D + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 x = ScriptReadByte(ctx); - u8 y = ScriptReadByte(ctx); - u16 *var = ScriptGetVarPointer(ctx); + u8 x = ScriptReadByte(ctx); + u8 y = ScriptReadByte(ctx); + u16 *var = ScriptGetVarPointer(ctx); PrintCurrentFloorInNewWindow(fieldSystem, x, y, var, *messageFormat); return FALSE; } -BOOL ScrCmd_CountSinnohDexSeen(ScriptContext *ctx) { //011E +BOOL ScrCmd_CountSinnohDexSeen(ScriptContext *ctx) { // 011E Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = Pokedex_CountSinnohDexSeen(pokedex); + u16 *var = ScriptGetVarPointer(ctx); + *var = Pokedex_CountSinnohDexSeen(pokedex); return FALSE; } -BOOL ScrCmd_CountSinnohDexOwned(ScriptContext *ctx) { //011F +BOOL ScrCmd_CountSinnohDexOwned(ScriptContext *ctx) { // 011F Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = Pokedex_CountSinnohDexOwned(pokedex); + u16 *var = ScriptGetVarPointer(ctx); + *var = Pokedex_CountSinnohDexOwned(pokedex); return FALSE; } -BOOL ScrCmd_CountNationalDexSeen(ScriptContext *ctx) { //0120 +BOOL ScrCmd_CountNationalDexSeen(ScriptContext *ctx) { // 0120 Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = Pokedex_CountNationalDexSeen(pokedex); + u16 *var = ScriptGetVarPointer(ctx); + *var = Pokedex_CountNationalDexSeen(pokedex); return FALSE; } -BOOL ScrCmd_CountNationalDexOwned(ScriptContext *ctx) { //0121 +BOOL ScrCmd_CountNationalDexOwned(ScriptContext *ctx) { // 0121 Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = Pokedex_CountNationalDexOwned(pokedex); + u16 *var = ScriptGetVarPointer(ctx); + *var = Pokedex_CountNationalDexOwned(pokedex); return FALSE; } -BOOL ScrCmd_DummyDexCheck(ScriptContext *ctx) { //0122 +BOOL ScrCmd_DummyDexCheck(ScriptContext *ctx) { // 0122 return FALSE; } -BOOL ScrCmd_GetDexEvaluationMessage(ScriptContext *ctx) { //0123 - Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); +BOOL ScrCmd_GetDexEvaluationMessage(ScriptContext *ctx) { // 0123 + Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); - u8 mode = ScriptReadByte(ctx); - u16 *var = ScriptGetVarPointer(ctx); + u8 mode = ScriptReadByte(ctx); + u16 *var = ScriptGetVarPointer(ctx); if (mode == 0) { *var = sub_02054CC8(Pokedex_CountSinnohDexSeen_OmitMythicals(pokedex), sub_0205F2E4(Save_VarsFlags_Get(ctx->fieldSystem->saveData), 2, 10)); } else { @@ -2898,66 +2844,66 @@ BOOL ScrCmd_GetDexEvaluationMessage(ScriptContext *ctx) { //0123 return FALSE; } -BOOL ScrCmd_WildBattle(ScriptContext *ctx) { //0124 +BOOL ScrCmd_WildBattle(ScriptContext *ctx) { // 0124 u32 *winFlag = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_BATTLE_WIN_FLAG); - u16 species = ScriptGetVar(ctx); - u16 level = ScriptGetVar(ctx); + u16 species = ScriptGetVar(ctx); + u16 level = ScriptGetVar(ctx); SetupAndStartWildBattle(ctx->taskManager, species, level, winFlag, FALSE); return TRUE; } -BOOL ScrCmd_LegendaryBattle(ScriptContext *ctx) { //02BD +BOOL ScrCmd_LegendaryBattle(ScriptContext *ctx) { // 02BD u32 *winFlag = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_BATTLE_WIN_FLAG); - u16 species = ScriptGetVar(ctx); - u16 level = ScriptGetVar(ctx); + u16 species = ScriptGetVar(ctx); + u16 level = ScriptGetVar(ctx); SetupAndStartWildBattle(ctx->taskManager, species, level, winFlag, TRUE); return TRUE; } -BOOL ScrCmd_FirstBattle(ScriptContext *ctx) { //0125 +BOOL ScrCmd_FirstBattle(ScriptContext *ctx) { // 0125 u16 species = ScriptGetVar(ctx); - u16 level = ScriptGetVar(ctx); + u16 level = ScriptGetVar(ctx); SetupAndStartFirstBattle(ctx->taskManager, species, level); return TRUE; } -BOOL ScrCmd_CatchTutorial(ScriptContext *ctx) { //0126 +BOOL ScrCmd_CatchTutorial(ScriptContext *ctx) { // 0126 SetupAndStartTutorialBattle(ctx->taskManager); return TRUE; } -BOOL ScrCmd_UpdateHoneyTree(ScriptContext *ctx) { //0127 +BOOL ScrCmd_UpdateHoneyTree(ScriptContext *ctx) { // 0127 UpdateHoneyTree(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_CheckHoneyTree(ScriptContext *ctx) { //0128 +BOOL ScrCmd_CheckHoneyTree(ScriptContext *ctx) { // 0128 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *var = ScriptGetVarPointer(ctx); - *var = CheckHoneyTree(fieldSystem); + u16 *var = ScriptGetVarPointer(ctx); + *var = CheckHoneyTree(fieldSystem); return FALSE; } -BOOL ScrCmd_HoneyTreeBattle(ScriptContext *ctx) { //0129 +BOOL ScrCmd_HoneyTreeBattle(ScriptContext *ctx) { // 0129 u32 *winFlag = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_BATTLE_WIN_FLAG); SetupAndStartHoneyTreeBattle(ctx->taskManager, winFlag); return TRUE; } -BOOL ScrCmd_StopHoneyTreeAnimation(ScriptContext *ctx) { //012A +BOOL ScrCmd_StopHoneyTreeAnimation(ScriptContext *ctx) { // 012A ov05_021F4E7C(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_ShowSignatureScreen(ScriptContext *ctx) { //012B +BOOL ScrCmd_ShowSignatureScreen(ScriptContext *ctx) { // 012B sub_020386B4(ctx->fieldSystem); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_CheckSaveStatus(ScriptContext *ctx) { //012C +BOOL ScrCmd_CheckSaveStatus(ScriptContext *ctx) { // 012C SaveData *saveData = ctx->fieldSystem->saveData; - u16 *var = ScriptGetVarPointer(ctx); + u16 *var = ScriptGetVarPointer(ctx); if (Save_FileDoesNotBelongToPlayer(saveData)) { *var = 0; @@ -2971,44 +2917,44 @@ BOOL ScrCmd_CheckSaveStatus(ScriptContext *ctx) { //012C return FALSE; } -BOOL ScrCmd_SaveGame(ScriptContext *ctx) { //012D +BOOL ScrCmd_SaveGame(ScriptContext *ctx) { // 012D FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *var = ScriptGetVarPointer(ctx); - *var = Field_SaveGame(fieldSystem); + u16 *var = ScriptGetVarPointer(ctx); + *var = Field_SaveGame(fieldSystem); return FALSE; } -BOOL ScrCmd_GivePoketch(ScriptContext *ctx) { //0131 +BOOL ScrCmd_GivePoketch(ScriptContext *ctx) { // 0131 Field_GivePoketch(ctx->taskManager); return TRUE; } -BOOL ScrCmd_CheckPoketch(ScriptContext *ctx) { //0132 +BOOL ScrCmd_CheckPoketch(ScriptContext *ctx) { // 0132 Poketch *poketch = Save_Poketch_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = Save_Poketch_IsGiven(poketch); + u16 *var = ScriptGetVarPointer(ctx); + *var = Save_Poketch_IsGiven(poketch); return FALSE; } -BOOL ScrCmd_UnlockPoketchApp(ScriptContext *ctx) { //0133 +BOOL ScrCmd_UnlockPoketchApp(ScriptContext *ctx) { // 0133 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 appNumber = ScriptGetVar(ctx); - Poketch *poketch = Save_Poketch_Get(fieldSystem->saveData); + u16 appNumber = ScriptGetVar(ctx); + Poketch *poketch = Save_Poketch_Get(fieldSystem->saveData); Save_Poketch_UnlockApp(poketch, (PoketchApp)appNumber); return FALSE; } -BOOL ScrCmd_CheckPoketchApp(ScriptContext *ctx) { //0134 +BOOL ScrCmd_CheckPoketchApp(ScriptContext *ctx) { // 0134 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 appNumber = ScriptGetVar(ctx); - u16 *var = ScriptGetVarPointer(ctx); - Poketch *poketch = Save_Poketch_Get(fieldSystem->saveData); - *var = Save_Poketch_AppIsUnlocked(poketch, (PoketchApp)appNumber); + u16 appNumber = ScriptGetVar(ctx); + u16 *var = ScriptGetVarPointer(ctx); + Poketch *poketch = Save_Poketch_Get(fieldSystem->saveData); + *var = Save_Poketch_AppIsUnlocked(poketch, (PoketchApp)appNumber); return FALSE; } -BOOL ScrCmd_Unk0135(ScriptContext *ctx) { //0135 - u16 unk0 = ScriptGetVar(ctx); +BOOL ScrCmd_Unk0135(ScriptContext *ctx) { // 0135 + u16 unk0 = ScriptGetVar(ctx); ctx->data[0] = unk0; sub_02031588(unk0); SetupNativeScript(ctx, sub_0203D314); @@ -3022,26 +2968,26 @@ static BOOL sub_0203D314(ScriptContext *ctx) { return sub_020315D8(ctx->data[0]); } -BOOL ScrCmd_Unk0136(ScriptContext *ctx) { //0136 +BOOL ScrCmd_Unk0136(ScriptContext *ctx) { // 0136 sub_0203168C(); return FALSE; } -BOOL ScrCmd_Unk0137(ScriptContext *ctx) { //0137 +BOOL ScrCmd_Unk0137(ScriptContext *ctx) { // 0137 MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205296C(*messageFormat); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_0205296C(*messageFormat); return FALSE; } -BOOL ScrCmd_Unk0138(ScriptContext *ctx) { //0138 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk0138(ScriptContext *ctx) { // 0138 + u16 *var = ScriptGetVarPointer(ctx); MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - *var = sub_02052C0C(ctx->fieldSystem->unk78, *messageFormat); + *var = sub_02052C0C(ctx->fieldSystem->unk78, *messageFormat); return FALSE; } -BOOL ScrCmd_Unk0139(ScriptContext *ctx) { //0139 +BOOL ScrCmd_Unk0139(ScriptContext *ctx) { // 0139 u16 unk0 = ScriptReadHalfword(ctx); if (unk0 == 5 || unk0 == 7 || unk0 == 9 || unk0 == 6) { @@ -3055,12 +3001,12 @@ BOOL ScrCmd_Unk0139(ScriptContext *ctx) { //0139 return FALSE; } -BOOL ScrCmd_Unk013C(ScriptContext *ctx) { //013C +BOOL ScrCmd_Unk013C(ScriptContext *ctx) { // 013C LocalMapObject **lastInteracted = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u16 unk0 = ScriptReadHalfword(ctx); - PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); - SaveEasyChat *easyChat = Save_EasyChat_Get(FieldSystem_GetSaveData(ctx->fieldSystem)); + MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); + u16 unk0 = ScriptReadHalfword(ctx); + PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); + SaveEasyChat *easyChat = Save_EasyChat_Get(FieldSystem_GetSaveData(ctx->fieldSystem)); u16 objId; if (unk0 == 0) { @@ -3072,12 +3018,12 @@ BOOL ScrCmd_Unk013C(ScriptContext *ctx) { //013C return FALSE; } -BOOL ScrCmd_Unk013D(ScriptContext *ctx) { //013D +BOOL ScrCmd_Unk013D(ScriptContext *ctx) { // 013D sub_0208881C(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_Unk013E(ScriptContext *ctx) { //013E +BOOL ScrCmd_Unk013E(ScriptContext *ctx) { // 013E sub_02052F74(ctx->fieldSystem->unk7C); sub_02031B50(); SetupNativeScript(ctx, sub_0203D47C); @@ -3088,18 +3034,18 @@ static BOOL sub_0203D47C(ScriptContext *ctx) { return sub_02030F20() < 2; } -BOOL ScrCmd_Unk013F(ScriptContext *ctx) { //013F +BOOL ScrCmd_Unk013F(ScriptContext *ctx) { // 013F LocalMapObject **lastInteracted = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16 unk0 = ScriptReadHalfword(ctx); - u16 *var = ScriptGetVarPointer(ctx); - MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - *var = sub_02052A10(ctx->fieldSystem->unk78, MapObject_GetID(*lastInteracted), unk0, *messageFormat); + u16 unk0 = ScriptReadHalfword(ctx); + u16 *var = ScriptGetVarPointer(ctx); + MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); + *var = sub_02052A10(ctx->fieldSystem->unk78, MapObject_GetID(*lastInteracted), unk0, *messageFormat); return FALSE; } -BOOL ScrCmd_Unk02BA(ScriptContext *ctx) { //02BA +BOOL ScrCmd_Unk02BA(ScriptContext *ctx) { // 02BA u16 *var = ScriptGetVarPointer(ctx); - *var = sub_020527A8(ctx->fieldSystem->unk78); + *var = sub_020527A8(ctx->fieldSystem->unk78); if (*var) { void **runningAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); FreeToHeap(*runningAppData); @@ -3107,24 +3053,24 @@ BOOL ScrCmd_Unk02BA(ScriptContext *ctx) { //02BA return FALSE; } -BOOL ScrCmd_Unk0140(ScriptContext *ctx) { //0140 - FieldSystem *fieldSystem = ctx->fieldSystem; +BOOL ScrCmd_Unk0140(ScriptContext *ctx) { // 0140 + FieldSystem *fieldSystem = ctx->fieldSystem; LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_020524CC(fieldSystem->unk78, MapObject_GetID(*lastInteracted)); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_020524CC(fieldSystem->unk78, MapObject_GetID(*lastInteracted)); return FALSE; } -BOOL ScrCmd_Unk0146(ScriptContext *ctx) { //0146 - FieldSystem *fieldSystem = ctx->fieldSystem; +BOOL ScrCmd_Unk0146(ScriptContext *ctx) { // 0146 + FieldSystem *fieldSystem = ctx->fieldSystem; LocalMapObject **lastInteracted = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16 unk0 = ScriptGetVar(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_02052544(fieldSystem->unk78, MapObject_GetID(*lastInteracted), unk0); + u16 unk0 = ScriptGetVar(ctx); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_02052544(fieldSystem->unk78, MapObject_GetID(*lastInteracted), unk0); return FALSE; } -BOOL ScrCmd_Unk0141(ScriptContext *ctx) { //0141 +BOOL ScrCmd_Unk0141(ScriptContext *ctx) { // 0141 ctx->data[0] = ScriptReadHalfword(ctx); SetupNativeScript(ctx, sub_0203D5CC); return TRUE; @@ -3132,8 +3078,8 @@ BOOL ScrCmd_Unk0141(ScriptContext *ctx) { //0141 static BOOL sub_0203D5CC(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u32 unk0 = sub_02052604(fieldSystem->unk78); - u16 *var = GetVarPointer(fieldSystem, ctx->data[0]); + u32 unk0 = sub_02052604(fieldSystem->unk78); + u16 *var = GetVarPointer(fieldSystem, ctx->data[0]); if (unk0 == 0) { return FALSE; } else { @@ -3142,33 +3088,33 @@ static BOOL sub_0203D5CC(ScriptContext *ctx) { } } -BOOL ScrCmd_Unk0142(ScriptContext *ctx) { //0142 +BOOL ScrCmd_Unk0142(ScriptContext *ctx) { // 0142 sub_020534DC(ctx->fieldSystem->mapObjectManager, ctx->fieldSystem->unk7C); return FALSE; } -BOOL ScrCmd_Unk013A(ScriptContext *ctx) { //013A +BOOL ScrCmd_Unk013A(ScriptContext *ctx) { // 013A sub_02052B74(4); sub_02031C2C(); return FALSE; } -BOOL ScrCmd_Unk013B(ScriptContext *ctx) { //013B +BOOL ScrCmd_Unk013B(ScriptContext *ctx) { // 013B sub_02031C64(); sub_02031B50(); sub_02052B74(0); return FALSE; } -BOOL ScrCmd_Unk0143(ScriptContext *ctx) { //0143 +BOOL ScrCmd_Unk0143(ScriptContext *ctx) { // 0143 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); sub_0205265C(fieldSystem->unk78, unk0, unk1); return FALSE; } -BOOL ScrCmd_Unk0144(ScriptContext *ctx) { //0144 +BOOL ScrCmd_Unk0144(ScriptContext *ctx) { // 0144 ctx->data[0] = ScriptReadHalfword(ctx); SetupNativeScript(ctx, sub_0203D688); return TRUE; @@ -3186,7 +3132,7 @@ static BOOL sub_0203D688(ScriptContext *ctx) { return FALSE; } -BOOL ScrCmd_Unk0145(ScriptContext *ctx) { //0145 +BOOL ScrCmd_Unk0145(ScriptContext *ctx) { // 0145 ctx->data[0] = ScriptReadHalfword(ctx); SetupNativeScript(ctx, sub_0203D6E0); return TRUE; @@ -3205,72 +3151,72 @@ static BOOL sub_0203D6E0(ScriptContext *ctx) { return FALSE; } -BOOL ScrCmd_Unk0153(ScriptContext *ctx) { //0153 +BOOL ScrCmd_Unk0153(ScriptContext *ctx) { // 0153 sub_02049EA4(ctx->fieldSystem->taskManager); return TRUE; } -BOOL ScrCmd_Unk0154(ScriptContext *ctx) { //0154 - PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); +BOOL ScrCmd_Unk0154(ScriptContext *ctx) { // 0154 + PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); sub_0205363C(PlayerProfile_GetTrainerID(playerProfile), PlayerProfile_GetTrainerGender(playerProfile), *messageFormat); return FALSE; } -BOOL ScrCmd_Unk0155(ScriptContext *ctx) { //0155 +BOOL ScrCmd_Unk0155(ScriptContext *ctx) { // 0155 PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); - u16 unk0 = ScriptGetVar(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_02053678(PlayerProfile_GetTrainerID(playerProfile), PlayerProfile_GetTrainerGender(playerProfile), unk0); - *var = sub_020536D0(PlayerProfile_GetTrainerGender(playerProfile), *var, 2); + u16 unk0 = ScriptGetVar(ctx); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_02053678(PlayerProfile_GetTrainerID(playerProfile), PlayerProfile_GetTrainerGender(playerProfile), unk0); + *var = sub_020536D0(PlayerProfile_GetTrainerGender(playerProfile), *var, 2); return FALSE; } -BOOL ScrCmd_Unk029C(ScriptContext *ctx) { //029C +BOOL ScrCmd_Unk029C(ScriptContext *ctx) { // 029C PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); - u16 unk0 = ScriptGetVar(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_02053678(PlayerProfile_GetTrainerID(playerProfile), PlayerProfile_GetTrainerGender(playerProfile), unk0); + u16 unk0 = ScriptGetVar(ctx); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_02053678(PlayerProfile_GetTrainerID(playerProfile), PlayerProfile_GetTrainerGender(playerProfile), unk0); return FALSE; } -BOOL ScrCmd_SetPlayerAvatar(ScriptContext *ctx) { //0156 +BOOL ScrCmd_SetPlayerAvatar(ScriptContext *ctx) { // 0156 PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); - u16 avatar = ScriptGetVar(ctx); + u16 avatar = ScriptGetVar(ctx); PlayerProfile_SetAvatar(playerProfile, avatar); return FALSE; } -BOOL ScrCmd_DummyBlackout(ScriptContext *ctx) { //014B +BOOL ScrCmd_DummyBlackout(ScriptContext *ctx) { // 014B CallTask_Blackout(ctx->taskManager); return TRUE; } -BOOL ScrCmd_SetSpawn(ScriptContext *ctx) { //014C - u16 spawnPoint = ScriptGetVar(ctx); +BOOL ScrCmd_SetSpawn(ScriptContext *ctx) { // 014C + u16 spawnPoint = ScriptGetVar(ctx); LocalFieldData *localFieldData = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); LocalFieldData_SetBlackoutSpawn(localFieldData, spawnPoint); return FALSE; } -BOOL ScrCmd_GetPlayerGender(ScriptContext *ctx) { //014D +BOOL ScrCmd_GetPlayerGender(ScriptContext *ctx) { // 014D PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(ctx->fieldSystem)); - u16 *var = ScriptGetVarPointer(ctx); - *var = PlayerProfile_GetTrainerGender(playerProfile); + u16 *var = ScriptGetVarPointer(ctx); + *var = PlayerProfile_GetTrainerGender(playerProfile); return FALSE; } -BOOL ScrCmd_HealParty(ScriptContext *ctx) { //014E +BOOL ScrCmd_HealParty(ScriptContext *ctx) { // 014E FieldSystem *fieldSystem = TaskManager_GetFieldSystem(ctx->taskManager); HealParty(SaveArray_Party_Get(fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_Unk014F(ScriptContext *ctx) { //014F +BOOL ScrCmd_Unk014F(ScriptContext *ctx) { // 014F return FALSE; } -BOOL ScrCmd_Unk0150(ScriptContext *ctx) { //0150 +BOOL ScrCmd_Unk0150(ScriptContext *ctx) { // 0150 sub_02050024(); SetupNativeScript(ctx, sub_0203D904); return TRUE; @@ -3283,206 +3229,206 @@ static BOOL sub_0203D904(ScriptContext *ctx) { return FALSE; } -BOOL ScrCmd_Unk02BB(ScriptContext *ctx) { //02BB +BOOL ScrCmd_Unk02BB(ScriptContext *ctx) { // 02BB sub_02050048(); SetupNativeScript(ctx, sub_0203D904); return TRUE; } -BOOL ScrCmd_Unk0151(ScriptContext *ctx) { //0151 +BOOL ScrCmd_Unk0151(ScriptContext *ctx) { // 0151 sub_0204FF5C(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_Unk0152(ScriptContext *ctx) { //0152 +BOOL ScrCmd_Unk0152(ScriptContext *ctx) { // 0152 u16 unk0 = ScriptReadHalfword(ctx); sub_0204F6DC(unk0); return FALSE; } -BOOL ScrCmd_CheckPocketNotEmpty(ScriptContext *ctx) { //017A +BOOL ScrCmd_CheckPocketNotEmpty(ScriptContext *ctx) { // 017A u16 pocket = ScriptGetVar(ctx); - u16 *var = ScriptGetVarPointer(ctx); - Bag *bag = Save_Bag_Get(ctx->fieldSystem->saveData); - *var = Bag_PocketNotEmpty(bag, pocket); + u16 *var = ScriptGetVarPointer(ctx); + Bag *bag = Save_Bag_Get(ctx->fieldSystem->saveData); + *var = Bag_PocketNotEmpty(bag, pocket); return FALSE; } -BOOL ScrCmd_SetEventDefaultPosition(ScriptContext *ctx) { //0186 +BOOL ScrCmd_SetEventDefaultPosition(ScriptContext *ctx) { // 0186 u16 eventId = ScriptGetVar(ctx); - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); SetEventDefaultXYPos(ctx->fieldSystem, eventId, x, y); return FALSE; } -BOOL ScrCmd_SetEventPosition(ScriptContext *ctx) { //0187 - u16 eventId = ScriptGetVar(ctx); - u16 x = ScriptGetVar(ctx); - u16 z = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); - u16 direction = ScriptGetVar(ctx); +BOOL ScrCmd_SetEventPosition(ScriptContext *ctx) { // 0187 + u16 eventId = ScriptGetVar(ctx); + u16 x = ScriptGetVar(ctx); + u16 z = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); + u16 direction = ScriptGetVar(ctx); LocalMapObject *object = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); sub_02058E28(object, x, z, y, direction); sub_02059D1C(object); return FALSE; } -BOOL ScrCmd_SetEventDefaultMovement(ScriptContext *ctx) { //0188 - u16 eventId = ScriptGetVar(ctx); +BOOL ScrCmd_SetEventDefaultMovement(ScriptContext *ctx) { // 0188 + u16 eventId = ScriptGetVar(ctx); u16 movementId = ScriptGetVar(ctx); SetEventDefaultMovement(ctx->fieldSystem, eventId, movementId); return FALSE; } -BOOL ScrCmd_SetEventDefaultDirection(ScriptContext *ctx) { //0189 - u16 eventId = ScriptGetVar(ctx); +BOOL ScrCmd_SetEventDefaultDirection(ScriptContext *ctx) { // 0189 + u16 eventId = ScriptGetVar(ctx); u16 direction = ScriptGetVar(ctx); SetEventDefaultDirection(ctx->fieldSystem, eventId, direction); return FALSE; } -BOOL ScrCmd_SetWarpPosition(ScriptContext *ctx) { //018A +BOOL ScrCmd_SetWarpPosition(ScriptContext *ctx) { // 018A u16 warpId = ScriptGetVar(ctx); - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); SetWarpXYPos(ctx->fieldSystem, warpId, x, y); return FALSE; } -BOOL ScrCmd_SetBgEventPosition(ScriptContext *ctx) { //018B +BOOL ScrCmd_SetBgEventPosition(ScriptContext *ctx) { // 018B u16 bgEventId = ScriptGetVar(ctx); - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); SetBgEventXYPos(ctx->fieldSystem, bgEventId, x, y); return FALSE; } -BOOL ScrCmd_SetEventDirection(ScriptContext *ctx) { //018C - u16 eventId = ScriptGetVar(ctx); - u16 direction = ScriptGetVar(ctx); +BOOL ScrCmd_SetEventDirection(ScriptContext *ctx) { // 018C + u16 eventId = ScriptGetVar(ctx); + u16 direction = ScriptGetVar(ctx); LocalMapObject *localMapObject = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); GF_ASSERT(localMapObject); ov05_021F1EC0(localMapObject, direction); return FALSE; } -BOOL ScrCmd_Unk018F(ScriptContext *ctx) { //018F +BOOL ScrCmd_Unk018F(ScriptContext *ctx) { // 018F u16 **unk0 = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_UNKNOWN_12); - u16 unk1 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); if (*unk0 != NULL) { **unk0 = unk1; } return FALSE; } -BOOL ScrCmd_PrepareDoorAnimation(ScriptContext *ctx) { //0168 +BOOL ScrCmd_PrepareDoorAnimation(ScriptContext *ctx) { // 0168 u16 matrixX = ScriptReadHalfword(ctx); u16 matrixY = ScriptReadHalfword(ctx); - u16 mapX = ScriptGetVar(ctx); - u16 mapY = ScriptGetVar(ctx); - u8 doorId = ScriptReadByte(ctx); - ov05_021DAE40(ctx->fieldSystem, mapX + 32 * matrixX, mapY + 32 * matrixY, doorId); //Field_PrepareDoorAnimation? + u16 mapX = ScriptGetVar(ctx); + u16 mapY = ScriptGetVar(ctx); + u8 doorId = ScriptReadByte(ctx); + ov05_021DAE40(ctx->fieldSystem, mapX + 32 * matrixX, mapY + 32 * matrixY, doorId); // Field_PrepareDoorAnimation? return FALSE; } -BOOL ScrCmd_WaitDoorAnimation(ScriptContext *ctx) { //0169 +BOOL ScrCmd_WaitDoorAnimation(ScriptContext *ctx) { // 0169 u8 doorId = ScriptReadByte(ctx); - ov05_021DAF78(ctx->fieldSystem, doorId); //Field_WaitDoorAnimation? + ov05_021DAF78(ctx->fieldSystem, doorId); // Field_WaitDoorAnimation? return TRUE; } -BOOL ScrCmd_FreeDoorAnimation(ScriptContext *ctx) { //016A +BOOL ScrCmd_FreeDoorAnimation(ScriptContext *ctx) { // 016A u8 doorId = ScriptReadByte(ctx); - ov05_021DAF98(ctx->fieldSystem, doorId); //Field_FreeDoorAnimation? + ov05_021DAF98(ctx->fieldSystem, doorId); // Field_FreeDoorAnimation? return FALSE; } -BOOL ScrCmd_OpenDoorAnimation(ScriptContext *ctx) { //016B +BOOL ScrCmd_OpenDoorAnimation(ScriptContext *ctx) { // 016B u8 doorId = ScriptReadByte(ctx); - ov05_021DAED4(ctx->fieldSystem, doorId); //Field_OpenDoorAnimation? + ov05_021DAED4(ctx->fieldSystem, doorId); // Field_OpenDoorAnimation? return FALSE; } -BOOL ScrCmd_CloseDoorAnimation(ScriptContext *ctx) { //016C +BOOL ScrCmd_CloseDoorAnimation(ScriptContext *ctx) { // 016C u8 doorId = ScriptReadByte(ctx); - ov05_021DAF28(ctx->fieldSystem, doorId); //Field_CloseDoorAnimation? + ov05_021DAF28(ctx->fieldSystem, doorId); // Field_CloseDoorAnimation? return FALSE; } -BOOL ScrCmd_InitPastoriaGym(ScriptContext *ctx) { //016F +BOOL ScrCmd_InitPastoriaGym(ScriptContext *ctx) { // 016F InitPastoriaGym(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_CheckPastoriaGymButton(ScriptContext *ctx) { //0170 +BOOL ScrCmd_CheckPastoriaGymButton(ScriptContext *ctx) { // 0170 CheckPastoriaGymButton(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_InitHearthomeGym(ScriptContext *ctx) { //0171 +BOOL ScrCmd_InitHearthomeGym(ScriptContext *ctx) { // 0171 InitHearthomeGym(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_MoveHearthomeGymElevator(ScriptContext *ctx) { //0172 +BOOL ScrCmd_MoveHearthomeGymElevator(ScriptContext *ctx) { // 0172 MoveHearthomeGymElevator(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_InitCanalaveGym(ScriptContext *ctx) { //0173 +BOOL ScrCmd_InitCanalaveGym(ScriptContext *ctx) { // 0173 InitCanalaveGym(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_InitVeilstoneGym(ScriptContext *ctx) { //0174 +BOOL ScrCmd_InitVeilstoneGym(ScriptContext *ctx) { // 0174 InitVeilstoneGym(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_InitSunyshoreGym(ScriptContext *ctx) { //0175 +BOOL ScrCmd_InitSunyshoreGym(ScriptContext *ctx) { // 0175 FieldSystem *fieldSystem = ctx->fieldSystem; - u8 room = ScriptReadByte(ctx); + u8 room = ScriptReadByte(ctx); InitSunyshoreGym(fieldSystem, room); return FALSE; } -BOOL ScrCmd_RotateSunyshoreGymGear(ScriptContext *ctx) { //0176 +BOOL ScrCmd_RotateSunyshoreGymGear(ScriptContext *ctx) { // 0176 FieldSystem *fieldSystem = ctx->fieldSystem; - u8 rotation = ScriptReadByte(ctx); + u8 rotation = ScriptReadByte(ctx); RotateSunyshoreGymGear(fieldSystem, rotation); return TRUE; } -BOOL ScrCmd_HatchEgg(ScriptContext *ctx) { //01AC +BOOL ScrCmd_HatchEgg(ScriptContext *ctx) { // 01AC HatchEggInParty(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_Unk019E(ScriptContext *ctx) { //019E - void **miscDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); //todo: identify what this is +BOOL ScrCmd_Unk019E(ScriptContext *ctx) { // 019E + void **miscDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); // todo: identify what this is LocalMapObject **lastInteracted = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16 unk0 = ScriptGetVar(ctx); - ctx->data[0] = ScriptReadHalfword(ctx); - *miscDataPtr = ov18_0224CA54(unk0, ctx->fieldSystem, MapObject_GetID(*lastInteracted)); + u16 unk0 = ScriptGetVar(ctx); + ctx->data[0] = ScriptReadHalfword(ctx); + *miscDataPtr = ov18_0224CA54(unk0, ctx->fieldSystem, MapObject_GetID(*lastInteracted)); SetupNativeScript(ctx, sub_0203DDC0); return TRUE; } static BOOL sub_0203DDC0(ScriptContext *ctx) { - void **miscDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); //todo: identify what this is - u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); - *var = ov18_0224CA2C(*miscDataPtr); + void **miscDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); // todo: identify what this is + u16 *var = GetVarPointer(ctx->fieldSystem, ctx->data[0]); + *var = ov18_0224CA2C(*miscDataPtr); if (*var != 0xFFFE) { return TRUE; } return FALSE; } -BOOL ScrCmd_Unk019F(ScriptContext *ctx) { //019F +BOOL ScrCmd_Unk019F(ScriptContext *ctx) { // 019F u8 *textPrinterNumber = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_TEXT_PRINTER_NUMBER); - u16 unk0 = ScriptGetVar(ctx); - *textPrinterNumber = ov18_0224CA58(unk0); + u16 unk0 = ScriptGetVar(ctx); + *textPrinterNumber = ov18_0224CA58(unk0); SetupNativeScript(ctx, sub_0203DE38); return TRUE; } @@ -3492,348 +3438,348 @@ static BOOL sub_0203DE38(ScriptContext *ctx) { return sub_020546C8(*textPrinterNumber); } -BOOL ScrCmd_Unk01A0(ScriptContext *ctx) { //01A0 +BOOL ScrCmd_Unk01A0(ScriptContext *ctx) { // 01A0 ov11_0224CA94(); return FALSE; } -BOOL ScrCmd_Unk01A1(ScriptContext *ctx) { //01A1 - u8 unk0 = ScriptReadByte(ctx); +BOOL ScrCmd_Unk01A1(ScriptContext *ctx) { // 01A1 + u8 unk0 = ScriptReadByte(ctx); u16 unk1 = ScriptGetVar(ctx); ov18_0224CAA0(unk0, unk1); return FALSE; } -BOOL ScrCmd_Unk01A2(ScriptContext *ctx) { //01A2 - u8 unk0 = ScriptReadByte(ctx); +BOOL ScrCmd_Unk01A2(ScriptContext *ctx) { // 01A2 + u8 unk0 = ScriptReadByte(ctx); u16 unk1 = ScriptGetVar(ctx); ov18_0224CAB4(unk0, unk1); return FALSE; } -BOOL ScrCmd_Unk003F(ScriptContext *ctx) { //003F +BOOL ScrCmd_Unk003F(ScriptContext *ctx) { // 003F ov06_02242BE0(ctx->taskManager, 1, 1, 0, 0, 0); return TRUE; } -BOOL ScrCmd_HideEvent(ScriptContext *ctx) { //01B1 - FieldSystem *fieldSystem = ctx->fieldSystem; - u16 eventId = ScriptGetVar(ctx); +BOOL ScrCmd_HideEvent(ScriptContext *ctx) { // 01B1 + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 eventId = ScriptGetVar(ctx); LocalMapObject *localMapObject = MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId); GF_ASSERT(localMapObject); MapObject_SetVisible(localMapObject, FALSE); return FALSE; } -BOOL ScrCmd_ShowEvent(ScriptContext *ctx) { //01B2 - FieldSystem *fieldSystem = ctx->fieldSystem; - u16 eventId = ScriptGetVar(ctx); +BOOL ScrCmd_ShowEvent(ScriptContext *ctx) { // 01B2 + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 eventId = ScriptGetVar(ctx); LocalMapObject *localMapObject = MapObjectManager_GetFirstActiveObjectByID(fieldSystem->mapObjectManager, eventId); GF_ASSERT(localMapObject); MapObject_SetVisible(localMapObject, TRUE); return FALSE; } -BOOL ScrCmd_ShowMailbox(ScriptContext *ctx) { //01B3 - sub_02066818(ctx->taskManager); //CallTask_ShowMailbox? +BOOL ScrCmd_ShowMailbox(ScriptContext *ctx) { // 01B3 + sub_02066818(ctx->taskManager); // CallTask_ShowMailbox? return TRUE; } -BOOL ScrCmd_CountMail(ScriptContext *ctx) { //01B4 +BOOL ScrCmd_CountMail(ScriptContext *ctx) { // 01B4 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *var = ScriptGetVarPointer(ctx); - Mail *mailbox = Save_Mailbox_Get(fieldSystem->saveData); - *var = Mailbox_CountMessages(mailbox, 0); + u16 *var = ScriptGetVarPointer(ctx); + Mail *mailbox = Save_Mailbox_Get(fieldSystem->saveData); + *var = Mailbox_CountMessages(mailbox, 0); return FALSE; } -BOOL ScrCmd_Unk01B5(ScriptContext *ctx) { //01B5 +BOOL ScrCmd_Unk01B5(ScriptContext *ctx) { // 01B5 u16 unk0 = ScriptGetVar(ctx); sub_02063650(ctx->taskManager, unk0); return TRUE; } -BOOL ScrCmd_GetTimeOfDay(ScriptContext *ctx) { //01B6 +BOOL ScrCmd_GetTimeOfDay(ScriptContext *ctx) { // 01B6 u16 *var = ScriptGetVarPointer(ctx); - *var = Script_GetTimeOfDay(ctx->fieldSystem); + *var = Script_GetTimeOfDay(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_Random(ScriptContext *ctx) { //01B7 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Random(ScriptContext *ctx) { // 01B7 + u16 *var = ScriptGetVarPointer(ctx); u16 range = ScriptGetVar(ctx); - *var = LCRandom() % range; + *var = LCRandom() % range; return TRUE; } -BOOL ScrCmd_DummyRandom(ScriptContext *ctx) { //01B8 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_DummyRandom(ScriptContext *ctx) { // 01B8 + u16 *var = ScriptGetVarPointer(ctx); u16 range = ScriptGetVar(ctx); - *var = LCRandom() % range; + *var = LCRandom() % range; return TRUE; } -BOOL ScrCmd_CheckPokemonSizeRecord(ScriptContext *ctx) { //01C1 +BOOL ScrCmd_CheckPokemonSizeRecord(ScriptContext *ctx) { // 01C1 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *var = ScriptGetVarPointer(ctx); - u16 partyPosition = ScriptGetVar(ctx); - *var = Field_CheckPokemonSizeRecord(fieldSystem, partyPosition); + u16 *var = ScriptGetVarPointer(ctx); + u16 partyPosition = ScriptGetVar(ctx); + *var = Field_CheckPokemonSizeRecord(fieldSystem, partyPosition); return FALSE; } -BOOL ScrCmd_SetPokemonSizeRecord(ScriptContext *ctx) { //01C2 +BOOL ScrCmd_SetPokemonSizeRecord(ScriptContext *ctx) { // 01C2 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 partyPosition = ScriptGetVar(ctx); + u16 partyPosition = ScriptGetVar(ctx); Field_SetPokemonSizeRecord(fieldSystem, partyPosition); return FALSE; } -BOOL ScrCmd_BufferPartyPokemonSize(ScriptContext *ctx) { //01C3 +BOOL ScrCmd_BufferPartyPokemonSize(ScriptContext *ctx) { // 01C3 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 intStrBuffer = ScriptGetVar(ctx); - u16 decimalStrBuffer = ScriptGetVar(ctx); - u16 partyPosition = ScriptGetVar(ctx); + u16 intStrBuffer = ScriptGetVar(ctx); + u16 decimalStrBuffer = ScriptGetVar(ctx); + u16 partyPosition = ScriptGetVar(ctx); Field_BufferPartyPokemonSize(fieldSystem, intStrBuffer, decimalStrBuffer, partyPosition); return FALSE; } -BOOL ScrCmd_BufferPokemonRecordSize(ScriptContext *ctx) { //01C4 +BOOL ScrCmd_BufferPokemonRecordSize(ScriptContext *ctx) { // 01C4 FieldSystem *fieldSystem = ctx->fieldSystem; - u16 intStrBuffer = ScriptGetVar(ctx); - u16 decimalStrBuffer = ScriptGetVar(ctx); - u16 species = ScriptGetVar(ctx); + u16 intStrBuffer = ScriptGetVar(ctx); + u16 decimalStrBuffer = ScriptGetVar(ctx); + u16 species = ScriptGetVar(ctx); Field_BufferPokemonRecordSize(fieldSystem, intStrBuffer, decimalStrBuffer, species); return FALSE; } -BOOL ScrCmd_InitPokemonRecordSize(ScriptContext *ctx) { //01C5 +BOOL ScrCmd_InitPokemonRecordSize(ScriptContext *ctx) { // 01C5 SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - sub_0205F3F8(state, 33280); //todo: what constant is this + sub_0205F3F8(state, 33280); // todo: what constant is this return FALSE; } -BOOL ScrCmd_Unk01CC(ScriptContext *ctx) { //01CC +BOOL ScrCmd_Unk01CC(ScriptContext *ctx) { // 01CC FieldSystem *fieldSystem = ctx->fieldSystem; - SaveVarsFlags *state = Save_VarsFlags_Get(fieldSystem->saveData); - sub_0205F2D4(state, 1); //set flag - u32 unk0 = sub_020289A4(fieldSystem->saveData); - u32 *unk1 = sub_020289B0(unk0, 1); + SaveVarsFlags *state = Save_VarsFlags_Get(fieldSystem->saveData); + sub_0205F2D4(state, 1); // set flag + u32 unk0 = sub_020289A4(fieldSystem->saveData); + u32 *unk1 = sub_020289B0(unk0, 1); fieldSystem->unk98 = unk1; sub_02048C58(fieldSystem); return FALSE; } -BOOL ScrCmd_Unk01CD(ScriptContext *ctx) { //01CD - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); - u16 unk2 = ScriptGetVar(ctx); - u16 unk3 = ScriptGetVar(ctx); - u16 unk4 = ScriptGetVar(ctx); - void **miscDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); //todo: identify this - u32 unk5; //this will literally always be 1... GF why? - switch ((unk0 - 16)) { - case 0: - unk5 = 1; - *miscDataPtr = sub_02029120(4); - break; - case 1: - unk5 = 1; - *miscDataPtr = sub_0202912C(4); - break; - case 2: - unk5 = 1; - *miscDataPtr = sub_02029138(unk1, 4); - break; - case 3: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - unk5 = 1; - *miscDataPtr = sub_0202914C(unk0 - 19, unk1, 4); - break; - default: - return TRUE; +BOOL ScrCmd_Unk01CD(ScriptContext *ctx) { // 01CD + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); + u16 unk2 = ScriptGetVar(ctx); + u16 unk3 = ScriptGetVar(ctx); + u16 unk4 = ScriptGetVar(ctx); + void **miscDataPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); // todo: identify this + u32 unk5; // this will literally always be 1... GF why? + switch (unk0 - 16) { + case 0: + unk5 = 1; + *miscDataPtr = sub_02029120(4); + break; + case 1: + unk5 = 1; + *miscDataPtr = sub_0202912C(4); + break; + case 2: + unk5 = 1; + *miscDataPtr = sub_02029138(unk1, 4); + break; + case 3: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + unk5 = 1; + *miscDataPtr = sub_0202914C(unk0 - 19, unk1, 4); + break; + default: + return TRUE; } sub_02028AD4(ctx->fieldSystem->unk98, *miscDataPtr, unk5); return TRUE; } -BOOL ScrCmd_Unk01CE(ScriptContext *ctx) { //01CE +BOOL ScrCmd_Unk01CE(ScriptContext *ctx) { // 01CE return FALSE; } -BOOL ScrCmd_Unk01D2(ScriptContext *ctx) { //01D2 +BOOL ScrCmd_Unk01D2(ScriptContext *ctx) { // 01D2 u16 unk0 = ScriptGetVar(ctx); u16 unk1 = ScriptGetVar(ctx); sub_020271A4(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0, unk1); return FALSE; } -BOOL ScrCmd_Unk01D3(ScriptContext *ctx) { //01D3 +BOOL ScrCmd_Unk01D3(ScriptContext *ctx) { // 01D3 u16 unk0 = ScriptGetVar(ctx); u16 unk1 = ScriptGetVar(ctx); u16 *var = ScriptGetVarPointer(ctx); - *var = sub_020270D8(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0, unk1); + *var = sub_020270D8(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0, unk1); return FALSE; } -BOOL ScrCmd_Unk01D4(ScriptContext *ctx) { //01D4 +BOOL ScrCmd_Unk01D4(ScriptContext *ctx) { // 01D4 u16 unk0 = ScriptGetVar(ctx); u16 unk1 = ScriptGetVar(ctx); u16 *var = ScriptGetVarPointer(ctx); - *var = unk1 <= sub_02027114(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0); + *var = unk1 <= sub_02027114(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0); return FALSE; } -BOOL ScrCmd_Unk01D5(ScriptContext *ctx) { //01D5 +BOOL ScrCmd_Unk01D5(ScriptContext *ctx) { // 01D5 u16 unk0 = ScriptGetVar(ctx); sub_02027264(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0); return FALSE; } -BOOL ScrCmd_Unk01D6(ScriptContext *ctx) { //01D6 +BOOL ScrCmd_Unk01D6(ScriptContext *ctx) { // 01D6 u16 unk0 = ScriptGetVar(ctx); u16 *var = ScriptGetVarPointer(ctx); - *var = sub_02027100(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0); + *var = sub_02027100(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0); return FALSE; } -BOOL ScrCmd_CheckSinnohDexComplete(ScriptContext *ctx) { //01E8 +BOOL ScrCmd_CheckSinnohDexComplete(ScriptContext *ctx) { // 01E8 Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = FALSE; + u16 *var = ScriptGetVarPointer(ctx); + *var = FALSE; if (Pokedex_SinnohDexIsComplete(pokedex) == TRUE) { *var = TRUE; } return FALSE; } -BOOL ScrCmd_CheckNationalDexComplete(ScriptContext *ctx) { //01E9 +BOOL ScrCmd_CheckNationalDexComplete(ScriptContext *ctx) { // 01E9 Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = FALSE; + u16 *var = ScriptGetVarPointer(ctx); + *var = FALSE; if (Pokedex_NationalDexIsComplete(pokedex) == TRUE) { *var = TRUE; } return FALSE; } -BOOL ScrCmd_RegisterSinnohPokedex(ScriptContext *ctx) { //01EA +BOOL ScrCmd_RegisterSinnohPokedex(ScriptContext *ctx) { // 01EA PokedexAppData **pokedexAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *pokedexAppData = sub_02038AF4(ctx->fieldSystem, HEAP_ID_32, FALSE); + *pokedexAppData = sub_02038AF4(ctx->fieldSystem, HEAP_ID_32, FALSE); SetupNativeScript(ctx, sub_0203BB90); return TRUE; } -BOOL ScrCmd_RegisterNationalPokedex(ScriptContext *ctx) { //01EB +BOOL ScrCmd_RegisterNationalPokedex(ScriptContext *ctx) { // 01EB PokedexAppData **pokedexAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *pokedexAppData = sub_02038AF4(ctx->fieldSystem, HEAP_ID_32, TRUE); + *pokedexAppData = sub_02038AF4(ctx->fieldSystem, HEAP_ID_32, TRUE); SetupNativeScript(ctx, sub_0203BB90); return TRUE; } -BOOL ScrCmd_Unk01EC(ScriptContext *ctx) { //01EC +BOOL ScrCmd_Unk01EC(ScriptContext *ctx) { // 01EC ov06_0224CBB0(ctx->fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_Unk01ED(ScriptContext *ctx) { //01ED +BOOL ScrCmd_Unk01ED(ScriptContext *ctx) { // 01ED u16 *var = ScriptGetVarPointer(ctx); - *var = ov06_0224CC24(ctx->fieldSystem->saveData); + *var = ov06_0224CC24(ctx->fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_Unk01EF(ScriptContext *ctx) { //01EF +BOOL ScrCmd_Unk01EF(ScriptContext *ctx) { // 01EF ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_IncrementGameStat(ScriptContext *ctx) { //01E5 - u16 stat = ScriptReadHalfword(ctx); +BOOL ScrCmd_IncrementGameStat(ScriptContext *ctx) { // 01E5 + u16 stat = ScriptReadHalfword(ctx); GameStats *gameStats = Save_GameStats_Get(ctx->fieldSystem->saveData); GameStats_Inc(gameStats, stat); return FALSE; } -BOOL ScrCmd_GetGameStat(ScriptContext *ctx) { //01E6 - u16 stat = ScriptReadHalfword(ctx); +BOOL ScrCmd_GetGameStat(ScriptContext *ctx) { // 01E6 + u16 stat = ScriptReadHalfword(ctx); u16 statHighVarNo = ScriptReadHalfword(ctx); - u16 statLowVarNo = ScriptReadHalfword(ctx); - u16 *statHighVar = GetVarPointer(ctx->fieldSystem, statHighVarNo); - u16 *statLowVar = GetVarPointer(ctx->fieldSystem, statLowVarNo); - u32 statVal = GameStats_GetCapped(Save_GameStats_Get(ctx->fieldSystem->saveData), stat); - *statHighVar = (u16)((statVal & 0xFFFF0000) >> 16); - *statLowVar = (u16)statVal; + u16 statLowVarNo = ScriptReadHalfword(ctx); + u16 *statHighVar = GetVarPointer(ctx->fieldSystem, statHighVarNo); + u16 *statLowVar = GetVarPointer(ctx->fieldSystem, statLowVarNo); + u32 statVal = GameStats_GetCapped(Save_GameStats_Get(ctx->fieldSystem->saveData), stat); + *statHighVar = (u16)((statVal & 0xFFFF0000) >> 16); + *statLowVar = (u16)statVal; return FALSE; } -BOOL ScrCmd_SetGameStat(ScriptContext *ctx) { //01E7 - u16 stat = ScriptReadHalfword(ctx); +BOOL ScrCmd_SetGameStat(ScriptContext *ctx) { // 01E7 + u16 stat = ScriptReadHalfword(ctx); u16 valueHigh = ScriptReadHalfword(ctx); - u16 valueLow = ScriptReadHalfword(ctx); - u8 action = ScriptReadByte(ctx); + u16 valueLow = ScriptReadHalfword(ctx); + u8 action = ScriptReadByte(ctx); u32 value = ((valueHigh << 16) | valueLow); switch (action) { - case 0: //add - GameStats_Add(Save_GameStats_Get(ctx->fieldSystem->saveData), stat, value); - break; - case 1: //direct set - GameStats_SetCapped(Save_GameStats_Get(ctx->fieldSystem->saveData), stat, value); - break; - case 2: //set if higher - GameStats_UpdateBounded(Save_GameStats_Get(ctx->fieldSystem->saveData), stat, value); - break; + case 0: // add + GameStats_Add(Save_GameStats_Get(ctx->fieldSystem->saveData), stat, value); + break; + case 1: // direct set + GameStats_SetCapped(Save_GameStats_Get(ctx->fieldSystem->saveData), stat, value); + break; + case 2: // set if higher + GameStats_UpdateBounded(Save_GameStats_Get(ctx->fieldSystem->saveData), stat, value); + break; } return FALSE; } -BOOL ScrCmd_EnableDisableSafariZone(ScriptContext *ctx) { //0202 +BOOL ScrCmd_EnableDisableSafariZone(ScriptContext *ctx) { // 0202 LocalFieldData *localFieldData = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); - SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - SafariZone *safariZone = Save_SafariZone_Get(ctx->fieldSystem->saveData); - u8 action = ScriptReadByte(ctx); - u16 *safariBalls = LocalFieldData_GetSafariBallsCounter(localFieldData); - u16 *safariSteps = LocalFieldData_GetSafariStepsCounter(localFieldData); + SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + SafariZone *safariZone = Save_SafariZone_Get(ctx->fieldSystem->saveData); + u8 action = ScriptReadByte(ctx); + u16 *safariBalls = LocalFieldData_GetSafariBallsCounter(localFieldData); + u16 *safariSteps = LocalFieldData_GetSafariStepsCounter(localFieldData); switch (action) { - case 0: //enable - Save_VarsFlags_SetSafariSysFlag(varsFlags); - sub_02060FD0(safariZone); - *safariBalls = 30; - *safariSteps = 0; - break; - case 1: //disable - Save_VarsFlags_ClearSafariSysFlag(varsFlags); - sub_02061574(ctx->fieldSystem); - sub_02028AD4(ctx->fieldSystem->unk98, sub_0202912C(4), 1); - *safariBalls = 0; - *safariSteps = 0; - break; + case 0: // enable + Save_VarsFlags_SetSafariSysFlag(varsFlags); + sub_02060FD0(safariZone); + *safariBalls = 30; + *safariSteps = 0; + break; + case 1: // disable + Save_VarsFlags_ClearSafariSysFlag(varsFlags); + sub_02061574(ctx->fieldSystem); + sub_02028AD4(ctx->fieldSystem->unk98, sub_0202912C(4), 1); + *safariBalls = 0; + *safariSteps = 0; + break; } return FALSE; } -BOOL ScrCmd_UseGreatMarshBinoculars(ScriptContext *ctx) { //0206 +BOOL ScrCmd_UseGreatMarshBinoculars(ScriptContext *ctx) { // 0206 CallTask_UseGreatMarshBinoculars(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_SpearPillarSequence(ScriptContext *ctx) { //020D +BOOL ScrCmd_SpearPillarSequence(ScriptContext *ctx) { // 020D u8 operation = ScriptReadByte(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *var = SpearPillarSequence(ctx->fieldSystem, operation); + u16 *var = ScriptGetVarPointer(ctx); + *var = SpearPillarSequence(ctx->fieldSystem, operation); return TRUE; } -BOOL ScrCmd_KeepSafariTrain(ScriptContext *ctx) { //020E +BOOL ScrCmd_KeepSafariTrain(ScriptContext *ctx) { // 020E KeepSafariTrain(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_MoveSafariTrain(ScriptContext *ctx) { //020F +BOOL ScrCmd_MoveSafariTrain(ScriptContext *ctx) { // 020F u16 *var = ScriptGetVarPointer(ctx); u16 type = ScriptReadHalfword(ctx); sub_0200433C(65, SEQ_PV001, 0); @@ -3841,35 +3787,35 @@ BOOL ScrCmd_MoveSafariTrain(ScriptContext *ctx) { //020F return TRUE; } -BOOL ScrCmd_CheckSafariTrainPosition(ScriptContext *ctx) { //0210 +BOOL ScrCmd_CheckSafariTrainPosition(ScriptContext *ctx) { // 0210 u16 position = ScriptReadHalfword(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *var = ov06_02245340(ctx->fieldSystem, position); + u16 *var = ScriptGetVarPointer(ctx); + *var = ov06_02245340(ctx->fieldSystem, position); return FALSE; } -BOOL ScrCmd_IgnoreHeights(ScriptContext *ctx) { //0211 +BOOL ScrCmd_IgnoreHeights(ScriptContext *ctx) { // 0211 u8 flag = ScriptReadByte(ctx); PlayerAvatar_ToggleAutomaticHeightUpdating(ctx->fieldSystem->playerAvatar, flag); return TRUE; } -BOOL ScrCmd_GetSpiritombTalkCounter(ScriptContext *ctx) { //0214 +BOOL ScrCmd_GetSpiritombTalkCounter(ScriptContext *ctx) { // 0214 SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = Save_VarsFlags_GetSpiritombTalkCounter(varsFlags); + u16 *var = ScriptGetVarPointer(ctx); + *var = Save_VarsFlags_GetSpiritombTalkCounter(varsFlags); return FALSE; } -BOOL ScrCmd_Unk0218(ScriptContext *ctx) { //0218 - Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *speciesVar = ScriptGetVarPointer(ctx); - s32 sinnohSeen = Pokedex_CountSinnohDexSeen(pokedex); +BOOL ScrCmd_Unk0218(ScriptContext *ctx) { // 0218 + Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); + u16 *speciesVar = ScriptGetVarPointer(ctx); + s32 sinnohSeen = Pokedex_CountSinnohDexSeen(pokedex); u16 randomSeenCount = LCRandom() % sinnohSeen; - *speciesVar = SPECIES_PIKACHU; - u16 i = SPECIES_BULBASAUR; - u16 speciesIndex = 0; - while (i <= NATIONAL_DEX_COUNT) { //can't do for loop - needed for matching + *speciesVar = SPECIES_PIKACHU; + u16 i = SPECIES_BULBASAUR; + u16 speciesIndex = 0; + while (i <= NATIONAL_DEX_COUNT) { // can't do for loop - needed for matching if (Pokedex_CheckMonSeenFlag(pokedex, i) == TRUE && SpeciesToSinnohDexNo(i) != 0) { if (speciesIndex == randomSeenCount) { *speciesVar = i; @@ -3882,78 +3828,78 @@ BOOL ScrCmd_Unk0218(ScriptContext *ctx) { //0218 return FALSE; } -BOOL ScrCmd_Unk0219(ScriptContext *ctx) { //0219 - u16 unk0 = ScriptGetVar(ctx); +BOOL ScrCmd_Unk0219(ScriptContext *ctx) { // 0219 + u16 unk0 = ScriptGetVar(ctx); SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205F5A4(varsFlags, unk0); return FALSE; } -BOOL ScrCmd_Unk021A(ScriptContext *ctx) { //021A +BOOL ScrCmd_Unk021A(ScriptContext *ctx) { // 021A u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205F594(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); + *var = sub_0205F594(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_Unk021B(ScriptContext *ctx) { //021B +BOOL ScrCmd_Unk021B(ScriptContext *ctx) { // 021B sub_0202AA00(ctx->fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_CreateRoamer(ScriptContext *ctx) { //021C +BOOL ScrCmd_CreateRoamer(ScriptContext *ctx) { // 021C u8 roamer = ScriptReadByte(ctx); Save_CreateRoamerByID(ctx->fieldSystem->saveData, roamer); return FALSE; } -BOOL ScrCmd_NPCTradeInit(ScriptContext *ctx) { //0226 +BOOL ScrCmd_NPCTradeInit(ScriptContext *ctx) { // 0226 NPCTradeAppData **tradeAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - u8 tradeId = ScriptReadByte(ctx); - *tradeAppData = NPCTradeApp_Init(HEAP_ID_FIELD, tradeId); + u8 tradeId = ScriptReadByte(ctx); + *tradeAppData = NPCTradeApp_Init(HEAP_ID_FIELD, tradeId); return FALSE; } -BOOL ScrCmd_NPCTradeGetOfferedSpecies(ScriptContext *ctx) { //0227 +BOOL ScrCmd_NPCTradeGetOfferedSpecies(ScriptContext *ctx) { // 0227 NPCTradeAppData **tradeData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - u16 *var = ScriptGetVarPointer(ctx); - *var = NPCTradeApp_GetOfferedSpecies(*tradeData); + u16 *var = ScriptGetVarPointer(ctx); + *var = NPCTradeApp_GetOfferedSpecies(*tradeData); return FALSE; } -BOOL ScrCmd_NPCTradeGetRequestedSpecies(ScriptContext *ctx) { //0228 +BOOL ScrCmd_NPCTradeGetRequestedSpecies(ScriptContext *ctx) { // 0228 NPCTradeAppData **tradeData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - u16 *var = ScriptGetVarPointer(ctx); - *var = NPCTradeApp_GetRequestedSpecies(*tradeData); + u16 *var = ScriptGetVarPointer(ctx); + *var = NPCTradeApp_GetRequestedSpecies(*tradeData); return FALSE; } -BOOL ScrCmd_NPCTradeExecute(ScriptContext *ctx) { //0229 +BOOL ScrCmd_NPCTradeExecute(ScriptContext *ctx) { // 0229 NPCTradeAppData **tradeData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); - u16 partyPosition = ScriptGetVar(ctx); + u16 partyPosition = ScriptGetVar(ctx); CallTask_NPCTrade(ctx->taskManager, *tradeData, partyPosition, HEAP_ID_FIELD); return TRUE; } -BOOL ScrCmd_NPCTradeEnd(ScriptContext *ctx) { //022A +BOOL ScrCmd_NPCTradeEnd(ScriptContext *ctx) { // 022A NPCTradeAppData **tradeData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MISC_DATA_PTR); NPCTradeApp_Delete(*tradeData); return FALSE; } -BOOL ScrCmd_UnlockForeignEntries(ScriptContext *ctx) { //022B +BOOL ScrCmd_UnlockForeignEntries(ScriptContext *ctx) { // 022B Pokedex_SetForeignEntriesFlag(Save_Pokedex_Get(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_UnlockGenderEntries(ScriptContext *ctx) { //022C +BOOL ScrCmd_UnlockGenderEntries(ScriptContext *ctx) { // 022C Pokedex_SetGenderEntriesFlag(Save_Pokedex_Get(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_NationalDex(ScriptContext *ctx) { //022D +BOOL ScrCmd_NationalDex(ScriptContext *ctx) { // 022D u8 action = ScriptReadByte(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *var = 0; + u16 *var = ScriptGetVarPointer(ctx); + *var = 0; if (action == 1) { Pokedex_SetNatDexFlag(Save_Pokedex_Get(ctx->fieldSystem->saveData)); PlayerProfile_SetNatDexFlag(Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData)); @@ -3965,14 +3911,14 @@ BOOL ScrCmd_NationalDex(ScriptContext *ctx) { //022D return FALSE; } -BOOL ScrCmd_GetTotalPokemonEVs(ScriptContext *ctx) { //0233 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_GetTotalPokemonEVs(ScriptContext *ctx) { // 0233 + u16 *var = ScriptGetVarPointer(ctx); u16 partyPosition = ScriptGetVar(ctx); - Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition); + Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition); - u32 hpEv = GetMonData(mon, MON_DATA_HP_EV, NULL); - u32 atkEv = GetMonData(mon, MON_DATA_ATK_EV, NULL); - u32 defEv = GetMonData(mon, MON_DATA_DEF_EV, NULL); + u32 hpEv = GetMonData(mon, MON_DATA_HP_EV, NULL); + u32 atkEv = GetMonData(mon, MON_DATA_ATK_EV, NULL); + u32 defEv = GetMonData(mon, MON_DATA_DEF_EV, NULL); u32 speedEv = GetMonData(mon, MON_DATA_SPEED_EV, NULL); u32 spAtkEv = GetMonData(mon, MON_DATA_SPATK_EV, NULL); u32 spDefEv = GetMonData(mon, MON_DATA_SPDEF_EV, NULL); @@ -3981,7 +3927,7 @@ BOOL ScrCmd_GetTotalPokemonEVs(ScriptContext *ctx) { //0233 return FALSE; } -BOOL ScrCmd_GetDayOfWeek(ScriptContext *ctx) { //0234 +BOOL ScrCmd_GetDayOfWeek(ScriptContext *ctx) { // 0234 u16 *var = ScriptGetVarPointer(ctx); RTCDate date; GF_RTC_CopyDate(&date); @@ -3989,62 +3935,62 @@ BOOL ScrCmd_GetDayOfWeek(ScriptContext *ctx) { //0234 return FALSE; } -BOOL ScrCmd_Unk0239(ScriptContext *ctx) { //0239 +BOOL ScrCmd_Unk0239(ScriptContext *ctx) { // 0239 u16 *var = ScriptGetVarPointer(ctx); ov06_022411F4(ctx->taskManager, var); return TRUE; } -BOOL ScrCmd_GetPokemonFootprint(ScriptContext *ctx) { //023A - u16 *var = ScriptGetVarPointer(ctx); - u16 *var2 = ScriptGetVarPointer(ctx); +BOOL ScrCmd_GetPokemonFootprint(ScriptContext *ctx) { // 023A + u16 *var = ScriptGetVarPointer(ctx); + u16 *var2 = ScriptGetVarPointer(ctx); u16 partyPosition = ScriptGetVar(ctx); - Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition); - u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); - *var = ov05_021F61E8(species); - *var2 = ov05_021F61DC(species); + Pokemon *mon = Party_GetMonByIndex(SaveArray_Party_Get(ctx->fieldSystem->saveData), partyPosition); + u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + *var = ov05_021F61E8(species); + *var2 = ov05_021F61DC(species); return FALSE; } -BOOL ScrCmd_PokecenterHealAnimation(ScriptContext *ctx) { //023B +BOOL ScrCmd_PokecenterHealAnimation(ScriptContext *ctx) { // 023B u16 balls = ScriptGetVar(ctx); CallTask_PokecenterAnimation(ctx->fieldSystem, balls); return TRUE; } -BOOL ScrCmd_ElevatorAnimation(ScriptContext *ctx) { //023C +BOOL ScrCmd_ElevatorAnimation(ScriptContext *ctx) { // 023C u16 direction = ScriptGetVar(ctx); - u16 length = ScriptGetVar(ctx); + u16 length = ScriptGetVar(ctx); ov06_0224C520(ctx->fieldSystem, direction, length); return TRUE; } -BOOL ScrCmd_ShipAnimation(ScriptContext *ctx) { //023D - u8 shipDirection = ScriptReadByte(ctx); +BOOL ScrCmd_ShipAnimation(ScriptContext *ctx) { // 023D + u8 shipDirection = ScriptReadByte(ctx); u8 playerOrientation = ScriptReadByte(ctx); - u16 destId = ScriptReadHalfword(ctx); - u16 destX = ScriptReadHalfword(ctx); - u16 destZ = ScriptReadHalfword(ctx); + u16 destId = ScriptReadHalfword(ctx); + u16 destX = ScriptReadHalfword(ctx); + u16 destZ = ScriptReadHalfword(ctx); sub_020607D4(ctx->fieldSystem, shipDirection, playerOrientation, destId, destX, destZ); return TRUE; } -BOOL ScrCmd_GetGameVersion(ScriptContext *ctx) { //0246 +BOOL ScrCmd_GetGameVersion(ScriptContext *ctx) { // 0246 u16 *var = ScriptGetVarPointer(ctx); - *var = GAME_VERSION; + *var = GAME_VERSION; return FALSE; } -BOOL ScrCmd_GiveWallpaper(ScriptContext *ctx) { //0249 - used for easy chat unlock, todo: find better name - FieldSystem *fieldSystem = ctx->fieldSystem; +BOOL ScrCmd_GiveWallpaper(ScriptContext *ctx) { // 0249 - used for easy chat unlock, todo: find better name + FieldSystem *fieldSystem = ctx->fieldSystem; PlayerProfile *playerProfile = Save_PlayerData_GetProfileAddr(FieldSystem_GetSaveData(fieldSystem)); - u16 *var = ScriptGetVarPointer(ctx); - PCStorage *pcStorage = SaveArray_PCStorage_Get(fieldSystem->saveData); - u16 unk0 = ScriptGetVar(ctx); - u16 unk1 = ScriptGetVar(ctx); - u16 unk2 = ScriptGetVar(ctx); - u16 unk3 = ScriptGetVar(ctx); + u16 *var = ScriptGetVarPointer(ctx); + PCStorage *pcStorage = SaveArray_PCStorage_Get(fieldSystem->saveData); + u16 unk0 = ScriptGetVar(ctx); + u16 unk1 = ScriptGetVar(ctx); + u16 unk2 = ScriptGetVar(ctx); + u16 unk3 = ScriptGetVar(ctx); s32 wallpaperId = ov06_0224D14C(playerProfile, unk0, unk1, unk2, unk3); if (wallpaperId == -1 || wallpaperId > 7) { @@ -4061,81 +4007,81 @@ BOOL ScrCmd_GiveWallpaper(ScriptContext *ctx) { //0249 - used for easy chat unlo return FALSE; } -BOOL ScrCmd_Unk024A(ScriptContext *ctx) { //024A +BOOL ScrCmd_Unk024A(ScriptContext *ctx) { // 024A SaveData *saveData = ctx->fieldSystem->saveData; - u16 *var = ScriptGetVarPointer(ctx); + u16 *var = ScriptGetVarPointer(ctx); *var = sub_020269CC(sub_02026CB4(saveData)); return FALSE; } -BOOL ScrCmd_Unk024B(ScriptContext *ctx) { //024B - todo: PreparePCAnimation? +BOOL ScrCmd_Unk024B(ScriptContext *ctx) { // 024B - todo: PreparePCAnimation? FieldSystem *fieldSystem = ctx->fieldSystem; - u8 unk0 = ScriptReadByte(ctx); + u8 unk0 = ScriptReadByte(ctx); ov06_0224C678(fieldSystem, unk0); return FALSE; } -BOOL ScrCmd_Unk024C(ScriptContext *ctx) { //024C - todo: OpenPCAnimation? +BOOL ScrCmd_Unk024C(ScriptContext *ctx) { // 024C - todo: OpenPCAnimation? FieldSystem *fieldSystem = ctx->fieldSystem; - u8 unk0 = ScriptReadByte(ctx); + u8 unk0 = ScriptReadByte(ctx); ov06_0224C6E8(fieldSystem, unk0); return FALSE; } -BOOL ScrCmd_Unk024D(ScriptContext *ctx) { //024D - todo: ClosePCAnimation? +BOOL ScrCmd_Unk024D(ScriptContext *ctx) { // 024D - todo: ClosePCAnimation? FieldSystem *fieldSystem = ctx->fieldSystem; - u8 unk0 = ScriptReadByte(ctx); + u8 unk0 = ScriptReadByte(ctx); ov06_0224C6F4(fieldSystem, unk0); return FALSE; } static void Script_SetMonSeenFlagBySpecies(FieldSystem *fieldSystem, u16 species) { Pokedex *pokedex = Save_Pokedex_Get(fieldSystem->saveData); - Pokemon *mon = AllocMonZeroed(HEAP_ID_32); + Pokemon *mon = AllocMonZeroed(HEAP_ID_32); ZeroMonData(mon); CreateMon(mon, species, 50, 32, FALSE, 0, OT_ID_PLAYER_ID, 0); Pokedex_SetMonSeenFlag(pokedex, mon); FreeToHeap(mon); } -BOOL ScrCmd_CountPCFreeSpace(ScriptContext *ctx) { //0252 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_CountPCFreeSpace(ScriptContext *ctx) { // 0252 + u16 *var = ScriptGetVarPointer(ctx); u16 count = PCStorage_CountMonsAndEggsInAllBoxes(SaveArray_PCStorage_Get(ctx->fieldSystem->saveData)); - *var = MONS_PER_BOX * NUM_BOXES - count; + *var = MONS_PER_BOX * NUM_BOXES - count; return FALSE; } -BOOL ScrCmd_Unk0258(ScriptContext *ctx) { //0258 - to do with player state types +BOOL ScrCmd_Unk0258(ScriptContext *ctx) { // 0258 - to do with player state types u32 *playerState = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_UNKNOWN_22); - *playerState = PLAYER_STATE_WALKING; - *playerState = ov05_021E7184(ctx->fieldSystem); + *playerState = PLAYER_STATE_WALKING; + *playerState = ov05_021E7184(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_Unk0259(ScriptContext *ctx) { //0259 +BOOL ScrCmd_Unk0259(ScriptContext *ctx) { // 0259 u32 *playerState = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_UNKNOWN_22); ov05_021E71E8(*playerState); return TRUE; } -BOOL ScrCmd_Unk025A(ScriptContext *ctx) { //025A +BOOL ScrCmd_Unk025A(ScriptContext *ctx) { // 025A u16 unk0 = ScriptGetVar(ctx); ov06_0224E554(ctx->fieldSystem, unk0); return TRUE; } -BOOL ScrCmd_Unk025B(ScriptContext *ctx) { //025B +BOOL ScrCmd_Unk025B(ScriptContext *ctx) { // 025B sub_0206486C(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_Unk025C(ScriptContext *ctx) { //025C +BOOL ScrCmd_Unk025C(ScriptContext *ctx) { // 025C sub_020649D4(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_Unk025D(ScriptContext *ctx) { //025D +BOOL ScrCmd_Unk025D(ScriptContext *ctx) { // 025D u16 *var = ScriptGetVarPointer(ctx); if (sub_020649B0(ctx->fieldSystem)) { *var = TRUE; @@ -4145,35 +4091,35 @@ BOOL ScrCmd_Unk025D(ScriptContext *ctx) { //025D return FALSE; } -BOOL ScrCmd_Unk025E(ScriptContext *ctx) { //025E +BOOL ScrCmd_Unk025E(ScriptContext *ctx) { // 025E ov06_0224E764(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_Unk025F(ScriptContext *ctx) { //025F +BOOL ScrCmd_Unk025F(ScriptContext *ctx) { // 025F ov06_0224E7C4(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_AddSpecialGameStat(ScriptContext *ctx) { //0260 +BOOL ScrCmd_AddSpecialGameStat(ScriptContext *ctx) { // 0260 u16 statNumber = ScriptReadHalfword(ctx); GameStats_AddSpecial(Save_GameStats_Get(ctx->fieldSystem->saveData), statNumber); return FALSE; } -BOOL ScrCmd_CheckPokemonInParty(ScriptContext *ctx) { //0262 +BOOL ScrCmd_CheckPokemonInParty(ScriptContext *ctx) { // 0262 u16 species = ScriptGetVar(ctx); - u16 *var = ScriptGetVarPointer(ctx); - *var = Party_HasMon(SaveArray_Party_Get(ctx->fieldSystem->saveData), species); + u16 *var = ScriptGetVarPointer(ctx); + *var = Party_HasMon(SaveArray_Party_Get(ctx->fieldSystem->saveData), species); return TRUE; } -BOOL ScrCmd_SetDeoxysForm(ScriptContext *ctx) { //0263 - u16 form = ScriptGetVar(ctx); +BOOL ScrCmd_SetDeoxysForm(ScriptContext *ctx) { // 0263 + u16 form = ScriptGetVar(ctx); Party *playerParty = SaveArray_Party_Get(ctx->fieldSystem->saveData); - s32 partyCount = Party_GetCount(playerParty); - Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - + s32 partyCount = Party_GetCount(playerParty); + Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); + for (s32 i = 0; i < partyCount; i++) { Pokemon *mon = Party_GetMonByIndex(playerParty, i); if (GetMonData(mon, MON_DATA_SPECIES, NULL) == SPECIES_DEOXYS) { @@ -4186,10 +4132,10 @@ BOOL ScrCmd_SetDeoxysForm(ScriptContext *ctx) { //0263 } #ifdef NONMATCHING -BOOL ScrCmd_CheckBurmyForms(ScriptContext *ctx) { //0264 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_CheckBurmyForms(ScriptContext *ctx) { // 0264 + u16 *var = ScriptGetVarPointer(ctx); Party *playerParty = SaveArray_Party_Get(ctx->fieldSystem->saveData); - s32 partyCount = Party_GetCount(playerParty); + s32 partyCount = Party_GetCount(playerParty); u32 unk0[PARTY_SIZE]; memcpy(unk0, UNK_020F34FC, sizeof(unk0)); @@ -4199,11 +4145,11 @@ BOOL ScrCmd_CheckBurmyForms(ScriptContext *ctx) { //0264 s32 j; BOOL hasMultiple; Pokemon *mon = Party_GetMonByIndex(playerParty, i); - u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); - u32 form = GetMonData(mon, MON_DATA_FORM, NULL); + u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + u32 form = GetMonData(mon, MON_DATA_FORM, NULL); if (species == SPECIES_BURMY) { hasMultiple = FALSE; - unk0[i] = form; + unk0[i] = form; for (j = 0; j < i; j++) { if (unk0[j] == form) { hasMultiple = TRUE; @@ -4218,149 +4164,151 @@ BOOL ScrCmd_CheckBurmyForms(ScriptContext *ctx) { //0264 return TRUE; } #else +// clang-format off asm BOOL ScrCmd_CheckBurmyForms(ScriptContext *ctx) { - push {r3-r7, lr} - sub sp, #0x30 - add r4, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r4, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl GetVarPointer - add r4, #0x80 - str r0, [sp, #0x0] - ldr r0, [r4, #0x0] - ldr r0, [r0, #0xc] - bl SaveArray_Party_Get - str r0, [sp, #0xc] - bl Party_GetCount - add r2, sp, #0x18 - mov r4, #0x0 - ldr r3, =UNK_020F34FC - str r0, [sp, #0x8] - add r7, r2, #0x0 - ldmia r3!, {r0-r1} - stmia r2!, {r0-r1} - ldmia r3!, {r0-r1} - stmia r2!, {r0-r1} - ldmia r3!, {r0-r1} - stmia r2!, {r0-r1} - ldr r0, [sp, #0x8] - str r4, [sp, #0x4] - cmp r0, #0x0 - ble _0203EFFC - mov r5, #0x1 - str r7, [sp, #0x14] + push {r3-r7, lr} + sub sp, #0x30 + add r4, r0, #0x0 + bl ScriptReadHalfword + add r1, r0, #0x0 + add r0, r4, #0x0 + add r0, #0x80 + ldr r0, [r0, #0x0] + bl GetVarPointer + add r4, #0x80 + str r0, [sp, #0x0] + ldr r0, [r4, #0x0] + ldr r0, [r0, #0xc] + bl SaveArray_Party_Get + str r0, [sp, #0xc] + bl Party_GetCount + add r2, sp, #0x18 + mov r4, #0x0 + ldr r3, =UNK_020F34FC + str r0, [sp, #0x8] + add r7, r2, #0x0 + ldmia r3!, {r0-r1} + stmia r2!, {r0-r1} + ldmia r3!, {r0-r1} + stmia r2!, {r0-r1} + ldmia r3!, {r0-r1} + stmia r2!, {r0-r1} + ldr r0, [sp, #0x8] + str r4, [sp, #0x4] + cmp r0, #0x0 + ble _0203EFFC + mov r5, #0x1 + str r7, [sp, #0x14] _0203EFA2: - ldr r0, [sp, #0xc] - add r1, r4, #0x0 - bl Party_GetMonByIndex - add r6, r0, #0x0 - mov r1, #0x5 - mov r2, #0x0 - bl GetMonData - str r0, [sp, #0x10] - add r0, r6, #0x0 - mov r1, #0x70 - mov r2, #0x0 - bl GetMonData - add r3, r0, #0x0 - mov r0, #0x67 - ldr r1, [sp, #0x10] - lsl r0, r0, #0x2 - cmp r1, r0 - bne _0203EFF2 - mov r2, #0x0 - add r1, r2, #0x0 - str r3, [r7, #0x0] - cmp r4, #0x0 - ble _0203EFE8 - ldr r6, [sp, #0x14] + ldr r0, [sp, #0xc] + add r1, r4, #0x0 + bl Party_GetMonByIndex + add r6, r0, #0x0 + mov r1, #0x5 + mov r2, #0x0 + bl GetMonData + str r0, [sp, #0x10] + add r0, r6, #0x0 + mov r1, #0x70 + mov r2, #0x0 + bl GetMonData + add r3, r0, #0x0 + mov r0, #0x67 + ldr r1, [sp, #0x10] + lsl r0, r0, #0x2 + cmp r1, r0 + bne _0203EFF2 + mov r2, #0x0 + add r1, r2, #0x0 + str r3, [r7, #0x0] + cmp r4, #0x0 + ble _0203EFE8 + ldr r6, [sp, #0x14] _0203EFD8: - ldr r0, [r6, #0x0] - cmp r3, r0 - bne _0203EFE0 - add r2, r5, #0x0 + ldr r0, [r6, #0x0] + cmp r3, r0 + bne _0203EFE0 + add r2, r5, #0x0 _0203EFE0: - add r1, r1, #0x1 - add r6, r6, #0x4 - cmp r1, r4 - blt _0203EFD8 + add r1, r1, #0x1 + add r6, r6, #0x4 + cmp r1, r4 + blt _0203EFD8 _0203EFE8: - cmp r2, #0x0 - bne _0203EFF2 - ldr r0, [sp, #0x4] - add r0, r0, #0x1 - str r0, [sp, #0x4] + cmp r2, #0x0 + bne _0203EFF2 + ldr r0, [sp, #0x4] + add r0, r0, #0x1 + str r0, [sp, #0x4] _0203EFF2: - ldr r0, [sp, #0x8] - add r4, r4, #0x1 - add r7, r7, #0x4 - cmp r4, r0 - blt _0203EFA2 + ldr r0, [sp, #0x8] + add r4, r4, #0x1 + add r7, r7, #0x4 + cmp r4, r0 + blt _0203EFA2 _0203EFFC: - ldr r1, [sp, #0x4] - ldr r0, [sp, #0x0] - strh r1, [r0, #0x0] - mov r0, #0x1 - add sp, #0x30 - pop {r3-r7, pc} -} + ldr r1, [sp, #0x4] + ldr r0, [sp, #0x0] + strh r1, [r0, #0x0] + mov r0, #0x1 + add sp, #0x30 + pop {r3-r7, pc} +} +// clang-format on #endif -BOOL ScrCmd_Unk0265(ScriptContext *ctx) { //0265 +BOOL ScrCmd_Unk0265(ScriptContext *ctx) { // 0265 sub_0205F1C4(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_Unk0266(ScriptContext *ctx) { //0266 +BOOL ScrCmd_Unk0266(ScriptContext *ctx) { // 0266 sub_0205F1D4(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_SlotMachine(ScriptContext *ctx) { //0267 +BOOL ScrCmd_SlotMachine(ScriptContext *ctx) { // 0267 u16 unk0 = ScriptGetVar(ctx); sub_020389CC(ctx->fieldSystem->taskManager, unk0); return TRUE; } -BOOL ScrCmd_GetHour(ScriptContext *ctx) { //0268 +BOOL ScrCmd_GetHour(ScriptContext *ctx) { // 0268 u16 *var = ScriptGetVarPointer(ctx); - *var = Script_GetHour(ctx->fieldSystem); + *var = Script_GetHour(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_ShakeEvent(ScriptContext *ctx) { //0269 - u16 eventId = ScriptGetVar(ctx); - u16 count = ScriptGetVar(ctx); - u16 frames = ScriptGetVar(ctx); - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); +BOOL ScrCmd_ShakeEvent(ScriptContext *ctx) { // 0269 + u16 eventId = ScriptGetVar(ctx); + u16 count = ScriptGetVar(ctx); + u16 frames = ScriptGetVar(ctx); + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); LocalMapObject *mapObject = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); GF_ASSERT(mapObject != NULL); sub_02054F50(ctx->taskManager, mapObject, count, frames, x, y); return TRUE; } -BOOL ScrCmd_BlinkEvent(ScriptContext *ctx) { //026A - u16 eventId = ScriptGetVar(ctx); - u16 count = ScriptGetVar(ctx); - u16 frames = ScriptGetVar(ctx); +BOOL ScrCmd_BlinkEvent(ScriptContext *ctx) { // 026A + u16 eventId = ScriptGetVar(ctx); + u16 count = ScriptGetVar(ctx); + u16 frames = ScriptGetVar(ctx); LocalMapObject *mapObject = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, eventId); GF_ASSERT(mapObject != NULL); sub_0205502C(ctx->taskManager, mapObject, count, frames); return TRUE; } -BOOL ScrCmd_CheckRegis(ScriptContext *ctx) { //026B +BOOL ScrCmd_CheckRegis(ScriptContext *ctx) { // 026B u16 *var = ScriptGetVarPointer(ctx); - *var = Save_PlayerHasAllRegisInParty(ctx->fieldSystem->saveData); + *var = Save_PlayerHasAllRegisInParty(ctx->fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_Unk026C(ScriptContext *ctx) { //026C - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk026C(ScriptContext *ctx) { // 026C + u16 *var = ScriptGetVarPointer(ctx); FashionCase *fashionCase = Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)); s32 i; u32 k; @@ -4390,20 +4338,20 @@ BOOL ScrCmd_Unk026C(ScriptContext *ctx) { //026C return FALSE; } -BOOL ScrCmd_CheckGBACartridge(ScriptContext *ctx) { //026E +BOOL ScrCmd_CheckGBACartridge(ScriptContext *ctx) { // 026E u16 *var = ScriptGetVarPointer(ctx); - *var = gSystem.gbaCartId; + *var = gSystem.gbaCartId; return TRUE; } -BOOL ScrCmd_ResetSpiritombTalkCounter(ScriptContext *ctx) { //026F +BOOL ScrCmd_ResetSpiritombTalkCounter(ScriptContext *ctx) { // 026F Save_VarsFlags_SetSpiritombTalkCounter(Save_VarsFlags_Get(ctx->fieldSystem->saveData), 0); return FALSE; } -BOOL ScrCmd_Unk0270(ScriptContext *ctx) { //0270 - todo: SetMatrixAlternativeMap - u16 alternativeId = ScriptGetVar(ctx); - u8 status = ScriptReadByte(ctx); +BOOL ScrCmd_Unk0270(ScriptContext *ctx) { // 0270 - todo: SetMatrixAlternativeMap + u16 alternativeId = ScriptGetVar(ctx); + u8 status = ScriptReadByte(ctx); SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); if (status) { @@ -4414,17 +4362,17 @@ BOOL ScrCmd_Unk0270(ScriptContext *ctx) { //0270 - todo: SetMatrixAlternativeMap return FALSE; } -BOOL ScrCmd_BufferContestBackgroundName(ScriptContext *ctx) { //0273 +BOOL ScrCmd_BufferContestBackgroundName(ScriptContext *ctx) { // 0273 MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 bufferId = ScriptReadByte(ctx); - u16 backgroundId = ScriptGetVar(ctx); + u8 bufferId = ScriptReadByte(ctx); + u16 backgroundId = ScriptGetVar(ctx); BufferContestBackgroundName(*messageFormat, bufferId, backgroundId); return TRUE; } -BOOL ScrCmd_Unk0275(ScriptContext *ctx) { //0275 +BOOL ScrCmd_Unk0275(ScriptContext *ctx) { // 0275 SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); + u16 *var = ScriptGetVarPointer(ctx); if (sub_0205F6C8(varsFlags) >= 10) { *var = 1; } else { @@ -4433,34 +4381,34 @@ BOOL ScrCmd_Unk0275(ScriptContext *ctx) { //0275 return FALSE; } -BOOL ScrCmd_Unk0277(ScriptContext *ctx) { //0277 +BOOL ScrCmd_Unk0277(ScriptContext *ctx) { // 0277 u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205F648(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); + *var = sub_0205F648(Save_VarsFlags_Get(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_Unk0279(ScriptContext *ctx) { //0279 +BOOL ScrCmd_Unk0279(ScriptContext *ctx) { // 0279 u16 unk0 = ScriptGetVar(ctx); u16 unk1 = ScriptGetVar(ctx); sub_02027210(Save_FashionData_GetFashionCase(Save_FashionData_Get(ctx->fieldSystem->saveData)), unk0, unk1); return FALSE; } -BOOL ScrCmd_UseSunyshoreBinoculars(ScriptContext *ctx) { //027A +BOOL ScrCmd_UseSunyshoreBinoculars(ScriptContext *ctx) { // 027A CallTask_UseSunyshoreBinoculars(ctx->fieldSystem); return TRUE; } -BOOL ScrCmd_Unk027B(ScriptContext *ctx) { //027B +BOOL ScrCmd_Unk027B(ScriptContext *ctx) { // 027B sub_0205F668(ctx->fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_BufferRandomTrendySaying(ScriptContext *ctx) { //027D - u16 *var = ScriptGetVarPointer(ctx); - u16 fieldId = ScriptGetVar(ctx); +BOOL ScrCmd_BufferRandomTrendySaying(ScriptContext *ctx) { // 027D + u16 *var = ScriptGetVarPointer(ctx); + u16 fieldId = ScriptGetVar(ctx); MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u32 trendy = Save_EasyChat_SetRandomTrendySaying(Save_EasyChat_Get(ctx->fieldSystem->saveData)); + u32 trendy = Save_EasyChat_SetRandomTrendySaying(Save_EasyChat_Get(ctx->fieldSystem->saveData)); if (trendy == 32) { *var = -1; return FALSE; @@ -4470,23 +4418,23 @@ BOOL ScrCmd_BufferRandomTrendySaying(ScriptContext *ctx) { //027D return FALSE; } -BOOL ScrCmd_Unk027F(ScriptContext *ctx) { //027F +BOOL ScrCmd_Unk027F(ScriptContext *ctx) { // 027F u16 *var = ScriptGetVarPointer(ctx); - *var = Save_EasyChat_TrendySayingsUnlockedAllCheck(Save_EasyChat_Get(ctx->fieldSystem->saveData)) == TRUE; + *var = Save_EasyChat_TrendySayingsUnlockedAllCheck(Save_EasyChat_Get(ctx->fieldSystem->saveData)) == TRUE; return FALSE; } -BOOL ScrCmd_Unk027E(ScriptContext *ctx) { //027E +BOOL ScrCmd_Unk027E(ScriptContext *ctx) { // 027E SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205F710(varsFlags) >= 5; + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_0205F710(varsFlags) >= 5; return FALSE; } -BOOL ScrCmd_CheckBirthday(ScriptContext *ctx) { //0282 - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_CheckBirthday(ScriptContext *ctx) { // 0282 + u16 *var = ScriptGetVarPointer(ctx); FieldSystem *fieldSystem = ctx->fieldSystem; - SaveSysInfo *sysInfo = Save_SysInfo_Get(ctx->fieldSystem->saveData); + SaveSysInfo *sysInfo = Save_SysInfo_Get(ctx->fieldSystem->saveData); if (Save_SysInfo_GetBirthMonth(sysInfo) == Script_GetMonth(fieldSystem) && Save_SysInfo_GetBirthDay(sysInfo) == Script_GetDay(fieldSystem)) { *var = TRUE; } else { @@ -4495,18 +4443,18 @@ BOOL ScrCmd_CheckBirthday(ScriptContext *ctx) { //0282 return FALSE; } -BOOL ScrCmd_CountSeenUnown(ScriptContext *ctx) { //0284 +BOOL ScrCmd_CountSeenUnown(ScriptContext *ctx) { // 0284 Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = Pokedex_CountSeenUnown(pokedex); + u16 *var = ScriptGetVarPointer(ctx); + *var = Pokedex_CountSeenUnown(pokedex); return FALSE; } -BOOL ScrCmd_Unk0285(ScriptContext *ctx) { //0285 +BOOL ScrCmd_Unk0285(ScriptContext *ctx) { // 0285 u16 unk0 = ScriptGetVar(ctx); u16 unk1 = ScriptGetVar(ctx); - u16 x = ctx->fieldSystem->location->x; - u16 y = ctx->fieldSystem->location->y; + u16 x = ctx->fieldSystem->location->x; + u16 y = ctx->fieldSystem->location->y; u16 unk2 = 0; if (unk0 >= 3) { @@ -4547,39 +4495,39 @@ BOOL ScrCmd_Unk0285(ScriptContext *ctx) { //0285 return FALSE; } -BOOL ScrCmd_Unk0286(ScriptContext *ctx) { //0286 +BOOL ScrCmd_Unk0286(ScriptContext *ctx) { // 0286 SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205F720(varsFlags); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_0205F720(varsFlags); return FALSE; } -BOOL ScrCmd_Unk0287(ScriptContext *ctx) { //0287 +BOOL ScrCmd_Unk0287(ScriptContext *ctx) { // 0287 SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205F740(varsFlags); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_0205F740(varsFlags); return FALSE; } -BOOL ScrCmd_Unk0288(ScriptContext *ctx) { //0288 +BOOL ScrCmd_Unk0288(ScriptContext *ctx) { // 0288 SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205F760(varsFlags); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_0205F760(varsFlags); return FALSE; } -BOOL ScrCmd_Unk0289(ScriptContext *ctx) { //0289 +BOOL ScrCmd_Unk0289(ScriptContext *ctx) { // 0289 u16 *var = ScriptGetVarPointer(ctx); u8 bytes[5]; for (s32 i = 0; i < 5; i++) { bytes[i] = ScriptReadByte(ctx); } - u8 unk0 = ScriptReadByte(ctx); - Poffin *poffin = Poffin_New(HEAP_ID_4); - u32 unk1 = sub_02027F04(poffin, bytes, unk0, 0); + u8 unk0 = ScriptReadByte(ctx); + Poffin *poffin = Poffin_New(HEAP_ID_4); + u32 unk1 = sub_02027F04(poffin, bytes, unk0, 0); SavePoffinData *poffinSave = Save_PoffinData_Get(ctx->fieldSystem->saveData); - u16 unk2 = sub_02028094(poffinSave, poffin); + u16 unk2 = sub_02028094(poffinSave, poffin); FreeToHeap(poffin); if (unk2 == 0xFFFF) { @@ -4590,7 +4538,7 @@ BOOL ScrCmd_Unk0289(ScriptContext *ctx) { //0289 return FALSE; } -BOOL ScrCmd_Unk028A(ScriptContext *ctx) { //028A +BOOL ScrCmd_Unk028A(ScriptContext *ctx) { // 028A u16 *var = ScriptGetVarPointer(ctx); if (sub_02028074(Save_PoffinData_Get(ctx->fieldSystem->saveData)) == 0xFFFF) { *var = 0; @@ -4600,16 +4548,16 @@ BOOL ScrCmd_Unk028A(ScriptContext *ctx) { //028A return FALSE; } -BOOL ScrCmd_CheckEventValidity(ScriptContext *ctx) { //028B - u8 eventId = ScriptReadByte(ctx); - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_CheckEventValidity(ScriptContext *ctx) { // 028B + u8 eventId = ScriptReadByte(ctx); + u16 *var = ScriptGetVarPointer(ctx); SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); GF_ASSERT(eventId <= 3); *var = sub_0205F4A0(varsFlags, eventId); return FALSE; } -BOOL ScrCmd_Unk028F(ScriptContext *ctx) { //028F +BOOL ScrCmd_Unk028F(ScriptContext *ctx) { // 028F u16 *var = ScriptGetVarPointer(ctx); s32 loadResult; HallOfFame *hallOfFame = LoadHallOfFame(ctx->fieldSystem->saveData, HEAP_ID_32, &loadResult); @@ -4630,17 +4578,17 @@ BOOL ScrCmd_Unk028F(ScriptContext *ctx) { //028F return TRUE; } -BOOL ScrCmd_Unk0290(ScriptContext *ctx) { //0290 - u16 unk0 = ScriptGetVar(ctx); - void **runningAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); //todo: find out what this is - *runningAppData = sub_02037A48(HEAP_ID_32, ctx->fieldSystem, unk0); +BOOL ScrCmd_Unk0290(ScriptContext *ctx) { // 0290 + u16 unk0 = ScriptGetVar(ctx); + void **runningAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); // todo: find out what this is + *runningAppData = sub_02037A48(HEAP_ID_32, ctx->fieldSystem, unk0); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_Unk0291(ScriptContext *ctx) { //0291 - u16 *var1 = ScriptGetVarPointer(ctx); - u16 *var2 = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk0291(ScriptContext *ctx) { // 0291 + u16 *var1 = ScriptGetVarPointer(ctx); + u16 *var2 = ScriptGetVarPointer(ctx); PartyMenuAppData **partyMenu = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); GF_ASSERT(*partyMenu != NULL); *var1 = sub_02037A40(*partyMenu); @@ -4654,46 +4602,46 @@ BOOL ScrCmd_Unk0291(ScriptContext *ctx) { //0291 return FALSE; } -BOOL ScrCmd_Unk0292(ScriptContext *ctx) { //0292 +BOOL ScrCmd_Unk0292(ScriptContext *ctx) { // 0292 u8 limit = ScriptReadByte(ctx); u16 *var = ScriptGetVarPointer(ctx); if (limit > 100) { limit = 100; } u16 rnd = LCRandom() % 101; - *var = (rnd <= limit); + *var = (rnd <= limit); return FALSE; } -BOOL ScrCmd_Unk029E(ScriptContext *ctx) { //029E - u16 unk0 = ScriptGetVar(ctx); - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk029E(ScriptContext *ctx) { // 029E + u16 unk0 = ScriptGetVar(ctx); + u16 *var = ScriptGetVarPointer(ctx); FieldSystem *fieldSystem = ctx->fieldSystem; switch (unk0) { - case 0: - ov06_0224F12C(fieldSystem, var, 0, HEAP_ID_32); - break; - case 1: - ov06_0224F12C(fieldSystem, var, 1, HEAP_ID_32); - break; - case 2: - ov06_0224F12C(fieldSystem, var, 2, HEAP_ID_32); - break; - default: - GF_ASSERT(FALSE); - break; + case 0: + ov06_0224F12C(fieldSystem, var, 0, HEAP_ID_32); + break; + case 1: + ov06_0224F12C(fieldSystem, var, 1, HEAP_ID_32); + break; + case 2: + ov06_0224F12C(fieldSystem, var, 2, HEAP_ID_32); + break; + default: + GF_ASSERT(FALSE); + break; } return TRUE; } -BOOL ScrCmd_Unk0293(ScriptContext *ctx) { //0293 +BOOL ScrCmd_Unk0293(ScriptContext *ctx) { // 0293 SaveVarsFlags *varsFlags = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0205F6A8(varsFlags); + u16 *var = ScriptGetVarPointer(ctx); + *var = sub_0205F6A8(varsFlags); return FALSE; } -BOOL ScrCmd_ShakeCamera(ScriptContext *ctx) { //029F +BOOL ScrCmd_ShakeCamera(ScriptContext *ctx) { // 029F u16 type = ScriptGetVar(ctx); if (type == 0) { ov06_02239944(ctx->fieldSystem->taskManager); @@ -4703,53 +4651,53 @@ BOOL ScrCmd_ShakeCamera(ScriptContext *ctx) { //029F return TRUE; } -BOOL ScrCmd_Unk02A3(ScriptContext *ctx) { //02A3 +BOOL ScrCmd_Unk02A3(ScriptContext *ctx) { // 02A3 u16 *var = ScriptGetVarPointer(ctx); - *var = sub_0203384C(ctx->fieldSystem->saveData); + *var = sub_0203384C(ctx->fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_Unk02A4(ScriptContext *ctx) { //02A4 +BOOL ScrCmd_Unk02A4(ScriptContext *ctx) { // 02A4 u16 *var = ScriptGetVarPointer(ctx); - *var = sub_02028448(sub_020286EC(ctx->fieldSystem->saveData)); + *var = sub_02028448(sub_020286EC(ctx->fieldSystem->saveData)); return FALSE; } -BOOL ScrCmd_Unk02A2(ScriptContext *ctx) { //02A2 +BOOL ScrCmd_Unk02A2(ScriptContext *ctx) { // 02A2 u16 unk0 = ScriptGetVar(ctx); - u32 res = sub_02026CC4(ctx->fieldSystem->saveData); - u16 unk1 = unk0 + 0xFF79; //this is weird + u32 res = sub_02026CC4(ctx->fieldSystem->saveData); + u16 unk1 = unk0 + 0xFF79; // this is weird if (unk1 <= 1) { sub_02025C30(res); } return FALSE; } -BOOL ScrCmd_Unk02A7(ScriptContext *ctx) { //02A7 +BOOL ScrCmd_Unk02A7(ScriptContext *ctx) { // 02A7 u16 unk0 = ScriptGetVar(ctx); u16 *var = ScriptGetVarPointer(ctx); - *var = 0; + *var = 0; if (unk0 >= 0x12A && unk0 <= 0x139) { *var = 1; } return FALSE; } -BOOL ScrCmd_CompareMysteryGiftEasyChatInput(ScriptContext *ctx) { //02AA - u16 *var = ScriptGetVarPointer(ctx); - u16 word0 = ScriptGetVar(ctx); - u16 word1 = ScriptGetVar(ctx); - u16 word2 = ScriptGetVar(ctx); - u16 word3 = ScriptGetVar(ctx); +BOOL ScrCmd_CompareMysteryGiftEasyChatInput(ScriptContext *ctx) { // 02AA + u16 *var = ScriptGetVarPointer(ctx); + u16 word0 = ScriptGetVar(ctx); + u16 word1 = ScriptGetVar(ctx); + u16 word2 = ScriptGetVar(ctx); + u16 word3 = ScriptGetVar(ctx); MessageFormat *messageFormat = MessageFormat_New(HEAP_ID_32); - MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_DIRECT, NARC_MSGDATA_MSG, NARC_msg_narc_0327_bin, HEAP_ID_32); + MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_DIRECT, NARC_MSGDATA_MSG, NARC_msg_narc_0327_bin, HEAP_ID_32); BufferECWord(messageFormat, 0, word0); BufferECWord(messageFormat, 1, word1); BufferECWord(messageFormat, 2, word2); BufferECWord(messageFormat, 3, word3); - String *userInput = ReadMsgData_ExpandPlaceholders(messageFormat, msgData, narc_0327_00001, HEAP_ID_32); + String *userInput = ReadMsgData_ExpandPlaceholders(messageFormat, msgData, narc_0327_00001, HEAP_ID_32); String *targetString = NewString_ReadMsgData(msgData, narc_0327_00000); - *var = String_Compare(userInput, targetString) == FALSE; + *var = String_Compare(userInput, targetString) == FALSE; String_Delete(userInput); String_Delete(targetString); DestroyMsgData(msgData); @@ -4757,65 +4705,65 @@ BOOL ScrCmd_CompareMysteryGiftEasyChatInput(ScriptContext *ctx) { //02AA return FALSE; } -BOOL ScrCmd_ActivateMysteryGift(ScriptContext *ctx) { //02AC +BOOL ScrCmd_ActivateMysteryGift(ScriptContext *ctx) { // 02AC Save_SysInfo_SetMysteryGiftActive(Save_SysInfo_Get(ctx->fieldSystem->saveData), TRUE); return FALSE; } -BOOL ScrCmd_Unk02AF(ScriptContext *ctx) { //02AF - FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *var = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk02AF(ScriptContext *ctx) { // 02AF + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 *var = ScriptGetVarPointer(ctx); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - *var = sub_0205296C(*messageFormat); + *var = sub_0205296C(*messageFormat); return FALSE; } -BOOL ScrCmd_Unk02B0(ScriptContext *ctx) { //02B0 +BOOL ScrCmd_Unk02B0(ScriptContext *ctx) { // 02B0 sub_02033E74(); return FALSE; } -BOOL ScrCmd_Unk02B1(ScriptContext *ctx) { //02B1 +BOOL ScrCmd_Unk02B1(ScriptContext *ctx) { // 02B1 sub_02033ED0(); return FALSE; } -BOOL ScrCmd_Unk02B2(ScriptContext *ctx) { //02B2 +BOOL ScrCmd_Unk02B2(ScriptContext *ctx) { // 02B2 FieldSystem_SyncMapObjectsToSave(ctx->fieldSystem); return FALSE; } -BOOL ScrCmd_Unk02B5(ScriptContext *ctx) { //02B5 - u16 mapId = ScriptGetVar(ctx); - u16 x = ScriptGetVar(ctx); - u16 y = ScriptGetVar(ctx); - Location *specialSpawn = LocalFieldData_GetSpecialSpawnWarpPtr(Save_LocalFieldData_Get(ctx->fieldSystem->saveData)); - specialSpawn->mapId = mapId; - specialSpawn->x = x; - specialSpawn->y = y; - specialSpawn->warpId = -1; +BOOL ScrCmd_Unk02B5(ScriptContext *ctx) { // 02B5 + u16 mapId = ScriptGetVar(ctx); + u16 x = ScriptGetVar(ctx); + u16 y = ScriptGetVar(ctx); + Location *specialSpawn = LocalFieldData_GetSpecialSpawnWarpPtr(Save_LocalFieldData_Get(ctx->fieldSystem->saveData)); + specialSpawn->mapId = mapId; + specialSpawn->x = x; + specialSpawn->y = y; + specialSpawn->warpId = -1; specialSpawn->direction = DIR_SOUTH; return FALSE; } -BOOL ScrCmd_Unk02B6(ScriptContext *ctx) { //02B6 - u16 objectId = ScriptGetVar(ctx); - u8 unk0 = ScriptReadByte(ctx); +BOOL ScrCmd_Unk02B6(ScriptContext *ctx) { // 02B6 + u16 objectId = ScriptGetVar(ctx); + u8 unk0 = ScriptReadByte(ctx); LocalMapObject *object = MapObjectManager_GetFirstActiveObjectByID(ctx->fieldSystem->mapObjectManager, objectId); GF_ASSERT(object != NULL); sub_020588B8(object, unk0); return FALSE; } -BOOL ScrCmd_GetTrainerCardLevel(ScriptContext *ctx) { //02BE +BOOL ScrCmd_GetTrainerCardLevel(ScriptContext *ctx) { // 02BE FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *var = ScriptGetVarPointer(ctx); - *var = GetTrainerCardLevel(fieldSystem); + u16 *var = ScriptGetVarPointer(ctx); + *var = GetTrainerCardLevel(fieldSystem); return FALSE; } -BOOL ScrCmd_ShowSaveStats(ScriptContext *ctx) { //02C1 - FieldSystem *fieldSystem = ctx->fieldSystem; +BOOL ScrCmd_ShowSaveStats(ScriptContext *ctx) { // 02C1 + FieldSystem *fieldSystem = ctx->fieldSystem; SaveStatsPrinter **saveStatsPrinter = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SAVE_STATS_PRINTER); if (!Save_FileDoesNotBelongToPlayer(fieldSystem->saveData)) { *saveStatsPrinter = Field_SaveStatsPrinter_New(fieldSystem, HEAP_ID_4, 3); @@ -4824,8 +4772,8 @@ BOOL ScrCmd_ShowSaveStats(ScriptContext *ctx) { //02C1 return FALSE; } -BOOL ScrCmd_HideSaveStats(ScriptContext *ctx) { //02C2 - FieldSystem *fieldSystem = ctx->fieldSystem; +BOOL ScrCmd_HideSaveStats(ScriptContext *ctx) { // 02C2 + FieldSystem *fieldSystem = ctx->fieldSystem; SaveStatsPrinter **saveStatsPrinter = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_SAVE_STATS_PRINTER); if (!Save_FileDoesNotBelongToPlayer(fieldSystem->saveData)) { Field_SaveStatsPrinter_RemoveFromScreen(*saveStatsPrinter); @@ -4834,7 +4782,7 @@ BOOL ScrCmd_HideSaveStats(ScriptContext *ctx) { //02C2 return FALSE; } -BOOL ScrCmd_ScopeMode(ScriptContext *ctx) { //02C3 +BOOL ScrCmd_ScopeMode(ScriptContext *ctx) { // 02C3 u8 value = ScriptReadByte(ctx); sub_0206367C(ctx->fieldSystem, value); return FALSE; diff --git a/arm9/src/scrcmd_13.c b/arm9/src/scrcmd_13.c index e989ce940..ef89ac5c3 100644 --- a/arm9/src/scrcmd_13.c +++ b/arm9/src/scrcmd_13.c @@ -1,53 +1,49 @@ #include "global.h" -#include "scrcmd.h" -#include "save_vars_flags.h" + #include "heap.h" #include "pokedex.h" #include "pokemon_storage_system.h" +#include "save_vars_flags.h" +#include "scrcmd.h" #include "unk_0202C144.h" -extern struct PCStorage* SaveArray_PCStorage_Get(struct SaveData* save); -extern void* sub_02022528(struct SaveData* save); -extern void sub_0202BEDC(struct Pokemon* pokemon); -extern void sub_0202BFD8(void* a0, s32 a1, struct Pokemon* pokemon); -extern u16 sub_0202C000(struct Pokemon* pokemon); -extern void sub_0204B9EC(struct FieldSystem*); -extern u32 sub_0204BA1C(struct FieldSystem*); -extern u16 sub_0204BAC4(struct FieldSystem*); -extern u16 sub_0204BAD4(struct FieldSystem*); -extern u16 sub_0204BAE4(struct FieldSystem*); -extern void sub_0205F224(struct SaveVarsFlags* state); -extern void sub_0205F234(struct SaveVarsFlags* state); -extern void sub_0208089C(struct Pokemon* pokemon, PlayerProfile* player, u32 a2, u32 a3, HeapID heapId); - -BOOL ScrCmd_Unk0253(struct ScriptContext* ctx) //0253 +extern struct PCStorage *SaveArray_PCStorage_Get(struct SaveData *save); +extern void *sub_02022528(struct SaveData *save); +extern void sub_0202BEDC(struct Pokemon *pokemon); +extern void sub_0202BFD8(void *a0, s32 a1, struct Pokemon *pokemon); +extern u16 sub_0202C000(struct Pokemon *pokemon); +extern void sub_0204B9EC(struct FieldSystem *); +extern u32 sub_0204BA1C(struct FieldSystem *); +extern u16 sub_0204BAC4(struct FieldSystem *); +extern u16 sub_0204BAD4(struct FieldSystem *); +extern u16 sub_0204BAE4(struct FieldSystem *); +extern void sub_0205F224(struct SaveVarsFlags *state); +extern void sub_0205F234(struct SaveVarsFlags *state); +extern void sub_0208089C(struct Pokemon *pokemon, PlayerProfile *player, u32 a2, u32 a3, HeapID heapId); + +BOOL ScrCmd_Unk0253(struct ScriptContext *ctx) // 0253 { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u16 unk = ScriptGetVar(ctx); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u16 unk = ScriptGetVar(ctx); - if (unk == 0) - { + if (unk == 0) { sub_0205F224(state); sub_0204B9EC(ctx->fieldSystem); - } - else if (unk == 1) - { + } else if (unk == 1) { sub_0205F234(state); sub_0204BA1C(ctx->fieldSystem); - } - else - { + } else { GF_ASSERT(FALSE); } return FALSE; } -BOOL ScrCmd_Unk0254(struct ScriptContext* ctx) //0254 +BOOL ScrCmd_Unk0254(struct ScriptContext *ctx) // 0254 { - void* unk = sub_02022528(ctx->fieldSystem->saveData); - struct Pokemon* pokemon = AllocMonZeroed(HEAP_ID_32); - u16* ret_ptr = ScriptGetVarPointer(ctx); + void *unk = sub_02022528(ctx->fieldSystem->saveData); + struct Pokemon *pokemon = AllocMonZeroed(HEAP_ID_32); + u16 *ret_ptr = ScriptGetVarPointer(ctx); u16 eggs = sub_0202C000(unk); if (eggs == 6) { @@ -61,20 +57,19 @@ BOOL ScrCmd_Unk0254(struct ScriptContext* ctx) //0254 return FALSE; } -BOOL ScrCmd_Unk0255(struct ScriptContext* ctx) //0255 +BOOL ScrCmd_Unk0255(struct ScriptContext *ctx) // 0255 { - void* unk = sub_02022528(ctx->fieldSystem->saveData); - struct PCStorage* pc = SaveArray_PCStorage_Get(ctx->fieldSystem->saveData); - struct Pokemon* pokemon = AllocMonZeroed(HEAP_ID_32); - PlayerProfile* player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); - struct Pokedex* pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); // unused - - for (s32 i = 0; i < PARTY_SIZE; i++) - { + void *unk = sub_02022528(ctx->fieldSystem->saveData); + struct PCStorage *pc = SaveArray_PCStorage_Get(ctx->fieldSystem->saveData); + struct Pokemon *pokemon = AllocMonZeroed(HEAP_ID_32); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); + struct Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); // unused + + for (s32 i = 0; i < PARTY_SIZE; i++) { sub_0202BFD8(unk, i, pokemon); sub_0208089C(pokemon, player, 2, 0, HEAP_ID_32); - struct BoxPokemon* box_mon = sub_020690E4(pokemon); + struct BoxPokemon *box_mon = sub_020690E4(pokemon); GF_ASSERT(PCStorage_PlaceMonInFirstEmptySlotInAnyBox(pc, box_mon)); sub_0202C144(ctx->fieldSystem->saveData, pokemon); @@ -86,13 +81,12 @@ BOOL ScrCmd_Unk0255(struct ScriptContext* ctx) //0255 return FALSE; } -BOOL ScrCmd_Unk0256(struct ScriptContext* ctx) //0256 +BOOL ScrCmd_Unk0256(struct ScriptContext *ctx) // 0256 { - u16 unk = ScriptGetVar(ctx); - u16* ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); + u16 unk = ScriptGetVar(ctx); + u16 *ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); - switch (unk) - { + switch (unk) { case 0: *ret_ptr = sub_0204BAC4(ctx->fieldSystem); break; diff --git a/arm9/src/scrcmd_25.c b/arm9/src/scrcmd_25.c index fa29032af..c6147bc97 100644 --- a/arm9/src/scrcmd_25.c +++ b/arm9/src/scrcmd_25.c @@ -1,27 +1,28 @@ #include "global.h" + #include "scrcmd.h" -BOOL ScrCmd_Unk023F(struct ScriptContext * ctx) //023F +BOOL ScrCmd_Unk023F(struct ScriptContext *ctx) // 023F { #pragma unused(ctx) GF_ASSERT(FALSE); return FALSE; } -BOOL ScrCmd_Unk0240(struct ScriptContext * ctx) //0240 +BOOL ScrCmd_Unk0240(struct ScriptContext *ctx) // 0240 { #pragma unused(ctx) GF_ASSERT(FALSE); return FALSE; } -BOOL ScrCmd_Unk0241(struct ScriptContext * ctx) //0241 +BOOL ScrCmd_Unk0241(struct ScriptContext *ctx) // 0241 { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Unk0242(struct ScriptContext * ctx) //0242 +BOOL ScrCmd_Unk0242(struct ScriptContext *ctx) // 0242 { #pragma unused(ctx) return FALSE; diff --git a/arm9/src/scrcmd_amity_square.c b/arm9/src/scrcmd_amity_square.c index daa66e25e..cb487f7d4 100644 --- a/arm9/src/scrcmd_amity_square.c +++ b/arm9/src/scrcmd_amity_square.c @@ -1,199 +1,175 @@ #include "global.h" -#include "scrcmd.h" + #include "constants/accessories.h" #include "constants/pokemon.h" + #include "save_vars_flags.h" +#include "scrcmd.h" -extern void sub_0205F54C(struct SaveVarsFlags* state); -extern u16 sub_0205F55C(struct SaveVarsFlags* state); +extern void sub_0205F54C(struct SaveVarsFlags *state); +extern u16 sub_0205F55C(struct SaveVarsFlags *state); static const u16 sAmitySquarePossibleAccessoriesByPokemon[6][10] = { { // Clefairy and Skitty ACCESSORY_WHITE_FLUFF, - ACCESSORY_ORANGE_FLUFF, - ACCESSORY_WHITE_FEATHER, - ACCESSORY_MINI_PEBBLE, - ACCESSORY_SMALL_LEAF, - ACCESSORY_BLUE_SCALE, + ACCESSORY_ORANGE_FLUFF, + ACCESSORY_WHITE_FEATHER, + ACCESSORY_MINI_PEBBLE, + ACCESSORY_SMALL_LEAF, + ACCESSORY_BLUE_SCALE, - ACCESSORY_WHITE_BEARD, - ACCESSORY_THIN_MUSHROOM, - ACCESSORY_BIG_SCALE, + ACCESSORY_WHITE_BEARD, + ACCESSORY_THIN_MUSHROOM, + ACCESSORY_BIG_SCALE, - ACCESSORY_STUMP - }, + ACCESSORY_STUMP }, { // Torchic and Drifloon ACCESSORY_PINK_FLUFF, - ACCESSORY_RED_FEATHER, - ACCESSORY_YELLOW_FEATHER, - ACCESSORY_BLACK_BEARD, - ACCESSORY_NARROW_SCALE, - ACCESSORY_WHITE_FLUFF, + ACCESSORY_RED_FEATHER, + ACCESSORY_YELLOW_FEATHER, + ACCESSORY_BLACK_BEARD, + ACCESSORY_NARROW_SCALE, + ACCESSORY_WHITE_FLUFF, - ACCESSORY_WHITE_MOUSTACHE, - ACCESSORY_SHED_CLAW, - ACCESSORY_NARROW_LEAF, + ACCESSORY_WHITE_MOUSTACHE, + ACCESSORY_SHED_CLAW, + ACCESSORY_NARROW_LEAF, - ACCESSORY_PURPLE_SCALE - }, + ACCESSORY_PURPLE_SCALE }, { // Psyduck and Pachirisu ACCESSORY_SNAGGY_PEBBLE, - ACCESSORY_JAGGED_BOULDER, - ACCESSORY_BROWN_FLUFF, - ACCESSORY_MINI_PEBBLE, - ACCESSORY_BLACK_MOUSTACHE, - ACCESSORY_SHED_HORN, + ACCESSORY_JAGGED_BOULDER, + ACCESSORY_BROWN_FLUFF, + ACCESSORY_MINI_PEBBLE, + ACCESSORY_BLACK_MOUSTACHE, + ACCESSORY_SHED_HORN, - ACCESSORY_NARROW_SCALE, - ACCESSORY_ROUND_PEBBLE, - ACCESSORY_GREEN_SCALE, + ACCESSORY_NARROW_SCALE, + ACCESSORY_ROUND_PEBBLE, + ACCESSORY_GREEN_SCALE, - ACCESSORY_THICK_MUSHROOM - }, + ACCESSORY_THICK_MUSHROOM }, { // Jigglypuff and Shroomish ACCESSORY_PINK_SCALE, - ACCESSORY_BLUE_FEATHER, - ACCESSORY_WHITE_FEATHER, - ACCESSORY_BLUE_SCALE, - ACCESSORY_THIN_MUSHROOM, - ACCESSORY_JAGGED_BOULDER, + ACCESSORY_BLUE_FEATHER, + ACCESSORY_WHITE_FEATHER, + ACCESSORY_BLUE_SCALE, + ACCESSORY_THIN_MUSHROOM, + ACCESSORY_JAGGED_BOULDER, - ACCESSORY_WHITE_BEARD, - ACCESSORY_BLACK_BEARD, - ACCESSORY_BIG_LEAF, + ACCESSORY_WHITE_BEARD, + ACCESSORY_BLACK_BEARD, + ACCESSORY_BIG_LEAF, - ACCESSORY_ROUND_PEBBLE - }, + ACCESSORY_ROUND_PEBBLE }, { // Pikachu ACCESSORY_ORANGE_FLUFF, - ACCESSORY_BROWN_FLUFF, - ACCESSORY_SMALL_LEAF, - ACCESSORY_RED_FEATHER, - ACCESSORY_YELLOW_FEATHER, - ACCESSORY_YELLOW_FLUFF, + ACCESSORY_BROWN_FLUFF, + ACCESSORY_SMALL_LEAF, + ACCESSORY_RED_FEATHER, + ACCESSORY_YELLOW_FEATHER, + ACCESSORY_YELLOW_FLUFF, - ACCESSORY_GLITTER_BOULDER, - ACCESSORY_BIG_SCALE, - ACCESSORY_BLACK_MOUSTACHE, + ACCESSORY_GLITTER_BOULDER, + ACCESSORY_BIG_SCALE, + ACCESSORY_BLACK_MOUSTACHE, - ACCESSORY_PURPLE_SCALE - }, + ACCESSORY_PURPLE_SCALE }, { // Buneary and Happiny ACCESSORY_PINK_SCALE, - ACCESSORY_SHED_HORN, - ACCESSORY_PINK_FLUFF, - ACCESSORY_YELLOW_FEATHER, - ACCESSORY_SHED_CLAW, - ACCESSORY_BLACK_FLUFF, + ACCESSORY_SHED_HORN, + ACCESSORY_PINK_FLUFF, + ACCESSORY_YELLOW_FEATHER, + ACCESSORY_SHED_CLAW, + ACCESSORY_BLACK_FLUFF, - ACCESSORY_SNAGGY_PEBBLE, - ACCESSORY_BIG_LEAF, - ACCESSORY_GREEN_SCALE, + ACCESSORY_SNAGGY_PEBBLE, + ACCESSORY_BIG_LEAF, + ACCESSORY_GREEN_SCALE, - ACCESSORY_BLACK_PEBBLE - }, + ACCESSORY_BLACK_PEBBLE }, }; -BOOL ScrCmd_ClearAmitySquareSteps(struct ScriptContext* ctx) //0215 +BOOL ScrCmd_ClearAmitySquareSteps(struct ScriptContext *ctx) // 0215 { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205F54C(state); return FALSE; } -BOOL ScrCmd_CheckAmitySquareSteps(struct ScriptContext* ctx) //0216 +BOOL ScrCmd_CheckAmitySquareSteps(struct ScriptContext *ctx) // 0216 { - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); *ret_ptr = sub_0205F55C(state); return FALSE; } -BOOL ScrCmd_GetAmitySquareAccessory(struct ScriptContext* ctx) //0217 +BOOL ScrCmd_GetAmitySquareAccessory(struct ScriptContext *ctx) // 0217 { - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 species = ScriptGetVar(ctx); - u16 rand = (u16)(LCRandom() % 100); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 species = ScriptGetVar(ctx); + u16 rand = (u16)(LCRandom() % 100); u32 j; - if (rand < 15) - { + if (rand < 15) { j = 0; - } - else if (rand < 30) - { + } else if (rand < 30) { j = 1; - } - else if (rand < 45) - { + } else if (rand < 45) { j = 2; - } - else if (rand < 60) - { + } else if (rand < 60) { j = 3; - } - else if (rand < 70) - { + } else if (rand < 70) { j = 4; - } - else if (rand < 80) - { + } else if (rand < 80) { j = 5; - } - else if (rand < 88) - { + } else if (rand < 88) { j = 6; - } - else if (rand < 93) - { + } else if (rand < 93) { j = 7; - } - else if (rand < 98) - { + } else if (rand < 98) { j = 8; - } - else - { + } else { j = 9; } u32 i; - switch (species) - { - case SPECIES_CLEFAIRY: - case SPECIES_SKITTY: - i = 0; - break; - case SPECIES_TORCHIC: - case SPECIES_DRIFLOON: - i = 1; - break; - case SPECIES_PSYDUCK: - case SPECIES_PACHIRISU: - i = 2; - break; - case SPECIES_JIGGLYPUFF: - case SPECIES_SHROOMISH: - i = 3; - break; - case SPECIES_PIKACHU: - i = 4; - break; - case SPECIES_BUNEARY: - case SPECIES_HAPPINY: - i = 5; - break; - default: - i = 0; - break; + switch (species) { + case SPECIES_CLEFAIRY: + case SPECIES_SKITTY: + i = 0; + break; + case SPECIES_TORCHIC: + case SPECIES_DRIFLOON: + i = 1; + break; + case SPECIES_PSYDUCK: + case SPECIES_PACHIRISU: + i = 2; + break; + case SPECIES_JIGGLYPUFF: + case SPECIES_SHROOMISH: + i = 3; + break; + case SPECIES_PIKACHU: + i = 4; + break; + case SPECIES_BUNEARY: + case SPECIES_HAPPINY: + i = 5; + break; + default: + i = 0; + break; } *ret_ptr = sAmitySquarePossibleAccessoriesByPokemon[i][j]; diff --git a/arm9/src/scrcmd_berry_trees.c b/arm9/src/scrcmd_berry_trees.c index 0274ade5f..bb33b9910 100644 --- a/arm9/src/scrcmd_berry_trees.c +++ b/arm9/src/scrcmd_berry_trees.c @@ -1,22 +1,23 @@ #include "global.h" + #include "scrcmd.h" #include "unk_02029FB0.h" -extern void* FieldSysGetAttrAddr(struct FieldSystem*, int idx); - -extern u8 sub_0204B5FC(struct FieldSystem*, LocalMapObject *berryTree); -extern void sub_0204B57C(struct FieldSystem*, LocalMapObject *berryTree, u32 mulchVal); -extern u16 sub_0204B63C(struct FieldSystem*, LocalMapObject *berryTree); -extern u16 sub_0204B660(struct FieldSystem*, LocalMapObject *berryTree); -extern u16 sub_0204B684(struct FieldSystem*, LocalMapObject *berryTree); -extern u16 sub_0204B6A4(struct FieldSystem*, LocalMapObject *berryTree); -extern void sub_0204B9CC(struct FieldSystem*); -extern void sub_0204B5A8(struct FieldSystem*, LocalMapObject *berryTree, u16); -extern void sub_0204B9A0(struct FieldSystem*); -extern void sub_0204B4FC(struct FieldSystem*, LocalMapObject *berryTree); - -BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext* ctx) { //017D - u16* ret_ptr = ScriptGetVarPointer(ctx); +extern void *FieldSysGetAttrAddr(struct FieldSystem *, int idx); + +extern u8 sub_0204B5FC(struct FieldSystem *, LocalMapObject *berryTree); +extern void sub_0204B57C(struct FieldSystem *, LocalMapObject *berryTree, u32 mulchVal); +extern u16 sub_0204B63C(struct FieldSystem *, LocalMapObject *berryTree); +extern u16 sub_0204B660(struct FieldSystem *, LocalMapObject *berryTree); +extern u16 sub_0204B684(struct FieldSystem *, LocalMapObject *berryTree); +extern u16 sub_0204B6A4(struct FieldSystem *, LocalMapObject *berryTree); +extern void sub_0204B9CC(struct FieldSystem *); +extern void sub_0204B5A8(struct FieldSystem *, LocalMapObject *berryTree, u16); +extern void sub_0204B9A0(struct FieldSystem *); +extern void sub_0204B4FC(struct FieldSystem *, LocalMapObject *berryTree); + +BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext *ctx) { // 017D + u16 *ret_ptr = ScriptGetVarPointer(ctx); LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); *ret_ptr = sub_0204B5FC(ctx->fieldSystem, *berryTree); @@ -24,56 +25,56 @@ BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext* ctx) { //017D return FALSE; } -BOOL ScrCmd_GetBerryTreeType(struct ScriptContext* ctx) { //017E +BOOL ScrCmd_GetBerryTreeType(struct ScriptContext *ctx) { // 017E LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = sub_0204B63C(ctx->fieldSystem, *berryTree); return FALSE; } -BOOL ScrCmd_GetBerryTreeMulch(struct ScriptContext* ctx) { //017F +BOOL ScrCmd_GetBerryTreeMulch(struct ScriptContext *ctx) { // 017F LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = sub_0204B660(ctx->fieldSystem, *berryTree); return FALSE; } -BOOL ScrCmd_GetBerryTreeWater(struct ScriptContext* ctx) { //0180 +BOOL ScrCmd_GetBerryTreeWater(struct ScriptContext *ctx) { // 0180 LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = sub_0204B684(ctx->fieldSystem, *berryTree); return FALSE; } -BOOL ScrCmd_GetBerryTreeAmount(struct ScriptContext* ctx) { //0181 +BOOL ScrCmd_GetBerryTreeAmount(struct ScriptContext *ctx) { // 0181 LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = sub_0204B6A4(ctx->fieldSystem, *berryTree); return FALSE; } -BOOL ScrCmd_SetBerryTreeMulch(struct ScriptContext* ctx) { //0182 +BOOL ScrCmd_SetBerryTreeMulch(struct ScriptContext *ctx) { // 0182 LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - u16 mulchVal = ScriptGetVar(ctx); + u16 mulchVal = ScriptGetVar(ctx); sub_0204B57C(ctx->fieldSystem, *berryTree, mulchVal); return FALSE; } -BOOL ScrCmd_SetBerryTreeType(struct ScriptContext* ctx) //0183 - todo: PlantBerryTree? +BOOL ScrCmd_SetBerryTreeType(struct ScriptContext *ctx) // 0183 - todo: PlantBerryTree? { - LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); - struct GameStats* gameStats = Save_GameStats_Get(ctx->fieldSystem->saveData); - u16 treeType = ScriptGetVar(ctx); + LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); + struct GameStats *gameStats = Save_GameStats_Get(ctx->fieldSystem->saveData); + u16 treeType = ScriptGetVar(ctx); sub_0204B5A8(ctx->fieldSystem, *berryTree, treeType); GameStats_Inc(gameStats, 3); @@ -81,12 +82,11 @@ BOOL ScrCmd_SetBerryTreeType(struct ScriptContext* ctx) //0183 - todo: PlantBerr return FALSE; } -BOOL ScrCmd_Unk0184(struct ScriptContext* ctx) //0184 - todo: SetBerryTreeWater/WaterBerryTree, or just the animation? +BOOL ScrCmd_Unk0184(struct ScriptContext *ctx) // 0184 - todo: SetBerryTreeWater/WaterBerryTree, or just the animation? { u16 unk = ScriptReadHalfword(ctx); - switch (unk) - { + switch (unk) { case 0: sub_0204B9A0(ctx->fieldSystem); break; @@ -101,10 +101,10 @@ BOOL ScrCmd_Unk0184(struct ScriptContext* ctx) //0184 - todo: SetBerryTreeWater/ return TRUE; } -BOOL ScrCmd_TakeBerryTreeBerries(struct ScriptContext* ctx) //0185 +BOOL ScrCmd_TakeBerryTreeBerries(struct ScriptContext *ctx) // 0185 { - struct GameStats* gameStats = Save_GameStats_Get(ctx->fieldSystem->saveData); - LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); + struct GameStats *gameStats = Save_GameStats_Get(ctx->fieldSystem->saveData); + LocalMapObject **berryTree = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_LAST_INTERACTED); sub_0204B4FC(ctx->fieldSystem, *berryTree); GameStats_AddSpecial(gameStats, 0); diff --git a/arm9/src/scrcmd_coins.c b/arm9/src/scrcmd_coins.c index ea061b3b5..1478b617d 100644 --- a/arm9/src/scrcmd_coins.c +++ b/arm9/src/scrcmd_coins.c @@ -1,27 +1,28 @@ #include "global.h" -#include "scrcmd.h" + #include "coins.h" +#include "scrcmd.h" -extern void * FieldSysGetAttrAddr(struct FieldSystem* arg, u8 idx); +extern void *FieldSysGetAttrAddr(struct FieldSystem *arg, u8 idx); -extern Window *ov05_021E2950(struct FieldSystem* arg, u8 xVal, u8 yVal); +extern Window *ov05_021E2950(struct FieldSystem *arg, u8 xVal, u8 yVal); extern void ov05_021E29B4(Window *coinBox); extern void ov05_021E29C8(struct FieldSystem *arg, Window *coinBox); -BOOL ScrCmd_ShowCoinBox(struct ScriptContext * ctx) //0075 +BOOL ScrCmd_ShowCoinBox(struct ScriptContext *ctx) // 0075 { - struct FieldSystem* sav_ptr = ctx->fieldSystem; - u16 xVal = ScriptGetVar(ctx); - u16 yVal = ScriptGetVar(ctx); - Window **coinBoxPtr = (Window **)FieldSysGetAttrAddr(sav_ptr, SCRIPTENV_COIN_BOX); + struct FieldSystem *sav_ptr = ctx->fieldSystem; + u16 xVal = ScriptGetVar(ctx); + u16 yVal = ScriptGetVar(ctx); + Window **coinBoxPtr = (Window **)FieldSysGetAttrAddr(sav_ptr, SCRIPTENV_COIN_BOX); Window *coinBox = ov05_021E2950(ctx->fieldSystem, (u8)xVal, (u8)yVal); - *coinBoxPtr = coinBox; + *coinBoxPtr = coinBox; return FALSE; } -BOOL ScrCmd_HideCoinBox(struct ScriptContext * ctx) //0076 +BOOL ScrCmd_HideCoinBox(struct ScriptContext *ctx) // 0076 { Window **coinBoxPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_COIN_BOX); ov05_021E29B4(*coinBoxPtr); @@ -29,7 +30,7 @@ BOOL ScrCmd_HideCoinBox(struct ScriptContext * ctx) //0076 return FALSE; } -BOOL ScrCmd_UpdateCoinBox(struct ScriptContext * ctx) //0077 +BOOL ScrCmd_UpdateCoinBox(struct ScriptContext *ctx) // 0077 { Window **coinBoxPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_COIN_BOX); ov05_021E29C8(ctx->fieldSystem, *coinBoxPtr); @@ -37,99 +38,93 @@ BOOL ScrCmd_UpdateCoinBox(struct ScriptContext * ctx) //0077 return FALSE; } -BOOL ScrCmd_GetCoins(struct ScriptContext * ctx) //0078 - todo: CheckCoins instead? +BOOL ScrCmd_GetCoins(struct ScriptContext *ctx) // 0078 - todo: CheckCoins instead? { - u16 * coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); - u16 * ret_ptr = ScriptGetVarPointer(ctx); + u16 *coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = CheckCoins(coins_ptr); return FALSE; } -BOOL ScrCmd_GiveCoins(struct ScriptContext * ctx) //0079 +BOOL ScrCmd_GiveCoins(struct ScriptContext *ctx) // 0079 { - u16 * coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); - u16 amount = ScriptGetVar(ctx); + u16 *coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); + u16 amount = ScriptGetVar(ctx); GiveCoins(coins_ptr, amount); return FALSE; } -BOOL ScrCmd_TakeCoinsImmediate(struct ScriptContext * ctx) //0080 - todo: TakeCoins instead? +BOOL ScrCmd_TakeCoinsImmediate(struct ScriptContext *ctx) // 0080 - todo: TakeCoins instead? { - u16 * coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); - u16 amount = ScriptGetVar(ctx); + u16 *coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); + u16 amount = ScriptGetVar(ctx); TakeCoins(coins_ptr, amount); return FALSE; } -BOOL ScrCmd_TakeCoinsAddress(struct ScriptContext * ctx) //02A8 - todo: TakeCoinsVar instead? +BOOL ScrCmd_TakeCoinsAddress(struct ScriptContext *ctx) // 02A8 - todo: TakeCoinsVar instead? { - u16 * coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); - u16 * amount = ScriptGetVarPointer(ctx); + u16 *coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); + u16 *amount = ScriptGetVarPointer(ctx); TakeCoins(coins_ptr, *amount); return FALSE; } -BOOL ScrCmd_HasEnoughCoinsImmediate(struct ScriptContext * ctx) //0274 - todo: CanAffordCoins? +BOOL ScrCmd_HasEnoughCoinsImmediate(struct ScriptContext *ctx) // 0274 - todo: CanAffordCoins? { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - struct SaveData * save = FieldSystem_GetSaveData(fieldSystem); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + struct SaveData *save = FieldSystem_GetSaveData(fieldSystem); // Created, but discarded. - PlayerProfile * player = Save_PlayerData_GetProfileAddr(save); - u16 * coins_ptr = Save_PlayerData_GetCoinsAddr(fieldSystem->saveData); - u16 * ret_ptr = ScriptGetVarPointer(ctx); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); + u16 *coins_ptr = Save_PlayerData_GetCoinsAddr(fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); u32 amount = ScriptReadWord(ctx); - u16 coins = CheckCoins(coins_ptr); + u16 coins = CheckCoins(coins_ptr); - if (coins < amount) - { + if (coins < amount) { *ret_ptr = 0; - } - else - { + } else { *ret_ptr = 1; } return FALSE; } -BOOL ScrCmd_HasEnoughCoinsAddress(struct ScriptContext * ctx) //02A9 - todo: CanAffordCoinsVar? +BOOL ScrCmd_HasEnoughCoinsAddress(struct ScriptContext *ctx) // 02A9 - todo: CanAffordCoinsVar? { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - struct SaveData * save = FieldSystem_GetSaveData(fieldSystem); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + struct SaveData *save = FieldSystem_GetSaveData(fieldSystem); // Created, but discarded - PlayerProfile * player = Save_PlayerData_GetProfileAddr(save); - u16 * coins_ptr = Save_PlayerData_GetCoinsAddr(fieldSystem->saveData); - u16 * ret_ptr = ScriptGetVarPointer(ctx); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); + u16 *coins_ptr = Save_PlayerData_GetCoinsAddr(fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); u16 amount = *ScriptGetVarPointer(ctx); - u16 coins = CheckCoins(coins_ptr); + u16 coins = CheckCoins(coins_ptr); - if (coins < amount) - { + if (coins < amount) { *ret_ptr = 0; - } - else - { + } else { *ret_ptr = 1; } return FALSE; } -BOOL ScrCmd_CanGiveCoins(struct ScriptContext * ctx) //0276 +BOOL ScrCmd_CanGiveCoins(struct ScriptContext *ctx) // 0276 { - u16 * coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); - u16 * ret_ptr = ScriptGetVarPointer(ctx); - u16 amount = ScriptGetVar(ctx); + u16 *coins_ptr = Save_PlayerData_GetCoinsAddr(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 amount = ScriptGetVar(ctx); *ret_ptr = (u16)CanGiveCoins(coins_ptr, amount); diff --git a/arm9/src/scrcmd_daycare.c b/arm9/src/scrcmd_daycare.c index 33ac5e36e..4f48cccf6 100644 --- a/arm9/src/scrcmd_daycare.c +++ b/arm9/src/scrcmd_daycare.c @@ -1,193 +1,194 @@ #include "global.h" -#include "scrcmd.h" + #include "daycare.h" -#include "party.h" #include "message_format.h" +#include "party.h" +#include "scrcmd.h" -extern void* FieldSysGetAttrAddr(struct FieldSystem*, int idx); +extern void *FieldSysGetAttrAddr(struct FieldSystem *, int idx); -extern void ov05_021EC57C(struct Party* party, u8 idx, struct Daycare* daycare, struct SaveData* save); -extern u16 ov05_021EC71C(struct Party* party, MessageFormat *messageFormat, struct Daycare* daycare, u8 idx); -extern u16 ov05_021EC854(struct Daycare* daycare, u8 idx, MessageFormat *messageFormat); -extern u8 ov05_021EC864(struct Daycare* daycare, int idx, MessageFormat *messageFormat); -extern void ov05_021ECD64(struct Daycare* daycare); -extern void ov05_Daycare_GiveEggToPlayer(struct Daycare* daycare, struct Party* party, PlayerProfile* player); -extern void ov05_021ED4E0(struct Daycare* daycare, MessageFormat *messageFormat); -extern void ov05_021ED52C(struct Daycare* daycare, u8 idx1, u8 idx2, u8 idx3, u8 idx4, MessageFormat *messageFormat); -extern u16 ov05_021ED5C4(struct Party* party, int idx, MessageFormat *messageFormat); -extern u16 ov05_021ED5EC(struct Daycare* daycare); -extern u32 ov05_021ED644(struct Daycare* daycare); +extern void ov05_021EC57C(struct Party *party, u8 idx, struct Daycare *daycare, struct SaveData *save); +extern u16 ov05_021EC71C(struct Party *party, MessageFormat *messageFormat, struct Daycare *daycare, u8 idx); +extern u16 ov05_021EC854(struct Daycare *daycare, u8 idx, MessageFormat *messageFormat); +extern u8 ov05_021EC864(struct Daycare *daycare, int idx, MessageFormat *messageFormat); +extern void ov05_021ECD64(struct Daycare *daycare); +extern void ov05_Daycare_GiveEggToPlayer(struct Daycare *daycare, struct Party *party, PlayerProfile *player); +extern void ov05_021ED4E0(struct Daycare *daycare, MessageFormat *messageFormat); +extern void ov05_021ED52C(struct Daycare *daycare, u8 idx1, u8 idx2, u8 idx3, u8 idx4, MessageFormat *messageFormat); +extern u16 ov05_021ED5C4(struct Party *party, int idx, MessageFormat *messageFormat); +extern u16 ov05_021ED5EC(struct Daycare *daycare); +extern u32 ov05_021ED644(struct Daycare *daycare); -BOOL ScrCmd_GetDaycarePokemonNames(struct ScriptContext* ctx) //016D +BOOL ScrCmd_GetDaycarePokemonNames(struct ScriptContext *ctx) // 016D { - struct SaveData* save = ctx->fieldSystem->saveData; + struct SaveData *save = ctx->fieldSystem->saveData; MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - struct Daycare* daycare = Save_Daycare_Get(save); + struct Daycare *daycare = Save_Daycare_Get(save); ov05_021ED4E0(daycare, *messageFormat); return FALSE; } -BOOL ScrCmd_GetDaycareStatus(struct ScriptContext* ctx) //016E +BOOL ScrCmd_GetDaycareStatus(struct ScriptContext *ctx) // 016E { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - struct SaveData* save = fieldSystem->saveData; - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct Daycare* daycare = SaveArray_Get(save, 8); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + struct SaveData *save = fieldSystem->saveData; + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct Daycare *daycare = SaveArray_Get(save, 8); *ret_ptr = ov05_021ED5EC(daycare); return FALSE; } -BOOL ScrCmd_DeleteDaycareEgg(struct ScriptContext* ctx) //01A8 +BOOL ScrCmd_DeleteDaycareEgg(struct ScriptContext *ctx) // 01A8 { - struct Daycare* daycare = SaveArray_Get(ctx->fieldSystem->saveData, 8); + struct Daycare *daycare = SaveArray_Get(ctx->fieldSystem->saveData, 8); ov05_021ECD64(daycare); return FALSE; } -BOOL ScrCmd_GiveDaycareEgg(struct ScriptContext* ctx) //01A9 +BOOL ScrCmd_GiveDaycareEgg(struct ScriptContext *ctx) // 01A9 { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - struct Daycare* daycare = SaveArray_Get(fieldSystem->saveData, 8); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct SaveData* save = FieldSystem_GetSaveData(ctx->fieldSystem); - PlayerProfile* player = Save_PlayerData_GetProfileAddr(save); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + struct Daycare *daycare = SaveArray_Get(fieldSystem->saveData, 8); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct SaveData *save = FieldSystem_GetSaveData(ctx->fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); ov05_Daycare_GiveEggToPlayer(daycare, party, player); return FALSE; } -BOOL ScrCmd_Unk01A4(struct ScriptContext* ctx) //01A4 +BOOL ScrCmd_Unk01A4(struct ScriptContext *ctx) // 01A4 { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - struct SaveData* save = fieldSystem->saveData; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 idx = ScriptGetVar(ctx); - struct Daycare* daycare = SaveArray_Get(save, 8); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); + struct SaveData *save = fieldSystem->saveData; + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 idx = ScriptGetVar(ctx); + struct Daycare *daycare = SaveArray_Get(save, 8); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); *ret_ptr = ov05_021EC71C(party, *messageFormat, daycare, (u8)idx); return FALSE; } -BOOL ScrCmd_Unk01AA(struct ScriptContext* ctx) //01AA +BOOL ScrCmd_Unk01AA(struct ScriptContext *ctx) // 01AA { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - struct SaveData* save = fieldSystem->saveData; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 idx = ScriptGetVar(ctx); - struct Daycare* daycare = SaveArray_Get(save, 8); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); + struct SaveData *save = fieldSystem->saveData; + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 idx = ScriptGetVar(ctx); + struct Daycare *daycare = SaveArray_Get(save, 8); *ret_ptr = ov05_021EC854(daycare, (u8)idx, *messageFormat); return FALSE; } -BOOL ScrCmd_GetDaycareLevel(struct ScriptContext* ctx) //01AE +BOOL ScrCmd_GetDaycareLevel(struct ScriptContext *ctx) // 01AE { - struct SaveData* save = ctx->fieldSystem->saveData; + struct SaveData *save = ctx->fieldSystem->saveData; MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 idx = ScriptGetVar(ctx); - struct Daycare* daycare = SaveArray_Get(save, 8); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 idx = ScriptGetVar(ctx); + struct Daycare *daycare = SaveArray_Get(save, 8); *ret_ptr = ov05_021EC864(daycare, idx, *messageFormat); return FALSE; } -BOOL ScrCmd_Unk01AF(struct ScriptContext* ctx) //01AF +BOOL ScrCmd_Unk01AF(struct ScriptContext *ctx) // 01AF { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u16 unused = ScriptReadHalfword(ctx); - u16 idx = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); + u16 unused = ScriptReadHalfword(ctx); + u16 idx = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); *ret_ptr = ov05_021ED5C4(party, idx, *messageFormat); return FALSE; } -BOOL ScrCmd_Unk01B0(struct ScriptContext* ctx) //01B0 +BOOL ScrCmd_Unk01B0(struct ScriptContext *ctx) // 01B0 { - struct FieldSystem* fieldSystem = ctx->fieldSystem; - struct SaveData* save = fieldSystem->saveData; - u16 idx = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Daycare* daycare = SaveArray_Get(save, 8); + struct FieldSystem *fieldSystem = ctx->fieldSystem; + struct SaveData *save = fieldSystem->saveData; + u16 idx = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Daycare *daycare = SaveArray_Get(save, 8); ov05_021EC57C(party, (u8)idx, daycare, save); return FALSE; } -BOOL ScrCmd_Unk01BC(struct ScriptContext* ctx) //01BC +BOOL ScrCmd_Unk01BC(struct ScriptContext *ctx) // 01BC { - struct SaveData* save = ctx->fieldSystem->saveData; + struct SaveData *save = ctx->fieldSystem->saveData; MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u16 idx1 = ScriptGetVar(ctx); - u16 idx2 = ScriptGetVar(ctx); - u16 idx3 = ScriptGetVar(ctx); - u16 idx4 = ScriptGetVar(ctx); - struct Daycare* daycare = Save_Daycare_Get(save); + u16 idx1 = ScriptGetVar(ctx); + u16 idx2 = ScriptGetVar(ctx); + u16 idx3 = ScriptGetVar(ctx); + u16 idx4 = ScriptGetVar(ctx); + struct Daycare *daycare = Save_Daycare_Get(save); ov05_021ED52C(daycare, (u8)idx1, (u8)idx2, (u8)idx3, (u8)idx4, *messageFormat); return FALSE; } -BOOL ScrCmd_Unk01BE(struct ScriptContext* ctx) //01BE +BOOL ScrCmd_Unk01BE(struct ScriptContext *ctx) // 01BE { - struct SaveData* save = ctx->fieldSystem->saveData; - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct Daycare* daycare = SaveArray_Get(save, 8); + struct SaveData *save = ctx->fieldSystem->saveData; + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct Daycare *daycare = SaveArray_Get(save, 8); *ret_ptr = (u16)ov05_021ED644(daycare); return FALSE; } -BOOL ScrCmd_Unk01BF(struct ScriptContext* ctx) //01BF - todo: SaveEggPID? +BOOL ScrCmd_Unk01BF(struct ScriptContext *ctx) // 01BF - todo: SaveEggPID? { - struct SaveData* save = ctx->fieldSystem->saveData; - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct Daycare* daycare = SaveArray_Get(save, 8); + struct SaveData *save = ctx->fieldSystem->saveData; + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct Daycare *daycare = SaveArray_Get(save, 8); *ret_ptr = (u16)Save_Daycare_GetEggPID(daycare); return FALSE; } -BOOL ScrCmd_Unk01A5(struct ScriptContext* ctx) //01A5 +BOOL ScrCmd_Unk01A5(struct ScriptContext *ctx) // 01A5 { - u16* unused = ScriptGetVarPointer(ctx); + u16 *unused = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_Unk01A6(struct ScriptContext* ctx) //01A6 +BOOL ScrCmd_Unk01A6(struct ScriptContext *ctx) // 01A6 { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Unk01A7(struct ScriptContext* ctx) //01A7 +BOOL ScrCmd_Unk01A7(struct ScriptContext *ctx) // 01A7 { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Unk01AD(struct ScriptContext* ctx) //01AD +BOOL ScrCmd_Unk01AD(struct ScriptContext *ctx) // 01AD { - u16* unused = ScriptGetVarPointer(ctx); + u16 *unused = ScriptGetVarPointer(ctx); return FALSE; } diff --git a/arm9/src/scrcmd_flags.c b/arm9/src/scrcmd_flags.c index 6d8cd2f21..d563823f8 100644 --- a/arm9/src/scrcmd_flags.c +++ b/arm9/src/scrcmd_flags.c @@ -1,119 +1,125 @@ #include "global.h" -#include "scrcmd.h" -#include "save_vars_flags.h" + #include "pokedex.h" +#include "save_vars_flags.h" +#include "scrcmd.h" -extern void* sub_02034E20(void*); -extern void* Save_LocalFieldData_Get(void*); -extern BOOL sub_02055474(void*); -extern void sub_02055488(void*, u32); -extern void sub_0205ECD4(struct SaveVarsFlags* state); -extern BOOL sub_0205ECE0(struct SaveVarsFlags* state); -extern void sub_0205ECFC(struct SaveVarsFlags* state); -extern BOOL sub_0205ED0C(struct SaveVarsFlags* state); -extern void sub_0205ED1C(struct SaveVarsFlags* state); -extern void sub_0205ED2C(struct SaveVarsFlags* state); -extern BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags* state); -extern void sub_0205ED4C(struct SaveVarsFlags* state); -extern void sub_0205ED5C(struct SaveVarsFlags* state); -extern BOOL sub_0205ED6C(struct SaveVarsFlags* state); -extern BOOL sub_0205F264(struct SaveVarsFlags* state, u32); -extern void sub_0205F274(struct SaveVarsFlags* state); -extern void sub_0205F284(struct SaveVarsFlags* state); -extern BOOL sub_0205F294(struct SaveVarsFlags* state); -extern void sub_0205F2A4(struct SaveVarsFlags* state); -extern void sub_0205F2B4(struct SaveVarsFlags* state); -extern BOOL sub_0205F2C4(struct SaveVarsFlags* state); +extern void *sub_02034E20(void *); +extern void *Save_LocalFieldData_Get(void *); +extern BOOL sub_02055474(void *); +extern void sub_02055488(void *, u32); +extern void sub_0205ECD4(struct SaveVarsFlags *state); +extern BOOL sub_0205ECE0(struct SaveVarsFlags *state); +extern void sub_0205ECFC(struct SaveVarsFlags *state); +extern BOOL sub_0205ED0C(struct SaveVarsFlags *state); +extern void sub_0205ED1C(struct SaveVarsFlags *state); +extern void sub_0205ED2C(struct SaveVarsFlags *state); +extern BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags *state); +extern void sub_0205ED4C(struct SaveVarsFlags *state); +extern void sub_0205ED5C(struct SaveVarsFlags *state); +extern BOOL sub_0205ED6C(struct SaveVarsFlags *state); +extern BOOL sub_0205F264(struct SaveVarsFlags *state, u32); +extern void sub_0205F274(struct SaveVarsFlags *state); +extern void sub_0205F284(struct SaveVarsFlags *state); +extern BOOL sub_0205F294(struct SaveVarsFlags *state); +extern void sub_0205F2A4(struct SaveVarsFlags *state); +extern void sub_0205F2B4(struct SaveVarsFlags *state); +extern BOOL sub_0205F2C4(struct SaveVarsFlags *state); const u8 UNK_020F457F[8] = { - 0, 1, 2, 3, 4, 5, 6, 7, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, }; -BOOL ScrCmd_HasSinnohDex(struct ScriptContext* ctx) //0157 +BOOL ScrCmd_HasSinnohDex(struct ScriptContext *ctx) // 0157 { - struct Pokedex* pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); - u16* ret_ptr = ScriptGetVarPointer(ctx); + struct Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = (u16)Pokedex_GetSinnohDexFlag(pokedex); return FALSE; } -BOOL ScrCmd_GiveSinnohDex(struct ScriptContext* ctx) //0158 +BOOL ScrCmd_GiveSinnohDex(struct ScriptContext *ctx) // 0158 { - struct Pokedex* pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); + struct Pokedex *pokedex = Save_Pokedex_Get(ctx->fieldSystem->saveData); Pokedex_SetSinnohDexFlag(pokedex); return FALSE; } -BOOL ScrCmd_HasRunningShoes(struct ScriptContext* ctx) //0159 +BOOL ScrCmd_HasRunningShoes(struct ScriptContext *ctx) // 0159 { - u16* ret_ptr = ScriptGetVarPointer(ctx); - void* unk_sav_ptr = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); - void* unk = sub_02034E20(unk_sav_ptr); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + void *unk_sav_ptr = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); + void *unk = sub_02034E20(unk_sav_ptr); *ret_ptr = (u16)sub_02055474(unk); return FALSE; } -BOOL ScrCmd_GiveRunningShoes(struct ScriptContext* ctx) //015A +BOOL ScrCmd_GiveRunningShoes(struct ScriptContext *ctx) // 015A { - void* unk_sav_ptr = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); - void* unk = sub_02034E20(unk_sav_ptr); + void *unk_sav_ptr = Save_LocalFieldData_Get(ctx->fieldSystem->saveData); + void *unk = sub_02034E20(unk_sav_ptr); sub_02055488(unk, 1); return FALSE; } -BOOL ScrCmd_HasBadge(struct ScriptContext* ctx) //015B +BOOL ScrCmd_HasBadge(struct ScriptContext *ctx) // 015B { u16 badge_no = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); GF_ASSERT(badge_no < 8); - PlayerProfile* player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); *ret_ptr = (u16)PlayerProfile_TestBadgeFlag(player, badge_no); return FALSE; } -BOOL ScrCmd_GiveBadge(struct ScriptContext* ctx) //015C +BOOL ScrCmd_GiveBadge(struct ScriptContext *ctx) // 015C { u16 badge_no = ScriptGetVar(ctx); GF_ASSERT(badge_no < 8); - PlayerProfile* player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); PlayerProfile_SetBadgeFlag(player, badge_no); return FALSE; } -BOOL ScrCmd_HasBag(struct ScriptContext* ctx) //015E +BOOL ScrCmd_HasBag(struct ScriptContext *ctx) // 015E { - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); *ret_ptr = (u16)sub_0205ECE0(state); return FALSE; } -BOOL ScrCmd_GetTotalEarnedBadges(struct ScriptContext* ctx) //015D - todo: CountBadges? +BOOL ScrCmd_GetTotalEarnedBadges(struct ScriptContext *ctx) // 015D - todo: CountBadges? { - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); u16 i; u16 badges; - for (i = 0, badges = 0; i < 8; i++) - { - PlayerProfile* player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); - BOOL has_badge = PlayerProfile_TestBadgeFlag(player, UNK_020F457F[i]); - if (has_badge == TRUE) - { + for (i = 0, badges = 0; i < 8; i++) { + PlayerProfile *player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); + BOOL has_badge = PlayerProfile_TestBadgeFlag(player, UNK_020F457F[i]); + if (has_badge == TRUE) { badges++; } } @@ -122,106 +128,105 @@ BOOL ScrCmd_GetTotalEarnedBadges(struct ScriptContext* ctx) //015D - todo: Count return FALSE; } -BOOL ScrCmd_GiveBag(struct ScriptContext* ctx) //015F +BOOL ScrCmd_GiveBag(struct ScriptContext *ctx) // 015F { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + sub_0205ECD4(state); return FALSE; } -BOOL ScrCmd_Unk0160(struct ScriptContext* ctx) //0160 - todo: HasPartner? CheckPartner? +BOOL ScrCmd_Unk0160(struct ScriptContext *ctx) // 0160 - todo: HasPartner? CheckPartner? { - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); *ret_ptr = (u16)Save_VarsFlags_CheckHaveFollower(state); return FALSE; } -BOOL ScrCmd_Unk0161(struct ScriptContext* ctx) //0161 - todo: GivePartner? SetPartner? +BOOL ScrCmd_Unk0161(struct ScriptContext *ctx) // 0161 - todo: GivePartner? SetPartner? { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205ED1C(state); return FALSE; } -BOOL ScrCmd_Unk0162(struct ScriptContext* ctx) //0162 - todo: RemovePartner? ClearPartner? +BOOL ScrCmd_Unk0162(struct ScriptContext *ctx) // 0162 - todo: RemovePartner? ClearPartner? { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205ED2C(state); return FALSE; } -BOOL ScrCmd_Unk0163(struct ScriptContext* ctx) //0163 - todo: GetSteps? CheckSteps? GetStepFlag? CheckStepFlag? +BOOL ScrCmd_Unk0163(struct ScriptContext *ctx) // 0163 - todo: GetSteps? CheckSteps? GetStepFlag? CheckStepFlag? { - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); *ret_ptr = (u16)sub_0205ED6C(state); return FALSE; } -BOOL ScrCmd_Unk0164(struct ScriptContext* ctx) //0164 - todo: SetStepFlag? +BOOL ScrCmd_Unk0164(struct ScriptContext *ctx) // 0164 - todo: SetStepFlag? { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205ED4C(state); return 0; } -BOOL ScrCmd_Unk0165(struct ScriptContext* ctx) //0165 - todo: ClearStepFlag? +BOOL ScrCmd_Unk0165(struct ScriptContext *ctx) // 0165 - todo: ClearStepFlag? { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205ED5C(state); return 0; } -BOOL ScrCmd_CheckGameCompleted(struct ScriptContext* ctx) //0166 +BOOL ScrCmd_CheckGameCompleted(struct ScriptContext *ctx) // 0166 { - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); *ret_ptr = (u16)sub_0205ED0C(state); return FALSE; } -BOOL ScrCmd_SetGameCompleted(struct ScriptContext* ctx) //0167 +BOOL ScrCmd_SetGameCompleted(struct ScriptContext *ctx) // 0167 { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); sub_0205ECFC(state); return 0; } -BOOL ScrCmd_GetSetStrength(struct ScriptContext* ctx) //01CF - todo: Strength? +BOOL ScrCmd_GetSetStrength(struct ScriptContext *ctx) // 01CF - todo: Strength? { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u8 option = ScriptReadByte(ctx); - u16* ret_ptr; + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u8 option = ScriptReadByte(ctx); + u16 *ret_ptr; - switch (option) - { - case 1: //set strength to on + switch (option) { + case 1: // set strength to on sub_0205F264(state, 1); break; - case 0: //set strength to off + case 0: // set strength to off sub_0205F264(state, 0); break; - case 2: //get whether strength is on or off - ret_ptr = ScriptGetVarPointer(ctx); + case 2: // get whether strength is on or off + ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = (u16)sub_0205F264(state, 2); break; default: @@ -232,22 +237,21 @@ BOOL ScrCmd_GetSetStrength(struct ScriptContext* ctx) //01CF - todo: Strength? return FALSE; } -BOOL ScrCmd_GetSetFlash(struct ScriptContext* ctx) //01D0 - todo Flash? +BOOL ScrCmd_GetSetFlash(struct ScriptContext *ctx) // 01D0 - todo Flash? { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u8 option = ScriptReadByte(ctx); - u16* ret_ptr; + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u8 option = ScriptReadByte(ctx); + u16 *ret_ptr; - switch (option) - { - case 1: //set flash to on + switch (option) { + case 1: // set flash to on sub_0205F274(state); break; - case 0: //set flash to off + case 0: // set flash to off sub_0205F284(state); break; - case 2: //get whether flash is on or off - ret_ptr = ScriptGetVarPointer(ctx); + case 2: // get whether flash is on or off + ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = (u16)sub_0205F294(state); break; default: @@ -258,22 +262,21 @@ BOOL ScrCmd_GetSetFlash(struct ScriptContext* ctx) //01D0 - todo Flash? return FALSE; } -BOOL ScrCmd_GetSetDefog(struct ScriptContext* ctx) //01D1 - todo: Defog +BOOL ScrCmd_GetSetDefog(struct ScriptContext *ctx) // 01D1 - todo: Defog { - struct SaveVarsFlags* state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u8 option = ScriptReadByte(ctx); - u16* ret_ptr; + struct SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u8 option = ScriptReadByte(ctx); + u16 *ret_ptr; - switch (option) - { - case 1: //set defog to on + switch (option) { + case 1: // set defog to on sub_0205F2A4(state); break; - case 0: //set defog to off + case 0: // set defog to off sub_0205F2B4(state); break; - case 2: //get whether defog is on or off - ret_ptr = ScriptGetVarPointer(ctx); + case 2: // get whether defog is on or off + ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = (u16)sub_0205F2C4(state); break; default: diff --git a/arm9/src/scrcmd_fossils.c b/arm9/src/scrcmd_fossils.c index ed9779586..d6041dd41 100644 --- a/arm9/src/scrcmd_fossils.c +++ b/arm9/src/scrcmd_fossils.c @@ -1,18 +1,19 @@ #include "global.h" -#include "scrcmd.h" + #include "bag.h" +#include "scrcmd.h" const u16 gFossilPokemonMap[7][2] = { { ITEM_OLD_AMBER, SPECIES_AERODACTYL }, - { ITEM_HELIX_FOSSIL, SPECIES_OMANYTE }, - { ITEM_DOME_FOSSIL, SPECIES_KABUTO }, - { ITEM_ROOT_FOSSIL, SPECIES_LILEEP }, - { ITEM_CLAW_FOSSIL, SPECIES_ANORITH }, - { ITEM_ARMOR_FOSSIL, SPECIES_SHIELDON }, - { ITEM_SKULL_FOSSIL, SPECIES_CRANIDOS }, + { ITEM_HELIX_FOSSIL, SPECIES_OMANYTE }, + { ITEM_DOME_FOSSIL, SPECIES_KABUTO }, + { ITEM_ROOT_FOSSIL, SPECIES_LILEEP }, + { ITEM_CLAW_FOSSIL, SPECIES_ANORITH }, + { ITEM_ARMOR_FOSSIL, SPECIES_SHIELDON }, + { ITEM_SKULL_FOSSIL, SPECIES_CRANIDOS }, }; -BOOL ScrCmd_CountFossils(struct ScriptContext * ctx) //01F1 +BOOL ScrCmd_CountFossils(struct ScriptContext *ctx) // 01F1 { struct FieldSystem *fieldSystem = ctx->fieldSystem; @@ -20,8 +21,7 @@ BOOL ScrCmd_CountFossils(struct ScriptContext * ctx) //01F1 u8 i; u16 total; - for (i = 0, total = 0; i < 7; i++) - { + for (i = 0, total = 0; i < 7; i++) { total += Bag_GetQuantity(Save_Bag_Get(fieldSystem->saveData), gFossilPokemonMap[i][0], HEAP_ID_4); } @@ -29,17 +29,15 @@ BOOL ScrCmd_CountFossils(struct ScriptContext * ctx) //01F1 return FALSE; } -BOOL ScrCmd_GetFossilPokemon(struct ScriptContext * ctx) //01F4 +BOOL ScrCmd_GetFossilPokemon(struct ScriptContext *ctx) // 01F4 { u16 *ret_ptr = ScriptGetVarPointer(ctx); u16 fossilId = ScriptGetVar(ctx); *ret_ptr = 0; - for (u16 i = 0; i < 7; i++) - { - if (gFossilPokemonMap[i][0] == fossilId) - { + for (u16 i = 0; i < 7; i++) { + if (gFossilPokemonMap[i][0] == fossilId) { *ret_ptr = gFossilPokemonMap[i][1]; break; } @@ -48,23 +46,21 @@ BOOL ScrCmd_GetFossilPokemon(struct ScriptContext * ctx) //01F4 return FALSE; } -BOOL ScrCmd_GetFossilMinimumAmount(struct ScriptContext * ctx) //01F5 +BOOL ScrCmd_GetFossilMinimumAmount(struct ScriptContext *ctx) // 01F5 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 * ret_ptr1 = ScriptGetVarPointer(ctx); - u16 * ret_ptr2 = ScriptGetVarPointer(ctx); - u16 needed_amount = ScriptGetVar(ctx); + u16 *ret_ptr1 = ScriptGetVarPointer(ctx); + u16 *ret_ptr2 = ScriptGetVarPointer(ctx); + u16 needed_amount = ScriptGetVar(ctx); *ret_ptr1 = 0; *ret_ptr2 = 0; - u8 i = 0; + u8 i = 0; u16 total = 0; - for (; i < 7; i++) - { + for (; i < 7; i++) { total += Bag_GetQuantity(Save_Bag_Get(fieldSystem->saveData), gFossilPokemonMap[i][0], HEAP_ID_4); - if (total >= needed_amount) - { + if (total >= needed_amount) { *ret_ptr1 = gFossilPokemonMap[i][0]; *ret_ptr2 = i; break; @@ -74,13 +70,13 @@ BOOL ScrCmd_GetFossilMinimumAmount(struct ScriptContext * ctx) //01F5 return FALSE; } -BOOL ScrCmd_Unk01F2(struct ScriptContext * ctx) //01F2 +BOOL ScrCmd_Unk01F2(struct ScriptContext *ctx) // 01F2 { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Unk01F3(struct ScriptContext * ctx) //01F3 +BOOL ScrCmd_Unk01F3(struct ScriptContext *ctx) // 01F3 { #pragma unused(ctx) return FALSE; diff --git a/arm9/src/scrcmd_items.c b/arm9/src/scrcmd_items.c index 8c534a8b6..2699dd477 100644 --- a/arm9/src/scrcmd_items.c +++ b/arm9/src/scrcmd_items.c @@ -1,96 +1,97 @@ #include "global.h" -#include "scrcmd.h" + #include "bag.h" +#include "scrcmd.h" extern BOOL sub_02054CB0(u16 item_id); -BOOL ScrCmd_GiveItem(struct ScriptContext* ctx) //007B +BOOL ScrCmd_GiveItem(struct ScriptContext *ctx) // 007B { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 item_id = ScriptGetVar(ctx); - u16 quantity = ScriptGetVar(ctx); - u16* item_was_added = ScriptGetVarPointer(ctx); - struct Bag* bag = Save_Bag_Get(fieldSystem->saveData); + u16 item_id = ScriptGetVar(ctx); + u16 quantity = ScriptGetVar(ctx); + u16 *item_was_added = ScriptGetVarPointer(ctx); + struct Bag *bag = Save_Bag_Get(fieldSystem->saveData); *item_was_added = (u16)Bag_AddItem(bag, item_id, quantity, HEAP_ID_4); return FALSE; } -BOOL ScrCmd_TakeItem(struct ScriptContext* ctx) //007C +BOOL ScrCmd_TakeItem(struct ScriptContext *ctx) // 007C { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 item_id = ScriptGetVar(ctx); - u16 quantity = ScriptGetVar(ctx); - u16* item_was_taken = ScriptGetVarPointer(ctx); - struct Bag* bag = Save_Bag_Get(fieldSystem->saveData); + u16 item_id = ScriptGetVar(ctx); + u16 quantity = ScriptGetVar(ctx); + u16 *item_was_taken = ScriptGetVarPointer(ctx); + struct Bag *bag = Save_Bag_Get(fieldSystem->saveData); *item_was_taken = (u16)Bag_TakeItem(bag, item_id, quantity, HEAP_ID_4); return FALSE; } -BOOL ScrCmd_HasSpaceForItem(struct ScriptContext* ctx) //007D +BOOL ScrCmd_HasSpaceForItem(struct ScriptContext *ctx) // 007D { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 item_id = ScriptGetVar(ctx); - u16 quantity = ScriptGetVar(ctx); - u16* has_space = ScriptGetVarPointer(ctx); - struct Bag* bag = Save_Bag_Get(fieldSystem->saveData); + u16 item_id = ScriptGetVar(ctx); + u16 quantity = ScriptGetVar(ctx); + u16 *has_space = ScriptGetVarPointer(ctx); + struct Bag *bag = Save_Bag_Get(fieldSystem->saveData); *has_space = (u16)Bag_HasSpaceForItem(bag, item_id, quantity, HEAP_ID_4); return FALSE; } -BOOL ScrCmd_HasItem(struct ScriptContext* ctx) //007E +BOOL ScrCmd_HasItem(struct ScriptContext *ctx) // 007E { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 item_id = ScriptGetVar(ctx); - u16 quantity = ScriptGetVar(ctx); - u16* has_item = ScriptGetVarPointer(ctx); - struct Bag* bag = Save_Bag_Get(fieldSystem->saveData); + u16 item_id = ScriptGetVar(ctx); + u16 quantity = ScriptGetVar(ctx); + u16 *has_item = ScriptGetVarPointer(ctx); + struct Bag *bag = Save_Bag_Get(fieldSystem->saveData); *has_item = (u16)Bag_HasItem(bag, item_id, quantity, HEAP_ID_FIELD); return FALSE; } -BOOL ScrCmd_ItemIdIsTMOrHM(struct ScriptContext* ctx) //007F +BOOL ScrCmd_ItemIdIsTMOrHM(struct ScriptContext *ctx) // 007F { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 item_id = ScriptGetVar(ctx); - u16* is_tm_or_hm = ScriptGetVarPointer(ctx); + u16 item_id = ScriptGetVar(ctx); + u16 *is_tm_or_hm = ScriptGetVarPointer(ctx); *is_tm_or_hm = (u16)sub_02054CB0(item_id); return FALSE; } -BOOL ScrCmd_GetItemPocketId(struct ScriptContext* ctx) //0080 +BOOL ScrCmd_GetItemPocketId(struct ScriptContext *ctx) // 0080 { struct FieldSystem *fieldSystem = ctx->fieldSystem; u16 item_id = ScriptGetVar(ctx); - u16* pocket = ScriptGetVarPointer(ctx); + u16 *pocket = ScriptGetVarPointer(ctx); *pocket = (u16)GetItemAttr(item_id, ITEMATTR_POCKET, HEAP_ID_FIELD); return FALSE; } -BOOL ScrCmd_Unk0081(struct ScriptContext* ctx) //0081 - todo: DummyGiveItem? +BOOL ScrCmd_Unk0081(struct ScriptContext *ctx) // 0081 - todo: DummyGiveItem? { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Unk0082(struct ScriptContext* ctx) //0082 - todo: DummyHasItem? +BOOL ScrCmd_Unk0082(struct ScriptContext *ctx) // 0082 - todo: DummyHasItem? { #pragma unused(ctx) return FALSE; diff --git a/arm9/src/scrcmd_mart.c b/arm9/src/scrcmd_mart.c index 7c7d7d5b3..21a0e57d9 100644 --- a/arm9/src/scrcmd_mart.c +++ b/arm9/src/scrcmd_mart.c @@ -1,9 +1,11 @@ #include "global.h" + +#include "constants/decorations.h" #include "constants/items.h" #include "constants/seal_constants.h" -#include "constants/decorations.h" -#include "scrcmd.h" + #include "overlay_06.h" +#include "scrcmd.h" extern void sub_02038AD0(TaskManager *); @@ -281,30 +283,30 @@ static const u16 UNK_020F41FE[] = { static const u16 sNormalMartBadgeThresholds[][2] = { // Balls - {ITEM_POKE_BALL, 1}, - {ITEM_GREAT_BALL, 3}, - {ITEM_ULTRA_BALL, 4}, + { ITEM_POKE_BALL, 1 }, + { ITEM_GREAT_BALL, 3 }, + { ITEM_ULTRA_BALL, 4 }, // Potions - {ITEM_POTION, 1}, - {ITEM_SUPER_POTION, 2}, - {ITEM_HYPER_POTION, 4}, - {ITEM_MAX_POTION, 5}, - {ITEM_FULL_RESTORE, 6}, + { ITEM_POTION, 1 }, + { ITEM_SUPER_POTION, 2 }, + { ITEM_HYPER_POTION, 4 }, + { ITEM_MAX_POTION, 5 }, + { ITEM_FULL_RESTORE, 6 }, // Revives - {ITEM_REVIVE, 3}, + { ITEM_REVIVE, 3 }, // Status heal - {ITEM_ANTIDOTE, 1}, - {ITEM_PARLYZ_HEAL, 1}, - {ITEM_AWAKENING, 2}, - {ITEM_BURN_HEAL, 2}, - {ITEM_ICE_HEAL, 2}, - {ITEM_FULL_HEAL, 4}, + { ITEM_ANTIDOTE, 1 }, + { ITEM_PARLYZ_HEAL, 1 }, + { ITEM_AWAKENING, 2 }, + { ITEM_BURN_HEAL, 2 }, + { ITEM_ICE_HEAL, 2 }, + { ITEM_FULL_HEAL, 4 }, // Dungeon items - {ITEM_ESCAPE_ROPE, 2}, + { ITEM_ESCAPE_ROPE, 2 }, // Repels - {ITEM_REPEL, 2}, - {ITEM_SUPER_REPEL, 3}, - {ITEM_MAX_REPEL, 4}, + { ITEM_REPEL, 2 }, + { ITEM_SUPER_REPEL, 3 }, + { ITEM_MAX_REPEL, 4 }, }; const u16 *sDecorationMartPointers[] = { @@ -344,51 +346,48 @@ const u16 *sSealsMartPointers[] = { UNK_020F41B2, }; -BOOL ScrCmd_NormalMart(ScriptContext *ctx) //0147 - todo: Pokemart? +BOOL ScrCmd_NormalMart(ScriptContext *ctx) // 0147 - todo: Pokemart? { u16 whichMart = ScriptGetVar(ctx); s32 param; u16 martItems[64]; - u8 martIdx = 0; + u8 martIdx = 0; u8 badgeCount = 0; u8 i; - for (i = 0; i < 8; i++) - { - if (PlayerProfile_TestBadgeFlag(Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData), i) == TRUE) + for (i = 0; i < 8; i++) { + if (PlayerProfile_TestBadgeFlag(Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData), i) == TRUE) { badgeCount++; + } } - switch (badgeCount) - { - case 0: - param = 1; - break; - case 1: - case 2: - param = 2; - break; - case 3: - case 4: - param = 3; - break; - case 5: - case 6: - param = 4; - break; - case 7: - param = 5; - break; - case 8: - param = 6; - break; - default: - param = 1; - break; + switch (badgeCount) { + case 0: + param = 1; + break; + case 1: + case 2: + param = 2; + break; + case 3: + case 4: + param = 3; + break; + case 5: + case 6: + param = 4; + break; + case 7: + param = 5; + break; + case 8: + param = 6; + break; + default: + param = 1; + break; } - for (i = 0; i < NELEMS(sNormalMartBadgeThresholds); i++) - { - if (param >= sNormalMartBadgeThresholds[i][1]) - { + for (i = 0; i < NELEMS(sNormalMartBadgeThresholds); i++) { + if (param >= sNormalMartBadgeThresholds[i][1]) { martItems[martIdx] = sNormalMartBadgeThresholds[i][0]; martIdx++; } @@ -398,36 +397,38 @@ BOOL ScrCmd_NormalMart(ScriptContext *ctx) //0147 - todo: Pokemart? return TRUE; } -BOOL ScrCmd_SpecialMart(ScriptContext *ctx) //0148 +BOOL ScrCmd_SpecialMart(ScriptContext *ctx) // 0148 { u16 whichMart = ScriptGetVar(ctx); u32 sp0; // Fakematch? - if ((u16)(whichMart + (u16)(-8u)) <= 5) + if ((u16)(whichMart + (u16)(-8u)) <= 5) { sp0 = 1; - else + } else { sp0 = 0; + } ov06_0223D3D0(ctx->taskManager, ctx->fieldSystem, sSpecialMartPointers[whichMart], MART_ITEMS, sp0); return TRUE; } -BOOL ScrCmd_GoodsMart(ScriptContext *ctx) //0149 +BOOL ScrCmd_GoodsMart(ScriptContext *ctx) // 0149 { u16 whichMart = ScriptGetVar(ctx); u32 sp0; - if (whichMart <= 1) + if (whichMart <= 1) { sp0 = 1; - else + } else { sp0 = 0; + } ov06_0223D3D0(ctx->taskManager, ctx->fieldSystem, sDecorationMartPointers[whichMart], MART_DECORATIONS, sp0); return TRUE; } -BOOL ScrCmd_SealsMart(ScriptContext *ctx) //014A +BOOL ScrCmd_SealsMart(ScriptContext *ctx) // 014A { u16 whichMart = ScriptGetVar(ctx); @@ -435,7 +436,7 @@ BOOL ScrCmd_SealsMart(ScriptContext *ctx) //014A return TRUE; } -BOOL ScrCmd_AccessoriesShop(ScriptContext *ctx) //0257 - todo: Unsure if this is correct, SDSME has it as SprtSave? +BOOL ScrCmd_AccessoriesShop(ScriptContext *ctx) // 0257 - todo: Unsure if this is correct, SDSME has it as SprtSave? { sub_02038AD0(ctx->fieldSystem->taskManager); return TRUE; diff --git a/arm9/src/scrcmd_money.c b/arm9/src/scrcmd_money.c index 5985c300d..52dbf0c94 100644 --- a/arm9/src/scrcmd_money.c +++ b/arm9/src/scrcmd_money.c @@ -1,17 +1,18 @@ #include "global.h" -#include "scrcmd.h" + #include "player_data.h" +#include "scrcmd.h" -extern void * FieldSysGetAttrAddr(struct FieldSystem *fieldSystem, u8 idx); +extern void *FieldSysGetAttrAddr(struct FieldSystem *fieldSystem, u8 idx); extern Window *ov05_021E27E8(struct FieldSystem *fieldSystem, u8 xVal, u8 yVal); extern void ov05_021E288C(Window *moneyBox); extern void ov05_021E28A0(struct FieldSystem *fieldSystem, Window *moneyBox); -BOOL ScrCmd_GiveMoney(struct ScriptContext * ctx) //006F +BOOL ScrCmd_GiveMoney(struct ScriptContext *ctx) // 006F { - struct SaveData * save = FieldSystem_GetSaveData(ctx->fieldSystem); - PlayerProfile * player = Save_PlayerData_GetProfileAddr(save); + struct SaveData *save = FieldSystem_GetSaveData(ctx->fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); u32 amount = ScriptReadWord(ctx); PlayerProfile_AddMoney(player, amount); @@ -19,10 +20,10 @@ BOOL ScrCmd_GiveMoney(struct ScriptContext * ctx) //006F return FALSE; } -BOOL ScrCmd_TakeMoneyImmediate(struct ScriptContext * ctx) //0070 - todo: TakeMoney? +BOOL ScrCmd_TakeMoneyImmediate(struct ScriptContext *ctx) // 0070 - todo: TakeMoney? { - struct SaveData * save = FieldSystem_GetSaveData(ctx->fieldSystem); - PlayerProfile * player = Save_PlayerData_GetProfileAddr(save); + struct SaveData *save = FieldSystem_GetSaveData(ctx->fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); u32 amount = ScriptReadWord(ctx); PlayerProfile_SubMoney(player, amount); @@ -30,10 +31,10 @@ BOOL ScrCmd_TakeMoneyImmediate(struct ScriptContext * ctx) //0070 - todo: TakeMo return FALSE; } -BOOL ScrCmd_TakeMoneyAddress(struct ScriptContext * ctx) //01A3 - todo: TakeMoneyVar? +BOOL ScrCmd_TakeMoneyAddress(struct ScriptContext *ctx) // 01A3 - todo: TakeMoneyVar? { - struct SaveData * save = FieldSystem_GetSaveData(ctx->fieldSystem); - PlayerProfile * player = Save_PlayerData_GetProfileAddr(save); + struct SaveData *save = FieldSystem_GetSaveData(ctx->fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); u16 amount = ScriptGetVar(ctx); PlayerProfile_SubMoney(player, (u32)amount); @@ -41,61 +42,55 @@ BOOL ScrCmd_TakeMoneyAddress(struct ScriptContext * ctx) //01A3 - todo: TakeMone return FALSE; } -BOOL ScrCmd_HasEnoughMoneyImmediate(struct ScriptContext * ctx) //0071 - todo: CanAffordMoney? +BOOL ScrCmd_HasEnoughMoneyImmediate(struct ScriptContext *ctx) // 0071 - todo: CanAffordMoney? { - struct SaveData * save = FieldSystem_GetSaveData(ctx->fieldSystem); - PlayerProfile * player = Save_PlayerData_GetProfileAddr(save); - u16 * ret_ptr = ScriptGetVarPointer(ctx); + struct SaveData *save = FieldSystem_GetSaveData(ctx->fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); + u16 *ret_ptr = ScriptGetVarPointer(ctx); u32 amount = ScriptReadWord(ctx); - u32 money = PlayerProfile_GetMoney(player); + u32 money = PlayerProfile_GetMoney(player); - if (money < amount) - { + if (money < amount) { *ret_ptr = 0; - } - else - { + } else { *ret_ptr = 1; } return FALSE; } -BOOL ScrCmd_HasEnoughMoneyAddress(struct ScriptContext * ctx) //01AB - todo: CanAffordMoneyVar? +BOOL ScrCmd_HasEnoughMoneyAddress(struct ScriptContext *ctx) // 01AB - todo: CanAffordMoneyVar? { - struct SaveData * save = FieldSystem_GetSaveData(ctx->fieldSystem); - PlayerProfile * player = Save_PlayerData_GetProfileAddr(save); - u16 * ret_ptr = ScriptGetVarPointer(ctx); + struct SaveData *save = FieldSystem_GetSaveData(ctx->fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); + u16 *ret_ptr = ScriptGetVarPointer(ctx); u16 amount = ScriptGetVar(ctx); - u32 money = PlayerProfile_GetMoney(player); + u32 money = PlayerProfile_GetMoney(player); - if (money < amount) - { + if (money < amount) { *ret_ptr = 0; - } - else - { + } else { *ret_ptr = 1; } return FALSE; } -BOOL ScrCmd_ShowMoneyBox(struct ScriptContext * ctx) //0072 +BOOL ScrCmd_ShowMoneyBox(struct ScriptContext *ctx) // 0072 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 xVal = ScriptGetVar(ctx); - u16 yVal = ScriptGetVar(ctx); - Window **moneyBox = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MONEY_BOX); + u16 xVal = ScriptGetVar(ctx); + u16 yVal = ScriptGetVar(ctx); + Window **moneyBox = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MONEY_BOX); *moneyBox = ov05_021E27E8(ctx->fieldSystem, (u8)xVal, (u8)yVal); return FALSE; } -BOOL ScrCmd_HideMoneyBox(struct ScriptContext * ctx) //0073 +BOOL ScrCmd_HideMoneyBox(struct ScriptContext *ctx) // 0073 { Window **moneyBox = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MONEY_BOX); ov05_021E288C(*moneyBox); @@ -103,7 +98,7 @@ BOOL ScrCmd_HideMoneyBox(struct ScriptContext * ctx) //0073 return FALSE; } -BOOL ScrCmd_UpdateMoneyBox(struct ScriptContext * ctx) //0074 +BOOL ScrCmd_UpdateMoneyBox(struct ScriptContext *ctx) // 0074 { Window **moneyBox = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MONEY_BOX); ov05_021E28A0(ctx->fieldSystem, *moneyBox); diff --git a/arm9/src/scrcmd_move_relearner.c b/arm9/src/scrcmd_move_relearner.c index 53c4a63aa..b2501b25f 100644 --- a/arm9/src/scrcmd_move_relearner.c +++ b/arm9/src/scrcmd_move_relearner.c @@ -1,34 +1,34 @@ #include "global.h" -#include "scrcmd.h" + #include "heap.h" +#include "move_relearner.h" #include "party.h" +#include "scrcmd.h" #include "unk_020377F0.h" -#include "move_relearner.h" -extern void* FieldSysGetAttrAddr(struct FieldSystem*, int idx); +extern void *FieldSysGetAttrAddr(struct FieldSystem *, int idx); -extern struct UnkStruct_02037CF0* sub_02037CF0(HeapID heapId, struct FieldSystem*, u8); -extern u8 sub_02037D5C(struct UnkStruct_02037CF0*); -extern void sub_02038864(struct FieldSystem*, MoveRelearner *moveRelearner); -extern BOOL sub_0203BC04(struct ScriptContext* ctx); +extern struct UnkStruct_02037CF0 *sub_02037CF0(HeapID heapId, struct FieldSystem *, u8); +extern u8 sub_02037D5C(struct UnkStruct_02037CF0 *); +extern void sub_02038864(struct FieldSystem *, MoveRelearner *moveRelearner); +extern BOOL sub_0203BC04(struct ScriptContext *ctx); -BOOL ScrCmd_Unk01C6(struct ScriptContext* ctx) { //01C6 - todo: MoveInfo? - u16 unk = ScriptGetVar(ctx); +BOOL ScrCmd_Unk01C6(struct ScriptContext *ctx) { // 01C6 - todo: MoveInfo? + u16 unk = ScriptGetVar(ctx); struct UnkStruct_02037CF0 **runningAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - *runningAppData = sub_02037CF0(HEAP_ID_32, ctx->fieldSystem, (u8)unk); + *runningAppData = sub_02037CF0(HEAP_ID_32, ctx->fieldSystem, (u8)unk); SetupNativeScript(ctx, sub_0203BC04); return TRUE; } -BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx) { //01C7 - todo: StoreMove? - u16 *ret_ptr = ScriptGetVarPointer(ctx); +BOOL ScrCmd_Unk01C7(struct ScriptContext *ctx) { // 01C7 - todo: StoreMove? + u16 *ret_ptr = ScriptGetVarPointer(ctx); struct UnkStruct_02037CF0 **runningAppData = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); GF_ASSERT(*runningAppData != NULL); *ret_ptr = sub_02037D5C(*runningAppData); - if (*ret_ptr == 4) - { + if (*ret_ptr == 4) { *ret_ptr = 0xFF; } @@ -37,18 +37,18 @@ BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx) { //01C7 - todo: StoreMove? return FALSE; } -BOOL ScrCmd_Unk021E(struct ScriptContext* ctx) //021E +BOOL ScrCmd_Unk021E(struct ScriptContext *ctx) // 021E { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Unk021F(struct ScriptContext* ctx) { //021F - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_idx = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* pokemon = Party_GetMonByIndex(party, mon_idx); - u16 *eligibleMoves = MoveRelearner_GetEligibleLevelUpMoves(pokemon, HEAP_ID_32); +BOOL ScrCmd_Unk021F(struct ScriptContext *ctx) { // 021F + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_idx = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *pokemon = Party_GetMonByIndex(party, mon_idx); + u16 *eligibleMoves = MoveRelearner_GetEligibleLevelUpMoves(pokemon, HEAP_ID_32); *ret_ptr = (u16)MoveRelearner_IsValidMove(eligibleMoves); FreeToHeap(eligibleMoves); @@ -56,77 +56,74 @@ BOOL ScrCmd_Unk021F(struct ScriptContext* ctx) { //021F return FALSE; } -void sub_02045E74(struct ScriptContext* ctx, u8 a1, struct Pokemon* pokemon, u16 *eligibleMoves) { +void sub_02045E74(struct ScriptContext *ctx, u8 a1, struct Pokemon *pokemon, u16 *eligibleMoves) { MoveRelearner **moveRelearnerPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - MoveRelearner *moveRelearner = MoveRelearner_New(HEAP_ID_32); - *moveRelearnerPtr = moveRelearner; + MoveRelearner *moveRelearner = MoveRelearner_New(HEAP_ID_32); + *moveRelearnerPtr = moveRelearner; moveRelearner->mon = pokemon; - struct SaveData* save = FieldSystem_GetSaveData(ctx->fieldSystem); + struct SaveData *save = FieldSystem_GetSaveData(ctx->fieldSystem); moveRelearner->profile = Save_PlayerData_GetProfileAddr(save); - moveRelearner->options = Save_PlayerData_GetOptionsAddr(ctx->fieldSystem->saveData); + moveRelearner->options = Save_PlayerData_GetOptionsAddr(ctx->fieldSystem->saveData); moveRelearner->eligibleMoves = eligibleMoves; - moveRelearner->unk15 = a1; + moveRelearner->unk15 = a1; sub_02038864(ctx->fieldSystem, moveRelearner); SetupNativeScript(ctx, sub_0203BC04); FreeToHeap(eligibleMoves); } -BOOL ScrCmd_Unk0220(struct ScriptContext* ctx) //0220 +BOOL ScrCmd_Unk0220(struct ScriptContext *ctx) // 0220 { #pragma unused(ctx) return TRUE; } -BOOL ScrCmd_Unk0221(struct ScriptContext* ctx) //0221 - todo: RememberMove? +BOOL ScrCmd_Unk0221(struct ScriptContext *ctx) // 0221 - todo: RememberMove? { - u16 mon_idx = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* pokemon = Party_GetMonByIndex(party, mon_idx); - u16 *eligibleMoves = MoveRelearner_GetEligibleLevelUpMoves(pokemon, HEAP_ID_32); + u16 mon_idx = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *pokemon = Party_GetMonByIndex(party, mon_idx); + u16 *eligibleMoves = MoveRelearner_GetEligibleLevelUpMoves(pokemon, HEAP_ID_32); sub_02045E74(ctx, 1, pokemon, eligibleMoves); return TRUE; } -BOOL ScrCmd_Unk0224(struct ScriptContext* ctx) //0224 - todo: TeachMove? +BOOL ScrCmd_Unk0224(struct ScriptContext *ctx) // 0224 - todo: TeachMove? { - u16 mon_idx = ScriptGetVar(ctx); - u16 move = ScriptGetVar(ctx); - struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + u16 mon_idx = ScriptGetVar(ctx); + u16 move = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); struct Pokemon *pokemon = Party_GetMonByIndex(party, mon_idx); u16 *eligibleMoves = AllocFromHeap(HEAP_ID_32, 2 * sizeof(u16)); - eligibleMoves[0] = move; - eligibleMoves[1] = 0xFFFF; + eligibleMoves[0] = move; + eligibleMoves[1] = 0xFFFF; sub_02045E74(ctx, 0, pokemon, eligibleMoves); return TRUE; } -BOOL ScrCmd_Unk0222(struct ScriptContext* ctx) //0222 - todo: DummyMoveCmd? +BOOL ScrCmd_Unk0222(struct ScriptContext *ctx) // 0222 - todo: DummyMoveCmd? { #pragma unused(ctx) return FALSE; } -BOOL ScrCmd_Unk0223(struct ScriptContext* ctx) //0223 - todo: RememberMoveResponse? - destroys the MoveRelearner - find better name +BOOL ScrCmd_Unk0223(struct ScriptContext *ctx) // 0223 - todo: RememberMoveResponse? - destroys the MoveRelearner - find better name { - u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); MoveRelearner **moveRelearnerPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - MoveRelearner *moveRelearner = *moveRelearnerPtr; + MoveRelearner *moveRelearner = *moveRelearnerPtr; GF_ASSERT(moveRelearner != NULL); - if (moveRelearner->unk16 == 0) - { + if (moveRelearner->unk16 == 0) { *ret_ptr = 0; - } - else - { + } else { *ret_ptr = 0xFF; } @@ -134,20 +131,17 @@ BOOL ScrCmd_Unk0223(struct ScriptContext* ctx) //0223 - todo: RememberMoveRespon return FALSE; } -BOOL ScrCmd_Unk0225(struct ScriptContext* ctx) //0225 - todo: TeachMoveResponse? - destroys the MoveRelearner - find better name +BOOL ScrCmd_Unk0225(struct ScriptContext *ctx) // 0225 - todo: TeachMoveResponse? - destroys the MoveRelearner - find better name { - u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); MoveRelearner **moveRelearnerPtr = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_RUNNING_APP_DATA); - MoveRelearner *moveRelearner = *moveRelearnerPtr; + MoveRelearner *moveRelearner = *moveRelearnerPtr; GF_ASSERT(moveRelearner != NULL); - if (moveRelearner->unk16 == 0) - { + if (moveRelearner->unk16 == 0) { *ret_ptr = 0; - } - else - { + } else { *ret_ptr = 0xFF; } diff --git a/arm9/src/scrcmd_names.c b/arm9/src/scrcmd_names.c index 8e4c24e50..f002ca06d 100644 --- a/arm9/src/scrcmd_names.c +++ b/arm9/src/scrcmd_names.c @@ -1,13 +1,15 @@ #include "global.h" -#include "save_vars_flags.h" + +#include "msgdata/msg.naix" + #include "itemtool.h" #include "message_format.h" #include "msgdata.h" -#include "msgdata/msg.naix" #include "nutdata.h" #include "party.h" #include "player_data.h" #include "pokemon.h" +#include "save_vars_flags.h" #include "scrcmd.h" #include "unk_02024E64.h" #include "unk_02064E4C.h" @@ -24,125 +26,124 @@ extern u32 sub_02054C14(u32 number); static String *sub_02040AE4(u32 msg_no, HeapID heapId); -BOOL ScrCmd_GetPlayerName(ScriptContext *ctx) //00CD - todo: BufferPlayerName? TextPlayerName? +BOOL ScrCmd_GetPlayerName(ScriptContext *ctx) // 00CD - todo: BufferPlayerName? TextPlayerName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - SaveData *save = FieldSystem_GetSaveData(fieldSystem); - PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); + u8 idx = ScriptReadByte(ctx); + SaveData *save = FieldSystem_GetSaveData(fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); BufferPlayersName(*messageFormat, idx, player); return FALSE; } -BOOL ScrCmd_GetRivalName(ScriptContext *ctx) //00CE - todo: BufferRivalName? TextRivalName? +BOOL ScrCmd_GetRivalName(ScriptContext *ctx) // 00CE - todo: BufferRivalName? TextRivalName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); + u8 idx = ScriptReadByte(ctx); BufferRivalsName(*messageFormat, idx, fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_GetFriendName(ScriptContext *ctx) //00CF - todo: BufferFriendName? TextFriendName? +BOOL ScrCmd_GetFriendName(ScriptContext *ctx) // 00CF - todo: BufferFriendName? TextFriendName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); + u8 idx = ScriptReadByte(ctx); BufferFriendsName(*messageFormat, idx, fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_GetPokemonName(ScriptContext *ctx) //00D0 - todo: BufferPartyPokemonName? TextPartyPokemonName? +BOOL ScrCmd_GetPokemonName(ScriptContext *ctx) // 00D0 - todo: BufferPartyPokemonName? TextPartyPokemonName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 mon_idx = ScriptGetVar(ctx); - Party *party = SaveArray_Party_Get(fieldSystem->saveData); - Pokemon *mon = Party_GetMonByIndex(party, mon_idx); + u8 idx = ScriptReadByte(ctx); + u16 mon_idx = ScriptGetVar(ctx); + Party *party = SaveArray_Party_Get(fieldSystem->saveData); + Pokemon *mon = Party_GetMonByIndex(party, mon_idx); BufferBoxMonSpeciesName(*messageFormat, idx, &mon->box); return FALSE; } -BOOL ScrCmd_GetItemName(ScriptContext *ctx) //00D1 - todo: BufferItemName? TextItemName? +BOOL ScrCmd_GetItemName(ScriptContext *ctx) // 00D1 - todo: BufferItemName? TextItemName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 item = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 item = ScriptGetVar(ctx); BufferItemName(*messageFormat, idx, item); return FALSE; } -BOOL ScrCmd_GetPocketName(ScriptContext *ctx) //00D2 - todo: BufferPocketName? TextPocketName? +BOOL ScrCmd_GetPocketName(ScriptContext *ctx) // 00D2 - todo: BufferPocketName? TextPocketName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 pocket = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 pocket = ScriptGetVar(ctx); BufferPocketName(*messageFormat, idx, pocket); return FALSE; } -BOOL ScrCmd_GetTMHMMoveName(ScriptContext *ctx) //00D3 - todo: BufferTMHMName? BufferMachineName? TextTMHMName? TextMachineName? +BOOL ScrCmd_GetTMHMMoveName(ScriptContext *ctx) // 00D3 - todo: BufferTMHMName? BufferMachineName? TextTMHMName? TextMachineName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 tmhm = ScriptGetVar(ctx); - u16 move = TMHMGetMove(tmhm); + u8 idx = ScriptReadByte(ctx); + u16 tmhm = ScriptGetVar(ctx); + u16 move = TMHMGetMove(tmhm); BufferMoveName(*messageFormat, idx, move); return FALSE; } -BOOL ScrCmd_GetMoveName(ScriptContext *ctx) //00D4 - todo: BufferMoveName? TextMoveName? +BOOL ScrCmd_GetMoveName(ScriptContext *ctx) // 00D4 - todo: BufferMoveName? TextMoveName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 move = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 move = ScriptGetVar(ctx); BufferMoveName(*messageFormat, idx, move); return FALSE; } -BOOL ScrCmd_Unk00D5(ScriptContext *ctx) //00D5 - todo: BufferNumber? TextNumber? +BOOL ScrCmd_Unk00D5(ScriptContext *ctx) // 00D5 - todo: BufferNumber? TextNumber? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 unk = ScriptGetVar(ctx); - u32 digits = sub_02054C14(unk); + u8 idx = ScriptReadByte(ctx); + u16 unk = ScriptGetVar(ctx); + u32 digits = sub_02054C14(unk); BufferIntegerAsString(*messageFormat, idx, unk, digits, PRINTING_MODE_RIGHT_ALIGN, TRUE); return FALSE; } -BOOL ScrCmd_Unk0280(ScriptContext *ctx) //0280 - todo: BufferNumberSpecial? need more info +BOOL ScrCmd_Unk0280(ScriptContext *ctx) // 0280 - todo: BufferNumberSpecial? need more info { - MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 unk = ScriptGetVar(ctx); + MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); + u8 idx = ScriptReadByte(ctx); + u16 unk = ScriptGetVar(ctx); enum PrintingMode printingMode = (enum PrintingMode)ScriptReadByte(ctx); - u8 digits = ScriptReadByte(ctx); - if (printingMode == PRINTING_MODE_LEFT_ALIGN) - { + u8 digits = ScriptReadByte(ctx); + if (printingMode == PRINTING_MODE_LEFT_ALIGN) { digits = (u8)sub_02054C14(unk); } @@ -151,82 +152,82 @@ BOOL ScrCmd_Unk0280(ScriptContext *ctx) //0280 - todo: BufferNumberSpecial? need return FALSE; } -BOOL ScrCmd_GetPokemonNickname(ScriptContext *ctx) //00D6 - todo: BufferPartyPokemonNickname? TextPartyPokemonNickname? +BOOL ScrCmd_GetPokemonNickname(ScriptContext *ctx) // 00D6 - todo: BufferPartyPokemonNickname? TextPartyPokemonNickname? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 mon_idx = ScriptGetVar(ctx); - Party *party = SaveArray_Party_Get(fieldSystem->saveData); - Pokemon *pokemon = Party_GetMonByIndex(party, mon_idx); + u8 idx = ScriptReadByte(ctx); + u16 mon_idx = ScriptGetVar(ctx); + Party *party = SaveArray_Party_Get(fieldSystem->saveData); + Pokemon *pokemon = Party_GetMonByIndex(party, mon_idx); BufferBoxMonNickname(*messageFormat, idx, &pokemon->box); return FALSE; } -BOOL ScrCmd_Unk0251(ScriptContext *ctx) //0251 - todo: BufferBoxPokemonNickname? TextBoxPokemonNickname? +BOOL ScrCmd_Unk0251(ScriptContext *ctx) // 0251 - todo: BufferBoxPokemonNickname? TextBoxPokemonNickname? { - FieldSystem *fieldSystem = ctx->fieldSystem; - PCStorage *pc = SaveArray_PCStorage_Get(fieldSystem->saveData); + FieldSystem *fieldSystem = ctx->fieldSystem; + PCStorage *pc = SaveArray_PCStorage_Get(fieldSystem->saveData); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 box_mon_idx = ScriptGetVar(ctx); - s32 box_no = box_mon_idx / 30; - s32 slot_no = box_mon_idx % 30; - BoxPokemon *box_mon = PCStorage_GetMonByIndexPair(pc, box_no, slot_no); + u8 idx = ScriptReadByte(ctx); + u16 box_mon_idx = ScriptGetVar(ctx); + s32 box_no = box_mon_idx / 30; + s32 slot_no = box_mon_idx % 30; + BoxPokemon *box_mon = PCStorage_GetMonByIndexPair(pc, box_no, slot_no); BufferBoxMonNickname(*messageFormat, idx, box_mon); return FALSE; } -BOOL ScrCmd_GetPoketchAppName(ScriptContext *ctx) //00D7 - todo: BufferPoketchAppName? TextPoketchAppName? +BOOL ScrCmd_GetPoketchAppName(ScriptContext *ctx) // 00D7 - todo: BufferPoketchAppName? TextPoketchAppName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 app = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 app = ScriptGetVar(ctx); BufferPoketchAppName(*messageFormat, idx, app); return FALSE; } -BOOL ScrCmd_GetTrainerClassName(ScriptContext *ctx) //00D8 - todo: BufferTrainerClassName? TextTrainerClassName? +BOOL ScrCmd_GetTrainerClassName(ScriptContext *ctx) // 00D8 - todo: BufferTrainerClassName? TextTrainerClassName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 trainer_class = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 trainer_class = ScriptGetVar(ctx); BufferTrainerClassName(*messageFormat, idx, trainer_class); return FALSE; } -BOOL ScrCmd_Unk00D9(ScriptContext *ctx) //00D9 - todo: BufferPlayerTrainerClassName? TextPlayerTrainerClassName? +BOOL ScrCmd_Unk00D9(ScriptContext *ctx) // 00D9 - todo: BufferPlayerTrainerClassName? TextPlayerTrainerClassName? { - FieldSystem *fieldSystem = ctx->fieldSystem; - SaveData *save = FieldSystem_GetSaveData(fieldSystem); - PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); + FieldSystem *fieldSystem = ctx->fieldSystem; + SaveData *save = FieldSystem_GetSaveData(fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u32 gender = PlayerProfile_GetTrainerGender(player); - u32 avatar = PlayerProfile_GetAvatar(player); - u32 trainer_class = sub_020536D0(gender, avatar, 2); + u8 idx = ScriptReadByte(ctx); + u32 gender = PlayerProfile_GetTrainerGender(player); + u32 avatar = PlayerProfile_GetAvatar(player); + u32 trainer_class = sub_020536D0(gender, avatar, 2); BufferTrainerClassNameWithArticle(*messageFormat, idx, trainer_class); return FALSE; } -BOOL ScrCmd_Unk00DA(ScriptContext *ctx) //00DA - todo: BufferPokemonSpeciesName? TextPokemonSpeciesName? +BOOL ScrCmd_Unk00DA(ScriptContext *ctx) // 00DA - todo: BufferPokemonSpeciesName? TextPokemonSpeciesName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 msg_no = ScriptGetVar(ctx); - u16 unk1 = ScriptReadHalfword(ctx); - u8 unk2 = ScriptReadByte(ctx); - String *str = sub_02040AE4(msg_no, HEAP_ID_4); + u8 idx = ScriptReadByte(ctx); + u16 msg_no = ScriptGetVar(ctx); + u16 unk1 = ScriptReadHalfword(ctx); + u8 unk2 = ScriptReadByte(ctx); + String *str = sub_02040AE4(msg_no, HEAP_ID_4); BufferString(*messageFormat, idx, str, unk1, unk2, 2); String_Delete(str); @@ -234,22 +235,22 @@ BOOL ScrCmd_Unk00DA(ScriptContext *ctx) //00DA - todo: BufferPokemonSpeciesName? return FALSE; } -static String *sub_02040AE4(u32 msg_no, HeapID heapId) //todo: GetPokemonSpeciesName? +static String *sub_02040AE4(u32 msg_no, HeapID heapId) // todo: GetPokemonSpeciesName? { MsgData *msg_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0362_bin, heapId); - String *ret = NewString_ReadMsgData(msg_data, msg_no); + String *ret = NewString_ReadMsgData(msg_data, msg_no); DestroyMsgData(msg_data); return ret; } -BOOL ScrCmd_GetPlayerStarterName(ScriptContext *ctx) //00DB - todo: BufferPlayerStarterSpecies? +BOOL ScrCmd_GetPlayerStarterName(ScriptContext *ctx) // 00DB - todo: BufferPlayerStarterSpecies? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u32 msg_no = Save_VarsFlags_GetStarter(state); - String *str = sub_02040AE4(msg_no, HEAP_ID_4); + u8 idx = ScriptReadByte(ctx); + SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u32 msg_no = Save_VarsFlags_GetStarter(state); + String *str = sub_02040AE4(msg_no, HEAP_ID_4); BufferString(*messageFormat, idx, str, 0, 1, 2); String_Delete(str); @@ -257,13 +258,13 @@ BOOL ScrCmd_GetPlayerStarterName(ScriptContext *ctx) //00DB - todo: BufferPlayer return FALSE; } -BOOL ScrCmd_GetRivalStarterName(ScriptContext *ctx) //00DC - todo: BufferRivalStarterSpecies? +BOOL ScrCmd_GetRivalStarterName(ScriptContext *ctx) // 00DC - todo: BufferRivalStarterSpecies? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u32 msg_no = sub_0205F398(state); - String *str = sub_02040AE4(msg_no, HEAP_ID_4); + u8 idx = ScriptReadByte(ctx); + SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u32 msg_no = sub_0205F398(state); + String *str = sub_02040AE4(msg_no, HEAP_ID_4); BufferString(*messageFormat, idx, str, 0, 1, 2); String_Delete(str); @@ -271,13 +272,13 @@ BOOL ScrCmd_GetRivalStarterName(ScriptContext *ctx) //00DC - todo: BufferRivalSt return FALSE; } -BOOL ScrCmd_GetCounterpartStarterName(ScriptContext *ctx) //00DD - todo: BufferFriendStarterSpecies? +BOOL ScrCmd_GetCounterpartStarterName(ScriptContext *ctx) // 00DD - todo: BufferFriendStarterSpecies? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u32 msg_no = sub_0205F3C0(state); - String *str = sub_02040AE4(msg_no, HEAP_ID_4); + u8 idx = ScriptReadByte(ctx); + SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u32 msg_no = sub_0205F3C0(state); + String *str = sub_02040AE4(msg_no, HEAP_ID_4); BufferString(*messageFormat, idx, str, 0, 1, 2); String_Delete(str); @@ -285,45 +286,45 @@ BOOL ScrCmd_GetCounterpartStarterName(ScriptContext *ctx) //00DD - todo: BufferF return FALSE; } -BOOL ScrCmd_GetDecorationName(ScriptContext *ctx) //00DF - todo: BufferDecorationName? +BOOL ScrCmd_GetDecorationName(ScriptContext *ctx) // 00DF - todo: BufferDecorationName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 decoration = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 decoration = ScriptGetVar(ctx); BufferDecorationName(*messageFormat, idx, decoration); return FALSE; } -BOOL ScrCmd_GetUndergroundTrapName(ScriptContext *ctx) //00E0 - todo: BufferUndergroundTrapName? +BOOL ScrCmd_GetUndergroundTrapName(ScriptContext *ctx) // 00E0 - todo: BufferUndergroundTrapName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 underground_trap = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 underground_trap = ScriptGetVar(ctx); BufferUndergroundTrapName(*messageFormat, idx, underground_trap); return FALSE; } -BOOL ScrCmd_GetUndergroundItemName(ScriptContext *ctx) //00E1 - todo: BufferUndergroundItemName? BufferTreasureName? +BOOL ScrCmd_GetUndergroundItemName(ScriptContext *ctx) // 00E1 - todo: BufferUndergroundItemName? BufferTreasureName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 underground_item = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 underground_item = ScriptGetVar(ctx); BufferUndergroundItemName(*messageFormat, idx, underground_item); return FALSE; } -BOOL ScrCmd_GetMapName(ScriptContext *ctx) //00E2 - todo: BufferMapName? +BOOL ScrCmd_GetMapName(ScriptContext *ctx) // 00E2 - todo: BufferMapName? { - String *str = String_New(22, HEAP_ID_4); + String *str = String_New(22, HEAP_ID_4); MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 map_no = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 map_no = ScriptGetVar(ctx); sub_02064E60(map_no, HEAP_ID_4, str); BufferString(*messageFormat, idx, str, 0, 1, 2); @@ -332,13 +333,13 @@ BOOL ScrCmd_GetMapName(ScriptContext *ctx) //00E2 - todo: BufferMapName? return FALSE; } -BOOL ScrCmd_GetBerryName(ScriptContext *ctx) //017B - todo: BufferBerryName? +BOOL ScrCmd_GetBerryName(ScriptContext *ctx) // 017B - todo: BufferBerryName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 berry = ScriptGetVar(ctx); - u16 unk = ScriptGetVar(ctx); - String *nut_name = GetNutName((u16)(berry - FIRST_BERRY_IDX), HEAP_ID_32); + u8 idx = ScriptReadByte(ctx); + u16 berry = ScriptGetVar(ctx); + u16 unk = ScriptGetVar(ctx); + String *nut_name = GetNutName((u16)(berry - FIRST_BERRY_IDX), HEAP_ID_32); BufferString(*messageFormat, idx, nut_name, 0, unk < 2, 2); String_Delete(nut_name); @@ -346,35 +347,35 @@ BOOL ScrCmd_GetBerryName(ScriptContext *ctx) //017B - todo: BufferBerryName? return FALSE; } -BOOL ScrCmd_GetNatureName(ScriptContext *ctx) //017C - todo: BufferNatureName? +BOOL ScrCmd_GetNatureName(ScriptContext *ctx) // 017C - todo: BufferNatureName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 nature = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 nature = ScriptGetVar(ctx); BufferNatureName(*messageFormat, idx, nature); return FALSE; } -BOOL ScrCmd_GetFashionName(ScriptContext *ctx) //0261 - todo: BufferAccessoryName? +BOOL ScrCmd_GetFashionName(ScriptContext *ctx) // 0261 - todo: BufferAccessoryName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 fashion = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 fashion = ScriptGetVar(ctx); BufferFashionName(*messageFormat, idx, fashion); return FALSE; } -BOOL ScrCmd_GetWhiteRockInscription(ScriptContext *ctx) //0272 - todo: BufferWhiteRockInscription? +BOOL ScrCmd_GetWhiteRockInscription(ScriptContext *ctx) // 0272 - todo: BufferWhiteRockInscription? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - String *str = String_New(11, HEAP_ID_FIELD); - UnkStruct_02024E64 *unk = sub_02024EB4(ctx->fieldSystem->saveData); - u16 *unk_buffer = sub_02024F0C(unk); + u8 idx = ScriptReadByte(ctx); + String *str = String_New(11, HEAP_ID_FIELD); + UnkStruct_02024E64 *unk = sub_02024EB4(ctx->fieldSystem->saveData); + u16 *unk_buffer = sub_02024F0C(unk); CopyU16ArrayToString(str, unk_buffer); BufferString(*messageFormat, idx, str, 0, 0, gGameLanguage); @@ -383,162 +384,162 @@ BOOL ScrCmd_GetWhiteRockInscription(ScriptContext *ctx) //0272 - todo: BufferWhi return FALSE; } -BOOL ScrCmd_GetPokemonMoveName(ScriptContext *ctx) //01CB - todo: BufferPartyPokemonMoveName? +BOOL ScrCmd_GetPokemonMoveName(ScriptContext *ctx) // 01CB - todo: BufferPartyPokemonMoveName? { - FieldSystem *fieldSystem = ctx->fieldSystem; + FieldSystem *fieldSystem = ctx->fieldSystem; MessageFormat **messageFormat = FieldSysGetAttrAddr(fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 mon_idx = ScriptGetVar(ctx); - u16 mon_move_idx = ScriptGetVar(ctx); - Party *party = SaveArray_Party_Get(fieldSystem->saveData); - Pokemon *pokemon = Party_GetMonByIndex(party, mon_idx); - u16 move = (u16)GetMonData(pokemon, MON_DATA_MOVE1 + mon_move_idx, NULL); + u8 idx = ScriptReadByte(ctx); + u16 mon_idx = ScriptGetVar(ctx); + u16 mon_move_idx = ScriptGetVar(ctx); + Party *party = SaveArray_Party_Get(fieldSystem->saveData); + Pokemon *pokemon = Party_GetMonByIndex(party, mon_idx); + u16 move = (u16)GetMonData(pokemon, MON_DATA_MOVE1 + mon_move_idx, NULL); BufferMoveName(*messageFormat, idx, move); return FALSE; } -BOOL ScrCmd_GetRibbonName(ScriptContext *ctx) //0232 - todo: BufferRibbonName? +BOOL ScrCmd_GetRibbonName(ScriptContext *ctx) // 0232 - todo: BufferRibbonName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u8 unk = (u8)ScriptGetVar(ctx); - u16 ribbon = (u16)sub_0207FC5C(unk, 3); + u8 idx = ScriptReadByte(ctx); + u8 unk = (u8)ScriptGetVar(ctx); + u16 ribbon = (u16)sub_0207FC5C(unk, 3); BufferRibbonNameOrDesc(*messageFormat, idx, ribbon); return FALSE; } -BOOL ScrCmd_GetSealName(ScriptContext *ctx) //02B3 - todo: BufferSealName? +BOOL ScrCmd_GetSealName(ScriptContext *ctx) // 02B3 - todo: BufferSealName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 seal = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 seal = ScriptGetVar(ctx); BufferSealName(*messageFormat, idx, (u16)(seal - 1)); return FALSE; } -BOOL ScrCmd_GetItemNameWithIndefArticle(ScriptContext *ctx) //02C4 - todo: BufferIndefItemName? +BOOL ScrCmd_GetItemNameWithIndefArticle(ScriptContext *ctx) // 02C4 - todo: BufferIndefItemName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 item = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 item = ScriptGetVar(ctx); BufferItemNameWithIndefArticle(*messageFormat, idx, item); return FALSE; } -BOOL ScrCmd_GetItemNamePlural(ScriptContext *ctx) //02C5 - todo: BufferPluralItemName? +BOOL ScrCmd_GetItemNamePlural(ScriptContext *ctx) // 02C5 - todo: BufferPluralItemName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 item = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 item = ScriptGetVar(ctx); BufferItemNamePlural(*messageFormat, idx, item); return FALSE; } -BOOL ScrCmd_GetDecorationNameWithArticle(ScriptContext *ctx) //02C6 - todo: BufferIndefDecorationName? +BOOL ScrCmd_GetDecorationNameWithArticle(ScriptContext *ctx) // 02C6 - todo: BufferIndefDecorationName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 decoration = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 decoration = ScriptGetVar(ctx); BufferDecorationNameWithArticle(*messageFormat, idx, decoration); return FALSE; } -BOOL ScrCmd_GetUndergroundTrapNameWithArticle(ScriptContext *ctx) //02C7 - todo: BufferIndefTrapName? +BOOL ScrCmd_GetUndergroundTrapNameWithArticle(ScriptContext *ctx) // 02C7 - todo: BufferIndefTrapName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 underground_trap = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 underground_trap = ScriptGetVar(ctx); BufferUndergroundTrapNameWithArticle(*messageFormat, idx, underground_trap); return FALSE; } -BOOL ScrCmd_GetUndergroundItemNameWithArticle(ScriptContext *ctx) //02C8 - todo: BufferIndefUndergroundItemName? BufferIndefTreasureName? +BOOL ScrCmd_GetUndergroundItemNameWithArticle(ScriptContext *ctx) // 02C8 - todo: BufferIndefUndergroundItemName? BufferIndefTreasureName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 underground_item = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 underground_item = ScriptGetVar(ctx); BufferUndergroundItemNameWithArticle(*messageFormat, idx, underground_item); return FALSE; } -BOOL ScrCmd_Unk02C9(ScriptContext *ctx) //02C9 - todo: BufferIndefSpeciesName? +BOOL ScrCmd_Unk02C9(ScriptContext *ctx) // 02C9 - todo: BufferIndefSpeciesName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 species = ScriptGetVar(ctx); - u16 unused1 = ScriptReadHalfword(ctx); - u8 unused2 = ScriptReadByte(ctx); + u8 idx = ScriptReadByte(ctx); + u16 species = ScriptGetVar(ctx); + u16 unused1 = ScriptReadHalfword(ctx); + u8 unused2 = ScriptReadByte(ctx); BufferSpeciesNameWithArticle(*messageFormat, idx, species); return FALSE; } -BOOL ScrCmd_Unk02CA(ScriptContext *ctx) //02CA - todo: BufferIndefFriendStarterSpecies? +BOOL ScrCmd_Unk02CA(ScriptContext *ctx) // 02CA - todo: BufferIndefFriendStarterSpecies? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); - u32 species = sub_0205F3C0(state); + u8 idx = ScriptReadByte(ctx); + SaveVarsFlags *state = Save_VarsFlags_Get(ctx->fieldSystem->saveData); + u32 species = sub_0205F3C0(state); BufferSpeciesNameWithArticle(*messageFormat, idx, species); return FALSE; } -BOOL ScrCmd_GetFashionNameWithArticle(ScriptContext *ctx) //02CB - todo: BufferIndefAccessoryName? +BOOL ScrCmd_GetFashionNameWithArticle(ScriptContext *ctx) // 02CB - todo: BufferIndefAccessoryName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 fashion = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 fashion = ScriptGetVar(ctx); BufferFashionNameWithArticle(*messageFormat, idx, fashion); return FALSE; } -BOOL ScrCmd_Unk02CC(ScriptContext *ctx) //02CC - todo: BufferIndefTrainerClassName? +BOOL ScrCmd_Unk02CC(ScriptContext *ctx) // 02CC - todo: BufferIndefTrainerClassName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 trainer_class = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 trainer_class = ScriptGetVar(ctx); BufferTrainerClassNameWithArticle(*messageFormat, idx, trainer_class); return FALSE; } -BOOL ScrCmd_GetSealNamePlural(ScriptContext *ctx) //02CD - todo: BufferPluralSealName? +BOOL ScrCmd_GetSealNamePlural(ScriptContext *ctx) // 02CD - todo: BufferPluralSealName? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); - u16 seal = ScriptGetVar(ctx); + u8 idx = ScriptReadByte(ctx); + u16 seal = ScriptGetVar(ctx); BufferSealNamePlural(*messageFormat, idx, (u16)(seal - 1)); return FALSE; } -BOOL ScrCmd_CapitalizeFirstChar(ScriptContext *ctx) //02CE - todo CapitalizeText? +BOOL ScrCmd_CapitalizeFirstChar(ScriptContext *ctx) // 02CE - todo CapitalizeText? { MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - u8 idx = ScriptReadByte(ctx); + u8 idx = ScriptReadByte(ctx); MessageFormat_UpperFirstChar(*messageFormat, idx); diff --git a/arm9/src/scrcmd_party.c b/arm9/src/scrcmd_party.c index 1cab62464..70c38a63e 100644 --- a/arm9/src/scrcmd_party.c +++ b/arm9/src/scrcmd_party.c @@ -1,5 +1,7 @@ #include "global.h" + #include "constants/moves.h" + #include "itemtool.h" #include "map_header.h" #include "overlay_05.h" @@ -12,39 +14,36 @@ #include "unk_02022504.h" #include "unk_0207FC5C.h" -extern u16 sub_02054DEC(struct SaveData* save); +extern u16 sub_02054DEC(struct SaveData *save); -BOOL ScrCmd_GiveMon(struct ScriptContext* ctx) //0096 - todo: GivePokemon? +BOOL ScrCmd_GiveMon(struct ScriptContext *ctx) // 0096 - todo: GivePokemon? { - u32 mapSec = MapHeader_GetMapSec(ctx->fieldSystem->location->mapId); + u32 mapSec = MapHeader_GetMapSec(ctx->fieldSystem->location->mapId); struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 species = ScriptGetVar(ctx); - u16 level = ScriptGetVar(ctx); - u16 item = ScriptGetVar(ctx); - u16 * varPtr = ScriptGetVarPointer(ctx); - struct Party * party = SaveArray_Party_Get(fieldSystem->saveData); - *varPtr = (u16)GiveMon(HEAP_ID_FIELD, fieldSystem->saveData, species, (u8)level, item, mapSec, 12); + u16 species = ScriptGetVar(ctx); + u16 level = ScriptGetVar(ctx); + u16 item = ScriptGetVar(ctx); + u16 *varPtr = ScriptGetVarPointer(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + *varPtr = (u16)GiveMon(HEAP_ID_FIELD, fieldSystem->saveData, species, (u8)level, item, mapSec, 12); return FALSE; } -BOOL ScrCmd_GetPartyMonSpecies(struct ScriptContext* ctx) //0198 - todo: GetPartyPokemonSpecies? +BOOL ScrCmd_GetPartyMonSpecies(struct ScriptContext *ctx) // 0198 - todo: GetPartyPokemonSpecies? { u32 species; - u16* ret_ptr; + u16 *ret_ptr; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* mon_slot = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); //for some reason this is *required* for matching, cannot use ScriptGetVarPointer here - ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, *mon_slot); + u16 *mon_slot = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); // for some reason this is *required* for matching, cannot use ScriptGetVarPointer here + ret_ptr = GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, *mon_slot); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { species = GetMonData(party_mon, MON_DATA_SPECIES, NULL); - } - else - { + } else { species = SPECIES_NONE; } @@ -52,44 +51,40 @@ BOOL ScrCmd_GetPartyMonSpecies(struct ScriptContext* ctx) //0198 - todo: GetPart return FALSE; } -BOOL ScrCmd_CheckPartyMonOTID(struct ScriptContext* ctx) //0199 - todo: CheckPartyPokemonTraded? +BOOL ScrCmd_CheckPartyMonOTID(struct ScriptContext *ctx) // 0199 - todo: CheckPartyPokemonTraded? { struct FieldSystem *fieldSystem = ctx->fieldSystem; - struct SaveData* save = FieldSystem_GetSaveData(fieldSystem); - PlayerProfile* player = Save_PlayerData_GetProfileAddr(save); + struct SaveData *save = FieldSystem_GetSaveData(fieldSystem); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(save); - u16* mon_slot = ScriptGetVarPointer(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *mon_slot = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, *mon_slot); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, *mon_slot); u16 party_mon_otid = (u16)GetMonData(party_mon, MON_DATA_OTID, NULL); - u16 player_otid = (u16)PlayerProfile_GetTrainerID(player); - if (party_mon_otid == player_otid) - { + u16 player_otid = (u16)PlayerProfile_GetTrainerID(player); + if (party_mon_otid == player_otid) { *ret_ptr = 0; - } - else - { + } else { *ret_ptr = 1; } return FALSE; } -BOOL ScrCmd_GiveEgg(struct ScriptContext* ctx) //0097 +BOOL ScrCmd_GiveEgg(struct ScriptContext *ctx) // 0097 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - PlayerProfile* player = Save_PlayerData_GetProfileAddr(fieldSystem->saveData); - u16 species = ScriptGetVar(ctx); - u16 unk = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - u8 party_count = (u8)Party_GetCount(party); - - if (party_count < PARTY_SIZE) - { - struct Pokemon* egg = AllocMonZeroed(HEAP_ID_FIELD); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(fieldSystem->saveData); + u16 species = ScriptGetVar(ctx); + u16 unk = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + u8 party_count = (u8)Party_GetCount(party); + + if (party_count < PARTY_SIZE) { + struct Pokemon *egg = AllocMonZeroed(HEAP_ID_FIELD); ZeroMonData(egg); s32 met_loc = sub_02015CF8(1, unk); @@ -102,67 +97,56 @@ BOOL ScrCmd_GiveEgg(struct ScriptContext* ctx) //0097 return FALSE; } -BOOL ScrCmd_SetPartyMonMove(struct ScriptContext* ctx) //0098 - todo: ReplacePartyPokemonMove? +BOOL ScrCmd_SetPartyMonMove(struct ScriptContext *ctx) // 0098 - todo: ReplacePartyPokemonMove? { - u16 mon_slot = ScriptGetVar(ctx); - u16 move_slot = ScriptGetVar(ctx); - u16 move = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + u16 mon_slot = ScriptGetVar(ctx); + u16 move_slot = ScriptGetVar(ctx); + u16 move = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); PartyMonSetMoveInSlot(party, mon_slot, move_slot, move); return FALSE; } -BOOL ScrCmd_PartyMonHasMove(struct ScriptContext* ctx) //0099 +BOOL ScrCmd_PartyMonHasMove(struct ScriptContext *ctx) // 0099 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 required_move = ScriptGetVar(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 required_move = ScriptGetVar(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = 0; BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg) - { + if (party_mon_is_egg) { return FALSE; } - if (required_move == GetMonData(party_mon, MON_DATA_MOVE1, NULL) || - required_move == GetMonData(party_mon, MON_DATA_MOVE2, NULL) || - required_move == GetMonData(party_mon, MON_DATA_MOVE3, NULL) || - required_move == GetMonData(party_mon, MON_DATA_MOVE4, NULL)) - { + if (required_move == GetMonData(party_mon, MON_DATA_MOVE1, NULL) || required_move == GetMonData(party_mon, MON_DATA_MOVE2, NULL) || required_move == GetMonData(party_mon, MON_DATA_MOVE3, NULL) || required_move == GetMonData(party_mon, MON_DATA_MOVE4, NULL)) { *ret_ptr = 1; } return FALSE; } -BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext* ctx) //009A - todo: CheckMoveInParty? +BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext *ctx) // 009A - todo: CheckMoveInParty? { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 required_move = ScriptGetVar(ctx); - u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 required_move = ScriptGetVar(ctx); + u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); u8 i; - for (i = 0, *ret_ptr = PARTY_SIZE; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, *ret_ptr = PARTY_SIZE; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { - if (required_move == GetMonData(party_mon, MON_DATA_MOVE1, NULL) || - required_move == GetMonData(party_mon, MON_DATA_MOVE2, NULL) || - required_move == GetMonData(party_mon, MON_DATA_MOVE3, NULL) || - required_move == GetMonData(party_mon, MON_DATA_MOVE4, NULL)) - { + if (party_mon_is_egg == FALSE) { + if (required_move == GetMonData(party_mon, MON_DATA_MOVE1, NULL) || required_move == GetMonData(party_mon, MON_DATA_MOVE2, NULL) || required_move == GetMonData(party_mon, MON_DATA_MOVE3, NULL) || required_move == GetMonData(party_mon, MON_DATA_MOVE4, NULL)) { *ret_ptr = i; break; } @@ -172,39 +156,36 @@ BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext* ctx) //009A - todo: Check return FALSE; } -BOOL ScrCmd_SurvivePsn(struct ScriptContext* ctx) //01F7 +BOOL ScrCmd_SurvivePsn(struct ScriptContext *ctx) // 01F7 { - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = (u16)SurvivePoisoning(party_mon); return FALSE; } -BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext* ctx) //01F6 +BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext *ctx) // 01F6 { u8 party_count; u8 i; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 highest_level = ScriptGetVar(ctx); - party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 highest_level = ScriptGetVar(ctx); + party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); u8 mons; - for (i = 0, mons = 0, *ret_ptr = 0; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, mons = 0, *ret_ptr = 0; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { u32 party_mon_level = GetMonData(party_mon, MON_DATA_LEVEL, NULL); - if (party_mon_level <= highest_level) - { + if (party_mon_level <= highest_level) { mons++; } } @@ -214,44 +195,41 @@ BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext* ctx) //01F6 return FALSE; } -BOOL ScrCmd_GetPartyMonLevel(struct ScriptContext* ctx) //0278 +BOOL ScrCmd_GetPartyMonLevel(struct ScriptContext *ctx) // 0278 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = 0; BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { *ret_ptr = (u16)GetMonData(party_mon, MON_DATA_LEVEL, NULL); } return FALSE; } -BOOL ScrCmd_GetPartyMonNature(struct ScriptContext* ctx) //0212 +BOOL ScrCmd_GetPartyMonNature(struct ScriptContext *ctx) // 0212 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); - if (mon_slot >= party_count) - { + if (mon_slot >= party_count) { *ret_ptr = 0; return FALSE; } - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg) - { + if (party_mon_is_egg) { *ret_ptr = 0; return FALSE; } @@ -260,25 +238,22 @@ BOOL ScrCmd_GetPartyMonNature(struct ScriptContext* ctx) //0212 return FALSE; } -BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext* ctx) //0213 - todo: CheckNatureInParty +BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext *ctx) // 0213 - todo: CheckNatureInParty { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 required_nature = ScriptGetVar(ctx); - u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 required_nature = ScriptGetVar(ctx); + u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); u8 i; - for (i = 0, *ret_ptr = 0xFF; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, *ret_ptr = 0xFF; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { u8 party_mon_nature = GetMonNature(party_mon); - if (required_nature == party_mon_nature) - { + if (required_nature == party_mon_nature) { *ret_ptr = i; break; } @@ -288,54 +263,49 @@ BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext* ctx) //0213 - todo: Che return FALSE; } -BOOL ScrCmd_GetPartyMonFriendship(struct ScriptContext* ctx) //01B9 +BOOL ScrCmd_GetPartyMonFriendship(struct ScriptContext *ctx) // 01B9 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = (u16)GetMonData(party_mon, MON_DATA_FRIENDSHIP, NULL); return FALSE; } -BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext* ctx) //01BA +BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext *ctx) // 01BA { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 friendship_to_add = ScriptGetVar(ctx); - u16 mon_slot = ScriptGetVar(ctx); - u16 map_sec = MapHeader_GetMapSec(ctx->fieldSystem->location->mapId); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 friendship_to_add = ScriptGetVar(ctx); + u16 mon_slot = ScriptGetVar(ctx); + u16 map_sec = MapHeader_GetMapSec(ctx->fieldSystem->location->mapId); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); u16 friendship = (u16)GetMonData(party_mon, MON_DATA_FRIENDSHIP, NULL); - if (friendship_to_add != 0) - { - u16 party_mon_held_item = (u16)GetMonData(party_mon, MON_DATA_HELD_ITEM, NULL); + if (friendship_to_add != 0) { + u16 party_mon_held_item = (u16)GetMonData(party_mon, MON_DATA_HELD_ITEM, NULL); u32 held_item_hold_effect = GetItemAttr(party_mon_held_item, ITEMATTR_HOLD_EFFECT, HEAP_ID_FIELD); - if (held_item_hold_effect == HOLD_EFFECT_FRIENDSHIP_UP) - { + if (held_item_hold_effect == HOLD_EFFECT_FRIENDSHIP_UP) { friendship_to_add = (u16)((friendship_to_add * 150) / 100); } u32 party_mon_pokeball = GetMonData(party_mon, MON_DATA_POKEBALL, NULL); - if (party_mon_pokeball == ITEM_LUXURY_BALL) - { + if (party_mon_pokeball == ITEM_LUXURY_BALL) { friendship_to_add++; } u32 party_mon_egg_met_location = GetMonData(party_mon, MON_DATA_EGG_MET_LOCATION, NULL); - if (map_sec == party_mon_egg_met_location) - { + if (map_sec == party_mon_egg_met_location) { friendship_to_add++; } } friendship += friendship_to_add; - if (friendship > 0xFF) - { + if (friendship > 0xFF) { friendship = 0xFF; } @@ -344,21 +314,18 @@ BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext* ctx) //01BA return FALSE; } -BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext* ctx) //01BB +BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext *ctx) // 01BB { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 friendship_to_deplete = ScriptGetVar(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 friendship_to_deplete = ScriptGetVar(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); u16 friendship = (u16)GetMonData(party_mon, MON_DATA_FRIENDSHIP, NULL); - if (friendship_to_deplete > friendship) - { + if (friendship_to_deplete > friendship) { friendship = 0; - } - else - { + } else { friendship -= friendship_to_deplete; } @@ -367,101 +334,94 @@ BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext* ctx) //01BB return FALSE; } -BOOL ScrCmd_GetPartyMonContestCondition(struct ScriptContext* ctx) //0281 +BOOL ScrCmd_GetPartyMonContestCondition(struct ScriptContext *ctx) // 0281 { - u16 mon_slot = ScriptGetVar(ctx); - u16 contest_condition_id = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 mon_slot = ScriptGetVar(ctx); + u16 contest_condition_id = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = (u16)GetMonData(party_mon, MON_DATA_COOL + contest_condition_id, NULL); return FALSE; } -BOOL ScrCmd_GetLeadingPartyMonSlot(struct ScriptContext* ctx) //0247 +BOOL ScrCmd_GetLeadingPartyMonSlot(struct ScriptContext *ctx) // 0247 { - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = sub_02054DEC(ctx->fieldSystem->saveData); return FALSE; } -BOOL ScrCmd_GetPartyMonTypes(struct ScriptContext* ctx) //0248 +BOOL ScrCmd_GetPartyMonTypes(struct ScriptContext *ctx) // 0248 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* type1 = ScriptGetVarPointer(ctx); - u16* type2 = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *type1 = ScriptGetVarPointer(ctx); + u16 *type2 = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *type1 = (u16)GetMonData(party_mon, MON_DATA_TYPE_1, NULL); *type2 = (u16)GetMonData(party_mon, MON_DATA_TYPE_2, NULL); return FALSE; } -BOOL ScrCmd_CountPartyMons(struct ScriptContext* ctx) //0177 +BOOL ScrCmd_CountPartyMons(struct ScriptContext *ctx) // 0177 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); *ret_ptr = (u16)Party_GetCount(party); return FALSE; } -BOOL ScrCmd_CountPartyMons_OmitEggs(struct ScriptContext* ctx) //019A +BOOL ScrCmd_CountPartyMons_OmitEggs(struct ScriptContext *ctx) // 019A { u32 non_egg_mons; s32 i; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - s32 party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + s32 party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); - for (i = 0, non_egg_mons = 0; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, non_egg_mons = 0; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { non_egg_mons++; } - } *ret_ptr = (u16)non_egg_mons; return FALSE; } -BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext* ctx) //019B +BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext *ctx) // 019B { u16 slot_to_ignore; s32 party_count; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - slot_to_ignore = ScriptGetVar(ctx); - party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + slot_to_ignore = ScriptGetVar(ctx); + party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); u32 available_mons; s32 i; - for (i = 0, available_mons = 0; i < party_count; i++) - { - if (i != slot_to_ignore) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, available_mons = 0; i < party_count; i++) { + if (i != slot_to_ignore) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { u32 party_mon_hp = GetMonData(party_mon, MON_DATA_HP, NULL); - if (party_mon_hp != 0) - { + if (party_mon_hp != 0) { available_mons++; } } @@ -472,29 +432,26 @@ BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext* ctx) //019B return FALSE; } -BOOL ScrCmd_CountAvailablePartyAndPCMons(struct ScriptContext* ctx) //019C +BOOL ScrCmd_CountAvailablePartyAndPCMons(struct ScriptContext *ctx) // 019C { s32 party_count; - struct PCStorage* pc; + struct PCStorage *pc; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - pc = SaveArray_PCStorage_Get(fieldSystem->saveData); - party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + pc = SaveArray_PCStorage_Get(fieldSystem->saveData); + party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); u32 mons; s32 i; - for (i = 0, mons = 0; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, mons = 0; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { u32 party_mon_hp = GetMonData(party_mon, MON_DATA_HP, NULL); - if (party_mon_hp != 0) - { + if (party_mon_hp != 0) { mons++; } } @@ -504,24 +461,22 @@ BOOL ScrCmd_CountAvailablePartyAndPCMons(struct ScriptContext* ctx) //019C return FALSE; } -BOOL ScrCmd_GetPartyEggCount(struct ScriptContext* ctx) //019D +BOOL ScrCmd_GetPartyEggCount(struct ScriptContext *ctx) // 019D { s32 party_count; u32 eggs_in_party; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + party_count = Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); s32 i; - for (i = 0, eggs_in_party = 0; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, eggs_in_party = 0; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg) - { + if (party_mon_is_egg) { eggs_in_party++; } } @@ -530,23 +485,21 @@ BOOL ScrCmd_GetPartyEggCount(struct ScriptContext* ctx) //019D return FALSE; } -BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext* ctx) //0119 +BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext *ctx) // 0119 { u16 party_count; u16 i; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - party_count = (u16)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + party_count = (u16)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); - for (i = 0, *ret_ptr = 0; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, *ret_ptr = 0; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_has_pokerus = (BOOL)GetMonData(party_mon, MON_DATA_POKERUS, NULL); - if (party_mon_has_pokerus) - { + if (party_mon_has_pokerus) { *ret_ptr = 1; break; } @@ -555,31 +508,30 @@ BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext* ctx) //0119 return FALSE; } -BOOL ScrCmd_GetPartyMonGender(struct ScriptContext* ctx) //011A +BOOL ScrCmd_GetPartyMonGender(struct ScriptContext *ctx) // 011A { - u16 mon_slot = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 mon_slot = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = (u16)GetMonData(party_mon, MON_DATA_GENDER, NULL); return FALSE; } -BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext* ctx) //01C8 +BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext *ctx) // 01C8 { - struct Pokemon* party_mon; + struct Pokemon *party_mon; u8 moves; struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + party_mon = Party_GetMonByIndex(party, mon_slot); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg) - { + if (party_mon_is_egg) { *ret_ptr = 0; return FALSE; } @@ -587,26 +539,22 @@ BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext* ctx) //01C8 moves = 0; u32 move1 = GetMonData(party_mon, MON_DATA_MOVE1, NULL); - if (move1 != MOVE_NONE) - { + if (move1 != MOVE_NONE) { moves++; } u32 move2 = GetMonData(party_mon, MON_DATA_MOVE2, NULL); - if (move2 != MOVE_NONE) - { + if (move2 != MOVE_NONE) { moves++; } u32 move3 = GetMonData(party_mon, MON_DATA_MOVE3, NULL); - if (move3 != MOVE_NONE) - { + if (move3 != MOVE_NONE) { moves++; } u32 move4 = GetMonData(party_mon, MON_DATA_MOVE4, NULL); - if (move4 != MOVE_NONE) - { + if (move4 != MOVE_NONE) { moves++; } @@ -614,50 +562,50 @@ BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext* ctx) //01C8 return FALSE; } -BOOL ScrCmd_ForgetPartyMonMove(struct ScriptContext* ctx) //01C9 +BOOL ScrCmd_ForgetPartyMonMove(struct ScriptContext *ctx) // 01C9 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 mon_slot = ScriptGetVar(ctx); - u16 move_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 mon_slot = ScriptGetVar(ctx); + u16 move_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); sub_020699A4(party_mon, move_slot); return FALSE; } -BOOL ScrCmd_GetPartyMonMove(struct ScriptContext* ctx) //01CA +BOOL ScrCmd_GetPartyMonMove(struct ScriptContext *ctx) // 01CA { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - u16 move_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + u16 move_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = (u16)GetMonData(party_mon, MON_DATA_MOVE1 + move_slot, NULL); return FALSE; } -BOOL ScrCmd_GetPartyMonHeldItem(struct ScriptContext* ctx) //01EE +BOOL ScrCmd_GetPartyMonHeldItem(struct ScriptContext *ctx) // 01EE { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = (u16)GetMonData(party_mon, MON_DATA_HELD_ITEM, NULL); return FALSE; } -BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext* ctx) //01F0 +BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext *ctx) // 01F0 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); u16 party_mon_held_item = ITEM_NONE; SetMonData(party_mon, MON_DATA_HELD_ITEM, &party_mon_held_item); @@ -665,25 +613,22 @@ BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext* ctx) //01F0 return FALSE; } -BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext* ctx) //01C0 +BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext *ctx) // 01C0 { struct FieldSystem *fieldSystem = ctx->fieldSystem; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 species = ScriptGetVar(ctx); - u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 species = ScriptGetVar(ctx); + u8 party_count = (u8)Party_GetCount(SaveArray_Party_Get(fieldSystem->saveData)); u8 i; - for (i = 0, *ret_ptr = 0; i < party_count; i++) - { - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (i = 0, *ret_ptr = 0; i < party_count; i++) { + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg == FALSE) - { + if (party_mon_is_egg == FALSE) { u16 party_mon_species = (u16)GetMonData(party_mon, MON_DATA_SPECIES, NULL); - if (species == party_mon_species) - { + if (species == party_mon_species) { *ret_ptr = 1; break; } @@ -693,20 +638,18 @@ BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext* ctx) //01C0 return FALSE; } -BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext* ctx) //022E +BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext *ctx) // 022E { - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); u16 ribbon_idx; u16 ribbons; - for (ribbon_idx = 0, ribbons = 0; ribbon_idx < 80; ribbon_idx++) - { + for (ribbon_idx = 0, ribbons = 0; ribbon_idx < 80; ribbon_idx++) { BOOL party_mon_has_ribbon = (BOOL)GetMonData(party_mon, sub_0207FC5C((u8)ribbon_idx, 0), NULL); - if (party_mon_has_ribbon) - { + if (party_mon_has_ribbon) { ribbons++; } } @@ -715,33 +658,29 @@ BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext* ctx) //022E return FALSE; } -BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext* ctx) //022F +BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext *ctx) // 022F { - struct Party* party; + struct Party *party; u16 ribbon_idx; u16 ribbons; - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); u16 party_count = (u16)Party_GetCount(SaveArray_Party_Get(ctx->fieldSystem->saveData)); - party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - for (ribbon_idx = 0, ribbons = 0; ribbon_idx < 80; ribbon_idx++) - { - for (u16 i = 0; i < party_count; i++) - { - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); + for (ribbon_idx = 0, ribbons = 0; ribbon_idx < 80; ribbon_idx++) { + for (u16 i = 0; i < party_count; i++) { + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg) - { + if (party_mon_is_egg) { // BUG: This `break` should be a `continue`, as any party mons after a detected // egg would have their ribbons ignored. break; } BOOL party_mon_has_ribbon = (BOOL)GetMonData(party_mon, sub_0207FC5C((u8)ribbon_idx, 0), NULL); - if (party_mon_has_ribbon) - { + if (party_mon_has_ribbon) { ribbons++; break; } @@ -752,52 +691,48 @@ BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext* ctx) //022F return FALSE; } -BOOL ScrCmd_PartyMonHasRibbon(struct ScriptContext* ctx) //0230 +BOOL ScrCmd_PartyMonHasRibbon(struct ScriptContext *ctx) // 0230 { - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 mon_slot = ScriptGetVar(ctx); - u16 ribbon_idx = ScriptGetVar(ctx); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 mon_slot = ScriptGetVar(ctx); + u16 ribbon_idx = ScriptGetVar(ctx); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); *ret_ptr = (u16)GetMonData(party_mon, sub_0207FC5C((u8)ribbon_idx, 0), NULL); return FALSE; } -BOOL ScrCmd_GivePartyMonRibbon(struct ScriptContext* ctx) //0231 +BOOL ScrCmd_GivePartyMonRibbon(struct ScriptContext *ctx) // 0231 { - u16 mon_slot = ScriptGetVar(ctx); - u16 ribbon_idx = ScriptGetVar(ctx); - u8 mon_has_ribbon = TRUE; - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); - struct Pokemon* party_mon = Party_GetMonByIndex(party, mon_slot); + u16 mon_slot = ScriptGetVar(ctx); + u16 ribbon_idx = ScriptGetVar(ctx); + u8 mon_has_ribbon = TRUE; + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + struct Pokemon *party_mon = Party_GetMonByIndex(party, mon_slot); SetMonData(party_mon, (s32)sub_0207FC5C((u8)ribbon_idx, 0), &mon_has_ribbon); return FALSE; } -BOOL ScrCmd_CheckPartyForBadEgg(struct ScriptContext* ctx) //02B7 +BOOL ScrCmd_CheckPartyForBadEgg(struct ScriptContext *ctx) // 02B7 { u16 ribbon_idx; - u16* ret_ptr = ScriptGetVarPointer(ctx); - u16 party_count = (u16)Party_GetCount(SaveArray_Party_Get(ctx->fieldSystem->saveData)); - struct Party* party = SaveArray_Party_Get(ctx->fieldSystem->saveData); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + u16 party_count = (u16)Party_GetCount(SaveArray_Party_Get(ctx->fieldSystem->saveData)); + struct Party *party = SaveArray_Party_Get(ctx->fieldSystem->saveData); // BUG: Probably a copy-paste fail. Checks if your party has a Bad Egg in it, // 80 times. - for (ribbon_idx = 0; ribbon_idx < 80; ribbon_idx++) - { - for (u16 i = 0; i < party_count; i++) - { - struct Pokemon* party_mon = Party_GetMonByIndex(party, i); - BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); - if (party_mon_is_egg) - { + for (ribbon_idx = 0; ribbon_idx < 80; ribbon_idx++) { + for (u16 i = 0; i < party_count; i++) { + struct Pokemon *party_mon = Party_GetMonByIndex(party, i); + BOOL party_mon_is_egg = (BOOL)GetMonData(party_mon, MON_DATA_IS_EGG, NULL); + if (party_mon_is_egg) { BOOL party_mon_is_bad_egg = (BOOL)GetMonData(party_mon, MON_DATA_CHECKSUM_FAILED, NULL); - if (party_mon_is_bad_egg) - { + if (party_mon_is_bad_egg) { *ret_ptr = 1; return FALSE; } @@ -809,7 +744,7 @@ BOOL ScrCmd_CheckPartyForBadEgg(struct ScriptContext* ctx) //02B7 return FALSE; } -BOOL ScrCmd_Unk00A0(struct ScriptContext* ctx) //00A0 - todo: DummyCountPartyPokemon +BOOL ScrCmd_Unk00A0(struct ScriptContext *ctx) // 00A0 - todo: DummyCountPartyPokemon { #pragma unused(ctx) return FALSE; diff --git a/arm9/src/scrcmd_prizes.c b/arm9/src/scrcmd_prizes.c index b21cb5e1c..1ed67ac76 100644 --- a/arm9/src/scrcmd_prizes.c +++ b/arm9/src/scrcmd_prizes.c @@ -1,36 +1,38 @@ #include "global.h" -#include "scrcmd.h" + #include "constants/items.h" +#include "scrcmd.h" + const u16 gGameCornerPrizes[19][2] = { - { ITEM_SILK_SCARF, 1000 }, - { ITEM_WIDE_LENS, 1000 }, - { ITEM_ZOOM_LENS, 1000 }, - { ITEM_METRONOME, 1000 }, - { ITEM_TM90, 2000 }, - { ITEM_TM58, 2000 }, - { ITEM_TM75, 4000 }, - { ITEM_TM32, 4000 }, - { ITEM_TM44, 6000 }, - { ITEM_TM89, 6000 }, - { ITEM_TM10, 6000 }, - { ITEM_TM27, 8000 }, - { ITEM_TM21, 8000 }, - { ITEM_TM35, 10000 }, - { ITEM_TM24, 10000 }, - { ITEM_TM13, 10000 }, - { ITEM_TM29, 10000 }, - { ITEM_TM74, 15000 }, - { ITEM_TM68, 20000 }, + { ITEM_SILK_SCARF, 1000 }, + { ITEM_WIDE_LENS, 1000 }, + { ITEM_ZOOM_LENS, 1000 }, + { ITEM_METRONOME, 1000 }, + { ITEM_TM90, 2000 }, + { ITEM_TM58, 2000 }, + { ITEM_TM75, 4000 }, + { ITEM_TM32, 4000 }, + { ITEM_TM44, 6000 }, + { ITEM_TM89, 6000 }, + { ITEM_TM10, 6000 }, + { ITEM_TM27, 8000 }, + { ITEM_TM21, 8000 }, + { ITEM_TM35, 10000 }, + { ITEM_TM24, 10000 }, + { ITEM_TM13, 10000 }, + { ITEM_TM29, 10000 }, + { ITEM_TM74, 15000 }, + { ITEM_TM68, 20000 }, }; -BOOL ScrCmd_GetPrizeItemIdAndCost(struct ScriptContext* ctx) //02A6 +BOOL ScrCmd_GetPrizeItemIdAndCost(struct ScriptContext *ctx) // 02A6 { - u16 idx = ScriptGetVar(ctx); - u16* prize_item_id = ScriptGetVarPointer(ctx); - u16* prize_cost_in_coins = ScriptGetVarPointer(ctx); + u16 idx = ScriptGetVar(ctx); + u16 *prize_item_id = ScriptGetVarPointer(ctx); + u16 *prize_cost_in_coins = ScriptGetVarPointer(ctx); - *prize_item_id = gGameCornerPrizes[idx][0]; + *prize_item_id = gGameCornerPrizes[idx][0]; *prize_cost_in_coins = gGameCornerPrizes[idx][1]; return FALSE; diff --git a/arm9/src/scrcmd_sound.c b/arm9/src/scrcmd_sound.c index 7d90d2dd5..c2189c629 100644 --- a/arm9/src/scrcmd_sound.c +++ b/arm9/src/scrcmd_sound.c @@ -1,11 +1,13 @@ #include "global.h" -#include "scrcmd.h" + #include "constants/sndseq.h" + +#include "scrcmd.h" +#include "sound_chatot.h" #include "unk_020040F4.h" #include "unk_020051F4.h" -#include "sound_chatot.h" -//todo make compatible with the headers +// todo make compatible with the headers extern BOOL sub_02005CBC(void); extern void FieldSystem_SetSavedMusicId(struct FieldSystem *fieldSystem, u16); @@ -13,9 +15,9 @@ extern u16 sub_0204ABA8(struct FieldSystem *fieldSystem, u32); extern u16 sub_02005410(u16); extern BOOL sub_02005670(void); -BOOL ScrCmd_Unk02AE(struct ScriptContext *ctx) //02AE +BOOL ScrCmd_Unk02AE(struct ScriptContext *ctx) // 02AE { - u16 unk0 = ScriptReadHalfword(ctx); + u16 unk0 = ScriptReadHalfword(ctx); u16 *unk1 = ScriptGetVarPointer(ctx); *unk1 = sub_02005410(unk0); @@ -23,13 +25,13 @@ BOOL ScrCmd_Unk02AE(struct ScriptContext *ctx) //02AE return FALSE; } -BOOL ScrCmd_PlayBgm(struct ScriptContext *ctx) //0050 +BOOL ScrCmd_PlayBgm(struct ScriptContext *ctx) // 0050 { sub_0200521C(ScriptReadHalfword(ctx)); return FALSE; } -BOOL ScrCmd_StopBgm(struct ScriptContext *ctx) //0051 +BOOL ScrCmd_StopBgm(struct ScriptContext *ctx) // 0051 { ScriptReadHalfword(ctx); u16 unk0 = sub_02004124(); @@ -37,20 +39,20 @@ BOOL ScrCmd_StopBgm(struct ScriptContext *ctx) //0051 return FALSE; } -BOOL ScrCmd_PlayDefaultBgm(struct ScriptContext *ctx) //0052 +BOOL ScrCmd_PlayDefaultBgm(struct ScriptContext *ctx) // 0052 { u16 unk0 = sub_0204ABA8(ctx->fieldSystem, ctx->fieldSystem->location->mapId); sub_0200521C(unk0); return FALSE; } -BOOL ScrCmd_Unk0053(struct ScriptContext *ctx) //0053 - todo: SetMusic? SpecialMusic? +BOOL ScrCmd_Unk0053(struct ScriptContext *ctx) // 0053 - todo: SetMusic? SpecialMusic? { FieldSystem_SetSavedMusicId(ctx->fieldSystem, ScriptReadHalfword(ctx)); return FALSE; } -BOOL ScrCmd_FadeOutBgm(struct ScriptContext *ctx) //0054 +BOOL ScrCmd_FadeOutBgm(struct ScriptContext *ctx) // 0054 { u16 unk1 = ScriptReadHalfword(ctx); u16 unk2 = ScriptReadHalfword(ctx); @@ -61,17 +63,17 @@ BOOL ScrCmd_FadeOutBgm(struct ScriptContext *ctx) //0054 return TRUE; } -BOOL sub_02041464(struct ScriptContext* ctx) -{ +BOOL sub_02041464(struct ScriptContext *ctx) { #pragma unused(ctx) - if(GF_SndGetFadeTimer() == 0) + if (GF_SndGetFadeTimer() == 0) { return TRUE; - else + } else { return FALSE; + } } -BOOL ScrCmd_FadeInBgm(struct ScriptContext* ctx) //0055 +BOOL ScrCmd_FadeInBgm(struct ScriptContext *ctx) // 0055 { u16 unk = ScriptReadHalfword(ctx); @@ -81,7 +83,7 @@ BOOL ScrCmd_FadeInBgm(struct ScriptContext* ctx) //0055 return TRUE; } -BOOL ScrCmd_Unk0056(struct ScriptContext* ctx) //0056 +BOOL ScrCmd_Unk0056(struct ScriptContext *ctx) // 0056 { u8 PtrIndx0 = ScriptReadByte(ctx); @@ -92,35 +94,34 @@ BOOL ScrCmd_Unk0056(struct ScriptContext* ctx) //0056 return FALSE; } -BOOL ScrCmd_Unk0057(struct ScriptContext* ctx) //0057 - todo: PlayFieldBgm? +BOOL ScrCmd_Unk0057(struct ScriptContext *ctx) // 0057 - todo: PlayFieldBgm? { sub_02005308(4, ScriptReadHalfword(ctx)); return FALSE; } -BOOL ScrCmd_Unk0058(struct ScriptContext* ctx) //0058 +BOOL ScrCmd_Unk0058(struct ScriptContext *ctx) // 0058 { u8 PtrIndx0 = ScriptReadByte(ctx); sub_020040F4(PtrIndx0); return FALSE; } - -BOOL ScrCmd_PlayFanfare(struct ScriptContext* ctx) //0049 +BOOL ScrCmd_PlayFanfare(struct ScriptContext *ctx) // 0049 { u16 sound = ScriptGetVar(ctx); PlaySE(sound); return FALSE; } -BOOL ScrCmd_StopFanfare(struct ScriptContext* ctx) //004A +BOOL ScrCmd_StopFanfare(struct ScriptContext *ctx) // 004A { u16 unk = ScriptGetVar(ctx); sub_020054F0(unk, 0); return FALSE; } -BOOL ScrCmd_PlayFanfareWait(struct ScriptContext* ctx) //004B +BOOL ScrCmd_PlayFanfareWait(struct ScriptContext *ctx) // 004B { u16 unk = ScriptGetVar(ctx); @@ -130,39 +131,39 @@ BOOL ScrCmd_PlayFanfareWait(struct ScriptContext* ctx) //004B return TRUE; } -BOOL sub_02041540(struct ScriptContext* ctx) -{ - if(sub_02005508((u16)ctx->data[0]) == 0) +BOOL sub_02041540(struct ScriptContext *ctx) { + if (sub_02005508((u16)ctx->data[0]) == 0) { return TRUE; - else + } else { return FALSE; + } } -BOOL ScrCmd_PlayCry(struct ScriptContext* ctx) //004C +BOOL ScrCmd_PlayCry(struct ScriptContext *ctx) // 004C { - u16 unk0 = ScriptGetVar(ctx); + u16 unk0 = ScriptGetVar(ctx); u16 unused = ScriptGetVar(ctx); sub_02005578(unk0); return FALSE; } -BOOL ScrCmd_PlayCryWait(struct ScriptContext* ctx) //004D +BOOL ScrCmd_PlayCryWait(struct ScriptContext *ctx) // 004D { SetupNativeScript(ctx, sub_02041598); return TRUE; } -BOOL sub_02041598(struct ScriptContext* ctx) -{ +BOOL sub_02041598(struct ScriptContext *ctx) { #pragma unused(ctx) - if(!sub_02005670()) + if (!sub_02005670()) { return TRUE; - else + } else { return FALSE; + } } -BOOL ScrCmd_PlaySound(struct ScriptContext* ctx) //004E +BOOL ScrCmd_PlaySound(struct ScriptContext *ctx) // 004E { u16 bgm_id = ScriptReadHalfword(ctx); PlaySound(bgm_id); @@ -170,77 +171,71 @@ BOOL ScrCmd_PlaySound(struct ScriptContext* ctx) //004E return FALSE; } -BOOL ScrCmd_PlaySoundWait(struct ScriptContext* ctx) //004F +BOOL ScrCmd_PlaySoundWait(struct ScriptContext *ctx) // 004F { SetupNativeScript(ctx, sub_020415CC); return TRUE; } -BOOL sub_020415CC(struct ScriptContext* ctx) -{ +BOOL sub_020415CC(struct ScriptContext *ctx) { #pragma unused(ctx) - if (!sub_02005CBC()) + if (!sub_02005CBC()) { return TRUE; - else + } else { return FALSE; + } } -BOOL ScrCmd_CheckChatotCry(struct ScriptContext* ctx) //0059 +BOOL ScrCmd_CheckChatotCry(struct ScriptContext *ctx) // 0059 { - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); - struct SaveChatotSoundClip* chatotSoundClip = Save_Chatot_Get(ctx->fieldSystem->saveData); - if (Chatot_checkCry(chatotSoundClip) == 1) - { + struct SaveChatotSoundClip *chatotSoundClip = Save_Chatot_Get(ctx->fieldSystem->saveData); + if (Chatot_checkCry(chatotSoundClip) == 1) { *ret_ptr = 1; return FALSE; - } - else - { + } else { *ret_ptr = 0; return FALSE; } } -BOOL ScrCmd_StartChatotRecord(struct ScriptContext* ctx) //005A +BOOL ScrCmd_StartChatotRecord(struct ScriptContext *ctx) // 005A { - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); - if (Chatot_startRecording() == 0) - { + if (Chatot_startRecording() == 0) { *ret_ptr = 1; return FALSE; - } - else - { + } else { *ret_ptr = 0; return FALSE; } } -BOOL ScrCmd_StopChatotRecord(struct ScriptContext* ctx) //005B +BOOL ScrCmd_StopChatotRecord(struct ScriptContext *ctx) // 005B { #pragma unused(ctx) Chatot_stopRecording(); return TRUE; } -BOOL ScrCmd_SaveChatotCry(struct ScriptContext* ctx) //005C +BOOL ScrCmd_SaveChatotCry(struct ScriptContext *ctx) // 005C { - struct SaveChatotSoundClip* chatotSoundClip = Save_Chatot_Get(ctx->fieldSystem->saveData); + struct SaveChatotSoundClip *chatotSoundClip = Save_Chatot_Get(ctx->fieldSystem->saveData); Chatot_saveRecording(chatotSoundClip); return TRUE; } -BOOL ScrCmd_Unk005D(struct ScriptContext* ctx) //005D - todo: LoadSpearPillarAudio? +BOOL ScrCmd_Unk005D(struct ScriptContext *ctx) // 005D - todo: LoadSpearPillarAudio? { #pragma unused(ctx) sub_0200433C(0x3F, SEQ_PV001, 0); return TRUE; } -BOOL ScrCmd_SetVolume(struct ScriptContext* ctx) //0283 +BOOL ScrCmd_SetVolume(struct ScriptContext *ctx) // 0283 { u16 unk1 = ScriptGetVar(ctx); u16 unk2 = ScriptGetVar(ctx); diff --git a/arm9/src/scrcmd_underground.c b/arm9/src/scrcmd_underground.c index fe99dc757..1ff0fc7dc 100644 --- a/arm9/src/scrcmd_underground.c +++ b/arm9/src/scrcmd_underground.c @@ -1,172 +1,173 @@ #include "global.h" + #include "scrcmd.h" -extern BOOL sub_02025D6C(void*, u16); -extern BOOL sub_02025D94(void*, u16); -extern BOOL sub_02026298(void*, u16); -extern void* sub_02026CC4(struct SaveData* save); -extern BOOL sub_020260C4(void*, u16, u16); +extern BOOL sub_02025D6C(void *, u16); +extern BOOL sub_02025D94(void *, u16); +extern BOOL sub_02026298(void *, u16); +extern void *sub_02026CC4(struct SaveData *save); +extern BOOL sub_020260C4(void *, u16, u16); /* Given the amount of dummy functions in this file, I believe this is a debug file of some kind */ -BOOL ScrCmd_GiveSecretBaseDecoration(struct ScriptContext* ctx) //0083 +BOOL ScrCmd_GiveSecretBaseDecoration(struct ScriptContext *ctx) // 0083 { - struct SaveData* save = ctx->fieldSystem->saveData; - u16 unk1 = ScriptGetVar(ctx); - u16 unused = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - void* unk2 = sub_02026CC4(save); + struct SaveData *save = ctx->fieldSystem->saveData; + u16 unk1 = ScriptGetVar(ctx); + u16 unused = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + void *unk2 = sub_02026CC4(save); *ret_ptr = (u16)sub_02025D6C(unk2, unk1); return FALSE; } -BOOL ScrCmd_TakeSecretBaseDecoration(struct ScriptContext* ctx) //0084 +BOOL ScrCmd_TakeSecretBaseDecoration(struct ScriptContext *ctx) // 0084 { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_HasSpaceForDecoration(struct ScriptContext* ctx) //0085 +BOOL ScrCmd_HasSpaceForDecoration(struct ScriptContext *ctx) // 0085 { - struct SaveData* save = ctx->fieldSystem->saveData; - u16 unk1 = ScriptGetVar(ctx); - u16 unused = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - void* unk2 = sub_02026CC4(save); + struct SaveData *save = ctx->fieldSystem->saveData; + u16 unk1 = ScriptGetVar(ctx); + u16 unused = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + void *unk2 = sub_02026CC4(save); *ret_ptr = (u16)sub_02025D94(unk2, unk1); return FALSE; } -BOOL ScrCmd_GetDecorationCount(struct ScriptContext* ctx) //0086 - somewhat unsure on name, was originally CheckGoods +BOOL ScrCmd_GetDecorationCount(struct ScriptContext *ctx) // 0086 - somewhat unsure on name, was originally CheckGoods { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_GiveUndergroundTrap(struct ScriptContext* ctx) //0087 +BOOL ScrCmd_GiveUndergroundTrap(struct ScriptContext *ctx) // 0087 { - struct SaveData* save = ctx->fieldSystem->saveData; - u16 unk1 = ScriptGetVar(ctx); - u16 unused = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - void* unk2 = sub_02026CC4(save); + struct SaveData *save = ctx->fieldSystem->saveData; + u16 unk1 = ScriptGetVar(ctx); + u16 unused = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + void *unk2 = sub_02026CC4(save); *ret_ptr = (u16)sub_02026298(unk2, unk1); return FALSE; } -BOOL ScrCmd_TakeUndergroundTrap(struct ScriptContext* ctx) //0088 +BOOL ScrCmd_TakeUndergroundTrap(struct ScriptContext *ctx) // 0088 { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_HasSpaceForTrap(struct ScriptContext* ctx) //0089 +BOOL ScrCmd_HasSpaceForTrap(struct ScriptContext *ctx) // 0089 { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_GetTrapCount(struct ScriptContext* ctx) //008A +BOOL ScrCmd_GetTrapCount(struct ScriptContext *ctx) // 008A { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_GiveTreasure(struct ScriptContext* ctx) //008B +BOOL ScrCmd_GiveTreasure(struct ScriptContext *ctx) // 008B { - struct SaveData* save = ctx->fieldSystem->saveData; - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - void* unused3 = sub_02026CC4(save); + struct SaveData *save = ctx->fieldSystem->saveData; + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + void *unused3 = sub_02026CC4(save); return FALSE; } -BOOL ScrCmd_TakeTreasure(struct ScriptContext* ctx) //008C +BOOL ScrCmd_TakeTreasure(struct ScriptContext *ctx) // 008C { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_HasSpaceForTreasure(struct ScriptContext* ctx) //008D +BOOL ScrCmd_HasSpaceForTreasure(struct ScriptContext *ctx) // 008D { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_GetTreasureCount(struct ScriptContext* ctx) //008E +BOOL ScrCmd_GetTreasureCount(struct ScriptContext *ctx) // 008E { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_GiveUndergroundSphere(struct ScriptContext* ctx) //008F +BOOL ScrCmd_GiveUndergroundSphere(struct ScriptContext *ctx) // 008F { - struct SaveData* save = ctx->fieldSystem->saveData; - u16 unk1 = ScriptGetVar(ctx); - u16 unk2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); - void* unk3 = sub_02026CC4(save); + struct SaveData *save = ctx->fieldSystem->saveData; + u16 unk1 = ScriptGetVar(ctx); + u16 unk2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); + void *unk3 = sub_02026CC4(save); *ret_ptr = (u16)sub_020260C4(unk3, unk1, unk2); return FALSE; } -BOOL ScrCmd_TakeUndergroundSphere(struct ScriptContext* ctx) //0090 +BOOL ScrCmd_TakeUndergroundSphere(struct ScriptContext *ctx) // 0090 { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_HasSpaceForSphere(struct ScriptContext* ctx) //0091 +BOOL ScrCmd_HasSpaceForSphere(struct ScriptContext *ctx) // 0091 { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } -BOOL ScrCmd_GetSphereCount(struct ScriptContext* ctx) //0092 +BOOL ScrCmd_GetSphereCount(struct ScriptContext *ctx) // 0092 { - u16 unused1 = ScriptGetVar(ctx); - u16 unused2 = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + u16 unused1 = ScriptGetVar(ctx); + u16 unused2 = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); return FALSE; } diff --git a/arm9/src/scrcmd_union.c b/arm9/src/scrcmd_union.c index 4f5dcf862..e76c697d7 100644 --- a/arm9/src/scrcmd_union.c +++ b/arm9/src/scrcmd_union.c @@ -1,74 +1,73 @@ #include "global.h" -#include "scrcmd.h" -#include "message_format.h" + #include "math_util.h" +#include "message_format.h" +#include "scrcmd.h" #include "unk_020286F8.h" #include "unk_020377F0.h" -extern void* FieldSysGetAttrAddr(struct FieldSystem*, u8 idx); +extern void *FieldSysGetAttrAddr(struct FieldSystem *, u8 idx); -extern BOOL sub_020612EC(struct FieldSystem*); -extern BOOL sub_020612F8(struct FieldSystem*); +extern BOOL sub_020612EC(struct FieldSystem *); +extern BOOL sub_020612F8(struct FieldSystem *); -BOOL ScrCmd_UnionGroup(struct ScriptContext* ctx) //021D +BOOL ScrCmd_UnionGroup(struct ScriptContext *ctx) // 021D { - MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); - struct UnkSaveStruct_020286F8* unk_sav_ptr = sub_0202881C(ctx->fieldSystem->saveData); - struct SaveData* save = ctx->fieldSystem->saveData; + MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT); + struct UnkSaveStruct_020286F8 *unk_sav_ptr = sub_0202881C(ctx->fieldSystem->saveData); + struct SaveData *save = ctx->fieldSystem->saveData; u16 option = ScriptReadHalfword(ctx); - switch (option) - { - case 0: { //check if group ID exists - u16 unk_var = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + switch (option) { + case 0: { // check if group ID exists + u16 unk_var = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = (u16)sub_02028828(unk_sav_ptr, unk_var); return FALSE; } - case 1: { //check if group ID is accessible - u16 unk_var = ScriptGetVar(ctx); - u16* ret_ptr = ScriptGetVarPointer(ctx); + case 1: { // check if group ID is accessible + u16 unk_var = ScriptGetVar(ctx); + u16 *ret_ptr = ScriptGetVarPointer(ctx); *ret_ptr = (u16)sub_02028840(unk_sav_ptr, unk_var); return FALSE; } - case 2: { //writes group ID to string buffer + case 2: { // writes group ID to string buffer u16 unk_var = ScriptGetVar(ctx); - u16 idx = ScriptGetVar(ctx); + u16 idx = ScriptGetVar(ctx); BufferGroupName(*messageFormat, save, unk_var, idx, 0); break; } - case 3: { //writes group leader name to string buffer + case 3: { // writes group leader name to string buffer u16 unk_var = ScriptGetVar(ctx); - u16 idx = ScriptGetVar(ctx); + u16 idx = ScriptGetVar(ctx); BufferGroupName(*messageFormat, save, unk_var, idx, 1); break; } - case 4: { //opens keyboard, 2 if group id exists, 1 if cancel, 0 otherwise - u16* unk_str_ptr = sub_020287A8(unk_sav_ptr, 0, 0); - u16* ret_ptr = ScriptGetVarPointer(ctx); + case 4: { // opens keyboard, 2 if group id exists, 1 if cancel, 0 otherwise + u16 *unk_str_ptr = sub_020287A8(unk_sav_ptr, 0, 0); + u16 *ret_ptr = ScriptGetVarPointer(ctx); - CreateNamingScreen(ctx->taskManager, NAMINGSCREEN_GROUP, 0, PLAYER_NAME_LENGTH, 0, unk_str_ptr, ret_ptr); //should be GROUP_NAME_LENGTH? + CreateNamingScreen(ctx->taskManager, NAMINGSCREEN_GROUP, 0, PLAYER_NAME_LENGTH, 0, unk_str_ptr, ret_ptr); // should be GROUP_NAME_LENGTH? return TRUE; } - case 5: { //enter in group id (whatever this means, needs more investigation) - u16 src_idx = ScriptGetVar(ctx); + case 5: { // enter in group id (whatever this means, needs more investigation) + u16 src_idx = ScriptGetVar(ctx); BOOL unk_bool = sub_02028828(unk_sav_ptr, 1); sub_02028700(unk_sav_ptr, src_idx, 1); - if (unk_bool != FALSE) - { + if (unk_bool != FALSE) { sub_020612F8(ctx->fieldSystem); } return FALSE; } - case 6: { //create a group - struct String* player_name = String_New(64, HEAP_ID_32); - PlayerProfile* player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); + case 6: { // create a group + struct String *player_name = String_New(64, HEAP_ID_32); + PlayerProfile *player = Save_PlayerData_GetProfileAddr(ctx->fieldSystem->saveData); PlayerName_FlatToString(player, player_name); sub_020287C0(unk_sav_ptr, 0, 1, player_name); diff --git a/arm9/src/script.c b/arm9/src/script.c index 4ba7a5256..25c9b9f45 100644 --- a/arm9/src/script.c +++ b/arm9/src/script.c @@ -1,82 +1,76 @@ -#include "global.h" #include "script.h" -void InitScriptContext(struct ScriptContext *ctx, void *cmdTable, u32 cmdCount) -{ +#include "global.h" + +void InitScriptContext(struct ScriptContext *ctx, void *cmdTable, u32 cmdCount) { int i; - ctx->mode = 0; - ctx->scriptPtr = NULL; + ctx->mode = 0; + ctx->scriptPtr = NULL; ctx->stackDepth = 0; - ctx->nativePtr = NULL; - ctx->cmdTable = cmdTable; - ctx->cmdCount = cmdCount; + ctx->nativePtr = NULL; + ctx->cmdTable = cmdTable; + ctx->cmdCount = cmdCount; - for (i = 0; i < NELEMS(ctx->data); i++) + for (i = 0; i < NELEMS(ctx->data); i++) { ctx->data[i] = 0; + } - for (i = 0; i < NELEMS(ctx->stack); i++) + for (i = 0; i < NELEMS(ctx->stack); i++) { ctx->stack[i] = NULL; + } ctx->taskManager = NULL; } -u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr) -{ +u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr) { ctx->scriptPtr = ptr; - ctx->mode = 1; + ctx->mode = 1; return 1; } -void SetupNativeScript(struct ScriptContext *ctx, BOOL (*ptr)(struct ScriptContext *)) -{ - ctx->mode = 2; +void SetupNativeScript(struct ScriptContext *ctx, BOOL (*ptr)(struct ScriptContext *)) { + ctx->mode = 2; ctx->nativePtr = ptr; } -void StopScript(struct ScriptContext *ctx) -{ - ctx->mode = 0; +void StopScript(struct ScriptContext *ctx) { + ctx->mode = 0; ctx->scriptPtr = 0; } -void sub_02038B6C(struct ScriptContext *ctx, struct TaskManager *taskManager) -{ +void sub_02038B6C(struct ScriptContext *ctx, struct TaskManager *taskManager) { ctx->taskManager = taskManager; } -u8 RunScriptCommand(struct ScriptContext *ctx) -{ - if (ctx->mode == 0) +u8 RunScriptCommand(struct ScriptContext *ctx) { + if (ctx->mode == 0) { return FALSE; + } - switch (ctx->mode) - { + switch (ctx->mode) { case 0: return FALSE; case 2: - if (ctx->nativePtr) - { - if (ctx->nativePtr(ctx) == TRUE) + if (ctx->nativePtr) { + if (ctx->nativePtr(ctx) == TRUE) { ctx->mode = 1; + } return TRUE; } ctx->mode = 1; case 1: - while (1) - { + while (1) { u16 cmdCode; ScrCmdFunc *func; - if (!ctx->scriptPtr) - { + if (!ctx->scriptPtr) { ctx->mode = 0; return FALSE; } cmdCode = ScriptReadHalfword(ctx); - if (cmdCode >= ctx->cmdCount) - { + if (cmdCode >= ctx->cmdCount) { GF_ASSERT(0); ctx->mode = 0; return FALSE; @@ -84,63 +78,55 @@ u8 RunScriptCommand(struct ScriptContext *ctx) func = &ctx->cmdTable[cmdCode]; - if ((*func)(ctx) == 1) + if ((*func)(ctx) == 1) { break; + } } } return TRUE; } -u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr) -{ - if (ctx->stackDepth + 1 >= 20) - { +u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr) { + if (ctx->stackDepth + 1 >= 20) { return 1; - } - else - { + } else { ctx->stack[ctx->stackDepth] = ptr; ctx->stackDepth++; return 0; } } -const u8 *ScriptPop(struct ScriptContext *ctx) -{ - if (ctx->stackDepth == 0) +const u8 *ScriptPop(struct ScriptContext *ctx) { + if (ctx->stackDepth == 0) { return NULL; + } ctx->stackDepth--; return ctx->stack[ctx->stackDepth]; } -void ScriptJump(struct ScriptContext *ctx, const u8 *ptr) -{ +void ScriptJump(struct ScriptContext *ctx, const u8 *ptr) { ctx->scriptPtr = ptr; } -u8 ScriptCall(struct ScriptContext *ctx, const u8 *ptr) -{ - u8 ret = ScriptPush(ctx, ctx->scriptPtr); +u8 ScriptCall(struct ScriptContext *ctx, const u8 *ptr) { + u8 ret = ScriptPush(ctx, ctx->scriptPtr); ctx->scriptPtr = ptr; return ret; } -void ScriptReturn(struct ScriptContext *ctx) -{ +void ScriptReturn(struct ScriptContext *ctx) { ctx->scriptPtr = ScriptPop(ctx); } -u16 ScriptReadHalfword(struct ScriptContext *ctx) -{ +u16 ScriptReadHalfword(struct ScriptContext *ctx) { u16 value = *(ctx->scriptPtr++); value += *(ctx->scriptPtr++) << 8; return value; } -u32 ScriptReadWord(struct ScriptContext *ctx) -{ +u32 ScriptReadWord(struct ScriptContext *ctx) { u32 value0 = *(ctx->scriptPtr++); u32 value1 = *(ctx->scriptPtr++); u32 value2 = *(ctx->scriptPtr++); diff --git a/arm9/src/script_pokemon_util.c b/arm9/src/script_pokemon_util.c index 1ef478a8d..697579f94 100644 --- a/arm9/src/script_pokemon_util.c +++ b/arm9/src/script_pokemon_util.c @@ -1,39 +1,41 @@ +#include "script_pokemon_util.h" + #include "global.h" + +#include "constants/items.h" +#include "constants/script_pokemon_util.h" + #include "heap.h" +#include "overlay_05.h" #include "party.h" #include "player_data.h" #include "pokemon.h" #include "save.h" #include "unk_02015CC0.h" #include "unk_0202C144.h" -#include "overlay_05.h" -#include "script_pokemon_util.h" -#include "constants/items.h" -#include "constants/script_pokemon_util.h" -BOOL MonNotFaintedOrEgg(struct Pokemon * pokemon) -{ - if (GetMonData(pokemon, MON_DATA_HP, NULL) == 0) +BOOL MonNotFaintedOrEgg(struct Pokemon *pokemon) { + if (GetMonData(pokemon, MON_DATA_HP, NULL) == 0) { + return FALSE; + } + if (GetMonData(pokemon, MON_DATA_IS_EGG, NULL)) { return FALSE; - if (GetMonData(pokemon, MON_DATA_IS_EGG, NULL)) - return FALSE; + } return TRUE; } -BOOL GiveMon(HeapID heapId, struct SaveData * save, u16 species, u8 level, u16 item, u32 mapSec, u32 encounterType) -{ +BOOL GiveMon(HeapID heapId, struct SaveData *save, u16 species, u8 level, u16 item, u32 mapSec, u32 encounterType) { u32 ptr; - PlayerProfile * data = Save_PlayerData_GetProfileAddr(save); - struct Party * party = SaveArray_Party_Get(save); - struct Pokemon * mon = AllocMonZeroed(heapId); + PlayerProfile *data = Save_PlayerData_GetProfileAddr(save); + struct Party *party = SaveArray_Party_Get(save); + struct Pokemon *mon = AllocMonZeroed(heapId); ZeroMonData(mon); CreateMon(mon, species, level, 32, 0, 0, OT_ID_PLAYER_ID, 0); sub_0206A014(mon, data, ITEM_POKE_BALL, mapSec, encounterType, heapId); ptr = item; SetMonData(mon, MON_DATA_HELD_ITEM, &ptr); BOOL isAdded = Party_AddMon(party, mon); - if (isAdded) - { + if (isAdded) { sub_0202C144(save, mon); } FreeToHeap(mon); @@ -41,12 +43,11 @@ BOOL GiveMon(HeapID heapId, struct SaveData * save, u16 species, u8 level, u16 i } /* Seems to have something to do with Manaphy Egg*/ -BOOL GiveEgg(HeapID heapId, struct SaveData * save, u16 species, int level, int metLocIndex, int a3) -{ +BOOL GiveEgg(HeapID heapId, struct SaveData *save, u16 species, int level, int metLocIndex, int a3) { #pragma unused(heapId) - PlayerProfile * data = Save_PlayerData_GetProfileAddr(save); - struct Party * party = SaveArray_Party_Get(save); - struct Pokemon * mon = AllocMonZeroed(HEAP_ID_32); + PlayerProfile *data = Save_PlayerData_GetProfileAddr(save); + struct Party *party = SaveArray_Party_Get(save); + struct Pokemon *mon = AllocMonZeroed(HEAP_ID_32); ZeroMonData(mon); ov05_SetEggStats(mon, species, level, data, 4, sub_02015CF8(metLocIndex, a3)); BOOL isAdded = Party_AddMon(party, mon); @@ -54,145 +55,137 @@ BOOL GiveEgg(HeapID heapId, struct SaveData * save, u16 species, int level, int return isAdded; } -void PartyMonSetMoveInSlot(struct Party * party, int partySlot, int moveSlot, u16 move) -{ - struct Pokemon * mon = Party_GetMonByIndex(party, partySlot); +void PartyMonSetMoveInSlot(struct Party *party, int partySlot, int moveSlot, u16 move) { + struct Pokemon *mon = Party_GetMonByIndex(party, partySlot); MonSetMoveInSlot(mon, move, (u8)moveSlot); } -int GetIdxOfFirstPartyMonWithMove(struct Party * party, int move) -{ +int GetIdxOfFirstPartyMonWithMove(struct Party *party, int move) { int partyCount = Party_GetCount(party); - for (int i = 0; i < partyCount; i++) - { - struct Pokemon * mon = Party_GetMonByIndex(party, i); - - if (GetMonData(mon, MON_DATA_IS_EGG, NULL)) + for (int i = 0; i < partyCount; i++) { + struct Pokemon *mon = Party_GetMonByIndex(party, i); + + if (GetMonData(mon, MON_DATA_IS_EGG, NULL)) { continue; + } if (GetMonData(mon, MON_DATA_MOVE1, NULL) == move || GetMonData(mon, MON_DATA_MOVE2, NULL) == move || GetMonData(mon, MON_DATA_MOVE3, NULL) == move - || GetMonData(mon, MON_DATA_MOVE4, NULL) == move) + || GetMonData(mon, MON_DATA_MOVE4, NULL) == move) { return i; + } } return 0xFF; } -int CountAlivePokemon(struct Party * party) -{ +int CountAlivePokemon(struct Party *party) { int partyCount = Party_GetCount(party); int i; int aliveCount = 0; - for (i = 0; i < partyCount; i++) - { - struct Pokemon * mon = Party_GetMonByIndex(party, i); - - if(MonNotFaintedOrEgg(mon)) + for (i = 0; i < partyCount; i++) { + struct Pokemon *mon = Party_GetMonByIndex(party, i); + + if (MonNotFaintedOrEgg(mon)) { aliveCount++; + } } return aliveCount; } -struct Pokemon * GetFirstAliveMonInParty_CrashIfNone(struct Party * party) -{ +struct Pokemon *GetFirstAliveMonInParty_CrashIfNone(struct Party *party) { int i; int partyCount = Party_GetCount(party); - for (i = 0; i < partyCount; i++) - { - struct Pokemon * mon = Party_GetMonByIndex(party, i); - - if(MonNotFaintedOrEgg(mon)) + for (i = 0; i < partyCount; i++) { + struct Pokemon *mon = Party_GetMonByIndex(party, i); + + if (MonNotFaintedOrEgg(mon)) { return mon; + } } GF_ASSERT(0); return 0; } -struct Pokemon * GetFirstNonEggInParty(struct Party * party) -{ +struct Pokemon *GetFirstNonEggInParty(struct Party *party) { u16 i; u16 partyCount = (u16)Party_GetCount(party); - for (i = 0; i < partyCount; i++) - { - struct Pokemon * mon = Party_GetMonByIndex(party, i); + for (i = 0; i < partyCount; i++) { + struct Pokemon *mon = Party_GetMonByIndex(party, i); - if (!GetMonData(mon, MON_DATA_IS_EGG, NULL)) + if (!GetMonData(mon, MON_DATA_IS_EGG, NULL)) { return mon; + } } return 0; } -BOOL HasEnoughAlivePokemonForDoubleBattle(struct Party * party) -{ - return (CountAlivePokemon(party) >= 2); +BOOL HasEnoughAlivePokemonForDoubleBattle(struct Party *party) { + return CountAlivePokemon(party) >= 2; } -void GiveAllMonsTheSinnohChampRibbon(struct Party * party) -{ - u8 var = 1; +void GiveAllMonsTheSinnohChampRibbon(struct Party *party) { + u8 var = 1; int partyCount = Party_GetCount(party); - - for (int i = 0; i < partyCount; i++) - { - struct Pokemon * mon = Party_GetMonByIndex(party, i); - - if (GetMonData(mon, MON_DATA_IS_EGG, NULL)) + for (int i = 0; i < partyCount; i++) { + struct Pokemon *mon = Party_GetMonByIndex(party, i); + + if (GetMonData(mon, MON_DATA_IS_EGG, NULL)) { continue; + } SetMonData(mon, MON_DATA_SINNOH_CHAMP_RIBBON, &var); } } -int ApplyPoisonStep(struct Party * party, int location) -{ +int ApplyPoisonStep(struct Party *party, int location) { u32 hp; int numPoisoned = 0; - int numHealed = 0; - int partyCount = Party_GetCount(party); - - for (int i = 0; i < partyCount; i++) - { - struct Pokemon * mon = Party_GetMonByIndex(party, i); - - if(!MonNotFaintedOrEgg(mon)) + int numHealed = 0; + int partyCount = Party_GetCount(party); + + for (int i = 0; i < partyCount; i++) { + struct Pokemon *mon = Party_GetMonByIndex(party, i); + + if (!MonNotFaintedOrEgg(mon)) { continue; + } - if (!(GetMonData(mon, MON_DATA_STATUS, NULL) & 0x88)) + if (!(GetMonData(mon, MON_DATA_STATUS, NULL) & 0x88)) { continue; + } hp = GetMonData(mon, MON_DATA_HP, NULL); - if (hp > 1) + if (hp > 1) { hp--; + } SetMonData(mon, MON_DATA_HP, &hp); - if (hp == 1) - { + if (hp == 1) { numHealed++; MonApplyFriendshipMod(mon, FRIENDSHIP_EVENT_HEAL_FIELD_PSN, (u32)location); } numPoisoned++; } - if (numHealed != 0) + if (numHealed != 0) { return FLDPSN_HEAL; - - if (numPoisoned != 0) + } + + if (numPoisoned != 0) { return FLDPSN_PSN; - + } + return FLDPSN_NONE; } -BOOL SurvivePoisoning(struct Pokemon * mon) -{ +BOOL SurvivePoisoning(struct Pokemon *mon) { int status; - if (GetMonData(mon, MON_DATA_STATUS, NULL) & 0x88) - { - if (GetMonData(mon, MON_DATA_HP, NULL) == 1) - { + if (GetMonData(mon, MON_DATA_STATUS, NULL) & 0x88) { + if (GetMonData(mon, MON_DATA_HP, NULL) == 1) { status = 0; SetMonData(mon, MON_DATA_STATUS, &status); return TRUE; diff --git a/arm9/src/seal_case.c b/arm9/src/seal_case.c index 913b0cf1c..edbc8d15b 100644 --- a/arm9/src/seal_case.c +++ b/arm9/src/seal_case.c @@ -1,57 +1,48 @@ #include "global.h" -#include "save.h" + #include "MI_memory.h" +#include "save.h" #include "seal.h" -u32 Save_SealCase_sizeof(void) -{ +u32 Save_SealCase_sizeof(void) { return sizeof(struct SealCase); } -void Save_SealCase_Init(struct SealCase * sealCase) -{ +void Save_SealCase_Init(struct SealCase *sealCase) { MI_CpuClear8(sealCase, Save_SealCase_sizeof()); } -void CapsuleArray_Copy(const CapsuleArray * a0, CapsuleArray * a1) -{ +void CapsuleArray_Copy(const CapsuleArray *a0, CapsuleArray *a1) { MI_CpuCopy8(a0, a1, sizeof(CapsuleArray)); } -struct SealCase * Save_SealCase_Get(struct SaveData * save) -{ +struct SealCase *Save_SealCase_Get(struct SaveData *save) { return (struct SealCase *)SaveArray_Get(save, 21); } -CapsuleArray * SealCase_GetCapsuleI(struct SealCase * sealCase, s32 idx) -{ +CapsuleArray *SealCase_GetCapsuleI(struct SealCase *sealCase, s32 idx) { GF_ASSERT(idx < 12); return &sealCase->coords[idx]; } -void SealCase_SetCapsuleI(struct SealCase * sealCase, const CapsuleArray * src, s32 idx) -{ +void SealCase_SetCapsuleI(struct SealCase *sealCase, const CapsuleArray *src, s32 idx) { GF_ASSERT(idx < 12); CapsuleArray_Copy(src, SealCase_GetCapsuleI(sealCase, idx)); } -Coords8 * Capsule_GetSealI(CapsuleArray * a0, s32 a1) -{ +Coords8 *Capsule_GetSealI(CapsuleArray *a0, s32 a1) { GF_ASSERT(a1 < 8); return &(*a0)[a1]; } -s32 Seal_GetId(Coords8 * a0) -{ +s32 Seal_GetId(Coords8 *a0) { return (*a0)[0]; } -s32 Seal_GetXCoord(Coords8 * a0) -{ +s32 Seal_GetXCoord(Coords8 *a0) { return (*a0)[1]; } -s32 Seal_GetYCoord(Coords8 * a0) -{ +s32 Seal_GetYCoord(Coords8 *a0) { return (*a0)[2]; } diff --git a/arm9/src/sound.c b/arm9/src/sound.c index d1dfd2476..553704c35 100644 --- a/arm9/src/sound.c +++ b/arm9/src/sound.c @@ -1,10 +1,12 @@ -#include "global.h" #include "sound.h" + +#include "global.h" + #include "SPI_mic.h" #include "SPI_pm.h" +#include "sound_chatot.h" #include "unk_020040F4.h" #include "unk_020051F4.h" -#include "sound_chatot.h" static struct SoundData sSoundDataBuffer; static u32 UNK_02107070; @@ -18,9 +20,8 @@ void sub_02004088(struct SoundData *); void sub_020040A4(struct SoundData *); void sub_020040DC(void); -void InitSoundData(struct SaveChatotSoundClip * chatot, struct Options * options) -{ - struct SoundData * sdat = GetSoundDataPointer(); +void InitSoundData(struct SaveChatotSoundClip *chatot, struct Options *options) { + struct SoundData *sdat = GetSoundDataPointer(); NNS_SndInit(); GF_InitMic(); GF_SoundDataInit(sdat); @@ -34,45 +35,42 @@ void InitSoundData(struct SaveChatotSoundClip * chatot, struct Options * options GF_SndSetMonoFlag(options->soundMethod); } -void DoSoundUpdateFrame(void) -{ - struct SoundData * sdat = GetSoundDataPointer(); - if (!sub_02003D04()) - { - if (sdat->unk_BCD00 > 0) +void DoSoundUpdateFrame(void) { + struct SoundData *sdat = GetSoundDataPointer(); + if (!sub_02003D04()) { + if (sdat->unk_BCD00 > 0) { sdat->unk_BCD00--; + } sub_02003C40(); } sub_02005CFC(); NNS_SndMain(); } -void sub_02003C40(void) -{ - struct SoundData * sdat = GetSoundDataPointer(); - switch (UNK_02107070) - { +void sub_02003C40(void) { + struct SoundData *sdat = GetSoundDataPointer(); + switch (UNK_02107070) { case 1: sub_02003CE8(2); break; case 3: - if (GF_SndGetFadeTimer() == 0) + if (GF_SndGetFadeTimer() == 0) { sub_02003CE8(2); + } break; case 4: - if (GF_SndGetFadeTimer() == 0) + if (GF_SndGetFadeTimer() == 0) { sub_02003CE8(2); + } break; case 5: - if (GF_SndGetFadeTimer() == 0 && !sub_02004D94()) - { + if (GF_SndGetFadeTimer() == 0 && !sub_02004D94()) { sub_020040DC(); sub_0200521C(sdat->unk_BCD0E); } break; case 6: - if (GF_SndGetFadeTimer() == 0 && !sub_02004D94()) - { + if (GF_SndGetFadeTimer() == 0 && !sub_02004D94()) { sub_020040DC(); sub_0200521C(sdat->unk_BCD0E); sub_0200538C(0x7F, sdat->unk_BCD08, 0); @@ -81,31 +79,27 @@ void sub_02003C40(void) } } -void sub_02003CE8(int a0) -{ - struct SoundData * sdat = GetSoundDataPointer(); - sdat->unk_BCCFC = 0; - UNK_02107070 = (u32)a0; +void sub_02003CE8(int a0) { + struct SoundData *sdat = GetSoundDataPointer(); + sdat->unk_BCCFC = 0; + UNK_02107070 = (u32)a0; } -BOOL sub_02003D04(void) -{ - struct SoundData * sdat = GetSoundDataPointer(); - if (GF_SndPlayerCountPlayingSeqByPlayerNo(2)) +BOOL sub_02003D04(void) { + struct SoundData *sdat = GetSoundDataPointer(); + if (GF_SndPlayerCountPlayingSeqByPlayerNo(2)) { return TRUE; + } return sdat->unk_BCD12 != 0; } -struct SoundData * GetSoundDataPointer(void) -{ +struct SoundData *GetSoundDataPointer(void) { return &sSoundDataBuffer; } -void * sub_02003D38(u32 a0) -{ - struct SoundData * sdat = GetSoundDataPointer(); - switch (a0) - { +void *sub_02003D38(u32 a0) { + struct SoundData *sdat = GetSoundDataPointer(); + switch (a0) { case 5: return &sdat->unk_BCCFE; case 0: @@ -192,67 +186,57 @@ void * sub_02003D38(u32 a0) } } -int GF_Snd_SaveState(int * level_p) -{ - struct SoundData * sdat = GetSoundDataPointer(); - int level = NNS_SndHeapSaveState(sdat->heap); +int GF_Snd_SaveState(int *level_p) { + struct SoundData *sdat = GetSoundDataPointer(); + int level = NNS_SndHeapSaveState(sdat->heap); GF_ASSERT(level != -1); - if (level_p != NULL) + if (level_p != NULL) { *level_p = level; + } return level; } -void GF_Snd_RestoreState(int level) -{ - struct SoundData * sdat = GetSoundDataPointer(); +void GF_Snd_RestoreState(int level) { + struct SoundData *sdat = GetSoundDataPointer(); NNS_SndHeapLoadState(sdat->heap, level); } -BOOL GF_Snd_LoadGroup(int groupNo) -{ - struct SoundData * sdat = GetSoundDataPointer(); +BOOL GF_Snd_LoadGroup(int groupNo) { + struct SoundData *sdat = GetSoundDataPointer(); return NNS_SndArcLoadGroup(groupNo, sdat->heap); } -BOOL GF_Snd_LoadSeq(int seqNo) -{ - struct SoundData * sdat = GetSoundDataPointer(); +BOOL GF_Snd_LoadSeq(int seqNo) { + struct SoundData *sdat = GetSoundDataPointer(); return NNS_SndArcLoadSeq(seqNo, sdat->heap); } -BOOL GF_Snd_LoadSeqEx(int seqNo, u32 loadFlag) -{ - struct SoundData * sdat = GetSoundDataPointer(); +BOOL GF_Snd_LoadSeqEx(int seqNo, u32 loadFlag) { + struct SoundData *sdat = GetSoundDataPointer(); return NNS_SndArcLoadSeqEx(seqNo, loadFlag, sdat->heap); } -BOOL GF_Snd_LoadWaveArc(int waveArcNo) -{ - struct SoundData * sdat = GetSoundDataPointer(); +BOOL GF_Snd_LoadWaveArc(int waveArcNo) { + struct SoundData *sdat = GetSoundDataPointer(); return NNS_SndArcLoadWaveArc(waveArcNo, sdat->heap); } -BOOL GF_Snd_LoadBank(int bankNo) -{ - struct SoundData * sdat = GetSoundDataPointer(); +BOOL GF_Snd_LoadBank(int bankNo) { + struct SoundData *sdat = GetSoundDataPointer(); return NNS_SndArcLoadBank(bankNo, sdat->heap); } -u32 * GetSoundPlayer(int playerNo) -{ - struct SoundData * sdat = GetSoundDataPointer(); - if (playerNo >= (s32)NELEMS(sdat->players)) - { +u32 *GetSoundPlayer(int playerNo) { + struct SoundData *sdat = GetSoundDataPointer(); + if (playerNo >= (s32)NELEMS(sdat->players)) { GF_ASSERT(0); playerNo = 0; } return &sdat->players[playerNo]; } -int sub_02004018(u32 a0) -{ - switch (a0) - { +int sub_02004018(u32 a0) { + switch (a0) { case 1: return 0; case 0: @@ -275,39 +259,34 @@ int sub_02004018(u32 a0) } } -void GF_SoundDataInit(struct SoundData * sdat) -{ +void GF_SoundDataInit(struct SoundData *sdat) { int i; memset(sdat, 0, sizeof(*sdat)); - for (i = 0; i < 7; i++) + for (i = 0; i < 7; i++) { sdat->unk_BCD1C[i] = i + 1; + } } -void sub_02004088(struct SoundData * sdat) -{ +void sub_02004088(struct SoundData *sdat) { int i; - for (i = 0; i < 9; i++) - { + for (i = 0; i < 9; i++) { NNS_SndHandleInit(&sdat->players[i]); } } -void sub_020040A4(struct SoundData * sdat) -{ +void sub_020040A4(struct SoundData *sdat) { GF_Snd_SaveState(&sdat->unk_BCD1C[0]); GF_Snd_LoadGroup(0); GF_Snd_SaveState(&sdat->unk_BCD1C[1]); } -void GF_InitMic(void) -{ +void GF_InitMic(void) { MIC_Init(); PM_SetAmp(1); PM_SetAmpGain(2); } -void sub_020040DC(void) -{ +void sub_020040DC(void) { NNS_SndPlayerStopSeqByPlayerNo(7, 0); NNS_SndHandleReleaseSeq(GetSoundPlayer(7)); } diff --git a/arm9/src/sound_chatot.c b/arm9/src/sound_chatot.c index 8b7e6b063..eb4828ef1 100644 --- a/arm9/src/sound_chatot.c +++ b/arm9/src/sound_chatot.c @@ -1,5 +1,7 @@ -#include "global.h" #include "sound_chatot.h" + +#include "global.h" + #include "SPI_mic.h" #include "math_util.h" #include "proto.h" @@ -8,10 +10,8 @@ #include "unk_020040F4.h" #include "unk_020051F4.h" -BOOL sub_02005CFC(void) -{ - if (*(u8 *)sub_02003D38(29) == 1 && sub_02004ABC(14) == 0) - { +BOOL sub_02005CFC(void) { + if (*(u8 *)sub_02003D38(29) == 1 && sub_02004ABC(14) == 0) { sub_02005DFC(); return TRUE; @@ -20,32 +20,27 @@ BOOL sub_02005CFC(void) return FALSE; } -BOOL Chatot_checkCry(struct SaveChatotSoundClip *param0) -{ +BOOL Chatot_checkCry(struct SaveChatotSoundClip *param0) { u8 *r4 = sub_02003D38(30); - if (!Chatot_Exists(param0)) - { + if (!Chatot_Exists(param0)) { return FALSE; } - if (*r4 != 1) - { + if (*r4 != 1) { return TRUE; } return FALSE; } -u32 sub_02005D48(struct SaveChatotSoundClip *param0, u32 param1, s32 param2, s32 param3) -{ +u32 sub_02005D48(struct SaveChatotSoundClip *param0, u32 param1, s32 param2, s32 param3) { #pragma unused(param1) s8 *st0 = sub_02004DB4(); u8 *st4 = sub_02003D38(29); - if (!Chatot_checkCry(param0)) - { + if (!Chatot_checkCry(param0)) { return 0; } @@ -77,13 +72,11 @@ u32 sub_02005D48(struct SaveChatotSoundClip *param0, u32 param1, s32 param2, s32 return res; } -void sub_02005DFC(void) -{ +void sub_02005DFC(void) { u8 *r5 = sub_02003D38(15); u8 *r4 = sub_02003D38(29); - if (*r5 == 1) - { + if (*r5 == 1) { sub_02004C3C(14); sub_02004A04(14); } @@ -91,15 +84,13 @@ void sub_02005DFC(void) *r4 = 0; } -u32 Chatot_startRecording(void) -{ +u32 Chatot_startRecording(void) { struct MIC_SamplingData st0; st0.unk00 = 2; st0.unk04 = sub_02004DB4(); st0.unk08 = 2000; - if ((st0.unk08 & 0x1f) != 0) - { + if ((st0.unk08 & 0x1f) != 0) { st0.unk08 &= ~0x1f; } st0.unk0c = 0x4174; @@ -110,72 +101,57 @@ u32 Chatot_startRecording(void) return GF_MIC_StartAutoSampling(&st0); } -void Chatot_stopRecording(void) -{ +void Chatot_stopRecording(void) { GF_MIC_StopAutoSampling(); } -void Chatot_saveRecording(struct SaveChatotSoundClip *param0) -{ +void Chatot_saveRecording(struct SaveChatotSoundClip *param0) { Chatot_Encode(param0, sub_02004DB4()); } -void sub_02005E80(u8 param0) -{ +void sub_02005E80(u8 param0) { *(u8 *)sub_02003D38(30) = param0; } -void sub_02005E90(struct SaveChatotSoundClip *param0, u32 param1, s32 param2, s32 param3) -{ +void sub_02005E90(struct SaveChatotSoundClip *param0, u32 param1, s32 param2, s32 param3) { struct SaveChatotSoundClip **r0 = sub_02003D38(35); u32 ret; - if (param0 == 0) - { + if (param0 == 0) { ret = sub_02005D48(*r0, param1, param2, param3); - } - else - { + } else { ret = sub_02005D48(param0, param1, param2, param3); } - if (ret == 0) - { + if (ret == 0) { sub_02005E80(1); sub_020056AC(0, SPECIES_CHATOT, param3, param2, HEAP_ID_FIELD); } } -u32 sub_02005EE0(struct SaveChatotSoundClip *param0) -{ - if (!Chatot_Exists(param0)) - { +u32 sub_02005EE0(struct SaveChatotSoundClip *param0) { + if (!Chatot_Exists(param0)) { return 0; } s8 r0 = Chatot_GetData(param0)[15]; - if (r0 < -30) - { + if (r0 < -30) { return 1; - } - else if (r0 >= 30 && r0 < 128) - { + } else if (r0 >= 30 && r0 < 128) { return 2; } return 0; } -BOOL sub_02005F14(s32 param0) -{ - switch (param0) - { - case 0: - case 1: - case 5: - case 11: - case 12: - return TRUE; - default: - return FALSE; +BOOL sub_02005F14(s32 param0) { + switch (param0) { + case 0: + case 1: + case 5: + case 11: + case 12: + return TRUE; + default: + return FALSE; } } diff --git a/arm9/src/string_control_code.c b/arm9/src/string_control_code.c index 806c29e22..2a4862c42 100644 --- a/arm9/src/string_control_code.c +++ b/arm9/src/string_control_code.c @@ -1,8 +1,8 @@ -#include "global.h" #include "string_control_code.h" -const u16 * MsgArray_SkipControlCode(const u16 *arr) -{ +#include "global.h" + +const u16 *MsgArray_SkipControlCode(const u16 *arr) { GF_ASSERT(*arr == EXT_CTRL_CODE_BEGIN); if (*arr == EXT_CTRL_CODE_BEGIN) { u16 size = arr[2]; @@ -12,19 +12,16 @@ const u16 * MsgArray_SkipControlCode(const u16 *arr) return arr; } -u32 MsgArray_GetControlCode(const u16 *arr) -{ +u32 MsgArray_GetControlCode(const u16 *arr) { GF_ASSERT(*arr == EXT_CTRL_CODE_BEGIN); return arr[1]; } -BOOL MsgArray_ControlCodeIsStrVar(const u16 *arr) -{ +BOOL MsgArray_ControlCodeIsStrVar(const u16 *arr) { return (MsgArray_GetControlCode(arr) & 0xFF00) == 0x100; } -u32 MsgArray_ControlCodeGetField(const u16 *arr, u32 fieldno) -{ +u32 MsgArray_ControlCodeGetField(const u16 *arr, u32 fieldno) { GF_ASSERT(*arr == EXT_CTRL_CODE_BEGIN); GF_ASSERT(fieldno < arr[2]); return arr[3 + fieldno]; diff --git a/arm9/src/string_util.c b/arm9/src/string_util.c index 1be501366..d4d200263 100644 --- a/arm9/src/string_util.c +++ b/arm9/src/string_util.c @@ -1,6 +1,7 @@ -#include "global.h" #include "string_util.h" +#include "global.h" + const u16 gDigitTable[] = { 0xA2, 0xA3, @@ -21,32 +22,30 @@ const u16 gDigitTable[] = { }; const s32 gPowersOfTen[] = { - 1, - 10, - 100, - 1000, - 10000, - 100000, - 1000000, - 10000000, - 100000000, + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000, 1000000000, }; -void CopyU16StringArray(u16 *dest, const u16 *src) -{ +void CopyU16StringArray(u16 *dest, const u16 *src) { u16 c = *src; while (c != EOS) { src++; *dest = c; - c = *src; + c = *src; dest++; } *dest = EOS; } -u16 *CopyU16StringArrayN(u16 *dest, const u16 *src, u32 num) -{ +u16 *CopyU16StringArrayN(u16 *dest, const u16 *src, u32 num) { u32 copied = 0; if (num > copied) { u16 *p = dest; @@ -61,24 +60,22 @@ u16 *CopyU16StringArrayN(u16 *dest, const u16 *src, u32 num) return dest + num; } -u32 StringLength(const u16 *str) -{ +u32 StringLength(const u16 *str) { int i; for (i = 0; str[i] != EOS; i++) {} return i; } -BOOL StringNotEqual(const u16 *s1, const u16 *s2) -{ +BOOL StringNotEqual(const u16 *s1, const u16 *s2) { for (; *s1 == *s2; s1++, s2++) { - if (*s1 == EOS) + if (*s1 == EOS) { return FALSE; + } } return TRUE; } -BOOL StringNotEqualN(const u16 *s1, const u16 *s2, u32 num) -{ +BOOL StringNotEqualN(const u16 *s1, const u16 *s2, u32 num) { u16 c1, c2; c2 = *s2; c1 = *s1; @@ -98,8 +95,7 @@ BOOL StringNotEqualN(const u16 *s1, const u16 *s2, u32 num) return TRUE; } -u16 *StringFill(u16 *dest, u16 value, u32 num) -{ +u16 *StringFill(u16 *dest, u16 value, u32 num) { u32 copied = 0; if (num > copied) { u16 *p = dest; @@ -112,21 +108,19 @@ u16 *StringFill(u16 *dest, u16 value, u32 num) return dest + copied; } -u16 *StringFillEOS(u16 *dest, u32 num) -{ +u16 *StringFillEOS(u16 *dest, u32 num) { return StringFill(dest, EOS, num); } -u16 *ConvertUIntToDecimalString(u16 *dest, u32 value, enum PrintingMode mode, u32 n) -{ +u16 *ConvertUIntToDecimalString(u16 *dest, u32 value, enum PrintingMode mode, u32 n) { for (u32 x = (u32)gPowersOfTen[n - 1]; x != 0; x = x / 10) { u16 res = (u16)(value / x); - value = value - x * res; + value = value - x * res; if (mode == PRINTING_MODE_LEADING_ZEROS) { *dest = res >= 10 ? (u16)CHAR_JP_QUESTION_MARK : gDigitTable[res]; dest++; } else if (res != 0 || x == 1) { - mode = PRINTING_MODE_LEADING_ZEROS; + mode = PRINTING_MODE_LEADING_ZEROS; *dest = res >= 10 ? (u16)CHAR_JP_QUESTION_MARK : gDigitTable[res]; dest++; } else if (mode == PRINTING_MODE_RIGHT_ALIGN) { diff --git a/arm9/src/task.c b/arm9/src/task.c index 4d3007aab..b35c2a41d 100644 --- a/arm9/src/task.c +++ b/arm9/src/task.c @@ -1,99 +1,90 @@ -#include "global.h" #include "task.h" -#include "script.h" + +#include "global.h" + #include "heap.h" +#include "script.h" -struct TaskManager *Task_New(struct FieldSystem * fieldSystem, TaskFunc taskFunc, void *env) -{ +struct TaskManager *Task_New(struct FieldSystem *fieldSystem, TaskFunc taskFunc, void *env) { struct TaskManager *taskManager = AllocFromHeapAtEnd(HEAP_ID_32, sizeof(struct TaskManager)); - taskManager->prev = NULL; - taskManager->func = taskFunc; - taskManager->state = 0; - taskManager->env = env; - taskManager->unk10 = NULL; - taskManager->unk14 = NULL; - taskManager->fieldSystem = fieldSystem; - taskManager->unk1C = AllocFromHeapAtEnd(HEAP_ID_32, 4); + taskManager->prev = NULL; + taskManager->func = taskFunc; + taskManager->state = 0; + taskManager->env = env; + taskManager->unk10 = NULL; + taskManager->unk14 = NULL; + taskManager->fieldSystem = fieldSystem; + taskManager->unk1C = AllocFromHeapAtEnd(HEAP_ID_32, 4); return taskManager; } -void FieldSystem_CreateTask(struct FieldSystem * fieldSystem, TaskFunc taskFunc, void *env) -{ +void FieldSystem_CreateTask(struct FieldSystem *fieldSystem, TaskFunc taskFunc, void *env) { GF_ASSERT(fieldSystem->taskManager == NULL); fieldSystem->taskManager = Task_New(fieldSystem, taskFunc, env); } -void TaskManager_Jump(struct TaskManager *taskManager, TaskFunc taskFunc, void *env) -{ - taskManager->func = taskFunc; +void TaskManager_Jump(struct TaskManager *taskManager, TaskFunc taskFunc, void *env) { + taskManager->func = taskFunc; taskManager->state = 0; - taskManager->env = env; - if (taskManager->unk14 != NULL || taskManager->unk14 != NULL) - { + taskManager->env = env; + if (taskManager->unk14 != NULL || taskManager->unk14 != NULL) { FreeToHeap(taskManager->unk14); taskManager->unk10 = NULL; taskManager->unk14 = NULL; } } -void TaskManager_Call(struct TaskManager *taskManager, TaskFunc taskFunc, void *env) -{ - struct TaskManager *taskManager2 = Task_New(taskManager->fieldSystem, taskFunc, env); - taskManager2->prev = taskManager; +void TaskManager_Call(struct TaskManager *taskManager, TaskFunc taskFunc, void *env) { + struct TaskManager *taskManager2 = Task_New(taskManager->fieldSystem, taskFunc, env); + taskManager2->prev = taskManager; taskManager->fieldSystem->taskManager = taskManager2; } -BOOL sub_02046420(struct TaskManager *taskManager) -{ - if (taskManager->unk10 == NULL) +BOOL sub_02046420(struct TaskManager *taskManager) { + if (taskManager->unk10 == NULL) { return FALSE; - while (taskManager->unk10->func(taskManager->unk10) == TRUE) - { + } + while (taskManager->unk10->func(taskManager->unk10) == TRUE) { struct TaskManager *taskManager2 = taskManager->unk10->prev; - if (taskManager->unk10->unk14 != NULL) + if (taskManager->unk10->unk14 != NULL) { FreeToHeap(taskManager->unk10->unk14); + } FreeToHeap(taskManager->unk10->unk1C); FreeToHeap(taskManager->unk10); taskManager->unk10 = taskManager2; - if (taskManager2 == NULL) + if (taskManager2 == NULL) { return TRUE; + } } return FALSE; } -BOOL sub_0204646C(struct TaskManager *taskManager) -{ - return (taskManager->unk10 != NULL); +BOOL sub_0204646C(struct TaskManager *taskManager) { + return taskManager->unk10 != NULL; } -BOOL FieldSystem_ApplicationIsRunning(struct FieldSystem *fieldSystem) -{ - return (sub_0203739C(fieldSystem) || sub_020373C4(fieldSystem)); +BOOL FieldSystem_ApplicationIsRunning(struct FieldSystem *fieldSystem) { + return sub_0203739C(fieldSystem) || sub_020373C4(fieldSystem); } -void sub_0204649C(void * r0) -{ +void sub_0204649C(void *r0) { LoadOverlay_OVERLAY_05(r0); } -BOOL sub_020464A4(void * r0) -{ - return (sub_020373AC(r0) != FALSE); +BOOL sub_020464A4(void *r0) { + return sub_020373AC(r0) != FALSE; } -BOOL sub_020464B8(struct TaskManager *taskManager) -{ +BOOL sub_020464B8(struct TaskManager *taskManager) { struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - u32 * r4_2 = TaskManager_GetEnvironment(taskManager); - switch (r4_2[0]) - { + u32 *r4_2 = TaskManager_GetEnvironment(taskManager); + switch (r4_2[0]) { case 0: - sub_020373D4(fieldSystem, (struct OverlayManagerTemplate *)r4_2[1], (void *)r4_2[2]); //FIXME: typing is wrong + sub_020373D4(fieldSystem, (struct OverlayManagerTemplate *)r4_2[1], (void *)r4_2[2]); // FIXME: typing is wrong r4_2[0]++; break; case 1: - if (!FieldSystem_ApplicationIsRunning(fieldSystem)) - { + if (!FieldSystem_ApplicationIsRunning(fieldSystem)) { FreeToHeap(r4_2); return TRUE; } @@ -102,31 +93,26 @@ BOOL sub_020464B8(struct TaskManager *taskManager) return FALSE; } -void sub_02046500(struct TaskManager *taskManager, u32 r5, u32 r4) -{ - u32 * r2 = AllocFromHeapAtEnd(HEAP_ID_32, 3 * sizeof(u32)); - r2[0] = 0; - r2[1] = r5; - r2[2] = r4; +void sub_02046500(struct TaskManager *taskManager, u32 r5, u32 r4) { + u32 *r2 = AllocFromHeapAtEnd(HEAP_ID_32, 3 * sizeof(u32)); + r2[0] = 0; + r2[1] = r5; + r2[2] = r4; TaskManager_Call(taskManager, sub_020464B8, r2); } -struct FieldSystem *TaskManager_GetFieldSystem(struct TaskManager *taskManager) -{ +struct FieldSystem *TaskManager_GetFieldSystem(struct TaskManager *taskManager) { return taskManager->fieldSystem; } -void * TaskManager_GetEnvironment(struct TaskManager *taskManager) -{ +void *TaskManager_GetEnvironment(struct TaskManager *taskManager) { return taskManager->env; } -u32 * TaskManager_GetStatePtr(struct TaskManager *taskManager) -{ +u32 *TaskManager_GetStatePtr(struct TaskManager *taskManager) { return &taskManager->state; } -u32 sub_02046534(struct TaskManager *taskManager) -{ +u32 sub_02046534(struct TaskManager *taskManager) { return *taskManager->unk1C; } diff --git a/arm9/src/text.c b/arm9/src/text.c index 02ca46a64..937035934 100644 --- a/arm9/src/text.c +++ b/arm9/src/text.c @@ -1,10 +1,13 @@ -#include "global.h" -#include "gf_gfx_loader.h" #include "text.h" + +#include "global.h" + +#include "graphic/font.naix" + #include "MI_memory.h" #include "filesystem.h" #include "font.h" -#include "graphic/font.naix" +#include "gf_gfx_loader.h" #include "heap.h" #include "message_format.h" #include "string16.h" @@ -23,24 +26,19 @@ extern struct TextPrinter *sub_0201B6C8(void); extern void sub_0201C1A8(struct TextPrinter *printer); -void SetFontsPointer(const struct FontInfo *fonts) -{ +void SetFontsPointer(const struct FontInfo *fonts) { gFonts = fonts; } -u8 sub_0201BCC8(void (*func)(u32, void *), void *printer, u32 param2) -{ +u8 sub_0201BCC8(void (*func)(u32, void *), void *printer, u32 param2) { u32 *r4 = UNK_021C5714; s32 i; - for (i = 0; i < 8; i++, r4++) - { - if (r4[0] != 0) - { + for (i = 0; i < 8; i++, r4++) { + if (r4[0] != 0) { continue; } UNK_021C5714[i] = sub_0200CA7C(func, printer, param2); - if (UNK_021C5714[i] != 0) - { + if (UNK_021C5714[i] != 0) { break; } i = 8; @@ -49,21 +47,17 @@ u8 sub_0201BCC8(void (*func)(u32, void *), void *printer, u32 param2) return (u8)i; } -void sub_0201BCFC(u8 textPrinterNumber) -{ +void sub_0201BCFC(u8 textPrinterNumber) { GF_ASSERT(textPrinterNumber < 8); GF_ASSERT(UNK_021C5714[textPrinterNumber] != 0); - if (textPrinterNumber >= 8) - { + if (textPrinterNumber >= 8) { return; } - if (UNK_021C5714[textPrinterNumber] == 0) - { + if (UNK_021C5714[textPrinterNumber] == 0) { return; } struct TextPrinter *printer = sub_0201B6C8(); - if (printer) - { + if (printer) { sub_0201C238(printer); FreeToHeap((void *)printer); } @@ -71,144 +65,129 @@ void sub_0201BCFC(u8 textPrinterNumber) UNK_021C5714[textPrinterNumber] = 0; } -BOOL sub_0201BD44(u8 textPrinterNumber) -{ +BOOL sub_0201BD44(u8 textPrinterNumber) { return UNK_021C5714[textPrinterNumber] ? TRUE : FALSE; } -void ResetAllTextPrinters(void) -{ - for (s32 i = 0; i < 8; i++) - { +void ResetAllTextPrinters(void) { + for (s32 i = 0; i < 8; i++) { UNK_021C5714[i] = 0; } } -u8 sub_0201BD70(u8 textPrinterNumber) -{ +u8 sub_0201BD70(u8 textPrinterNumber) { return (u8)sub_0201BD44(textPrinterNumber); } -void sub_0201BD7C(u8 textPrinterNumber) -{ +void sub_0201BD7C(u8 textPrinterNumber) { sub_0201BCFC(textPrinterNumber); } -u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)) -{ +u16 AddTextPrinterParameterized(struct Window *window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)) { struct TextPrinterTemplate printerTemplate; - printerTemplate.window = window; + printerTemplate.window = window; printerTemplate.currentChar.wrapped = str; - printerTemplate.fontId = fontId; - printerTemplate.x = (u8)x; - printerTemplate.y = (u8)y; - printerTemplate.currentX = (u8)x; - printerTemplate.currentY = (u8)y; - printerTemplate.letterSpacing = gFonts[fontId].letterSpacing; - printerTemplate.lineSpacing = gFonts[fontId].lineSpacing; - printerTemplate.unk = gFonts[fontId].unk; - printerTemplate.fgColor = gFonts[fontId].fgColor; - printerTemplate.bgColor = gFonts[fontId].bgColor; - printerTemplate.shadowColor = gFonts[fontId].shadowColor; - printerTemplate.unk2 = 0; - printerTemplate.unk3 = 0; - printerTemplate.unk4 = 255; + printerTemplate.fontId = fontId; + printerTemplate.x = (u8)x; + printerTemplate.y = (u8)y; + printerTemplate.currentX = (u8)x; + printerTemplate.currentY = (u8)y; + printerTemplate.letterSpacing = gFonts[fontId].letterSpacing; + printerTemplate.lineSpacing = gFonts[fontId].lineSpacing; + printerTemplate.unk = gFonts[fontId].unk; + printerTemplate.fgColor = gFonts[fontId].fgColor; + printerTemplate.bgColor = gFonts[fontId].bgColor; + printerTemplate.shadowColor = gFonts[fontId].shadowColor; + printerTemplate.unk2 = 0; + printerTemplate.unk3 = 0; + printerTemplate.unk4 = 255; return AddTextPrinter(&printerTemplate, speed, callback); } -u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16)) -{ +u16 AddTextPrinterParameterized2(struct Window *window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16)) { struct TextPrinterTemplate printerTemplate; - printerTemplate.window = window; + printerTemplate.window = window; printerTemplate.currentChar.wrapped = str; - printerTemplate.fontId = fontId; - printerTemplate.x = (u8)x; - printerTemplate.y = (u8)y; - printerTemplate.currentX = (u8)x; - printerTemplate.currentY = (u8)y; - printerTemplate.letterSpacing = gFonts[fontId].letterSpacing; - printerTemplate.lineSpacing = gFonts[fontId].lineSpacing; - printerTemplate.unk = gFonts[fontId].unk; - printerTemplate.fgColor = (u8)(colors >> 16); - printerTemplate.shadowColor = (u8)(colors >> 8); - printerTemplate.bgColor = (u8)colors; - printerTemplate.unk2 = 0; - printerTemplate.unk3 = 0; - printerTemplate.unk4 = 255; + printerTemplate.fontId = fontId; + printerTemplate.x = (u8)x; + printerTemplate.y = (u8)y; + printerTemplate.currentX = (u8)x; + printerTemplate.currentY = (u8)y; + printerTemplate.letterSpacing = gFonts[fontId].letterSpacing; + printerTemplate.lineSpacing = gFonts[fontId].lineSpacing; + printerTemplate.unk = gFonts[fontId].unk; + printerTemplate.fgColor = (u8)(colors >> 16); + printerTemplate.shadowColor = (u8)(colors >> 8); + printerTemplate.bgColor = (u8)colors; + printerTemplate.unk2 = 0; + printerTemplate.unk3 = 0; + printerTemplate.unk4 = 255; return AddTextPrinter(&printerTemplate, speed, callback); } -u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16)) -{ +u16 AddTextPrinterParameterized3(struct Window *window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16)) { struct TextPrinterTemplate printerTemplate; - printerTemplate.window = window; + printerTemplate.window = window; printerTemplate.currentChar.wrapped = str; - printerTemplate.fontId = (u8)fontId; - printerTemplate.x = (u8)x; - printerTemplate.y = (u8)y; - printerTemplate.currentX = (u8)x; - printerTemplate.currentY = (u8)y; - printerTemplate.letterSpacing = (u8)letterSpacing; - printerTemplate.lineSpacing = (u8)lineSpacing; - printerTemplate.unk = gFonts[fontId].unk; - printerTemplate.fgColor = (u8)(colors >> 16); - printerTemplate.shadowColor = (u8)(colors >> 8); - printerTemplate.bgColor = (u8)colors; - printerTemplate.unk2 = 0; - printerTemplate.unk3 = 0; - printerTemplate.unk4 = 255; + printerTemplate.fontId = (u8)fontId; + printerTemplate.x = (u8)x; + printerTemplate.y = (u8)y; + printerTemplate.currentX = (u8)x; + printerTemplate.currentY = (u8)y; + printerTemplate.letterSpacing = (u8)letterSpacing; + printerTemplate.lineSpacing = (u8)lineSpacing; + printerTemplate.unk = gFonts[fontId].unk; + printerTemplate.fgColor = (u8)(colors >> 16); + printerTemplate.shadowColor = (u8)(colors >> 8); + printerTemplate.bgColor = (u8)colors; + printerTemplate.unk2 = 0; + printerTemplate.unk3 = 0; + printerTemplate.unk4 = 255; return AddTextPrinter(&printerTemplate, speed, callback); } -u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)) -{ - if (!gFonts) +u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)) { + if (!gFonts) { return 0xff; + } struct TextPrinter *printer = (struct TextPrinter *)AllocFromHeap(HEAP_ID_DEFAULT, sizeof(struct TextPrinter)); - printer->active = TRUE; - printer->state = 0; + printer->active = TRUE; + printer->state = 0; printer->textSpeedBottom = (u8)speed; - printer->delayCounter = 0; - printer->scrollDistance = 0; - printer->Unk29 = 0; + printer->delayCounter = 0; + printer->scrollDistance = 0; + printer->Unk29 = 0; - for (s32 i = 0; i < 7; i++) - { + for (s32 i = 0; i < 7; i++) { printer->subStructFields[i] = 0; } - printer->printerTemplate = *printerTemplate; + printer->printerTemplate = *printerTemplate; printer->printerTemplate.currentChar.raw = String_c_str(printer->printerTemplate.currentChar.wrapped); - printer->callback = callback; - UNK_021C570C = 0; + printer->callback = callback; + UNK_021C570C = 0; sub_0201C1A8(printer); - if (speed != 0xff && speed != 0) - { + if (speed != 0xff && speed != 0) { printer->textSpeedBottom--; - printer->textSpeedTop = 1; + printer->textSpeedTop = 1; printer->minLetterSpacing = sub_0201BCC8((void (*)(u32, void *))RunTextPrinter, printer, 1); return printer->minLetterSpacing; - } - else - { - u32 j = 0; + } else { + u32 j = 0; printer->textSpeedBottom = 0; - printer->textSpeedTop = 0; + printer->textSpeedTop = 0; GenerateFontHalfRowLookupTable(printerTemplate->fgColor, printerTemplate->bgColor, printerTemplate->shadowColor); - for (; j < 0x400; ++j) - { - if (RenderFont(printer) == 1) - { + for (; j < 0x400; ++j) { + if (RenderFont(printer) == 1) { break; } } - if (speed != 0xff) - { + if (speed != 0xff) { CopyWindowToVram(printer->printerTemplate.window); } sub_0201C238(printer); @@ -217,57 +196,46 @@ u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (* } } -void RunTextPrinter(u32 param0, struct TextPrinter *printer) -{ +void RunTextPrinter(u32 param0, struct TextPrinter *printer) { #pragma unused(param0) - if (UNK_021C570C == 0) - { - if (printer->Unk29 == 0) - { + if (UNK_021C570C == 0) { + if (printer->Unk29 == 0) { printer->Unk2A = 0; GenerateFontHalfRowLookupTable(printer->printerTemplate.fgColor, printer->printerTemplate.bgColor, printer->printerTemplate.shadowColor); u32 temp = RenderFont(printer); - switch (temp) - { - case 0: - CopyWindowToVram(printer->printerTemplate.window); - //fallthrough - case 3: - if (printer->callback == NULL) - { - return; - } - printer->Unk29 = printer->callback(&printer->printerTemplate, printer->Unk2A); - return; - case 1: - sub_0201BCFC(printer->minLetterSpacing); - return; - default: + switch (temp) { + case 0: + CopyWindowToVram(printer->printerTemplate.window); + // fallthrough + case 3: + if (printer->callback == NULL) { return; + } + printer->Unk29 = printer->callback(&printer->printerTemplate, printer->Unk2A); + return; + case 1: + sub_0201BCFC(printer->minLetterSpacing); + return; + default: + return; } - } - else - { + } else { printer->Unk29 = printer->callback(&printer->printerTemplate, printer->Unk2A); } } } -u32 RenderFont(struct TextPrinter *printer) -{ +u32 RenderFont(struct TextPrinter *printer) { u32 ret; - while (TRUE) - { + while (TRUE) { ret = FontFunc(printer->printerTemplate.fontId, printer); - if (ret != 2) - { + if (ret != 2) { return ret; } } } -void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) -{ +void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) { s32 r5 = 0; u32 sp20[4]; s32 i; // sp14 @@ -285,14 +253,10 @@ void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) UNK_021C570E = fgColor; UNK_021C5710 = shadowColor; - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - for (k = 0; k < 4; k++) - { - for (l = 0; l < 4; l++) - { + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + for (l = 0; l < 4; l++) { sFontHalfRowLookupTable[r5++] = (u16)((sp20[l] << 12) | (sp20[k] << 8) | (sp20[j] << 4) | (sp20[i] << 0)); } } @@ -300,18 +264,17 @@ void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor) } } -void DecompressGlyphTile(const u16 *src, u16 *dst) -{ - dst[0] = sFontHalfRowLookupTable[(u32)src[0] >> 8]; - dst[1] = sFontHalfRowLookupTable[(u8)src[0]]; - dst[2] = sFontHalfRowLookupTable[(u32)src[1] >> 8]; - dst[3] = sFontHalfRowLookupTable[(u8)src[1]]; - dst[4] = sFontHalfRowLookupTable[(u32)src[2] >> 8]; - dst[5] = sFontHalfRowLookupTable[(u8)src[2]]; - dst[6] = sFontHalfRowLookupTable[(u32)src[3] >> 8]; - dst[7] = sFontHalfRowLookupTable[(u8)src[3]]; - dst[8] = sFontHalfRowLookupTable[(u32)src[4] >> 8]; - dst[9] = sFontHalfRowLookupTable[(u8)src[4]]; +void DecompressGlyphTile(const u16 *src, u16 *dst) { + dst[0] = sFontHalfRowLookupTable[(u32)src[0] >> 8]; + dst[1] = sFontHalfRowLookupTable[(u8)src[0]]; + dst[2] = sFontHalfRowLookupTable[(u32)src[1] >> 8]; + dst[3] = sFontHalfRowLookupTable[(u8)src[1]]; + dst[4] = sFontHalfRowLookupTable[(u32)src[2] >> 8]; + dst[5] = sFontHalfRowLookupTable[(u8)src[2]]; + dst[6] = sFontHalfRowLookupTable[(u32)src[3] >> 8]; + dst[7] = sFontHalfRowLookupTable[(u8)src[3]]; + dst[8] = sFontHalfRowLookupTable[(u32)src[4] >> 8]; + dst[9] = sFontHalfRowLookupTable[(u8)src[4]]; dst[10] = sFontHalfRowLookupTable[(u32)src[5] >> 8]; dst[11] = sFontHalfRowLookupTable[(u8)src[5]]; dst[12] = sFontHalfRowLookupTable[(u32)src[6] >> 8]; @@ -320,38 +283,32 @@ void DecompressGlyphTile(const u16 *src, u16 *dst) dst[15] = sFontHalfRowLookupTable[(u8)src[7]]; } -void sub_0201C1A8(struct TextPrinter *printer) -{ +void sub_0201C1A8(struct TextPrinter *printer) { printer->Unk2C = NULL; } -u16 *sub_0201C1B0(void) -{ +u16 *sub_0201C1B0(void) { void *res = AllocFromHeap(HEAP_ID_DEFAULT, 32 * 24 * sizeof(u16)); - struct NNSG2dCharacterData * var; + struct NNSG2dCharacterData *var; void *tmp = GfGfxLoader_GetCharData(NARC_GRAPHIC_FONT, NARC_font_narc_0005_NCGR, 0, &var, HEAP_ID_DEFAULT); MI_CpuCopy32(var->pRawData, res, 32 * 24 * sizeof(u16)); FreeToHeap(tmp); return res; } -void sub_0201C1EC(struct TextPrinter *printer, u32 param1, u32 param2, u32 param3) -{ -#pragma unused (param1, param2) - struct Window * window = printer->printerTemplate.window; - if (printer->Unk2C == NULL) - { +void sub_0201C1EC(struct TextPrinter *printer, u32 param1, u32 param2, u32 param3) { +#pragma unused(param1, param2) + struct Window *window = printer->printerTemplate.window; + if (printer->Unk2C == NULL) { printer->Unk2C = sub_0201C1B0(); } - u16 * r6 = printer->Unk2C + param3 * 24 * 8; - u16 r2 = (u16)((GetWindowWidth(window) - 3) * 8); + u16 *r6 = printer->Unk2C + param3 * 24 * 8; + u16 r2 = (u16)((GetWindowWidth(window) - 3) * 8); BlitBitmapRectToWindow(window, r6, 0, 0, 24, 32, r2, 0, 24, 32); } -void sub_0201C238(struct TextPrinter *printer) -{ - if (printer->Unk2C == NULL) - { +void sub_0201C238(struct TextPrinter *printer) { + if (printer->Unk2C == NULL) { return; } FreeToHeap(printer->Unk2C); diff --git a/arm9/src/text_02054590.c b/arm9/src/text_02054590.c index 59189acd9..bf2337390 100644 --- a/arm9/src/text_02054590.c +++ b/arm9/src/text_02054590.c @@ -1,55 +1,47 @@ -#include "global.h" #include "text_02054590.h" -#include "text.h" + +#include "global.h" + #include "bg_window.h" #include "font.h" #include "render_text.h" #include "render_window.h" +#include "text.h" -void sub_02054590(enum GFPalLoadLocation location, u32 param1) -{ - if (param1 == 1) - { +void sub_02054590(enum GFPalLoadLocation location, u32 param1) { + if (param1 == 1) { ResetAllTextPrinters(); } LoadFontPal0(location, GF_PAL_SLOT_13_OFFSET, HEAP_ID_4); LoadFontPal1(location, GF_PAL_SLOT_12_OFFSET, HEAP_ID_4); } -void sub_020545B8(struct BgConfig *param0, struct Window *param1, u32 param2) -{ - if (param2 == 3) - { +void sub_020545B8(struct BgConfig *param0, struct Window *param1, u32 param2) { + if (param2 == 3) { AddWindowParameterized(param0, param1, 3, 2, 19, 27, 4, 12, 813); - } - else - { + } else { AddWindowParameterized(param0, param1, 7, 2, 19, 27, 4, 12, 404); } } -void sub_02054608(struct Window *param0, struct Options *options) -{ +void sub_02054608(struct Window *param0, struct Options *options) { sub_0200CD68(param0->bgConfig, GetWindowBgId(param0), 994, 10, (u8)Options_GetFrame(options), HEAP_ID_4); sub_0205464C(param0); DrawFrameAndWindow2(param0, 0, 994, 10); } -void sub_0205464C(struct Window *param0) -{ +void sub_0205464C(struct Window *param0) { FillWindowPixelBuffer(param0, 15); } -u16 sub_02054658(struct Window * window, struct String *str, struct Options *options, u8 param3) -{ +u16 sub_02054658(struct Window *window, struct String *str, struct Options *options, u8 param3) { TextFlags_SetCanABSpeedUpPrint(param3); sub_02002B7C(0); sub_02002BB8(0); return AddTextPrinterParameterized(window, 1, str, 0, 0, (u32)Options_GetTextFrameDelay(options), NULL); } -u16 DrawFieldMessage(struct Window * window, struct String *str, u8 fontId, u32 speed, u8 a4, s32 a5) -{ +u16 DrawFieldMessage(struct Window *window, struct String *str, u8 fontId, u32 speed, u8 a4, s32 a5) { TextFlags_SetCanABSpeedUpPrint(a4); sub_02002B7C(a5); sub_02002BB8(0); @@ -62,32 +54,24 @@ u8 sub_020546C8(u8 textPrinterNumber) // bool8? } void sub_020546E0( - struct BgConfig *param0, struct Window *param1, u32 param2, u32 param3) -{ + struct BgConfig *param0, struct Window *param1, u32 param2, u32 param3) { u32 r4 = 0; u32 r5 = 0; - if (param2 <= 1) - { + if (param2 <= 1) { r4 = 9; r5 = 20; - } - else - { + } else { r4 = 2; r5 = 27; } - if (param3 == 3) - { - AddWindowParameterized(param0, param1, 3, (u8) r4, 19, (u8) r5, 4, 9, 813); - } - else - { - AddWindowParameterized(param0, param1, 7, (u8) r4, 19, (u8) r5, 4, 9, 404); + if (param3 == 3) { + AddWindowParameterized(param0, param1, 3, (u8)r4, 19, (u8)r5, 4, 9, 813); + } else { + AddWindowParameterized(param0, param1, 7, (u8)r4, 19, (u8)r5, 4, 9, 404); } } -void sub_02054744(struct Window *param0, u32 param1, u16 param2) -{ +void sub_02054744(struct Window *param0, u32 param1, u16 param2) { sub_0200D300(param0->bgConfig, GetWindowBgId(param0), 0x399, 9, (u8)param1, param2, HEAP_ID_4); FillWindowPixelBuffer(param0, 15); DrawFrameAndWindow3(param0, 0, 0x399, 9, (u8)param1); diff --git a/arm9/src/timer3.c b/arm9/src/timer3.c index 83cd8ca97..89dc366dd 100644 --- a/arm9/src/timer3.c +++ b/arm9/src/timer3.c @@ -1,19 +1,18 @@ -#include "global.h" #include "timer3.h" +#include "global.h" + #include "OS_interrupt.h" #include "OS_irqTable.h" -#include "OS_timer.h" #include "OS_system.h" +#include "OS_timer.h" #include "registers.h" static BOOL timer3_needReset; static vu64 timer3_counter; - -void Init_Timer3() -{ - timer3_counter = 0; +void Init_Timer3() { + timer3_counter = 0; timer3_needReset = FALSE; OS_SetTimerControl(OS_TIMER_3, 0); @@ -24,13 +23,10 @@ void Init_Timer3() OS_EnableIrqMask(OS_IE_TIMER3); // irq on timer3 overflow } - -void CountUpTimer3() -{ +void CountUpTimer3() { timer3_counter++; - if (timer3_needReset) - { + if (timer3_needReset) { OS_SetTimerControl(OS_TIMER_3, 0); OS_SetTimerCount(OS_TIMER_3, 0); OS_SetTimerControl(OS_TIMER_3, REG_OS_TM3CNT_H_E_MASK | REG_OS_TM3CNT_H_I_MASK | OS_TIMER_PRESCALER_64); @@ -41,15 +37,13 @@ void CountUpTimer3() OS_SetIrqFunction(OS_IE_TIMER3, &CountUpTimer3); } -u64 internal_GetTimer3Count() -{ +u64 internal_GetTimer3Count() { OSIntrMode intr_mode = OS_DisableInterrupts(); - vu16 timer3 = reg_OS_TM3CNT_L; + vu16 timer3 = reg_OS_TM3CNT_L; vu64 counter = timer3_counter & 0x0000ffffffffffff; - if (reg_OS_IF & OS_IE_TIMER3 && !(timer3 & 0x8000)) - { + if (reg_OS_IF & OS_IE_TIMER3 && !(timer3 & 0x8000)) { counter++; } @@ -57,17 +51,14 @@ u64 internal_GetTimer3Count() return (counter << 16) | timer3; } -u64 GetTimer3Count() -{ +u64 GetTimer3Count() { return internal_GetTimer3Count(); } -u64 Timer3CountToMilliSeconds(u64 count) -{ +u64 Timer3CountToMilliSeconds(u64 count) { return (count * 64) / (HW_SYSTEM_CLOCK / 1000); } -u64 Timer3CountToSeconds(u64 count) -{ +u64 Timer3CountToSeconds(u64 count) { return (count * 64) / HW_SYSTEM_CLOCK; } diff --git a/arm9/src/trainer_data.c b/arm9/src/trainer_data.c index ac0c527fe..a712b1b32 100644 --- a/arm9/src/trainer_data.c +++ b/arm9/src/trainer_data.c @@ -1,38 +1,36 @@ -#include "global.h" -#include "heap.h" #include "trainer_data.h" + +#include "global.h" + +#include "constants/trainer_classes.h" + +#include "msgdata/msg.naix" + #include "battle_setup.h" +#include "heap.h" #include "math_util.h" +#include "msgdata.h" #include "party.h" #include "proto.h" -#include "msgdata.h" -#include "msgdata/msg.naix" -#include "constants/trainer_classes.h" #include "unk_02024E64.h" // Loads all battle opponents, including multi-battle partner if exists. -void EnemyTrainerSet_Init(BattleSetup *setup, struct SaveData * save, HeapID heapId) -{ +void EnemyTrainerSet_Init(BattleSetup *setup, struct SaveData *save, HeapID heapId) { Trainer trdata; - struct MsgData * msgData; - u16 * rivalName; + struct MsgData *msgData; + u16 *rivalName; s32 i; - struct String * str; + struct String *str; - msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0559_bin, heapId); + msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0559_bin, heapId); rivalName = GetRivalNamePtr(sub_02024EC0(save)); - for (i = 0; i < 4; i++) - { - if (setup->trainerId[i] != 0) - { + for (i = 0; i < 4; i++) { + if (setup->trainerId[i] != 0) { TrainerData_ReadTrData(setup->trainerId[i], &trdata.data); setup->trainers[i] = trdata; - if (trdata.data.trainerClass == TRAINER_CLASS_PKMN_TRAINER_BARRY) - { + if (trdata.data.trainerClass == TRAINER_CLASS_PKMN_TRAINER_BARRY) { CopyU16StringArray(setup->trainers[i].name, rivalName); - } - else - { + } else { str = NewString_ReadMsgData(msgData, setup->trainerId[i]); CopyStringToU16Array(str, setup->trainers[i].name, PLAYER_NAME_LENGTH + 1); String_Delete(str); @@ -44,14 +42,12 @@ void EnemyTrainerSet_Init(BattleSetup *setup, struct SaveData * save, HeapID hea DestroyMsgData(msgData); } -s32 TrainerData_GetAttr(u32 tr_idx, u32 attr_no) -{ +s32 TrainerData_GetAttr(u32 tr_idx, u32 attr_no) { Trainer trainer; s32 ret; TrainerData_ReadTrData(tr_idx, &trainer.data); - switch (attr_no) - { + switch (attr_no) { case 0: ret = trainer.data.trainerType; break; @@ -91,184 +87,176 @@ s32 TrainerData_GetAttr(u32 tr_idx, u32 attr_no) // however the trainers are not in order in this file. trtblofs gives a pointer into trtbl // for each trainer. trtblofs is also a single-member NARC whose entries are shorts, one // per NPC trainer. -BOOL TrainerMessageWithIdPairExists(u32 trainer_idx, u32 msg_id, HeapID heapId) -{ +BOOL TrainerMessageWithIdPairExists(u32 trainer_idx, u32 msg_id, HeapID heapId) { u16 rdbuf[3]; - struct NARC * trTblNarc; + struct NARC *trTblNarc; BOOL ret = FALSE; u32 trTblSize; trTblSize = GetNarcMemberSizeByIdPair(NARC_POKETOOL_TRMSG_TRTBL, 0); ReadFromNarcMemberByIdPair(&rdbuf[0], NARC_POKETOOL_TRMSG_TRTBLOFS, 0, trainer_idx * 2, 2); trTblNarc = NARC_New(NARC_POKETOOL_TRMSG_TRTBL, heapId); - while (rdbuf[0] != trTblSize) - { + while (rdbuf[0] != trTblSize) { NARC_ReadFromMember(trTblNarc, 0, rdbuf[0], 4, &rdbuf[1]); - if (rdbuf[1] == trainer_idx && rdbuf[2] == msg_id) - { + if (rdbuf[1] == trainer_idx && rdbuf[2] == msg_id) { ret = TRUE; break; } - if (rdbuf[1] != trainer_idx) + if (rdbuf[1] != trainer_idx) { break; + } rdbuf[0] += 4; } NARC_Delete(trTblNarc); return ret; } -void GetTrainerMessageByIdPair(u32 trainer_idx, u32 msg_id, struct String * str, HeapID heapId) -{ +void GetTrainerMessageByIdPair(u32 trainer_idx, u32 msg_id, struct String *str, HeapID heapId) { u16 rdbuf[3]; u32 trTblSize; - struct NARC * trTblNarc; + struct NARC *trTblNarc; trTblSize = GetNarcMemberSizeByIdPair(NARC_POKETOOL_TRMSG_TRTBL, 0); ReadFromNarcMemberByIdPair(&rdbuf[0], NARC_POKETOOL_TRMSG_TRTBLOFS, 0, trainer_idx * 2, 2); trTblNarc = NARC_New(NARC_POKETOOL_TRMSG_TRTBL, heapId); - while (rdbuf[0] != trTblSize) - { + while (rdbuf[0] != trTblSize) { NARC_ReadFromMember(trTblNarc, 0, rdbuf[0], 4, &rdbuf[1]); - if (rdbuf[1] == trainer_idx && rdbuf[2] == msg_id) - { + if (rdbuf[1] == trainer_idx && rdbuf[2] == msg_id) { ReadMsgData_NewNarc_ExistingString(NARC_MSGDATA_MSG, 558, (u32)(rdbuf[0] / 4), heapId, str); break; } rdbuf[0] += 4; } NARC_Delete(trTblNarc); - if (rdbuf[0] == trTblSize) + if (rdbuf[0] == trTblSize) { String_SetEmpty(str); + } } -void TrainerData_ReadTrData(u32 idx, struct TrainerData * dest) -{ +void TrainerData_ReadTrData(u32 idx, struct TrainerData *dest) { ReadWholeNarcMemberByIdPair(dest, NARC_POKETOOL_TRAINER_TRDATA, (s32)idx); } -void TrainerData_ReadTrPoke(u32 idx, union TrainerMon * dest) -{ +void TrainerData_ReadTrPoke(u32 idx, union TrainerMon *dest) { ReadWholeNarcMemberByIdPair(dest, NARC_POKETOOL_TRAINER_TRPOKE, (s32)idx); } const u8 sTrainerClassGenderCountTbl[] = { - /*TRAINER_CLASS_PKMN_TRAINER_M*/ 0, - /*TRAINER_CLASS_PKMN_TRAINER_F*/ 1, - /*TRAINER_CLASS_YOUNGSTER*/ 0, - /*TRAINER_CLASS_LASS*/ 1, - /*TRAINER_CLASS_CAMPER*/ 0, - /*TRAINER_CLASS_PICNICKER*/ 1, - /*TRAINER_CLASS_BUG_CATCHER*/ 0, - /*TRAINER_CLASS_AROMA_LADY*/ 1, - /*TRAINER_CLASS_TWINS*/ 1, - /*TRAINER_CLASS_HIKER*/ 0, - /*TRAINER_CLASS_BATTLE_GIRL*/ 1, - /*TRAINER_CLASS_FISHERMAN*/ 0, - /*TRAINER_CLASS_CYCLIST_M*/ 0, - /*TRAINER_CLASS_CYCLIST_F*/ 1, - /*TRAINER_CLASS_BLACK_BELT*/ 0, - /*TRAINER_CLASS_ARTIST*/ 0, - /*TRAINER_CLASS_PKMN_BREEDER_M*/ 0, - /*TRAINER_CLASS_PKMN_BREEDER_F*/ 1, - /*TRAINER_CLASS_COWGIRL*/ 1, - /*TRAINER_CLASS_JOGGER*/ 0, - /*TRAINER_CLASS_POKEFAN_M*/ 0, - /*TRAINER_CLASS_POKEFAN_F*/ 1, - /*TRAINER_CLASS_POKE_KID*/ 1, - /*TRAINER_CLASS_YOUNG_COUPLE*/ 2, - /*TRAINER_CLASS_ACE_TRAINER_M*/ 0, - /*TRAINER_CLASS_ACE_TRAINER_F*/ 1, - /*TRAINER_CLASS_WAITRESS*/ 1, - /*TRAINER_CLASS_VETERAN*/ 0, - /*TRAINER_CLASS_NINJA_BOY*/ 0, - /*TRAINER_CLASS_DRAGON_TAMER*/ 0, - /*TRAINER_CLASS_BIRD_KEEPER*/ 1, - /*TRAINER_CLASS_DOUBLE_TEAM*/ 2, - /*TRAINER_CLASS_RICH_BOY*/ 0, - /*TRAINER_CLASS_LADY*/ 1, - /*TRAINER_CLASS_GENTLEMAN*/ 0, - /*TRAINER_CLASS_SOCIALITE*/ 1, - /*TRAINER_CLASS_BEAUTY*/ 1, - /*TRAINER_CLASS_COLLECTOR*/ 0, - /*TRAINER_CLASS_POLICEMAN*/ 0, - /*TRAINER_CLASS_PKMN_RANGER_M*/ 0, - /*TRAINER_CLASS_PKMN_RANGER_F*/ 1, - /*TRAINER_CLASS_SCIENTIST*/ 0, - /*TRAINER_CLASS_SWIMMER_M*/ 0, - /*TRAINER_CLASS_SWIMMER_F*/ 1, - /*TRAINER_CLASS_TUBER_M*/ 0, - /*TRAINER_CLASS_TUBER_F*/ 1, - /*TRAINER_CLASS_SAILOR*/ 0, - /*TRAINER_CLASS_SIS_AND_BRO*/ 2, - /*TRAINER_CLASS_RUIN_MANIAC*/ 0, - /*TRAINER_CLASS_PSYCHIC_M*/ 0, - /*TRAINER_CLASS_PSYCHIC_F*/ 1, - /*TRAINER_CLASS_PI*/ 0, - /*TRAINER_CLASS_GUITARIST*/ 0, - /*TRAINER_CLASS_ACE_TRAINER_SNOW_M*/ 0, - /*TRAINER_CLASS_ACE_TRAINER_SNOW_F*/ 1, - /*TRAINER_CLASS_SKIER_M*/ 0, - /*TRAINER_CLASS_SKIER_F*/ 1, - /*TRAINER_CLASS_ROUGHNECK*/ 0, - /*TRAINER_CLASS_CLOWN*/ 0, - /*TRAINER_CLASS_WORKER*/ 0, - /*TRAINER_CLASS_SCHOOL_KID_M*/ 0, - /*TRAINER_CLASS_SCHOOL_KID_F*/ 1, - /*TRAINER_CLASS_LEADER_ROARK*/ 0, - /*TRAINER_CLASS_PKMN_TRAINER_BARRY*/ 0, - /*TRAINER_CLASS_LEADER_BYRON*/ 0, - /*TRAINER_CLASS_ELITE_FOUR_AARON*/ 0, - /*TRAINER_CLASS_ELITE_FOUR_BERTHA*/ 1, - /*TRAINER_CLASS_ELITE_FOUR_FLINT*/ 0, - /*TRAINER_CLASS_ELITE_FOUR_LUCIEN*/ 0, - /*TRAINER_CLASS_CHAMPION*/ 1, - /*TRAINER_CLASS_BELLE__PA*/ 2, - /*TRAINER_CLASS_RANCHER*/ 0, - /*TRAINER_CLASS_COMMANDER_MARS*/ 1, - /*TRAINER_CLASS_GALACTIC*/ 0, - /*TRAINER_CLASS_LEADER_GARDENIA*/ 1, - /*TRAINER_CLASS_LEADER_WAKE*/ 0, - /*TRAINER_CLASS_LEADER_MAYLENE*/ 1, - /*TRAINER_CLASS_LEADER_FANTINA*/ 1, - /*TRAINER_CLASS_LEADER_CANDICE*/ 1, - /*TRAINER_CLASS_LEADER_VOLKNER*/ 0, - /*TRAINER_CLASS_PARASOL_LADY*/ 1, - /*TRAINER_CLASS_WAITER*/ 0, - /*TRAINER_CLASS_INTERVIEWERS*/ 2, - /*TRAINER_CLASS_CAMERAMAN*/ 0, - /*TRAINER_CLASS_REPORTER*/ 1, - /*TRAINER_CLASS_IDOL*/ 1, - /*TRAINER_CLASS_GALACTIC_BOSS*/ 0, - /*TRAINER_CLASS_COMMANDER_JUPITER*/ 1, - /*TRAINER_CLASS_COMMANDER_SATURN*/ 1, - /*TRAINER_CLASS_GALACTIC_F*/ 1, - /*TRAINER_CLASS_PKMN_TRAINER_CHERYL*/ 1, - /*TRAINER_CLASS_PKMN_TRAINER_RILEY*/ 0, - /*TRAINER_CLASS_PKMN_TRAINER_MARLEY*/ 1, - /*TRAINER_CLASS_PKMN_TRAINER_BUCK*/ 0, - /*TRAINER_CLASS_PKMN_TRAINER_MIRA*/ 1, - /*TRAINER_CLASS_PKMN_TRAINER_LUCAS*/ 0, - /*TRAINER_CLASS_PKMN_TRAINER_DAWN*/ 1, - /*TRAINER_CLASS_TOWER_TYCOON*/ 0 + /*TRAINER_CLASS_PKMN_TRAINER_M*/ 0, + /*TRAINER_CLASS_PKMN_TRAINER_F*/ 1, + /*TRAINER_CLASS_YOUNGSTER*/ 0, + /*TRAINER_CLASS_LASS*/ 1, + /*TRAINER_CLASS_CAMPER*/ 0, + /*TRAINER_CLASS_PICNICKER*/ 1, + /*TRAINER_CLASS_BUG_CATCHER*/ 0, + /*TRAINER_CLASS_AROMA_LADY*/ 1, + /*TRAINER_CLASS_TWINS*/ 1, + /*TRAINER_CLASS_HIKER*/ 0, + /*TRAINER_CLASS_BATTLE_GIRL*/ 1, + /*TRAINER_CLASS_FISHERMAN*/ 0, + /*TRAINER_CLASS_CYCLIST_M*/ 0, + /*TRAINER_CLASS_CYCLIST_F*/ 1, + /*TRAINER_CLASS_BLACK_BELT*/ 0, + /*TRAINER_CLASS_ARTIST*/ 0, + /*TRAINER_CLASS_PKMN_BREEDER_M*/ 0, + /*TRAINER_CLASS_PKMN_BREEDER_F*/ 1, + /*TRAINER_CLASS_COWGIRL*/ 1, + /*TRAINER_CLASS_JOGGER*/ 0, + /*TRAINER_CLASS_POKEFAN_M*/ 0, + /*TRAINER_CLASS_POKEFAN_F*/ 1, + /*TRAINER_CLASS_POKE_KID*/ 1, + /*TRAINER_CLASS_YOUNG_COUPLE*/ 2, + /*TRAINER_CLASS_ACE_TRAINER_M*/ 0, + /*TRAINER_CLASS_ACE_TRAINER_F*/ 1, + /*TRAINER_CLASS_WAITRESS*/ 1, + /*TRAINER_CLASS_VETERAN*/ 0, + /*TRAINER_CLASS_NINJA_BOY*/ 0, + /*TRAINER_CLASS_DRAGON_TAMER*/ 0, + /*TRAINER_CLASS_BIRD_KEEPER*/ 1, + /*TRAINER_CLASS_DOUBLE_TEAM*/ 2, + /*TRAINER_CLASS_RICH_BOY*/ 0, + /*TRAINER_CLASS_LADY*/ 1, + /*TRAINER_CLASS_GENTLEMAN*/ 0, + /*TRAINER_CLASS_SOCIALITE*/ 1, + /*TRAINER_CLASS_BEAUTY*/ 1, + /*TRAINER_CLASS_COLLECTOR*/ 0, + /*TRAINER_CLASS_POLICEMAN*/ 0, + /*TRAINER_CLASS_PKMN_RANGER_M*/ 0, + /*TRAINER_CLASS_PKMN_RANGER_F*/ 1, + /*TRAINER_CLASS_SCIENTIST*/ 0, + /*TRAINER_CLASS_SWIMMER_M*/ 0, + /*TRAINER_CLASS_SWIMMER_F*/ 1, + /*TRAINER_CLASS_TUBER_M*/ 0, + /*TRAINER_CLASS_TUBER_F*/ 1, + /*TRAINER_CLASS_SAILOR*/ 0, + /*TRAINER_CLASS_SIS_AND_BRO*/ 2, + /*TRAINER_CLASS_RUIN_MANIAC*/ 0, + /*TRAINER_CLASS_PSYCHIC_M*/ 0, + /*TRAINER_CLASS_PSYCHIC_F*/ 1, + /*TRAINER_CLASS_PI*/ 0, + /*TRAINER_CLASS_GUITARIST*/ 0, + /*TRAINER_CLASS_ACE_TRAINER_SNOW_M*/ 0, + /*TRAINER_CLASS_ACE_TRAINER_SNOW_F*/ 1, + /*TRAINER_CLASS_SKIER_M*/ 0, + /*TRAINER_CLASS_SKIER_F*/ 1, + /*TRAINER_CLASS_ROUGHNECK*/ 0, + /*TRAINER_CLASS_CLOWN*/ 0, + /*TRAINER_CLASS_WORKER*/ 0, + /*TRAINER_CLASS_SCHOOL_KID_M*/ 0, + /*TRAINER_CLASS_SCHOOL_KID_F*/ 1, + /*TRAINER_CLASS_LEADER_ROARK*/ 0, + /*TRAINER_CLASS_PKMN_TRAINER_BARRY*/ 0, + /*TRAINER_CLASS_LEADER_BYRON*/ 0, + /*TRAINER_CLASS_ELITE_FOUR_AARON*/ 0, + /*TRAINER_CLASS_ELITE_FOUR_BERTHA*/ 1, + /*TRAINER_CLASS_ELITE_FOUR_FLINT*/ 0, + /*TRAINER_CLASS_ELITE_FOUR_LUCIEN*/ 0, + /*TRAINER_CLASS_CHAMPION*/ 1, + /*TRAINER_CLASS_BELLE__PA*/ 2, + /*TRAINER_CLASS_RANCHER*/ 0, + /*TRAINER_CLASS_COMMANDER_MARS*/ 1, + /*TRAINER_CLASS_GALACTIC*/ 0, + /*TRAINER_CLASS_LEADER_GARDENIA*/ 1, + /*TRAINER_CLASS_LEADER_WAKE*/ 0, + /*TRAINER_CLASS_LEADER_MAYLENE*/ 1, + /*TRAINER_CLASS_LEADER_FANTINA*/ 1, + /*TRAINER_CLASS_LEADER_CANDICE*/ 1, + /*TRAINER_CLASS_LEADER_VOLKNER*/ 0, + /*TRAINER_CLASS_PARASOL_LADY*/ 1, + /*TRAINER_CLASS_WAITER*/ 0, + /*TRAINER_CLASS_INTERVIEWERS*/ 2, + /*TRAINER_CLASS_CAMERAMAN*/ 0, + /*TRAINER_CLASS_REPORTER*/ 1, + /*TRAINER_CLASS_IDOL*/ 1, + /*TRAINER_CLASS_GALACTIC_BOSS*/ 0, + /*TRAINER_CLASS_COMMANDER_JUPITER*/ 1, + /*TRAINER_CLASS_COMMANDER_SATURN*/ 1, + /*TRAINER_CLASS_GALACTIC_F*/ 1, + /*TRAINER_CLASS_PKMN_TRAINER_CHERYL*/ 1, + /*TRAINER_CLASS_PKMN_TRAINER_RILEY*/ 0, + /*TRAINER_CLASS_PKMN_TRAINER_MARLEY*/ 1, + /*TRAINER_CLASS_PKMN_TRAINER_BUCK*/ 0, + /*TRAINER_CLASS_PKMN_TRAINER_MIRA*/ 1, + /*TRAINER_CLASS_PKMN_TRAINER_LUCAS*/ 0, + /*TRAINER_CLASS_PKMN_TRAINER_DAWN*/ 1, + /*TRAINER_CLASS_TOWER_TYCOON*/ 0 }; // Returns 0 for male, 1 for female, 2 for doubles. See above vector. -int TrainerClass_GetGenderOrTrainerCount(int a0) -{ +int TrainerClass_GetGenderOrTrainerCount(int a0) { return sTrainerClassGenderCountTbl[a0]; } -void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) -{ - union TrainerMon * data; +void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) { + union TrainerMon *data; s32 i; s32 j; u32 seed_bak; - struct Pokemon * pokemon; - struct TrainerMonSpeciesItemMoves * monSpeciesItemMoves; - struct TrainerMonSpeciesItem * monSpeciesItem; - struct TrainerMonSpeciesMoves * monSpeciesMoves; - struct TrainerMonSpecies * monSpecies; + struct Pokemon *pokemon; + struct TrainerMonSpeciesItemMoves *monSpeciesItemMoves; + struct TrainerMonSpeciesItem *monSpeciesItem; + struct TrainerMonSpeciesMoves *monSpeciesMoves; + struct TrainerMonSpecies *monSpecies; u32 seed; u32 personality; u8 iv; @@ -278,7 +266,7 @@ void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) // state seed_bak = GetLCRNGSeed(); Party_InitWithMaxSize(setup->party[party_id], PARTY_SIZE); - data = (union TrainerMon *)AllocFromHeap(heapId, sizeof(union TrainerMon) * PARTY_SIZE); + data = (union TrainerMon *)AllocFromHeap(heapId, sizeof(union TrainerMon) * PARTY_SIZE); pokemon = AllocMonZeroed(heapId); TrainerData_ReadTrPoke(setup->trainerId[party_id], data); @@ -292,13 +280,10 @@ void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) // array, with bit 0 being custom moveset and bit 1 being held item. // Nintendo didn't do it that way, instead using a switch statement and a lot // of code duplication. This has been the case since the 2nd generation games. - switch (setup->trainers[party_id].data.trainerType) - { - case TRTYPE_MON: - { + switch (setup->trainers[party_id].data.trainerType) { + case TRTYPE_MON: { monSpecies = &data->species; - for (i = 0; i < setup->trainers[party_id].data.npoke; i++) - { + for (i = 0; i < setup->trainers[party_id].data.npoke; i++) { // Generate personality by seeding with a value based on the difficulty, // level, species, and opponent ID. Roll the RNG N times, where N is // the index of its trainer class. Finally, left shift the 16-bit @@ -307,8 +292,7 @@ void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) // consistent manner between attempts. seed = monSpecies[i].difficulty + monSpecies[i].level + monSpecies[i].species + setup->trainerId[party_id]; SetLCRNGSeed(seed); - for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) - { + for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) { seed = LCRandom(); } personality = (seed << 8); @@ -326,38 +310,31 @@ void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) } break; } - case TRTYPE_MON_MOVES: - { + case TRTYPE_MON_MOVES: { monSpeciesMoves = &data->species_moves; - for (i = 0; i < setup->trainers[party_id].data.npoke; i++) - { + for (i = 0; i < setup->trainers[party_id].data.npoke; i++) { seed = monSpeciesMoves[i].difficulty + monSpeciesMoves[i].level + monSpeciesMoves[i].species + setup->trainerId[party_id]; SetLCRNGSeed(seed); - for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) - { + for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) { seed = LCRandom(); } personality = (seed << 8); personality += pid_gender; iv = (u8)((monSpeciesMoves[i].difficulty * 31) / 255); CreateMon(pokemon, monSpeciesMoves[i].species, monSpeciesMoves[i].level, iv, 1, (s32)personality, 2, 0); - for (j = 0; j < 4; j++) - { + for (j = 0; j < 4; j++) { MonSetMoveInSlot(pokemon, monSpeciesMoves[i].moves[j], (u8)j); } Party_AddMon(setup->party[party_id], pokemon); } break; } - case TRTYPE_MON_ITEM: - { + case TRTYPE_MON_ITEM: { monSpeciesItem = &data->species_item; - for (i = 0; i < setup->trainers[party_id].data.npoke; i++) - { + for (i = 0; i < setup->trainers[party_id].data.npoke; i++) { seed = monSpeciesItem[i].difficulty + monSpeciesItem[i].level + monSpeciesItem[i].species + setup->trainerId[party_id]; SetLCRNGSeed(seed); - for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) - { + for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) { seed = LCRandom(); } personality = (seed << 8); @@ -369,15 +346,12 @@ void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) } break; } - case TRTYPE_MON_ITEM_MOVES: - { + case TRTYPE_MON_ITEM_MOVES: { monSpeciesItemMoves = &data->species_item_moves; - for (i = 0; i < setup->trainers[party_id].data.npoke; i++) - { + for (i = 0; i < setup->trainers[party_id].data.npoke; i++) { seed = monSpeciesItemMoves[i].difficulty + monSpeciesItemMoves[i].level + monSpeciesItemMoves[i].species + setup->trainerId[party_id]; SetLCRNGSeed(seed); - for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) - { + for (j = 0; j < setup->trainers[party_id].data.trainerClass; j++) { seed = LCRandom(); } personality = (seed << 8); @@ -385,8 +359,7 @@ void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId) iv = (u8)((monSpeciesItemMoves[i].difficulty * 31) / 255); CreateMon(pokemon, monSpeciesItemMoves[i].species, monSpeciesItemMoves[i].level, iv, 1, (s32)personality, 2, 0); SetMonData(pokemon, MON_DATA_HELD_ITEM, &monSpeciesItemMoves[i].item); - for (j = 0; j < 4; j++) - { + for (j = 0; j < 4; j++) { MonSetMoveInSlot(pokemon, monSpeciesItemMoves[i].moves[j], (u8)j); } Party_AddMon(setup->party[party_id], pokemon); diff --git a/arm9/src/unk_020040F4.c b/arm9/src/unk_020040F4.c index ae879f1d8..9b9b0ef38 100644 --- a/arm9/src/unk_020040F4.c +++ b/arm9/src/unk_020040F4.c @@ -1,10 +1,12 @@ -#include "global.h" #include "unk_020040F4.h" + +#include "global.h" + #include "OS_cache.h" +#include "SPI_mic.h" #include "sound.h" #include "unk_020051F4.h" #include "unk_0202F150.h" -#include "SPI_mic.h" u32 UNK_021C3DD8[2]; @@ -48,251 +50,230 @@ extern u32 NNS_SndPlayerGetTick(u32 *); extern void NNS_SndPlayerSetAllocatableChannel(u32, u32); extern void NNS_SndPlayerSetPlayerVolume(u32, u8); -void sub_020040F4(u8 param0) -{ +void sub_020040F4(u8 param0) { u8 *ptr = sub_02003D38(5); - *ptr = param0; + *ptr = param0; } -u8 sub_02004104(void) -{ +u8 sub_02004104(void) { u8 *ptr = sub_02003D38(5); return *ptr; } -void sub_02004110(u16 param0) -{ +void sub_02004110(u16 param0) { u16 *ptr = sub_02003D38(9); - *ptr = param0; + *ptr = param0; sub_02004130(0); } -u16 sub_02004124(void) -{ +u16 sub_02004124(void) { u16 *ptr = sub_02003D38(9); return *ptr; } -void sub_02004130(u16 param0) -{ +void sub_02004130(u16 param0) { u16 *ptr = sub_02003D38(10); - *ptr = param0; + *ptr = param0; } -u16 sub_02004140(void) -{ +u16 sub_02004140(void) { u16 *ptr = sub_02003D38(10); return *ptr; } -void sub_0200414C(u16 param0) -{ +void sub_0200414C(u16 param0) { u16 *ptr = sub_02003D38(31); - *ptr = param0; + *ptr = param0; } -void sub_0200415C(u8 param0) -{ - u8 *ptr = sub_02003D38(20); +void sub_0200415C(u8 param0) { + u8 *ptr = sub_02003D38(20); u8 *ptr2 = sub_02003D38(21); - if (param0 < 51) - { - *ptr = param0; + if (param0 < 51) { + *ptr = param0; *ptr2 = 0; - } - else - { + } else { *ptr2 = param0; } } -BOOL sub_02004180(s32 param0) -{ +BOOL sub_02004180(s32 param0) { BOOL res; - switch (param0) - { - case 1: - case 9: - case 10: - case 14: - res = GF_Snd_LoadGroup(1); - break; - case 2: - case 13: - res = GF_Snd_LoadGroup(2); - break; - case 3: - res = GF_Snd_LoadGroup(13); - break; - case 4: - res = GF_Snd_LoadGroup(1); - break; - case 5: - res = GF_Snd_LoadGroup(2); - break; - case 11: - res = GF_Snd_LoadGroup(1); - break; - case 6: - res = GF_Snd_LoadGroup(11); - break; - case 8: - res = GF_Snd_LoadGroup(1); - break; - case 12: - res = GF_Snd_LoadGroup(14); - break; - case 51: - res = GF_Snd_LoadGroup(3); - break; - case 66: - res = GF_Snd_LoadGroup(6); - break; - case 52: - res = GF_Snd_LoadGroup(5); - break; - case 7: - case 53: - res = GF_Snd_LoadGroup(9); - break; - case 54: - res = GF_Snd_LoadGroup(10); - break; - case 55: - case 67: - res = GF_Snd_LoadBank(0x5e5); - res = GF_Snd_LoadWaveArc(0x5e5); - break; - case 56: - res = GF_Snd_LoadGroup(12); - break; - case 57: - res = GF_Snd_LoadGroup(7); - break; - case 58: - res = GF_Snd_LoadGroup(8); - break; - case 59: - res = GF_Snd_LoadGroup(15); - break; - case 60: - res = GF_Snd_LoadGroup(3); - break; - case 61: - res = GF_Snd_LoadGroup(5); - break; - case 62: - res = GF_Snd_LoadGroup(15); - break; - case 63: - res = GF_Snd_LoadGroup(4); - break; - case 64: - res = GF_Snd_LoadBank(0x5ed); - res = GF_Snd_LoadWaveArc(0x5ed); - break; - case 65: - res = GF_Snd_LoadBank(0x5ec); - res = GF_Snd_LoadWaveArc(0x5ec); - break; + switch (param0) { + case 1: + case 9: + case 10: + case 14: + res = GF_Snd_LoadGroup(1); + break; + case 2: + case 13: + res = GF_Snd_LoadGroup(2); + break; + case 3: + res = GF_Snd_LoadGroup(13); + break; + case 4: + res = GF_Snd_LoadGroup(1); + break; + case 5: + res = GF_Snd_LoadGroup(2); + break; + case 11: + res = GF_Snd_LoadGroup(1); + break; + case 6: + res = GF_Snd_LoadGroup(11); + break; + case 8: + res = GF_Snd_LoadGroup(1); + break; + case 12: + res = GF_Snd_LoadGroup(14); + break; + case 51: + res = GF_Snd_LoadGroup(3); + break; + case 66: + res = GF_Snd_LoadGroup(6); + break; + case 52: + res = GF_Snd_LoadGroup(5); + break; + case 7: + case 53: + res = GF_Snd_LoadGroup(9); + break; + case 54: + res = GF_Snd_LoadGroup(10); + break; + case 55: + case 67: + res = GF_Snd_LoadBank(0x5e5); + res = GF_Snd_LoadWaveArc(0x5e5); + break; + case 56: + res = GF_Snd_LoadGroup(12); + break; + case 57: + res = GF_Snd_LoadGroup(7); + break; + case 58: + res = GF_Snd_LoadGroup(8); + break; + case 59: + res = GF_Snd_LoadGroup(15); + break; + case 60: + res = GF_Snd_LoadGroup(3); + break; + case 61: + res = GF_Snd_LoadGroup(5); + break; + case 62: + res = GF_Snd_LoadGroup(15); + break; + case 63: + res = GF_Snd_LoadGroup(4); + break; + case 64: + res = GF_Snd_LoadBank(0x5ed); + res = GF_Snd_LoadWaveArc(0x5ed); + break; + case 65: + res = GF_Snd_LoadBank(0x5ec); + res = GF_Snd_LoadWaveArc(0x5ec); + break; } return res; } -BOOL sub_0200433C(u8 param0, u16 param1, u32 param2) -{ +BOOL sub_0200433C(u8 param0, u16 param1, u32 param2) { u8 *st0 = sub_02003D38(20); u8 *st4 = sub_02003D38(21); u16 *r7 = sub_02003D38(13); - if (param0 < 51) - { - if (*st0 == param0) - { + if (param0 < 51) { + if (*st0 == param0) { return FALSE; } - } - else - { - if (*st4 == param0) - { + } else { + if (*st4 == param0) { return FALSE; } } sub_0200415C(param0); - switch (param0) - { - case 4: - sub_0200516C(0); - sub_020044D4(param1, param2); - *r7 = 0; - break; - case 5: - sub_02004648(param1, param2); - break; - case 11: - sub_02004680(param1, param2); - break; - case 6: - sub_020046A0(param1, param2); - break; - case 7: - sub_020046C4(param1, param2); - break; - case 57: - case 53: - case 51: - case 52: - case 54: - case 55: - case 56: - case 58: - case 59: - case 60: - case 61: - case 62: - case 63: - case 64: - case 65: - case 66: - case 67: - sub_020046E8(param0); - break; - case 1: - sub_0200516C(1); - sub_02004704(param0, param1, param2); - break; - case 14: - sub_0200516C(2); - sub_02004704(param0, param1, param2); - break; - case 2: - sub_0200516C(0); - sub_02004704(param0, param1, param2); - break; - case 3: - case 8: - case 9: - case 10: - case 12: - case 13: - sub_02004704(param0, param1, param2); - break; + switch (param0) { + case 4: + sub_0200516C(0); + sub_020044D4(param1, param2); + *r7 = 0; + break; + case 5: + sub_02004648(param1, param2); + break; + case 11: + sub_02004680(param1, param2); + break; + case 6: + sub_020046A0(param1, param2); + break; + case 7: + sub_020046C4(param1, param2); + break; + case 57: + case 53: + case 51: + case 52: + case 54: + case 55: + case 56: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + sub_020046E8(param0); + break; + case 1: + sub_0200516C(1); + sub_02004704(param0, param1, param2); + break; + case 14: + sub_0200516C(2); + sub_02004704(param0, param1, param2); + break; + case 2: + sub_0200516C(0); + sub_02004704(param0, param1, param2); + break; + case 3: + case 8: + case 9: + case 10: + case 12: + case 13: + sub_02004704(param0, param1, param2); + break; } return TRUE; } -void sub_020044A8(s32 param0) -{ +void sub_020044A8(s32 param0) { int *ptr = sub_02003D38(23); GF_Snd_RestoreState(*ptr); @@ -305,8 +286,7 @@ void sub_020044A8(s32 param0) GF_Snd_SaveState(ptr3); } -void sub_020044D4(u16 seqNo, u32 param1) -{ +void sub_020044D4(u16 seqNo, u32 param1) { #pragma unused(param1) u8 *ptr = sub_02003D38(11); @@ -315,28 +295,24 @@ void sub_020044D4(u16 seqNo, u32 param1) sub_02003D38(31); u32 r4 = GF_SndPlayerGetSeqNo(GetSoundPlayer(0)); - if (*ptr == 0 && r4 == seqNo && sub_02004140() != 1152) - { + if (*ptr == 0 && r4 == seqNo && sub_02004140() != 1152) { return; } sub_02004DBC(1); sub_02005454(); - if (r4 != seqNo) - { + if (r4 != seqNo) { sub_020047C8(1, 0); sub_0200541C(); } - if (*ptr == 1) - { + if (*ptr == 1) { GF_Snd_RestoreState(sub_02004748(2)); sub_02004180(4); GF_Snd_SaveState((int *)sub_02003D38(25)); - if (r4 != seqNo) - { + if (r4 != seqNo) { sub_020047C8(1, 0); } sub_02004568(seqNo, (u16)r4); @@ -346,20 +322,16 @@ void sub_020044D4(u16 seqNo, u32 param1) sub_0200521C(seqNo); } -void sub_02004568(int seqNo, u16 param1) -{ +void sub_02004568(int seqNo, u16 param1) { #pragma unused(param1) u16 *ptr = sub_02003D38(31); u32 r0 = sub_02004900(*ptr); - if (r0 != 1001 && r0 != 1003) - { + if (r0 != 1001 && r0 != 1003) { GF_Snd_LoadSeqEx(seqNo, 4); GF_ASSERT(FALSE); - } - else - { + } else { GF_Snd_LoadSeqEx(*ptr, 6); } @@ -369,13 +341,11 @@ void sub_02004568(int seqNo, u16 param1) sub_02004DBC(0); } -void sub_020045C4(int seqNo, u32 param1) -{ - u8 *ptr = sub_02003D38(18); +void sub_020045C4(int seqNo, u32 param1) { + u8 *ptr = sub_02003D38(18); u16 *ptr2 = sub_02003D38(31); - if (*ptr != 1 && param1 != 0) - { + if (*ptr != 1 && param1 != 0) { return; } @@ -387,21 +357,17 @@ void sub_020045C4(int seqNo, u32 param1) GF_Snd_SaveState((int *)sub_02003D38(25)); u32 r0 = sub_02004900(*ptr2); - if (r0 != 1001 && r0 != 1003) - { + if (r0 != 1001 && r0 != 1003) { GF_Snd_LoadSeqEx(seqNo, 4); GF_ASSERT(FALSE); - } - else - { + } else { GF_Snd_LoadSeqEx(*ptr2, 4); } GF_Snd_SaveState((int *)sub_02003D38(26)); } -void sub_02004648(u16 param0, u32 param1) -{ +void sub_02004648(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); sub_020051AC(); @@ -413,8 +379,7 @@ void sub_02004648(u16 param0, u32 param1) sub_0200521C(param0); } -void sub_02004680(u16 param0, u32 param1) -{ +void sub_02004680(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); sub_0200541C(); @@ -423,8 +388,7 @@ void sub_02004680(u16 param0, u32 param1) sub_0200521C(param0); } -void sub_020046A0(u16 param0, u32 param1) -{ +void sub_020046A0(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); sub_0200541C(); @@ -433,8 +397,7 @@ void sub_020046A0(u16 param0, u32 param1) sub_0200521C(param0); } -void sub_020046C4(u16 param0, u32 param1) -{ +void sub_020046C4(u16 param0, u32 param1) { #pragma unused(param1) sub_02003D38(23); sub_0200541C(); @@ -443,15 +406,13 @@ void sub_020046C4(u16 param0, u32 param1) sub_0200521C(param0); } -void sub_020046E8(s32 param0) -{ +void sub_020046E8(s32 param0) { sub_02004738(); sub_02004180(param0); GF_Snd_SaveState((int *)sub_02003D38(27)); } -void sub_02004704(s32 param0, u16 param1, u32 param2) -{ +void sub_02004704(s32 param0, u16 param1, u32 param2) { #pragma unused(param2) sub_02003D38(23); sub_0200541C(); @@ -459,79 +420,68 @@ void sub_02004704(s32 param0, u16 param1, u32 param2) sub_0200521C(param1); } -void sub_02004724(u16 param0) -{ +void sub_02004724(u16 param0) { GetSoundDataPointer(); sub_020051AC(); sub_0200521C(param0); } -void sub_02004738(void) -{ +void sub_02004738(void) { GF_Snd_RestoreState(sub_02004748(4)); } -int sub_02004748(s32 param0) -{ +int sub_02004748(s32 param0) { GetSoundDataPointer(); - if (param0 >= 7) - { + if (param0 >= 7) { GF_AssertFail(); return *(int *)sub_02003D38(26); } int *r5; - switch (param0) - { - case 0: - r5 = sub_02003D38(22); - break; - case 1: - r5 = sub_02003D38(23); - break; - case 2: - r5 = sub_02003D38(24); - break; - case 3: - r5 = sub_02003D38(25); - break; - case 4: - r5 = sub_02003D38(26); - break; - case 5: - r5 = sub_02003D38(27); - break; - case 6: - r5 = sub_02003D38(28); - break; + switch (param0) { + case 0: + r5 = sub_02003D38(22); + break; + case 1: + r5 = sub_02003D38(23); + break; + case 2: + r5 = sub_02003D38(24); + break; + case 3: + r5 = sub_02003D38(25); + break; + case 4: + r5 = sub_02003D38(26); + break; + case 5: + r5 = sub_02003D38(27); + break; + case 6: + r5 = sub_02003D38(28); + break; } return *r5; } -void sub_020047C8(u8 param0, u8 param1) -{ +void sub_020047C8(u8 param0, u8 param1) { u8 *ptr; int r4; - if (param0 == 1) - { + if (param0 == 1) { ptr = sub_02003D38(11); - r4 = 0; - } - else - { - if (param0 != 7) - { + r4 = 0; + } else { + if (param0 != 7) { return; } ptr = sub_02003D38(12); - r4 = 7; + r4 = 7; } - if (param1 == 0) - { + if (param1 == 0) { sub_02004110((u16)GF_SndPlayerGetSeqNo(GetSoundPlayer(r4))); } @@ -539,184 +489,146 @@ void sub_020047C8(u8 param0, u8 param1) *ptr = param1; } -void sub_02004810(void) -{ - u8 *ptr = sub_02003D38(11); +void sub_02004810(void) { + u8 *ptr = sub_02003D38(11); u8 *ptr2 = sub_02003D38(12); - *ptr = 0; - *ptr2 = 0; + *ptr = 0; + *ptr2 = 0; } -void GF_SndPlayerMoveVolume(int playerNo, s32 param1, s32 param2) -{ +void GF_SndPlayerMoveVolume(int playerNo, s32 param1, s32 param2) { NNS_SndPlayerMoveVolume(GetSoundPlayer(playerNo), param1, param2); } -void GF_SndPlayerSetInitialVolume(int playerNo, s32 param1) -{ - if (param1 < 0) - { +void GF_SndPlayerSetInitialVolume(int playerNo, s32 param1) { + if (param1 < 0) { param1 = 0; } - if (param1 > 127) - { + if (param1 > 127) { param1 = 127; } NNS_SndPlayerSetInitialVolume(GetSoundPlayer(playerNo), param1); } -void sub_02004858(u32 param0, int playerNo) -{ +void sub_02004858(u32 param0, int playerNo) { u8 *ret = NNS_SndArcGetSeqParam(param0); u8 r4; - if (playerNo == 1 || playerNo == 8) - { + if (playerNo == 1 || playerNo == 8) { r4 = 127; - } - else - { - if (ret == NULL) - { + } else { + if (ret == NULL) { return; } r4 = ret[2]; } - if (sub_020313EC() == 1) - { + if (sub_020313EC() == 1) { GF_SndPlayerSetInitialVolume(playerNo, r4 / 5); } } -void sub_0200488C(u16 param0, u16 param1) -{ +void sub_0200488C(u16 param0, u16 param1) { GF_SndPlayerSetInitialVolume(sub_02004018(sub_020048D0(param0)), param1); } -void GF_SndArcPlayerStartSeqEx(int playerNo, u32 param1, u32 param2) -{ +void GF_SndArcPlayerStartSeqEx(int playerNo, u32 param1, u32 param2) { NNS_SndArcPlayerStartSeqEx(GetSoundPlayer(playerNo), param1, -1, -1, param2); } -u16 GF_SndPlayerCountPlayingSeqByPlayerNo(int playerNo) -{ +u16 GF_SndPlayerCountPlayingSeqByPlayerNo(int playerNo) { GF_ASSERT(playerNo >= 0); return NNS_SndPlayerCountPlayingSeqByPlayerNo(playerNo); } -u8 sub_020048D0(u16 param0) -{ - if (param0 == 0) - { +u8 sub_020048D0(u16 param0) { + if (param0 == 0) { return 0xff; } u8 *ptr = NNS_SndArcGetSeqParam(param0); - if (ptr == NULL) - { + if (ptr == NULL) { return 0xff; } return ptr[5]; } -u32 GF_SndPlayerGetSeqNo(u32 *param0) -{ +u32 GF_SndPlayerGetSeqNo(u32 *param0) { return NNS_SndPlayerGetSeqNo(param0); } -u32 sub_020048F4(u16 param0) -{ +u32 sub_020048F4(u16 param0) { return NNS_SndArcGetBankInfo(sub_02004900(param0)); } -u16 sub_02004900(u32 param0) -{ +u16 sub_02004900(u32 param0) { u16 *ptr = NNS_SndArcGetSeqParam(param0); - if (ptr == NULL) - { + if (ptr == NULL) { return 0; } return *ptr; } -u32 GF_MIC_StartAutoSampling(struct MIC_SamplingData *param0) -{ +u32 GF_MIC_StartAutoSampling(struct MIC_SamplingData *param0) { return MIC_StartAutoSampling(param0); } -u32 GF_MIC_StopAutoSampling(void) -{ +u32 GF_MIC_StopAutoSampling(void) { GetSoundDataPointer(); return MIC_StopAutoSampling(); } -u32 GF_MIC_DoSamplingAsync(u32 param0, u32 param1, u32 param2, u32 param3) -{ +u32 GF_MIC_DoSamplingAsync(u32 param0, u32 param1, u32 param2, u32 param3) { return MIC_DoSamplingAsync(param0, param1, param2, param3); } -void *sub_02004930(u32 param0) -{ +void *sub_02004930(u32 param0) { GetSoundDataPointer(); - u8 *ptr = sub_02003D38(15); + u8 *ptr = sub_02003D38(15); u8 *ptr2 = sub_02003D38(16); GF_ASSERT(param0 == 14 || param0 == 15); GF_ASSERT(param0 != 14 || *ptr != 0); GF_ASSERT(param0 != 15 || *ptr2 != 0); - if (param0 == 14) - { + if (param0 == 14) { return sub_02003D38(0); } return sub_02003D38(1); } -BOOL sub_02004984(u32 param0) -{ +BOOL sub_02004984(u32 param0) { GetSoundDataPointer(); - u8 *ptr = sub_02003D38(15); + u8 *ptr = sub_02003D38(15); u8 *ptr2 = sub_02003D38(16); GF_ASSERT(param0 == 14 || param0 == 15); - if (param0 == 14) - { - if (*ptr == 0) - { + if (param0 == 14) { + if (*ptr == 0) { u32 *r4 = sub_02003D38(0); - *r4 = NNS_SndWaveOutAllocChannel(param0); - if (*r4 == 0) - { + *r4 = NNS_SndWaveOutAllocChannel(param0); + if (*r4 == 0) { return FALSE; } *ptr = 1; - } - else - { + } else { GF_AssertFail(); } - } - else - { - if (*ptr2 == 0) - { + } else { + if (*ptr2 == 0) { u32 *r6 = sub_02003D38(1); - *r6 = NNS_SndWaveOutAllocChannel(param0); - if (*r6 == 0) - { + *r6 = NNS_SndWaveOutAllocChannel(param0); + if (*r6 == 0) { return FALSE; } *ptr2 = 1; - } - else - { + } else { GF_AssertFail(); } } @@ -724,46 +636,36 @@ BOOL sub_02004984(u32 param0) return TRUE; } -void sub_02004A04(u32 param0) -{ +void sub_02004A04(u32 param0) { GetSoundDataPointer(); - u8 *ptr = sub_02003D38(15); + u8 *ptr = sub_02003D38(15); u8 *ptr2 = sub_02003D38(16); - if (param0 != 14 && param0 != 15) - { + if (param0 != 14 && param0 != 15) { GF_AssertFail(); return; } - if (param0 == 14) - { - if (*ptr == 1) - { + if (param0 == 14) { + if (*ptr == 1) { NNS_SndWaveOutFreeChannel(*(u32 *)sub_02004930(param0)); *ptr = 0; return; - } - else - { + } else { GF_AssertFail(); return; } } - if (*ptr2 == 1) - { + if (*ptr2 == 1) { NNS_SndWaveOutFreeChannel(*(u32 *)sub_02004930(param0)); *ptr2 = 0; return; - } - else - { + } else { GF_AssertFail(); } } -u32 sub_02004A6C(struct UnkStruct_020040F4_1 *param0, u32 param1) -{ +u32 sub_02004A6C(struct UnkStruct_020040F4_1 *param0, u32 param1) { u32 res = NNS_SndWaveOutStart(*(u32 *)param0->unk00, param0->unk04, param0->unk08, @@ -774,43 +676,35 @@ u32 sub_02004A6C(struct UnkStruct_020040F4_1 *param0, u32 param1) param0->unk1c, param0->unk20, param0->unk24); - if (res == 0) - { + if (res == 0) { sub_02004A04(param1); } return res; } -void sub_02004AAC(u32 param0) -{ +void sub_02004AAC(u32 param0) { NNS_SndWaveOutStop(*(u32 *)sub_02004930(param0)); } -BOOL sub_02004ABC(u32 param0) -{ +BOOL sub_02004ABC(u32 param0) { return NNS_SndWaveOutIsPlaying(*(u32 *)sub_02004930(param0)); } -void sub_02004ACC(u32 param0, u32 param1) -{ - if (param1 > 127) - { +void sub_02004ACC(u32 param0, u32 param1) { + if (param1 > 127) { param1 = 127; } NNS_SndWaveOutSetPan(*(u32 *)sub_02004930(param0), param1); } -void sub_02004AE4(u32 param0, u32 param1) -{ +void sub_02004AE4(u32 param0, u32 param1) { NNS_SndWaveOutSetSpeed(*(u32 *)sub_02004930(param0), param1); } -void sub_02004AF8(u32 param0, s32 param1) -{ - if (sub_020313EC() == 1) - { +void sub_02004AF8(u32 param0, s32 param1) { + if (sub_020313EC() == 1) { NNS_SndWaveOutSetVolume(*(u32 *)sub_02004930(param0), param1 / 5); return; } @@ -818,40 +712,34 @@ void sub_02004AF8(u32 param0, s32 param1) NNS_SndWaveOutSetVolume(*(u32 *)sub_02004930(param0), param1); } -u32 sub_02004B30(u32 param0, s32 param1, s32 param2, u32 param3, HeapID heapId) -{ +u32 sub_02004B30(u32 param0, s32 param1, s32 param2, u32 param3, HeapID heapId) { GetSoundDataPointer(); void **r4 = sub_02003D38(33); GF_ASSERT(param3 == 14 || param3 == 15); struct WaveArcInfo *r7 = NNS_SndArcGetWaveArcInfo(param0); - if (r7 == 0) - { + if (r7 == 0) { GF_AssertFail(); return 0; } u32 r6 = NNS_SndArcGetFileSize(r7->unk00); - if (r6 == 0) - { + if (r6 == 0) { GF_AssertFail(); return 0; } - if (param3 == 14) - { + if (param3 == 14) { void *ptr = AllocFromHeap(heapId, r6); - *r4 = ptr; - if (ptr == NULL) - { + *r4 = ptr; + if (ptr == NULL) { GF_AssertFail(); return 0; } memset(ptr, 0, r6); - if (NNS_SndArcReadFile(r7->unk00, *r4, r6, 0) == -1) - { + if (NNS_SndArcReadFile(r7->unk00, *r4, r6, 0) == -1) { GF_AssertFail(); return 0; } @@ -876,130 +764,108 @@ u32 sub_02004B30(u32 param0, s32 param1, s32 param2, u32 param3, HeapID heapId) u32 ret = sub_02004A6C(&st8, param3); sub_02004AF8(param3, param1); u8 *r0 = sub_02003D38(14); - *r0 = 1; + *r0 = 1; return ret; } -void sub_02004C1C(u8 *param0, u32 param1) -{ - for (u32 r5 = 0; r5 < param1 / 2; r5++) - { - u8 r4 = param0[r5]; - param0[r5] = param0[param1 - 1 - r5]; +void sub_02004C1C(u8 *param0, u32 param1) { + for (u32 r5 = 0; r5 < param1 / 2; r5++) { + u8 r4 = param0[r5]; + param0[r5] = param0[param1 - 1 - r5]; param0[param1 - 1 - r5] = r4; } } -void sub_02004C3C(u32 param0) -{ +void sub_02004C3C(u32 param0) { GetSoundDataPointer(); - u8 *ptr = sub_02003D38(14); + u8 *ptr = sub_02003D38(14); void **ptr2 = sub_02003D38(33); GF_ASSERT(param0 == 14 || param0 == 15); sub_02004AAC(param0); - if (*ptr == 1) - { + if (*ptr == 1) { *ptr = 0; FreeToHeap(*ptr2); } } -BOOL GF_SndCaptureIsActive(void) -{ +BOOL GF_SndCaptureIsActive(void) { return NNS_SndCaptureIsActive(); } -u32 GF_SndCaptureStartReverb(u32 param0) -{ +u32 GF_SndCaptureStartReverb(u32 param0) { GetSoundDataPointer(); return NNS_SndCaptureStartReverb(sub_02003D38(3), 0x1000, 0, 0x3E80, param0); } -void GF_SndCaptureStopReverb(u32 param0) -{ +void GF_SndCaptureStopReverb(u32 param0) { NNS_SndCaptureStopReverb(param0); } -void GF_SndCaptureSetReverbVolume(u32 param0, u32 param1) -{ +void GF_SndCaptureSetReverbVolume(u32 param0, u32 param1) { NNS_SndCaptureSetReverbVolume(param0, param1); } -void sub_02004CB4(void) -{ +void sub_02004CB4(void) { GetSoundDataPointer(); MI_CpuFill8(sub_02003D38(4), 0, 0x1c); - void *r4 = sub_02003D38(3); + void *r4 = sub_02003D38(3); void *st8 = sub_02003D38(4); NNS_SndCaptureStartEffect(r4, 0x1000, 0, 0x55F0, 2, sub_02005068, st8); } -void GF_SndCaptureStopEffect(void) -{ +void GF_SndCaptureStopEffect(void) { NNS_SndCaptureStopEffect(); } -void sub_02004D04(s32 param0) -{ +void sub_02004D04(s32 param0) { u8 *ptr = sub_02003D38(19); - if (param0 > 8) - { + if (param0 > 8) { param0 = 8; - } - else if (param0 < 0) - { + } else if (param0 < 0) { param0 = 0; } *ptr = (u8)param0; } -void GF_SndPlayerSetTrackPitch(int playerNo, u32 param1, s32 param2) -{ +void GF_SndPlayerSetTrackPitch(int playerNo, u32 param1, s32 param2) { NNS_SndPlayerSetTrackPitch(GetSoundPlayer(playerNo), param1, param2); } -void sub_02004D34(u16 param0, u32 param1, s32 param2) -{ +void sub_02004D34(u16 param0, u32 param1, s32 param2) { GF_SndPlayerSetTrackPitch(sub_02004018(sub_020048D0(param0)), param1, param2); } -void GF_SndPlayerSetTrackPan(int playerNo, u32 param1, s32 param2) -{ +void GF_SndPlayerSetTrackPan(int playerNo, u32 param1, s32 param2) { NNS_SndPlayerSetTrackPan(GetSoundPlayer(playerNo), param1, param2); } -void GF_SndSetMonoFlag(u32 param0) -{ +void GF_SndSetMonoFlag(u32 param0) { NNS_SndSetMonoFlag(param0); UNK_021C3DD8[0] = param0; } -void sub_02004D74(s32 param0) -{ +void sub_02004D74(s32 param0) { *(s32 *)sub_02003D38(6) = param0; } -void sub_02004D84(u32 param0) -{ +void sub_02004D84(u32 param0) { *(u32 *)sub_02003D38(7) = param0; } -u16 sub_02004D94(void) -{ +u16 sub_02004D94(void) { u16 *ptr = sub_02003D38(7); - if (*ptr == 0) - { + if (*ptr == 0) { *ptr = 0; return 0; } @@ -1007,18 +873,15 @@ u16 sub_02004D94(void) return --(*ptr); } -u8 *sub_02004DB4(void) -{ +u8 *sub_02004DB4(void) { return UNK_021C3DE0; } -void sub_02004DBC(u8 param0) -{ +void sub_02004DBC(u8 param0) { *(u8 *)sub_02003D38(18) = param0; } -u32 sub_02004DCC(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5) -{ +u32 sub_02004DCC(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5) { u8 *ptr = sub_02003D38(21); sub_02004E44(param0, param1, param2, param3, param4, param5); @@ -1029,8 +892,7 @@ u32 sub_02004DCC(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 } u32 sub_02004E08( - u32 param0, u16 param1, u16 param2, u32 param3, u32 param35, u8 param4, u32 param5) -{ + u32 param0, u16 param1, u16 param2, u32 param3, u32 param35, u8 param4, u32 param5) { u32 *ptr = sub_02003D38(8); sub_02004E44(param0, param1, param2, param3, param4, param5); @@ -1040,8 +902,7 @@ u32 sub_02004E08( return 1; } -void sub_02004E44(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5) -{ +void sub_02004E44(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 param5) { #pragma unused(param0) #pragma unused(param5) u32 *ptr = sub_02003D38(2); @@ -1055,34 +916,28 @@ void sub_02004E44(u32 param0, u16 param1, u16 param2, u32 param3, u8 param4, u32 sub_02004DBC(param4); } -u32 sub_02004E80(u32 param0) -{ - if (param0 == 0) - { +u32 sub_02004E80(u32 param0) { + if (param0 == 0) { return 0; } return param0 + 12; } -u32 sub_02004E8C(u32 *param0) -{ - if (param0 == NULL) - { +u32 sub_02004E8C(u32 *param0) { + if (param0 == NULL) { return 0; } return param0[2]; } -u32 sub_02004E98(s32 param0) -{ +u32 sub_02004E98(s32 param0) { GF_Snd_RestoreState(sub_02004748(5)); u16 r4 = (u16)param0; - if (r4 != 0x1B9 && (param0 > 0x1ef || param0 == 0)) - { + if (r4 != 0x1B9 && (param0 > 0x1ef || param0 == 0)) { r4 = 1; } @@ -1090,27 +945,23 @@ u32 sub_02004E98(s32 param0) return sub_02004ED0(r4); } -u32 sub_02004ED0(s32 param0) -{ +u32 sub_02004ED0(s32 param0) { u32 *ptr = sub_02003D38(32); u16 r4 = (u16)param0; - if (r4 != 0x1B9 && (param0 > 0x1ef || param0 == 0)) - { + if (r4 != 0x1B9 && (param0 > 0x1ef || param0 == 0)) { r4 = 1; } struct WaveArcInfo *info = NNS_SndArcGetWaveArcInfo(r4); - if (info == NULL) - { + if (info == NULL) { GF_AssertFail(); return 0; } u32 address = NNS_SndArcGetFileAddress(info->unk00); - if (address == 0) - { + if (address == 0) { GF_AssertFail(); return 0; } @@ -1119,192 +970,149 @@ u32 sub_02004ED0(s32 param0) return *ptr; } -u32 sub_02004F28(u32 param0, struct UnkStruct_020040F4_2 *param1, s32 param2) -{ +u32 sub_02004F28(u32 param0, struct UnkStruct_020040F4_2 *param1, s32 param2) { #pragma unused(param0) u32 r4 = GF_SndPlayerGetTick(1); u32 r5 = param1->unk08; s32 r1 = (param2 / (3 * 0x100)) << 1; - if (r1 < 0) - { + if (r1 < 0) { r1 = 32 / r1; r1 = -r1; - } - else if (r1 == 0) - { + } else if (r1 == 0) { r1 = 32; - } - else - { + } else { r1 = 32 * r1; } u32 r0 = r4 * r1; - if (r0 >= r5) - { + if (r0 >= r5) { r0 = 0; } return r0; } -u32 GF_SndPlayerGetTick(int playerNo) -{ +u32 GF_SndPlayerGetTick(int playerNo) { return NNS_SndPlayerGetTick(GetSoundPlayer(playerNo)); } void sub_02004F70( - struct UnkStruct_020040F4_2 *param0, u8 *param1, int param2, s32 param3) -{ + struct UnkStruct_020040F4_2 *param0, u8 *param1, int param2, s32 param3) { int r0; s32 r1; int i, j; u32 r12 = sub_02004F28(1, param0, param3); - r1 = (s32)r12 - 100; - if (r1 < 0) - { + r1 = (s32)r12 - 100; + if (r1 < 0) { r1 = 0; } int r3 = 0; int r7 = 0; s8 r5; - if (param0->unk0c[r1] < 0x80) - { + if (param0->unk0c[r1] < 0x80) { r5 = 1; - } - else - { + } else { r5 = -1; } r5 = (s8)(s32)r5; - for (i = r1; i < r12; i += 2) - { + for (i = r1; i < r12; i += 2) { r0 = 0; - if (r5 > 0) - { - if (param0->unk0c[i] > 0x80) - { + if (r5 > 0) { + if (param0->unk0c[i] > 0x80) { r0 = 1; - } - else - { + } else { r3++; } - } - else - { - if (param0->unk0c[i] < 0x80) - { + } else { + if (param0->unk0c[i] < 0x80) { r0 = 1; - } - else - { + } else { r3++; } } - if (r0 == 1) - { - for (j = 0; j < 9; j++) - { - if (r3 < UNK_020ECB8C[j]) - { + if (r0 == 1) { + for (j = 0; j < 9; j++) { + if (r3 < UNK_020ECB8C[j]) { r7 = j; break; } } - if (r7 >= param2) - { + if (r7 >= param2) { r7 = param2 - 1; } - if (r3 != 0) - { + if (r3 != 0) { param1[param2 - 1 - r7]++; } r3 = 0; r0 = 0; - if (param0->unk0c[i] < 0x80) - { + if (param0->unk0c[i] < 0x80) { r5 = 1; - } - else - { + } else { r5 = -1; } r5 = (s8)(s32)r5; } } - for (i = 0; i < param2; i++) - { - if (param1[i] >= 10) - { + for (i = 0; i < param2; i++) { + if (param1[i] >= 10) { param1[i] = 9; } } - for (i = 0; i < param2 - 1; i++) - { - if (param1[i] == 0 && param1[i + 1] != 0) - { + for (i = 0; i < param2 - 1; i++) { + if (param1[i] == 0 && param1[i + 1] != 0) { param1[i] = (u8)(param1[i + 1] / 2); return; } } } -void sub_02005068(s16 *param0, s16 *param1, u32 param2, u32 param3, void *param4) -{ +void sub_02005068(s16 *param0, s16 *param1, u32 param2, u32 param3, void *param4) { s16 st10[8][2]; s16(*st0)[2] = param4; - u8 *r7 = sub_02003D38(19); + u8 *r7 = sub_02003D38(19); int r0; int i, j; - if (param3 != 1) - { + if (param3 != 1) { param2 /= 2; } - if (*r7 == 0) - { + if (*r7 == 0) { return; } - for (i = 0; i < *r7; i++) - { + for (i = 0; i < *r7; i++) { st10[i][0] = param0[param2 - (*r7) + i]; st10[i][1] = param1[param2 - (*r7) + i]; } - for (i = (int)param2 - 1; i >= *r7 - 1; i--) - { + for (i = (int)param2 - 1; i >= *r7 - 1; i--) { r0 = 0; - for (j = 0; j < *r7; j++) - { + for (j = 0; j < *r7; j++) { r0 += param0[i - j]; } param0[i] = (s16)(r0 / (*r7)); r0 = 0; - for (j = 0; j < *r7; j++) - { + for (j = 0; j < *r7; j++) { r0 += param1[i - j]; } param1[i] = (s16)(r0 / (*r7)); } - for (i = 0; i < *r7; i++) - { + for (i = 0; i < *r7; i++) { st0[i][0] = st10[i][0]; st0[i][1] = st10[i][1]; } @@ -1313,25 +1121,18 @@ void sub_02005068(s16 *param0, s16 *param1, u32 param2, u32 param3, void *param4 DC_FlushRange(param1, param2); } -void sub_02005160(u32 param0) -{ +void sub_02005160(u32 param0) { NNS_SndPlayerSetAllocatableChannel(7, param0); } -void sub_0200516C(u32 param0) -{ - if (param0 == 0) - { +void sub_0200516C(u32 param0) { + if (param0 == 0) { sub_02005160(0x7ff); GF_SndCaptureStopReverb(0); - } - else if (param0 == 1) - { + } else if (param0 == 1) { sub_02005160(0x7fff); GF_SndCaptureStartReverb(30); - } - else - { + } else { sub_02005160(0x7fff); GF_SndCaptureStartReverb(15); } @@ -1339,11 +1140,8 @@ void sub_0200516C(u32 param0) GF_SndCaptureIsActive(); } -void sub_020051AC(void) -{ - if (GF_SndGetFadeTimer() == 0 && GF_SndPlayerGetSeqNo(GetSoundPlayer(0)) != -1 && - sub_02004124() != 0x47e) - { +void sub_020051AC(void) { + if (GF_SndGetFadeTimer() == 0 && GF_SndPlayerGetSeqNo(GetSoundPlayer(0)) != -1 && sub_02004124() != 0x47e) { sub_02005454(); sub_020047C8(1, 1); @@ -1353,7 +1151,6 @@ void sub_020051AC(void) sub_0200541C(); } -void GF_SndPlayerSetPlayerVolume(u32 param0, u8 param1) -{ +void GF_SndPlayerSetPlayerVolume(u32 param0, u8 param1) { NNS_SndPlayerSetPlayerVolume(param0, param1); } diff --git a/arm9/src/unk_020051F4.c b/arm9/src/unk_020051F4.c index 61b565a3c..2f20b4753 100644 --- a/arm9/src/unk_020051F4.c +++ b/arm9/src/unk_020051F4.c @@ -1,12 +1,15 @@ -#include "global.h" #include "unk_020051F4.h" -#include "NNS_SND_arc.h" + +#include "global.h" + #include "constants/species.h" + +#include "NNS_SND_arc.h" #include "heap.h" #include "sound.h" +#include "sound_chatot.h" #include "unk_020040F4.h" #include "unk_0200CA44.h" -#include "sound_chatot.h" extern u32 NNS_SndArcPlayerStartSeq(u32 *, u32); extern u32 NNS_SndArcPlayerStartSeqEx(u32 *, s32, s32, s32, u32); @@ -16,8 +19,7 @@ extern void NNS_SndPlayerStopSeq(u32 *, u32); extern void NNS_SndPlayerSetTrackPan(u32 *, u32, u32); extern void *sub_0201B6C8(u32 *); -u32 sub_020051F4(u16 param0) -{ +u32 sub_020051F4(u16 param0) { int playerNo = sub_02004018(sub_020048D0(param0)); u32 ret = NNS_SndArcPlayerStartSeq(GetSoundPlayer(playerNo), param0); @@ -27,22 +29,16 @@ u32 sub_020051F4(u16 param0) return ret; } -u32 sub_0200521C(u16 param0) -{ - u8 r4 = sub_020048D0(param0); +u32 sub_0200521C(u16 param0) { + u8 r4 = sub_020048D0(param0); int playerNo = sub_02004018(r4); u32 ret; - if (r4 == 7) - { + if (r4 == 7) { ret = sub_02005288(param0, r4, playerNo); - } - else if (r4 == 1) - { + } else if (r4 == 1) { ret = sub_020052B8(param0, r4, playerNo); - } - else - { + } else { GF_AssertFail(); return 0; } @@ -53,16 +49,14 @@ u32 sub_0200521C(u16 param0) return ret; } -void sub_0200526C(u16 param0, int playerNo) -{ +void sub_0200526C(u16 param0, int playerNo) { sub_02004110(param0); sub_02004858(param0, playerNo); sub_02003CE8(1); } -u32 sub_02005288(u16 param0, u32 param1, int playerNo) -{ +u32 sub_02005288(u16 param0, u32 param1, int playerNo) { #pragma unused(param1) GF_Snd_RestoreState(sub_02004748(3)); GF_Snd_LoadSeq(param0); @@ -70,8 +64,7 @@ u32 sub_02005288(u16 param0, u32 param1, int playerNo) return NNS_SndArcPlayerStartSeq(GetSoundPlayer(playerNo), param0); } -u32 sub_020052B8(u16 param0, u32 param1, int playerNo) -{ +u32 sub_020052B8(u16 param0, u32 param1, int playerNo) { #pragma unused(param1) sub_02003D38(18); u16 *r4 = sub_02003D38(31); @@ -81,16 +74,13 @@ u32 sub_020052B8(u16 param0, u32 param1, int playerNo) return NNS_SndArcPlayerStartSeqEx(GetSoundPlayer(playerNo), -1, sub_02004900(*r4), -1, param0); } -u32 sub_02005308(u32 param0, u16 param1) -{ - if (param0 != 4) - { +u32 sub_02005308(u32 param0, u16 param1) { + if (param0 != 4) { GF_AssertFail(); return 0; } - if (sub_020048D0(param1) != 7) - { + if (sub_020048D0(param1) != 7) { GF_AssertFail(); return 0; } @@ -104,37 +94,31 @@ u32 sub_02005308(u32 param0, u16 param1) return r4; } -void sub_02005350(u16 param0, u32 param1) -{ +void sub_02005350(u16 param0, u32 param1) { NNS_SndPlayerStopSeqBySeqNo(param0, param1); u8 r0 = sub_020048D0(param0); - if (r0 != 0xff) - { + if (r0 != 0xff) { NNS_SndHandleReleaseSeq(GetSoundPlayer(sub_02004018(r0))); } sub_02005374(); } -void sub_02005374() -{ +void sub_02005374() { sub_02004110(0); sub_02004130(0); sub_02003CE8(0); } -void sub_0200538C(s32 param0, u32 param1, u32 param2) -{ +void sub_0200538C(s32 param0, u32 param1, u32 param2) { u8 r0 = sub_020048D0(sub_02004124()); - if (r0 == 0xff) - { + if (r0 == 0xff) { return; } int playerNo = sub_02004018(r0); - if (param2 == 0) - { + if (param2 == 0) { GF_SndPlayerMoveVolume(playerNo, 0, 0); } @@ -143,16 +127,13 @@ void sub_0200538C(s32 param0, u32 param1, u32 param2) sub_02003CE8(3); } -void GF_SndStartFadeOutBGM(u16 param0, u16 param1) -{ +void GF_SndStartFadeOutBGM(u16 param0, u16 param1) { u8 r6 = sub_020048D0(sub_02004124()); - if (r6 == 0xff) - { + if (r6 == 0xff) { return; } - if (GF_SndGetFadeTimer() == 0) - { + if (GF_SndGetFadeTimer() == 0) { GF_SndPlayerMoveVolume(sub_02004018(r6), param0, param1); sub_02004D74(param1); } @@ -160,71 +141,60 @@ void GF_SndStartFadeOutBGM(u16 param0, u16 param1) sub_02003CE8(4); } -u16 GF_SndGetFadeTimer() -{ +u16 GF_SndGetFadeTimer() { return *(u16 *)sub_02003D38(6); } -u16 sub_02005410(u16 param0) -{ +u16 sub_02005410(u16 param0) { return GF_SndPlayerCountPlayingSeqByPlayerNo(sub_020048D0(param0)); } -void sub_0200541C() -{ +void sub_0200541C() { u8 *r5 = sub_02003D38(15); u8 *r4 = sub_02003D38(16); NNS_SndPlayerStopSeqAll(0); - if (*r5 == 1) - { + if (*r5 == 1) { sub_02004AAC(14); } - if (*r4 == 1) - { + if (*r4 == 1) { sub_02004AAC(15); } sub_02003CE8(0); } -void sub_02005454() -{ +void sub_02005454() { u8 *r5 = sub_02003D38(15); u8 *r4 = sub_02003D38(16); NNS_SndPlayerStopSeq(GetSoundPlayer(7), 0); sub_02005374(); - for (s32 i = 0; i < 4; i++) - { + for (s32 i = 0; i < 4; i++) { sub_020054F8(i + 3, 0); } sub_02005614(0); - if (*r5 == 1) - { + if (*r5 == 1) { sub_02004AAC(14); } - if (*r4 == 1) - { + if (*r4 == 1) { sub_02004AAC(15); } } -u32 sub_020054A8(u16 param0, u32 param1) -{ +u32 sub_020054A8(u16 param0, u32 param1) { u32 r6 = PlaySE(param0); sub_02005530(param0, 0xFFFF, param1); return r6; } -u32 PlaySE(u16 param0) -{ +u32 PlaySE(u16 param0) { int playerNo = sub_02004018(sub_020048D0(param0)); u32 r6 = NNS_SndArcPlayerStartSeq(GetSoundPlayer(playerNo), param0); @@ -233,27 +203,21 @@ u32 PlaySE(u16 param0) return r6; } -void sub_020054F0(u32 param0, u32 param1) -{ +void sub_020054F0(u32 param0, u32 param1) { NNS_SndPlayerStopSeqBySeqNo(param0, param1); } -void sub_020054F8(s32 param0, u32 param1) -{ +void sub_020054F8(s32 param0, u32 param1) { NNS_SndPlayerStopSeq(GetSoundPlayer(param0), param1); } -u16 sub_02005508(u16 param0) -{ +u16 sub_02005508(u16 param0) { return GF_SndPlayerCountPlayingSeqByPlayerNo(sub_020048D0(param0)); } -BOOL sub_02005514() -{ - for (s32 i = 0; i < 4; i++) - { - if (GF_SndPlayerCountPlayingSeqByPlayerNo(i + 3) == 1) - { +BOOL sub_02005514() { + for (s32 i = 0; i < 4; i++) { + if (GF_SndPlayerCountPlayingSeqByPlayerNo(i + 3) == 1) { return TRUE; } } @@ -261,38 +225,30 @@ BOOL sub_02005514() return FALSE; } -void sub_02005530(u16 param0, u32 param1, u32 param2) -{ +void sub_02005530(u16 param0, u32 param1, u32 param2) { NNS_SndPlayerSetTrackPan(GetSoundPlayer(sub_02004018(sub_020048D0(param0))), param1, param2); } -void sub_0200554C(u32 param0) -{ +void sub_0200554C(u32 param0) { int playerNo = sub_02004018(3); - for (int i = 0; i < 4; i++) - { + for (int i = 0; i < 4; i++) { NNS_SndPlayerSetTrackPan(GetSoundPlayer(playerNo + i), 0xFFFF, param0); } } -u32 sub_02005578(u16 species) -{ - u8 *r4 = sub_02003D38(17); +u32 sub_02005578(u16 species) { + u8 *r4 = sub_02003D38(17); struct SaveChatotSoundClip **r0 = sub_02003D38(35); - if (species != SPECIES_CHATOT) - { - if (species > SPECIES_MANAPHY_EGG || species == SPECIES_NONE) - { + if (species != SPECIES_CHATOT) { + if (species > SPECIES_MANAPHY_EGG || species == SPECIES_NONE) { species = SPECIES_BULBASAUR; } } - if (species == SPECIES_CHATOT) - { - if (sub_02005D48(*r0, 0, 127, 0) == 1) - { + if (species == SPECIES_CHATOT) { + if (sub_02005D48(*r0, 0, 127, 0) == 1) { sub_02005E80(0); return 1; @@ -300,14 +256,11 @@ u32 sub_02005578(u16 species) } u32 res; - if (*r4 == 0) - { + if (*r4 == 0) { sub_02005614(0); res = NNS_SndArcPlayerStartSeqEx(GetSoundPlayer(1), -1, species, -1, 2); sub_02004858(species, 1); - } - else - { + } else { res = NNS_SndArcPlayerStartSeqEx(GetSoundPlayer(8), -1, species, -1, 2); sub_02004858(species, 8); } @@ -317,8 +270,7 @@ u32 sub_02005578(u16 species) return res; } -void sub_02005614(u32 param0) -{ +void sub_02005614(u32 param0) { u8 *r6 = sub_02003D38(15); u8 *r4 = sub_02003D38(16); sub_02003D38(14); @@ -326,14 +278,12 @@ void sub_02005614(u32 param0) NNS_SndPlayerStopSeq(GetSoundPlayer(1), param0); NNS_SndPlayerStopSeq(GetSoundPlayer(8), param0); - if (*r6 == 1) - { + if (*r6 == 1) { sub_02004C3C(14); sub_02004A04(14); } - if (*r4 == 1) - { + if (*r4 == 1) { sub_02004C3C(15); sub_02004A04(15); } @@ -341,219 +291,201 @@ void sub_02005614(u32 param0) sub_02005DFC(); } -BOOL sub_02005670() -{ +BOOL sub_02005670() { u8 *r5 = sub_02003D38(15); u8 *r4 = sub_02003D38(16); sub_02003D38(14); - if (*r5 == 1) - { + if (*r5 == 1) { return sub_02004ABC(14); } - if (*r4 == 1) - { + if (*r4 == 1) { return sub_02004ABC(15); } return GF_SndPlayerCountPlayingSeqByPlayerNo(0); } -u32 sub_020056AC(u32 param0, u16 param1, s32 param2, s32 param3, HeapID heapId) -{ +u32 sub_020056AC(u32 param0, u16 param1, s32 param2, s32 param3, HeapID heapId) { s32 st1c, st18; u8 *st14 = sub_02003D38(15); u8 *st10 = sub_02003D38(16); - u8 *r4 = sub_02003D38(17); - u8 *stc = sub_02003D38(29); + u8 *r4 = sub_02003D38(17); + u8 *stc = sub_02003D38(29); sub_02003D38(35); st1c = 64 + (param2 / 2); st18 = param3 - 30; - if (st18 <= 0) - { + if (st18 <= 0) { st18 = 1; } *r4 = 0; - if (*st14 == 1) - { + if (*st14 == 1) { sub_02004C3C(14); sub_02004A04(14); } - if (*st10 == 1) - { + if (*st10 == 1) { sub_02004C3C(15); sub_02004A04(15); } u16 species = param1; - if (species != SPECIES_CHATOT) - { - if (species > SPECIES_MANAPHY_EGG || species == SPECIES_NONE) - { + if (species != SPECIES_CHATOT) { + if (species > SPECIES_MANAPHY_EGG || species == SPECIES_NONE) { species = SPECIES_BULBASAUR; } } - if (param1 == SPECIES_CHATOT) - { - switch (param0) - { - case 0: - case 1: - case 2: - case 5: - case 11: - case 12: - sub_02005578(SPECIES_CHATOT); - if (*stc == 0) - { - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - } - else - { - sub_02004ACC(14, (u8)st1c); - sub_02004AF8(14, param3); - } - - return 1; - - default: - sub_02005E80(1); - } - } - - switch (param0) - { + if (param1 == SPECIES_CHATOT) { + switch (param0) { case 0: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - break; case 1: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - sub_02005AE0(20, heapId); - break; case 2: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, 64); - sub_02005BC8(species, 20); - GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); - sub_02005AC8(species, 8, st18); - break; - case 3: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - sub_02005AE0(30, heapId); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, 192); - sub_02005BC8(species, 16); - GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); - sub_02005AC8(species, 8, st18); - break; - case 4: - sub_02004984(14); - sub_02004B30(species, param3, st1c, 14, heapId); - sub_02004ACC(14, (u8)st1c); - sub_02005AE0(15, heapId); - sub_02004AE4(14, 34304); - sub_02005BF8(species, -64, st18, st1c, heapId); - sub_02004AE4(15, 34304); - break; case 5: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, -224); - break; - case 6: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, 44); - sub_02005BC8(species, -64); - GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); - sub_02005AC8(species, 8, st18); - break; - case 7: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - sub_02005AE0(11, heapId); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, -128); - break; - case 8: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - sub_02005AE0(60, heapId); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, 60); - break; - case 9: - sub_02004984(14); - sub_02004B30(species, param3, st1c, 14, heapId); - sub_02004ACC(14, (u8)st1c); - sub_02005AE0(13, heapId); - sub_02004AE4(14, 26624); - break; - case 10: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - sub_02005AE0(100, heapId); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, -44); - break; case 11: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, -96); - break; case 12: - sub_02005578(species); - GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); - sub_02005AC8(species, 1, param3); - sub_02005AE0(20, heapId); - GF_SndPlayerSetTrackPitch(1, 0xFFFF, -96); - break; - case 13: - sub_02005578(species); - sub_02005AC8(species, 1, 127); - sub_02005BC8(species, 20); - GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); - GF_SndPlayerMoveVolume(8, param3, 0); - break; - case 14: - sub_02005578(species); - break; + sub_02005578(SPECIES_CHATOT); + if (*stc == 0) { + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + } else { + sub_02004ACC(14, (u8)st1c); + sub_02004AF8(14, param3); + } + + return 1; + + default: + sub_02005E80(1); + } + } + + switch (param0) { + case 0: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + break; + case 1: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + sub_02005AE0(20, heapId); + break; + case 2: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, 64); + sub_02005BC8(species, 20); + GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); + sub_02005AC8(species, 8, st18); + break; + case 3: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + sub_02005AE0(30, heapId); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, 192); + sub_02005BC8(species, 16); + GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); + sub_02005AC8(species, 8, st18); + break; + case 4: + sub_02004984(14); + sub_02004B30(species, param3, st1c, 14, heapId); + sub_02004ACC(14, (u8)st1c); + sub_02005AE0(15, heapId); + sub_02004AE4(14, 34304); + sub_02005BF8(species, -64, st18, st1c, heapId); + sub_02004AE4(15, 34304); + break; + case 5: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, -224); + break; + case 6: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, 44); + sub_02005BC8(species, -64); + GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); + sub_02005AC8(species, 8, st18); + break; + case 7: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + sub_02005AE0(11, heapId); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, -128); + break; + case 8: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + sub_02005AE0(60, heapId); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, 60); + break; + case 9: + sub_02004984(14); + sub_02004B30(species, param3, st1c, 14, heapId); + sub_02004ACC(14, (u8)st1c); + sub_02005AE0(13, heapId); + sub_02004AE4(14, 26624); + break; + case 10: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + sub_02005AE0(100, heapId); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, -44); + break; + case 11: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, -96); + break; + case 12: + sub_02005578(species); + GF_SndPlayerSetTrackPan(1, 0xFFFF, param2); + sub_02005AC8(species, 1, param3); + sub_02005AE0(20, heapId); + GF_SndPlayerSetTrackPitch(1, 0xFFFF, -96); + break; + case 13: + sub_02005578(species); + sub_02005AC8(species, 1, 127); + sub_02005BC8(species, 20); + GF_SndPlayerSetTrackPan(8, 0xFFFF, param2); + GF_SndPlayerMoveVolume(8, param3, 0); + break; + case 14: + sub_02005578(species); + break; } return 1; } -void sub_02005AC8(u32 param0, int playerNo, s32 param2) -{ +void sub_02005AC8(u32 param0, int playerNo, s32 param2) { GF_SndPlayerSetInitialVolume(playerNo, param2); sub_02004858(param0, playerNo); } -void sub_02005AE0(u32 param0, HeapID heapId) -{ +void sub_02005AE0(u32 param0, HeapID heapId) { u32 *r6 = sub_02003D38(34); sub_02005BA0(); u32 *ptr = AllocFromHeap(heapId, 2 * sizeof(u32)); - if (ptr == NULL) - { + if (ptr == NULL) { GF_AssertFail(); return; } @@ -568,40 +500,34 @@ void sub_02005AE0(u32 param0, HeapID heapId) ((u8 *)ptr)[7] = 0; ptr[0] = param0; - u32 r0 = (u32)SysTask_CreateOnMainQueue((SysTaskFunc)sub_02005B2C, (void *)ptr, 0); //TODO: fix this func + u32 r0 = (u32)SysTask_CreateOnMainQueue((SysTaskFunc)sub_02005B2C, (void *)ptr, 0); // TODO: fix this func ptr[1] = r0; - *r6 = r0; + *r6 = r0; } -void sub_02005B2C(SysTask *task, s32 *param1) -{ +void sub_02005B2C(SysTask *task, s32 *param1) { #pragma unused(task) u8 *r6 = sub_02003D38(15); u8 *r4 = sub_02003D38(16); - if (*param1 == 10) - { + if (*param1 == 10) { GF_SndPlayerMoveVolume(1, 0, *param1); GF_SndPlayerMoveVolume(8, 0, *param1); } (*param1)--; - if (!sub_02005670()) - { + if (!sub_02005670()) { *param1 = 0; } - if (*param1 <= 0) - { + if (*param1 <= 0) { sub_02005614(0); - if (*r6 == 1) - { + if (*r6 == 1) { sub_02004C3C(14); sub_02004A04(14); } - if (*r4 == 1) - { + if (*r4 == 1) { sub_02004C3C(15); sub_02004A04(15); } @@ -610,11 +536,9 @@ void sub_02005B2C(SysTask *task, s32 *param1) } } -void sub_02005BA0() -{ +void sub_02005BA0() { u32 **r4 = sub_02003D38(34); - if (*r4 != NULL) - { + if (*r4 != NULL) { void *r5 = sub_0201B6C8(*r4); sub_0200CAB4((s32)(*r4)); FreeToHeap(r5); @@ -623,8 +547,7 @@ void sub_02005BA0() *r4 = 0; } -u32 sub_02005BC8(u16 param0, s32 param1) -{ +u32 sub_02005BC8(u16 param0, s32 param1) { *(u8 *)sub_02003D38(17) = 1; sub_02005E80(1); @@ -635,8 +558,7 @@ u32 sub_02005BC8(u16 param0, s32 param1) return res; } -void sub_02005BF8(u32 param0, s32 param1, s32 param2, s32 param3, HeapID heapId) -{ +void sub_02005BF8(u32 param0, s32 param1, s32 param2, s32 param3, HeapID heapId) { #pragma unused(param1) *(u8 *)sub_02003D38(17) = 1; @@ -644,14 +566,12 @@ void sub_02005BF8(u32 param0, s32 param1, s32 param2, s32 param3, HeapID heapId) sub_02004B30(param0, param2, param3, 15, heapId); } -u32 PlaySound(u16 param0) -{ +u32 PlaySound(u16 param0) { sub_020048F4(param0); sub_02005CEC(param0); u8 r0 = sub_020048D0(sub_02004124()); - if (r0 != 0xff) - { + if (r0 != 0xff) { sub_020047C8(r0, 1); } @@ -663,17 +583,14 @@ u32 PlaySound(u16 param0) return res; } -BOOL sub_02005C74() -{ +BOOL sub_02005C74() { u16 *r4 = sub_02003D38(13); - if (GF_SndPlayerCountPlayingSeqByPlayerNo(2) != 0) - { + if (GF_SndPlayerCountPlayingSeqByPlayerNo(2) != 0) { return TRUE; } - if (*r4 != 0) - { + if (*r4 != 0) { (*r4)--; return TRUE; } @@ -681,34 +598,29 @@ BOOL sub_02005C74() return FALSE; } -void sub_02005CA0(u32 param0) -{ +void sub_02005CA0(u32 param0) { NNS_SndPlayerStopSeq(GetSoundPlayer(2), param0); GF_Snd_RestoreState(sub_02004748(6)); } -BOOL sub_02005CBC() -{ +BOOL sub_02005CBC() { sub_02003D38(13); - if (sub_02005C74() == TRUE) - { + if (sub_02005C74() == TRUE) { return TRUE; } sub_02005CA0(0); u8 r0 = sub_020048D0(sub_02004124()); - if (r0 != 0xff) - { + if (r0 != 0xff) { sub_020047C8(r0, 0); } return FALSE; } -void sub_02005CEC(u16 param0) -{ +void sub_02005CEC(u16 param0) { #pragma unused(param0) *(u16 *)sub_02003D38(13) = 15; } diff --git a/arm9/src/unk_020061E8.c b/arm9/src/unk_020061E8.c index 8eb326315..195e19df1 100644 --- a/arm9/src/unk_020061E8.c +++ b/arm9/src/unk_020061E8.c @@ -1,34 +1,29 @@ +#include "unk_020061E8.h" + #include "global.h" + #include "heap.h" #include "unk_0200CA44.h" -#include "unk_020061E8.h" extern struct TextPrinter *sub_0201B6C8(void); -SysTask *sub_020061E8(SysTaskFunc func, u32 r1, u32 r2, HeapID heapId) -{ - void * r4; - if(r1 != 0) - { +SysTask *sub_020061E8(SysTaskFunc func, u32 r1, u32 r2, HeapID heapId) { + void *r4; + if (r1 != 0) { r4 = AllocFromHeap(heapId, r1); - if(r4 == 0) - { + if (r4 == 0) { return NULL; } memset(r4, 0, r1); - } - else - { + } else { r4 = NULL; } return SysTask_CreateOnMainQueue(func, r4, r2); } -void sub_0200621C(s32 r4) -{ - struct TextPrinter * r0 = sub_0201B6C8(); - if(r0 != NULL) - { +void sub_0200621C(s32 r4) { + struct TextPrinter *r0 = sub_0201B6C8(); + if (r0 != NULL) { FreeToHeap(r0); } sub_0200CAB4(r4); diff --git a/arm9/src/unk_02006D98.c b/arm9/src/unk_02006D98.c index e6495268d..9133f4e26 100644 --- a/arm9/src/unk_02006D98.c +++ b/arm9/src/unk_02006D98.c @@ -1,13 +1,15 @@ #include "unk_02006D98.h" #include "global.h" + +#include "poketool/pokegra/otherpoke.naix" + #include "MI_memory.h" #include "NNS_g2d.h" #include "filesystem.h" #include "heap.h" #include "ov63_021DB450.h" #include "palette.h" -#include "poketool/pokegra/otherpoke.naix" #include "registers.h" const struct UnkStruct_02006D98_3 UNK_020ECCE2[] = { @@ -256,25 +258,30 @@ const struct UnkStruct_02006D98_3 UNK_020ECDCC[] = { }; const int UNK_020ECBD0[4][4] = { - { 160, 160, 224, 176 }, { 160, 160, 224, 176 }, { 160, 176, 224, 192 }, { 160, 192, 224, 208 } + { 160, 160, 224, 176 }, + { 160, 160, 224, 176 }, + { 160, 176, 224, 192 }, + { 160, 192, 224, 208 } }; -const int UNK_020ECD4C[4][2][4] = { { { 0, 0, 0x50, 0x50 }, { 0x50, 0, 0xA0, 0x50 } }, +const int UNK_020ECD4C[4][2][4] = { + { { 0, 0, 0x50, 0x50 }, { 0x50, 0, 0xA0, 0x50 } }, { - { 0, 0x50, 0x50, 0xA0 }, { 0x50, 0x50, 0xA0, 0xA0 } + { 0, 0x50, 0x50, 0xA0 }, { 0x50, 0x50, 0xA0, 0xA0 } }, { - { 0, 0xA0, 0x50, 0xF0 }, { 0x50, 0xA0, 0xA0, 0xF0 } + { 0, 0xA0, 0x50, 0xF0 }, { 0x50, 0xA0, 0xA0, 0xF0 } }, { - { 0xA0, 0, 0xF0, 0x50 }, { 0xA0, 0x50, 0xF0, 0xA0 } + { 0xA0, 0, 0xF0, 0x50 }, { 0xA0, 0x50, 0xF0, 0xA0 } - } }; + } +}; const struct UnkStruct_02006D98_3 *UNK_02105AE8[] = { UNK_020ECCE2, @@ -295,15 +302,14 @@ extern void NNS_G2dDrawSpriteFast(s16 param0, int param7, int param8); -struct UnkStruct_02006D98 *sub_02006D98(HeapID heapId) -{ +struct UnkStruct_02006D98 *sub_02006D98(HeapID heapId) { struct UnkStruct_02006D98 *ptr = AllocFromHeap(heapId, sizeof(struct UnkStruct_02006D98)); - ptr->heapId = heapId; - ptr->unk2E0 = 0; - ptr->unk29C = 0; - ptr->unk2A0 = 0x8000; - ptr->unk2A4 = 0; - ptr->unk2A8 = 0x80; + ptr->heapId = heapId; + ptr->unk2E0 = 0; + ptr->unk29C = 0; + ptr->unk2A0 = 0x8000; + ptr->unk2A4 = 0; + ptr->unk2A8 = 0x80; ptr->unk2AC = AllocFromHeap(heapId, 0x8000); @@ -313,8 +319,7 @@ struct UnkStruct_02006D98 *sub_02006D98(HeapID heapId) ptr->unk2B4 = AllocFromHeap(heapId, 0xc0); MIi_CpuClearFast(0, ptr->unk2B4, 4); - for (int i = 0; i < 4; i++) - { + for (int i = 0; i < 4; i++) { MIi_CpuClearFast(0, &ptr->unk000[i], sizeof(struct UnkStruct_02006D98_2)); } @@ -327,18 +332,16 @@ struct UnkStruct_02006D98 *sub_02006D98(HeapID heapId) NNSG2dCharacterData *stc; NNS_G2dGetUnpackedCharacterData(st4, &stc); - ptr->unk2B8.pixelFmt = stc->pixelFmt; - ptr->unk2B8.mapingType = stc->mapingType; + ptr->unk2B8.pixelFmt = stc->pixelFmt; + ptr->unk2B8.mapingType = stc->mapingType; ptr->unk2B8.characterFmt = stc->characterFmt; - st8 = stc->pRawData; + st8 = stc->pRawData; sub_02008A74(st8); MI_CpuFill8(ptr->unk2AC, *st8, 0x8000); - for (int i = 0; i < 0x50; i++) - { - for (int j = 0; j < 0x28; j++) - { + for (int i = 0; i < 0x50; i++) { + for (int j = 0; j < 0x28; j++) { ((u8 *)ptr->unk2AC)[0x5050 + i * 0x80 + j] = st8[i * 0x50 + j]; } } @@ -350,8 +353,7 @@ struct UnkStruct_02006D98 *sub_02006D98(HeapID heapId) return ptr; } -void sub_02006ED4(struct UnkStruct_02006D98 *param0) -{ +void sub_02006ED4(struct UnkStruct_02006D98 *param0) { s32 arg3; s32 arg4; @@ -371,23 +373,18 @@ void sub_02006ED4(struct UnkStruct_02006D98 *param0) param0->unk260.attr.plttUse, param0->unk29C); - for (int st18 = 0; st18 < 4; st18++) - { - if (param0->unk000[st18].unk00_0 == 0 || param0->unk000[st18].unk54_0 != 0 || - param0->unk000[st18].unk54_B != 0) - { + for (int st18 = 0; st18 < 4; st18++) { + if (param0->unk000[st18].unk00_0 == 0 || param0->unk000[st18].unk54_0 != 0 || param0->unk000[st18].unk54_B != 0) { continue; } - if (param0->unk000[st18].unk68 != NULL) - { + if (param0->unk000[st18].unk68 != NULL) { param0->unk000[st18].unk68(¶m0->unk000[st18], ¶m0->unk000[st18].unk24); } NNS_G3dGeFlushBuffer(); - if (param0->unk2E3 != 1) - { + if (param0->unk2E3 != 1) { G3_Identity(); } @@ -412,10 +409,8 @@ void sub_02006ED4(struct UnkStruct_02006D98 *param0) -(fx32)(param0->unk000[st18].unk28 << 0xc)); G3_MaterialColorDiffAmb( - (GXRgb)(param0->unk000[st18].unk50_0 | (param0->unk000[st18].unk50_5 << 5) | - (param0->unk000[st18].unk50_a << 10)), - (GXRgb)(param0->unk000[st18].unk50_f | (param0->unk000[st18].unk50_14 << 5) | - (param0->unk000[st18].unk50_19 << 10)), + (GXRgb)(param0->unk000[st18].unk50_0 | (param0->unk000[st18].unk50_5 << 5) | (param0->unk000[st18].unk50_a << 10)), + (GXRgb)(param0->unk000[st18].unk50_f | (param0->unk000[st18].unk50_14 << 5) | (param0->unk000[st18].unk50_19 << 10)), TRUE); G3_MaterialColorSpecEmi(0x4210, 0, FALSE); @@ -427,18 +422,15 @@ void sub_02006ED4(struct UnkStruct_02006D98 *param0) (int)param0->unk000[st18].unk54_2, 0); - if (param0->unk000[st18].unk54_1 != 0) - { - int r6 = param0->unk000[st18].unk44 + UNK_020ECD4C[st18][param0->unk000[st18].unk5B][0]; + if (param0->unk000[st18].unk54_1 != 0) { + int r6 = param0->unk000[st18].unk44 + UNK_020ECD4C[st18][param0->unk000[st18].unk5B][0]; int r12 = param0->unk000[st18].unk46; - int r1 = param0->unk000[st18].unk45 + UNK_020ECD4C[st18][param0->unk000[st18].unk5B][1]; - int r7 = param0->unk000[st18].unk47; - int r0 = r12 + r6; - - NNS_G2dDrawSpriteFast((s16)(param0->unk000[st18].unk24 - 40 + - param0->unk000[st18].unk44 + param0->unk000[st18].unk2C), - (s16)(param0->unk000[st18].unk26 - 40 + param0->unk000[st18].unk45 + - param0->unk000[st18].unk2E - param0->unk000[st18].unk6C.unk2), + int r1 = param0->unk000[st18].unk45 + UNK_020ECD4C[st18][param0->unk000[st18].unk5B][1]; + int r7 = param0->unk000[st18].unk47; + int r0 = r12 + r6; + + NNS_G2dDrawSpriteFast((s16)(param0->unk000[st18].unk24 - 40 + param0->unk000[st18].unk44 + param0->unk000[st18].unk2C), + (s16)(param0->unk000[st18].unk26 - 40 + param0->unk000[st18].unk45 + param0->unk000[st18].unk2E - param0->unk000[st18].unk6C.unk2), (int)(param0->unk000[st18].unk28 + param0->unk000[st18].unk30), r12, r7, @@ -446,16 +438,13 @@ void sub_02006ED4(struct UnkStruct_02006D98 *param0) r1, r0, r7 + r1); - } - else - { + } else { arg3 = (param0->unk000[st18].unk34 * 80) >> 8; arg4 = (param0->unk000[st18].unk36 * 80) >> 8; NNS_G2dDrawSpriteFast( (s16)(param0->unk000[st18].unk24 - (arg3 / 2) + param0->unk000[st18].unk2C), - (s16)(param0->unk000[st18].unk26 - (arg4 / 2) + param0->unk000[st18].unk2E - - param0->unk000[st18].unk6C.unk2), + (s16)(param0->unk000[st18].unk26 - (arg4 / 2) + param0->unk000[st18].unk2E - param0->unk000[st18].unk6C.unk2), (int)(param0->unk000[st18].unk28 + param0->unk000[st18].unk30), arg3, arg4, @@ -465,43 +454,31 @@ void sub_02006ED4(struct UnkStruct_02006D98 *param0) UNK_020ECD4C[st18][param0->unk000[st18].unk5B][3]); } - if (param0->unk000[st18].unk6C.unk0_0 == 0 || param0->unk000[st18].unk6C.unk0_5 == 0 || - param0->unk000[st18].unk54_1 != 0 || (param0->unk2E4 & 1) != 0) - { + if (param0->unk000[st18].unk6C.unk0_0 == 0 || param0->unk000[st18].unk6C.unk0_5 == 0 || param0->unk000[st18].unk54_1 != 0 || (param0->unk2E4 & 1) != 0) { continue; } - if (param0->unk2E3 != 1) - { + if (param0->unk2E3 != 1) { G3_Identity(); } - G3_TexPlttBase((param0->unk2A4 + ((param0->unk000[st18].unk6C.unk0_0 + 3) << 5)), + G3_TexPlttBase(param0->unk2A4 + ((param0->unk000[st18].unk6C.unk0_0 + 3) << 5), param0->unk260.attr.fmt); - if (param0->unk000[st18].unk6C.unk0_4 != 0) - { + if (param0->unk000[st18].unk6C.unk0_4 != 0) { arg3 = (param0->unk000[st18].unk34 * 64) >> 8; arg4 = (param0->unk000[st18].unk36 * 16) >> 8; - } - else - { + } else { arg3 = 64; arg4 = 16; } - if (param0->unk000[st18].unk6C.unk0_2 != 0) - { - param0->unk000[st18].unk6C.unk4 = - (s16)(param0->unk000[st18].unk24 + param0->unk000[st18].unk2C + - param0->unk000[st18].unk6C.unk8); + if (param0->unk000[st18].unk6C.unk0_2 != 0) { + param0->unk000[st18].unk6C.unk4 = (s16)(param0->unk000[st18].unk24 + param0->unk000[st18].unk2C + param0->unk000[st18].unk6C.unk8); } - if (param0->unk000[st18].unk6C.unk0_3 != 0) - { - param0->unk000[st18].unk6C.unk6 = - (s16)(param0->unk000[st18].unk26 + param0->unk000[st18].unk2E + - param0->unk000[st18].unk6C.unka); + if (param0->unk000[st18].unk6C.unk0_3 != 0) { + param0->unk000[st18].unk6C.unk6 = (s16)(param0->unk000[st18].unk26 + param0->unk000[st18].unk2E + param0->unk000[st18].unk6C.unka); } NNS_G2dDrawSpriteFast((s16)(param0->unk000[st18].unk6C.unk4 - (arg3 / 2)), @@ -518,23 +495,19 @@ void sub_02006ED4(struct UnkStruct_02006D98 *param0) G3_PopMtx(1); } -void sub_020072E8(struct UnkStruct_02006D98 *param0) -{ +void sub_020072E8(struct UnkStruct_02006D98 *param0) { FreeToHeap(param0->unk2AC); FreeToHeap(param0->unk2B0); FreeToHeap(param0->unk2B4); FreeToHeap(param0); } -void sub_02007314(struct UnkStruct_02006D98_2 *param0) -{ +void sub_02007314(struct UnkStruct_02006D98_2 *param0) { param0->unk59 = 0; - for (s32 i = 0; i < 10; i++) - { + for (s32 i = 0; i < 10; i++) { param0->unk5C[i] = 0; } - if (param0->unk84[param0->unk59].unk0 == -1) - { + if (param0->unk84[param0->unk59].unk0 == -1) { param0->unk5B = 0; return; } @@ -545,15 +518,12 @@ void sub_02007314(struct UnkStruct_02006D98_2 *param0) } void sub_0200737C( - struct UnkStruct_02006D98_2 *param0, struct UnkStruct_02006D98_sub *param1) -{ + struct UnkStruct_02006D98_2 *param0, struct UnkStruct_02006D98_sub *param1) { MI_CpuCopy8(param1, param0->unk84, sizeof(struct UnkStruct_02006D98_sub) * 10); } -BOOL sub_02007390(struct UnkStruct_02006D98_2 *param0) -{ - if (param0->unk58 != 0) - { +BOOL sub_02007390(struct UnkStruct_02006D98_2 *param0) { + if (param0->unk58 != 0) { return TRUE; } return FALSE; @@ -566,13 +536,10 @@ struct UnkStruct_02006D98_2 *sub_020073A0(struct UnkStruct_02006D98 *param0, u32 param4, u32 param5, const void *param6, - void (*param7)(struct UnkStruct_02006D98_2 *, void *)) -{ + void (*param7)(struct UnkStruct_02006D98_2 *, void *)) { s32 i; - for (i = 0; i < 4; i++) - { - if (param0->unk000[i].unk00_0 == 0) - { + for (i = 0; i < 4; i++) { + if (param0->unk000[i].unk00_0 == 0) { break; } } @@ -589,8 +556,7 @@ struct UnkStruct_02006D98_2 *sub_020073E8(struct UnkStruct_02006D98 *param0, u32 param5, s32 param6, const void *param7, - void (*param8)(struct UnkStruct_02006D98_2 *, void *)) -{ + void (*param8)(struct UnkStruct_02006D98_2 *, void *)) { GF_ASSERT(param0->unk000[param6].unk00_0 == 0); MIi_CpuClearFast(0, ¶m0->unk000[param6], sizeof(struct UnkStruct_02006D98_2)); @@ -599,342 +565,334 @@ struct UnkStruct_02006D98_2 *sub_020073E8(struct UnkStruct_02006D98 *param0, param0->unk000[param6].unk00_8 = 1; param0->unk000[param6].unk00_1 = param5; - param0->unk000[param6].unk04 = *param1; - param0->unk000[param6].unk14 = *param1; - param0->unk000[param6].unk24 = (s16)param2; - param0->unk000[param6].unk26 = (s16)param3; - param0->unk000[param6].unk28 = param4; - param0->unk000[param6].unk34 = 0x100; - param0->unk000[param6].unk36 = 0x100; - param0->unk000[param6].unk54_2 = 0x1f; - param0->unk000[param6].unk50_0 = 0x1f; - param0->unk000[param6].unk50_5 = 0x1f; - param0->unk000[param6].unk50_a = 0x1f; - param0->unk000[param6].unk50_f = 0x10; - param0->unk000[param6].unk50_14 = 0x10; - param0->unk000[param6].unk50_19 = 0x10; - param0->unk000[param6].unk68 = param8; - param0->unk000[param6].unk6C.unk4 = (s16)param2; - param0->unk000[param6].unk6C.unk6 = (s16)param3; + param0->unk000[param6].unk04 = *param1; + param0->unk000[param6].unk14 = *param1; + param0->unk000[param6].unk24 = (s16)param2; + param0->unk000[param6].unk26 = (s16)param3; + param0->unk000[param6].unk28 = param4; + param0->unk000[param6].unk34 = 0x100; + param0->unk000[param6].unk36 = 0x100; + param0->unk000[param6].unk54_2 = 0x1f; + param0->unk000[param6].unk50_0 = 0x1f; + param0->unk000[param6].unk50_5 = 0x1f; + param0->unk000[param6].unk50_a = 0x1f; + param0->unk000[param6].unk50_f = 0x10; + param0->unk000[param6].unk50_14 = 0x10; + param0->unk000[param6].unk50_19 = 0x10; + param0->unk000[param6].unk68 = param8; + param0->unk000[param6].unk6C.unk4 = (s16)param2; + param0->unk000[param6].unk6C.unk6 = (s16)param3; param0->unk000[param6].unk6C.unk0_2 = 1; param0->unk000[param6].unk6C.unk0_3 = 1; param0->unk000[param6].unk6C.unk0_4 = 1; - if (param7 != NULL) - { + if (param7 != NULL) { MI_CpuCopy8(param7, param0->unk000[param6].unk84, 0x14); } return ¶m0->unk000[param6]; } -void sub_02007534(struct UnkStruct_02006D98_2 *param0) -{ +void sub_02007534(struct UnkStruct_02006D98_2 *param0) { param0->unk00_0 = 0; } -void sub_02007540(struct UnkStruct_02006D98 *param0) -{ - for (s32 i = 0; i < 4; i++) - { +void sub_02007540(struct UnkStruct_02006D98 *param0) { + for (s32 i = 0; i < 4; i++) { sub_02007534(¶m0->unk000[i]); } } -void sub_02007558(struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2) -{ - switch (param1) - { - case 0: - param0->unk24 = (s16)param2; - break; - case 1: - param0->unk26 = (s16)param2; - break; - case 2: - param0->unk28 = param2; - break; - case 3: - param0->unk2C = (s16)param2; - break; - case 4: - param0->unk2E = (s16)param2; - break; - case 5: - param0->unk30 = param2; - break; - case 6: - param0->unk54_0 = param2; - break; - case 7: - param0->unk38 = (u16)param2; - break; - case 8: - param0->unk3A = (u16)param2; - break; - case 9: - param0->unk3C = (u16)param2; - break; - case 10: - param0->unk40 = (s16)param2; - break; - case 11: - param0->unk42 = (s16)param2; - break; - case 12: - param0->unk34 = (s16)param2; - break; - case 13: - param0->unk36 = (s16)param2; - break; - case 14: - param0->unk54_1 = param2; - break; - case 15: - param0->unk44 = (u8)param2; - break; - case 16: - param0->unk45 = (u8)param2; - break; - case 17: - param0->unk46 = (u8)param2; - break; - case 18: - param0->unk47 = (u8)param2; - break; - case 19: - param0->unk6C.unk4 = (s16)param2; - break; - case 20: - param0->unk6C.unk6 = (s16)param2; - break; - case 21: - param0->unk6C.unk8 = (s16)param2; - break; - case 22: - param0->unk6C.unka = (s16)param2; - break; - case 23: - param0->unk54_2 = param2; - break; - case 24: - param0->unk50_0 = param2; - break; - case 25: - param0->unk50_5 = param2; - break; - case 26: - param0->unk50_a = param2; - break; - case 27: - param0->unk50_f = param2; - break; - case 28: - param0->unk50_14 = param2; - break; - case 29: - param0->unk50_19 = param2; - break; - case 30: - param0->unk54_C = param2; - param0->unk00_8 = 1; - break; - case 31: - param0->unk4C = param2; - param0->unk00_8 = 1; - break; - case 32: - param0->unk48 = (u8)param2; - param0->unk00_8 = 1; - break; - case 33: - param0->unk49 = (u8)param2; - param0->unk00_8 = 1; - break; - case 34: - param0->unk4A = (u8)param2; - break; - case 35: - param0->unk54_9 = param2; - param0->unk00_7 = 1; - break; - case 36: - param0->unk54_A = param2; - param0->unk00_7 = 1; - break; - case 37: - param0->unk54_B = param2; - break; - case 38: - param0->unk5B = (u8)param2; - break; - case 40: - param0->unk54_D = param2; - param0->unk00_7 = 1; - break; - case 41: - param0->unk6C.unk2 = (s8)param2; - break; - case 42: - param0->unk6C.unk0_0 = (u16)param2; - param0->unk00_8 = 1; - break; - case 43: - param0->unk6C.unk0_2 = (u16)param2; - break; - case 44: - param0->unk6C.unk0_3 = (u16)param2; - break; - case 45: - param0->unk6C.unk0_4 = (u16)param2; - break; - case 46: - param0->unk6C.unk0_5 = (u16)param2; - break; +void sub_02007558(struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2) { + switch (param1) { + case 0: + param0->unk24 = (s16)param2; + break; + case 1: + param0->unk26 = (s16)param2; + break; + case 2: + param0->unk28 = param2; + break; + case 3: + param0->unk2C = (s16)param2; + break; + case 4: + param0->unk2E = (s16)param2; + break; + case 5: + param0->unk30 = param2; + break; + case 6: + param0->unk54_0 = param2; + break; + case 7: + param0->unk38 = (u16)param2; + break; + case 8: + param0->unk3A = (u16)param2; + break; + case 9: + param0->unk3C = (u16)param2; + break; + case 10: + param0->unk40 = (s16)param2; + break; + case 11: + param0->unk42 = (s16)param2; + break; + case 12: + param0->unk34 = (s16)param2; + break; + case 13: + param0->unk36 = (s16)param2; + break; + case 14: + param0->unk54_1 = param2; + break; + case 15: + param0->unk44 = (u8)param2; + break; + case 16: + param0->unk45 = (u8)param2; + break; + case 17: + param0->unk46 = (u8)param2; + break; + case 18: + param0->unk47 = (u8)param2; + break; + case 19: + param0->unk6C.unk4 = (s16)param2; + break; + case 20: + param0->unk6C.unk6 = (s16)param2; + break; + case 21: + param0->unk6C.unk8 = (s16)param2; + break; + case 22: + param0->unk6C.unka = (s16)param2; + break; + case 23: + param0->unk54_2 = param2; + break; + case 24: + param0->unk50_0 = param2; + break; + case 25: + param0->unk50_5 = param2; + break; + case 26: + param0->unk50_a = param2; + break; + case 27: + param0->unk50_f = param2; + break; + case 28: + param0->unk50_14 = param2; + break; + case 29: + param0->unk50_19 = param2; + break; + case 30: + param0->unk54_C = param2; + param0->unk00_8 = 1; + break; + case 31: + param0->unk4C = param2; + param0->unk00_8 = 1; + break; + case 32: + param0->unk48 = (u8)param2; + param0->unk00_8 = 1; + break; + case 33: + param0->unk49 = (u8)param2; + param0->unk00_8 = 1; + break; + case 34: + param0->unk4A = (u8)param2; + break; + case 35: + param0->unk54_9 = param2; + param0->unk00_7 = 1; + break; + case 36: + param0->unk54_A = param2; + param0->unk00_7 = 1; + break; + case 37: + param0->unk54_B = param2; + break; + case 38: + param0->unk5B = (u8)param2; + break; + case 40: + param0->unk54_D = param2; + param0->unk00_7 = 1; + break; + case 41: + param0->unk6C.unk2 = (s8)param2; + break; + case 42: + param0->unk6C.unk0_0 = (u16)param2; + param0->unk00_8 = 1; + break; + case 43: + param0->unk6C.unk0_2 = (u16)param2; + break; + case 44: + param0->unk6C.unk0_3 = (u16)param2; + break; + case 45: + param0->unk6C.unk0_4 = (u16)param2; + break; + case 46: + param0->unk6C.unk0_5 = (u16)param2; + break; } } -u32 sub_0200782C(struct UnkStruct_02006D98_2 *param0, u32 param1) -{ - switch (param1) - { - case 0: - return param0->unk24; +u32 sub_0200782C(struct UnkStruct_02006D98_2 *param0, u32 param1) { + switch (param1) { + case 0: + return param0->unk24; - case 1: - return param0->unk26; + case 1: + return param0->unk26; - case 2: - return param0->unk28; + case 2: + return param0->unk28; - case 3: - return param0->unk2C; + case 3: + return param0->unk2C; - case 4: - return param0->unk2E; + case 4: + return param0->unk2E; - case 5: - return param0->unk30; + case 5: + return param0->unk30; - case 6: - return param0->unk54_0; + case 6: + return param0->unk54_0; - case 7: - return param0->unk38; + case 7: + return param0->unk38; - case 8: - return param0->unk3A; + case 8: + return param0->unk3A; - case 9: - return param0->unk3C; + case 9: + return param0->unk3C; - case 10: - return param0->unk40; + case 10: + return param0->unk40; - case 11: - return param0->unk42; + case 11: + return param0->unk42; - case 12: - return param0->unk34; + case 12: + return param0->unk34; - case 13: - return param0->unk36; + case 13: + return param0->unk36; - case 14: - return param0->unk54_1; + case 14: + return param0->unk54_1; - case 15: - return param0->unk44; + case 15: + return param0->unk44; - case 16: - return param0->unk45; + case 16: + return param0->unk45; - case 17: - return param0->unk46; + case 17: + return param0->unk46; - case 18: - return param0->unk47; + case 18: + return param0->unk47; - case 19: - return param0->unk6C.unk4; + case 19: + return param0->unk6C.unk4; - case 20: - return param0->unk6C.unk6; + case 20: + return param0->unk6C.unk6; - case 21: - return param0->unk6C.unk8; + case 21: + return param0->unk6C.unk8; - case 22: - return param0->unk6C.unka; + case 22: + return param0->unk6C.unka; - case 23: - return param0->unk54_2; + case 23: + return param0->unk54_2; - case 24: - return param0->unk50_0; + case 24: + return param0->unk50_0; - case 25: - return param0->unk50_5; + case 25: + return param0->unk50_5; - case 26: - return param0->unk50_a; + case 26: + return param0->unk50_a; - case 27: - return param0->unk50_f; + case 27: + return param0->unk50_f; - case 28: - return param0->unk50_14; + case 28: + return param0->unk50_14; - case 29: - return param0->unk50_19; + case 29: + return param0->unk50_19; - case 30: - return param0->unk54_C; + case 30: + return param0->unk54_C; - case 31: - return param0->unk4C; + case 31: + return param0->unk4C; - case 32: - return param0->unk48; + case 32: + return param0->unk48; - case 33: - return param0->unk49; + case 33: + return param0->unk49; - case 34: - return param0->unk4A; + case 34: + return param0->unk4A; - case 35: - return param0->unk54_9; + case 35: + return param0->unk54_9; - case 36: - return param0->unk54_A; + case 36: + return param0->unk54_A; - case 37: - return param0->unk54_B; + case 37: + return param0->unk54_B; - case 38: - return param0->unk5B; + case 38: + return param0->unk5B; - case 40: - return param0->unk54_D; + case 40: + return param0->unk54_D; - case 41: - return param0->unk6C.unk2; + case 41: + return param0->unk6C.unk2; - case 42: - return param0->unk6C.unk0_0; + case 42: + return param0->unk6C.unk0_0; - case 43: - return param0->unk6C.unk0_2; + case 43: + return param0->unk6C.unk0_2; - case 44: - return param0->unk6C.unk0_3; + case 44: + return param0->unk6C.unk0_3; - case 45: - return param0->unk6C.unk0_4; + case 45: + return param0->unk6C.unk0_4; - case 46: - return param0->unk6C.unk0_5; + case 46: + return param0->unk6C.unk0_5; } GF_AssertFail(); @@ -942,217 +900,207 @@ u32 sub_0200782C(struct UnkStruct_02006D98_2 *param0, u32 param1) return 0; } -void sub_020079E0(struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2) -{ - switch (param1) - { - case 0: - param0->unk24 += param2; - break; - case 1: - param0->unk26 += param2; - break; - case 2: - param0->unk28 += param2; - break; - case 3: - param0->unk2C += param2; - break; - case 4: - param0->unk2E += param2; - break; - case 5: - param0->unk30 += param2; - break; - case 6: - param0->unk54_0 += param2; - break; - case 7: - param0->unk38 += param2; - break; - case 8: - param0->unk3A += param2; - break; - case 9: - param0->unk3C += param2; - break; - case 10: - param0->unk40 += param2; - break; - case 11: - param0->unk42 += param2; - break; - case 12: - param0->unk34 += param2; - break; - case 13: - param0->unk36 += param2; - break; - case 14: - param0->unk54_1 += param2; - break; - case 15: - param0->unk44 += param2; - break; - case 16: - param0->unk45 += param2; - break; - case 17: - param0->unk46 += param2; - break; - case 18: - param0->unk47 += param2; - break; - case 19: - param0->unk6C.unk4 += param2; - break; - case 20: - param0->unk6C.unk6 += param2; - break; - case 21: - param0->unk6C.unk8 += param2; - break; - case 22: - param0->unk6C.unka += param2; - break; - case 23: - param0->unk54_2 += param2; - break; - case 24: - param0->unk50_0 += param2; - break; - case 25: - param0->unk50_5 += param2; - break; - case 26: - param0->unk50_a += param2; - break; - case 27: - param0->unk50_f += param2; - break; - case 28: - param0->unk50_14 += param2; - break; - case 29: - param0->unk50_19 += param2; - break; - case 30: - param0->unk54_C += param2; - param0->unk00_8 = 1; - break; - case 31: - param0->unk4C += param2; - param0->unk00_8 = 1; - break; - case 32: - param0->unk48 += param2; - param0->unk00_8 = 1; - break; - case 33: - param0->unk49 += param2; - param0->unk00_8 = 1; - break; - case 34: - param0->unk4A += param2; - break; - case 35: - param0->unk54_9 += param2; - param0->unk00_7 = 1; - break; - case 36: - param0->unk54_A += param2; - param0->unk00_7 = 1; - break; - case 37: - param0->unk54_B += param2; - break; - case 38: - param0->unk5B += param2; - break; - case 40: - param0->unk54_D += param2; - param0->unk00_7 = 1; - break; - case 41: - param0->unk6C.unk2 += param2; - break; - case 42: - param0->unk6C.unk0_0 += param2; - param0->unk00_8 = 1; - break; - case 43: - param0->unk6C.unk0_2 += param2; - break; - case 44: - param0->unk6C.unk0_3 += param2; - break; - case 45: - param0->unk6C.unk0_4 += param2; - break; - case 46: - param0->unk6C.unk0_5 += param2; - break; +void sub_020079E0(struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2) { + switch (param1) { + case 0: + param0->unk24 += param2; + break; + case 1: + param0->unk26 += param2; + break; + case 2: + param0->unk28 += param2; + break; + case 3: + param0->unk2C += param2; + break; + case 4: + param0->unk2E += param2; + break; + case 5: + param0->unk30 += param2; + break; + case 6: + param0->unk54_0 += param2; + break; + case 7: + param0->unk38 += param2; + break; + case 8: + param0->unk3A += param2; + break; + case 9: + param0->unk3C += param2; + break; + case 10: + param0->unk40 += param2; + break; + case 11: + param0->unk42 += param2; + break; + case 12: + param0->unk34 += param2; + break; + case 13: + param0->unk36 += param2; + break; + case 14: + param0->unk54_1 += param2; + break; + case 15: + param0->unk44 += param2; + break; + case 16: + param0->unk45 += param2; + break; + case 17: + param0->unk46 += param2; + break; + case 18: + param0->unk47 += param2; + break; + case 19: + param0->unk6C.unk4 += param2; + break; + case 20: + param0->unk6C.unk6 += param2; + break; + case 21: + param0->unk6C.unk8 += param2; + break; + case 22: + param0->unk6C.unka += param2; + break; + case 23: + param0->unk54_2 += param2; + break; + case 24: + param0->unk50_0 += param2; + break; + case 25: + param0->unk50_5 += param2; + break; + case 26: + param0->unk50_a += param2; + break; + case 27: + param0->unk50_f += param2; + break; + case 28: + param0->unk50_14 += param2; + break; + case 29: + param0->unk50_19 += param2; + break; + case 30: + param0->unk54_C += param2; + param0->unk00_8 = 1; + break; + case 31: + param0->unk4C += param2; + param0->unk00_8 = 1; + break; + case 32: + param0->unk48 += param2; + param0->unk00_8 = 1; + break; + case 33: + param0->unk49 += param2; + param0->unk00_8 = 1; + break; + case 34: + param0->unk4A += param2; + break; + case 35: + param0->unk54_9 += param2; + param0->unk00_7 = 1; + break; + case 36: + param0->unk54_A += param2; + param0->unk00_7 = 1; + break; + case 37: + param0->unk54_B += param2; + break; + case 38: + param0->unk5B += param2; + break; + case 40: + param0->unk54_D += param2; + param0->unk00_7 = 1; + break; + case 41: + param0->unk6C.unk2 += param2; + break; + case 42: + param0->unk6C.unk0_0 += param2; + param0->unk00_8 = 1; + break; + case 43: + param0->unk6C.unk0_2 += param2; + break; + case 44: + param0->unk6C.unk0_3 += param2; + break; + case 45: + param0->unk6C.unk0_4 += param2; + break; + case 46: + param0->unk6C.unk0_5 += param2; + break; } } void sub_02007E40( - struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2, u32 param3, u32 param4) -{ + struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2, u32 param3, u32 param4) { param0->unk54_1 = 1; - param0->unk44 = (u8)param1; - param0->unk45 = (u8)param2; - param0->unk46 = (u8)param3; - param0->unk47 = (u8)param4; + param0->unk44 = (u8)param1; + param0->unk45 = (u8)param2; + param0->unk46 = (u8)param3; + param0->unk47 = (u8)param4; } void sub_02007E68( - struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2, u32 param3, u32 param4) -{ + struct UnkStruct_02006D98_2 *param0, u32 param1, u32 param2, u32 param3, u32 param4) { param0->unk54_C = 1; - param0->unk48 = (u8)param1; - param0->unk49 = (u8)param2; - param0->unk4A = 0; - param0->unk4B = (u8)param3; - param0->unk4C = param4; + param0->unk48 = (u8)param1; + param0->unk49 = (u8)param2; + param0->unk4A = 0; + param0->unk4B = (u8)param3; + param0->unk4C = param4; } void sub_02007E98( - struct UnkStruct_02006D98 *param0, u32 param1, u32 param2, u32 param3, u32 param4) -{ - for (s32 i = 0; i < 4; i++) - { - if (param0->unk000[i].unk00_0 == 0) - { + struct UnkStruct_02006D98 *param0, u32 param1, u32 param2, u32 param3, u32 param4) { + for (s32 i = 0; i < 4; i++) { + if (param0->unk000[i].unk00_0 == 0) { continue; } param0->unk000[i].unk54_C = 1; - param0->unk000[i].unk48 = (u8)param1; - param0->unk000[i].unk49 = (u8)param2; - param0->unk000[i].unk4A = 0; - param0->unk000[i].unk4B = (u8)param3; - param0->unk000[i].unk4C = param4; + param0->unk000[i].unk48 = (u8)param1; + param0->unk000[i].unk49 = (u8)param2; + param0->unk000[i].unk4A = 0; + param0->unk000[i].unk4B = (u8)param3; + param0->unk000[i].unk4C = param4; } } -void sub_02007EEC(struct UnkStruct_02006D98_2 *param0) -{ +void sub_02007EEC(struct UnkStruct_02006D98_2 *param0) { param0->unk54_C = 0; - param0->unk48 = 0; - param0->unk49 = 0; - param0->unk4A = 0; - param0->unk4B = 0; - param0->unk4C = 0; + param0->unk48 = 0; + param0->unk49 = 0; + param0->unk4A = 0; + param0->unk4B = 0; + param0->unk4C = 0; param0->unk00_8 = 1; } -BOOL sub_02007F20(struct UnkStruct_02006D98_2 *param0) -{ +BOOL sub_02007F20(struct UnkStruct_02006D98_2 *param0) { return param0->unk54_C == 1; } -void sub_02007F34(struct UnkStruct_02006D98_2 *param0, s32 param1) -{ +void sub_02007F34(struct UnkStruct_02006D98_2 *param0, s32 param1) { param0->unk2E = (s16)((40 - param1) - (((40 - param1) * param0->unk36) >> 8)); } @@ -1161,34 +1109,26 @@ static inline void inlineLoop(u8 *unk58, u8 *unk5A, u8 *unk5B, u8 *unk5C, - const struct UnkStruct_02006D98_sub *unk84) -{ - if (*unk58 == 0) - { + const struct UnkStruct_02006D98_sub *unk84) { + if (*unk58 == 0) { return; } - if (*unk5A == 0) - { + if (*unk5A == 0) { (*unk59)++; - while (unk84[*unk59].unk0 < -1) - { + while (unk84[*unk59].unk0 < -1) { unk5C[*unk59]++; - if (unk84[*unk59].unk1 == unk5C[*unk59] || unk84[*unk59].unk1 == 0) - { + if (unk84[*unk59].unk1 == unk5C[*unk59] || unk84[*unk59].unk1 == 0) { unk5C[*unk59] = 0; unk59++; - } - else - { + } else { *unk59 = (u8)(-2 - unk84[*unk59].unk0); } } - if (unk84[*unk59].unk0 == -1 || *unk59 >= 10) - { + if (unk84[*unk59].unk0 == -1 || *unk59 >= 10) { *unk5B = 0; *unk58 = 0; @@ -1197,15 +1137,12 @@ static inline void inlineLoop(u8 *unk58, *unk5B = (u8)unk84[*unk59].unk0; *unk5A = unk84[*unk59].unk1; - } - else - { + } else { (*unk5A)--; } } -void sub_02007F48(struct UnkStruct_02006D98_2 *param0) -{ +void sub_02007F48(struct UnkStruct_02006D98_2 *param0) { inlineLoop(¶m0->unk58, ¶m0->unk59, ¶m0->unk5A, @@ -1215,24 +1152,20 @@ void sub_02007F48(struct UnkStruct_02006D98_2 *param0) } void sub_02008010( - struct UnkStruct_02006D98_5 *param0, struct UnkStruct_02006D98_sub *param1) -{ + struct UnkStruct_02006D98_5 *param0, struct UnkStruct_02006D98_sub *param1) { param0->unk00 = 1; param0->unk02 = 0; param0->unk01 = (u8)param1->unk0; param0->unk03 = param1->unk1; param0->unk10 = param1; - for (s32 i = 0; i < 10; i++) - { + for (s32 i = 0; i < 10; i++) { param0->unk04[i] = 0; } } -s32 sub_02008030(struct UnkStruct_02006D98_5 *param0) -{ - if (param0->unk00 != 0) - { +s32 sub_02008030(struct UnkStruct_02006D98_5 *param0) { + if (param0->unk00 != 0) { inlineLoop(¶m0->unk00, ¶m0->unk02, ¶m0->unk03, @@ -1245,65 +1178,56 @@ s32 sub_02008030(struct UnkStruct_02006D98_5 *param0) return -1; } -void sub_020080D0(struct UnkStruct_02006D98_2 *param0) -{ +void sub_020080D0(struct UnkStruct_02006D98_2 *param0) { param0->unk00_7 = 1; param0->unk00_8 = 1; } -void sub_020080E0(struct UnkStruct_02006D98_2 *param0) -{ +void sub_020080E0(struct UnkStruct_02006D98_2 *param0) { param0->unk14 = param0->unk04; param0->unk78 = param0->unk6C; } -void sub_0200813C(struct UnkStruct_02006D98_2 *param0) -{ - param0->unk04 = param0->unk14; - param0->unk6C = param0->unk78; +void sub_0200813C(struct UnkStruct_02006D98_2 *param0) { + param0->unk04 = param0->unk14; + param0->unk6C = param0->unk78; param0->unk00_7 = 1; param0->unk00_8 = 1; } -void sub_020081A8(struct UnkStruct_02006D98 *param0, u32 param1, u32 param2) -{ +void sub_020081A8(struct UnkStruct_02006D98 *param0, u32 param1, u32 param2) { param0->unk29C = param1; param0->unk2A0 = param2; } -void sub_020081B4(struct UnkStruct_02006D98 *param0, u32 param1, u32 param2) -{ +void sub_020081B4(struct UnkStruct_02006D98 *param0, u32 param1, u32 param2) { param0->unk2A4 = param1; param0->unk2A8 = param2; } -u32 sub_020081C0(u32 param0) -{ +u32 sub_020081C0(u32 param0) { return param0 + 4; } -void sub_020081C4(struct UnkStruct_02006D98 *param0) -{ - if (param0->unk2E1 != 0) - { +void sub_020081C4(struct UnkStruct_02006D98 *param0) { + if (param0->unk2E1 != 0) { param0->unk2E1 = 0; NNS_G2dInitImageProxy(¶m0->unk260); - param0->unk2B8.H = 0x20; - param0->unk2B8.W = 0x20; - param0->unk2B8.szByte = param0->unk2A0; + param0->unk2B8.H = 0x20; + param0->unk2B8.W = 0x20; + param0->unk2B8.szByte = param0->unk2A0; param0->unk2B8.pRawData = param0->unk2AC; NNS_G2dLoadImage2DMapping( ¶m0->unk2B8, param0->unk29C, NNS_G2D_VRAM_TYPE_3DMAIN, ¶m0->unk260); } - if (param0->unk2E2 != 0) - { + if (param0->unk2E2 != 0) { param0->unk2E2 = 0; NNS_G2dInitImagePaletteProxy(¶m0->unk284); - param0->unk2D0.szByte = param0->unk2A8; + param0->unk2D0.szByte = param0->unk2A8; param0->unk2D0.pRawData = param0->unk2B0; NNS_G2dLoadPalette( @@ -1311,29 +1235,24 @@ void sub_020081C4(struct UnkStruct_02006D98 *param0) } } -void sub_0200825C(struct UnkStruct_02006D98 *param0, u8 param1) -{ +void sub_0200825C(struct UnkStruct_02006D98 *param0, u8 param1) { param0->unk2E3 = param1; } -BOOL sub_02008268(struct UnkStruct_02006D98_2 *param0) -{ +BOOL sub_02008268(struct UnkStruct_02006D98_2 *param0) { GF_ASSERT(param0); return param0->unk00_0 != 0; } -void sub_02008284(struct UnkStruct_02006D98 *param0, u32 param1) -{ +void sub_02008284(struct UnkStruct_02006D98 *param0, u32 param1) { param0->unk2E4 |= param1; } -void sub_02008290(struct UnkStruct_02006D98 *param0, u32 param1) -{ +void sub_02008290(struct UnkStruct_02006D98 *param0, u32 param1) { param0->unk2E4 &= (param1 ^ ~0); } -void sub_020082A8(struct UnkStruct_02006D98 *param0) -{ +void sub_020082A8(struct UnkStruct_02006D98 *param0) { NNSG2dCharacterData *st58; int st54; int r4; @@ -1342,179 +1261,93 @@ void sub_020082A8(struct UnkStruct_02006D98 *param0) void *st4c; u8 st48 = 0; - for (st54 = 0; st54 < 4; st54++) - { - if (param0->unk000[st54].unk00_0 != 0 && param0->unk000[st54].unk00_7 != 0) - { + for (st54 = 0; st54 < 4; st54++) { + if (param0->unk000[st54].unk00_0 != 0 && param0->unk000[st54].unk00_7 != 0) { param0->unk000[st54].unk00_7 = 0; - st48 = 1; - st4c = AllocAndReadWholeNarcMemberByIdPair((NarcId)param0->unk000[st54].unk04.field_00, + st48 = 1; + st4c = AllocAndReadWholeNarcMemberByIdPair((NarcId)param0->unk000[st54].unk04.field_00, param0->unk000[st54].unk04.field_02, param0->heapId); NNS_G2dGetUnpackedCharacterData(st4c, &st58); - param0->unk2B8.pixelFmt = st58->pixelFmt; - param0->unk2B8.mapingType = st58->mapingType; + param0->unk2B8.pixelFmt = st58->pixelFmt; + param0->unk2B8.mapingType = st58->mapingType; param0->unk2B8.characterFmt = st58->characterFmt; st50 = st58->pRawData; sub_02008A74(st50); sub_020088EC(¶m0->unk000[st54], st50); - if (st54 == 3) - { - for (st14 = 0; st14 < 0x50; st14++) - { - for (r4 = 0; r4 < 0x50; r4++) - { - if (r4 < 0x28) - { - if (param0->unk000[st54].unk54_9 != 0 && - param0->unk000[st54].unk54_A != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x50] = - sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x27 - r4)]); - } - else if (param0->unk000[st54].unk54_9 != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x50] = - sub_020088D8(st50[st14 * 0x50 + (0x27 - r4)]); - } - else if (param0->unk000[st54].unk54_A != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x50] = - st50[(0x4f - st14) * 0x50 + r4]; - } - else if (param0->unk000[st54].unk54_D != 0) - { - if (st14 % (param0->unk000[st54].unk54_D * 2) != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x50] = - param0->unk2AC[(st14 - 1) * 0x80 + r4 + 0x50]; + if (st54 == 3) { + for (st14 = 0; st14 < 0x50; st14++) { + for (r4 = 0; r4 < 0x50; r4++) { + if (r4 < 0x28) { + if (param0->unk000[st54].unk54_9 != 0 && param0->unk000[st54].unk54_A != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x50] = sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x27 - r4)]); + } else if (param0->unk000[st54].unk54_9 != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x50] = sub_020088D8(st50[st14 * 0x50 + (0x27 - r4)]); + } else if (param0->unk000[st54].unk54_A != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x50] = st50[(0x4f - st14) * 0x50 + r4]; + } else if (param0->unk000[st54].unk54_D != 0) { + if (st14 % (param0->unk000[st54].unk54_D * 2) != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x50] = param0->unk2AC[(st14 - 1) * 0x80 + r4 + 0x50]; + } else if (r4 % param0->unk000[st54].unk54_D != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x50] = param0->unk2AC[st14 * 0x80 + r4 + 0x4f]; + } else { + param0->unk2AC[st14 * 0x80 + r4 + 0x50] = (u8)((st50[st14 * 0x50 + r4] & 0xf) | ((st50[st14 * 0x50 + r4] & 0xf) << 4)); } - else if (r4 % param0->unk000[st54].unk54_D != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x50] = - param0->unk2AC[st14 * 0x80 + r4 + 0x4f]; - } - else - { - param0->unk2AC[st14 * 0x80 + r4 + 0x50] = - (u8)((st50[st14 * 0x50 + r4] & 0xf) | - ((st50[st14 * 0x50 + r4] & 0xf) << 4)); - } - } - else - { + } else { param0->unk2AC[st14 * 0x80 + r4 + 0x50] = st50[st14 * 0x50 + r4]; } - } - else - { + } else { //_02008442 - if (param0->unk000[st54].unk54_9 != 0 && - param0->unk000[st54].unk54_A != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = - sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x4f - (r4 - 0x28))]); - } - else if (param0->unk000[st54].unk54_9 != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = - sub_020088D8(st50[st14 * 0x50 + (0x4f - (r4 - 0x28))]); - } - else if (param0->unk000[st54].unk54_A != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = - st50[(0x4f - st14) * 0x50 + r4]; - } - else if (param0->unk000[st54].unk54_D != 0) - { - if (st14 % (param0->unk000[st54].unk54_D * 2) != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = - param0->unk2AC[(st14 - 1) * 0x80 + r4 + 0x2828]; - } - else if (r4 % param0->unk000[st54].unk54_D != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = - param0->unk2AC[st14 * 0x80 + (r4 - 1) + 0x2828]; + if (param0->unk000[st54].unk54_9 != 0 && param0->unk000[st54].unk54_A != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x4f - (r4 - 0x28))]); + } else if (param0->unk000[st54].unk54_9 != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = sub_020088D8(st50[st14 * 0x50 + (0x4f - (r4 - 0x28))]); + } else if (param0->unk000[st54].unk54_A != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = st50[(0x4f - st14) * 0x50 + r4]; + } else if (param0->unk000[st54].unk54_D != 0) { + if (st14 % (param0->unk000[st54].unk54_D * 2) != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = param0->unk2AC[(st14 - 1) * 0x80 + r4 + 0x2828]; + } else if (r4 % param0->unk000[st54].unk54_D != 0) { + param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = param0->unk2AC[st14 * 0x80 + (r4 - 1) + 0x2828]; + } else { + param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = (u8)((st50[st14 * 0x50 + r4] & 0xf) | ((st50[st14 * 0x50 + r4] & 0xf) << 4)); } - else - { - param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = - (u8)((st50[st14 * 0x50 + r4] & 0xf) | - ((st50[st14 * 0x50 + r4] & 0xf) << 4)); - } - } - else - { + } else { param0->unk2AC[st14 * 0x80 + r4 + 0x2828] = st50[st14 * 0x50 + r4]; } } } } - } - else - { + } else { //_02008554 - for (st14 = 0; st14 < 0x50; st14++) - { - for (r4 = 0; r4 < 0x50; r4++) - { - if (param0->unk000[st54].unk54_9 != 0 && param0->unk000[st54].unk54_A != 0) - { - if (r4 < 0x28) - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x27 - r4)]); - } - else - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x4f - (r4 - 0x28))]); - } - } - else if (param0->unk000[st54].unk54_9 != 0) - { - if (r4 < 0x28) - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - sub_020088D8(st50[st14 * 0x50 + (0x27 - r4)]); - } - else - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - sub_020088D8(st50[st14 * 0x50 + (0x4f - (r4 - 0x28))]); + for (st14 = 0; st14 < 0x50; st14++) { + for (r4 = 0; r4 < 0x50; r4++) { + if (param0->unk000[st54].unk54_9 != 0 && param0->unk000[st54].unk54_A != 0) { + if (r4 < 0x28) { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x27 - r4)]); + } else { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = sub_020088D8(st50[(0x4f - st14) * 0x50 + (0x4f - (r4 - 0x28))]); } - } - else if (param0->unk000[st54].unk54_A != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - st50[(0x4f - st14) * 0x50 + r4]; - } - else if (param0->unk000[st54].unk54_D != 0) - { - if (st14 % (param0->unk000[st54].unk54_D * 2) != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - param0->unk2AC[(st14 - 1) * 0x80 + r4 + st54 * 0x2800]; - } - else if (r4 % (param0->unk000[st54].unk54_D) != 0) - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - param0->unk2AC[st14 * 0x80 + (r4 - 1) + st54 * 0x2800]; + } else if (param0->unk000[st54].unk54_9 != 0) { + if (r4 < 0x28) { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = sub_020088D8(st50[st14 * 0x50 + (0x27 - r4)]); + } else { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = sub_020088D8(st50[st14 * 0x50 + (0x4f - (r4 - 0x28))]); } - else - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - (u8)((st50[st14 * 0x50 + r4] & 0xf) | - ((st50[st14 * 0x50 + r4] & 0xf) << 4)); + } else if (param0->unk000[st54].unk54_A != 0) { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = st50[(0x4f - st14) * 0x50 + r4]; + } else if (param0->unk000[st54].unk54_D != 0) { + if (st14 % (param0->unk000[st54].unk54_D * 2) != 0) { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = param0->unk2AC[(st14 - 1) * 0x80 + r4 + st54 * 0x2800]; + } else if (r4 % (param0->unk000[st54].unk54_D) != 0) { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = param0->unk2AC[st14 * 0x80 + (r4 - 1) + st54 * 0x2800]; + } else { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = (u8)((st50[st14 * 0x50 + r4] & 0xf) | ((st50[st14 * 0x50 + r4] & 0xf) << 4)); } - } - else - { - param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = - st50[st14 * 0x50 + r4]; + } else { + param0->unk2AC[st14 * 0x80 + r4 + st54 * 0x2800] = st50[st14 * 0x50 + r4]; } } } @@ -1528,41 +1361,35 @@ void sub_020082A8(struct UnkStruct_02006D98 *param0) param0->unk2E1 = st48; } -void sub_020086F4(struct UnkStruct_02006D98 *param0) -{ +void sub_020086F4(struct UnkStruct_02006D98 *param0) { NNSG2dPaletteData *st18; int st14, r7; u16 *r1; void *st10; u8 stc = 0; - for (st14 = 0; st14 < 4; st14++) - { - if (param0->unk000[st14].unk00_0 != 0 && param0->unk000[st14].unk00_8 != 0) - { + for (st14 = 0; st14 < 4; st14++) { + if (param0->unk000[st14].unk00_0 != 0 && param0->unk000[st14].unk00_8 != 0) { param0->unk000[st14].unk00_8 = 0; - stc = 1; - st10 = AllocAndReadWholeNarcMemberByIdPair((NarcId)param0->unk000[st14].unk04.field_00, + stc = 1; + st10 = AllocAndReadWholeNarcMemberByIdPair((NarcId)param0->unk000[st14].unk04.field_00, param0->unk000[st14].unk04.field_04, param0->heapId); NNS_G2dGetUnpackedPaletteData(st10, &st18); param0->unk2D0.fmt = st18->fmt; - r1 = st18->pRawData; - for (r7 = 0; r7 < 0x10; r7++) - { + r1 = st18->pRawData; + for (r7 = 0; r7 < 0x10; r7++) { param0->unk2B0[st14 * 0x10 + r7] = r1[r7]; param0->unk2B4[st14 * 0x10 + r7] = r1[r7]; } FreeToHeap(st10); - if (param0->unk000[st14].unk6C.unk0_0 != 0) - { + if (param0->unk000[st14].unk6C.unk0_0 != 0) { st10 = AllocAndReadWholeNarcMemberByIdPair( NARC_POKETOOL_POKEGRA_OTHERPOKE, NARC_otherpoke_narc_0212_NCLR, param0->heapId); NNS_G2dGetUnpackedPaletteData(st10, &st18); r1 = st18->pRawData; - for (r7 = 0; r7 < 0x10; r7++) - { + for (r7 = 0; r7 < 0x10; r7++) { param0->unk2B0[(param0->unk000[st14].unk6C.unk0_0 + 3) * 0x10 + r7] = r1[r7]; param0->unk2B4[(param0->unk000[st14].unk6C.unk0_0 + 3) * 0x10 + r7] = r1[r7]; } @@ -1571,11 +1398,9 @@ void sub_020086F4(struct UnkStruct_02006D98 *param0) } //_020087E0 - if (param0->unk000[st14].unk00_0 != 0 && param0->unk000[st14].unk54_C != 0) - { - if (param0->unk000[st14].unk4A == 0) - { - stc = 1; + if (param0->unk000[st14].unk00_0 != 0 && param0->unk000[st14].unk54_C != 0) { + if (param0->unk000[st14].unk4A == 0) { + stc = 1; param0->unk000[st14].unk4A = param0->unk000[st14].unk4B; BlendPalette(param0->unk2B4 + st14 * 0x10, param0->unk2B0 + st14 * 0x10, @@ -1583,8 +1408,7 @@ void sub_020086F4(struct UnkStruct_02006D98 *param0) param0->unk000[st14].unk48, (u16)param0->unk000[st14].unk4C); - if (param0->unk000[st14].unk6C.unk0_0 != 0) - { + if (param0->unk000[st14].unk6C.unk0_0 != 0) { BlendPalette(param0->unk2B4 + (param0->unk000[st14].unk6C.unk0_0 + 3) * 0x10, param0->unk2B0 + (param0->unk000[st14].unk6C.unk0_0 + 3) * 0x10, 0x10, @@ -1592,21 +1416,14 @@ void sub_020086F4(struct UnkStruct_02006D98 *param0) (u16)param0->unk000[st14].unk4C); } - if (param0->unk000[st14].unk48 == param0->unk000[st14].unk49) - { + if (param0->unk000[st14].unk48 == param0->unk000[st14].unk49) { param0->unk000[st14].unk54_C = 0; - } - else if (param0->unk000[st14].unk48 > param0->unk000[st14].unk49) - { + } else if (param0->unk000[st14].unk48 > param0->unk000[st14].unk49) { param0->unk000[st14].unk48--; - } - else - { + } else { param0->unk000[st14].unk48++; } - } - else - { + } else { param0->unk000[st14].unk4A--; } } @@ -1615,21 +1432,17 @@ void sub_020086F4(struct UnkStruct_02006D98 *param0) param0->unk2E2 = stc; } -u8 sub_020088D8(u8 param0) -{ +u8 sub_020088D8(u8 param0) { return (u8)(((u8)((param0 & 0xf0) >> 4)) | ((u8)(param0 << 4))); } -void sub_020088EC(struct UnkStruct_02006D98_2 *param0, u8 *param1) -{ - if (param0->unk04.field_06 != 0) - { +void sub_020088EC(struct UnkStruct_02006D98_2 *param0, u8 *param1) { + if (param0->unk04.field_06 != 0) { sub_02008904(param1, param0->unk04.field_0C, 1); } } -void sub_02008904(u8 *param0, u32 param1, u32 param2) -{ +void sub_02008904(u8 *param0, u32 param1, u32 param2) { const struct UnkStruct_02006D98_3 *st10; s32 i; u32 r2; @@ -1638,26 +1451,19 @@ void sub_02008904(u8 *param0, u32 param1, u32 param2) u8 r1; u32 st0 = param1; - for (i = 0; i < 4; i++) - { + for (i = 0; i < 4; i++) { st10 = UNK_02105AE8[i]; - r1 = 0; - while (st10[r1].unk0 != 0xff) - { + r1 = 0; + while (st10[r1].unk0 != 0xff) { r0 = (u8)(st10[r1].unk0 + ((param1 & 0xf) - 8)); r4 = (u8)(st10[r1].unk1 + (((param1 & 0xf0) >> 4) - 8)); r2 = (u32)(r0 / 2 + r4 * 0x50); - if ((r0 & 1) != 0) - { - if ((param0[r2] & 0xf0) >= 0x10 && (param0[r2] & 0xf0) <= 0x30) - { + if ((r0 & 1) != 0) { + if ((param0[r2] & 0xf0) >= 0x10 && (param0[r2] & 0xf0) <= 0x30) { param0[r2] += 0x50; } - } - else - { - if ((param0[r2] & 0xf) >= 1 && (param0[r2] & 0xf) <= 3) - { + } else { + if ((param0[r2] & 0xf) >= 1 && (param0[r2] & 0xf) <= 3) { param0[r2] += 5; } } @@ -1669,28 +1475,20 @@ void sub_02008904(u8 *param0, u32 param1, u32 param2) param1 = st0; - if (param2 != 0) - { - for (i = 0; i < 4; i++) - { + if (param2 != 0) { + for (i = 0; i < 4; i++) { st10 = UNK_02105AE8[i]; - r1 = 0; - while (st10[r1].unk0 != 0xff) - { + r1 = 0; + while (st10[r1].unk0 != 0xff) { r0 = (u8)(st10[r1].unk0 - 14 + ((param1 & 0xf) - 8) + 0x50); r4 = (u8)(st10[r1].unk1 + (((param1 & 0xf0) >> 4) - 8)); r2 = (u32)(r0 / 2 + r4 * 0x50); - if ((r0 & 1) != 0) - { - if ((param0[r2] & 0xf0) >= 0x10 && (param0[r2] & 0xf0) <= 0x30) - { + if ((r0 & 1) != 0) { + if ((param0[r2] & 0xf0) >= 0x10 && (param0[r2] & 0xf0) <= 0x30) { param0[r2] += 0x50; } - } - else - { - if ((param0[r2] & 0xf) >= 1 && (param0[r2] & 0xf) <= 3) - { + } else { + if ((param0[r2] & 0xf) >= 1 && (param0[r2] & 0xf) <= 3) { param0[r2] += 5; } } @@ -1701,18 +1499,15 @@ void sub_02008904(u8 *param0, u32 param1, u32 param2) } } -u16 sub_02008A54(u32 *param0) -{ +u16 sub_02008A54(u32 *param0) { *param0 = (*param0) * 0x41C64E6D + 0x6073; return (u16)(*param0 >> 16); } -void sub_02008A74(u8 *param0) -{ +void sub_02008A74(u8 *param0) { u32 st0 = ((u16 *)param0)[0xc7f]; - for (s32 r4 = 0xc7f; r4 > -1; r4--) - { + for (s32 r4 = 0xc7f; r4 > -1; r4--) { ((u16 *)param0)[r4] ^= st0; sub_02008A54(&st0); } diff --git a/arm9/src/unk_02008AA4.c b/arm9/src/unk_02008AA4.c index cc840df0a..e5e117c91 100644 --- a/arm9/src/unk_02008AA4.c +++ b/arm9/src/unk_02008AA4.c @@ -1,10 +1,12 @@ -#include "global.h" #include "unk_02008AA4.h" + +#include "global.h" + #include "GX_vramcnt.h" #include "heap.h" -#include "unk_0200BB14.h" -#include "unk_02008DEC.h" #include "oam.h" +#include "unk_02008DEC.h" +#include "unk_0200BB14.h" extern void sub_0202134C(void *, u32); extern u32 sub_0201FCB0(u32 *); @@ -26,14 +28,13 @@ void sub_02008AA4(struct UnkStruct_0200BB14_sub *param0, struct UnkStruct_02008DEC_1 *param11, struct UnkStruct_02008DEC_1 *param12, struct UnkStruct_02008DEC_1 *param13, - struct UnkStruct_02008DEC_1 *param14) -{ + struct UnkStruct_02008DEC_1 *param14) { struct UnkStruct_02008DEC_sub *r7; struct UnkStruct_02008DEC_sub *st14; struct UnkStruct_02008DEC_sub *st10; struct UnkStruct_02008DEC_sub *stc = NULL; - struct UnkStruct_02008DEC_sub *r4 = NULL; + struct UnkStruct_02008DEC_sub *r4 = NULL; struct UnkStruct_02008DEC_sub *st8 = NULL; GF_ASSERT(param9); @@ -51,35 +52,28 @@ void sub_02008AA4(struct UnkStruct_0200BB14_sub *param0, st10 = sub_020094F0(param11, param3); GF_ASSERT(st10); - if (param12 != 0 && param4 != -1) - { + if (param12 != 0 && param4 != -1) { stc = sub_020094F0(param12, param4); GF_ASSERT(stc); } - if (param13 != 0) - { - if (param5 != -1) - { + if (param13 != 0) { + if (param5 != -1) { r4 = sub_020094F0(param13, param5); } - if (param6 != -1) - { + if (param6 != -1) { st8 = sub_020094F0(param14, param6); } } u32 r6; - if (param7 != 0) - { + if (param7 != 0) { r6 = sub_02009C80(r7, st10); GF_ASSERT(r6); param0->unk04 = sub_02009544(r7); - } - else - { + } else { r6 = sub_02009C5C(r7); GF_ASSERT(r6); @@ -90,22 +84,16 @@ void sub_02008AA4(struct UnkStruct_0200BB14_sub *param0, param0->unk00 = r6; param0->unk0C = sub_02009574(st10); - if (stc != 0) - { + if (stc != 0) { param0->unk10 = sub_0200958C(stc); - } - else - { + } else { param0->unk10 = 0; } - if (r4 != 0) - { + if (r4 != 0) { param0->unk14 = sub_020095A4(r4); param0->unk18 = sub_020095BC(st8); - } - else - { + } else { param0->unk14 = 0; param0->unk18 = 0; } @@ -121,21 +109,18 @@ struct UnkStruct_02008AA4_1 *sub_02008BE0(struct UnkStruct_02008AA4_2 *param0, struct UnkStruct_02008DEC_1 *param4, struct UnkStruct_02008DEC_1 *param5, struct UnkStruct_02008DEC_1 *param6, - struct UnkStruct_02008DEC_1 *param7) -{ + struct UnkStruct_02008DEC_1 *param7) { s32 r4 = 0; - while (param0[r4].unk00 != -2) - { + while (param0[r4].unk00 != -2) { r4++; } struct UnkStruct_02008AA4_1 *r6 = AllocFromHeap(heapId, sizeof(struct UnkStruct_02008AA4_1)); - r6->unk00 = AllocFromHeap(heapId, r4 * sizeof(struct UnkStruct_0200BB14_sub)); - r6->unk04 = r4; + r6->unk00 = AllocFromHeap(heapId, r4 * sizeof(struct UnkStruct_0200BB14_sub)); + r6->unk04 = r4; - for (int r7 = 0; r7 < r6->unk04; r7++) - { + for (int r7 = 0; r7 < r6->unk04; r7++) { sub_02008AA4(&r6->unk00[r7], param0[r7].unk00, param0[r7].unk04, @@ -156,19 +141,16 @@ struct UnkStruct_02008AA4_1 *sub_02008BE0(struct UnkStruct_02008AA4_2 *param0, return r6; } -void sub_02008C80(struct UnkStruct_02008AA4_1 *param0) -{ +void sub_02008C80(struct UnkStruct_02008AA4_1 *param0) { GF_ASSERT(param0); - if (param0->unk00 != NULL) - { + if (param0->unk00 != NULL) { FreeToHeap(param0->unk00); } FreeToHeap(param0); } -u32 sub_02008C9C(u32 param0, void *param1, u32 param2) -{ +u32 sub_02008C9C(u32 param0, void *param1, u32 param2) { sub_0202134C(param1, 0xFFFFF000); u32 st10[3]; @@ -194,8 +176,7 @@ u32 sub_02008C9C(u32 param0, void *param1, u32 param2) return sub_0201FCB0(st10); } -void sub_02008D04(u32 param0, u32 param1, u32 param2) -{ +void sub_02008D04(u32 param0, u32 param1, u32 param2) { u32 st0[4]; st0[0] = param1; st0[2] = 0xFF000; @@ -204,8 +185,7 @@ void sub_02008D04(u32 param0, u32 param1, u32 param2) sub_02021390(param0 + 0x98, st0); } -void sub_02008D24(u32 param0, u32 param1, u32 param2) -{ +void sub_02008D24(u32 param0, u32 param1, u32 param2) { u32 st0[4]; st0[0] = param1; st0[2] = 0xFF000; @@ -214,36 +194,31 @@ void sub_02008D24(u32 param0, u32 param1, u32 param2) sub_02021390(param0 + 0xe0, st0); } -void sub_02008D44(u32 param0, u32 param1) -{ - switch (param1) - { - case 0x10: - if (GX_GetBankForOBJ() == 0x40 || GX_GetBankForOBJ() == 0x20) - { - sub_0201D194(0x3E00, 0x200, param0); - return; - } - - sub_0201D194(0x7E00, 0x200, param0); - return; - case 0x00100010: - sub_0201D194(0xfe00, 0x200, param0); +void sub_02008D44(u32 param0, u32 param1) { + switch (param1) { + case 0x10: + if (GX_GetBankForOBJ() == 0x40 || GX_GetBankForOBJ() == 0x20) { + sub_0201D194(0x3E00, 0x200, param0); return; - case 0x00200010: - if (GX_GetBankForOBJ() == 0x30 || GX_GetBankForOBJ() == 0x50) - { - sub_0201D194(0x13E00, 0x200, param0); - return; - } - sub_0201D194(0x1FE00, 0x200, param0); + } + + sub_0201D194(0x7E00, 0x200, param0); + return; + case 0x00100010: + sub_0201D194(0xfe00, 0x200, param0); + return; + case 0x00200010: + if (GX_GetBankForOBJ() == 0x30 || GX_GetBankForOBJ() == 0x50) { + sub_0201D194(0x13E00, 0x200, param0); return; + } + sub_0201D194(0x1FE00, 0x200, param0); + return; } GF_AssertFail(); } -void sub_02008DDC(u32 param0) -{ +void sub_02008DDC(u32 param0) { sub_0201E068(0xC000, param0); } diff --git a/arm9/src/unk_02008DEC.c b/arm9/src/unk_02008DEC.c index b0403d683..a58db0d59 100644 --- a/arm9/src/unk_02008DEC.c +++ b/arm9/src/unk_02008DEC.c @@ -1,5 +1,7 @@ -#include "global.h" #include "unk_02008DEC.h" + +#include "global.h" + #include "NNS_g2d.h" #include "gf_gfx_loader.h" #include "heap.h" @@ -31,11 +33,10 @@ extern u32 sub_0201E258(s32, u32); extern u32 sub_0201E230(s32); extern s32 NNS_G2dGetImagePaletteLocation(u32, u32); -struct UnkStruct_02008DEC_1 *sub_02008DEC(u32 param0, s32 param1, HeapID heapId) -{ +struct UnkStruct_02008DEC_1 *sub_02008DEC(u32 param0, s32 param1, HeapID heapId) { struct UnkStruct_02008DEC_1 *ptr = AllocFromHeap(heapId, sizeof(struct UnkStruct_02008DEC_1)); - ptr->unk00 = sub_02020C44(param0, heapId); - ptr->unk04 = AllocFromHeap(heapId, param0 * sizeof(struct UnkStruct_02008DEC_sub)); + ptr->unk00 = sub_02020C44(param0, heapId); + ptr->unk04 = AllocFromHeap(heapId, param0 * sizeof(struct UnkStruct_02008DEC_sub)); memset(ptr->unk04, 0, param0 * sizeof(struct UnkStruct_02008DEC_sub)); ptr->unk08 = (s32)param0; ptr->unk0C = 0; @@ -44,8 +45,7 @@ struct UnkStruct_02008DEC_1 *sub_02008DEC(u32 param0, s32 param1, HeapID heapId) return ptr; } -void sub_02008E2C(struct UnkStruct_02008DEC_1 *param0) -{ +void sub_02008E2C(struct UnkStruct_02008DEC_1 *param0) { GF_ASSERT(param0); GF_ASSERT(param0->unk00); GF_ASSERT(param0->unk04); @@ -62,8 +62,7 @@ void sub_02008E2C(struct UnkStruct_02008DEC_1 *param0) } struct UnkStruct_02008DEC_sub *sub_02008E6C( - struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_2 *param1, s32 param2, HeapID heapId) -{ + struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_2 *param1, s32 param2, HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param1); GF_ASSERT(param1->unk04 > param2); @@ -72,16 +71,13 @@ struct UnkStruct_02008DEC_sub *sub_02008E6C( struct UnkStruct_02008DEC_sub *st1c = sub_020097D0(param0); GF_ASSERT(st1c); - if (param1->unk0C == 0) - { + if (param1->unk0C == 0) { struct UnkStruct_02008DEC_3 *r6 = ¶m1->unk00_3[param2]; GF_ASSERT(sub_0200945C(param0, r6->unk00) == 1); sub_0200994C( param0, st1c, r6->unk04, r6->unk00, r6->unk44, r6->unk48, param1->unk08, heapId); - } - else - { + } else { struct UnkStruct_02008DEC_4 *r6 = ¶m1->unk00_4[param2]; GF_ASSERT(sub_0200945C(param0, r6->unk0C) == 1); @@ -109,8 +105,7 @@ struct UnkStruct_02008DEC_sub *sub_02008F34(struct UnkStruct_02008DEC_1 *param0, BOOL param3, s32 param4, u32 param5, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 0); @@ -130,8 +125,7 @@ struct UnkStruct_02008DEC_sub *sub_02008F90(struct UnkStruct_02008DEC_1 *param0, s32 param4, u32 param5, HeapID heapId, - BOOL param7) -{ + BOOL param7) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 0); @@ -151,8 +145,7 @@ struct UnkStruct_02008DEC_sub *sub_02008FEC(struct UnkStruct_02008DEC_1 *param0, s32 param4, u32 param5, u32 param6, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 1); @@ -173,8 +166,7 @@ struct UnkStruct_02008DEC_sub *sub_0200904C(struct UnkStruct_02008DEC_1 *param0, u32 param5, u32 param6, HeapID heapId, - BOOL param8) -{ + BOOL param8) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 1); @@ -193,8 +185,7 @@ struct UnkStruct_02008DEC_sub *sub_020090AC(struct UnkStruct_02008DEC_1 *param0, BOOL param3, s32 param4, u32 param5, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); struct UnkStruct_02008DEC_sub *r6 = sub_020097D0(param0); @@ -211,8 +202,7 @@ void sub_020090FC(struct UnkStruct_02008DEC_1 *param0, NarcId param2, s32 param3, BOOL param4, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 0); GF_ASSERT(param1); @@ -230,15 +220,14 @@ void sub_02009168(struct UnkStruct_02008DEC_1 *param0, NarcId param2, s32 param3, BOOL param4, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 1); GF_ASSERT(param1); GF_ASSERT(param1->unk04 == 1); - s32 r6 = sub_02009530(param1); - u32 r7 = sub_020095E4(param1); + s32 r6 = sub_02009530(param1); + u32 r7 = sub_020095E4(param1); u32 st24 = sub_02009610(param1); sub_02009490(param0, param1); @@ -251,8 +240,7 @@ struct UnkStruct_02008DEC_sub *sub_020091E0(struct UnkStruct_02008DEC_1 *param0, u32 param3, s32 param4, u32 param5, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 0); @@ -272,8 +260,7 @@ struct UnkStruct_02008DEC_sub *sub_0200923C(struct UnkStruct_02008DEC_1 *param0, s32 param4, u32 param5, HeapID heapId, - u32 param7) -{ + u32 param7) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 0); @@ -293,8 +280,7 @@ struct UnkStruct_02008DEC_sub *sub_02009298(struct UnkStruct_02008DEC_1 *param0, s32 param4, u32 param5, u32 param6, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 1); @@ -315,8 +301,7 @@ struct UnkStruct_02008DEC_sub *sub_020092F8(struct UnkStruct_02008DEC_1 *param0, u32 param5, u32 param6, HeapID heapId, - u32 param8) -{ + u32 param8) { GF_ASSERT(param0); GF_ASSERT(param0->unk10 == 1); @@ -335,8 +320,7 @@ struct UnkStruct_02008DEC_sub *sub_02009358(struct UnkStruct_02008DEC_1 *param0, u32 param3, s32 param4, u32 param5, - HeapID heapId) -{ + HeapID heapId) { GF_ASSERT(param0); struct UnkStruct_02008DEC_sub *r6 = sub_020097D0(param0); @@ -349,8 +333,7 @@ struct UnkStruct_02008DEC_sub *sub_02009358(struct UnkStruct_02008DEC_1 *param0, } s32 sub_020093A8( - struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_2 *param1, struct UnkStruct_02008DEC_5 *param2, HeapID heapId) -{ + struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_2 *param1, struct UnkStruct_02008DEC_5 *param2, HeapID heapId) { GF_ASSERT(param0); GF_ASSERT(param1); @@ -364,52 +347,44 @@ void sub_020093DC(struct UnkStruct_02008DEC_1 *param0, s32 param2, s32 param3, struct UnkStruct_02008DEC_5 *param4, - HeapID heapId) -{ - for (int r5 = param2; r5 < param2 + param3; r5++) - { + HeapID heapId) { + for (int r5 = param2; r5 < param2 + param3; r5++) { struct UnkStruct_02008DEC_sub *r0 = sub_02008E6C(param0, param1, r5, heapId); - if (param4 != NULL && param4->unk04 > param4->unk08) - { + if (param4 != NULL && param4->unk04 > param4->unk08) { param4->unk00[param4->unk08] = r0; param4->unk08++; } } } -struct UnkStruct_02008DEC_5 *sub_02009424(s32 param0, HeapID heapId) -{ +struct UnkStruct_02008DEC_5 *sub_02009424(s32 param0, HeapID heapId) { struct UnkStruct_02008DEC_5 *r4 = AllocFromHeap(heapId, sizeof(struct UnkStruct_02008DEC_5)); - r4->unk00 = AllocFromHeap(heapId, param0 * sizeof(struct UnkStruct_02008DEC_sub *)); - r4->unk04 = param0; - r4->unk08 = 0; + r4->unk00 = AllocFromHeap(heapId, param0 * sizeof(struct UnkStruct_02008DEC_sub *)); + r4->unk04 = param0; + r4->unk08 = 0; return r4; } -void sub_02009448(struct UnkStruct_02008DEC_5 *param0) -{ +void sub_02009448(struct UnkStruct_02008DEC_5 *param0) { FreeToHeap(param0->unk00); FreeToHeap(param0); } -u32 sub_0200945C(struct UnkStruct_02008DEC_1 *param0, s32 param1) -{ +u32 sub_0200945C(struct UnkStruct_02008DEC_1 *param0, s32 param1) { GF_ASSERT(param0); return sub_02020CB0(param0->unk00, param1); } -void sub_02009474(struct UnkStruct_02008DEC_sub *param0) -{ +void sub_02009474(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); sub_02009920(param0); sub_02020E1C(param0->unk00, 0); } -void sub_02009490(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_sub *param1) -{ +void sub_02009490(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_sub *param1) { GF_ASSERT(param0); GF_ASSERT(param0->unk04); @@ -419,28 +394,21 @@ void sub_02009490(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC param0->unk0C--; } -void sub_020094C4(struct UnkStruct_02008DEC_1 *param0) -{ - for (int i = 0; i < param0->unk08; i++) - { - if (param0->unk04[i].unk00 != 0) - { +void sub_020094C4(struct UnkStruct_02008DEC_1 *param0) { + for (int i = 0; i < param0->unk08; i++) { + if (param0->unk04[i].unk00 != 0) { sub_02009490(param0, ¶m0->unk04[i]); } } } -struct UnkStruct_02008DEC_sub *sub_020094F0(struct UnkStruct_02008DEC_1 *param0, s32 param1) -{ +struct UnkStruct_02008DEC_sub *sub_020094F0(struct UnkStruct_02008DEC_1 *param0, s32 param1) { GF_ASSERT(param0); - for (int i = 0; i < param0->unk08; i++) - { - if (param0->unk04[i].unk00 != 0) - { + for (int i = 0; i < param0->unk08; i++) { + if (param0->unk04[i].unk00 != 0) { s32 r0 = sub_02020E38(param0->unk04[i].unk00); - if (r0 == param1) - { + if (r0 == param1) { return ¶m0->unk04[i]; } } @@ -449,109 +417,90 @@ struct UnkStruct_02008DEC_sub *sub_020094F0(struct UnkStruct_02008DEC_1 *param0, return NULL; } -s32 sub_02009530(struct UnkStruct_02008DEC_sub *param0) -{ +s32 sub_02009530(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); return sub_02020E38(param0->unk00); } -u32 sub_02009544(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009544(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0->unk04 == 0); return *sub_02009934(param0); } -u32 sub_0200955C(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_0200955C(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0->unk04 == 1); return *sub_02009934(param0); } -u32 sub_02009574(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009574(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0->unk04 == 2); return *sub_02009934(param0); } -u32 sub_0200958C(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_0200958C(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0->unk04 == 3); return *sub_02009934(param0); } -u32 sub_020095A4(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_020095A4(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0->unk04 == 4); return *sub_02009934(param0); } -u32 sub_020095BC(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_020095BC(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0->unk04 == 5); return *sub_02009934(param0); } -u32 sub_020095D4(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_020095D4(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); return param0->unk04; } -u32 sub_020095E4(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_020095E4(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); - if (param0->unk04 == 0) - { + if (param0->unk04 == 0) { return sub_02009934(param0)[1]; } - if (param0->unk04 == 1) - { + if (param0->unk04 == 1) { return sub_02009934(param0)[1]; } return 0; } -u32 sub_02009610(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009610(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); - if (param0->unk04 == 1) - { + if (param0->unk04 == 1) { return sub_02009934(param0)[2]; } return 0; } -void sub_02009630(struct UnkStruct_02008DEC_sub *param0, u32 param1) -{ +void sub_02009630(struct UnkStruct_02008DEC_sub *param0, u32 param1) { GF_ASSERT(param0); - if (param0->unk04 == 0) - { + if (param0->unk04 == 0) { sub_02009934(param0)[1] = param1; } - if (param0->unk04 == 1) - { + if (param0->unk04 == 1) { sub_02009934(param0)[1] = param1; } } -u32 sub_0200965C(void) -{ +u32 sub_0200965C(void) { return 16; } -struct UnkStruct_02008DEC_2 *sub_02009660(struct UnkStruct_02008DEC_2 *param0, s32 param1) -{ +struct UnkStruct_02008DEC_2 *sub_02009660(struct UnkStruct_02008DEC_2 *param0, s32 param1) { return ¶m0[param1]; } -void sub_02009668(u32 *param0, struct UnkStruct_02008DEC_2 *param1, HeapID heapId) -{ +void sub_02009668(u32 *param0, struct UnkStruct_02008DEC_2 *param1, HeapID heapId) { GF_ASSERT(param1); param1->unk08 = param0[0]; @@ -559,59 +508,48 @@ void sub_02009668(u32 *param0, struct UnkStruct_02008DEC_2 *param1, HeapID heapI param1->unk04 = sub_020099E8((struct UnkStruct_02008DEC_4 *)(param0 + 1)); - if (param1->unk04 > 0) - { + if (param1->unk04 > 0) { param1->unk00_4 = AllocFromHeap(heapId, param1->unk04 * sizeof(struct UnkStruct_02008DEC_4)); - } - else - { + } else { param1->unk00_4 = NULL; } - if (param1->unk00_4 != NULL) - { + if (param1->unk00_4 != NULL) { memcpy(param1->unk00_4, param0 + 1, param1->unk04 * sizeof(struct UnkStruct_02008DEC_4)); } } -void sub_020096B4(struct UnkStruct_02008DEC_2 *param0) -{ - if (param0->unk00_4) - { +void sub_020096B4(struct UnkStruct_02008DEC_2 *param0) { + if (param0->unk00_4) { FreeToHeap(param0->unk00_4); } param0->unk00_4 = NULL; - param0->unk04 = 0; + param0->unk04 = 0; } -s32 sub_020096CC(struct UnkStruct_02008DEC_2 *param0) -{ +s32 sub_020096CC(struct UnkStruct_02008DEC_2 *param0) { GF_ASSERT(param0); return param0->unk04; } -s32 sub_020096DC(struct UnkStruct_02008DEC_2 *param0, s32 param1) -{ +s32 sub_020096DC(struct UnkStruct_02008DEC_2 *param0, s32 param1) { GF_ASSERT(param0); GF_ASSERT(param0->unk04 > param1); - if (param0->unk0C == 0) - { + if (param0->unk0C == 0) { return param0->unk00_3[param1].unk00; } return param0->unk00_4[param1].unk0C; } -s32 sub_02009710(struct UnkStruct_02008DEC_2 *param0, s32 param1) -{ +s32 sub_02009710(struct UnkStruct_02008DEC_2 *param0, s32 param1) { GF_ASSERT(param0); GF_ASSERT(param0->unk04 > param1); s32 r6; - if (param0->unk0C == 1) - { + if (param0->unk0C == 1) { r6 = param0->unk00_4[param1].unk04; } @@ -619,14 +557,12 @@ s32 sub_02009710(struct UnkStruct_02008DEC_2 *param0, s32 param1) return r6; } -BOOL sub_0200973C(struct UnkStruct_02008DEC_2 *param0, s32 param1) -{ +BOOL sub_0200973C(struct UnkStruct_02008DEC_2 *param0, s32 param1) { GF_ASSERT(param0); GF_ASSERT(param0->unk04 > param1); BOOL r6; - if (param0->unk0C == 1) - { + if (param0->unk0C == 1) { r6 = param0->unk00_4[param1].unk08; } @@ -634,38 +570,31 @@ BOOL sub_0200973C(struct UnkStruct_02008DEC_2 *param0, s32 param1) return r6; } -u32 sub_02009768(struct UnkStruct_02008DEC_2 *param0, s32 param1) -{ +u32 sub_02009768(struct UnkStruct_02008DEC_2 *param0, s32 param1) { GF_ASSERT(param0); GF_ASSERT(param0->unk04 > param1); - if (param0->unk0C == 0) - { + if (param0->unk0C == 0) { return param0->unk00_3[param1].unk44; } return param0->unk00_4[param1].unk10; } -u32 sub_0200979C(struct UnkStruct_02008DEC_2 *param0, s32 param1) -{ +u32 sub_0200979C(struct UnkStruct_02008DEC_2 *param0, s32 param1) { GF_ASSERT(param0); GF_ASSERT(param0->unk04 > param1); - if (param0->unk0C == 0) - { + if (param0->unk0C == 0) { return param0->unk00_3[param1].unk48; } return param0->unk00_4[param1].unk14; } -struct UnkStruct_02008DEC_sub *sub_020097D0(struct UnkStruct_02008DEC_1 *param0) -{ - for (int i = 0; i < param0->unk08; i++) - { - if (param0->unk04[i].unk00 == 0) - { +struct UnkStruct_02008DEC_sub *sub_020097D0(struct UnkStruct_02008DEC_1 *param0) { + for (int i = 0; i < param0->unk08; i++) { + if (param0->unk04[i].unk00 == 0) { return ¶m0->unk04[i]; } } @@ -674,37 +603,33 @@ struct UnkStruct_02008DEC_sub *sub_020097D0(struct UnkStruct_02008DEC_1 *param0) } void sub_020097FC( - struct UnkStruct_02008DEC_sub *param0, u32 param1, u32 param2, u32 param3, HeapID heapId) -{ + struct UnkStruct_02008DEC_sub *param0, u32 param1, u32 param2, u32 param3, HeapID heapId) { void *r0 = sub_02020E0C(param0->unk00); - switch (param1) - { - case 0: - param0->unk08 = sub_0200986C(r0, param2, heapId); - break; - case 1: - param0->unk08 = sub_0200988C(r0, param2, param3, heapId); - break; - case 2: - param0->unk08 = sub_020098B0(r0, heapId); - break; - case 3: - param0->unk08 = sub_020098CC(r0, heapId); - break; - case 4: - param0->unk08 = sub_020098E8(r0, heapId); - break; - case 5: - param0->unk08 = sub_02009904(r0, heapId); - break; - } -} - -struct CharacterData_02008DEC *sub_0200986C(void *param0, u32 param1, HeapID heapId) -{ - struct CharacterData_02008DEC *ptr = - AllocFromHeap(heapId, sizeof(struct CharacterData_02008DEC)); + switch (param1) { + case 0: + param0->unk08 = sub_0200986C(r0, param2, heapId); + break; + case 1: + param0->unk08 = sub_0200988C(r0, param2, param3, heapId); + break; + case 2: + param0->unk08 = sub_020098B0(r0, heapId); + break; + case 3: + param0->unk08 = sub_020098CC(r0, heapId); + break; + case 4: + param0->unk08 = sub_020098E8(r0, heapId); + break; + case 5: + param0->unk08 = sub_02009904(r0, heapId); + break; + } +} + +struct CharacterData_02008DEC *sub_0200986C(void *param0, u32 param1, HeapID heapId) { + struct CharacterData_02008DEC *ptr = AllocFromHeap(heapId, sizeof(struct CharacterData_02008DEC)); NNS_G2dGetUnpackedCharacterData(param0, &ptr->chData); ptr->unk04 = param1; @@ -713,8 +638,7 @@ struct CharacterData_02008DEC *sub_0200986C(void *param0, u32 param1, HeapID hea } struct PaletteData_02008DEC *sub_0200988C( - void *param0, u32 param1, u32 param2, HeapID heapId) -{ + void *param0, u32 param1, u32 param2, HeapID heapId) { struct PaletteData_02008DEC *ptr = AllocFromHeap(heapId, sizeof(struct PaletteData_02008DEC)); NNS_G2dGetUnpackedPaletteData(param0, &ptr->plttData); @@ -724,8 +648,7 @@ struct PaletteData_02008DEC *sub_0200988C( return ptr; } -struct CellDataBank_02008DEC *sub_020098B0(void *param0, HeapID heapId) -{ +struct CellDataBank_02008DEC *sub_020098B0(void *param0, HeapID heapId) { struct CellDataBank_02008DEC *ptr = AllocFromHeap(heapId, sizeof(struct CellDataBank_02008DEC)); NNS_G2dGetUnpackedCellBank(param0, &ptr->cellBank); @@ -733,8 +656,7 @@ struct CellDataBank_02008DEC *sub_020098B0(void *param0, HeapID heapId) return ptr; } -struct AnimBank_02008DEC *sub_020098CC(void *param0, HeapID heapId) -{ +struct AnimBank_02008DEC *sub_020098CC(void *param0, HeapID heapId) { struct AnimBank_02008DEC *ptr = AllocFromHeap(heapId, sizeof(struct AnimBank_02008DEC)); NNS_G2dGetUnpackedAnimBank(param0, &ptr->bankData); @@ -742,8 +664,7 @@ struct AnimBank_02008DEC *sub_020098CC(void *param0, HeapID heapId) return ptr; } -void *sub_020098E8(void *param0, HeapID heapId) -{ +void *sub_020098E8(void *param0, HeapID heapId) { void *ptr = AllocFromHeap(heapId, 4); NNS_G2dGetUnpackedMultiCellBank(param0, ptr); @@ -751,8 +672,7 @@ void *sub_020098E8(void *param0, HeapID heapId) return ptr; } -void *sub_02009904(void *param0, HeapID heapId) -{ +void *sub_02009904(void *param0, HeapID heapId) { void *ptr = AllocFromHeap(heapId, 4); NNS_G2dGetUnpackedMCAnimBank(param0, ptr); @@ -760,18 +680,15 @@ void *sub_02009904(void *param0, HeapID heapId) return ptr; } -void sub_02009920(struct UnkStruct_02008DEC_sub *param0) -{ - if (param0->unk08 != NULL) - { +void sub_02009920(struct UnkStruct_02008DEC_sub *param0) { + if (param0->unk08 != NULL) { FreeToHeap(param0->unk08); } param0->unk08 = NULL; } -u32 *sub_02009934(struct UnkStruct_02008DEC_sub *param0) -{ +u32 *sub_02009934(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(param0->unk08); @@ -785,8 +702,7 @@ void sub_0200994C(struct UnkStruct_02008DEC_1 *param0, u32 param4, u32 param5, u32 param6, - HeapID heapId) -{ + HeapID heapId) { param1->unk00 = sub_02020D10(param0->unk00, param2, param3, heapId); param1->unk04 = param6; sub_020097FC(param1, param6, param4, param5, heapId); @@ -802,9 +718,8 @@ void sub_02009978(struct UnkStruct_02008DEC_1 *param0, u32 param7, u32 param8, HeapID heapId, - BOOL param10) -{ - void *r1 = GfGfxLoader_LoadFromNarc(param2, param3, param4, heapId, param10); + BOOL param10) { + void *r1 = GfGfxLoader_LoadFromNarc(param2, param3, param4, heapId, param10); param1->unk00 = sub_02020CD4(param0->unk00, r1, param5); param1->unk04 = param8; @@ -821,44 +736,34 @@ void sub_020099B0(struct UnkStruct_02008DEC_1 *param0, u32 param7, u32 param8, HeapID heapId, - u32 param10) -{ - param1->unk00 = - sub_02020CD4(param0->unk00, sub_02009A04(param2, param3, param4, heapId, param10), param5); + u32 param10) { + param1->unk00 = sub_02020CD4(param0->unk00, sub_02009A04(param2, param3, param4, heapId, param10), param5); param1->unk04 = param8; sub_020097FC(param1, param8, param6, param7, heapId); } -s32 sub_020099E8(struct UnkStruct_02008DEC_4 *param0) -{ +s32 sub_020099E8(struct UnkStruct_02008DEC_4 *param0) { s32 r3 = 0; - while (param0[r3].unk00 != -2) - { + while (param0[r3].unk00 != -2) { r3++; } return r3; } -void *sub_02009A04(NARC *param0, u32 param1, u32 param2, HeapID heapId, u32 param4) -{ +void *sub_02009A04(NARC *param0, u32 param1, u32 param2, HeapID heapId, u32 param4) { void *r4 = NARC_AllocAndReadWholeMember(param0, param1, heapId); - if (r4 != NULL && param2 != 0) - { + if (r4 != NULL && param2 != 0) { void *ptr; - if (param4 == 0) - { + if (param4 == 0) { ptr = AllocFromHeap(heapId, (*(u32 *)r4) >> 8); - } - else - { + } else { ptr = AllocFromHeapAtEnd(heapId, (*(u32 *)r4) >> 8); } - if (ptr != NULL) - { + if (ptr != NULL) { MI_UncompressLZ8(r4, ptr); FreeToHeap(r4); } @@ -869,8 +774,7 @@ void *sub_02009A04(NARC *param0, u32 param1, u32 param2, HeapID heapId, u32 para return r4; } -u32 sub_02009A50(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009A50(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 0); @@ -883,18 +787,15 @@ u32 sub_02009A50(struct UnkStruct_02008DEC_sub *param0) return sub_0201D1F8(st0); } -void sub_02009A90(struct UnkStruct_02008DEC_5 *param0) -{ +void sub_02009A90(struct UnkStruct_02008DEC_5 *param0) { GF_ASSERT(param0); - for (int i = 0; i < param0->unk04; i++) - { + for (int i = 0; i < param0->unk04; i++) { GF_ASSERT(param0->unk00[i] == NULL || sub_02009A50(param0->unk00[i]) != 0); } } -u32 sub_02009AC4(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009AC4(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 0); @@ -907,8 +808,7 @@ u32 sub_02009AC4(struct UnkStruct_02008DEC_sub *param0) return sub_0201D250(st0); } -u32 sub_02009B04(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009B04(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 0); @@ -921,18 +821,15 @@ u32 sub_02009B04(struct UnkStruct_02008DEC_sub *param0) return sub_0201D1F8(st0); } -void sub_02009B44(struct UnkStruct_02008DEC_5 *param0) -{ +void sub_02009B44(struct UnkStruct_02008DEC_5 *param0) { GF_ASSERT(param0); - for (int i = 0; i < param0->unk04; i++) - { + for (int i = 0; i < param0->unk04; i++) { GF_ASSERT(param0->unk00[i] == NULL || sub_02009B04(param0->unk00[i]) != 0); } } -u32 sub_02009B78(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009B78(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 0); @@ -945,51 +842,43 @@ u32 sub_02009B78(struct UnkStruct_02008DEC_sub *param0) return sub_0201D250(st0); } -void sub_02009BB8(struct UnkStruct_02008DEC_sub *param0, struct UnkStruct_02008DEC_sub *param1) -{ +void sub_02009BB8(struct UnkStruct_02008DEC_sub *param0, struct UnkStruct_02008DEC_sub *param1) { GF_ASSERT(param0); GF_ASSERT(param1); sub_0201D2DC(sub_02009530(param0), sub_02009544(param1)); } -void sub_02009BE8(struct UnkStruct_02008DEC_sub *param0) -{ +void sub_02009BE8(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); sub_0201D2DC(sub_02009530(param0), sub_02009544(param0)); } -void sub_02009C0C(struct UnkStruct_02008DEC_sub *param0) -{ +void sub_02009C0C(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 0); sub_0201D324(sub_02009530(param0)); } -void sub_02009C30(struct UnkStruct_02008DEC_5 *param0) -{ +void sub_02009C30(struct UnkStruct_02008DEC_5 *param0) { GF_ASSERT(param0); - for (int i = 0; i < param0->unk04; i++) - { - if (param0->unk00[i] != NULL) - { + for (int i = 0; i < param0->unk04; i++) { + if (param0->unk00[i] != NULL) { sub_02009C0C(param0->unk00[i]); } } } -u32 sub_02009C5C(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009C5C(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 0); return sub_0201D3B0(sub_02009530(param0)); } -u32 sub_02009C80(struct UnkStruct_02008DEC_sub *param0, struct UnkStruct_02008DEC_sub *param1) -{ +u32 sub_02009C80(struct UnkStruct_02008DEC_sub *param0, struct UnkStruct_02008DEC_sub *param1) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 0); GF_ASSERT(param1); @@ -998,23 +887,20 @@ u32 sub_02009C80(struct UnkStruct_02008DEC_sub *param0, struct UnkStruct_02008DE s32 r4 = sub_02009530(param0); u32 r0 = sub_0201D3D4(r4, ((u32 **)sub_02009574(param1))[3][0]); - if (r0 == 0) - { + if (r0 == 0) { return sub_0201D458(sub_0201D3B0(r4)); } return r0; } -void sub_02009CDC(u32 param0) -{ +void sub_02009CDC(u32 param0) { GF_ASSERT(param0); sub_0201D4F0(param0); } -u32 sub_02009CF0(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009CF0(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 1); @@ -1027,20 +913,16 @@ u32 sub_02009CF0(struct UnkStruct_02008DEC_sub *param0) return sub_0201E0E4(st0); } -void sub_02009D34(struct UnkStruct_02008DEC_5 *param0) -{ +void sub_02009D34(struct UnkStruct_02008DEC_5 *param0) { GF_ASSERT(param0); - for (int i = 0; i < param0->unk04; i++) - { - if (param0->unk00[i] != NULL) - { + for (int i = 0; i < param0->unk04; i++) { + if (param0->unk00[i] != NULL) { GF_ASSERT(sub_02009CF0(param0->unk00[i]) != 0); } } } -u32 sub_02009D68(struct UnkStruct_02008DEC_sub *param0) -{ +u32 sub_02009D68(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 1); @@ -1053,64 +935,52 @@ u32 sub_02009D68(struct UnkStruct_02008DEC_sub *param0) return sub_0201E128(st0); } -void sub_02009DAC(struct UnkStruct_02008DEC_5 *param0) -{ +void sub_02009DAC(struct UnkStruct_02008DEC_5 *param0) { GF_ASSERT(param0); - for (int i = 0; i < param0->unk04; i++) - { - if (param0->unk00[i] != NULL) - { + for (int i = 0; i < param0->unk04; i++) { + if (param0->unk00[i] != NULL) { GF_ASSERT(sub_02009D68(param0->unk00[i]) != 0); } } } -void sub_02009DE0(struct UnkStruct_02008DEC_sub *param0) -{ +void sub_02009DE0(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); sub_0201E168(sub_02009530(param0), sub_0200955C(param0)); } -void sub_02009E04(struct UnkStruct_02008DEC_sub *param0) -{ +void sub_02009E04(struct UnkStruct_02008DEC_sub *param0) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 1); sub_0201E1C8(sub_02009530(param0)); } -void sub_02009E28(struct UnkStruct_02008DEC_5 *param0) -{ +void sub_02009E28(struct UnkStruct_02008DEC_5 *param0) { GF_ASSERT(param0); - for (int i = 0; i < param0->unk04; i++) - { - if (param0->unk00[i] != NULL) - { + for (int i = 0; i < param0->unk04; i++) { + if (param0->unk00[i] != NULL) { sub_02009E04(param0->unk00[i]); } } } -u32 sub_02009E54(struct UnkStruct_02008DEC_sub *param0, u32 param1) -{ +u32 sub_02009E54(struct UnkStruct_02008DEC_sub *param0, u32 param1) { GF_ASSERT(param0); GF_ASSERT(sub_020095D4(param0) == 1); s32 r0 = sub_02009530(param0); - if (param1 != 0) - { + if (param1 != 0) { return sub_0201E258(r0, param1); } return sub_0201E230(r0); } -s32 sub_02009E88(struct UnkStruct_02008DEC_sub *param0, u32 param1) -{ +s32 sub_02009E88(struct UnkStruct_02008DEC_sub *param0, u32 param1) { s32 ret = NNS_G2dGetImagePaletteLocation(sub_02009E54(param0, 0), param1); - if (ret != -1) - { + if (ret != -1) { return ret / 32; } diff --git a/arm9/src/unk_0200BA78.c b/arm9/src/unk_0200BA78.c index 098661816..59422f217 100644 --- a/arm9/src/unk_0200BA78.c +++ b/arm9/src/unk_0200BA78.c @@ -1,5 +1,7 @@ -#include "global.h" #include "unk_0200BA78.h" + +#include "global.h" + #include "message_format.h" void sub_0200BA78(struct UnkStruct_0200B870 *param0, @@ -9,27 +11,23 @@ void sub_0200BA78(struct UnkStruct_0200B870 *param0, enum PrintingMode mode, struct Window *window, int x, - int y) -{ + int y) { sub_0200B9A8(param0, param1, window, x, y); sub_0200B9EC(param0, value, n, mode, window, x + 16, y); } void sub_0200BAAC( - struct UnkStruct_0200B870 *param0, u32 value, u32 n, enum PrintingMode mode, void *dest) -{ + struct UnkStruct_0200B870 *param0, u32 value, u32 n, enum PrintingMode mode, void *dest) { u8 st0 = (u8)((param0->unk_28 << 4) | param0->unk_28); ConvertUIntToDecimalString(param0->data, value, mode, n); - for (int i = 0; param0->data[i] != 0xffff; i++) - { - if (param0->data[i] >= 0xa2 && param0->data[i] <= 0xab) - { - MI_CpuCopy32( //UB: void * access - ¶m0->unk_4->pRawData[(param0->data[i] - 0xa2) << 5], dest + i * 0x20, 0x20); - } - else - { + for (int i = 0; param0->data[i] != 0xffff; i++) { + if (param0->data[i] >= 0xa2 && param0->data[i] <= 0xab) { + MI_CpuCopy32( // UB: void * access + ¶m0->unk_4->pRawData[(param0->data[i] - 0xa2) << 5], + dest + i * 0x20, + 0x20); + } else { MI_CpuFill8(dest + i * 0x20, st0, 0x20); } } diff --git a/arm9/src/unk_0200BB14.c b/arm9/src/unk_0200BB14.c index d6da30b17..5cb5b224e 100644 --- a/arm9/src/unk_0200BB14.c +++ b/arm9/src/unk_0200BB14.c @@ -1,10 +1,12 @@ -#include "global.h" #include "unk_0200BB14.h" + +#include "global.h" + #include "game_init.h" #include "heap.h" +#include "oam.h" #include "unk_02008AA4.h" #include "unk_02008DEC.h" -#include "oam.h" extern void sub_0201D060(u32 *param0, u32 param1, u32 param2); extern void sub_0201E00C(u32 param0, HeapID heapId); @@ -54,11 +56,9 @@ extern void sub_02020054(u32 param0, u32 *param1); extern void sub_02020358(u32 param0, u32 param1); extern void sub_02020398(u32 param0, u32 param1); -struct UnkStruct_0200BB14_1 *sub_0200BB14(HeapID heapId) -{ +struct UnkStruct_0200BB14_1 *sub_0200BB14(HeapID heapId) { struct UnkStruct_0200BB14_1 *ptr = AllocFromHeap(heapId, sizeof(struct UnkStruct_0200BB14_1)); - if (ptr == NULL) - { + if (ptr == NULL) { return NULL; } @@ -69,39 +69,32 @@ struct UnkStruct_0200BB14_1 *sub_0200BB14(HeapID heapId) return ptr; } -struct UnkStruct_0200BB14_2 *sub_0200BB34(struct UnkStruct_0200BB14_1 *param0) -{ +struct UnkStruct_0200BB14_2 *sub_0200BB34(struct UnkStruct_0200BB14_1 *param0) { GF_ASSERT(param0 != NULL); - struct UnkStruct_0200BB14_2 *ptr = - AllocFromHeap(param0->heapId, sizeof(struct UnkStruct_0200BB14_2)); - if (ptr == NULL) - { + struct UnkStruct_0200BB14_2 *ptr = AllocFromHeap(param0->heapId, sizeof(struct UnkStruct_0200BB14_2)); + if (ptr == NULL) { return NULL; } param0->unk004++; - for (s32 i = 0; i < 6; i++) - { + for (s32 i = 0; i < 6; i++) { ptr->unk0c[i] = 0; } return ptr; } -u32 sub_0200BB68(u32 param0) -{ +u32 sub_0200BB68(u32 param0) { return param0 + 0x10; } BOOL sub_0200BB6C( - struct UnkStruct_0200BB14_1 *param0, u32 *param1, u32 *param2, u32 param3) -{ + struct UnkStruct_0200BB14_1 *param0, u32 *param1, u32 *param2, u32 param3) { GF_ASSERT(param0 != NULL); - if (param0 == NULL) - { + if (param0 == NULL) { return FALSE; } @@ -111,8 +104,7 @@ BOOL sub_0200BB6C( sub_0201E00C(param3, param0->heapId); NNS_G2dInitOamManagerModule(); - if (param0->unk008 == 1) - { + if (param0->unk008 == 1) { sub_02009EAC(param1[0], param1[1], param1[2], @@ -132,10 +124,8 @@ BOOL sub_0200BB6C( } BOOL sub_0200BBF0( - struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 param2) -{ - if (param0 == NULL || param1 == NULL) - { + struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 param2) { + if (param0 == NULL || param1 == NULL) { return FALSE; } @@ -144,45 +134,36 @@ BOOL sub_0200BBF0( return TRUE; } -void sub_0200BC14(u32 param0) -{ +void sub_0200BC14(u32 param0) { sub_0201FFC8(param0); } -void sub_0200BC1C(u32 *param0) -{ +void sub_0200BC1C(u32 *param0) { GF_ASSERT(param0 != NULL); sub_0201FDEC(*param0); } -void sub_0200BC30() -{ +void sub_0200BC30() { ApplyAndResetOamManagerBuffer(); } -void sub_0200BC38() -{ +void sub_0200BC38() { sub_0201C348(); } -void sub_0200BC40(struct UnkStruct_0200BB14_2 *param0) -{ +void sub_0200BC40(struct UnkStruct_0200BB14_2 *param0) { sub_0201FD58(param0->unk00); } -void sub_0200BC4C(struct UnkStruct_0200BB14_2 *param0) -{ - if (param0->unk04 != 0) - { +void sub_0200BC4C(struct UnkStruct_0200BB14_2 *param0) { + if (param0->unk04 != 0) { sub_02008C80(param0->unk04); } } -void sub_0200BC5C(struct UnkStruct_0200BB14_2 *param0) -{ - for (s32 i = 0; i < param0->unk54; i++) - { +void sub_0200BC5C(struct UnkStruct_0200BB14_2 *param0) { + for (s32 i = 0; i < param0->unk54; i++) { sub_020096B4(sub_02009660(param0->unk08, i)); } @@ -190,94 +171,81 @@ void sub_0200BC5C(struct UnkStruct_0200BB14_2 *param0) sub_02009C30(param0->unk24[0]); sub_02009E28(param0->unk24[1]); - for (s32 i = 0; i < param0->unk54; i++) - { + for (s32 i = 0; i < param0->unk54; i++) { sub_02009448(param0->unk24[i]); sub_02008E2C(param0->unk0c[i]); } } -void sub_0200BCB0(u32 *param0) -{ +void sub_0200BCB0(u32 *param0) { sub_0201C350(param0[3]); sub_0201D12C(); sub_0201E08C(); - if (param0[2] == 1) - { + if (param0[2] == 1) { DeinitOamData(); } } void sub_0200BCD0( - struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1) -{ + struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1) { param0->unk004--; FreeToHeap(param1); } void sub_0200BCE0( - struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1) -{ + struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1) { sub_0200BC40(param1); sub_0200BC4C(param1); sub_0200BC5C(param1); sub_0200BCD0(param0, param1); } -void sub_0200BD04(u32 *param0) -{ +void sub_0200BD04(u32 *param0) { GF_ASSERT(param0[1] == 0); sub_0200BCB0(param0); FreeToHeap(param0); } BOOL sub_0200BD20( - struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, const char **param2) -{ - s32 st14 = 6; + struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, const char **param2) { + s32 st14 = 6; const char **st10 = param2; - if (param0 == NULL || param1 == NULL) - { + if (param0 == NULL || param1 == NULL) { return FALSE; } - if (param2[4] == 0) - { + if (param2[4] == 0) { st14 = 4; } param1->unk54 = st14; - u32 r2 = sub_0200965C(); + u32 r2 = sub_0200965C(); param1->unk08 = AllocFromHeap(param0->heapId, r2 * st14); - for (s32 i = 0; i < st14; i++) - { + for (s32 i = 0; i < st14; i++) { struct UnkStruct_02008DEC_2 *st18 = sub_02009660(param1->unk08, i); - void *st1c = AllocAndReadFile(param0->heapId, st10[i]); + void *st1c = AllocAndReadFile(param0->heapId, st10[i]); sub_02009668(st1c, st18, param0->heapId); FreeToHeap(st1c); } - for (s32 i = 0; i < st14; i++) - { - param1->unk0c[i] = - sub_02008DEC(sub_020096CC(sub_02009660(param1->unk08, i)), i, param0->heapId); + for (s32 i = 0; i < st14; i++) { + param1->unk0c[i] = sub_02008DEC(sub_020096CC(sub_02009660(param1->unk08, i)), i, param0->heapId); } - for (s32 i = 0; i < st14; i++) - { + for (s32 i = 0; i < st14; i++) { struct UnkStruct_02008DEC_2 *st20 = sub_02009660(param1->unk08, i); - param1->unk24[i] = sub_02009424(sub_020096CC(st20), param0->heapId); - param1->unk3c[i] = sub_020093A8(param1->unk0c[i], st20, param1->unk24[i], param0->heapId); + param1->unk24[i] = sub_02009424(sub_020096CC(st20), param0->heapId); + param1->unk3c[i] = sub_020093A8(param1->unk0c[i], st20, param1->unk24[i], param0->heapId); } sub_02009A90(param1->unk24[0]); sub_02009D34(param1->unk24[1]); struct UnkStruct_02008AA4_2 *r6 = AllocAndReadFile(param0->heapId, st10[6]); - param1->unk04 = sub_02008BE0(r6, + param1->unk04 = sub_02008BE0(r6, param0->heapId, param1->unk0c[0], param1->unk0c[1], @@ -290,8 +258,7 @@ BOOL sub_0200BD20( return TRUE; } -u32 sub_0200BE38(u32 *param0, u32 *param1, struct UnkStruct_0200BB14_3 *param2) -{ +u32 sub_0200BE38(u32 *param0, u32 *param1, struct UnkStruct_0200BB14_3 *param2) { return sub_0200BE74(param0, param1, param2->unk00, @@ -321,8 +288,7 @@ u32 sub_0200BE74(u32 *param0, u32 param10, u32 param11, u32 param12, - u32 param13) -{ + u32 param13) { #pragma unused(param10) #pragma unused(param11) #pragma unused(param12) @@ -333,38 +299,28 @@ u32 sub_0200BE74(u32 *param0, st0.unk04 = &(*(struct UnkStruct_0200BB14_sub **)(param1[1]))[param2]; f32 r0; - if (param3 > 0) - { + if (param3 > 0) { r0 = ((f32)(param3 * 0x1000) + (f32)0.5); - } - else - { + } else { r0 = ((f32)(param3 * 0x1000) - (f32)0.5); } st0.unk08 = (s32)r0; - if (param4 > 0) - { + if (param4 > 0) { r0 = ((f32)(param4 * 0x1000) + (f32)0.5); - } - else - { + } else { r0 = ((f32)(param4 * 0x1000) - (f32)0.5); } st0.unk0c = (s32)r0; - if (param5 > 0) - { + if (param5 > 0) { r0 = ((f32)(param5 * 0x1000) + (f32)0.5); - } - else - { + } else { r0 = ((f32)(param5 * 0x1000) - (f32)0.5); } st0.unk10 = (s32)r0; - if (param9 == 2) - { + if (param9 == 2) { st0.unk0c += 0xC0000; } @@ -377,8 +333,7 @@ u32 sub_0200BE74(u32 *param0, st0.unk2c = param0[0]; u32 r4 = sub_0201FE94(&st0); - if (r4 != 0) - { + if (r4 != 0) { sub_02020130(r4, param6); sub_02020248(r4, param8); @@ -388,38 +343,31 @@ u32 sub_0200BE74(u32 *param0, } BOOL sub_0200BF60( - struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, s32 *param2) -{ + struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, s32 *param2) { struct UnkStruct_0200BB14_1 *st0 = param0; s32 i; s32 st4 = 6; - if (st0 == NULL || param1 == NULL) - { + if (st0 == NULL || param1 == NULL) { return FALSE; } - if (param2[4] == 0 || param2[5] == 0) - { + if (param2[4] == 0 || param2[5] == 0) { st4 = 4; } param1->unk54 = st4; - for (i = 0; i < st4; i++) - { + for (i = 0; i < st4; i++) { param1->unk0c[i] = sub_02008DEC(param2[i], i, st0->heapId); } - for (i = 0; i < st4; i++) - { - if (param2[i] != 0) - { + for (i = 0; i < st4; i++) { + if (param2[i] != 0) { param1->unk24[i] = sub_02009424(param2[i], st0->heapId); param1->unk3c[i] = 0; - for (s32 j = 0; j < param1->unk24[i]->unk04; j++) - { + for (s32 j = 0; j < param1->unk24[i]->unk04; j++) { param1->unk24[i]->unk00[j] = NULL; } } @@ -434,16 +382,13 @@ BOOL sub_0200C00C(HeapID *heapId, s32 param3, BOOL param4, u32 param5, - s32 param6) -{ - if (sub_0200945C(param1->unk0c[0], param6) == 0) - { + s32 param6) { + if (sub_0200945C(param1->unk0c[0], param6) == 0) { return FALSE; } struct UnkStruct_02008DEC_sub *r5 = sub_02008F34(param1->unk0c[0], param2, param3, param4, param6, param5, *heapId); - if (r5 != NULL) - { + if (r5 != NULL) { sub_02009B04(r5); sub_0200C474(param1->unk24[0], r5); return TRUE; @@ -460,17 +405,13 @@ s32 sub_0200C06C(HeapID *heapId, BOOL param4, u32 param5, u32 param6, - s32 param7) -{ - if (sub_0200945C(param1->unk0c[1], param7) == 0) - { + s32 param7) { + if (sub_0200945C(param1->unk0c[1], param7) == 0) { return -1; } - struct UnkStruct_02008DEC_sub * r5 = - sub_02008FEC(param1->unk0c[1], param2, param3, param4, param7, param6, param5, *heapId); - if (r5 != NULL) - { + struct UnkStruct_02008DEC_sub *r5 = sub_02008FEC(param1->unk0c[1], param2, param3, param4, param7, param6, param5, *heapId); + if (r5 != NULL) { GF_ASSERT(sub_02009D68(r5) == 1); sub_0200C474(param1->unk24[1], r5); return (s8)sub_02009E88(r5, param6); @@ -489,11 +430,9 @@ u8 sub_0200C0DC(u32 param0, BOOL param6, u32 param7, u32 param8, - s32 param9) -{ + s32 param9) { s32 r4 = sub_0200C06C(heapId, param3, param4, param5, param6, param7, param8, param9); - if (r4 != -1) - { + if (r4 != -1) { sub_02003108(param0, param1, (u16)(r4 << 4), param7 << 5); } @@ -505,8 +444,7 @@ BOOL sub_0200C124(HeapID *heapId, NarcId param2, s32 param3, BOOL param4, - s32 param5) -{ + s32 param5) { return sub_0200C404(heapId, param1, param2, param3, param4, 2, param5); } @@ -515,61 +453,48 @@ BOOL sub_0200C13C(HeapID *heapId, NarcId param2, s32 param3, BOOL param4, - s32 param5) -{ + s32 param5) { return sub_0200C404(heapId, param1, param2, param3, param4, 3, param5); } struct UnkStruct_0200BB14_5 *sub_0200C154( - struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 *param2) -{ + struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1, u32 *param2) { struct UnkStruct_0200BB14_4 st44; s32 st2c[6]; - struct UnkStruct_0200BB14_5 *ptr = - AllocFromHeap(param0->heapId, sizeof(struct UnkStruct_0200BB14_5)); - if (ptr == NULL) - { + struct UnkStruct_0200BB14_5 *ptr = AllocFromHeap(param0->heapId, sizeof(struct UnkStruct_0200BB14_5)); + if (ptr == NULL) { return NULL; } ptr->unk08 = AllocFromHeap(param0->heapId, sizeof(struct UnkStruct_0200BB14_6)); - if (ptr->unk08 == 0) - { + if (ptr->unk08 == 0) { return NULL; } ptr->unk08->unk0 = AllocFromHeap(param0->heapId, sizeof(struct UnkStruct_0200BB14_sub)); - ptr->unk04 = ptr->unk08->unk0; - if (ptr->unk08->unk0 == NULL) - { - if (ptr->unk08 != NULL) - { + ptr->unk04 = ptr->unk08->unk0; + if (ptr->unk08->unk0 == NULL) { + if (ptr->unk08 != NULL) { FreeToHeap(ptr->unk08); } return NULL; } - for (s32 i = 0; i < 6; i++) - { + for (s32 i = 0; i < 6; i++) { st2c[i] = (s32)param2[5 + i]; } - if (param1->unk0c[4] == 0 || param1->unk0c[5] == 0) - { + if (param1->unk0c[4] == 0 || param1->unk0c[5] == 0) { st2c[4] = -1; st2c[5] = -1; - } - else - { - if (st2c[4] != -1 && sub_0200945C(param1->unk0c[4], st2c[4]) == 0) - { + } else { + if (st2c[4] != -1 && sub_0200945C(param1->unk0c[4], st2c[4]) == 0) { st2c[4] = -1; } - if (st2c[5] != -1 && sub_0200945C(param1->unk0c[5], st2c[5]) == 0) - { + if (st2c[5] != -1 && sub_0200945C(param1->unk0c[5], st2c[5]) == 0) { st2c[5] = -1; } } @@ -593,38 +518,28 @@ struct UnkStruct_0200BB14_5 *sub_0200C154( st44.unk00 = param1->unk00; st44.unk04 = ptr->unk04; f32 r0; - if (((s16 *)param2)[0] > 0) - { + if (((s16 *)param2)[0] > 0) { r0 = ((f32)(((s16 *)param2)[0] << 0xc) + (f32)0.5); - } - else - { + } else { r0 = ((f32)(((s16 *)param2)[0] << 0xc) - (f32)0.5); } st44.unk08 = (s32)r0; - if (((s16 *)param2)[1] > 0) - { + if (((s16 *)param2)[1] > 0) { r0 = ((f32)(((s16 *)param2)[1] << 0xc) + (f32)0.5); - } - else - { + } else { r0 = ((f32)(((s16 *)param2)[1] << 0xc) - (f32)0.5); } st44.unk0c = (s32)r0; - if (((s16 *)param2)[2] > 0) - { + if (((s16 *)param2)[2] > 0) { r0 = ((f32)(((s16 *)param2)[2] << 0xc) + (f32)0.5); - } - else - { + } else { r0 = ((f32)(((s16 *)param2)[2] << 0xc) - (f32)0.5); } st44.unk10 = (s32)r0; - if (param2[4] == 2) - { + if (param2[4] == 2) { st44.unk0c += 0xC0000; } @@ -639,60 +554,49 @@ struct UnkStruct_0200BB14_5 *sub_0200C154( ptr->unk00 = sub_0201FE94(&st44); ptr->unk0c = param2[12]; - if (ptr->unk00 != 0) - { + if (ptr->unk00 != 0) { u8 r6 = sub_020202A0(ptr->unk00); sub_02020130(ptr->unk00, ((u16 *)param2)[3]); sub_02020248(ptr->unk00, r6 + param2[3]); - } - else - { + } else { GF_ASSERT(0); } return ptr; } -u32 sub_0200C334(struct UnkStruct_02008DEC_1 **param0, s32 param1) -{ +u32 sub_0200C334(struct UnkStruct_02008DEC_1 **param0, s32 param1) { return sub_02009E54(sub_020094F0(param0[4], param1), 0); } -s32 sub_0200C344(struct UnkStruct_02008DEC_1 **param0, s32 param1, u32 param2) -{ +s32 sub_0200C344(struct UnkStruct_02008DEC_1 **param0, s32 param1, u32 param2) { return sub_02009E88(sub_020094F0(param0[4], param1), param2); } -BOOL sub_0200C358(struct UnkStruct_0200BB14_2 *param0, u32 param1) -{ +BOOL sub_0200C358(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return sub_0200C4F4(param0->unk0c[0], param0->unk24[0], param1); } -BOOL sub_0200C368(struct UnkStruct_0200BB14_2 *param0, u32 param1) -{ +BOOL sub_0200C368(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return sub_0200C548(param0->unk0c[1], param0->unk24[1], param1); } -BOOL sub_0200C378(struct UnkStruct_0200BB14_2 *param0, u32 param1) -{ +BOOL sub_0200C378(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return sub_0200C4A8(param0->unk0c[2], param0->unk24[2], param1); } -BOOL sub_0200C388(struct UnkStruct_0200BB14_2 *param0, u32 param1) -{ +BOOL sub_0200C388(struct UnkStruct_0200BB14_2 *param0, u32 param1) { return sub_0200C4A8(param0->unk0c[3], param0->unk24[3], param1); } void sub_0200C398( - struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1) -{ + struct UnkStruct_0200BB14_1 *param0, struct UnkStruct_0200BB14_2 *param1) { sub_0200BC40(param1); sub_02009C30(param1->unk24[0]); sub_02009E28(param1->unk24[1]); - for (s32 i = 0; i < param1->unk54; i++) - { + for (s32 i = 0; i < param1->unk54; i++) { sub_02009448(param1->unk24[i]); sub_02008E2C(param1->unk0c[i]); } @@ -700,10 +604,8 @@ void sub_0200C398( sub_0200BCD0(param0, param1); } -void sub_0200C3DC(u32 *param0) -{ - if (param0[3] != 0) - { +void sub_0200C3DC(u32 *param0) { + if (param0[3] != 0) { sub_02009CDC(*(u32 *)param0[1]); } @@ -718,16 +620,13 @@ BOOL sub_0200C404(HeapID *heapId, s32 param3, BOOL param4, u32 param5, - s32 param6) -{ - if (sub_0200945C(param1->unk0c[param5], param6) == 0) - { + s32 param6) { + if (sub_0200945C(param1->unk0c[param5], param6) == 0) { return FALSE; } struct UnkStruct_02008DEC_sub *r5 = sub_020090AC(param1->unk0c[param5], param2, param3, param4, param6, param5, *heapId); - if (r5 != NULL) - { + if (r5 != NULL) { BOOL r4 = sub_0200C474(param1->unk24[param5], r5); GF_ASSERT(r4 == TRUE); return r4; @@ -736,12 +635,9 @@ BOOL sub_0200C404(HeapID *heapId, return r5 != NULL ? TRUE : FALSE; } -BOOL sub_0200C474(struct UnkStruct_02008DEC_5 *param0, struct UnkStruct_02008DEC_sub *param1) -{ - for (s32 i = 0; i < param0->unk04; i++) - { - if (param0->unk00[i] == NULL) - { +BOOL sub_0200C474(struct UnkStruct_02008DEC_5 *param0, struct UnkStruct_02008DEC_sub *param1) { + for (s32 i = 0; i < param0->unk04; i++) { + if (param0->unk00[i] == NULL) { param0->unk00[i] = param1; param0->unk08++; return TRUE; @@ -751,15 +647,11 @@ BOOL sub_0200C474(struct UnkStruct_02008DEC_5 *param0, struct UnkStruct_02008DEC return FALSE; } -BOOL sub_0200C4A8(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_5 *param1, u32 param2) -{ - for (s32 i = 0; i < param1->unk04; i++) - { - if (param1->unk00[i] != 0) - { +BOOL sub_0200C4A8(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_5 *param1, u32 param2) { + for (s32 i = 0; i < param1->unk04; i++) { + if (param1->unk00[i] != 0) { s32 r0 = sub_02009530(param1->unk00[i]); - if (r0 == param2) - { + if (r0 == param2) { sub_02009490(param0, param1->unk00[i]); param1->unk00[i] = NULL; @@ -773,15 +665,11 @@ BOOL sub_0200C4A8(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC return FALSE; } -BOOL sub_0200C4F4(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_5 *param1, u32 param2) -{ - for (s32 i = 0; i < param1->unk04; i++) - { - if (param1->unk00[i] != NULL) - { +BOOL sub_0200C4F4(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_5 *param1, u32 param2) { + for (s32 i = 0; i < param1->unk04; i++) { + if (param1->unk00[i] != NULL) { s32 r0 = sub_02009530(param1->unk00[i]); - if (r0 == param2) - { + if (r0 == param2) { sub_0201D324(param2); sub_02009490(param0, param1->unk00[i]); @@ -796,15 +684,11 @@ BOOL sub_0200C4F4(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC return FALSE; } -BOOL sub_0200C548(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_5 *param1, u32 param2) -{ - for (s32 i = 0; i < param1->unk04; i++) - { - if (param1->unk00[i] != 0) - { +BOOL sub_0200C548(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC_5 *param1, u32 param2) { + for (s32 i = 0; i < param1->unk04; i++) { + if (param1->unk00[i] != 0) { s32 r0 = sub_02009530(param1->unk00[i]); - if (r0 == param2) - { + if (r0 == param2) { sub_0201E1C8(param2); sub_02009490(param0, param1->unk00[i]); @@ -819,168 +703,135 @@ BOOL sub_0200C548(struct UnkStruct_02008DEC_1 *param0, struct UnkStruct_02008DEC return FALSE; } -void sub_0200C59C(u32 param0) -{ +void sub_0200C59C(u32 param0) { sub_020201E4(param0, 0x1000); } -void sub_0200C5A8(u32 *param0) -{ +void sub_0200C5A8(u32 *param0) { sub_0200C59C(param0[0]); } -void sub_0200C5B4(u32 *param0, u32 param1) -{ +void sub_0200C5B4(u32 *param0, u32 param1) { sub_020201E4(param0[0], param1); } -void sub_0200C5C0(u32 *param0, u32 param1) -{ +void sub_0200C5C0(u32 *param0, u32 param1) { sub_02020130(param0[0], param1); } -u32 sub_0200C5CC(u32 *param0) -{ +u32 sub_0200C5CC(u32 *param0) { return sub_020201DC(param0[0]); } -void sub_0200C5D8(u32 param0, u32 param1) -{ +void sub_0200C5D8(u32 param0, u32 param1) { sub_020200BC(param0, param1); } -void sub_0200C5E0(u32 *param0, u32 param1) -{ +void sub_0200C5E0(u32 *param0, u32 param1) { sub_0200C5D8(param0[0], param1); } -void sub_0200C5EC(u32 param0, u32 param1) -{ +void sub_0200C5EC(u32 param0, u32 param1) { sub_020200D8(param0, param1); } -void sub_0200C5F4(u32 *param0, u32 param1) -{ +void sub_0200C5F4(u32 *param0, u32 param1) { sub_0200C5EC(*param0, param1); } -u32 sub_0200C600(u32 param0) -{ +u32 sub_0200C600(u32 param0) { return sub_02020388(param0); } -u32 sub_0200C608(u32 *param0) -{ +u32 sub_0200C608(u32 *param0) { return sub_0200C600(*param0); } -void sub_0200C614(u32 param0) -{ +void sub_0200C614(u32 param0) { sub_02020208(param0); } -void sub_0200C61C(u32 *param0) -{ +void sub_0200C61C(u32 *param0) { sub_0200C614(*param0); } -void sub_0200C628(u32 param0) -{ +void sub_0200C628(u32 param0) { sub_0202022C(param0); } -void sub_0200C630(u32 *param0) -{ +void sub_0200C630(u32 *param0) { sub_0200C628(*param0); } -void sub_0200C63C(u32 param0, u32 param1) -{ +void sub_0200C63C(u32 param0, u32 param1) { sub_020200A0(param0, param1); } -void sub_0200C644(u32 *param0, u32 param1) -{ +void sub_0200C644(u32 *param0, u32 param1) { sub_0200C63C(*param0, param1); } -u8 sub_0200C650(u32 param0) -{ +u8 sub_0200C650(u32 param0) { return sub_02020128(param0); } -u8 sub_0200C658(u32 *param0) -{ +u8 sub_0200C658(u32 *param0) { return sub_0200C650(*param0); } -void sub_0200C664(u32 param0, u32 param1) -{ +void sub_0200C664(u32 param0, u32 param1) { sub_02020248(param0, param1); } -void sub_0200C66C(u32 *param0, u32 param1) -{ +void sub_0200C66C(u32 *param0, u32 param1) { sub_0200C664(*param0, param1); } -void sub_0200C678(u32 param0, u32 param1) -{ +void sub_0200C678(u32 param0, u32 param1) { sub_020202A8(param0, param1); } -void sub_0200C680(u32 *param0, u32 param1) -{ +void sub_0200C680(u32 *param0, u32 param1) { sub_0200C678(*param0, param1); } -u8 sub_0200C68C(u32 *param0) -{ +u8 sub_0200C68C(u32 *param0) { return sub_02020300(*param0); } -void sub_0200C698(u32 param0, u32 param1) -{ +void sub_0200C698(u32 param0, u32 param1) { sub_02020238(param0, (u8)param1); } -u8 sub_0200C6A4(u32 *param0) -{ +u8 sub_0200C6A4(u32 *param0) { return sub_02020240(*param0); } -void sub_0200C6B0(u32 *param0, u32 param1) -{ +void sub_0200C6B0(u32 *param0, u32 param1) { sub_0200C698(*param0, param1); } -void sub_0200C6BC(u32 param0, u32 param1) -{ +void sub_0200C6BC(u32 param0, u32 param1) { sub_02020310(param0, param1); } -void sub_0200C6C4(u32 *param0, u32 param1) -{ +void sub_0200C6C4(u32 *param0, u32 param1) { sub_0200C6BC(*param0, param1); } -u16 sub_0200C6D0(u32 param0) -{ +u16 sub_0200C6D0(u32 param0) { return sub_0202032C(param0); } -u16 sub_0200C6D8(u32 *param0) -{ +u16 sub_0200C6D8(u32 *param0) { return sub_0200C6D0(*param0); } -void sub_0200C6E4(u32 param0, u32 param1, u32 param2) -{ +void sub_0200C6E4(u32 param0, u32 param1, u32 param2) { u32 st0[3]; st0[0] = param1 << 12; st0[1] = param2 << 12; - if (sub_02020380(param0) == 2) - { + if (sub_02020380(param0) == 2) { st0[1] += 0xc0000; } st0[2] = 0; @@ -988,19 +839,16 @@ void sub_0200C6E4(u32 param0, u32 param1, u32 param2) sub_02020044(param0, st0); } -void sub_0200C714(u32 *param0, u32 param1, u32 param2) -{ +void sub_0200C714(u32 *param0, u32 param1, u32 param2) { sub_0200C6E4(*param0, param1, param2); } -void sub_0200C720(u32 param0, u32 param1, u32 param2, u32 param3) -{ +void sub_0200C720(u32 param0, u32 param1, u32 param2, u32 param3) { u32 st0[3]; st0[0] = param1 << 12; st0[1] = param2 << 12; - if (sub_02020380(param0) == 2) - { + if (sub_02020380(param0) == 2) { st0[1] += param3; } st0[2] = 0; @@ -1008,19 +856,16 @@ void sub_0200C720(u32 param0, u32 param1, u32 param2, u32 param3) sub_02020044(param0, st0); } -void sub_0200C750(u32 *param0, u32 param1, u32 param2, u32 param3) -{ +void sub_0200C750(u32 *param0, u32 param1, u32 param2, u32 param3) { sub_0200C720(*param0, param1, param2, param3); } -void sub_0200C75C(u32 param0, u16 *param1, u16 *param2) -{ +void sub_0200C75C(u32 param0, u16 *param1, u16 *param2) { s32 *r4 = sub_0202011C(param0, param1, param2); param1[0] = (u16)(r4[0] / 0x1000); - if (sub_02020380(param0) == 2) - { + if (sub_02020380(param0) == 2) { s32 r1 = r4[1] - 0xc0000; param2[0] = (u16)(r1 / 0x1000); @@ -1031,19 +876,16 @@ void sub_0200C75C(u32 param0, u16 *param1, u16 *param2) param2[0] = (u16)(r4[1] / 0x1000); } -void sub_0200C7A0(u32 *param0, u16 *param1, u16 *param2) -{ +void sub_0200C7A0(u32 *param0, u16 *param1, u16 *param2) { sub_0200C75C(*param0, param1, param2); } -void sub_0200C7AC(u32 param0, u16 *param1, u16 *param2, s32 param3) -{ +void sub_0200C7AC(u32 param0, u16 *param1, u16 *param2, s32 param3) { s32 *r4 = sub_0202011C(param0, param1, param2); param1[0] = (u16)(r4[0] / 0x1000); - if (sub_02020380(param0) == 2) - { + if (sub_02020380(param0) == 2) { s32 r1 = r4[1] - param3; param2[0] = (u16)(r1 / 0x1000); @@ -1054,13 +896,11 @@ void sub_0200C7AC(u32 param0, u16 *param1, u16 *param2, s32 param3) param2[0] = (u16)(r4[1] / 0x1000); } -void sub_0200C7F0(u32 *param0, u16 *param1, u16 *param2, s32 param3) -{ +void sub_0200C7F0(u32 *param0, u16 *param1, u16 *param2, s32 param3) { sub_0200C7AC(*param0, param1, param2, param3); } -void sub_0200C7FC(u32 param0, u16 *param1, u16 *param2) -{ +void sub_0200C7FC(u32 param0, u16 *param1, u16 *param2) { u32 st0[3]; u32 *r0 = sub_0202011C(param0, param1, param2); @@ -1072,23 +912,19 @@ void sub_0200C7FC(u32 param0, u16 *param1, u16 *param2) sub_02020044(param0, st0); } -void sub_0200C82C(u32 *param0, u16 *param1, u16 *param2) -{ +void sub_0200C82C(u32 *param0, u16 *param1, u16 *param2) { sub_0200C7FC(*param0, param1, param2); } -void sub_0200C838(u32 param0, u32 param1) -{ +void sub_0200C838(u32 param0, u32 param1) { sub_020200EC(param0, param1); } -void sub_0200C840(u32 *param0, u32 param1) -{ +void sub_0200C840(u32 *param0, u32 param1) { sub_0200C838(*param0, param1); } -void sub_0200C84C(u32 param0, f32 param1, f32 param2) -{ +void sub_0200C84C(u32 param0, f32 param1, f32 param2) { s32 *r4 = sub_02020120(param0); r4[0] = (s32)(param1 * 0x1000); @@ -1097,45 +933,37 @@ void sub_0200C84C(u32 param0, f32 param1, f32 param2) sub_02020064(param0, r4); } -void sub_0200C884(u32 *param0, f32 param1, f32 param2) -{ +void sub_0200C884(u32 *param0, f32 param1, f32 param2) { sub_0200C84C(*param0, param1, param2); } -void sub_0200C890(u32 param0, u16 param1) -{ +void sub_0200C890(u32 param0, u16 param1) { sub_02020088(param0, param1); } -void sub_0200C898(u32 *param0, u16 param1) -{ +void sub_0200C898(u32 *param0, u16 param1) { sub_0200C890(*param0, param1); } -void sub_0200C8A4(u32 param0, u32 param1) -{ +void sub_0200C8A4(u32 param0, u32 param1) { u16 r0 = sub_02020124(param0); r0 += param1; sub_02020088(param0, r0); } -void sub_0200C8BC(u32 *param0, u32 param1) -{ +void sub_0200C8BC(u32 *param0, u32 param1) { sub_0200C8A4(*param0, param1); } -void sub_0200C8C8(u32 param0, u32 param1) -{ +void sub_0200C8C8(u32 param0, u32 param1) { sub_02020100(param0, param1); } -void sub_0200C8D0(u32 *param0, u32 param1) -{ +void sub_0200C8D0(u32 *param0, u32 param1) { sub_0200C8C8(*param0, param1); } -void sub_0200C8DC(u32 *param0, u32 param1, u32 param2) -{ +void sub_0200C8DC(u32 *param0, u32 param1, u32 param2) { u32 st0[3]; st0[0] = param1 << 12; st0[1] = param2 << 12; @@ -1144,18 +972,15 @@ void sub_0200C8DC(u32 *param0, u32 param1, u32 param2) sub_02020054(*param0, st0); } -void sub_0200C8F8(u32 *param0, u32 param1) -{ +void sub_0200C8F8(u32 *param0, u32 param1) { sub_02020358(*param0, param1); } -void sub_0200C904(u32 param0, u32 param1) -{ +void sub_0200C904(u32 param0, u32 param1) { sub_02020398(param0, param1); } -void sub_0200C90C(u32 *param0, u32 param1) -{ +void sub_0200C90C(u32 *param0, u32 param1) { sub_0200C904(*param0, param1); } @@ -1165,16 +990,13 @@ BOOL sub_0200C918(HeapID *heapId, s32 param3, BOOL param4, u32 param5, - s32 param6) -{ - if (sub_0200945C(param1->unk0c[0], param6) == 0) - { + s32 param6) { + if (sub_0200945C(param1->unk0c[0], param6) == 0) { return FALSE; } struct UnkStruct_02008DEC_sub *r5 = sub_02008F34(param1->unk0c[0], param2, param3, param4, param6, param5, *heapId); - if (r5 != NULL) - { + if (r5 != NULL) { sub_02009AC4(r5); sub_0200C474(param1->unk24[0], r5); @@ -1191,16 +1013,13 @@ BOOL sub_0200C978(HeapID *heapId, s32 param3, BOOL param4, u32 param5, - s32 param6) -{ - if (sub_0200945C(param1->unk0c[0], param6) == 0) - { + s32 param6) { + if (sub_0200945C(param1->unk0c[0], param6) == 0) { return FALSE; } struct UnkStruct_02008DEC_sub *r5 = sub_02008F34(param1->unk0c[0], param2, param3, param4, param6, param5, *heapId); - if (r5 != NULL) - { + if (r5 != NULL) { sub_02009B78(r5); sub_0200C474(param1->unk24[0], r5); @@ -1212,8 +1031,7 @@ BOOL sub_0200C978(HeapID *heapId, } void sub_0200C9D8( - HeapID *heapId, struct UnkStruct_02008DEC_1 **param1, NarcId param2, s32 param3, BOOL param4, s32 param5) -{ + HeapID *heapId, struct UnkStruct_02008DEC_1 **param1, NarcId param2, s32 param3, BOOL param4, s32 param5) { struct UnkStruct_02008DEC_sub *r6 = sub_020094F0(param1[3], param5); sub_020090FC(param1[3], r6, param2, param3, param4, *heapId); @@ -1221,15 +1039,13 @@ void sub_0200C9D8( } void sub_0200CA0C( - HeapID *heapId, struct UnkStruct_02008DEC_1 **param1, NarcId param2, s32 param3, BOOL param4, s32 param5) -{ + HeapID *heapId, struct UnkStruct_02008DEC_1 **param1, NarcId param2, s32 param3, BOOL param4, s32 param5) { struct UnkStruct_02008DEC_sub *r6 = sub_020094F0(param1[4], param5); sub_02009168(param1[4], r6, param2, param3, param4, *heapId); sub_02009DE0(r6); } -u32 sub_0200CA40(u32 *param0) -{ +u32 sub_0200CA40(u32 *param0) { return *param0; } diff --git a/arm9/src/unk_0200CA44.c b/arm9/src/unk_0200CA44.c index 221292d40..ca7159dab 100644 --- a/arm9/src/unk_0200CA44.c +++ b/arm9/src/unk_0200CA44.c @@ -1,31 +1,29 @@ +#include "unk_0200CA44.h" + #include "global.h" + #include "main.h" -#include "unk_0200CA44.h" extern SysTask *sub_0201B60C(void *queue, SysTaskFunc func, void *data, u32 priority); extern void sub_0201B6A0(s32); -SysTask *SysTask_CreateOnMainQueue(SysTaskFunc func, void *data, u32 priority) -{ +SysTask *SysTask_CreateOnMainQueue(SysTaskFunc func, void *data, u32 priority) { return sub_0201B60C(gSystem.unk18, func, data, priority); } -BOOL sub_0200CA60(void (*r0)(u32, void *), void * r1, u32 r2) -{ - return (BOOL)sub_0201B60C(gSystem.unk1C, (SysTaskFunc)r0, r1, r2); //TODO: this is wrong +BOOL sub_0200CA60(void (*r0)(u32, void *), void *r1, u32 r2) { + return (BOOL)sub_0201B60C(gSystem.unk1C, (SysTaskFunc)r0, r1, r2); // TODO: this is wrong } -BOOL sub_0200CA7C(void (*r0)(u32, void *), void * r1, u32 r2) -{ +BOOL sub_0200CA7C(void (*r0)(u32, void *), void *r1, u32 r2) { return (BOOL)sub_0201B60C(gSystem.unk24, (SysTaskFunc)r0, r1, r2); } -BOOL sub_0200CA98(void (*r0)(u32, void *), void * r1, u32 r2) -{ +BOOL sub_0200CA98(void (*r0)(u32, void *), void *r1, u32 r2) { return (BOOL)sub_0201B60C(gSystem.unk20, (SysTaskFunc)r0, r1, r2); } -void sub_0200CAB4(s32 unk1) //todo: SysTask +void sub_0200CAB4(s32 unk1) // todo: SysTask { sub_0201B6A0(unk1); } diff --git a/arm9/src/unk_0200E1D0.c b/arm9/src/unk_0200E1D0.c index 1dc5724b4..0f206e9c2 100644 --- a/arm9/src/unk_0200E1D0.c +++ b/arm9/src/unk_0200E1D0.c @@ -1,7 +1,6 @@ #include "global.h" -struct UnkStruct_021C46B4 -{ +struct UnkStruct_021C46B4 { u8 unk_000[0x14]; u8 unk_014[0x30]; u8 unk_044[0x30]; diff --git a/arm9/src/unk_02015CC0.c b/arm9/src/unk_02015CC0.c index 7adbe9798..8afefbee8 100644 --- a/arm9/src/unk_02015CC0.c +++ b/arm9/src/unk_02015CC0.c @@ -1,5 +1,7 @@ -#include "global.h" #include "unk_02015CC0.h" + +#include "global.h" + #include "constants/map_sections.h" const u16 UNK_020ED72C[] = { @@ -8,23 +10,21 @@ const u16 UNK_020ED72C[] = { METLOC_LOVELY_PLACE }; -int sub_02015CC0(u16 a0) -{ +int sub_02015CC0(u16 a0) { int i; for (i = 0; i < (int)NELEMS(UNK_020ED72C) - 1; i++) { - if (a0 < UNK_020ED72C[i + 1]) + if (a0 < UNK_020ED72C[i + 1]) { return i; + } } return i; } -int sub_02015CE0(u16 a0) -{ +int sub_02015CE0(u16 a0) { return a0 - UNK_020ED72C[sub_02015CC0(a0)]; } -int sub_02015CF8(int a0, int a1) -{ +int sub_02015CF8(int a0, int a1) { GF_ASSERT(a0 < (int)NELEMS(UNK_020ED72C)); return a1 + UNK_020ED72C[a0]; } diff --git a/arm9/src/unk_0201CBEC.c b/arm9/src/unk_0201CBEC.c index e5e5523ad..81b5bc816 100644 --- a/arm9/src/unk_0201CBEC.c +++ b/arm9/src/unk_0201CBEC.c @@ -1,9 +1,10 @@ +#include "unk_0201CBEC.h" + #include "global.h" + #include "fx.h" -#include "unk_0201CBEC.h" -s32 sub_0201CBEC(s32 x1, s32 y1, s32 x2, s32 y2) -{ +s32 sub_0201CBEC(s32 x1, s32 y1, s32 x2, s32 y2) { // Calculate distance between two points with pythagoras s32 x_delta = x1 - x2; s32 y_delta = y1 - y2; diff --git a/arm9/src/unk_02021590.c b/arm9/src/unk_02021590.c index 864e4dd4a..0c6002213 100644 --- a/arm9/src/unk_02021590.c +++ b/arm9/src/unk_02021590.c @@ -1,5 +1,7 @@ -#include "global.h" #include "unk_02021590.h" + +#include "global.h" + #include "filesystem.h" #include "heap.h" #include "string_control_code.h" @@ -20,119 +22,100 @@ static void (*const sDestructors[])(struct FontData *) = { FreeLoadedFontResources_LazyFromNarc, }; -struct FontData *FontData_New(NarcId narcId, s32 fileId, u32 unk2, BOOL unk3, HeapID heapId) -{ - struct FontData * ret = (struct FontData *)AllocFromHeap(heapId, sizeof(struct FontData)); - if (ret != NULL) - { +struct FontData *FontData_New(NarcId narcId, s32 fileId, u32 unk2, BOOL unk3, HeapID heapId) { + struct FontData *ret = (struct FontData *)AllocFromHeap(heapId, sizeof(struct FontData)); + if (ret != NULL) { FontData_Init(ret, narcId, fileId, unk3, heapId); InitFontResources(ret, unk2, heapId); } return ret; } -void FontData_Delete(struct FontData * ptr) -{ +void FontData_Delete(struct FontData *ptr) { FreeLoadedFontResources(ptr); FontData_FreeWidthsAndNarc(ptr); FreeToHeap(ptr); } -void FontData_ModeSwitch(struct FontData * ptr, u32 a1, HeapID heapId) -{ - if (ptr->glyphAccessMode != a1) - { +void FontData_ModeSwitch(struct FontData *ptr, u32 a1, HeapID heapId) { + if (ptr->glyphAccessMode != a1) { FreeLoadedFontResources(ptr); InitFontResources(ptr, a1, heapId); } } -void FontData_Init(struct FontData *ptr, NarcId narcId, s32 fileId, BOOL unk, HeapID heapId) -{ +void FontData_Init(struct FontData *ptr, NarcId narcId, s32 fileId, BOOL unk, HeapID heapId) { ptr->narc = NARC_New(narcId, heapId); - if (ptr->narc != NULL) - { + if (ptr->narc != NULL) { NARC_ReadFromMember(ptr->narc, (u32)fileId, 0, 16, &ptr->gfxHeader); ptr->isFixedWidthFont = unk; - if (unk) - { - ptr->glyphWidths = NULL; + if (unk) { + ptr->glyphWidths = NULL; ptr->glyphWidthFunc = GetGlyphWidth_FixedWidth; - } - else - { + } else { GF_ASSERT(ptr->gfxHeader.widthDataStart != 0); - ptr->glyphWidths = AllocFromHeap(heapId, ptr->gfxHeader.numGlyphs); + ptr->glyphWidths = AllocFromHeap(heapId, ptr->gfxHeader.numGlyphs); ptr->glyphWidthFunc = GetGlyphWidth_VariableWidth; NARC_ReadFromMember(ptr->narc, (u32)fileId, ptr->gfxHeader.widthDataStart, ptr->gfxHeader.numGlyphs, ptr->glyphWidths); } GF_ASSERT(ptr->gfxHeader.glyphWidth <= 2 && ptr->gfxHeader.glyphHeight <= 2); ptr->glyphShape = sGlyphShapes[ptr->gfxHeader.glyphWidth - 1][ptr->gfxHeader.glyphHeight - 1]; - ptr->glyphSize = (u32)(16 * ptr->gfxHeader.glyphWidth * ptr->gfxHeader.glyphHeight); - ptr->fileId = (u32)fileId; + ptr->glyphSize = (u32)(16 * ptr->gfxHeader.glyphWidth * ptr->gfxHeader.glyphHeight); + ptr->fileId = (u32)fileId; } } -void FontData_FreeWidthsAndNarc(struct FontData * ptr) -{ - if (ptr->glyphWidths != NULL) +void FontData_FreeWidthsAndNarc(struct FontData *ptr) { + if (ptr->glyphWidths != NULL) { FreeToHeap(ptr->glyphWidths); - if (ptr->narc != NULL) + } + if (ptr->narc != NULL) { NARC_Delete(ptr->narc); + } } -void InitFontResources(struct FontData * ptr, u32 a1, HeapID heapId) -{ +void InitFontResources(struct FontData *ptr, u32 a1, HeapID heapId) { ptr->glyphAccessMode = a1; sAllocators[a1](ptr, heapId); } -void InitFontResources_FromPreloaded(struct FontData * ptr, HeapID heapId) -{ - u32 r4 = ptr->glyphSize * ptr->gfxHeader.numGlyphs; - ptr->narcReadBuf = AllocFromHeap(heapId, r4); +void InitFontResources_FromPreloaded(struct FontData *ptr, HeapID heapId) { + u32 r4 = ptr->glyphSize * ptr->gfxHeader.numGlyphs; + ptr->narcReadBuf = AllocFromHeap(heapId, r4); ptr->uncompGlyphFunc = DecompressGlyphTiles_FromPreloaded; NARC_ReadFromMember(ptr->narc, ptr->fileId, ptr->gfxHeader.headerSize, r4, ptr->narcReadBuf); } -void InitFontResources_LazyFromNarc(struct FontData * ptr, HeapID heapId) -{ +void InitFontResources_LazyFromNarc(struct FontData *ptr, HeapID heapId) { #pragma unused(heapId) ptr->uncompGlyphFunc = DecompressGlyphTiles_LazyFromNarc; } -void FreeLoadedFontResources(struct FontData * ptr) -{ +void FreeLoadedFontResources(struct FontData *ptr) { sDestructors[ptr->glyphAccessMode](ptr); } -void FreeLoadedFontResources_FromPreloaded(struct FontData * ptr) -{ +void FreeLoadedFontResources_FromPreloaded(struct FontData *ptr) { FreeToHeap(ptr->narcReadBuf); ptr->narcReadBuf = NULL; } -void FreeLoadedFontResources_LazyFromNarc(struct FontData * ptr) -{ +void FreeLoadedFontResources_LazyFromNarc(struct FontData *ptr) { #pragma unused(ptr) } -void TryLoadGlyph(struct FontData * ptr, u32 param1, struct UnkStruct_02002C14_sub * ptr2) -{ - if (param1 <= ptr->gfxHeader.numGlyphs) +void TryLoadGlyph(struct FontData *ptr, u32 param1, struct UnkStruct_02002C14_sub *ptr2) { + if (param1 <= ptr->gfxHeader.numGlyphs) { ptr->uncompGlyphFunc(ptr, (u16)(param1 - 1), ptr2); - else - { - ptr2->width = 0; + } else { + ptr2->width = 0; ptr2->height = 0; } } -void DecompressGlyphTiles_FromPreloaded(struct FontData * ptr, u16 param1, struct UnkStruct_02002C14_sub * param2) -{ +void DecompressGlyphTiles_FromPreloaded(struct FontData *ptr, u16 param1, struct UnkStruct_02002C14_sub *param2) { u8 *r4 = &((u8 *)ptr->narcReadBuf)[param1 * ptr->glyphSize]; - switch (ptr->glyphShape) - { + switch (ptr->glyphShape) { case 0: DecompressGlyphTile((void *)(r4), (void *)param2->buf); break; @@ -151,15 +134,13 @@ void DecompressGlyphTiles_FromPreloaded(struct FontData * ptr, u16 param1, struc DecompressGlyphTile((void *)(r4 + 0x30), (void *)(param2->buf + 0x60)); break; } - param2->width = (u8)ptr->glyphWidthFunc(ptr, param1); + param2->width = (u8)ptr->glyphWidthFunc(ptr, param1); param2->height = ptr->gfxHeader.fixedHeight; } -void DecompressGlyphTiles_LazyFromNarc(struct FontData * ptr, u16 param1, struct UnkStruct_02002C14_sub * param2) -{ +void DecompressGlyphTiles_LazyFromNarc(struct FontData *ptr, u16 param1, struct UnkStruct_02002C14_sub *param2) { NARC_ReadFromMember(ptr->narc, ptr->fileId, ptr->gfxHeader.headerSize + param1 * ptr->glyphSize, ptr->glyphSize, ptr->glyphReadBuf); - switch (ptr->glyphShape) - { + switch (ptr->glyphShape) { case 0: DecompressGlyphTile((void *)(ptr->glyphReadBuf), (void *)param2->buf); break; @@ -178,21 +159,19 @@ void DecompressGlyphTiles_LazyFromNarc(struct FontData * ptr, u16 param1, struct DecompressGlyphTile((void *)(ptr->glyphReadBuf + 0x30), (void *)(param2->buf + 0x60)); break; } - param2->width = (u8)ptr->glyphWidthFunc(ptr, param1); + param2->width = (u8)ptr->glyphWidthFunc(ptr, param1); param2->height = ptr->gfxHeader.fixedHeight; } -u32 GetStringWidth(struct FontData * ptr, const u16 * str, u32 letterSpacing) -{ +u32 GetStringWidth(struct FontData *ptr, const u16 *str, u32 letterSpacing) { u32 width = 0; - while (*str != EOS) - { - if (*str == EXT_CTRL_CODE_BEGIN) - { + while (*str != EOS) { + if (*str == EXT_CTRL_CODE_BEGIN) { str = MsgArray_SkipControlCode(str); - if (*str == EOS) + if (*str == EOS) { break; + } } width += ptr->glyphWidthFunc(ptr, (*str) - 1) + letterSpacing; str++; @@ -200,60 +179,47 @@ u32 GetStringWidth(struct FontData * ptr, const u16 * str, u32 letterSpacing) return width - letterSpacing; } -int GetGlyphWidth_VariableWidth(struct FontData * ptr, int a1) -{ +int GetGlyphWidth_VariableWidth(struct FontData *ptr, int a1) { return ptr->glyphWidths[a1]; } -int GetGlyphWidth_FixedWidth(struct FontData * ptr, int a1) -{ +int GetGlyphWidth_FixedWidth(struct FontData *ptr, int a1) { #pragma unused(a1) return ptr->gfxHeader.fixedWidth; } -s32 GetStringWidthMultiline(struct FontData * r7, const u16 * arr, u32 r6) -{ +s32 GetStringWidthMultiline(struct FontData *r7, const u16 *arr, u32 r6) { s32 ret = 0; - u32 r4 = 0; - while (*arr != EOS) - { - if (*arr == EXT_CTRL_CODE_BEGIN) - { + u32 r4 = 0; + while (*arr != EOS) { + if (*arr == EXT_CTRL_CODE_BEGIN) { arr = MsgArray_SkipControlCode(arr); - } - else if (*arr == CHAR_LF) - { - if (ret < r4 - r6) + } else if (*arr == CHAR_LF) { + if (ret < r4 - r6) { ret = (int)(r4 - r6); + } r4 = 0; arr++; - } - else - { + } else { r4 += (r6 + r7->glyphWidthFunc(r7, *arr - 1)); arr++; } } - if (ret < r4 - r6) + if (ret < r4 - r6) { ret = (int)(r4 - r6); + } return ret; } -s32 StringGetWidth_SingleLine_HandleClearToControlCode(struct FontData * r6, const u16 * arr) -{ +s32 StringGetWidth_SingleLine_HandleClearToControlCode(struct FontData *r6, const u16 *arr) { s32 ret = 0; - while (*arr != EOS) - { - if (*arr == EXT_CTRL_CODE_BEGIN) - { - if (MsgArray_GetControlCode(arr) == 515) - { + while (*arr != EOS) { + if (*arr == EXT_CTRL_CODE_BEGIN) { + if (MsgArray_GetControlCode(arr) == 515) { ret = MsgArray_ControlCodeGetField(arr, 0) - 12; } arr = MsgArray_SkipControlCode(arr); - } - else - { + } else { ret += r6->glyphWidthFunc(r6, *arr - 1); arr++; } diff --git a/arm9/src/unk_02021934.c b/arm9/src/unk_02021934.c index 48f8f1b4f..47616ec0d 100644 --- a/arm9/src/unk_02021934.c +++ b/arm9/src/unk_02021934.c @@ -1,43 +1,38 @@ #include "global.h" -#include "string16.h" + #include "heap.h" +#include "string16.h" #include "string_util.h" #define ASSERT_STR16(_str) ({ GF_ASSERT(_str != NULL); GF_ASSERT(_str->magic == STR16_MAGIC); }) -struct String * String_New(u32 length, HeapID heapId) -{ - struct String * ret = AllocFromHeap(heapId, length * 2 + 10); - if (ret != NULL) - { - ret->magic = STR16_MAGIC; +struct String *String_New(u32 length, HeapID heapId) { + struct String *ret = AllocFromHeap(heapId, length * 2 + 10); + if (ret != NULL) { + ret->magic = STR16_MAGIC; ret->maxsize = (u16)length; - ret->size = 0; + ret->size = 0; ret->data[0] = EOS; } return ret; } -void String_Delete(struct String * str) -{ +void String_Delete(struct String *str) { ASSERT_STR16(str); str->magic = STR16_MAGIC | 1; FreeToHeap(str); } -void String_SetEmpty(struct String * str) -{ +void String_SetEmpty(struct String *str) { ASSERT_STR16(str); - str->size = 0; + str->size = 0; str->data[0] = EOS; } -void StringCopy(struct String * dest, struct String * src) -{ +void StringCopy(struct String *dest, struct String *src) { ASSERT_STR16(dest); ASSERT_STR16(src); - if (dest->maxsize > src->size) - { + if (dest->maxsize > src->size) { memcpy(dest->data, src->data, (u32)((src->size + 1) * 2)); dest->size = src->size; return; @@ -45,25 +40,22 @@ void StringCopy(struct String * dest, struct String * src) GF_ASSERT(0); } -struct String * StringDup(struct String * src, HeapID heapId) -{ +struct String *StringDup(struct String *src, HeapID heapId) { ASSERT_STR16(src); - struct String * dest = String_New((u32)(src->size + 1), heapId); - if (dest != NULL) + struct String *dest = String_New((u32)(src->size + 1), heapId); + if (dest != NULL) { StringCopy(dest, src); + } return dest; } -void String16_FormatInteger(struct String * str, int num, u32 ndigits, enum PrintingMode printingMode, BOOL whichCharset) -{ +void String16_FormatInteger(struct String *str, int num, u32 ndigits, enum PrintingMode printingMode, BOOL whichCharset) { static const u16 sCharset_EN[10] = { - 0x121, 0x122, 0x123, 0x124, 0x125, - 0x126, 0x127, 0x128, 0x129, 0x12A + 0x121, 0x122, 0x123, 0x124, 0x125, 0x126, 0x127, 0x128, 0x129, 0x12A }; static const u16 sCharset_JP[10] = { - 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, - 0xA7, 0xA8, 0xA9, 0xAA, 0xAB + 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB }; static const u32 sPowersOfTen[10] = { @@ -81,38 +73,30 @@ void String16_FormatInteger(struct String * str, int num, u32 ndigits, enum Prin ASSERT_STR16(str); - const u16 * charbase; + const u16 *charbase; BOOL isNegative = (num < 0); - if (str->maxsize > ndigits + isNegative) - { + if (str->maxsize > ndigits + isNegative) { charbase = (whichCharset == 0) ? sCharset_JP : sCharset_EN; String_SetEmpty(str); - if (isNegative) - { + if (isNegative) { num *= -1; - u16 hyphen = (u16)((whichCharset == 0) ? 0x00F1 : 0x01BE); + u16 hyphen = (u16)((whichCharset == 0) ? 0x00F1 : 0x01BE); str->data[str->size++] = hyphen; } u32 dividend = sPowersOfTen[ndigits - 1]; - while (dividend != 0) - { + while (dividend != 0) { u16 digit = (u16)(num / dividend); num -= dividend * digit; - if (printingMode == PRINTING_MODE_LEADING_ZEROS) - { - u16 value = (u16)((digit < 10) ? charbase[digit] : 0x00E2); + if (printingMode == PRINTING_MODE_LEADING_ZEROS) { + u16 value = (u16)((digit < 10) ? charbase[digit] : 0x00E2); str->data[str->size++] = value; - } - else if (digit != 0 || dividend == 1) - { - printingMode = PRINTING_MODE_LEADING_ZEROS; - u16 value = (u16)((digit < 10) ? charbase[digit] : 0x00E2); + } else if (digit != 0 || dividend == 1) { + printingMode = PRINTING_MODE_LEADING_ZEROS; + u16 value = (u16)((digit < 10) ? charbase[digit] : 0x00E2); str->data[str->size++] = value; - } - else if (printingMode == PRINTING_MODE_RIGHT_ALIGN) - { - u16 value = (u16)((whichCharset == 0) ? 0x0001 : 0x01E2); + } else if (printingMode == PRINTING_MODE_RIGHT_ALIGN) { + u16 value = (u16)((whichCharset == 0) ? 0x0001 : 0x01E2); str->data[str->size++] = value; } dividend /= 10; @@ -123,24 +107,20 @@ void String16_FormatInteger(struct String * str, int num, u32 ndigits, enum Prin GF_ASSERT(FALSE); } -s64 String_atoi(struct String * str, BOOL * flag) -{ - s64 ret = 0; +s64 String_atoi(struct String *str, BOOL *flag) { + s64 ret = 0; s64 pow10 = 1; - if (str->size > 18) - { + if (str->size > 18) { return 0; } int ndigits = str->size - 1; while (ndigits >= 0) { // 0 s64 digit = str->data[ndigits] - 0x00A2; - if (digit >= 10ull) - { + if (digit >= 10ull) { // 0 digit = str->data[ndigits] - 0x0121; - if (digit >= 10ull) - { + if (digit >= 10ull) { *flag = FALSE; return ret; } @@ -154,73 +134,63 @@ s64 String_atoi(struct String * str, BOOL * flag) return ret; } -BOOL String_Compare(struct String * str1, struct String * str2) -{ +BOOL String_Compare(struct String *str1, struct String *str2) { ASSERT_STR16(str1); ASSERT_STR16(str2); - for (int i = 0; str1->data[i] == str2->data[i]; i++) - { - if (str1->data[i] == EOS) + for (int i = 0; str1->data[i] == str2->data[i]; i++) { + if (str1->data[i] == EOS) { return FALSE; + } } return TRUE; } -u16 StringGetLength(struct String * str) -{ +u16 StringGetLength(struct String *str) { ASSERT_STR16(str); return str->size; } -int StringCountLines(volatile struct String * str) -{ +int StringCountLines(volatile struct String *str) { ASSERT_STR16(str); int i, nline; - for (i = 0, nline = 1; i < str->size; i++) - { - if (str->data[i] == CHAR_LF) + for (i = 0, nline = 1; i < str->size; i++) { + if (str->data[i] == CHAR_LF) { nline++; + } } return nline; } -void StringGetLineN(struct String * dest, volatile struct String * src, u32 n) -{ +void StringGetLineN(struct String *dest, volatile struct String *src, u32 n) { ASSERT_STR16(src); ASSERT_STR16(dest); int i = 0; - if (n != 0) - { - for (i = 0; i < src->size; i++) - { - if (src->data[i] == CHAR_LF && --n == 0) - { + if (n != 0) { + for (i = 0; i < src->size; i++) { + if (src->data[i] == CHAR_LF && --n == 0) { i++; break; } } } String_SetEmpty(dest); - for (; i < src->size; i++) - { + for (; i < src->size; i++) { u16 c = src->data[i]; - if (c == CHAR_LF) + if (c == CHAR_LF) { break; + } StrAddChar(dest, c); } } -void CopyU16ArrayToString(struct String * str, u16 * buf) -{ +void CopyU16ArrayToString(struct String *str, u16 *buf) { ASSERT_STR16(str); - for (str->size = 0; *buf != EOS;) - { - if (str->size >= str->maxsize - 1) - { + for (str->size = 0; *buf != EOS;) { + if (str->size >= str->maxsize - 1) { GF_ASSERT(0); break; } @@ -229,22 +199,19 @@ void CopyU16ArrayToString(struct String * str, u16 * buf) str->data[str->size] = EOS; } -void CopyU16ArrayToStringN(struct String * str, u16 * buf, u32 length) -{ +void CopyU16ArrayToStringN(struct String *str, u16 *buf, u32 length) { ASSERT_STR16(str); - if (length <= str->maxsize) - { + if (length <= str->maxsize) { memcpy(str->data, buf, length * 2); int i; - for (i = 0; i < length; i++) - { - if (str->data[i] == EOS) + for (i = 0; i < length; i++) { + if (str->data[i] == EOS) { break; + } } str->size = (u16)i; - if (i == length) - { + if (i == length) { str->data[length - 1] = EOS; } return; @@ -252,32 +219,27 @@ void CopyU16ArrayToStringN(struct String * str, u16 * buf, u32 length) GF_ASSERT(0); } -void CopyStringToU16Array(struct String * str, u16 * buf, u32 length) -{ +void CopyStringToU16Array(struct String *str, u16 *buf, u32 length) { ASSERT_STR16(str); - if (str->size + 1 <= length) - { + if (str->size + 1 <= length) { memcpy(buf, str->data, (u32)((str->size + 1) * 2)); return; } GF_ASSERT(0); } -u16 * String_c_str(struct String * str) -{ +u16 *String_c_str(struct String *str) { ASSERT_STR16(str); return str->data; } -void StringCat(struct String * dest, struct String * src) -{ +void StringCat(struct String *dest, struct String *src) { ASSERT_STR16(dest); ASSERT_STR16(src); - if (dest->size + src->size + 1 <= dest->maxsize) - { + if (dest->size + src->size + 1 <= dest->maxsize) { memcpy(dest->data + dest->size, src->data, (u32)(2 * (src->size + 1))); dest->size += src->size; return; @@ -285,68 +247,60 @@ void StringCat(struct String * dest, struct String * src) GF_ASSERT(0); } -void StrAddChar(struct String * str, u16 val) -{ +void StrAddChar(struct String *str, u16 val) { ASSERT_STR16(str); - if (str->size + 1 < str->maxsize) - { + if (str->size + 1 < str->maxsize) { str->data[str->size++] = val; - str->data[str->size] = EOS; + str->data[str->size] = EOS; return; } GF_ASSERT(0); } -void StrUpperFirstChar(struct String * str) -{ +void StrUpperFirstChar(struct String *str) { ASSERT_STR16(str); - if (str->size != 0) - { + if (str->size != 0) { // a z - if (str->data[0] >= 0x0145 && str->data[0] <= 0x015E) + if (str->data[0] >= 0x0145 && str->data[0] <= 0x015E) { // (a - A) str->data[0] -= 26; + } } } -BOOL String_IsTrainerName(struct String * string) -{ +BOOL String_IsTrainerName(struct String *string) { return string->size != 0 && string->data[0] == 0xF100; } -void StringCat_HandleTrainerName(struct String * dest, struct String * src) -{ - if (String_IsTrainerName(src)) - { - u16 * dest_p = &dest->data[dest->size]; - u16 * src_p = &src->data[1]; - s32 bit = 0; - u32 outsize = 0; +void StringCat_HandleTrainerName(struct String *dest, struct String *src) { + if (String_IsTrainerName(src)) { + u16 *dest_p = &dest->data[dest->size]; + u16 *src_p = &src->data[1]; + s32 bit = 0; + u32 outsize = 0; u16 cur_char = 0; - while (1) - { + while (1) { cur_char = (u16)((*src_p >> bit) & 0x1FF); bit += 9; - if (bit >= 15) - { + if (bit >= 15) { src_p++; bit -= 15; - if (bit != 0) - { + if (bit != 0) { cur_char |= (*src_p << (9 - bit)) & 0x1FF; } } - if (cur_char == 0x1FF) + if (cur_char == 0x1FF) { break; + } *dest_p++ = cur_char; outsize++; } *dest_p = EOS; dest->size += outsize; - } - else + } else { StringCat(dest, src); + } } diff --git a/arm9/src/unk_02021FF8.c b/arm9/src/unk_02021FF8.c index 746d1d566..fb51d3924 100644 --- a/arm9/src/unk_02021FF8.c +++ b/arm9/src/unk_02021FF8.c @@ -1,30 +1,26 @@ +#include "unk_02021FF8.h" + #include "global.h" -#include "string16.h" + #include "heap.h" -#include "unk_02021FF8.h" +#include "string16.h" -struct UnkStruct_020220C4 * sub_020220C4(u8 * a0, u32 a1, void (*a2)(s32, s32, u32), u32 a3, HeapID heapId) -{ - struct UnkStruct_020220C4 * ret; +struct UnkStruct_020220C4 *sub_020220C4(u8 *a0, u32 a1, void (*a2)(s32, s32, u32), u32 a3, HeapID heapId) { + struct UnkStruct_020220C4 *ret; s32 i; GF_ASSERT(a1 != 0); ret = AllocFromHeap(heapId, sizeof(struct UnkStruct_020220C4)); - if (ret != NULL) - { - ret->field_0 = a0; - ret->field_4 = a1; - ret->field_8 = a2; - ret->field_C = a3; + if (ret != NULL) { + ret->field_0 = a0; + ret->field_4 = a1; + ret->field_8 = a2; + ret->field_C = a3; ret->field_10 = AllocFromHeap(heapId, a1 * sizeof(struct UnkStruct_020220C4_sub)); - if (ret->field_10 != NULL) - { - for (i = 0; i < a1; i++) - { + if (ret->field_10 != NULL) { + for (i = 0; i < a1; i++) { sub_02022120(&ret->field_10[i]); } - } - else - { + } else { FreeToHeap(ret); ret = NULL; } @@ -32,15 +28,13 @@ struct UnkStruct_020220C4 * sub_020220C4(u8 * a0, u32 a1, void (*a2)(s32, s32, u return ret; } -void sub_02022120(struct UnkStruct_020220C4_sub * sub) -{ +void sub_02022120(struct UnkStruct_020220C4_sub *sub) { sub->field_0 = 0; sub->field_1 = 0; sub->field_2 = 0; } -void sub_0202212C(struct UnkStruct_020220C4 * unk) -{ +void sub_0202212C(struct UnkStruct_020220C4 *unk) { GF_ASSERT(unk != NULL); FreeToHeap(unk->field_10); FreeToHeap(unk); @@ -48,77 +42,61 @@ void sub_0202212C(struct UnkStruct_020220C4 * unk) extern u16 sub_02020A98(void); extern u16 sub_02020AA4(void); -extern u8 sub_02020A40(u8 * a0); -extern u8 sub_02020A6C(u8 * a0); +extern u8 sub_02020A40(u8 *a0); +extern u8 sub_02020A6C(u8 *a0); -s32 (*const UNK_020EE6CC[])(struct UnkStruct_020220C4_sub * a0, u32 a1, u32 a2) = { +s32 (*const UNK_020EE6CC[])(struct UnkStruct_020220C4_sub *a0, u32 a1, u32 a2) = { sub_020221EC, sub_02022208 }; -void sub_02022144(struct UnkStruct_020220C4 * unk) -{ +void sub_02022144(struct UnkStruct_020220C4 *unk) { u32 sp4; u32 sp0 = sub_02020A98(); s32 i; s32 r1; - if (sp0 != 0) - { + if (sp0 != 0) { sp4 = sub_02020AA4(); - for (i = 0; i < unk->field_4; i++) - { + for (i = 0; i < unk->field_4; i++) { u8 res; - if (unk->field_10[i].field_1 != 0) - { + if (unk->field_10[i].field_1 != 0) { res = sub_02020A40(&unk->field_0[4 * i]); - } - else - { + } else { res = sub_02020A6C(&unk->field_0[4 * i]); } unk->field_10[i].field_1 = res; } - } - else - { + } else { sp4 = 0; - for (i = 0; i < unk->field_4; i++) - { + for (i = 0; i < unk->field_4; i++) { unk->field_10[i].field_1 = 0; } } - for (i = 0; i < unk->field_4; i++) - { + for (i = 0; i < unk->field_4; i++) { r1 = UNK_020EE6CC[unk->field_10[i].field_0](&unk->field_10[i], sp0, sp4); - if (r1 != -1) - { + if (r1 != -1) { unk->field_8(i, r1, unk->field_C); } } } -s32 sub_020221EC(struct UnkStruct_020220C4_sub * a0, u32 a1, u32 a2) -{ +s32 sub_020221EC(struct UnkStruct_020220C4_sub *a0, u32 a1, u32 a2) { #pragma unused(a1) - if (a0->field_1 && a2) - { + if (a0->field_1 && a2) { sub_0202223C(a0, 1); return 0; } return -1; } -s32 sub_02022208(struct UnkStruct_020220C4_sub * a0, u32 a1, u32 a2) -{ +s32 sub_02022208(struct UnkStruct_020220C4_sub *a0, u32 a1, u32 a2) { #pragma unused(a2) - if (a0->field_1) - { - if (a0->field_2 < 0xFFFF) + if (a0->field_1) { + if (a0->field_2 < 0xFFFF) { a0->field_2++; + } return 2; - } - else if (a1) - { + } else if (a1) { sub_0202223C(a0, 0); return 3; } @@ -126,9 +104,7 @@ s32 sub_02022208(struct UnkStruct_020220C4_sub * a0, u32 a1, u32 a2) return 1; } -void sub_0202223C(struct UnkStruct_020220C4_sub * a0, u8 a1) -{ +void sub_0202223C(struct UnkStruct_020220C4_sub *a0, u8 a1) { a0->field_0 = a1; a0->field_2 = 0; } - diff --git a/arm9/src/unk_020222E8.c b/arm9/src/unk_020222E8.c index df9991009..782536dfc 100644 --- a/arm9/src/unk_020222E8.c +++ b/arm9/src/unk_020222E8.c @@ -1,34 +1,29 @@ -#include "global.h" #include "unk_020222E8.h" + +#include "global.h" + #include "mmap.h" -void * sub_020222E8() -{ +void *sub_020222E8() { return (void *)HW_BG_PLTT; } -u32 sub_020222F0() -{ +u32 sub_020222F0() { return HW_BG_PLTT_SIZE; } -void * sub_020222F8() -{ +void *sub_020222F8() { return (void *)HW_DB_BG_PLTT; } -u32 sub_02022300() -{ +u32 sub_02022300() { return HW_DB_BG_PLTT_SIZE; } -void * sub_02022308() -{ +void *sub_02022308() { return (void *)HW_OBJ_PLTT; } -void * sub_02022310() -{ +void *sub_02022310() { return (void *)HW_DB_OBJ_PLTT; } - diff --git a/arm9/src/unk_02022450.c b/arm9/src/unk_02022450.c index 96239e641..e7096bbe1 100644 --- a/arm9/src/unk_02022450.c +++ b/arm9/src/unk_02022450.c @@ -1,49 +1,49 @@ +#include "unk_02022450.h" + #include "global.h" -#include "FS_file.h" -#include "OS_terminate_proc.h" + #include "CARD_rom.h" +#include "FS_file.h" #include "MI_memory.h" - -#include "unk_02022450.h" +#include "OS_terminate_proc.h" static inline u32 GetBakRomCode(void) { - return ((CARDRomHeader*)HW_MAIN_MEM_SHARED)->game_code; + return ((CARDRomHeader *)HW_MAIN_MEM_SHARED)->game_code; } static inline void SetBakRomCode(u32 newCode) { - ((CARDRomHeader*)HW_MAIN_MEM_SHARED)->game_code = newCode; + ((CARDRomHeader *)HW_MAIN_MEM_SHARED)->game_code = newCode; } static inline u16 GetBakRomMaker(void) { - return ((CARDRomHeader*)HW_MAIN_MEM_SHARED)->maker_code; + return ((CARDRomHeader *)HW_MAIN_MEM_SHARED)->maker_code; } static const char arc_name[] = "rom"; // Multichar constants are encoded big-endian, // but this is a little-endian machine. -#define ROM_CODE_ADAJ_BE 'JADA' -#define MAKER_CODE_01_BE '10' +#define ROM_CODE_ADAJ_BE 'JADA' +#define MAKER_CODE_01_BE '10' /*Replacing (HW_MAIN_MEM_SHARED + 0xC) or (HW_MAIN_MEM_SHARED + 0x10) or defining ADAJ or 01 constants causes match failure*/ void sub_02022450() { if (!FS_IsAvailable()) { OS_Terminate(); - } - else { - CARDRomHeader* card_header_buffer = (CARDRomHeader*)HW_MAIN_MEM_SHARED; - + } else { + CARDRomHeader *card_header_buffer = (CARDRomHeader *)HW_MAIN_MEM_SHARED; + if (GetBakRomCode() == 0) { CARD_Init(); - MI_CpuCopy8((u8*)HW_ROM_HEADER_BUF, (u8*)card_header_buffer, HW_CARD_ROM_HEADER_SIZE); - MI_CpuCopy8((u8*)HW_ROM_HEADER_BUF, (u8*)HW_CARD_ROM_HEADER, HW_CARD_ROM_HEADER_SIZE); + MI_CpuCopy8((u8 *)HW_ROM_HEADER_BUF, (u8 *)card_header_buffer, HW_CARD_ROM_HEADER_SIZE); + MI_CpuCopy8((u8 *)HW_ROM_HEADER_BUF, (u8 *)HW_CARD_ROM_HEADER, HW_CARD_ROM_HEADER_SIZE); SetBakRomCode(ROM_CODE_ADAJ_BE); } - FSArchive * const r0 = FS_FindArchive(arc_name, 3); - r0->fat = card_header_buffer->fat.offset; - r0->fat_size = card_header_buffer->fat.length; - r0->fnt = card_header_buffer->fnt.offset; - r0->fnt_size = card_header_buffer->fnt.length; + FSArchive *const r0 = FS_FindArchive(arc_name, 3); + r0->fat = card_header_buffer->fat.offset; + r0->fat_size = card_header_buffer->fat.length; + r0->fnt = card_header_buffer->fnt.offset; + r0->fnt_size = card_header_buffer->fnt.length; if (GetBakRomCode() != ROM_CODE_ADAJ_BE || GetBakRomMaker() != MAKER_CODE_01_BE) { OS_Terminate(); } @@ -51,11 +51,11 @@ void sub_02022450() { return; } -void Reset_To_File(const char* path) { +void Reset_To_File(const char *path) { FSFile file; FS_InitFile(&file); if (FS_OpenFile(&file, path)) { - *(u32*)HW_ROM_BASE_OFFSET_BUF = file.prop.file.top; + *(u32 *)HW_ROM_BASE_OFFSET_BUF = file.prop.file.top; OS_ResetSystem(0); } return; diff --git a/arm9/src/unk_02022504.c b/arm9/src/unk_02022504.c index e99a01913..36e1ec87e 100644 --- a/arm9/src/unk_02022504.c +++ b/arm9/src/unk_02022504.c @@ -1,33 +1,29 @@ +#include "unk_02022504.h" + #include "global.h" + #include "constants/save_arrays.h" -#include "unk_02022504.h" -SafariZone *Save_SafariZone_Get(struct SaveData *save) -{ +SafariZone *Save_SafariZone_Get(struct SaveData *save) { return SaveArray_Get(save, SAVE_SAFARI_ZONE); } -struct PCStorage *SaveArray_PCStorage_Get(struct SaveData *save) -{ +struct PCStorage *SaveArray_PCStorage_Get(struct SaveData *save) { return SaveArray_Get(save, 35); } -struct UnkStruct_0202AC20 * sub_0202251C(struct SaveData *save) -{ +struct UnkStruct_0202AC20 *sub_0202251C(struct SaveData *save) { return SaveArray_Get(save, 31); } -void *sub_02022528(struct SaveData *save) -{ +void *sub_02022528(struct SaveData *save) { return SaveArray_Get(save, 32); } -HallOfFame *LoadHallOfFame(struct SaveData *save, HeapID heapId, int *ret_p) -{ +HallOfFame *LoadHallOfFame(struct SaveData *save, HeapID heapId, int *ret_p) { return (HallOfFame *)ReadSaveFileFromFlash(save, heapId, 0, ret_p); } -s32 SaveHallOfFame(struct SaveData *save, HallOfFame *data) -{ +s32 SaveHallOfFame(struct SaveData *save, HallOfFame *data) { return WriteSaveFileToFlash(save, 0, (u8 *)data); } diff --git a/arm9/src/unk_02024E64.c b/arm9/src/unk_02024E64.c index 34278a9fa..2f91ba534 100644 --- a/arm9/src/unk_02024E64.c +++ b/arm9/src/unk_02024E64.c @@ -1,16 +1,15 @@ -#include "global.h" #include "unk_02024E64.h" +#include "global.h" + extern void sub_020250A4(void *param0); extern void sub_02025484(void *param0); -u32 sub_02024E64() -{ +u32 sub_02024E64() { return sizeof(struct UnkStruct_02024E64); } -void sub_02024E6C(struct UnkStruct_02024E64 *param0) -{ +void sub_02024E6C(struct UnkStruct_02024E64 *param0) { MI_CpuClearFast(param0, sizeof(struct UnkStruct_02024E64)); sub_020250A4(param0->unk0); @@ -21,43 +20,35 @@ void sub_02024E6C(struct UnkStruct_02024E64 *param0) MI_CpuFill16(param0->unk734, EOS, sizeof(param0->unk734) / sizeof(u16)); } -struct UnkStruct_02024E64 *sub_02024EB4(struct SaveData *save) -{ +struct UnkStruct_02024E64 *sub_02024EB4(struct SaveData *save) { return SaveArray_Get(save, 0xa); } -void *sub_02024EC0(struct SaveData *save) -{ +void *sub_02024EC0(struct SaveData *save) { return sub_02022634(save, 0xa); } -struct UnkStruct_02024E64 *sub_02024ECC(struct SaveData *save) -{ +struct UnkStruct_02024E64 *sub_02024ECC(struct SaveData *save) { return SaveArray_Get(save, 0xa); } -void *sub_02024ED8(struct SaveData *save) -{ +void *sub_02024ED8(struct SaveData *save) { struct UnkStruct_02024E64 *res = SaveArray_Get(save, 0xa); return res->unk700; } -u16 *GetRivalNamePtr(struct UnkStruct_02024E64 *unk) -{ +u16 *GetRivalNamePtr(struct UnkStruct_02024E64 *unk) { return unk->rival_name_buf; } -void RivalsNameToU16Array(struct UnkStruct_02024E64 *unk, struct String *str) -{ +void RivalsNameToU16Array(struct UnkStruct_02024E64 *unk, struct String *str) { CopyStringToU16Array(str, unk->rival_name_buf, sizeof(unk->rival_name_buf) / sizeof(u16)); } -u16 *sub_02024F0C(struct UnkStruct_02024E64 *unk) -{ +u16 *sub_02024F0C(struct UnkStruct_02024E64 *unk) { return unk->unk734; } -void sub_02024F18(struct UnkStruct_02024E64 *unk, struct String *str) -{ +void sub_02024F18(struct UnkStruct_02024E64 *unk, struct String *str) { CopyStringToU16Array(str, unk->unk734, sizeof(unk->unk734) / sizeof(u16)); } diff --git a/arm9/src/unk_02025484.c b/arm9/src/unk_02025484.c index b5866c75a..9497c6d10 100644 --- a/arm9/src/unk_02025484.c +++ b/arm9/src/unk_02025484.c @@ -1,27 +1,25 @@ +#include "unk_02025484.h" + #include "global.h" + #include "MI_memory.h" #include "error_handling.h" -#include "unk_02025484.h" -void sub_02025484(struct unk_2025484 *r0) -{ +void sub_02025484(struct unk_2025484 *r0) { MI_CpuFill8(r0, 0, sizeof(struct unk_2025484)); } -u32 *sub_02025490(struct unk_2025484 *r0, u32 r1) -{ +u32 *sub_02025490(struct unk_2025484 *r0, u32 r1) { sub_02025484(r0); r0->unk0 = r1; return &r0->unk4; } -u32 *sub_020254A0(struct unk_2025484 *r0, u32 r1) -{ +u32 *sub_020254A0(struct unk_2025484 *r0, u32 r1) { GF_ASSERT(r0->unk0 == r1); return &r0->unk4; } -u32 sub_020254B4(struct unk_2025484 *r0) -{ +u32 sub_020254B4(struct unk_2025484 *r0) { return r0->unk0; } diff --git a/arm9/src/unk_020254B8.c b/arm9/src/unk_020254B8.c index 46a351a39..38a2b9afc 100644 --- a/arm9/src/unk_020254B8.c +++ b/arm9/src/unk_020254B8.c @@ -1,50 +1,44 @@ +#include "unk_020254B8.h" + #include "global.h" -#include "string_util.h" -#include "save.h" + #include "heap.h" -#include "unk_020254B8.h" +#include "save.h" +#include "string_util.h" -u32 sub_020254B8(void) -{ +u32 sub_020254B8(void) { return 16 * sizeof(struct UnkStruct_020254B8); } -struct UnkStruct_020254B8 * sub_020254C0(struct SaveData * save) -{ +struct UnkStruct_020254B8 *sub_020254C0(struct SaveData *save) { return (struct UnkStruct_020254B8 *)SaveArray_Get(save, 9); } -void sub_020254CC(struct UnkStruct_020254B8 * arr) -{ +void sub_020254CC(struct UnkStruct_020254B8 *arr) { s32 i; - for (i = 0; i < 16; i++) - { + for (i = 0; i < 16; i++) { memset(&arr[i], 0, sizeof(struct UnkStruct_020254B8)); arr[i].field_00[0] = EOS; } } -u16 * sub_020254F0(struct UnkStruct_020254B8 * arr, s32 i) -{ +u16 *sub_020254F0(struct UnkStruct_020254B8 *arr, s32 i) { return arr[i].field_00; } -u8 sub_020254F8(struct UnkStruct_020254B8 * unk, s32 i) -{ +u8 sub_020254F8(struct UnkStruct_020254B8 *unk, s32 i) { return unk->field_68[i]; } -BOOL sub_02025500(struct UnkStruct_020254B8 * a, struct UnkStruct_020254B8 * b) -{ +BOOL sub_02025500(struct UnkStruct_020254B8 *a, struct UnkStruct_020254B8 *b) { return !StringNotEqual(a->field_00, b->field_00) && a->field_10 == b->field_10; } -void sub_02025520(struct UnkStruct_020254B8 * sp0, struct UnkStruct_020254B8 * sp4, s32 n, HeapID heapId) -{ +void sub_02025520(struct UnkStruct_020254B8 *sp0, struct UnkStruct_020254B8 *sp4, s32 n, HeapID heapId) { s32 sp18[5]; s32 sp14; - struct UnkStruct_020254B8 * sp10; + struct UnkStruct_020254B8 *sp10; s32 r12; s32 spC; s32 r4; @@ -55,35 +49,33 @@ void sub_02025520(struct UnkStruct_020254B8 * sp0, struct UnkStruct_020254B8 * s sub_020254CC(sp10); // Look up each element of sp4 in sp0 - for (sp14 = 0; sp14 < n; sp14++) - { + for (sp14 = 0; sp14 < n; sp14++) { sp18[sp14] = -1; - for (r4_2 = 0; r4_2 < 16; r4_2++) - { - if (sub_02025500(&sp0[r4_2], &sp4[sp14])) + for (r4_2 = 0; r4_2 < 16; r4_2++) { + if (sub_02025500(&sp0[r4_2], &sp4[sp14])) { sp18[sp14] = r4_2; + } } } // Copy sp4 to buffer and mask matching entries in sp0 r4 = 0; - for (spC = 0; spC < n; spC++) - { + for (spC = 0; spC < n; spC++) { sp10[r4] = sp4[spC]; - if (sp18[spC] >= 0) + if (sp18[spC] >= 0) { sp0[sp18[spC]].field_00[0] = EOS; + } r4++; } // Copy unmasked entries from sp0 to buffer - for (r12 = 0; r12 < 16; r12++) - { - if (sp0[r12].field_00[0] != EOS) - { + for (r12 = 0; r12 < 16; r12++) { + if (sp0[r12].field_00[0] != EOS) { sp10[r4] = sp0[r12]; r4++; - if (r4 >= 16) + if (r4 >= 16) { break; + } } } // Copy buffer to sp0 and destroy buffer @@ -91,21 +83,19 @@ void sub_02025520(struct UnkStruct_020254B8 * sp0, struct UnkStruct_020254B8 * s FreeToHeap(sp10); } -s32 sub_02025614(struct UnkStruct_020254B8 * a0, u32 a1) -{ +s32 sub_02025614(struct UnkStruct_020254B8 *a0, u32 a1) { s32 i, j; - for (i = 0; i < 16; i++) - { - if (a1 == a0[i].field_10) + for (i = 0; i < 16; i++) { + if (a1 == a0[i].field_10) { return 1; + } } - for (i = 0; i < 16; i++) - { - for (j = 0; j < 16; j++) - { - if (a1 == a0[i].field_18[j]) + for (i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) { + if (a1 == a0[i].field_18[j]) { return i + 2; + } } } return 0; diff --git a/arm9/src/unk_020286F8.c b/arm9/src/unk_020286F8.c index 3d67fda4b..5ca69c6e5 100644 --- a/arm9/src/unk_020286F8.c +++ b/arm9/src/unk_020286F8.c @@ -1,147 +1,136 @@ +#include "unk_020286F8.h" + #include "global.h" -#include "save.h" + #include "MI_memory.h" -#include "string_util.h" #include "math_util.h" +#include "save.h" #include "string16.h" -#include "unk_020286F8.h" +#include "string_util.h" -struct UnkSaveStruct_020286F8 * UNK_021C59D0; +struct UnkSaveStruct_020286F8 *UNK_021C59D0; -u32 sub_020286F8(void) -{ +u32 sub_020286F8(void) { return 6 * sizeof(struct UnkSaveStruct_020286F8); } -void sub_02028700(struct UnkSaveStruct_020286F8 * ptr, int a, int b) -{ +void sub_02028700(struct UnkSaveStruct_020286F8 *ptr, int a, int b) { ptr[b] = ptr[a]; } -void sub_02028724(struct UnkSaveStruct_020286F8 * ptr) -{ +void sub_02028724(struct UnkSaveStruct_020286F8 *ptr) { MI_CpuClearFast(ptr, 6 * sizeof(struct UnkSaveStruct_020286F8)); - for (int i = 0; i < 6; i++) - { - ptr[i].unk_0[0] = EOS; + for (int i = 0; i < 6; i++) { + ptr[i].unk_0[0] = EOS; ptr[i].unk_10[0] = EOS; } UNK_021C59D0 = ptr; } -void sub_02028754(struct UnkSaveStruct_020286F8 * ptr, u32 n) -{ +void sub_02028754(struct UnkSaveStruct_020286F8 *ptr, u32 n) { u32 i, j; - for (i = 0; i < 6; i++) - { - for (j = 0; j < n; j++) - { + for (i = 0; i < 6; i++) { + for (j = 0; j < n; j++) { ptr[i].unk_28 = PRandom(ptr[i].unk_28); } } } -u32 sub_0202877C(struct UnkSaveStruct_020286F8 * ptr, u32 i) -{ +u32 sub_0202877C(struct UnkSaveStruct_020286F8 *ptr, u32 i) { return ptr[i].unk_24; } -void sub_02028788(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j) -{ +void sub_02028788(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j) { ptr[i].unk_24 = j; ptr[i].unk_28 = PRandom(j); } -u32 sub_020287A4(struct UnkSaveStruct_020286F8 * ptr) -{ +u32 sub_020287A4(struct UnkSaveStruct_020286F8 *ptr) { return ptr[1].unk_28; } -u16 * sub_020287A8(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j) -{ - if (j == 0) +u16 *sub_020287A8(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j) { + if (j == 0) { return ptr[i].unk_0; - else + } else { return ptr[i].unk_10; + } } -void sub_020287C0(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j, struct String * k) -{ - if (j == 0) +void sub_020287C0(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j, struct String *k) { + if (j == 0) { CopyStringToU16Array(k, ptr[i].unk_0, 8); - else + } else { CopyStringToU16Array(k, ptr[i].unk_10, 8); + } } -void sub_020287EC(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j) -{ +void sub_020287EC(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j) { ptr[i].unk_20 = (u8)j; } -u8 sub_020287F8(struct UnkSaveStruct_020286F8 * ptr, u32 i) -{ +u8 sub_020287F8(struct UnkSaveStruct_020286F8 *ptr, u32 i) { return ptr[i].unk_20; } -u8 sub_02028804(struct UnkSaveStruct_020286F8 * ptr, u32 i) -{ +u8 sub_02028804(struct UnkSaveStruct_020286F8 *ptr, u32 i) { return ptr[i].unk_21; } -void sub_02028810(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j) -{ +void sub_02028810(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j) { ptr[i].unk_21 = (u8)j; } -struct UnkSaveStruct_020286F8 * sub_0202881C(struct SaveData * save) -{ +struct UnkSaveStruct_020286F8 *sub_0202881C(struct SaveData *save) { return (struct UnkSaveStruct_020286F8 *)SaveArray_Get(save, 17); } -BOOL sub_0202888C(struct UnkSaveStruct_020286F8 * ptr); +BOOL sub_0202888C(struct UnkSaveStruct_020286F8 *ptr); -BOOL sub_02028828(struct UnkSaveStruct_020286F8 * ptr, u32 i) -{ +BOOL sub_02028828(struct UnkSaveStruct_020286F8 *ptr, u32 i) { return !sub_0202888C(&ptr[i]); } -BOOL sub_020288AC(struct UnkSaveStruct_020286F8 * ptr, struct UnkSaveStruct_020286F8 * ptr2); +BOOL sub_020288AC(struct UnkSaveStruct_020286F8 *ptr, struct UnkSaveStruct_020286F8 *ptr2); -BOOL sub_02028840(struct UnkSaveStruct_020286F8 * ptr, int i) -{ +BOOL sub_02028840(struct UnkSaveStruct_020286F8 *ptr, int i) { return sub_020288AC(&ptr[1], &ptr[i]); } -BOOL sub_02028854(struct UnkSaveStruct_020286F8 * ptr, const u16 * str) -{ - if (str[0] == EOS) +BOOL sub_02028854(struct UnkSaveStruct_020286F8 *ptr, const u16 *str) { + if (str[0] == EOS) { return FALSE; - for (int i = 0; i < 6; i++) - { - if (!StringNotEqualN(str, ptr[i].unk_0, 8)) + } + for (int i = 0; i < 6; i++) { + if (!StringNotEqualN(str, ptr[i].unk_0, 8)) { return TRUE; + } } return FALSE; } -BOOL sub_0202888C(struct UnkSaveStruct_020286F8 * ptr) -{ - if (ptr->unk_0[0] == EOS) +BOOL sub_0202888C(struct UnkSaveStruct_020286F8 *ptr) { + if (ptr->unk_0[0] == EOS) { return TRUE; - if (ptr->unk_10[0] == EOS) + } + if (ptr->unk_10[0] == EOS) { return TRUE; + } return FALSE; } -BOOL sub_020288AC(struct UnkSaveStruct_020286F8 * ptr, struct UnkSaveStruct_020286F8 * ptr2) -{ - if (StringNotEqualN(ptr->unk_10, ptr2->unk_10, 8)) +BOOL sub_020288AC(struct UnkSaveStruct_020286F8 *ptr, struct UnkSaveStruct_020286F8 *ptr2) { + if (StringNotEqualN(ptr->unk_10, ptr2->unk_10, 8)) { return FALSE; - if (StringNotEqualN(ptr->unk_0, ptr2->unk_0, 8)) + } + if (StringNotEqualN(ptr->unk_0, ptr2->unk_0, 8)) { return FALSE; - if (ptr->unk_20 != ptr2->unk_20) + } + if (ptr->unk_20 != ptr2->unk_20) { return FALSE; - if (ptr->unk_21 != ptr2->unk_21) + } + if (ptr->unk_21 != ptr2->unk_21) { return FALSE; + } return ptr->unk_24 == ptr2->unk_24; } diff --git a/arm9/src/unk_02029FB0.c b/arm9/src/unk_02029FB0.c index a2191c05c..56d26bd9d 100644 --- a/arm9/src/unk_02029FB0.c +++ b/arm9/src/unk_02029FB0.c @@ -1,6 +1,8 @@ +#include "unk_02029FB0.h" + #include "global.h" + #include "pokedex.h" -#include "unk_02029FB0.h" const u16 UNK_020EEA7C[] = { 0x0001, // 00 @@ -169,189 +171,141 @@ u8 UNK_02105CD8[] = { FALSE, // 121 }; -static inline s32 GetOffsetToUnk00(s32 a0) -{ +static inline s32 GetOffsetToUnk00(s32 a0) { return a0; } -static inline s32 GetOffsetToUnkB0(s32 a0) -{ +static inline s32 GetOffsetToUnkB0(s32 a0) { return a0 - 44; } -u32 Save_GameStats_sizeof(void) -{ +u32 Save_GameStats_sizeof(void) { return sizeof(struct GameStats); } -void Save_GameStats_Init(struct GameStats * ptr) -{ +void Save_GameStats_Init(struct GameStats *ptr) { MI_CpuClear32(ptr, sizeof(struct GameStats)); } -struct GameStats * Save_GameStats_Get(struct SaveData * save) -{ +struct GameStats *Save_GameStats_Get(struct SaveData *save) { return SaveArray_Get(save, 20); } -u32 GameStats_GetValue(struct GameStats * ptr, s32 a1) -{ - if (a1 < 44) - { +u32 GameStats_GetValue(struct GameStats *ptr, s32 a1) { + if (a1 < 44) { return ptr->unk_00[GetOffsetToUnk00(a1)]; - } - else if (a1 < 121) - { + } else if (a1 < 121) { return ptr->unk_B0[GetOffsetToUnkB0(a1)]; - } - else - { + } else { GF_ASSERT(0); return 0; } } -u32 GameStats_SetValue(struct GameStats * ptr, s32 a1, u32 a2) -{ - if (a1 < 44) - { +u32 GameStats_SetValue(struct GameStats *ptr, s32 a1, u32 a2) { + if (a1 < 44) { ptr->unk_00[GetOffsetToUnk00(a1)] = a2; - } - else if (a1 < 121) - { + } else if (a1 < 121) { ptr->unk_B0[GetOffsetToUnkB0(a1)] = a2; - } - else - { + } else { GF_ASSERT(0); } return GameStats_GetValue(ptr, a1); } -u32 GameStats_GetMaxValue(s32 a0) -{ - if (a0 < 44) - { - if (UNK_02105CD8[a0]) +u32 GameStats_GetMaxValue(s32 a0) { + if (a0 < 44) { + if (UNK_02105CD8[a0]) { return 999999999; - else + } else { return 999999; - } - else if (a0 < 121) - { - if (UNK_02105CD8[a0]) + } + } else if (a0 < 121) { + if (UNK_02105CD8[a0]) { return 0xFFFF; - else + } else { return 9999; - } - else - { + } + } else { GF_ASSERT(0); return 0; } } -u16 GameStats_GetStdInc(s32 a0) -{ +u16 GameStats_GetStdInc(s32 a0) { return UNK_020EEA7C[a0]; } -u32 GameStats_SetCapped(struct GameStats * ptr, s32 a1, u32 a2) -{ +u32 GameStats_SetCapped(struct GameStats *ptr, s32 a1, u32 a2) { u32 r2 = GameStats_GetMaxValue(a1); - if (a2 < r2) - { + if (a2 < r2) { return GameStats_SetValue(ptr, a1, a2); - } - else - { + } else { return GameStats_SetValue(ptr, a1, r2); } } -u32 GameStats_UpdateBounded(struct GameStats * ptr, s32 a1, u32 a2) -{ +u32 GameStats_UpdateBounded(struct GameStats *ptr, s32 a1, u32 a2) { u32 r4 = GameStats_GetMaxValue(a1); u32 r0 = GameStats_GetValue(ptr, a1); - if (a2 > r4) - { + if (a2 > r4) { a2 = r4; } - if (r0 < a2) - { + if (r0 < a2) { return GameStats_SetValue(ptr, a1, a2); - } - else if (r0 > r4) - { + } else if (r0 > r4) { return GameStats_SetValue(ptr, a1, r4); - } - else - { + } else { return r0; } } -u32 GameStats_Inc(struct GameStats * ptr, s32 a1) -{ +u32 GameStats_Inc(struct GameStats *ptr, s32 a1) { u32 r4 = GameStats_GetMaxValue(a1); u32 r2 = GameStats_GetValue(ptr, a1) + 1; - if (r2 < r4) - { + if (r2 < r4) { return GameStats_SetValue(ptr, a1, r2); - } - else - { + } else { return GameStats_SetValue(ptr, a1, r4); } } -u32 GameStats_Add(struct GameStats * ptr, s32 a1, u32 a2) -{ +u32 GameStats_Add(struct GameStats *ptr, s32 a1, u32 a2) { u32 r6 = GameStats_GetMaxValue(a1); u32 r2 = GameStats_GetValue(ptr, a1); r2 += a2; - if (r2 < r6) - { + if (r2 < r6) { return GameStats_SetValue(ptr, a1, r2); - } - else - { + } else { return GameStats_SetValue(ptr, a1, r6); } } -u32 GameStats_GetCapped(struct GameStats * ptr, s32 a1) -{ +u32 GameStats_GetCapped(struct GameStats *ptr, s32 a1) { u32 r4 = GameStats_GetMaxValue(a1); u32 r0 = GameStats_GetValue(ptr, a1); - if (r0 <= r4) + if (r0 <= r4) { r4 = r0; + } return r4; } -u32 GameStats_AddSpecial(struct GameStats * ptr, s32 a1) -{ +u32 GameStats_AddSpecial(struct GameStats *ptr, s32 a1) { GF_ASSERT(a1 < 38); u32 r0 = GameStats_GetCapped(ptr, 0) + GameStats_GetStdInc(a1); - if (r0 > 99999999) - { + if (r0 > 99999999) { return GameStats_SetCapped(ptr, 0, 99999999); - } - else - { + } else { return GameStats_Add(ptr, 0, GameStats_GetStdInc(a1)); } } -u32 GameStats_GetStat0(struct GameStats * ptr) -{ +u32 GameStats_GetStat0(struct GameStats *ptr) { return GameStats_GetCapped(ptr, 0); } -void GameStats_IncSpeciesCaught(struct GameStats * ptr, struct Pokedex * pokedex, u16 species) -{ - if (!Pokedex_CheckMonCaughtFlag(pokedex, species)) - { +void GameStats_IncSpeciesCaught(struct GameStats *ptr, struct Pokedex *pokedex, u16 species) { + if (!Pokedex_CheckMonCaughtFlag(pokedex, species)) { GameStats_AddSpecial(ptr, 22); } } diff --git a/arm9/src/unk_0202A1E0.c b/arm9/src/unk_0202A1E0.c index cbb82c9d1..646b2757b 100644 --- a/arm9/src/unk_0202A1E0.c +++ b/arm9/src/unk_0202A1E0.c @@ -1,359 +1,299 @@ +#include "unk_0202A1E0.h" + #include "global.h" -#include "MI_memory.h" -#include "msgdata.h" + #include "msgdata/msg.naix" + +#include "MI_memory.h" #include "heap.h" -#include "unk_0202A1E0.h" +#include "msgdata.h" -s32 SaveStruct23_Substruct4_Substruct1_sizeof() -{ +s32 SaveStruct23_Substruct4_Substruct1_sizeof() { return sizeof(struct SaveStruct23_Substruct4_Substruct1); // 228 } -void SaveStruct23_Substruct1_Init(struct SaveStruct23_Substruct1 *substruct1) -{ +void SaveStruct23_Substruct1_Init(struct SaveStruct23_Substruct1 *substruct1) { MI_CpuFill8(substruct1, 0, sizeof(struct SaveStruct23_Substruct1)); } -void FrontierData_Init(struct FrontierData *frontierData) -{ +void FrontierData_Init(struct FrontierData *frontierData) { MI_CpuFill8(frontierData, 0, sizeof(struct FrontierData)); frontierData->u_3 = 1; } -void SaveStruct23_Messages_Init(struct SaveStruct23_Messages *messages) -{ +void SaveStruct23_Messages_Init(struct SaveStruct23_Messages *messages) { MailMsg_Init_FromTemplate(&messages->messages[0], 0); MailMsg_Init_FromTemplate(&messages->messages[1], 1); MailMsg_Init_FromTemplate(&messages->messages[2], 2); MailMsg_Init_FromTemplate(&messages->messages[3], 3); } -void SaveStruct23_Substruct4_Init(struct SaveStruct23_Substruct4 *substruct4) -{ +void SaveStruct23_Substruct4_Init(struct SaveStruct23_Substruct4 *substruct4) { MI_CpuFill8(substruct4, 0, sizeof(struct SaveStruct23_Substruct4)); } -u32 SaveStruct23_Substruct1_GetField(struct SaveStruct23_Substruct1 *substruct1, SaveStruct23_Substruct1_Field field, void *dst) -{ - switch (field) - { - case FIELD_0x0_2: - return substruct1->u_0_2; - case FIELD_0x2: - return substruct1->u_2; - case FIELD_0x3: - return substruct1->u_3; - case FIELD_0x4: - return substruct1->u_4; - case FIELD_0x6: - return substruct1->u_6; - case FIELD_0x8: - MI_CpuCopy8(&substruct1->u_8, dst, 4); - return 0; - case FIELD_0x2C: - MI_CpuCopy8(&substruct1->u_2C, dst, 16); - return 0; - case FIELD_flag0: - return substruct1->flag0; - case FIELD_0xC: - MI_CpuCopy8(&substruct1->u_C, dst, 28); - return 0; - case FIELD_0x0_5: - return substruct1->u_0_5; - case FIELD_0x28: - return substruct1->u_28; - default: - return 0; +u32 SaveStruct23_Substruct1_GetField(struct SaveStruct23_Substruct1 *substruct1, SaveStruct23_Substruct1_Field field, void *dst) { + switch (field) { + case FIELD_0x0_2: + return substruct1->u_0_2; + case FIELD_0x2: + return substruct1->u_2; + case FIELD_0x3: + return substruct1->u_3; + case FIELD_0x4: + return substruct1->u_4; + case FIELD_0x6: + return substruct1->u_6; + case FIELD_0x8: + MI_CpuCopy8(&substruct1->u_8, dst, 4); + return 0; + case FIELD_0x2C: + MI_CpuCopy8(&substruct1->u_2C, dst, 16); + return 0; + case FIELD_flag0: + return substruct1->flag0; + case FIELD_0xC: + MI_CpuCopy8(&substruct1->u_C, dst, 28); + return 0; + case FIELD_0x0_5: + return substruct1->u_0_5; + case FIELD_0x28: + return substruct1->u_28; + default: + return 0; }; } -void SaveStruct23_Substruct1_SetField(struct SaveStruct23_Substruct1 *substruct1, SaveStruct23_Substruct1_Field field, void *value) -{ - switch (field) - { - case FIELD_0x0_2: - substruct1->u_0_2 = *(u8 *)value; - break; - case FIELD_0x2: - substruct1->u_2 = *(u8 *)value; - break; - case FIELD_0x3: - substruct1->u_3 = *(u8 *)value; - break; - case FIELD_0x4: - substruct1->u_4 = *(u16 *)value; - break; - case FIELD_0x6: - substruct1->u_6 = *(u16 *)value; - break; - case FIELD_0x8: - MI_CpuCopy8(value, &substruct1->u_8, 4); - break; - case FIELD_0x2C: - MI_CpuCopy8(value, &substruct1->u_2C, 16); - break; - case FIELD_flag0: - substruct1->flag0 = *(u8 *)value; - break; - case FIELD_0xC: - MI_CpuCopy8(value, &substruct1->u_C, 28); - break; - case FIELD_0x28: - substruct1->u_28 = *(u32 *)value; - break; - case FIELD_0x0_5: - substruct1->u_0_5 = *(u8 *)value; - break; +void SaveStruct23_Substruct1_SetField(struct SaveStruct23_Substruct1 *substruct1, SaveStruct23_Substruct1_Field field, void *value) { + switch (field) { + case FIELD_0x0_2: + substruct1->u_0_2 = *(u8 *)value; + break; + case FIELD_0x2: + substruct1->u_2 = *(u8 *)value; + break; + case FIELD_0x3: + substruct1->u_3 = *(u8 *)value; + break; + case FIELD_0x4: + substruct1->u_4 = *(u16 *)value; + break; + case FIELD_0x6: + substruct1->u_6 = *(u16 *)value; + break; + case FIELD_0x8: + MI_CpuCopy8(value, &substruct1->u_8, 4); + break; + case FIELD_0x2C: + MI_CpuCopy8(value, &substruct1->u_2C, 16); + break; + case FIELD_flag0: + substruct1->flag0 = *(u8 *)value; + break; + case FIELD_0xC: + MI_CpuCopy8(value, &substruct1->u_C, 28); + break; + case FIELD_0x28: + substruct1->u_28 = *(u32 *)value; + break; + case FIELD_0x0_5: + substruct1->u_0_5 = *(u8 *)value; + break; } } -void sub_0202A36C(struct SaveStruct23_Substruct1 *substruct1, s32 arg1, s32 arg2, s32 arg3) -{ - if (substruct1->u_3 + arg1 < 0xff) - { +void sub_0202A36C(struct SaveStruct23_Substruct1 *substruct1, s32 arg1, s32 arg2, s32 arg3) { + if (substruct1->u_3 + arg1 < 0xff) { substruct1->u_3 += arg1; } - if (substruct1->u_4 + arg2 < 0xffff) - { + if (substruct1->u_4 + arg2 < 0xffff) { substruct1->u_4 += arg2; } - if (substruct1->u_6 + arg3 < 0xffff) - { + if (substruct1->u_6 + arg3 < 0xffff) { substruct1->u_6 += arg3; } } -BOOL SaveStruct23_Substruct1_GetFlag1(struct SaveStruct23_Substruct1 *substruct1) -{ +BOOL SaveStruct23_Substruct1_GetFlag1(struct SaveStruct23_Substruct1 *substruct1) { return substruct1->flag1; } -void SaveStruct23_Substruct1_SetFlag1(struct SaveStruct23_Substruct1 *substruct1, BOOL flag) -{ +void SaveStruct23_Substruct1_SetFlag1(struct SaveStruct23_Substruct1 *substruct1, BOOL flag) { substruct1->flag1 = flag; } -u16 FrontierData_BattlePointAction(struct FrontierData *frontierData, u16 value, DataSetMode mode) -{ - switch (mode) - { - case DATA_SET: - if (value > 9999) - { - frontierData->u_0 = 9999; - } - else - { - frontierData->u_0 = value; - } - break; - case DATA_ADD: - if (frontierData->u_0 + value > 9999) - { - frontierData->u_0 = 9999; - } - else - { - frontierData->u_0 += value; - } - break; - case DATA_SUBSTRACT: - if (frontierData->u_0 < value) - { - frontierData->u_0 = 0; - } - else - { - frontierData->u_0 -= value; - } - break; - case DATA_GET: - default: - break; +u16 FrontierData_BattlePointAction(struct FrontierData *frontierData, u16 value, DataSetMode mode) { + switch (mode) { + case DATA_SET: + if (value > 9999) { + frontierData->u_0 = 9999; + } else { + frontierData->u_0 = value; + } + break; + case DATA_ADD: + if (frontierData->u_0 + value > 9999) { + frontierData->u_0 = 9999; + } else { + frontierData->u_0 += value; + } + break; + case DATA_SUBSTRACT: + if (frontierData->u_0 < value) { + frontierData->u_0 = 0; + } else { + frontierData->u_0 -= value; + } + break; + case DATA_GET: + default: + break; } return frontierData->u_0; } -u8 FrontierData_SetField_0x2(struct FrontierData *frontierData, DataSetMode mode) -{ - switch (mode) - { - case DATA_RESET: - frontierData->u_2 = 0; - frontierData->flag4 = 0; - break; - case DATA_INCREMENT: - if (frontierData->flag4) - { - frontierData->u_2++; - } - else - { - frontierData->u_2 = 1; - frontierData->flag4 = 1; - } - break; +u8 FrontierData_SetField_0x2(struct FrontierData *frontierData, DataSetMode mode) { + switch (mode) { + case DATA_RESET: + frontierData->u_2 = 0; + frontierData->flag4 = 0; + break; + case DATA_INCREMENT: + if (frontierData->flag4) { + frontierData->u_2++; + } else { + frontierData->u_2 = 1; + frontierData->flag4 = 1; + } + break; } return frontierData->u_2; } -u8 FrontierData_SetField_0x3(struct FrontierData *frontierData, DataSetMode mode) -{ - switch (mode) - { - case DATA_RESET: - frontierData->u_3 = 1; - break; - case DATA_INCREMENT: - if (frontierData->u_3 < 10) - { - frontierData->u_3++; - } - break; - case DATA_DECREMENT: - if (frontierData->u_3 > 1) - { - frontierData->u_3--; - } - break; +u8 FrontierData_SetField_0x3(struct FrontierData *frontierData, DataSetMode mode) { + switch (mode) { + case DATA_RESET: + frontierData->u_3 = 1; + break; + case DATA_INCREMENT: + if (frontierData->u_3 < 10) { + frontierData->u_3++; + } + break; + case DATA_DECREMENT: + if (frontierData->u_3 > 1) { + frontierData->u_3--; + } + break; } return frontierData->u_3; } -void FrontierData_SetArray(struct FrontierData *frontierData, s32 mode, void *src) -{ - if (mode == 0) - { +void FrontierData_SetArray(struct FrontierData *frontierData, s32 mode, void *src) { + if (mode == 0) { MI_CpuCopy8(src, frontierData->u_C0, 168); - } - else - { + } else { MI_CpuCopy8(src, frontierData->u_18, 168); } } -void FrontierData_GetArray(struct FrontierData *frontierData, s32 mode, void *dst) -{ - if (mode == 0) - { +void FrontierData_GetArray(struct FrontierData *frontierData, s32 mode, void *dst) { + if (mode == 0) { MI_CpuCopy8(frontierData->u_C0, dst, 168); - } - else - { + } else { MI_CpuCopy8(frontierData->u_18, dst, 168); } } -u16 FrontierData_SetField_0x16(struct FrontierData *frontierData, struct Unk0202A4B8 *arg1) -{ +u16 FrontierData_SetField_0x16(struct FrontierData *frontierData, struct Unk0202A4B8 *arg1) { u16 var1, var2, var3, var4, var5, total; - var1 = (u16) ((arg1->u_2 - 1) * 1000); - var2 = (u16) (arg1->u_4 * 10); - var3 = (u16) (arg1->u_3 * 20); - - if (var2 + var3 > 950) - { + var1 = (u16)((arg1->u_2 - 1) * 1000); + var2 = (u16)(arg1->u_4 * 10); + var3 = (u16)(arg1->u_3 * 20); + + if (var2 + var3 > 950) { var4 = 0; - } - else - { - var4 = (u16) (950 - (var2 + var3)); + } else { + var4 = (u16)(950 - (var2 + var3)); } - if (arg1->u_6 > 970) - { + if (arg1->u_6 > 970) { var5 = 0; - } - else - { - var5 = (u16) ((1000 - arg1->u_6) / 30); + } else { + var5 = (u16)((1000 - arg1->u_6) / 30); } - total = (u16) (var1 + var4 + var5); + total = (u16)(var1 + var4 + var5); frontierData->u_16 = total; return total; } -u16 FrontierData_GetField_0x16(struct FrontierData *frontierData) -{ +u16 FrontierData_GetField_0x16(struct FrontierData *frontierData) { return frontierData->u_16; } -u8 sub_0202A524(struct FrontierData *frontierData) -{ +u8 sub_0202A524(struct FrontierData *frontierData) { return (u8)(frontierData->u_16 / 1000); } -u16 FrontierData_SetField_0xC(struct FrontierData *frontierData, u16 arg1, DataSetMode mode) -{ - if (arg1 == 5) - { +u16 FrontierData_SetField_0xC(struct FrontierData *frontierData, u16 arg1, DataSetMode mode) { + if (arg1 == 5) { return 0; } - switch(mode) { - case DATA_RESET: - frontierData->u_C[arg1] = 0; - break; - case DATA_INCREMENT: - if (frontierData->u_C[arg1] < 0xfffe) { - frontierData->u_C[arg1]++; - } - break; + switch (mode) { + case DATA_RESET: + frontierData->u_C[arg1] = 0; + break; + case DATA_INCREMENT: + if (frontierData->u_C[arg1] < 0xfffe) { + frontierData->u_C[arg1]++; + } + break; } - return frontierData->u_C[arg1]; + return frontierData->u_C[arg1]; } -BOOL FrontierData_SetFlag(struct FrontierData *frontierData, u16 flagNumber, DataSetMode mode) -{ +BOOL FrontierData_SetFlag(struct FrontierData *frontierData, u16 flagNumber, DataSetMode mode) { u16 i; u16 flag = 1; - for (i = 0; i < flagNumber ; i++) - { + for (i = 0; i < flagNumber; i++) { flag <<= 1; } - switch (mode) - { - case DATA_RESET: - flag = (u16) (flag ^ 0xffff); - frontierData->flags &= flag; - break; - case DATA_SET: - frontierData->flags |= flag; - break; - case DATA_GET: - return (BOOL) ((frontierData->flags >> flagNumber) & 1); + switch (mode) { + case DATA_RESET: + flag = (u16)(flag ^ 0xffff); + frontierData->flags &= flag; + break; + case DATA_SET: + frontierData->flags |= flag; + break; + case DATA_GET: + return (BOOL)((frontierData->flags >> flagNumber) & 1); } return FALSE; } - -void FrontierData_SetField_0x4(struct FrontierData *frontierData, u32 value) -{ +void FrontierData_SetField_0x4(struct FrontierData *frontierData, u32 value) { frontierData->u_4 = value; } -u32 FrontierData_GetField_0x4(struct FrontierData *frontierData) -{ +u32 FrontierData_GetField_0x4(struct FrontierData *frontierData) { return frontierData->u_4; } - -void SaveStruct23_SetMessage(struct SaveData *save, u32 index, struct MailMessage *message) -{ +void SaveStruct23_SetMessage(struct SaveData *save, u32 index, struct MailMessage *message) { struct SaveStruct23 *data = SaveArray_Get(save, 23); MailMsg_Copy(&data->messages.messages[index], message); } -struct MailMessage *SaveStruct23_GetMessage(struct SaveData *save, u32 index) -{ +struct MailMessage *SaveStruct23_GetMessage(struct SaveData *save, u32 index) { struct SaveStruct23 *data = SaveArray_Get(save, 23); return &data->messages.messages[index]; } @@ -362,34 +302,30 @@ void SaveStruct23_Substruct4_SetArrayFlag(struct SaveStruct23_Substruct4 *substr u8 flag = 1; - if (arg2 == 0 || arg2 > 200) - { + if (arg2 == 0 || arg2 > 200) { return; } - if (arg1 == 0 || arg1 > 10) - { + if (arg1 == 0 || arg1 > 10) { return; } - u16 var1 = (u16) ((arg1 - 1) * 200 + (arg2 - 1)); - u8 index = (u8) (var1 / 8); - u8 remainder = (u8) (var1 % 8); + u16 var1 = (u16)((arg1 - 1) * 200 + (arg2 - 1)); + u8 index = (u8)(var1 / 8); + u8 remainder = (u8)(var1 % 8); flag <<= remainder; substruct4->flags[index] |= flag; substruct4->u_0 = (arg3->u_0 << 24) | ((arg3->u_4 & 0xff) << 16) | ((arg3->u_8 & 0xff) << 8) | arg3->u_C; } -void SaveStruct23_Substruct4_ClearArrayFlags(struct SaveStruct23_Substruct4 *substruct4) -{ +void SaveStruct23_Substruct4_ClearArrayFlags(struct SaveStruct23_Substruct4 *substruct4) { MI_CpuFill8(substruct4->flags, 0, 250); MI_CpuFill8(&substruct4->u_0, 0, 4); } -BOOL StructUnk0202A68C_Compare(struct Unk0202A68C *struct1, struct Unk0202A68C *struct2) -{ +BOOL StructUnk0202A68C_Compare(struct Unk0202A68C *struct1, struct Unk0202A68C *struct2) { if (struct1->u_0 > struct2->u_0) { return TRUE; } else if (struct1->u_4 > struct2->u_4) { @@ -400,12 +336,10 @@ BOOL StructUnk0202A68C_Compare(struct Unk0202A68C *struct1, struct Unk0202A68C * return FALSE; } -BOOL SaveStruct23_Substruct4_GetArrayFlag(struct SaveStruct23_Substruct4 *substruct4, u8 arg1, u8 arg2, struct Unk0202A68C *arg3) -{ +BOOL SaveStruct23_Substruct4_GetArrayFlag(struct SaveStruct23_Substruct4 *substruct4, u8 arg1, u8 arg2, struct Unk0202A68C *arg3) { u8 flag = 1; - if (arg2 > 200 || arg1 > 10) - { + if (arg2 > 200 || arg1 > 10) { return FALSE; } @@ -417,67 +351,56 @@ BOOL SaveStruct23_Substruct4_GetArrayFlag(struct SaveStruct23_Substruct4 *substr var1.u_8 = var0 >> 8 & 0xff; var1.u_C = var0 & 0xff; - if (StructUnk0202A68C_Compare(arg3, &var1)) - { + if (StructUnk0202A68C_Compare(arg3, &var1)) { SaveStruct23_Substruct4_ClearArrayFlags(substruct4); return FALSE; } - u16 var2 = (u16) ((arg1 - 1) * 200 + (arg2 - 1)); - u8 index = (u8) (var2 / 8); - u8 remainder = (u8) (var2 % 8); + u16 var2 = (u16)((arg1 - 1) * 200 + (arg2 - 1)); + u8 index = (u8)(var2 / 8); + u8 remainder = (u8)(var2 % 8); flag <<= remainder; - if (substruct4->flags[index] & flag) - { + if (substruct4->flags[index] & flag) { return TRUE; } return FALSE; } - -u8 SaveStruct23_Substruct4_GetField_0xFE(struct SaveStruct23_Substruct4 *substruct4) -{ +u8 SaveStruct23_Substruct4_GetField_0xFE(struct SaveStruct23_Substruct4 *substruct4) { return substruct4->u_FE; } -u8 SaveStruct23_Substruct4_GetField_0xFF(struct SaveStruct23_Substruct4 *substruct4) -{ +u8 SaveStruct23_Substruct4_GetField_0xFF(struct SaveStruct23_Substruct4 *substruct4) { return substruct4->u_FF; } -void SaveStruct23_Substruct4_SetSubstruct1(struct SaveStruct23_Substruct4 *substruct4, struct SaveStruct23_Substruct4_Substruct1 *substruct1, u8 arg2, u8 arg3) -{ - MI_CpuCopy8(substruct1, &substruct4->substruct1, sizeof(struct SaveStruct23_Substruct4_Substruct1)*7); +void SaveStruct23_Substruct4_SetSubstruct1(struct SaveStruct23_Substruct4 *substruct4, struct SaveStruct23_Substruct4_Substruct1 *substruct1, u8 arg2, u8 arg3) { + MI_CpuCopy8(substruct1, &substruct4->substruct1, sizeof(struct SaveStruct23_Substruct4_Substruct1) * 7); substruct4->u_101 = arg2; substruct4->u_100 = arg3; - substruct4->u_FE = 1; + substruct4->u_FE = 1; } -void sub_0202A784(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A784 *dst) -{ +void sub_0202A784(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A784 *dst) { dst->u_0 = substruct4->u_101; dst->u_1 = substruct4->u_100; } -void sub_0202A798(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A798 *arg1, u32 arg2) -{ - struct Unk0202A798_substruct *unk_substruct = &arg1->u_0; - u8 *var1 = arg1->u_30; +void sub_0202A798(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A798 *arg1, u32 arg2) { + struct Unk0202A798_substruct *unk_substruct = &arg1->u_0; + u8 *var1 = arg1->u_30; struct SaveStruct23_Substruct4_Substruct1 *substruct4_substruct1 = &substruct4->substruct1[arg2]; struct MsgData *message; unk_substruct->u_0 = 10000; unk_substruct->u_4 = substruct4_substruct1->u_C9; - if(substruct4_substruct1->u_C8_0) - { + if (substruct4_substruct1->u_C8_0) { message = NewMsgDataFromNarc(MSGDATA_LOAD_DIRECT, NARC_MSGDATA_MSG, NARC_msg_narc_0017_bin, HEAP_ID_FIELD); - ReadMsgDataIntoU16Array(message, (u32) (22 + substruct4_substruct1->u_C8_1), unk_substruct->u_8); + ReadMsgDataIntoU16Array(message, (u32)(22 + substruct4_substruct1->u_C8_1), unk_substruct->u_8); DestroyMsgData(message); - } - else - { + } else { MI_CpuCopy8(substruct4_substruct1->u_A8, unk_substruct->u_8, 16); } @@ -487,51 +410,43 @@ void sub_0202A798(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A798 MI_CpuCopy8(substruct4_substruct1->u_0, var1, 168); } -void sub_0202A838(struct SaveStruct23_Substruct4 *substruct4, struct SaveStruct23_Substruct4_Substruct2 *substruct4_substruct2, u8 arg2, u8 arg3) -{ +void sub_0202A838(struct SaveStruct23_Substruct4 *substruct4, struct SaveStruct23_Substruct4_Substruct2 *substruct4_substruct2, u8 arg2, u8 arg3) { MI_CpuCopy8(substruct4_substruct2, &substruct4->substruct2, sizeof(struct SaveStruct23_Substruct4_Substruct2)); substruct4->u_103 = arg2; substruct4->u_102 = arg3; - substruct4->u_FF = 1; + substruct4->u_FF = 1; } -void sub_0202A864(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A784 *dst) -{ +void sub_0202A864(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A784 *dst) { dst->u_0 = substruct4->u_103; dst->u_1 = substruct4->u_102; } -struct SaveStruct23_Substruct4_Substruct2 *sub_0202A878(struct SaveStruct23_Substruct4 *substruct4, HeapID heapId) -{ +struct SaveStruct23_Substruct4_Substruct2 *sub_0202A878(struct SaveStruct23_Substruct4 *substruct4, HeapID heapId) { struct SaveStruct23_Substruct4_Substruct2 *substruct4_substruct2 = AllocFromHeap(heapId, sizeof(struct SaveStruct23_Substruct4_Substruct2) /* 1020 */); MI_CpuCopy8(&substruct4->substruct2, substruct4_substruct2, sizeof(struct SaveStruct23_Substruct4_Substruct2)); return substruct4_substruct2; } -s32 SaveStruct23_sizeof() -{ +s32 SaveStruct23_sizeof() { return sizeof(struct SaveStruct23); // 0xD00 (3328) } -void SaveStruct23_Init(struct SaveStruct23 *saveStruct23) -{ +void SaveStruct23_Init(struct SaveStruct23 *saveStruct23) { SaveStruct23_Substruct1_Init(&saveStruct23->substruct1); FrontierData_Init(&saveStruct23->frontierData); SaveStruct23_Messages_Init(&saveStruct23->messages); SaveStruct23_Substruct4_Init(&saveStruct23->substruct4); } -struct SaveStruct23_Substruct1 *SaveStruct23_GetSubstruct1(struct SaveData* save) -{ +struct SaveStruct23_Substruct1 *SaveStruct23_GetSubstruct1(struct SaveData *save) { return &((struct SaveStruct23 *)SaveArray_Get(save, 23))->substruct1; } -struct FrontierData *Save_FrontierData_Get(struct SaveData* save) -{ +struct FrontierData *Save_FrontierData_Get(struct SaveData *save) { return &((struct SaveStruct23 *)SaveArray_Get(save, 23))->frontierData; } -struct SaveStruct23_Substruct4 *SaveStruct23_GetSubstruct4(struct SaveData* save) -{ +struct SaveStruct23_Substruct4 *SaveStruct23_GetSubstruct4(struct SaveData *save) { return &((struct SaveStruct23 *)SaveArray_Get(save, 23))->substruct4; -} \ No newline at end of file +} diff --git a/arm9/src/unk_0202A8F4.c b/arm9/src/unk_0202A8F4.c index ed6c8fffe..1d3917e24 100644 --- a/arm9/src/unk_0202A8F4.c +++ b/arm9/src/unk_0202A8F4.c @@ -1,14 +1,14 @@ +#include "unk_0202A8F4.h" + #include "global.h" + #include "save.h" -#include "unk_0202A8F4.h" -u32 sub_0202A8F4() -{ +u32 sub_0202A8F4() { return sizeof(struct Unk0202A8F4); } -void sub_0202A8F8(struct Unk0202A8F4 *unk) -{ +void sub_0202A8F8(struct Unk0202A8F4 *unk) { unk->u_0 = 0; unk->u_1 = 0; unk->u_2 = 0; @@ -22,10 +22,9 @@ void sub_0202A8F8(struct Unk0202A8F4 *unk) unk->u_A = 0; unk->u_B = 0; unk->u_C = 0; - unk->u_D = 0; + unk->u_D = 0; } -void *sub_0202A918(struct SaveData* save) -{ +void *sub_0202A918(struct SaveData *save) { return SaveArray_Get(save, 24); } diff --git a/arm9/src/unk_0202ABBC.c b/arm9/src/unk_0202ABBC.c index 78fee6ad9..c56e8d34c 100644 --- a/arm9/src/unk_0202ABBC.c +++ b/arm9/src/unk_0202ABBC.c @@ -1,54 +1,46 @@ +#include "unk_0202ABBC.h" + #include "global.h" -#include "save.h" + #include "MI_memory.h" -#include "unk_0202ABBC.h" +#include "save.h" -void *sub_0202ABBC(struct SaveData* save) -{ +void *sub_0202ABBC(struct SaveData *save) { return SaveArray_Get(save, 26); } -u32 sub_0202ABC8() -{ +u32 sub_0202ABC8() { return sizeof(struct Unk0202ABBC); // 0xF4 } -void sub_0202ABCC(struct Unk0202ABBC* unk) -{ +void sub_0202ABCC(struct Unk0202ABBC *unk) { MI_CpuClearFast(unk, sizeof(struct Unk0202ABBC)); } -u16 sub_0202ABDC(struct Unk0202ABBC* unk) -{ +u16 sub_0202ABDC(struct Unk0202ABBC *unk) { return unk->unk_EC; } -void sub_0202ABE4(struct Unk0202ABBC* unk, u16 data) -{ +void sub_0202ABE4(struct Unk0202ABBC *unk, u16 data) { unk->unk_EC = data; } -void sub_0202ABEC(void *srcp, void *destp) -{ +void sub_0202ABEC(void *srcp, void *destp) { MI_CpuCopyFast(srcp, destp, 0xec); } -void sub_0202ABF8(void *destp, void *srcp) -{ +void sub_0202ABF8(void *destp, void *srcp) { MI_CpuCopyFast(srcp, destp, 0xec); } -u32 sub_0202AC08(struct Unk0202ABBC* unk) -{ +u32 sub_0202AC08(struct Unk0202ABBC *unk) { return unk->unk_F0; } -void sub_0202AC10(struct Unk0202ABBC* unk, u32 data) -{ +void sub_0202AC10(struct Unk0202ABBC *unk, u32 data) { unk->unk_F0 = data; } -u16 sub_0202AC18(struct Unk0202ABBC* unk) -{ +u16 sub_0202AC18(struct Unk0202ABBC *unk) { return unk->unk_EE; } diff --git a/arm9/src/unk_0202C0E0.c b/arm9/src/unk_0202C0E0.c index e1a0bfa6c..035432870 100644 --- a/arm9/src/unk_0202C0E0.c +++ b/arm9/src/unk_0202C0E0.c @@ -1,36 +1,31 @@ +#include "unk_0202C0E0.h" + #include "global.h" + #include "save.h" -#include "unk_0202C0E0.h" -u32 sub_0202C0E0() -{ +u32 sub_0202C0E0() { return sizeof(struct UnkSaveStruct0202C0E4); // 0x28 } -void sub_0202C0E4(struct UnkSaveStruct0202C0E4 *unkStruct) -{ +void sub_0202C0E4(struct UnkSaveStruct0202C0E4 *unkStruct) { s32 j, i; - for (i = 0; i < 5; i++) - { - for (j = 0; j < 4; j++) - { + for (i = 0; i < 5; i++) { + for (j = 0; j < 4; j++) { unkStruct->data[i][j] = 0; } } } -void sub_0202C108(struct SaveData *save, u32 a1, u32 a2) -{ +void sub_0202C108(struct SaveData *save, u32 a1, u32 a2) { struct UnkSaveStruct0202C0E4 *unkSavStruct = SaveArray_Get(save, 33); - if (unkSavStruct->data[a1][a2] < 9999) - { + if (unkSavStruct->data[a1][a2] < 9999) { unkSavStruct->data[a1][a2]++; } } -u16 sub_0202C12C(struct SaveData *save, u32 a1, u32 a2) -{ +u16 sub_0202C12C(struct SaveData *save, u32 a1, u32 a2) { struct UnkSaveStruct0202C0E4 *unkSavStruct = SaveArray_Get(save, 33); return unkSavStruct->data[a1][a2]; } diff --git a/arm9/src/unk_0202C144.c b/arm9/src/unk_0202C144.c index c3f78f4fd..5a8dd261a 100644 --- a/arm9/src/unk_0202C144.c +++ b/arm9/src/unk_0202C144.c @@ -1,21 +1,21 @@ +#include "unk_0202C144.h" + #include "global.h" + #include "pokedex.h" #include "poketch.h" #include "unk_02029FB0.h" -#include "unk_0202C144.h" -void sub_0202C144(struct SaveData * save, struct Pokemon * mon) -{ +void sub_0202C144(struct SaveData *save, struct Pokemon *mon) { u32 is_egg = GetMonData(mon, MON_DATA_IS_EGG, NULL); - if (!is_egg) - { - struct Pokedex * pokedex = Save_Pokedex_Get(save); - struct GameStats * unk = Save_GameStats_Get(save); - u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); - GameStats_IncSpeciesCaught(unk, pokedex, (u16) species); + if (!is_egg) { + struct Pokedex *pokedex = Save_Pokedex_Get(save); + struct GameStats *unk = Save_GameStats_Get(save); + u32 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + GameStats_IncSpeciesCaught(unk, pokedex, (u16)species); Pokedex_SetMonCaughtFlag(pokedex, mon); - struct Poketch * poketch = Save_Poketch_Get(save); + struct Poketch *poketch = Save_Poketch_Get(save); Save_Poketch_PokemonHistoryAddMon(poketch, &mon->box); } } diff --git a/arm9/src/unk_0202D858.c b/arm9/src/unk_0202D858.c index 9de981238..6b4ba7acd 100644 --- a/arm9/src/unk_0202D858.c +++ b/arm9/src/unk_0202D858.c @@ -1,71 +1,74 @@ -#include "global.h" #include "unk_0202D858.h" -struct UnkStruct_0202D858 -{ +#include "global.h" + +struct UnkStruct_0202D858 { u8 unk00[0x1a]; }; -static const struct UnkStruct_0202D858 UNK_020EEB04 = { { - 0x01, - 0x01, - 0x01, - 0x01, - 0x03, - 0x03, - 0x03, - 0x04, - 0x03, - 0x04, - 0x07, - 0x03, - 0x07, - 0x04, - 0x01, - 0x04, - 0x01, - 0x01, - 0x04, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x00, - 0x00, -} }; +static const struct UnkStruct_0202D858 UNK_020EEB04 = { + { + 0x01, + 0x01, + 0x01, + 0x01, + 0x03, + 0x03, + 0x03, + 0x04, + 0x03, + 0x04, + 0x07, + 0x03, + 0x07, + 0x04, + 0x01, + 0x04, + 0x01, + 0x01, + 0x04, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x00, + 0x00, + } +}; -static const struct UnkStruct_0202D858 UNK_020EEB1E = { { - 0x01, - 0x01, - 0x01, - 0x01, - 0x03, - 0x03, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x01, - 0x00, - 0x00, -} }; +static const struct UnkStruct_0202D858 UNK_020EEB1E = { + { + 0x01, + 0x01, + 0x01, + 0x01, + 0x03, + 0x03, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x01, + 0x00, + 0x00, + } +}; -u8 sub_0202D858(u16 param0) -{ +u8 sub_0202D858(u16 param0) { struct UnkStruct_0202D858 st0 = UNK_020EEB04; GF_ASSERT(param0 < 0x1a); @@ -73,8 +76,7 @@ u8 sub_0202D858(u16 param0) return st0.unk00[param0]; } -u8 sub_0202D884(u16 param0) -{ +u8 sub_0202D884(u16 param0) { struct UnkStruct_0202D858 st0 = UNK_020EEB1E; GF_ASSERT(param0 < 0x1a); @@ -82,10 +84,8 @@ u8 sub_0202D884(u16 param0) return st0.unk00[param0]; } -u32 sub_0202D8B0(int param0) -{ - switch (param0) - { +u32 sub_0202D8B0(int param0) { + switch (param0) { case 0x7: case 0x9: case 0xd: diff --git a/arm9/src/unk_0202E29C.c b/arm9/src/unk_0202E29C.c index 76b233053..a01f904ba 100644 --- a/arm9/src/unk_0202E29C.c +++ b/arm9/src/unk_0202E29C.c @@ -1,7 +1,10 @@ -#include "global.h" #include "unk_0202E29C.h" + +#include "global.h" + #include "MI_memory.h" #include "OS_cache.h" +#include "WM_api.h" #include "game_init.h" #include "heap.h" #include "mail_message.h" @@ -9,14 +12,14 @@ #include "unk_0202D858.h" #include "unk_0202F150.h" #include "unk_02031734.h" -#include "WM_api.h" -struct UnkStruct_0202E29C_const -{ +struct UnkStruct_0202E29C_const { u8 unk0[6]; }; -const struct UnkStruct_0202E29C_const UNK_020EEC40 = { { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } }; +const struct UnkStruct_0202E29C_const UNK_020EEC40 = { + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } +}; u16 UNK_021C59E8; struct UnkStruct_0202E29C *UNK_021C59F0; @@ -54,10 +57,8 @@ extern u32 sub_0202CB8C(); extern u16 WM_GetDispersionBeaconPeriod(); extern BOOL sub_0202D2D0(); -void sub_0202E29C(PlayerProfile *player_data) -{ - if (UNK_021C59F0 == NULL) - { +void sub_0202E29C(PlayerProfile *player_data) { + if (UNK_021C59F0 == NULL) { UNK_021C59F0 = AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct_0202E29C)); MI_CpuFill8(UNK_021C59F0, 0, sizeof(struct UnkStruct_0202E29C)); @@ -75,23 +76,18 @@ void sub_0202E29C(PlayerProfile *player_data) } } -BOOL sub_0202E344() -{ - if (UNK_021C59F0 != NULL) - { +BOOL sub_0202E344() { + if (UNK_021C59F0 != NULL) { return TRUE; } return FALSE; } -BOOL sub_0202E358(u8 *param0, u8 *param1, s32 param2) -{ +BOOL sub_0202E358(u8 *param0, u8 *param1, s32 param2) { int i = 0; - while (i < param2) - { - if (*param0 != *param1) - { + while (i < param2) { + if (*param0 != *param1) { return FALSE; } @@ -103,49 +99,38 @@ BOOL sub_0202E358(u8 *param0, u8 *param1, s32 param2) return TRUE; } -void sub_0202E380(struct UnkStruct_0202E29C_sub *param0, u32 param1) -{ +void sub_0202E380(struct UnkStruct_0202E29C_sub *param0, u32 param1) { #pragma unused(param1) - s32 r5 = sub_02033534(); - u8 r6 = sub_0203354C(); + s32 r5 = sub_02033534(); + u8 r6 = sub_0203354C(); struct UnkStruct_0202E29C_sub4 *r4 = ¶m0->unk50; - if (r5 != 0xe) - { - if (sub_0202D8B0(r4->unk04) == 0 || sub_0202D8B0(r5) == 0) - { - if (r4->unk30[0x24] != 0) - { - if (r4->unk04 == 0xa) - { + if (r5 != 0xe) { + if (sub_0202D8B0(r4->unk04) == 0 || sub_0202D8B0(r5) == 0) { + if (r4->unk30[0x24] != 0) { + if (r4->unk04 == 0xa) { return; } } - if (r4->unk04 != r5) - { + if (r4->unk04 != r5) { return; } } } - if (r5 != 0xe) - { - if (r4->unk05 != r6) - { + if (r5 != 0xe) { + if (r4->unk05 != r6) { return; } } - for (int i = 0; i < 0x10; i++) - { - if (UNK_021C59F0->unkC84[i] == 0) - { + for (int i = 0; i < 0x10; i++) { + if (UNK_021C59F0->unkC84[i] == 0) { continue; } - if (!sub_0202E358(UNK_021C59F0->unk054[i].unk04, param0->unk04, 6)) - { + if (!sub_0202E358(UNK_021C59F0->unk054[i].unk04, param0->unk04, 6)) { continue; } @@ -156,99 +141,81 @@ void sub_0202E380(struct UnkStruct_0202E29C_sub *param0, u32 param1) } int i; - for (i = 0; i < 0x10; i++) - { - if (UNK_021C59F0->unkC84[i] == 0) - { + for (i = 0; i < 0x10; i++) { + if (UNK_021C59F0->unkC84[i] == 0) { break; } } - if (i < 0x10) - { + if (i < 0x10) { UNK_021C59F0->unkC84[i] = 0x96; MI_CpuCopy8(param0, &UNK_021C59F0->unk054[i], sizeof(struct UnkStruct_0202E29C_sub)); UNK_021C59F0->unkCB4 = 1; } } -void sub_0202E470(u32 param0, u32 param1) -{ +void sub_0202E470(u32 param0, u32 param1) { #pragma unused(param0) - if (param1 != 0) - { + if (param1 != 0) { OS_Terminate(); } UNK_021C59EC = 2; } -void sub_0202E488() -{ +void sub_0202E488() { UNK_021C59EC = 0; sub_02016454(4); } -void sub_0202E49C() -{ +void sub_0202E49C() { sub_02016444(4); UNK_021C59EC = 1; - if (sub_02090DB8(8, sub_0202E470, 0) != 1) - { + if (sub_02090DB8(8, sub_0202E470, 0) != 1) { OS_Terminate(); } } -BOOL sub_0202E4C8() -{ - if (UNK_021C59EC == 2) - { +BOOL sub_0202E4C8() { + if (UNK_021C59EC == 2) { return TRUE; } return FALSE; } -BOOL sub_0202E4DC() -{ - if (UNK_021C59EC != 0) - { +BOOL sub_0202E4DC() { + if (UNK_021C59EC != 0) { return TRUE; } return FALSE; } -void sub_0202E4F0() -{ +void sub_0202E4F0() { sub_02090CC8(sub_0202E488, 0); } -void sub_0202E500() -{ +void sub_0202E500() { UNK_021C59F0->unkCB0 = 0; sub_0202CE64(UNK_021C59F0->unkCA4 + (32 - (u32)(UNK_021C59F0->unkCA4) % 32)); sub_0202CB70(UNK_021C59F0->unkCC0); } -void sub_0202E538() -{ - for (int i = 0; i < 0x10; i++) - { +void sub_0202E538() { + for (int i = 0; i < 0x10; i++) { UNK_021C59F0->unkC84[i] = 0; } MI_CpuFill8(UNK_021C59F0->unk054, 0, 0xC00); } -void sub_0202E56C(u32 param0) -{ +void sub_0202E56C(u32 param0) { UNK_021C59F0->unkDAD_3 = (u8)param0; } -void sub_0202E594() -{ +void sub_0202E594() { UNK_021C59F0->unkCB4 = 0; UNK_021C59F0->unkDAD_0 = 0; @@ -264,49 +231,41 @@ void sub_0202E594() UNK_021C59F0->unkDAB = 0; } -BOOL sub_0202E5F8(u32 param0, u32 param1, u32 param2) -{ +BOOL sub_0202E5F8(u32 param0, u32 param1, u32 param2) { #pragma unused(param0) sub_0202E594(); sub_0202E56C(param1); sub_0202D2F4(); - if (UNK_021C59F0->unkDAB == 0) - { + if (UNK_021C59F0->unkDAB == 0) { sub_0202D0A0(sub_020303BC, 0xe); UNK_021C59F0->unkDAB = 1; } UNK_021C59F0->unkDAD_5 = (u8)param2; - if (sub_0202CBD4() == 1 && sub_0202CBFC() != 0) - { + if (sub_0202CBD4() == 1 && sub_0202CBFC() != 0) { return TRUE; } return FALSE; } -u32 sub_0202E66C(u32 param0, u32 param1) -{ +u32 sub_0202E66C(u32 param0, u32 param1) { #pragma unused(param0) sub_0202E594(); - if (param1 != 0) - { + if (param1 != 0) { sub_0202E538(); } - if (UNK_021C59F0->unkDAB == 0) - { + if (UNK_021C59F0->unkDAB == 0) { sub_0202D0A0(sub_02030238, 0xe); UNK_021C59F0->unkDAB = 1; } - if (sub_0202CBD4() == 1) - { + if (sub_0202CBD4() == 1) { struct UnkStruct_0202E29C_const st0 = UNK_020EEC40; - if (sub_0202C570(sub_0202E380, st0.unk0, 0) != 0) - { + if (sub_0202C570(sub_0202E380, st0.unk0, 0) != 0) { return 1; } } @@ -314,43 +273,34 @@ u32 sub_0202E66C(u32 param0, u32 param1) return 0; } -u32 sub_0202E6F0() -{ - if (UNK_021C59F0 == NULL) - { +u32 sub_0202E6F0() { + if (UNK_021C59F0 == NULL) { return 1; } - switch (UNK_021C59F0->unkDAC) - { + switch (UNK_021C59F0->unkDAC) { case 0: - if (sub_0202D21C() != 0) - { + if (sub_0202D21C() != 0) { sub_0202C770(); UNK_021C59F0->unkDAC = 1; - } - else if (sub_0202D1E4() == 0) - { + } else if (sub_0202D1E4() == 0) { sub_0202D100(); UNK_021C59F0->unkDAC = 2; } break; case 1: - if (sub_0202D1E4() == 0) - { + if (sub_0202D1E4() == 0) { sub_0202D100(); UNK_021C59F0->unkDAC = 2; } break; case 2: - if (sub_0202D1C8() != 0) - { + if (sub_0202D1C8() != 0) { return 1; } - if (sub_0202D200() != 0) - { + if (sub_0202D200() != 0) { UNK_021C59F0->unkDAC = 1; } break; @@ -359,10 +309,8 @@ u32 sub_0202E6F0() return 0; } -BOOL sub_0202E784() -{ - if (UNK_021C59F0 != NULL && UNK_021C59F0->unkDAA == 0) - { +BOOL sub_0202E784() { + if (UNK_021C59F0 != NULL && UNK_021C59F0->unkDAA == 0) { UNK_021C59F0->unkDAA = 1; sub_0202D100(); return TRUE; @@ -371,12 +319,9 @@ BOOL sub_0202E784() return FALSE; } -void sub_0202E7B0(u32 param0) -{ - if (UNK_021C59F0 != NULL) - { - if (param0 != 0) - { +void sub_0202E7B0(u32 param0) { + if (UNK_021C59F0 != NULL) { + if (param0 != 0) { UNK_021C59F0->unkDAA = 2; return; } @@ -386,8 +331,7 @@ void sub_0202E7B0(u32 param0) } } -void sub_0202E7D8() -{ +void sub_0202E7D8() { FreeToHeap(UNK_021C59F0->unkCBC); FreeToHeap(UNK_021C59F0->unkCA4); FreeToHeap(UNK_021C59F0); @@ -395,18 +339,14 @@ void sub_0202E7D8() UNK_021C59F0 = NULL; } -u32 sub_0202E810() -{ - if (sub_02030F40() == 0) - { +u32 sub_0202E810() { + if (sub_02030F40() == 0) { return 0; } u32 count = 0; - for (int i = 0; i < 0x10; i++) - { - if (UNK_021C59F0->unkC84[i] != 0) - { + for (int i = 0; i < 0x10; i++) { + if (UNK_021C59F0->unkC84[i] != 0) { count++; } } @@ -414,19 +354,15 @@ u32 sub_0202E810() return count; } -s32 sub_0202E844(u32 param0) -{ +s32 sub_0202E844(u32 param0) { int i; u32 count = 0; - for (i = 0; i < 0x10; i++) - { - if (UNK_021C59F0->unkC84[i] == 0) - { + for (i = 0; i < 0x10; i++) { + if (UNK_021C59F0->unkC84[i] == 0) { continue; } - if (count == param0) - { + if (count == param0) { return i; } @@ -437,26 +373,19 @@ s32 sub_0202E844(u32 param0) return 0; } -u8 sub_0202E878() -{ +u8 sub_0202E878() { return UNK_021C59F0->unkCB4; } -void sub_0202E88C() -{ +void sub_0202E88C() { UNK_021C59F0->unkCB4 = 0; } -s32 sub_0202E8A0(s32 param0) -{ - if (UNK_021C59F0->unkC84[param0] != 0) - { - if (UNK_021C59F0->unk054[param0].unk50.unk06 == 0) - { +s32 sub_0202E8A0(s32 param0) { + if (UNK_021C59F0->unkC84[param0] != 0) { + if (UNK_021C59F0->unk054[param0].unk50.unk06 == 0) { return 1; - } - else - { + } else { return UNK_021C59F0->unk054[param0].unk50.unk06; } } @@ -464,13 +393,10 @@ s32 sub_0202E8A0(s32 param0) return 0; } -s32 sub_0202E8D0(s32 param0) -{ - for (int i = 0xf; i >= 0; i--) - { +s32 sub_0202E8D0(s32 param0) { + for (int i = 0xf; i >= 0; i--) { s32 ret = sub_0202E8A0(i); - if (ret > param0 && 8 > ret) - { + if (ret > param0 && 8 > ret) { return i; } } @@ -478,20 +404,15 @@ s32 sub_0202E8D0(s32 param0) return -1; } -s32 sub_0202E8F4() -{ - if (sub_0202E810() == 0) - { +s32 sub_0202E8F4() { + if (sub_0202E810() == 0) { return -1; } - for (int i = 0xf; i >= 0; i--) - { - if (UNK_021C59F0->unkC84[i] != 0 && sub_0202EFE4(UNK_021C59F0->unk054[i].unk04)) - { + for (int i = 0xf; i >= 0; i--) { + if (UNK_021C59F0->unkC84[i] != 0 && sub_0202EFE4(UNK_021C59F0->unk054[i].unk04)) { s32 ret2 = sub_0202E8A0(i); - if (ret2 > 1 && ret2 < 8) - { + if (ret2 > 1 && ret2 < 8) { return i; } } @@ -500,44 +421,35 @@ s32 sub_0202E8F4() return -1; } -s32 sub_0202E950() -{ - if (sub_0202E810() == 0) - { +s32 sub_0202E950() { + if (sub_0202E810() == 0) { return -1; } - for (int i = 0xf; i >= 0; i--) - { - if (UNK_021C59F0->unkC84[i] != 0 && sub_0202EFE4(UNK_021C59F0->unk054[i].unk04)) - { + for (int i = 0xf; i >= 0; i--) { + if (UNK_021C59F0->unkC84[i] != 0 && sub_0202EFE4(UNK_021C59F0->unk054[i].unk04)) { return i; } } s32 ret = sub_0202E8D0(1); - if (ret == -1) - { + if (ret == -1) { return sub_0202E8D0(0); } return ret; } -void sub_0202E9AC(u32 param0, PlayerProfile *player_data) -{ +void sub_0202E9AC(u32 param0, PlayerProfile *player_data) { int i; u32 count = 0; - for (i = 0; i < 0x10; i++) - { - if (UNK_021C59F0->unkC84[i] == 0) - { + for (i = 0; i < 0x10; i++) { + if (UNK_021C59F0->unkC84[i] == 0) { continue; } - if (param0 == count) - { + if (param0 == count) { PlayerProfile_Copy(sub_0202EF84(i), player_data); return; @@ -547,24 +459,18 @@ void sub_0202E9AC(u32 param0, PlayerProfile *player_data) } } -u32 sub_0202E9E8(u32 param0) -{ - if (sub_0202CBD4() == 2) - { +u32 sub_0202E9E8(u32 param0) { + if (sub_0202CBD4() == 2) { sub_0202C770(); return 0; } - if (sub_0202CBD4() == 1) - { - s32 ret = sub_02033534(); + if (sub_0202CBD4() == 1) { + s32 ret = sub_02033534(); UNK_021C59F0->unkDA8 = (u8)UNK_021C59F0->unk054[param0].unk36; - if (sub_0202D8B0(ret) != 0) - { + if (sub_0202D8B0(ret) != 0) { sub_0202C4D8(1, UNK_021C59F0->unk054[param0].unk04, 0); - } - else - { + } else { sub_0202D034(1, &UNK_021C59F0->unk054[param0]); } @@ -574,35 +480,28 @@ u32 sub_0202E9E8(u32 param0) return 0; } -void sub_0202EA54() -{ - for (int i = 0; i < 0x10; i++) - { - if (UNK_021C59F0->unkC84[i] == 0) - { +void sub_0202EA54() { + for (int i = 0; i < 0x10; i++) { + if (UNK_021C59F0->unkC84[i] == 0) { continue; } - if (UNK_021C59F0->unkC84[i] == 0) - { + if (UNK_021C59F0->unkC84[i] == 0) { continue; } UNK_021C59F0->unkC84[i]--; - if (UNK_021C59F0->unkC84[i] == 0) - { + if (UNK_021C59F0->unkC84[i] == 0) { UNK_021C59F0->unkCB4 = 1; } } } -void sub_0202EA9C() -{ - s32 res = sub_02033534(); +void sub_0202EA9C() { + s32 res = sub_02033534(); PlayerProfile *player_data = sub_0202EF70(); - if (res != 0xf) - { + if (res != 0xf) { struct UnkStruct_0202E29C_sub2 *res = &UNK_021C59F0->unkCC4; GF_ASSERT((s32)sub_02023AC4() <= 0x20); GF_ASSERT(PlayerProfile_sizeof() == 0x20); @@ -617,13 +516,11 @@ void sub_0202EA9C() MI_CpuCopy8(&UNK_021C59F0->unkCA8, &res->unk08.unk00, sizeof(struct MailMessage)); res->unk08.unk4C = (u8)sub_0202D358(); - } - else - { + } else { struct UnkStruct_0202E29C_sub2 *res = &UNK_021C59F0->unkCC4; - res->unk00 = PlayerProfile_GetTrainerID(player_data); - res->unk04 = (u8)sub_02033534(); - res->unk05 = sub_0203354C(); + res->unk00 = PlayerProfile_GetTrainerID(player_data); + res->unk04 = (u8)sub_02033534(); + res->unk05 = sub_0203354C(); MI_CpuCopy8(&UNK_021C59F0->unk000, &res->unk08, sizeof(struct UnkStruct_0202E29C_sub3)); } @@ -632,11 +529,9 @@ void sub_0202EA9C() sub_0202CB7C(&UNK_021C59F0->unkCC4, sizeof(struct UnkStruct_0202E29C_sub2)); } -void sub_0202EB7C() -{ +void sub_0202EB7C() { struct UnkStruct_0202E29C_sub2 *r4 = &UNK_021C59F0->unkCC4; - if (r4->unk06 != sub_0202EDB8()) - { + if (r4->unk06 != sub_0202EDB8()) { r4->unk06 = (u8)sub_0202EDB8(); DC_FlushRange(&UNK_021C59F0->unkCC4, sizeof(struct UnkStruct_0202E29C_sub2)); sub_0202CB7C(&UNK_021C59F0->unkCC4, sizeof(struct UnkStruct_0202E29C_sub2)); @@ -648,55 +543,43 @@ void sub_0202EB7C() } } -void sub_0202EBD0(u16 param0) -{ +void sub_0202EBD0(u16 param0) { u32 r5 = sub_0202CBD4(); sub_0202DF54(); sub_0202EB7C(); - if (sub_0202D19C() == 0 && sub_0202EE24() == 0 && UNK_021C59F0->unkDAD_2) - { + if (sub_0202D19C() == 0 && sub_0202EE24() == 0 && UNK_021C59F0->unkDAD_2) { UNK_021C59F0->unkDAD_0 = 1; } - if (UNK_021C59F0->unkDA6 == 0xFFFF) - { + if (UNK_021C59F0->unkDA6 == 0xFFFF) { UNK_021C59F0->unkDA6 = param0; } - if (UNK_021C59F0->unkDAD_1 && - UNK_021C59F0->unkDA6 > param0) - { + if (UNK_021C59F0->unkDAD_1 && UNK_021C59F0->unkDA6 > param0) { UNK_021C59F0->unkDAD_0 = 1; } - if (sub_0202CBE8() == 25) - { + if (sub_0202CBE8() == 25) { sub_020335D0(0); } - switch (r5) - { + switch (r5) { case 0: - if (UNK_021C59F0->unkDAA == 1) - { + if (UNK_021C59F0->unkDAA == 1) { sub_0202E7D8(); return; - } - else if (UNK_021C59F0->unkDAA == 2) - { + } else if (UNK_021C59F0->unkDAA == 2) { UNK_021C59F0->unkDAA = 3; } break; case 1: - if (UNK_021C59F0->unkDAA == 1 && sub_0202D178() != 0) - { + if (UNK_021C59F0->unkDAA == 1 && sub_0202D178() != 0) { return; } - if (UNK_021C59F0->unkDAA == 2 && sub_0202D178() != 0) - { + if (UNK_021C59F0->unkDAA == 2 && sub_0202D178() != 0) { return; } @@ -705,8 +588,7 @@ void sub_0202EBD0(u16 param0) case 8: case 9: - if (UNK_021C59F0 != NULL) - { + if (UNK_021C59F0 != NULL) { UNK_021C59F0->unkDAD_0 = 1; return; } @@ -714,19 +596,15 @@ void sub_0202EBD0(u16 param0) case 7: u16 r0 = sub_0202CDA4(); - if (UNK_021C59F0->unkDA9 == 0) - { + if (UNK_021C59F0->unkDA9 == 0) { UNK_021C59F0->unkDA4 = r0; UNK_021C59F0->unkDA9 = 5; - } - else - { + } else { UNK_021C59F0->unkDA9--; } u16 r5 = UNK_021C59F0->unkDA4; - if (UNK_021C59F0->unkDAD_3) - { + if (UNK_021C59F0->unkDAD_3) { UNK_021C59E8++; } @@ -745,41 +623,32 @@ void sub_0202EBD0(u16 param0) } } -void sub_0202ED70(u16 param0) -{ - if (UNK_021C59F0 != NULL) - { +void sub_0202ED70(u16 param0) { + if (UNK_021C59F0 != NULL) { sub_0202EBD0(param0); } } -u32 sub_0202ED84(u16 param0) -{ - if (UNK_021C59F0 == NULL) - { +u32 sub_0202ED84(u16 param0) { + if (UNK_021C59F0 == NULL) { return 0; } - if (sub_0202CBD4() != 4) - { + if (sub_0202CBD4() != 4) { return 0; } - if ((sub_0202CB8C() & (1 << param0)) == 0) - { + if ((sub_0202CB8C() & (1 << param0)) == 0) { return 0; } return 1; } -u32 sub_0202EDB8() -{ +u32 sub_0202EDB8() { u32 count = 0; - for (int i = 0; i < 8; i++) - { - if (sub_0202ED84((u16)i) != 0) - { + for (int i = 0; i < 8; i++) { + if (sub_0202ED84((u16)i) != 0) { count++; } } @@ -787,12 +656,9 @@ u32 sub_0202EDB8() return count; } -BOOL sub_0202EDD8() -{ - if (UNK_021C59F0 != NULL) - { - if (UNK_021C59F0->unkDAA == 3) - { +BOOL sub_0202EDD8() { + if (UNK_021C59F0 != NULL) { + if (UNK_021C59F0->unkDAA == 3) { return TRUE; } } @@ -800,98 +666,78 @@ BOOL sub_0202EDD8() return FALSE; } -BOOL sub_0202EDF8() -{ - if (UNK_021C59F0 != NULL) - { +BOOL sub_0202EDF8() { + if (UNK_021C59F0 != NULL) { return TRUE; } return FALSE; } -u32 sub_0202EE0C() -{ - if (UNK_021C59F0 != NULL) - { +u32 sub_0202EE0C() { + if (UNK_021C59F0 != NULL) { return sub_0202D1C8(); } return 1; } -u32 sub_0202EE24() -{ - if (UNK_021C59F0 != NULL) - { +u32 sub_0202EE24() { + if (UNK_021C59F0 != NULL) { return sub_0202CB8C() & 0xFFFE; } return 0; } -BOOL sub_0202EE44() -{ - if (sub_0202EE60() && sub_0202CBE8() == 0x14) - { +BOOL sub_0202EE44() { + if (sub_0202EE60() && sub_0202CBE8() == 0x14) { return TRUE; } return FALSE; } -BOOL sub_0202EE60() -{ - if (UNK_021C59F0 != NULL && UNK_021C59F0->unkDAD_0) - { +BOOL sub_0202EE60() { + if (UNK_021C59F0 != NULL && UNK_021C59F0->unkDAD_0) { return TRUE; } return FALSE; } -void sub_0202EE84(u32 param0) -{ - if (UNK_021C59F0 != NULL) - { +void sub_0202EE84(u32 param0) { + if (UNK_021C59F0 != NULL) { UNK_021C59F0->unkDAD_2 = (u8)param0; } } -void sub_0202EEB0(u32 param0) -{ - if (UNK_021C59F0 != NULL) - { +void sub_0202EEB0(u32 param0) { + if (UNK_021C59F0 != NULL) { UNK_021C59F0->unkDAD_1 = (u8)param0; UNK_021C59F0->unkDA6 = 0xFFFF; } } -u16 sub_0202EEE8(u16 param0) -{ +u16 sub_0202EEE8(u16 param0) { u16 r4 = WM_GetDispersionBeaconPeriod(); GF_ASSERT(param0 < 0x1a); - if (param0 == 0xa) - { + if (param0 == 0xa) { return (u16)(r4 >> 2); } - if (param0 == 9 || param0 == 0xd) - { + if (param0 == 9 || param0 == 0xd) { return (u16)(r4 >> 2); } return r4; } -struct UnkStruct_0202E29C_sub *sub_0202EF18(u32 param0) -{ - if (UNK_021C59F0 != NULL) - { - if (UNK_021C59F0->unkC84[param0] != 0) - { +struct UnkStruct_0202E29C_sub *sub_0202EF18(u32 param0) { + if (UNK_021C59F0 != NULL) { + if (UNK_021C59F0->unkC84[param0] != 0) { return &UNK_021C59F0->unk054[param0]; } } @@ -899,12 +745,9 @@ struct UnkStruct_0202E29C_sub *sub_0202EF18(u32 param0) return NULL; } -struct UnkStruct_0202E29C_sub4 *sub_0202EF44(s32 param0) -{ - if (UNK_021C59F0 != NULL) - { - if (UNK_021C59F0->unkC84[param0] != 0) - { +struct UnkStruct_0202E29C_sub4 *sub_0202EF44(s32 param0) { + if (UNK_021C59F0 != NULL) { + if (UNK_021C59F0->unkC84[param0] != 0) { return &UNK_021C59F0->unk054[param0].unk50; } } @@ -912,15 +755,12 @@ struct UnkStruct_0202E29C_sub4 *sub_0202EF44(s32 param0) return NULL; } -PlayerProfile *sub_0202EF70() -{ +PlayerProfile *sub_0202EF70() { return UNK_021C59F0->unkCB8; } -PlayerProfile *sub_0202EF84(int param0) -{ - if (UNK_021C59F0->unkC84[param0] == 0) - { +PlayerProfile *sub_0202EF84(int param0) { + if (UNK_021C59F0->unkC84[param0] == 0) { return NULL; } @@ -929,22 +769,17 @@ PlayerProfile *sub_0202EF84(int param0) return &r0->unk10; } -void sub_0202EFAC(u8 *param0, s32 param1) -{ - if (UNK_021C59F0 != NULL) - { +void sub_0202EFAC(u8 *param0, s32 param1) { + if (UNK_021C59F0 != NULL) { GF_ASSERT(param1 < 8); MI_CpuCopy8(param0, UNK_021C59F0->unkC54[param1], 6); } } -BOOL sub_0202EFE4(u8 *param0) -{ - for (int i = 0; i < 8; i++) - { - if (WM_IsBssidEqual(UNK_021C59F0->unkC54[i], param0)) - { +BOOL sub_0202EFE4(u8 *param0) { + for (int i = 0; i < 8; i++) { + if (WM_IsBssidEqual(UNK_021C59F0->unkC54[i], param0)) { return TRUE; } } @@ -952,36 +787,29 @@ BOOL sub_0202EFE4(u8 *param0) return FALSE; } -u32 sub_0202F03C() -{ - if (UNK_021C59F0 != NULL) - { +u32 sub_0202F03C() { + if (UNK_021C59F0 != NULL) { return UNK_021C59F0->unkDAD_4; } return 0; } -void sub_0202F05C() -{ - if (UNK_021C59F0 != NULL) - { +void sub_0202F05C() { + if (UNK_021C59F0 != NULL) { UNK_021C59F0->unkDAD_4 = 1; } } -void sub_0202F078(struct MailMessage *mail_message) -{ +void sub_0202F078(struct MailMessage *mail_message) { MI_CpuCopy8(mail_message, &UNK_021C59F0->unkCA8, sizeof(struct MailMessage)); } -void sub_0202F094(void *param0) -{ +void sub_0202F094(void *param0) { MI_CpuCopy8(param0, UNK_021C59F0->unkCBC, sub_02023AC4()); } -void sub_0202F0B8() -{ +void sub_0202F0B8() { sub_0202EA9C(); sub_0202D240(&UNK_021C59F0->unkCC4, sizeof(struct UnkStruct_0202E29C_sub2), @@ -989,15 +817,12 @@ void sub_0202F0B8() UNK_021C59E8); } -u32 sub_0202F0DC(u8 param0) -{ +u32 sub_0202F0DC(u8 param0) { int i; u32 r5 = 0; - for (i = 0; i < 0x10; i++) - { + for (i = 0; i < 0x10; i++) { struct UnkStruct_0202E29C_sub4 *res = sub_0202EF44(i); - if (res != 0 && res->unk04 == param0) - { + if (res != 0 && res->unk04 == param0) { r5 += res->unk06; } } @@ -1005,21 +830,17 @@ u32 sub_0202F0DC(u8 param0) return r5; } -BOOL sub_0202F104() -{ +BOOL sub_0202F104() { return sub_0202D2D0(); } -void sub_0202F10C(struct UnkStruct_0202E29C_sub3 *param0) -{ +void sub_0202F10C(struct UnkStruct_0202E29C_sub3 *param0) { MI_CpuCopy8(param0, &UNK_021C59F0->unk000, sizeof(struct UnkStruct_0202E29C_sub3)); sub_0202F0B8(); } -u8 *sub_0202F124(u32 param0) -{ - if (UNK_021C59F0 != NULL && UNK_021C59F0->unkC84[param0] != 0) - { +u8 *sub_0202F124(u32 param0) { + if (UNK_021C59F0 != NULL && UNK_021C59F0->unkC84[param0] != 0) { struct UnkStruct_0202E29C_sub4 *r0 = &UNK_021C59F0->unk054[param0].unk50; return r0->unk08; } diff --git a/arm9/src/unk_0202F150.c b/arm9/src/unk_0202F150.c index 54fb5efa5..bbf6542b5 100644 --- a/arm9/src/unk_0202F150.c +++ b/arm9/src/unk_0202F150.c @@ -1,8 +1,10 @@ -#include "global.h" #include "unk_0202F150.h" + +#include "global.h" + +#include "unk_0202E29C.h" #include "unk_02031480.h" #include "unk_02031734.h" -#include "unk_0202E29C.h" u8 UNK_021C59F4; struct UnkStruct0202F150 *UNK_021C59F8; @@ -44,23 +46,19 @@ extern void GF_RTC_CopyDateTime(RTCDate *, RTCTime *); extern void sub_0202D830(u8 *param0, u32 param1); extern u32 ov04_021D8624(); -u32 sub_0202F150(u32 param0, u32 param1) -{ - u32 r4 = 0; +u32 sub_0202F150(u32 param0, u32 param1) { + u32 r4 = 0; UNK_021C59F4 = 0; - if (param0 != 0) - { + if (param0 != 0) { int res = sub_0202D858((u16)sub_02033534()) + 1; - if (UNK_021C59F8 != 0) - { + if (UNK_021C59F8 != 0) { return 1; } sub_02031480(HEAP_ID_15); - struct UnkStruct0202F150 *ptr = - (struct UnkStruct0202F150 *)AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct0202F150)); - UNK_021C59F8 = ptr; + struct UnkStruct0202F150 *ptr = (struct UnkStruct0202F150 *)AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct0202F150)); + UNK_021C59F8 = ptr; MI_CpuFill8(ptr, 0, 0x68C); UNK_021C59F8->unk658 = param1 + 0x40; @@ -75,19 +73,14 @@ u32 sub_0202F150(u32 param0, u32 param1) UNK_021C59F8->unk454 = AllocFromHeap(HEAP_ID_15, res * UNK_021C59F8->unk658); - if (sub_02033534() == 0xa) - { + if (sub_02033534() == 0xa) { sub_0202D7D8(UNK_021C59F8->unk54C, 0x64, &UNK_021C59F8->unk464); sub_0202D7D8(UNK_021C59F8->unk56C, 0x32 << 4, &UNK_021C59F8->unk4DC); - } - else - { + } else { sub_0202D7D8(UNK_021C59F8->unk54C, 0x14, &UNK_021C59F8->unk464); sub_0202D7D8(UNK_021C59F8->unk56C, 0x1b + 0xfd, &UNK_021C59F8->unk4DC); } - } - else - { + } else { r4 = 1; GF_ASSERT(UNK_021C59F8 != 0); @@ -95,20 +88,17 @@ u32 sub_0202F150(u32 param0, u32 param1) UNK_021C59F8->unk65C = 0; - for (int i = 0; i < 4; i++) - { + for (int i = 0; i < 4; i++) { UNK_021C59F8->unk677[i] = 0xff; } - if (r4 == 0) - { + if (r4 == 0) { sub_0202F2F0(); } sub_020312BC(UNK_021C59F8->unk5F8); - if (r4 == 0) - { + if (r4 == 0) { u32 res2 = sub_0200CA60(sub_0202FB20, 0, 0); UNK_021C59F8->unk548 = res2; @@ -119,8 +109,7 @@ u32 sub_0202F150(u32 param0, u32 param1) return 1; } -void sub_0202F2F0() -{ +void sub_0202F2F0() { UNK_021C59F8->unk62C = 0; UNK_021C59F8->unk62D = 0; UNK_021C59F8->unk67F = 0; @@ -131,8 +120,7 @@ void sub_0202F2F0() MI_CpuFill8(UNK_021C59F8->unk458, 0, UNK_021C59F8->unk658 * res); int i; - for (i = 0; i < res; i++) - { + for (i = 0; i < res; i++) { sub_0202D394(&UNK_021C59F8->unk4E8[i], UNK_021C59F8->unk458 + i * UNK_021C59F8->unk658, UNK_021C59F8->unk658); @@ -140,8 +128,7 @@ void sub_0202F2F0() MI_CpuFill8(UNK_021C59F8->unk454, 0, UNK_021C59F8->unk658 * res); - for (i = 0; i < res; i++) - { + for (i = 0; i < res; i++) { sub_0202D394(&UNK_021C59F8->unk47C[i], UNK_021C59F8->unk454 + i * UNK_021C59F8->unk658, UNK_021C59F8->unk658); @@ -150,8 +137,7 @@ void sub_0202F2F0() MI_CpuFill8(&UNK_021C59F8->unk2D4, 0, 6 << 6); sub_0202D394(&UNK_021C59F8->unk4DC, UNK_021C59F8->unk2D4, 6 << 6); - for (i = 0; i < 0xc0; i++) - { + for (i = 0; i < 0xc0; i++) { UNK_021C59F8->unk154[0][i] = 0xee; UNK_021C59F8->unk154[1][i] = 0xee; } @@ -162,8 +148,7 @@ void sub_0202F2F0() UNK_021C59F8->unk000[0][0] = 0xff; UNK_021C59F8->unk000[1][0] = 0xff; - for (i = 1; i < 0x26; i++) - { + for (i = 1; i < 0x26; i++) { UNK_021C59F8->unk000[0][i] = 0xee; UNK_021C59F8->unk000[1][i] = 0xee; } @@ -176,8 +161,7 @@ void sub_0202F2F0() UNK_021C59F8->unk684 = 0; UNK_021C59F8->unk685 = 0; - for (i = 0; i < 8; i++) - { + for (i = 0; i < 8; i++) { UNK_021C59F8->unk65F[i] = 0; UNK_021C59F8->unk667[i] = 1; UNK_021C59F8->unk66F[i] = 1; @@ -209,8 +193,7 @@ void sub_0202F2F0() UNK_021C59F8->unk688 = 0; } -void sub_0202F5A4() -{ +void sub_0202F5A4() { UNK_021C59F8->unk62C = 0; UNK_021C59F8->unk62D = 0; @@ -219,8 +202,7 @@ void sub_0202F5A4() MI_CpuFill8(UNK_021C59F8->unk458, 0, UNK_021C59F8->unk658 * res); int i; - for (i = 0; i < res; i++) - { + for (i = 0; i < res; i++) { sub_0202D394(&UNK_021C59F8->unk4E8[i], UNK_021C59F8->unk458 + i * UNK_021C59F8->unk658, UNK_021C59F8->unk658); @@ -228,8 +210,7 @@ void sub_0202F5A4() MI_CpuFill8(UNK_021C59F8->unk454, 0, UNK_021C59F8->unk658 * res); - for (i = 0; i < res; i++) - { + for (i = 0; i < res; i++) { sub_0202D394(&UNK_021C59F8->unk47C[i], UNK_021C59F8->unk454 + i * UNK_021C59F8->unk658, UNK_021C59F8->unk658); @@ -238,8 +219,7 @@ void sub_0202F5A4() MI_CpuFill8(&UNK_021C59F8->unk2D4, 0, 6 << 6); sub_0202D394(&UNK_021C59F8->unk4DC, UNK_021C59F8->unk2D4, 6 << 6); - for (i = 0; i < 0xc0; i++) - { + for (i = 0; i < 0xc0; i++) { UNK_021C59F8->unk154[0][i] = 0xee; UNK_021C59F8->unk154[1][i] = 0xee; } @@ -250,8 +230,7 @@ void sub_0202F5A4() UNK_021C59F8->unk000[0][0] = 0xff; UNK_021C59F8->unk000[1][0] = 0xff; - for (i = 1; i < 0x26; i++) - { + for (i = 1; i < 0x26; i++) { UNK_021C59F8->unk000[0][i] = 0xee; UNK_021C59F8->unk000[1][i] = 0xee; } @@ -263,8 +242,7 @@ void sub_0202F5A4() UNK_021C59F8->unk684 = 0; UNK_021C59F8->unk685 = 0; - for (i = 0; i < 8; i++) - { + for (i = 0; i < 8; i++) { UNK_021C59F8->unk65F[i] = 0; UNK_021C59F8->unk667[i] = 1; UNK_021C59F8->unk66F[i] = 1; @@ -290,8 +268,7 @@ void sub_0202F5A4() UNK_021C59F8->unk688 = 0; } -void sub_0202F820(int param0) -{ +void sub_0202F820(int param0) { UNK_021C59F8->unk65F[param0] = 0; UNK_021C59F8->unk667[param0] = 1; @@ -314,27 +291,21 @@ void sub_0202F820(int param0) UNK_021C59F8->unk58C[param0].unk00 = 0; } -void sub_0202F8D4() -{ - for (int i = 1; i < 8; i++) - { - if (sub_02030E7C((u16)i) == 0 && UNK_021C59F8->unk667[i] == 0 && sub_02031280() == 0) - { +void sub_0202F8D4() { + for (int i = 1; i < 8; i++) { + if (sub_02030E7C((u16)i) == 0 && UNK_021C59F8->unk667[i] == 0 && sub_02031280() == 0) { sub_0202F820(i); } } } -void sub_0202F910(int param0) -{ +void sub_0202F910(int param0) { sub_0202F820(param0); } -BOOL sub_0202F918(u32 param0, u32 param1, u32 param2, u32 param3) -{ +BOOL sub_0202F918(u32 param0, u32 param1, u32 param2, u32 param3) { BOOL ret = TRUE; - if (sub_02033534() < 0x13) - { + if (sub_02033534() < 0x13) { ret = sub_0202E5F8(param0, param1, param3); sub_0202D330(sub_0202F910); } @@ -344,11 +315,9 @@ BOOL sub_0202F918(u32 param0, u32 param1, u32 param2, u32 param3) return ret; } -u32 sub_0202F950(u32 param0, u32 param1, u32 param2) -{ +u32 sub_0202F950(u32 param0, u32 param1, u32 param2) { u32 ret = 1; - if (sub_02033534() < 0x13) - { + if (sub_02033534() < 0x13) { ret = sub_0202E66C(param0, param1); } @@ -359,112 +328,84 @@ u32 sub_0202F950(u32 param0, u32 param1, u32 param2) return ret; } -void sub_0202F984() -{ +void sub_0202F984() { u32 r4 = 0; - if (sub_02031190() == 0) - { - if (UNK_02105D59 != 4) - { + if (sub_02031190() == 0) { + if (UNK_02105D59 != 4) { return; } - } - else - { - if (UNK_02105D58 != 4) - { + } else { + if (UNK_02105D58 != 4) { return; } } - if (UNK_021C59F8->unk67D == 2) - { + if (UNK_021C59F8->unk67D == 2) { UNK_021C59F8->unk67D = 0; - r4 = 1; + r4 = 1; } - if (UNK_021C59F8->unk67D == 3) - { + if (UNK_021C59F8->unk67D == 3) { UNK_021C59F8->unk67D = 1; - r4 = 1; + r4 = 1; } - if (r4 != 0) - { + if (r4 != 0) { sub_0202F5A4(); } sub_02031088(); } -void sub_0202F9E0(u32 param0) -{ +void sub_0202F9E0(u32 param0) { u8 r2 = UNK_021C59F8->unk67D; - if (r2 == 0 && param0 == 1) - { + if (r2 == 0 && param0 == 1) { UNK_021C59F8->unk67D = 3; - } - else if (r2 == 1 && param0 == 0) - { + } else if (r2 == 1 && param0 == 0) { UNK_021C59F8->unk67D = 2; } } -void sub_0202FA10() -{ +void sub_0202FA10() { sub_0202F9E0(1); } -void sub_0202FA1C() -{ +void sub_0202FA1C() { sub_0202F9E0(0); } -u8 sub_0202FA28() -{ +u8 sub_0202FA28() { u8 ret = UNK_021C59F8->unk67D; - if (ret == 2) - { + if (ret == 2) { return 1; - } - else if (ret == 3) - { + } else if (ret == 3) { return 0; } return ret; } -u32 sub_0202FA48() -{ - if (sub_0202FA28() == 1) - { +u32 sub_0202FA48() { + if (sub_0202FA28() == 1) { return 1; } return 0; } -void sub_0202FA5C() -{ +void sub_0202FA5C() { u32 r4 = 0; - if (UNK_021C59F8 != 0) - { - if (sub_02033534() >= 0x13) - { + if (UNK_021C59F8 != 0) { + if (sub_02033534() >= 0x13) { ov04_021D83C0(); r4 = 1; - } - else - { - if (sub_0202E784()) - { + } else { + if (sub_0202E784()) { r4 = 1; } } } - if (r4 != 0) - { + if (r4 != 0) { sub_020314D0(); sub_0202DBA4(); UNK_021C59F4 = 0; @@ -482,18 +423,14 @@ void sub_0202FA5C() } } -u32 sub_0202FB18(u32 param0) -{ +u32 sub_0202FB18(u32 param0) { return sub_0202E9E8(param0); } -void sub_0202FB20() -{ - if (UNK_021C59F4 != 0) - { +void sub_0202FB20() { + if (UNK_021C59F4 != 0) { sub_0203050C(); - if ((sub_02031190() == 0 && sub_02030E7C(0) != 0) || sub_02031280() != 0) - { + if ((sub_02031190() == 0 && sub_02030E7C(0) != 0) || sub_02031280() != 0) { sub_0202FEEC(); } @@ -501,32 +438,23 @@ void sub_0202FB20() } } -void sub_0202FB58() -{ - if (sub_0202F03C() != 0) - { - if (sub_02031190() == 0) - { - if (sub_0202EE24() == 0) - { +void sub_0202FB58() { + if (sub_0202F03C() != 0) { + if (sub_02031190() == 0) { + if (sub_0202EE24() == 0) { sub_0202FA5C(); } - } - else - { + } else { sub_0202FA5C(); } } } -BOOL sub_0202FB80() -{ +BOOL sub_0202FB80() { sub_02031CDC(); - if (UNK_021C59F8 != NULL) - { - if (UNK_021C59F8->unk68A == 0) - { + if (UNK_021C59F8 != NULL) { + if (UNK_021C59F8->unk68A == 0) { UNK_021C59F4 = 0; sub_0202F984(); UNK_021C59F8->unk628 |= gSystem.heldKeys & 0x7FFF; @@ -534,18 +462,15 @@ BOOL sub_0202FB80() sub_0202FCCC(); UNK_021C59F8->unk628 &= 2 << 0xe; - if (sub_0202FA28() == 0) - { + if (sub_0202FA28() == 0) { sub_02030DA4(); } - if ((sub_02031190() == 0 && sub_02030E7C(0) != 0) || sub_02031280() != 0) - { + if ((sub_02031190() == 0 && sub_02030E7C(0) != 0) || sub_02031280() != 0) { sub_02030074(); } - if (sub_02031190() == 0 || sub_0202FA28() == 1 || sub_02031280() != 0) - { + if (sub_02031190() == 0 || sub_0202FA28() == 1 || sub_02031280() != 0) { sub_02030DFC(); } @@ -554,15 +479,12 @@ BOOL sub_0202FB80() sub_0202ED70(UNK_021C59F8->unk65C); - if (sub_02031190() == 0) - { + if (sub_02031190() == 0) { sub_0202F8D4(); } sub_0202FB58(); - } - else - { + } else { sub_0202ED70(0); } @@ -572,28 +494,24 @@ BOOL sub_0202FB80() return TRUE; } -void sub_0202FC60() -{ +void sub_0202FC60() { u8 r4 = UNK_021C59F4; UNK_021C59F4 = 0; - if (UNK_021C59F8 != NULL) - { + if (UNK_021C59F8 != NULL) { sub_0202F2F0(); } UNK_021C59F4 = r4; } -void sub_0202FC80() -{ +void sub_0202FC80() { u8 r4 = UNK_021C59F4; UNK_021C59F4 = 0; - if (UNK_021C59F8 != NULL) - { + if (UNK_021C59F8 != NULL) { UNK_021C59F8->unk67D = 1; sub_0202F2F0(); } @@ -601,14 +519,12 @@ void sub_0202FC80() UNK_021C59F4 = r4; } -void sub_0202FCA8() -{ +void sub_0202FCA8() { u8 r4 = UNK_021C59F4; UNK_021C59F4 = 0; - if (UNK_021C59F8 != NULL) - { + if (UNK_021C59F8 != NULL) { sub_0202F2F0(); sub_0202E538(); } @@ -616,14 +532,10 @@ void sub_0202FCA8() UNK_021C59F4 = r4; } -void sub_0202FCCC() -{ - if (UNK_021C59F8->unk683 != 0) - { - if (sub_02033534() >= 0x13) - { - if (UNK_021C59F8->unk687 == 0 || ov04_021D78FC(UNK_021C59F8, 0x26) == 0) - { +void sub_0202FCCC() { + if (UNK_021C59F8->unk683 != 0) { + if (sub_02033534() >= 0x13) { + if (UNK_021C59F8->unk687 == 0 || ov04_021D78FC(UNK_021C59F8, 0x26) == 0) { return; } @@ -631,18 +543,15 @@ void sub_0202FCCC() return; } - if (sub_0202CBD4() != 4 || sub_02030E7C(sub_02031190()) == 0) - { - if (sub_02031280() == 0) - { + if (sub_0202CBD4() != 4 || sub_02030E7C(sub_02031190()) == 0) { + if (sub_02031280() == 0) { return; } } UNK_02105D58 = 0; sub_0203050C(); - if (UNK_02105D58 == 0) - { + if (UNK_02105D58 == 0) { return; } @@ -650,32 +559,23 @@ void sub_0202FCCC() return; } - if (sub_02033534() >= 0x13) - { - if (UNK_021C59F8->unk687 == 0) - { + if (sub_02033534() >= 0x13) { + if (UNK_021C59F8->unk687 == 0) { return; } - if (UNK_021C59F8->unk630 != 0) - { - if ((int)UNK_021C59F8->unk634 > 3) - { + if (UNK_021C59F8->unk630 != 0) { + if ((int)UNK_021C59F8->unk634 > 3) { return; } - if (UNK_02105D58 == 4) - { + if (UNK_02105D58 == 4) { sub_02030930(UNK_021C59F8->unk000[0]); UNK_02105D58 = 2; } - } - else - { - if (UNK_02105D58 == 4) - { - if (sub_02030930(UNK_021C59F8->unk000[0]) == 0) - { + } else { + if (UNK_02105D58 == 4) { + if (sub_02030930(UNK_021C59F8->unk000[0]) == 0) { return; } @@ -683,8 +583,7 @@ void sub_0202FCCC() } } - if (ov04_021D78FC(UNK_021C59F8, 0x26) == 0) - { + if (ov04_021D78FC(UNK_021C59F8, 0x26) == 0) { return; } @@ -693,22 +592,18 @@ void sub_0202FCCC() return; } - if (sub_0202CBD4() != 4 || sub_02030E7C(sub_02031190()) == 0) - { - if (sub_02031280() == 0) - { + if (sub_0202CBD4() != 4 || sub_02030E7C(sub_02031190()) == 0) { + if (sub_02031280() == 0) { return; } } - if (UNK_02105D58 != 4) - { + if (UNK_02105D58 != 4) { return; } // nonmatching - if ((int)UNK_021C59F8->unk634 > 3) - { + if ((int)UNK_021C59F8->unk634 > 3) { return; } @@ -721,8 +616,7 @@ void sub_0202FCCC() } #ifdef NONMATCHING -BOOL sub_0202FE2C(int param0) -{ +BOOL sub_0202FE2C(int param0) { // these 3 variables are shuffled on the stack, everything else matches int stc; @@ -732,35 +626,30 @@ BOOL sub_0202FE2C(int param0) stc = sub_02031228(sub_02033534()); st8 = sub_0202D858(sub_02033534()) + 1; - for (r7 = 0; r7 < st8; r7++) - { + for (r7 = 0; r7 < st8; r7++) { sub_0202D4BC(&UNK_021C59F8->unk47C[r7]); - if (sub_02030E7C(r7)) - { + if (sub_02030E7C(r7)) { UNK_021C59F8->unk154[param0][r7 * stc] = 0xe; } unused = sub_0202D400( &UNK_021C59F8->unk47C[r7], &UNK_021C59F8->unk154[param0][r7 * stc], stc); - if (UNK_021C59F8->unk154[param0][r7 * stc] == 0xe) - { + if (UNK_021C59F8->unk154[param0][r7 * stc] == 0xe) { st4++; } } - if (st4 == st8) - { + if (st4 == st8) { return FALSE; } return TRUE; } #else -asm BOOL sub_0202FE2C(int param0) -{ +asm BOOL sub_0202FE2C(int param0) { // clang-format off push {r3-r7, lr} sub sp, #0x10 @@ -856,49 +745,39 @@ asm BOOL sub_0202FE2C(int param0) } #endif -void sub_0202FEEC() -{ - if (UNK_021C59F8 == NULL || sub_02033534() >= 0x13) - { +void sub_0202FEEC() { + if (UNK_021C59F8 == NULL || sub_02033534() >= 0x13) { return; } int st0 = sub_02031228((u16)sub_02033534()); - int r6 = sub_0202D858((u16)sub_02033534()) + 1; + int r6 = sub_0202D858((u16)sub_02033534()) + 1; - if (UNK_02105D59 == 2 || UNK_02105D59 == 0) - { + if (UNK_02105D59 == 2 || UNK_02105D59 == 0) { UNK_02105D59++; - if (sub_0202FA28() == 1) - { + if (sub_0202FA28() == 1) { sub_0202FE2C(UNK_021C59F8->unk680); } - if (sub_0202CBD4() == 4 && sub_02031280() == 0) - { + if (sub_0202CBD4() == 4 && sub_02031280() == 0) { if (sub_0202D0D0(UNK_021C59F8->unk154[UNK_021C59F8->unk680], 0xc0, 0xe, - sub_020304F0) == 0) - { + sub_020304F0) + == 0) { UNK_02105D59--; } } int i; - if (UNK_02105D59 == 1 || UNK_02105D59 == 3) - { - for (i = 0; i < r6; i++) - { - if (sub_02030E7C((u16)i) != 0) - { + if (UNK_02105D59 == 1 || UNK_02105D59 == 3) { + for (i = 0; i < r6; i++) { + if (sub_02030E7C((u16)i) != 0) { UNK_021C59F8->unk638[i]++; - } - else if (sub_02031280() != 0 && i == 0) - { + } else if (sub_02031280() != 0 && i == 0) { UNK_021C59F8->unk638[i]++; } } @@ -908,74 +787,52 @@ void sub_0202FEEC() UNK_021C59F8->unk680 = (u8)(1 - UNK_021C59F8->unk680); } - for (i = 0; i < r6; i++) - { - if (sub_02030E7C((u16)i) == 0 && sub_0202FA28() == 1) - { + for (i = 0; i < r6; i++) { + if (sub_02030E7C((u16)i) == 0 && sub_0202FA28() == 1) { UNK_021C59F8->unk154[UNK_021C59F8->unk680][i * st0] = 0xff; } } - if (sub_0202CBD4() != 4 || sub_02031280() != 0) - { + if (sub_0202CBD4() != 4 || sub_02031280() != 0) { UNK_02105D59++; } } } -void sub_02030074() -{ - if (UNK_021C59F8->unk683 != 0) - { - if (sub_02033534() >= 0x13) - { - if (sub_02030E7C(0) != 0 && ov04_021D79B4(UNK_021C59F8->unk154, 0x4c) != 0) - { +void sub_02030074() { + if (UNK_021C59F8->unk683 != 0) { + if (sub_02033534() >= 0x13) { + if (sub_02030E7C(0) != 0 && ov04_021D79B4(UNK_021C59F8->unk154, 0x4c) != 0) { UNK_021C59F8->unk683 = 0; return; } - } - else if (sub_0202CBD4() == 4 || sub_02031280() != 0) - { + } else if (sub_0202CBD4() == 4 || sub_02031280() != 0) { sub_0202FEEC(); - if (UNK_02105D59 == 2) - { + if (UNK_02105D59 == 2) { UNK_021C59F8->unk683 = 0; return; } } } - if (sub_02033534() >= 0x13) - { - if (sub_02030E7C(0) != 0) - { - if (UNK_021C59F8->unk630 != 0) - { - if ((int)UNK_021C59F8->unk638[1] > 3 || - (int)UNK_021C59F8->unk638[0] > 3) - { + if (sub_02033534() >= 0x13) { + if (sub_02030E7C(0) != 0) { + if (UNK_021C59F8->unk630 != 0) { + if ((int)UNK_021C59F8->unk638[1] > 3 || (int)UNK_021C59F8->unk638[0] > 3) { return; } - if (UNK_02105D59 == 4) - { - if (sub_0202FA28() == 1) - { + if (UNK_02105D59 == 4) { + if (sub_0202FA28() == 1) { sub_0202FE2C(0); } UNK_02105D59 = 2; } - } - else - { - if (UNK_02105D59 == 4) - { - if (sub_0202FA28() == 1) - { - if (sub_0202FE2C(0) == 0) - { + } else { + if (UNK_02105D59 == 4) { + if (sub_0202FA28() == 1) { + if (sub_0202FE2C(0) == 0) { return; } } @@ -984,8 +841,7 @@ void sub_02030074() UNK_02105D59 = 2; } - if (ov04_021D79B4(UNK_021C59F8->unk154, 0x4c) == 0) - { + if (ov04_021D79B4(UNK_021C59F8->unk154, 0x4c) == 0) { return; } @@ -993,34 +849,23 @@ void sub_02030074() UNK_021C59F8->unk638[0]++; UNK_021C59F8->unk638[1]++; } - } - else if (sub_0202CBD4() == 4 || sub_02031280() != 0) - { - if (UNK_02105D59 == 4) - { - for (int r4 = 1; r4 < 8; r4++) - { - if (sub_02030E7C((u16)r4) != 0) - { - if ((int)UNK_021C59F8->unk638[r4] > 3) - { + } else if (sub_0202CBD4() == 4 || sub_02031280() != 0) { + if (UNK_02105D59 == 4) { + for (int r4 = 1; r4 < 8; r4++) { + if (sub_02030E7C((u16)r4) != 0) { + if ((int)UNK_021C59F8->unk638[r4] > 3) { return; } - } - else if (r4 == 0) - { - if (sub_02031280() != 0) - { - if ((int)UNK_021C59F8->unk638[0] > 3) - { + } else if (r4 == 0) { + if (sub_02031280() != 0) { + if ((int)UNK_021C59F8->unk638[0] > 3) { return; } } } } - if (sub_0202FA28() == 0) - { + if (sub_0202FA28() == 0) { sub_02030A00(UNK_021C59F8->unk154[UNK_021C59F8->unk680]); sub_02030A00(UNK_021C59F8->unk154[1 - UNK_021C59F8->unk680]); } @@ -1031,10 +876,8 @@ void sub_02030074() } } -void sub_02030238(u32 param0, u8 *param1, u32 param2) -{ - if (UNK_021C59F8->unk66F[0] != 0) - { +void sub_02030238(u32 param0, u8 *param1, u32 param2) { + if (UNK_021C59F8->unk66F[0] != 0) { UNK_021C59F8->unk634--; UNK_021C59F8->unk66F[0] = 0; return; @@ -1043,73 +886,52 @@ void sub_02030238(u32 param0, u8 *param1, u32 param2) sub_0203026C(param0, param1, param2); } -void sub_0203026C(u32 param0, u8 *param1, u32 param2) -{ +void sub_0203026C(u32 param0, u8 *param1, u32 param2) { #pragma unused(param0) #pragma unused(param2) UNK_021C59F8->unk634--; - if (param1 == 0) - { + if (param1 == 0) { return; } - if (param1[0] == 0xb) - { - if (sub_0202FA28() == 1) - { + if (param1[0] == 0xb) { + if (sub_0202FA28() == 1) { return; } param1++; - } - else - { - if (sub_0202FA28() == 0) - { + } else { + if (sub_0202FA28() == 0) { return; } } - if (UNK_021C59F8->unk682 != 0) - { - if ((param1[0] & 1) != 0) - { + if (UNK_021C59F8->unk682 != 0) { + if ((param1[0] & 1) != 0) { return; } } UNK_021C59F8->unk682 = 0; - if (sub_0202FA28() == 1) - { - int r6 = sub_02031228((u16)sub_02033534()); + if (sub_0202FA28() == 1) { + int r6 = sub_02031228((u16)sub_02033534()); int st4 = sub_0202D858((u16)sub_02033534()) + 1; int r4 = 0; - while (r4 < st4) - { + while (r4 < st4) { - if (param1[0] == 0xff) - { + if (param1[0] == 0xff) { UNK_021C59F8->unk65C &= ~(1 << r4); - } - else - { + } else { UNK_021C59F8->unk65C |= (1 << r4); } - if (param1[0] == 0xff) - { + if (param1[0] == 0xff) { param1 += r6; - } - else if (param1[0] == 0xe) - { + } else if (param1[0] == 0xe) { param1 += r6; - } - else if (UNK_021C59F8->unk667[r4] != 0 && (param1[0] & 1) != 0) - { + } else if (UNK_021C59F8->unk667[r4] != 0 && (param1[0] & 1) != 0) { param1 += r6; - } - else - { + } else { param1++; sub_0202D3A4(&UNK_021C59F8->unk4E8[r4], param1, (u32)(r6 - 1), 0x5E6); @@ -1130,10 +952,8 @@ void sub_0203026C(u32 param0, u8 *param1, u32 param2) sub_0202D3A4(&UNK_021C59F8->unk470, param1 + 4, param1[3], 0x5FF); } -void sub_020303BC(u32 param0, u8 *param1, u32 param2) -{ - if (UNK_021C59F8->unk66F[param0] != 0) - { +void sub_020303BC(u32 param0, u8 *param1, u32 param2) { + if (UNK_021C59F8->unk66F[param0] != 0) { UNK_021C59F8->unk638[param0]--; UNK_021C59F8->unk66F[param0] = 0; @@ -1143,28 +963,23 @@ void sub_020303BC(u32 param0, u8 *param1, u32 param2) sub_020303F4(param0, param1, param2); } -void sub_020303F4(u32 param0, u8 *param1, u32 param2) -{ +void sub_020303F4(u32 param0, u8 *param1, u32 param2) { #pragma unused(param2) UNK_021C59F8->unk638[param0]--; - if (param1 == 0) - { + if (param1 == 0) { return; } - if (UNK_021C59F8->unk667[param0] != 0 && (param1[0] & 1) != 0) - { + if (UNK_021C59F8->unk667[param0] != 0 && (param1[0] & 1) != 0) { return; } UNK_021C59F8->unk667[param0] = 0; - if (sub_0202FA28() == 1) - { + if (sub_0202FA28() == 1) { int r6 = sub_02031228((u16)sub_02033534()); sub_0202D858((u16)sub_02033534()); - if ((param1[0] & 2) == 0) - { + if ((param1[0] & 2) == 0) { sub_0202D3A4(&UNK_021C59F8->unk47C[param0], param1, (u32)r6, 0x65E); } @@ -1174,16 +989,13 @@ void sub_020303F4(u32 param0, u8 *param1, u32 param2) sub_020307E4(param1, param0); - if ((param1[0] & 2) == 0 && sub_0202D498(&UNK_021C59F8->unk4E8[param0]) >= 0xb) - { + if ((param1[0] & 2) == 0 && sub_0202D498(&UNK_021C59F8->unk4E8[param0]) >= 0xb) { sub_0202D3A4(&UNK_021C59F8->unk4E8[param0], param1 + 1, 0xb, 0x66E); } } -void sub_020304D4(u32 param0) -{ - if (param0 != 0) - { +void sub_020304D4(u32 param0) { + if (param0 != 0) { UNK_02105D58++; return; } @@ -1191,10 +1003,8 @@ void sub_020304D4(u32 param0) GF_ASSERT(0); } -void sub_020304F0(u32 param0) -{ - if (param0 != 0) - { +void sub_020304F0(u32 param0) { + if (param0 != 0) { UNK_02105D59++; return; } @@ -1202,18 +1012,15 @@ void sub_020304F0(u32 param0) GF_ASSERT(0); } -void sub_0203050C() -{ - if (UNK_021C59F8 == 0 || sub_02033534() >= 0x13) - { +void sub_0203050C() { + if (UNK_021C59F8 == 0 || sub_02033534() >= 0x13) { return; } int r4 = sub_02031228((u16)sub_02033534()); sub_0202D858((u16)sub_02033534()); - if (sub_02031280() != 0 && (UNK_02105D58 == 2 || UNK_02105D58 == 0)) - { + if (sub_02031280() != 0 && (UNK_02105D58 == 2 || UNK_02105D58 == 0)) { UNK_02105D58++; sub_020304D4(1); @@ -1224,31 +1031,27 @@ void sub_0203050C() return; } - if (sub_0202CBD4() != 4) - { + if (sub_0202CBD4() != 4) { return; } - if (sub_02030E7C(sub_02031190()) == 0) - { + if (sub_02030E7C(sub_02031190()) == 0) { sub_02031190(); return; } - if (UNK_02105D58 != 2 && UNK_02105D58 != 0) - { + if (UNK_02105D58 != 2 && UNK_02105D58 != 0) { return; } - if (sub_02031190() != 0) - { + if (sub_02031190() != 0) { UNK_02105D58++; if (sub_0202D0D0(UNK_021C59F8->unk000[UNK_021C59F8->unk67F], (u16)r4, 0xe, - sub_020304D4) == 0) - { + sub_020304D4) + == 0) { UNK_02105D58--; return; } @@ -1258,8 +1061,7 @@ void sub_0203050C() return; } - if ((sub_0202CB8C() & 0xFFFE) != 0) - { + if ((sub_0202CB8C() & 0xFFFE) != 0) { UNK_02105D58++; sub_020304D4(1); @@ -1271,56 +1073,40 @@ void sub_0203050C() } #ifdef NONMATCHING -void sub_02030674() -{ +void sub_02030674() { u16 r4 = 0; - if (UNK_021C59F8->unk62C == 0 || (UNK_021C59F8->unk628 & 0xf0) == 0) - { + if (UNK_021C59F8->unk62C == 0 || (UNK_021C59F8->unk628 & 0xf0) == 0) { return; } - if (UNK_021C59F8->unk62C == 2) - { - if ((UNK_021C59F8->unk628 & 0x20) != 0) - { + if (UNK_021C59F8->unk62C == 2) { + if ((UNK_021C59F8->unk628 & 0x20) != 0) { r4 = r4 | 0x10; } - if ((UNK_021C59F8->unk628 & 0x10) != 0) - { + if ((UNK_021C59F8->unk628 & 0x10) != 0) { r4 = r4 | 0x20; } - if ((UNK_021C59F8->unk628 & 0x40) != 0) - { + if ((UNK_021C59F8->unk628 & 0x40) != 0) { r4 = r4 | 0x80; } - if ((UNK_021C59F8->unk628 & 0x80) != 0) - { + if ((UNK_021C59F8->unk628 & 0x80) != 0) { r4 = r4 | 0x40; } - } - else - { - if (UNK_021C59F8->unk62E != 0) - { + } else { + if (UNK_021C59F8->unk62E != 0) { r4 = UNK_021C59F8->unk62E; UNK_021C59F8->unk62D--; - if (UNK_021C59F8->unk62D < 0) - { + if (UNK_021C59F8->unk62D < 0) { UNK_021C59F8->unk62E = 0; } - } - else - { - UNK_021C59F8->unk5F8[0] = - UNK_021C59F8->unk5F8[1] * UNK_021C59F8->unk5F8[0] + - UNK_021C59F8->unk5F8[2]; - - switch ((u32)(UNK_021C59F8->unk5F8[0] >> 0x3E) | (0 << 2)) - { + } else { + UNK_021C59F8->unk5F8[0] = UNK_021C59F8->unk5F8[1] * UNK_021C59F8->unk5F8[0] + UNK_021C59F8->unk5F8[2]; + + switch ((u32)(UNK_021C59F8->unk5F8[0] >> 0x3E) | (0 << 2)) { case 0: r4 = 0x20; break; @@ -1335,11 +1121,9 @@ void sub_02030674() break; } - UNK_021C59F8->unk5F8[0] = - UNK_021C59F8->unk5F8[2] + - UNK_021C59F8->unk5F8[1] * UNK_021C59F8->unk5F8[0]; - UNK_021C59F8->unk62D = UNK_021C59F8->unk5F8[0] >> 0x3c | (0 << 4); - UNK_021C59F8->unk62E = r4; + UNK_021C59F8->unk5F8[0] = UNK_021C59F8->unk5F8[2] + UNK_021C59F8->unk5F8[1] * UNK_021C59F8->unk5F8[0]; + UNK_021C59F8->unk62D = UNK_021C59F8->unk5F8[0] >> 0x3c | (0 << 4); + UNK_021C59F8->unk62E = r4; } } @@ -1347,8 +1131,7 @@ void sub_02030674() UNK_021C59F8->unk628 += r4; } #else -asm void sub_02030674() -{ +asm void sub_02030674() { // clang-format off push {r3-r7, lr} ldr r7, =UNK_021C59F4 @@ -1519,44 +1302,32 @@ asm void sub_02030674() } #endif -void sub_020307A8() -{ +void sub_020307A8() { UNK_021C59F8->unk62C = 1; } -void sub_020307BC() -{ +void sub_020307BC() { UNK_021C59F8->unk62C = 2; } -void sub_020307D0() -{ +void sub_020307D0() { UNK_021C59F8->unk62C = 0; } -u32 sub_020307E4(u8 *param0, u32 param1) -{ +u32 sub_020307E4(u8 *param0, u32 param1) { UNK_021C59F8->unk610[param1] = 0; int r7 = param0[0] & 0x10; - if (r7 == 0x10) - { + if (r7 == 0x10) { u8 r5 = (u8)(param0[0] & 0xc); - if (r5 == 0) - { + if (r5 == 0) { UNK_021C59F8->unk610[param1] |= 0x40; - } - else if (r5 == 4) - { + } else if (r5 == 4) { UNK_021C59F8->unk610[param1] |= 0x80; - } - else if (r5 == 8) - { + } else if (r5 == 8) { UNK_021C59F8->unk610[param1] |= 0x20; - } - else if (r5 == 0xc) - { + } else if (r5 == 0xc) { UNK_021C59F8->unk610[param1] |= 0x10; } @@ -1566,44 +1337,32 @@ u32 sub_020307E4(u8 *param0, u32 param1) return 1; } -void sub_0203086C() -{ +void sub_0203086C() { } -u32 sub_02030870(u8 *param0) -{ - if (UNK_021C59F8->unk62A != 0) - { +u32 sub_02030870(u8 *param0) { + if (UNK_021C59F8->unk62A != 0) { return 0; } - if (sub_02030FE0() == 0) - { + if (sub_02030FE0() == 0) { return 0; } - if (UNK_021C59F8->unk681 != 0) - { + if (UNK_021C59F8->unk681 != 0) { UNK_021C59F8->unk681--; } - if ((UNK_021C59F8->unk628 & 0x40) != 0) - { + if ((UNK_021C59F8->unk628 & 0x40) != 0) { param0[0] |= 0x10; UNK_021C59F8->unk681 = 8; - } - else if ((UNK_021C59F8->unk628 & 0x80) != 0) - { + } else if ((UNK_021C59F8->unk628 & 0x80) != 0) { param0[0] |= 0x14; UNK_021C59F8->unk681 = 8; - } - else if ((UNK_021C59F8->unk628 & 0x20) != 0) - { + } else if ((UNK_021C59F8->unk628 & 0x20) != 0) { param0[0] |= 0x18; UNK_021C59F8->unk681 = 8; - } - else if ((UNK_021C59F8->unk628 & 0x10) != 0) - { + } else if ((UNK_021C59F8->unk628 & 0x10) != 0) { param0[0] |= 0x1c; UNK_021C59F8->unk681 = 8; } @@ -1613,47 +1372,36 @@ u32 sub_02030870(u8 *param0) return 0; } -u32 sub_02030930(u8 *param0) -{ +u32 sub_02030930(u8 *param0) { int r5 = sub_02031228((u16)sub_02033534()); sub_0202D858((u16)sub_02033534()); - if (UNK_021C59F8->unk684 == 0) - { + if (UNK_021C59F8->unk684 == 0) { param0[0] = 0; - } - else - { + } else { param0[0] = 1; } - if (sub_0202FA28() == 0) - { + if (sub_0202FA28() == 0) { sub_02030870(param0); } UNK_021C59F8->unk684 = 0; - if (sub_0202D4E4(UNK_021C59F8->unk54C) != 0) - { + if (sub_0202D4E4(UNK_021C59F8->unk54C) != 0) { param0[0] |= 2; - if (param0[0] == 2) - { + if (param0[0] == 2) { return 0; } - } - else - { + } else { int st0[2]; st0[1] = r5 - 1; st0[0] = (int)param0 + 1; - if (sub_0202D760(UNK_021C59F8->unk54C, st0, 1) == 0) - { + if (sub_0202D760(UNK_021C59F8->unk54C, st0, 1) == 0) { UNK_021C59F8->unk684 = 1; } - if (sub_0202FA28() == 1) - { + if (sub_0202FA28() == 1) { UNK_021C59F8->unk65E++; param0[0] |= UNK_021C59F8->unk65E << 4 & 0xf0; @@ -1663,152 +1411,124 @@ u32 sub_02030930(u8 *param0) return 1; } -void sub_02030A00(u8 *param0) -{ +void sub_02030A00(u8 *param0) { param0[0] = 0xb; - if (UNK_021C59F8->unk685 == 0) - { + if (UNK_021C59F8->unk685 == 0) { param0[1] = 0; - } - else - { + } else { param0[1] = 1; } - u16 res = sub_0202CB8C(); + u16 res = sub_0202CB8C(); param0[2] = (u8)(res >> 8); param0[3] = (u8)res; int st0[2]; st0[1] = 0xbb; st0[0] = (int)param0 + 5; - if (sub_0202D760(UNK_021C59F8->unk56C, st0, 0) != 0) - { + if (sub_0202D760(UNK_021C59F8->unk56C, st0, 0) != 0) { UNK_021C59F8->unk685 = 0; - param0[4] = (u8)(0xbb - st0[1]); + param0[4] = (u8)(0xbb - st0[1]); return; } UNK_021C59F8->unk685 = 1; - param0[4] = 0xbb; + param0[4] = 0xbb; } -u32 sub_02030A78(u32 param0, u8 *param1, u32 param2) -{ - if (sub_02030E7C(sub_02031190()) == 0 && sub_02031280() == 0) - { +u32 sub_02030A78(u32 param0, u8 *param1, u32 param2) { + if (sub_02030E7C(sub_02031190()) == 0 && sub_02031280() == 0) { return 0; } - if (sub_0202D684(UNK_021C59F8->unk54C, param0, param1, param2, 1, 0) != 0) - { + if (sub_0202D684(UNK_021C59F8->unk54C, param0, param1, param2, 1, 0) != 0) { return 1; } - if (sub_02033534() == 0xa) - { + if (sub_02033534() == 0xa) { sub_02031454(); } return 0; } -u32 sub_02030ADC(u32 param0, u8 *param1, u32 param2) -{ - if (sub_02030E7C(sub_02031190()) == 0 && sub_02031280() == 0) - { +u32 sub_02030ADC(u32 param0, u8 *param1, u32 param2) { + if (sub_02030E7C(sub_02031190()) == 0 && sub_02031280() == 0) { return 0; } - if (sub_0202D684(UNK_021C59F8->unk54C, param0, param1, param2, 1, 1) != 0) - { + if (sub_0202D684(UNK_021C59F8->unk54C, param0, param1, param2, 1, 1) != 0) { return 1; } - if (sub_02033534() == 0xa) - { + if (sub_02033534() == 0xa) { sub_02031454(); } return 0; } -u32 sub_02030B3C(u32 param0, u8 *param1, u32 param2) -{ - if (sub_02031190() != 0) - { +u32 sub_02030B3C(u32 param0, u8 *param1, u32 param2) { + if (sub_02031190() != 0) { GF_ASSERT(0); return 0; } - if (sub_02030E7C(0) == 0 && sub_02031280() == 0) - { + if (sub_02030E7C(0) == 0 && sub_02031280() == 0) { return 0; } - if (sub_0202FA28() == 1) - { + if (sub_0202FA28() == 1) { return sub_02030A78(param0, param1, param2); } - if (sub_0202D684(UNK_021C59F8->unk56C, param0, param1, param2, 1, 0) != 0) - { + if (sub_0202D684(UNK_021C59F8->unk56C, param0, param1, param2, 1, 0) != 0) { return 1; } - if (sub_02033534() == 0xa) - { + if (sub_02033534() == 0xa) { sub_02031454(); } return 0; } -u32 sub_02030BC4(u32 param0, u8 *param1, u32 param2) -{ - if (sub_02031190() != 0) - { +u32 sub_02030BC4(u32 param0, u8 *param1, u32 param2) { + if (sub_02031190() != 0) { sub_02031454(); return 0; } - if (sub_02030E7C(0) == 0 && sub_02031280() == 0) - { + if (sub_02030E7C(0) == 0 && sub_02031280() == 0) { return 0; } - if (sub_0202FA28() == 1) - { + if (sub_0202FA28() == 1) { return sub_02030ADC(param0, param1, param2); } - if (sub_0202D684(UNK_021C59F8->unk56C, param0, param1, param2, 1, 1) != 0) - { + if (sub_0202D684(UNK_021C59F8->unk56C, param0, param1, param2, 1, 1) != 0) { return 1; } - if (sub_02033534() == 0xa) - { + if (sub_02033534() == 0xa) { sub_02031454(); } return 0; } -u32 sub_02030C4C(u32 param0, u8 *param1) -{ +u32 sub_02030C4C(u32 param0, u8 *param1) { return sub_02030BC4(param0, param1, 0); } -int sub_02030C58() -{ +int sub_02030C58() { return sub_0202D498(&UNK_021C59F8->unk464); } void sub_02030C70( - u32 param0, u32 param1, u32 param2, void *param3, struct UnkStruct0202F150_sub2 *param4) -{ + u32 param0, u32 param1, u32 param2, void *param3, struct UnkStruct0202F150_sub2 *param4) { sub_0202D934(param0, param1, param2, param3); param4->unk0a = 0xee; param4->unk08 = 0xffff; @@ -1820,38 +1540,30 @@ void sub_02030C8C(struct UnkStruct0202F150_sub1 *param0, u32 param1, void *param2, u32 param3, - struct UnkStruct0202F150_sub2 *param4) -{ + struct UnkStruct0202F150_sub2 *param4) { #pragma unused(param3) - while (sub_0202D478(param0) != 0) - { + while (sub_0202D478(param0) != 0) { u32 r7 = param4->unk0a; - if (r7 == 0xee) - { + if (r7 == 0xee) { r7 = sub_0202D41C(param0); - if (r7 == 0xee) - { + if (r7 == 0xee) { continue; } } - int st10 = param0->unk04; + int st10 = param0->unk04; param4->unk0a = (u8)r7; - int r4 = param4->unk08; - if (r4 == 0xffff) - { + int r4 = param4->unk08; + if (r4 == 0xffff) { r4 = sub_0202D9A0(r7); - if (UNK_021C59F8->unk689 != 0) - { + if (UNK_021C59F8->unk689 != 0) { return; } - if (r4 == 0xffff) - { - if (sub_0202D478(param0) < 1) - { + if (r4 == 0xffff) { + if (sub_0202D478(param0) < 1) { param0->unk04 = (s16)st10; return; } @@ -1865,36 +1577,27 @@ void sub_02030C8C(struct UnkStruct0202F150_sub1 *param0, param4->unk08 = (u16)r4; } - if (sub_0202DA04(r7) != 0) - { - if (param4->unk04 == 0) - { + if (sub_0202DA04(r7) != 0) { + if (param4->unk04 == 0) { param4->unk04 = sub_0202DA40(r7, param1, param4->unk08); } int stc = sub_0202D400(param0, param2, r4 - param4->unk00); - if (param4->unk04 != 0) - { + if (param4->unk04 != 0) { MI_CpuCopy8(param2, param4->unk04 + param4->unk00, (u32)stc); } - if ((int)(param4->unk00 += stc) < (int)r4) - { + if ((int)(param4->unk00 += stc) < (int)r4) { continue; } sub_02030C70(param1, r7, (u32)r4, param4->unk04, param4); - } - else - { - if (sub_0202D478(param0) >= r4) - { + } else { + if (sub_0202D478(param0) >= r4) { sub_0202D400(param0, param2, (u32)r4); sub_02030C70(param1, r7, (u32)r4, param2, param4); - } - else - { + } else { param0->unk04 = (s16)st10; return; } @@ -1902,15 +1605,11 @@ void sub_02030C8C(struct UnkStruct0202F150_sub1 *param0, } } -void sub_02030DA4() -{ - if (UNK_021C59F8 != NULL) - { - if (UNK_021C59F8->unk68B == 0) - { +void sub_02030DA4() { + if (UNK_021C59F8 != NULL) { + if (UNK_021C59F8->unk68B == 0) { sub_0202D4BC(&UNK_021C59F8->unk470); - if (sub_0202D478(&UNK_021C59F8->unk470) > 0) - { + if (sub_0202D478(&UNK_021C59F8->unk470) > 0) { sub_02030C8C(&UNK_021C59F8->unk470, 0, UNK_021C59F8->unk460, @@ -1921,19 +1620,14 @@ void sub_02030DA4() } } -void sub_02030DFC() -{ - if (UNK_021C59F8 != NULL) - { - if (UNK_021C59F8->unk68B == 0) - { +void sub_02030DFC() { + if (UNK_021C59F8 != NULL) { + if (UNK_021C59F8->unk68B == 0) { int r7 = sub_0202D858((u16)sub_02033534()) + 1; int r4; - for (r4 = 0; r4 < r7; r4++) - { + for (r4 = 0; r4 < r7; r4++) { sub_0202D4BC(&UNK_021C59F8->unk4E8[r4]); - if (sub_0202D478(&UNK_021C59F8->unk4E8[r4]) > 0) - { + if (sub_0202D478(&UNK_021C59F8->unk4E8[r4]) > 0) { sub_02030C8C(&UNK_021C59F8->unk4E8[r4], (u32)r4, @@ -1946,24 +1640,18 @@ void sub_02030DFC() } } -BOOL sub_02030E7C(u16 param0) -{ - if (UNK_021C59F8 == NULL) - { +BOOL sub_02030E7C(u16 param0) { + if (UNK_021C59F8 == NULL) { return FALSE; } - if (sub_02033534() >= 0x13) - { - if (UNK_021C59F8->unk687 != 0 && ov04_021D8018() != 0xffffffff) - { - if (param0 == 0) - { + if (sub_02033534() >= 0x13) { + if (UNK_021C59F8->unk687 != 0 && ov04_021D8018() != 0xffffffff) { + if (param0 == 0) { return TRUE; } - if (param0 == 1) - { + if (param0 == 1) { return TRUE; } } @@ -1971,34 +1659,26 @@ BOOL sub_02030E7C(u16 param0) return FALSE; } - if (sub_02030F40() == 0) - { + if (sub_02030F40() == 0) { return FALSE; } - if (sub_0202CBD4() != 4) - { + if (sub_0202CBD4() != 4) { return FALSE; } - if (sub_02031190() == param0) - { + if (sub_02031190() == param0) { return TRUE; } - if (sub_02031190() == 0) - { + if (sub_02031190() == 0) { u16 r0 = sub_0202CB8C(); - if ((r0 & (1 << param0)) != 0) - { + if ((r0 & (1 << param0)) != 0) { return TRUE; } - } - else - { - if ((UNK_021C59F8->unk65C & (1 << param0)) != 0) - { + } else { + if ((UNK_021C59F8->unk65C & (1 << param0)) != 0) { return TRUE; } } @@ -2006,13 +1686,10 @@ BOOL sub_02030E7C(u16 param0) return FALSE; } -s32 sub_02030F20() -{ +s32 sub_02030F20() { s32 r4 = 0; - for (int i = 0; i < 8; i++) - { - if (sub_02030E7C((u16)i) != 0) - { + for (int i = 0; i < 8; i++) { + if (sub_02030E7C((u16)i) != 0) { r4++; } } @@ -2020,69 +1697,55 @@ s32 sub_02030F20() return r4; } -BOOL sub_02030F40() -{ - if (UNK_021C59F8 != NULL && sub_02033534() >= 0x13) - { +BOOL sub_02030F40() { + if (UNK_021C59F8 != NULL && sub_02033534() >= 0x13) { return TRUE; } return sub_0202EDF8(); } -void sub_02030F60(u8 param0) -{ +void sub_02030F60(u8 param0) { UNK_021C59F8->unk62B = param0; } -u8 sub_02030F74(u32 param0) -{ +u8 sub_02030F74(u32 param0) { return UNK_021C59F8->unk620[param0]; } -u32 sub_02030F88(u32 param0) -{ - if (UNK_021C59F8 == NULL) - { +u32 sub_02030F88(u32 param0) { + if (UNK_021C59F8 == NULL) { return 0; } - u32 ret = UNK_021C59F8->unk610[param0]; + u32 ret = UNK_021C59F8->unk610[param0]; UNK_021C59F8->unk610[param0] = 0; return ret; } -void sub_02030FA8() -{ - if (UNK_021C59F8 != NULL) - { +void sub_02030FA8() { + if (UNK_021C59F8 != NULL) { UNK_021C59F8->unk628 |= 0x8000; } } -void sub_02030FC8() -{ - if (UNK_021C59F8 != NULL) - { +void sub_02030FC8() { + if (UNK_021C59F8 != NULL) { UNK_021C59F8->unk628 = 0; } } -u32 sub_02030FE0() -{ - if (UNK_021C59F8 != NULL) - { +u32 sub_02030FE0() { + if (UNK_021C59F8 != NULL) { return (u32)(UNK_021C59F8->unk628 & 0x8000); } return 1; } -void sub_02031000(u32 param0, u8 *param1, u32 param2) -{ - if (sub_0202FA28() == 1) - { +void sub_02031000(u32 param0, u8 *param1, u32 param2) { + if (sub_0202FA28() == 1) { sub_0202D684(UNK_021C59F8->unk54C, param0, param1, param2, 1, 0); return; } @@ -2090,99 +1753,74 @@ void sub_02031000(u32 param0, u8 *param1, u32 param2) sub_0202D684(UNK_021C59F8->unk56C, param0, param1, param2, 1, 0); } -void sub_0203105C(u32 param0, u8 *param1, u32 param2) -{ +void sub_0203105C(u32 param0, u8 *param1, u32 param2) { sub_0202D684(UNK_021C59F8->unk54C, param0, param1, param2, 0, 0); } -void sub_02031088() -{ - if (UNK_021C59F8 != NULL) - { - if (UNK_021C59F8->unk67B != 1) - { - if (UNK_021C59F8->unk67B != 3) - { +void sub_02031088() { + if (UNK_021C59F8 != NULL) { + if (UNK_021C59F8->unk67B != 1) { + if (UNK_021C59F8->unk67B != 3) { return; } - } - else - { + } else { u32 res; - if (sub_0202FA28() == 1) - { + if (sub_0202FA28() == 1) { res = sub_020311D0(0xb, &UNK_021C59F8->unk67C); - } - else - { + } else { res = sub_02030BC4(0xb, &UNK_021C59F8->unk67C, 1); } - if (res == 0) - { + if (res == 0) { return; } UNK_021C59F8->unk67B = 2; return; } - if (sub_020311D0(0xc, &UNK_021C59F8->unk67C) != 0) - { + if (sub_020311D0(0xc, &UNK_021C59F8->unk67C) != 0) { sub_0202F9E0(UNK_021C59F8->unk67C); UNK_021C59F8->unk67B = 0; } } } -void sub_0203110C(u32 param0, u32 param1, u8 *param2) -{ +void sub_0203110C(u32 param0, u32 param1, u8 *param2) { #pragma unused(param0) #pragma unused(param1) - if (sub_02031190() == 0) - { + if (sub_02031190() == 0) { UNK_021C59F8->unk67B = 1; UNK_021C59F8->unk67C = param2[0]; } } -void sub_02031134(u32 param0, u32 param1, u8 *param2) -{ +void sub_02031134(u32 param0, u32 param1, u8 *param2) { #pragma unused(param0) #pragma unused(param1) - if (sub_02031190() != 0) - { + if (sub_02031190() != 0) { UNK_021C59F8->unk67C = param2[0]; UNK_021C59F8->unk67B = 3; } } -void sub_0203115C(u32 param0, u32 param1, u8 *param2) -{ +void sub_0203115C(u32 param0, u32 param1, u8 *param2) { #pragma unused(param0) #pragma unused(param1) - if (sub_02031190() == 0 && UNK_021C59F8->unk67B == 2) - { + if (sub_02031190() == 0 && UNK_021C59F8->unk67B == 2) { sub_0202F9E0(*param2); UNK_021C59F8->unk67B = 0; } } -u16 sub_02031190() -{ - if (UNK_021C59F8 != NULL) - { - if (sub_02033534() >= 0x13) - { +u16 sub_02031190() { + if (UNK_021C59F8 != NULL) { + if (sub_02033534() >= 0x13) { u32 res = ov04_021D8018(); - if (res != 0xffffffff) - { + if (res != 0xffffffff) { return (u16)res; } - } - else - { - if (sub_02031280() != 0) - { + } else { + if (sub_02031280() != 0) { return 0; } @@ -2193,30 +1831,24 @@ u16 sub_02031190() return 0; } -u32 sub_020311D0(u32 param0, u8 *param1) -{ +u32 sub_020311D0(u32 param0, u8 *param1) { return sub_02030ADC(param0, param1, 0); } -u32 sub_020311DC(u32 param0) -{ +u32 sub_020311DC(u32 param0) { return sub_02030ADC(param0, 0, 0); } -u32 sub_020311E8() -{ +u32 sub_020311E8() { return sub_0202EE24(); } -BOOL sub_020311F0() -{ - if (sub_02031280() != 0) - { +BOOL sub_020311F0() { + if (sub_02031280() != 0) { return FALSE; } - if (UNK_021C59F8 != NULL && UNK_021C59F8->unk689 != 0) - { + if (UNK_021C59F8 != NULL && UNK_021C59F8->unk689 != 0) { sub_020334E8(1, 1); return TRUE; } @@ -2224,53 +1856,42 @@ BOOL sub_020311F0() return sub_0202EE60(); } -int sub_02031228(u16 param0) -{ - if (sub_0202D858(param0) >= 5) - { +int sub_02031228(u16 param0) { + if (sub_0202D858(param0) >= 5) { return 0xc; } - if (sub_0202FA28() == 0) - { + if (sub_0202FA28() == 0) { return 0xc; } return 0x26; } -int sub_02031248(u32 param0) -{ +int sub_02031248(u32 param0) { return sub_0202D858((u16)param0) + 1; } -int sub_02031258(u32 param0) -{ +int sub_02031258(u32 param0) { return sub_0202D884((u16)param0) + 1; } -void sub_02031268(u8 param0) -{ - if (UNK_021C59F8 != NULL) - { +void sub_02031268(u8 param0) { + if (UNK_021C59F8 != NULL) { UNK_021C59F8->unk686 = param0; } } -u8 sub_02031280() -{ - if (UNK_021C59F8 != NULL) - { +u8 sub_02031280() { + if (UNK_021C59F8 != NULL) { return UNK_021C59F8->unk686; } return 0; } -void sub_0203129C() -{ - if (sub_0202F03C() == 0 && sub_02031190() == 0) - { +void sub_0203129C() { + if (sub_0202F03C() == 0 && sub_02031190() == 0) { u8 st0; sub_02030C4C(2, &st0); } @@ -2279,8 +1900,7 @@ void sub_0203129C() } #ifdef NONMATCHING -void sub_020312BC(s64 *param0) -{ +void sub_020312BC(s64 *param0) { RTCDate st10; RTCTime st4; GF_RTC_CopyDateTime(&st10, &st4); @@ -2298,8 +1918,7 @@ void sub_020312BC(s64 *param0) (0x00000000 + r5) << 5; } #else -asm void sub_020312BC(s64 *param0) -{ +asm void sub_020312BC(s64 *param0) { // clang-format off push {r3-r7, lr} sub sp, #0x20 @@ -2370,40 +1989,31 @@ asm void sub_020312BC(s64 *param0) } #endif -void sub_02031354(u32 param0) -{ +void sub_02031354(u32 param0) { sub_0202D830(UNK_021C59F8->unk56C, param0); } -u32 sub_02031370() -{ +u32 sub_02031370() { return sub_0202D4E4(UNK_021C59F8->unk56C); } -u32 sub_02031388() -{ +u32 sub_02031388() { return sub_0202D4E4(UNK_021C59F8->unk54C); } -void sub_020313A0(u8 param0) -{ +void sub_020313A0(u8 param0) { UNK_021C59F8->unk687 = param0; } -void sub_020313B4(u8 param0, u32 param1) -{ - if (UNK_021C59F8 != NULL) - { +void sub_020313B4(u8 param0, u32 param1) { + if (UNK_021C59F8 != NULL) { UNK_021C59F8->unk677[param1] = param0; } } -u32 sub_020313CC(u32 param0) -{ - if (UNK_021C59F8 != NULL) - { - if (UNK_021C59F8->unk677[param0] != 0xff) - { +u32 sub_020313CC(u32 param0) { + if (UNK_021C59F8 != NULL) { + if (UNK_021C59F8->unk677[param0] != 0xff) { return UNK_021C59F8->unk677[param0]; } } @@ -2411,49 +2021,39 @@ u32 sub_020313CC(u32 param0) return param0; } -u32 sub_020313EC() -{ - if (sub_02033534() < 0x13) - { +u32 sub_020313EC() { + if (sub_02033534() < 0x13) { return 0; } return ov04_021D8624(); } -void sub_02031400(u32 param0) -{ - if (sub_02033534() >= 0x13) - { +void sub_02031400(u32 param0) { + if (sub_02033534() >= 0x13) { UNK_021C59F8->unk630 = param0; - if (param0 != 0) - { - UNK_021C59F8->unk634 = 0; + if (param0 != 0) { + UNK_021C59F8->unk634 = 0; UNK_021C59F8->unk638[0] = 0; UNK_021C59F8->unk638[1] = 0; } } } -u32 sub_02031438() -{ - if (UNK_021C59F8->unk681 != 0) - { +u32 sub_02031438() { + if (UNK_021C59F8->unk681 != 0) { return 1; } return 0; } -void sub_02031454() -{ +void sub_02031454() { UNK_021C59F8->unk689 = 1; } -void sub_02031468() -{ - if (UNK_021C59F8 != NULL) - { +void sub_02031468() { + if (UNK_021C59F8 != NULL) { UNK_021C59F8->unk68A = 1; } } diff --git a/arm9/src/unk_02031480.c b/arm9/src/unk_02031480.c index 9bebff2ed..d86a24960 100644 --- a/arm9/src/unk_02031480.c +++ b/arm9/src/unk_02031480.c @@ -1,8 +1,8 @@ -#include "global.h" #include "unk_02031480.h" -struct UnkStruct_02031480 -{ +#include "global.h" + +struct UnkStruct_02031480 { u8 unk000[8][2]; u8 unk010[8]; u8 unk018[8][70]; @@ -14,16 +14,13 @@ struct UnkStruct_02031480 static struct UnkStruct_02031480 *UNK_021C59FC; -void sub_02031480(HeapID heapId) -{ - if (UNK_021C59FC == NULL) - { +void sub_02031480(HeapID heapId) { + if (UNK_021C59FC == NULL) { UNK_021C59FC = AllocFromHeap(heapId, sizeof(struct UnkStruct_02031480)); MI_CpuFill8(UNK_021C59FC, 0, sizeof(struct UnkStruct_02031480)); } - for (int i = 0; i < 8; i++) - { + for (int i = 0; i < 8; i++) { UNK_021C59FC->unk010[i] = 0xff; } UNK_021C59FC->unk250 = 0xff; @@ -31,31 +28,26 @@ void sub_02031480(HeapID heapId) UNK_021C59FC->unk252 = 0x00; } -void sub_020314D0() -{ +void sub_020314D0() { FreeToHeap(UNK_021C59FC); UNK_021C59FC = NULL; } -BOOL sub_020314E8() -{ - if (UNK_021C59FC != NULL) - { +BOOL sub_020314E8() { + if (UNK_021C59FC != NULL) { return TRUE; } return FALSE; } -void sub_020314FC(u8 param0, u32 unused, u8 *param2) -{ +void sub_020314FC(u8 param0, u32 unused, u8 *param2) { #pragma unused(unused) u8 st0[3]; st0[0] = param2[0]; - if (sub_02031190() == 0) - { + if (sub_02031190() == 0) { st0[1] = param0; st0[2] = st0[0]; @@ -64,12 +56,9 @@ void sub_020314FC(u8 param0, u32 unused, u8 *param2) UNK_021C59FC->unk010[param0] = st0[0]; - for (int i = 0; i < 8; i++) - { - if (sub_02030E7C((u16)i) != 0) - { - if (st0[0] != UNK_021C59FC->unk010[i]) - { + for (int i = 0; i < 8; i++) { + if (sub_02030E7C((u16)i) != 0) { + if (st0[0] != UNK_021C59FC->unk010[i]) { return; } } @@ -79,109 +68,87 @@ void sub_020314FC(u8 param0, u32 unused, u8 *param2) } } -void sub_02031560(u32 unused1, u32 unused2, u8 *param2) -{ +void sub_02031560(u32 unused1, u32 unused2, u8 *param2) { #pragma unused(unused1) #pragma unused(unused2) UNK_021C59FC->unk010[param2[0]] = param2[1]; } -void sub_02031574(u32 unused1, u32 unused2, u8 *param2) -{ +void sub_02031574(u32 unused1, u32 unused2, u8 *param2) { #pragma unused(unused1) #pragma unused(unused2) UNK_021C59FC->unk250 = *param2; } -void sub_02031588(u8 param0) -{ +void sub_02031588(u8 param0) { UNK_021C59FC->unk251 = param0; UNK_021C59FC->unk252 = 1; } -void sub_020315A4() -{ - if (UNK_021C59FC != NULL && UNK_021C59FC->unk252 != 0 && - sub_020311D0(0x10, &UNK_021C59FC->unk251)) - { +void sub_020315A4() { + if (UNK_021C59FC != NULL && UNK_021C59FC->unk252 != 0 && sub_020311D0(0x10, &UNK_021C59FC->unk251)) { UNK_021C59FC->unk252 = 0; } } -BOOL sub_020315D8(u8 param0) -{ - if (UNK_021C59FC == NULL) - { +BOOL sub_020315D8(u8 param0) { + if (UNK_021C59FC == NULL) { return TRUE; } - if (UNK_021C59FC->unk250 == param0) - { + if (UNK_021C59FC->unk250 == param0) { return TRUE; } return FALSE; } -u8 sub_020315FC(u8 index) -{ +u8 sub_020315FC(u8 index) { return UNK_021C59FC->unk010[index]; } -void sub_0203160C(u32 param0, u32 unused, u8 *param2) -{ +void sub_0203160C(u32 param0, u32 unused, u8 *param2) { #pragma unused(unused) UNK_021C59FC->unk000[param0][0] = param2[0]; UNK_021C59FC->unk000[param0][1] = param2[1]; } -u32 sub_02031628() -{ +u32 sub_02031628() { return 2; } -void sub_0203162C(u8 param0, u8 param1) -{ +void sub_0203162C(u8 param0, u8 param1) { u8 st0[2] = { param0, param1 }; sub_020311D0(0x13, st0); } -int sub_02031640(u32 param0, u8 param1) -{ - if (UNK_021C59FC == NULL) - { +int sub_02031640(u32 param0, u8 param1) { + if (UNK_021C59FC == NULL) { return -1; } - if (UNK_021C59FC->unk000[param0][0] == param1) - { + if (UNK_021C59FC->unk000[param0][0] == param1) { return UNK_021C59FC->unk000[param0][1]; } return -1; } -void sub_02031668() -{ - for (int i = 0; i < 8; i++) - { +void sub_02031668() { + for (int i = 0; i < 8; i++) { MI_CpuFill8(UNK_021C59FC->unk000[i], 0, 2); } } -void sub_0203168C() -{ - for (int i = 0; i < 8; i++) - { +void sub_0203168C() { + for (int i = 0; i < 8; i++) { UNK_021C59FC->unk248[i] = 0; } } -BOOL sub_020316AC(u32 param0, void *param1) -{ - if (UNK_021C59FC != NULL) - { +BOOL sub_020316AC(u32 param0, void *param1) { + if (UNK_021C59FC != NULL) { MI_CpuCopy8(param1, UNK_021C59FC->unk018[param0], 0x46); sub_020311D0(0x14, UNK_021C59FC->unk018[param0]); @@ -191,24 +158,20 @@ BOOL sub_020316AC(u32 param0, void *param1) return FALSE; } -u8 *sub_020316E0(int param0) -{ - if (UNK_021C59FC->unk248[param0] != 0) - { +u8 *sub_020316E0(int param0) { + if (UNK_021C59FC->unk248[param0] != 0) { return UNK_021C59FC->unk018[param0]; } return NULL; } -void sub_02031704(u32 param0, u32 unused, void *param2) -{ +void sub_02031704(u32 param0, u32 unused, void *param2) { #pragma unused(unused) UNK_021C59FC->unk248[param0] = 1; MI_CpuCopy8(param2, UNK_021C59FC->unk018[param0], 0x46); } -u32 sub_02031730() -{ +u32 sub_02031730() { return 0x46; } diff --git a/arm9/src/unk_02031734.c b/arm9/src/unk_02031734.c index b49836a31..8648ebc74 100644 --- a/arm9/src/unk_02031734.c +++ b/arm9/src/unk_02031734.c @@ -1,15 +1,18 @@ -#include "global.h" #include "unk_02031734.h" + +#include "global.h" + #include "MI_memory.h" #include "communication_error.h" #include "game_init.h" #include "heap.h" #include "player_data.h" -#include "unk_0202F150.h" #include "unk_0202E29C.h" +#include "unk_0202F150.h" - -const struct UnkStruct_02031734_const2 UNK_020EEC48 = { { (u32)sub_02032B84, 0 } }; +const struct UnkStruct_02031734_const2 UNK_020EEC48 = { + { (u32)sub_02032B84, 0 } +}; const struct UnkStruct_02031734_const1 UNK_020EEC50 = { { (u32)sub_0203213C, (u32)sub_02032138, 0 } @@ -55,13 +58,11 @@ extern ov05_021D74E0(struct SaveData *save, u32 param1); extern void ov04_021D83A8(void (*param0)(s32)); extern void sub_0200541C(); -void sub_02031734(struct SaveData *save, u8 param1) -{ - if (UNK_021C5A00 == NULL) - { +void sub_02031734(struct SaveData *save, u8 param1) { + if (UNK_021C5A00 == NULL) { sub_0202E49C(); struct UnkStruct_02031734 *ptr = AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct_02031734)); - UNK_021C5A00 = ptr; + UNK_021C5A00 = ptr; MI_CpuFill8(ptr, 0, sizeof(struct UnkStruct_02031734)); UNK_021C5A00->unk3A = 0x32; @@ -78,25 +79,20 @@ void sub_02031734(struct SaveData *save, u8 param1) sub_020312BC(UNK_021C5A00->unk0C); sub_0202D8D0(0, 0, 0); - if (param1 != 9 && param1 != 0x11 && param1 != 0xf) - { + if (param1 != 9 && param1 != 0x11 && param1 != 0xf) { sub_02033E74(); } } } -void sub_020317C0() -{ - if (UNK_021C5A00 != NULL) - { +void sub_020317C0() { + if (UNK_021C5A00 != NULL) { sub_0202D918(); - if (UNK_021C5A00->unk00 != NULL) - { + if (UNK_021C5A00->unk00 != NULL) { FreeToHeap(UNK_021C5A00->unk00); } - if (UNK_021C5A00->unk3F >= 0x13) - { + if (UNK_021C5A00->unk3F >= 0x13) { DestroyHeap(HEAP_ID_49); } @@ -110,19 +106,15 @@ void sub_020317C0() } } -BOOL sub_02031810() -{ - if (UNK_021C5A00 != NULL) - { +BOOL sub_02031810() { + if (UNK_021C5A00 != NULL) { return TRUE; } return FALSE; } -void sub_02031824(struct SaveData *save) -{ - if (UNK_021C5A00 == NULL) - { +void sub_02031824(struct SaveData *save) { + if (UNK_021C5A00 == NULL) { CreateHeapAtEnd(3, 0xf, 0xe000); sub_02031734(save, 0xa); @@ -131,49 +123,40 @@ void sub_02031824(struct SaveData *save) } } -void sub_02031860() -{ - if (UNK_021C5A00 != NULL) - { +void sub_02031860() { + if (UNK_021C5A00 != NULL) { sub_02031468(); sub_02031D20(sub_020323CC, 0); } } -void sub_02031880() -{ +void sub_02031880() { sub_0202FC60(); UNK_021C5A00->unk38 = sub_02031190(); sub_02031D20(sub_020321B8, 0); } -void sub_020318A4(u8 param0) -{ +void sub_020318A4(u8 param0) { UNK_021C5A00->unk4F = param0; } -void sub_020318B4() -{ +void sub_020318B4() { sub_02031D20(sub_02032028, 0); } -BOOL sub_020318C4() -{ +BOOL sub_020318C4() { struct UnkStruct_02031734_const1 st0 = UNK_020EEC50; u32 r1 = (u32)UNK_021C5A00->unk24; - if (UNK_021C5A00 == NULL) - { + if (UNK_021C5A00 == NULL) { return FALSE; } - for (u32 i = 0; st0.unk00[i] != 0; i++) - { + for (u32 i = 0; st0.unk00[i] != 0; i++) { - if (r1 == st0.unk00[i]) - { + if (r1 == st0.unk00[i]) { return TRUE; } } @@ -181,26 +164,21 @@ BOOL sub_020318C4() return FALSE; } -void sub_02031914() -{ +void sub_02031914() { sub_02031D20(sub_02032178, 0); } -void sub_02031924() -{ +void sub_02031924() { UNK_021C5A00->unk4C = 1; } -void sub_02031934() -{ +void sub_02031934() { sub_0202E49C(); sub_02031D20(sub_02032194, 0); } -void sub_02031948(struct SaveData *save, u8 param1, u8 param2, u32 param3) -{ - if (sub_02030F40() == 0) - { +void sub_02031948(struct SaveData *save, u8 param1, u8 param2, u32 param3) { + if (sub_02030F40() == 0) { CreateHeapAtEnd(3, 0xf, 0x7080); sub_02031734(save, param1); UNK_021C5A00->unk40 = param2; @@ -209,10 +187,8 @@ void sub_02031948(struct SaveData *save, u8 param1, u8 param2, u32 param3) } } -void sub_02031990(struct SaveData *save, u8 param1, u8 param2, u32 param3) -{ - if (sub_02030F40() == 0) - { +void sub_02031990(struct SaveData *save, u8 param1, u8 param2, u32 param3) { + if (sub_02030F40() == 0) { CreateHeapAtEnd(3, 0xf, 0x7080); sub_02031734(save, param1); UNK_021C5A00->unk40 = param2; @@ -221,47 +197,38 @@ void sub_02031990(struct SaveData *save, u8 param1, u8 param2, u32 param3) } } -void sub_020319D8(u8 param0) -{ +void sub_020319D8(u8 param0) { UNK_021C5A00->unk3E = param0; sub_02031D20(sub_02032298, 0); } -void sub_020319F4() -{ +void sub_020319F4() { sub_0202FCA8(); sub_02031D20(sub_02032364, 0); } -void sub_02031A08() -{ - if (UNK_021C5A00 != NULL) - { +void sub_02031A08() { + if (UNK_021C5A00 != NULL) { sub_02031D20(sub_02032440, 5); } } -void sub_02031A24() -{ +void sub_02031A24() { sub_0202D298(); } -BOOL sub_02031A2C() -{ +BOOL sub_02031A2C() { struct UnkStruct_02031734_const1 st0 = UNK_020EEC5C; u32 r1 = (u32)UNK_021C5A00->unk24; - if (UNK_021C5A00 == NULL) - { + if (UNK_021C5A00 == NULL) { return FALSE; } - for (u32 i = 0; st0.unk00[i] != 0; i++) - { + for (u32 i = 0; st0.unk00[i] != 0; i++) { - if (r1 == st0.unk00[i]) - { + if (r1 == st0.unk00[i]) { return TRUE; } } @@ -269,12 +236,9 @@ BOOL sub_02031A2C() return FALSE; } -void sub_02031A7C(struct SaveData *save) -{ - if (UNK_021C5A00 == NULL) - { - if (CreateHeapAtEnd(3, 0xf, 0x7080) == 0) - { +void sub_02031A7C(struct SaveData *save) { + if (UNK_021C5A00 == NULL) { + if (CreateHeapAtEnd(3, 0xf, 0x7080) == 0) { sub_020335E0(); } @@ -285,8 +249,7 @@ void sub_02031A7C(struct SaveData *save) } } -void sub_02031AC8(u8 param0) -{ +void sub_02031AC8(u8 param0) { UNK_021C5A00->unk3E = param0; UNK_021C5A00->unk38 = 3; sub_0202D344(1); @@ -294,44 +257,35 @@ void sub_02031AC8(u8 param0) sub_02031D20(sub_02032628, 0); } -s32 sub_02031AF4() -{ - if (UNK_021C5A00 == NULL) - { +s32 sub_02031AF4() { + if (UNK_021C5A00 == NULL) { return -1; } - if (UNK_021C5A00->unk24 == sub_0203279C) - { + if (UNK_021C5A00->unk24 == sub_0203279C) { return 1; } - if (UNK_021C5A00->unk24 == sub_020327B4) - { + if (UNK_021C5A00->unk24 == sub_020327B4) { return -1; } return 0; } -BOOL sub_02031B2C() -{ - if (UNK_021C5A00 == NULL) - { +BOOL sub_02031B2C() { + if (UNK_021C5A00 == NULL) { return FALSE; } - if (UNK_021C5A00->unk24 == sub_020327FC) - { + if (UNK_021C5A00->unk24 == sub_020327FC) { return TRUE; } return FALSE; } -void sub_02031B50() -{ +void sub_02031B50() { sub_0202D344(0); - if (UNK_021C5A00->unk44 != 1 || UNK_021C5A00->unk45 != 1 || UNK_021C5A00->unk3F == 9) - { + if (UNK_021C5A00->unk44 != 1 || UNK_021C5A00->unk45 != 1 || UNK_021C5A00->unk3F == 9) { sub_020334E8(0, 0); } @@ -340,8 +294,7 @@ void sub_02031B50() UNK_021C5A00->unk48 = 0; sub_0202D1B0(UNK_021C5A00->unk3C); - if (sub_02031190() == 0) - { + if (sub_02031190() == 0) { sub_0202D36C(1); sub_02031D20(sub_020323DC, 0xf); return; @@ -350,112 +303,89 @@ void sub_02031B50() sub_02031D20(sub_02032424, 5); } -u32 sub_02031BD0() -{ - if (UNK_021C5A00 == NULL) - { +u32 sub_02031BD0() { + if (UNK_021C5A00 == NULL) { return 1; } - if (UNK_021C5A00->unk24 != sub_020324F8) - { + if (UNK_021C5A00->unk24 != sub_020324F8) { return 1; } return 0; } -void sub_02031BF4() -{ - if (UNK_021C5A00 != NULL) - { +void sub_02031BF4() { + if (UNK_021C5A00 != NULL) { sub_02031D20(sub_02032440, 5); } } -void sub_02031C10() -{ - if (UNK_021C5A00 != NULL) - { +void sub_02031C10() { + if (UNK_021C5A00 != NULL) { UNK_021C5A00->unk48 = 1; sub_0202D344(1); } } -void sub_02031C2C() -{ - if (UNK_021C5A00 != NULL) - { +void sub_02031C2C() { + if (UNK_021C5A00 != NULL) { UNK_021C5A00->unk48 = 1; sub_0202D344(1); sub_02031D20(sub_02032850, 0); } } -void sub_02031C54() -{ +void sub_02031C54() { UNK_021C5A00->unk3F = 0x12; } -void sub_02031C64() -{ +void sub_02031C64() { UNK_021C5A00->unk3F = 0x9; } -void sub_02031C74(struct SaveData *save, u8 param1) -{ - if (sub_02030F40() == 0) - { +void sub_02031C74(struct SaveData *save, u8 param1) { + if (sub_02030F40() == 0) { CreateHeapAtEnd(3, 0xf, 0x7080); sub_02031734(save, param1); sub_02031D20(sub_02032E00, 0); } } -void sub_02031CA8(struct SaveData *save, u8 param1) -{ - if (sub_02030F40() == 0) - { +void sub_02031CA8(struct SaveData *save, u8 param1) { + if (sub_02030F40() == 0) { CreateHeapAtEnd(3, 0xf, 0x7080); sub_02031734(save, param1); sub_02031D20(sub_02032E48, 0); } } -void sub_02031CDC() -{ - if (UNK_021C5A00 != NULL && UNK_021C5A00->unk24 != 0) - { +void sub_02031CDC() { + if (UNK_021C5A00 != NULL && UNK_021C5A00->unk24 != 0) { ((void (*)(void))(UNK_021C5A00->unk24))(); } - if (sub_02033590() != 0) - { + if (sub_02033590() != 0) { sub_02033EEC(3 - ov04_021DDB08()); return; } - if (sub_0202EDF8()) - { + if (sub_0202EDF8()) { sub_02033EEC(3 - WM_GetLinkLevel()); } } -void sub_02031D20(void (*param0)(), u32 param1) -{ +void sub_02031D20(void (*param0)(), u32 param1) { UNK_021C5A00->unk24 = param0; UNK_021C5A00->unk3A = (u16)param1; } -void sub_02031D30() -{ - if (UNK_021C5A00->unk3A != 0) - { +void sub_02031D30() { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } - if (!sub_0202E4C8()) - { + if (!sub_0202E4C8()) { return; } @@ -464,10 +394,8 @@ void sub_02031D30() sub_02031268(1); sub_02030FA8(); - if (UNK_021C5A00->unk4A != 0) - { - if (sub_0202F918(1, UNK_021C5A00->unk43, 0x1F4, 1) == 0) - { + if (UNK_021C5A00->unk4A != 0) { + if (sub_0202F918(1, UNK_021C5A00->unk43, 0x1F4, 1) == 0) { return; } @@ -478,40 +406,31 @@ void sub_02031D30() return; } - if (sub_0202F950(1, 1, 0x1F4) != 0) - { - if (UNK_021C5A00->unk4C != 0) - { + if (sub_0202F950(1, 1, 0x1F4) != 0) { + if (UNK_021C5A00->unk4C != 0) { sub_02031D20(sub_020323B8, 0); - } - else - { + } else { sub_02031D20(sub_02031EE0, 0x40); } } } -void sub_02031E08() -{ - if (sub_0202EE0C() != 0) - { +void sub_02031E08() { + if (sub_0202EE0C() != 0) { sub_02031268(1); sub_02030FA8(); - if (UNK_021C5A00->unk4A != 0) - { + if (UNK_021C5A00->unk4A != 0) { sub_02031D20(sub_02032058, 0); return; } - if (sub_0202F950(0, 1, 0x1F4) != 0) - { + if (sub_0202F950(0, 1, 0x1F4) != 0) { u32 r1 = compute(UNK_021C5A00->unk0C, 0x40); - if (UNK_021C5A00->unk38 != 0) - { - r1 = (u32)(UNK_021C5A00->unk38 << 6); + if (UNK_021C5A00->unk38 != 0) { + r1 = (u32)(UNK_021C5A00->unk38 << 6); UNK_021C5A00->unk38 = 0; } sub_02031D20(sub_02031EE0, r1); @@ -519,12 +438,9 @@ void sub_02031E08() } } -void sub_02031E8C() -{ - if (sub_0202EE0C() != 0) - { - if (sub_0202F950(0, 0, 0x1F4) != 0) - { +void sub_02031E8C() { + if (sub_0202EE0C() != 0) { + if (sub_0202F950(0, 0, 0x1F4) != 0) { u32 r1 = compute(UNK_021C5A00->unk0C, 0x20); @@ -533,28 +449,23 @@ void sub_02031E8C() } } -void sub_02031EE0() -{ +void sub_02031EE0() { sub_0202EA54(); - if (UNK_021C5A00->unk4F == 0 && UNK_021C5A00->unk4B == 0) - { + if (UNK_021C5A00->unk4F == 0 && UNK_021C5A00->unk4B == 0) { s32 r0 = sub_0202E8F4(); - if (r0 != -1) - { + if (r0 != -1) { UNK_021C5A00->unk3E = (u8)r0; sub_02031D20(sub_02031F60, 0x20); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } r0 = sub_0202E950(); - if (r0 != -1) - { + if (r0 != -1) { UNK_021C5A00->unk3E = (u8)r0; sub_02031D20(sub_02031F60, 0x20); return; @@ -564,23 +475,19 @@ void sub_02031EE0() } } -void sub_02031F60() -{ +void sub_02031F60() { sub_0202EA54(); - if (sub_0202E8A0(UNK_021C5A00->unk3E) != 0 && sub_0202FB18(UNK_021C5A00->unk3E) != 0) - { + if (sub_0202E8A0(UNK_021C5A00->unk3E) != 0 && sub_0202FB18(UNK_021C5A00->unk3E) != 0) { sub_02031D20(sub_02031FC8, 0x64); return; } - if (sub_020311F0() != 0) - { + if (sub_020311F0() != 0) { sub_02031D20(sub_02032028, 0); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } @@ -588,10 +495,8 @@ void sub_02031F60() sub_02031D20(sub_02032028, 0); } -void sub_02031FC8() -{ - if (sub_02030E7C(sub_02031190()) != 0) - { +void sub_02031FC8() { + if (sub_02030E7C(sub_02031190()) != 0) { sub_0202FC60(); sub_02031268(0); sub_02030FA8(); @@ -599,14 +504,12 @@ void sub_02031FC8() return; } - if (sub_020311F0() != 0) - { + if (sub_020311F0() != 0) { sub_02031D20(sub_02032028, 0); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } @@ -614,29 +517,22 @@ void sub_02031FC8() sub_02031D20(sub_02032028, 0); } -void sub_02032028() -{ - if (sub_0202E6F0() != 0) - { +void sub_02032028() { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_02032058, 0); } } -void sub_02032040() -{ - if (sub_0202E6F0() != 0) - { +void sub_02032040() { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_02031E8C, 0); } } -void sub_02032058() -{ - if (sub_0202EE0C() != 0) - { +void sub_02032058() { + if (sub_0202EE0C() != 0) { sub_02031268(1); - if (sub_0202F918(0, UNK_021C5A00->unk43, 0x1F4, 1) != 0) - { + if (sub_0202F918(0, UNK_021C5A00->unk43, 0x1F4, 1) != 0) { u32 r1 = compute(UNK_021C5A00->unk0C, 0x14); UNK_021C5A00->unk43 = 0; @@ -645,48 +541,38 @@ void sub_02032058() } } -void sub_020320C4() -{ - if (sub_020311E8() != 0) - { +void sub_020320C4() { + if (sub_020311E8() != 0) { UNK_021C5A00->unk43 = 1; sub_02031D20(sub_02032118, 0); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } - if (UNK_021C5A00->unk4A == 0 && sub_0202E6F0() != 0) - { + if (UNK_021C5A00->unk4A == 0 && sub_0202E6F0() != 0) { sub_02031D20(sub_02032040, 2); } } -void sub_02032118() -{ +void sub_02032118() { sub_02031268(0); sub_0202EE84(1); sub_02030FA8(); sub_02031D20(sub_02032138, 0); } -void sub_02032138() -{ +void sub_02032138() { } -void sub_0203213C() -{ +void sub_0203213C() { } -void sub_02032140() -{ - if (UNK_021C5A00->unk3F < 0x13) - { - if (sub_0202EE0C() == 0) - { +void sub_02032140() { + if (UNK_021C5A00->unk3F < 0x13) { + if (sub_0202EE0C() == 0) { return; } @@ -698,182 +584,143 @@ void sub_02032140() sub_02031D20(sub_020323B8, 0); } -void sub_02032178() -{ - if (sub_0202E6F0() != 0) - { +void sub_02032178() { + if (sub_0202E6F0() != 0) { sub_0202FC60(); sub_02031D20(sub_02032140, 0); } } -void sub_02032194() -{ - if (sub_0202E4C8()) - { +void sub_02032194() { + if (sub_0202E4C8()) { sub_0202E7B0(0); sub_0202FC60(); sub_02031D20(sub_02031E08, 0); } } -void sub_020321B8() -{ - if (sub_0202E6F0() != 0) - { +void sub_020321B8() { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_02031E08, 0); } } -void sub_020321D0() -{ - if (sub_0202E4C8()) - { +void sub_020321D0() { + if (sub_0202E4C8()) { sub_0202E29C(UNK_021C5A00->unk2C); sub_0202DB14(UNK_021C5A00->unk28, UNK_021C5A00->unk30); - if (sub_0202F918(1, 1, 0x200, 1) != 0) - { + if (sub_0202F918(1, 1, 0x200, 1) != 0) { sub_0202FA10(); sub_02031D20(sub_02032218, 0); } } } -void sub_02032218() -{ - if (sub_02030E7C(sub_02031190()) != 0) - { +void sub_02032218() { + if (sub_02030E7C(sub_02031190()) != 0) { sub_02031D20(sub_02032234, 0); } } -void sub_02032234() -{ - if (sub_02030F40() == 0) - { +void sub_02032234() { + if (sub_02030F40() == 0) { sub_02031D20(sub_020323BC, 0); } } -void sub_0203224C() -{ - if (sub_0202E4C8()) - { +void sub_0203224C() { + if (sub_0202E4C8()) { sub_0202E29C(UNK_021C5A00->unk2C); sub_0202DB14(UNK_021C5A00->unk28, UNK_021C5A00->unk30); - if (sub_0202F950(1, 1, 0x200) != 0) - { + if (sub_0202F950(1, 1, 0x200) != 0) { sub_0202FA10(); sub_02031D20(sub_02032290, 0); } } } -void sub_02032290() -{ +void sub_02032290() { sub_0202EA54(); } -void sub_02032298() -{ +void sub_02032298() { sub_0202EA54(); - if (sub_0202FB18(UNK_021C5A00->unk3E) != 0) - { + if (sub_0202FB18(UNK_021C5A00->unk3E) != 0) { sub_02031D20(sub_020322C0, 0xa); } } -void sub_020322C0() -{ - if (sub_020311F0() != 0) - { +void sub_020322C0() { + if (sub_020311F0() != 0) { sub_02031D20(sub_020322F8, 0); } - if (sub_02030E7C(sub_02031190()) != 0 && sub_02031190() != 0) - { + if (sub_02030E7C(sub_02031190()) != 0 && sub_02031190() != 0) { sub_02031D20(sub_0203234C, 0); } } -void sub_020322F8() -{ +void sub_020322F8() { sub_0202E6F0(); sub_02031D20(sub_0203230C, 2); } -void sub_0203230C() -{ - if (UNK_021C5A00->unk3A != 0) - { +void sub_0203230C() { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } - if (sub_0202EE0C() != 0 && sub_0202F950(0, 1, 0x200) != 0) - { + if (sub_0202EE0C() != 0 && sub_0202F950(0, 1, 0x200) != 0) { sub_0202FA10(); sub_02031D20(sub_02032298, 0xa); } } -void sub_0203234C() -{ - if (sub_02030F40() == 0) - { +void sub_0203234C() { + if (sub_02030F40() == 0) { sub_02031D20(sub_020323BC, 0); } } -void sub_02032364() -{ +void sub_02032364() { sub_0202E6F0(); sub_02031D20(sub_02032378, 2); } -void sub_02032378() -{ - if (UNK_021C5A00->unk3A != 0) - { +void sub_02032378() { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } - if (sub_0202EE0C() != 0 && sub_0202F950(0, 1, 0x200) != 0) - { + if (sub_0202EE0C() != 0 && sub_0202F950(0, 1, 0x200) != 0) { sub_0202FA10(); sub_02031D20(sub_02032290, 0xa); } } -void sub_020323B8() -{ +void sub_020323B8() { } -void sub_020323BC() -{ - if (sub_02030F40() == 0) - { +void sub_020323BC() { + if (sub_02030F40() == 0) { sub_020317C0(); } } -void sub_020323CC() -{ +void sub_020323CC() { sub_02031D20(sub_02032440, 5); } -void sub_020323DC() -{ - if (sub_02030F20() <= 1) - { +void sub_020323DC() { + if (sub_02030F20() <= 1) { sub_0202D36C(0); sub_0202FC80(); sub_02031D20(sub_020324F8, 0); } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } @@ -883,71 +730,56 @@ void sub_020323DC() sub_02031D20(sub_020324F8, 0); } -void sub_02032424() -{ - if (sub_0202E6F0() != 0) - { +void sub_02032424() { + if (sub_0202E6F0() != 0) { sub_0202FC60(); sub_02031D20(sub_020324F8, 0); } } -void sub_02032440() -{ - if (UNK_021C5A00->unk3A != 0) - { +void sub_02032440() { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; } - if (sub_0202E6F0() != 0 && UNK_021C5A00->unk3A == 0) - { + if (sub_0202E6F0() != 0 && UNK_021C5A00->unk3A == 0) { sub_0202FA5C(); sub_02031D20(sub_020323BC, 0); } } -void sub_02032478() -{ - if (sub_0202E4C8()) - { +void sub_02032478() { + if (sub_0202E4C8()) { sub_0202E29C(UNK_021C5A00->unk2C); sub_0202D1B0(UNK_021C5A00->unk3C); sub_0202DB14(UNK_021C5A00->unk28, 0); - if (sub_0202F950(1, 1, 0x200) != 0) - { + if (sub_0202F950(1, 1, 0x200) != 0) { sub_0202FA10(); sub_02031D20(sub_020324C8, 0x40); } } } -void sub_020324C8() -{ +void sub_020324C8() { sub_0202EA54(); - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } - if (sub_0202E6F0() != 0) - { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_02032510, 0); } } -void sub_020324F8() -{ - if (sub_0202E6F0() != 0) - { +void sub_020324F8() { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_02032510, 0); } } -void sub_02032510() -{ - if (sub_0202EE0C() != 0 && sub_0202F918(0, UNK_021C5A00->unk43, 0x200, 1) != 0) - { +void sub_02032510() { + if (sub_0202EE0C() != 0 && sub_0202F918(0, UNK_021C5A00->unk43, 0x200, 1) != 0) { // the compiler optimizes away the result of this function because it's not used, so any // second parameter value matches compute(UNK_021C5A00->unk0C, 0); @@ -959,35 +791,28 @@ void sub_02032510() } } -void sub_02032578() -{ - if (!sub_0202F104()) - { - if (sub_020311E8() != 0) - { +void sub_02032578() { + if (!sub_0202F104()) { + if (sub_020311E8() != 0) { UNK_021C5A00->unk43 = 1; sub_02033E74(); sub_02031D20(sub_020327FC, 0); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } } - if (sub_0202E6F0() != 0) - { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_020325D0, 0); } } -void sub_020325D0() -{ - if (sub_0202EE0C() != 0 && sub_0202F950(0, 0, 0x200) != 0) - { +void sub_020325D0() { + if (sub_0202EE0C() != 0 && sub_0202F950(0, 0, 0x200) != 0) { sub_0202FA10(); u32 r1 = compute(UNK_021C5A00->unk0C, 0x20); @@ -996,39 +821,31 @@ void sub_020325D0() } } -void sub_02032628() -{ - if (sub_0202E6F0() != 0) - { +void sub_02032628() { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_02032640, 0); } } -void sub_02032640() -{ - if (sub_0202EE0C() != 0 && sub_0202F950(0, 0, 0x200)) - { +void sub_02032640() { + if (sub_0202EE0C() != 0 && sub_0202F950(0, 0, 0x200)) { sub_0202FA10(); sub_02031D20(sub_0203266C, 0x64); } } -void sub_0203266C() -{ - if (sub_0202E8A0(UNK_021C5A00->unk3E) != 0 && sub_0202FB18(UNK_021C5A00->unk3E) != 0) - { +void sub_0203266C() { + if (sub_0202E8A0(UNK_021C5A00->unk3E) != 0 && sub_0202FB18(UNK_021C5A00->unk3E) != 0) { sub_02031D20(sub_020326D0, 0x64); return; } - if (sub_020311F0() != 0) - { + if (sub_020311F0() != 0) { sub_02031D20(sub_020327B8, 0); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } @@ -1036,24 +853,20 @@ void sub_0203266C() sub_02031D20(sub_020327B8, 0); } -void sub_020326D0() -{ - if (sub_020311F0() != 0) - { +void sub_020326D0() { + if (sub_020311F0() != 0) { sub_02031D20(sub_020327B8, 0); return; } - if (sub_02030E7C(sub_02031190()) != 0) - { + if (sub_02030E7C(sub_02031190()) != 0) { UNK_021C5A00->unk3D = 0; sub_020311D0(6, UNK_02105D5C); sub_02031D20(sub_02032738, 0x78); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } @@ -1061,28 +874,22 @@ void sub_020326D0() sub_02031D20(sub_020327B8, 0); } -void sub_02032738() -{ - if (sub_020311F0() != 0) - { +void sub_02032738() { + if (sub_020311F0() != 0) { sub_02031D20(sub_020327B8, 0); return; } - if (UNK_021C5A00->unk3D == 2) - { + if (UNK_021C5A00->unk3D == 2) { sub_02031D20(sub_020327B4, 0); return; - } - else if (UNK_021C5A00->unk3D == 1) - { + } else if (UNK_021C5A00->unk3D == 1) { sub_0202DBE0(); sub_02031D20(sub_0203279C, 0); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } @@ -1090,25 +897,19 @@ void sub_02032738() sub_02031D20(sub_020327B8, 0); } -void sub_0203279C() -{ - if (sub_020311F0() != 0) - { +void sub_0203279C() { + if (sub_020311F0() != 0) { sub_02031D20(sub_020327B8, 0); } } -void sub_020327B4() -{ +void sub_020327B4() { } -void sub_020327B8() -{ +void sub_020327B8() { UNK_021C5A00->unk3D = 0; - if (sub_0202E6F0() != 0) - { - if (UNK_021C5A00->unk38 != 0) - { + if (sub_0202E6F0() != 0) { + if (UNK_021C5A00->unk38 != 0) { UNK_021C5A00->unk38--; sub_02031D20(sub_02032640, 0); return; @@ -1118,44 +919,33 @@ void sub_020327B8() } } -void sub_020327FC() -{ - if (sub_020311E8() == 0) - { - if (sub_02033510() == 0 && sub_0202E6F0() != 0) - { +void sub_020327FC() { + if (sub_020311E8() == 0) { + if (sub_02033510() == 0 && sub_0202E6F0() != 0) { sub_02031D20(sub_020325D0, 0); } - } - else if (sub_02031190() == 0) - { + } else if (sub_02031190() == 0) { sub_0202DDE8(); } - if (sub_020311F0() != 0 && sub_02033510() == 0) - { + if (sub_020311F0() != 0 && sub_02033510() == 0) { sub_02031D20(sub_020327B8, 0); } } -void sub_02032850() -{ - if (sub_0202EE0C() != 0) - { - if (sub_0202F918(0, UNK_021C5A00->unk43, 0x200, 0) != 0) - { +void sub_02032850() { + if (sub_0202EE0C() != 0) { + if (sub_0202F918(0, UNK_021C5A00->unk43, 0x200, 0) != 0) { sub_0202FA10(); sub_02031D20(sub_020323B8, 0); } } } -void sub_02032888() -{ +void sub_02032888() { u8 st0[4]; UNK_021C5A00->unk3F = 0xd; - if (sub_02031190() == 0) - { + if (sub_02031190() == 0) { st0[1] = 0; sub_020311D0(0xa, &st0[1]); return; @@ -1165,20 +955,17 @@ void sub_02032888() sub_020311D0(0xa, st0); } -void sub_020328C0(u8 param0) -{ +void sub_020328C0(u8 param0) { UNK_021C5A00->unk3E = param0; UNK_021C5A00->unk38 = 3; sub_02031D20(sub_02032924, 0); } -void sub_020328E4() -{ +void sub_020328E4() { UNK_021C5A00->unk3F = 7; } -void sub_020328F4(u8 param0) -{ +void sub_020328F4(u8 param0) { UNK_021C5A00->unk3E = param0; UNK_021C5A00->unk3F = 7; UNK_021C5A00->unk38 = 3; @@ -1186,40 +973,31 @@ void sub_020328F4(u8 param0) sub_02031D20(sub_02032628, 0); } -void sub_02032924() -{ - if (sub_0202E6F0() != 0) - { +void sub_02032924() { + if (sub_0202E6F0() != 0) { sub_02031D20(sub_0203293C, 0); } } -void sub_0203293C() -{ - if (sub_0202EE0C() != 0) - { +void sub_0203293C() { + if (sub_0202EE0C() != 0) { UNK_021C5A00->unk3F = 0xd; - if (sub_0202F950(0, 0, 0x200) != 0) - { + if (sub_0202F950(0, 0, 0x200) != 0) { sub_0202FA1C(); sub_02031D20(sub_02032978, 0x64); } } } -void sub_02032978() -{ - if (sub_0202E8A0(UNK_021C5A00->unk3E) != 0 && sub_0202FB18(UNK_021C5A00->unk3E) != 0) - { +void sub_02032978() { + if (sub_0202E8A0(UNK_021C5A00->unk3E) != 0 && sub_0202FB18(UNK_021C5A00->unk3E) != 0) { sub_02031D20(sub_020329F4, 0x64); return; } - if (sub_020311F0() != 0 || UNK_021C5A00->unk3A == 0) - { + if (sub_020311F0() != 0 || UNK_021C5A00->unk3A == 0) { UNK_021C5A00->unk38--; - if (UNK_021C5A00->unk38 == 0) - { + if (UNK_021C5A00->unk38 == 0) { sub_02031D20(sub_020327B4, 0); return; } @@ -1228,26 +1006,21 @@ void sub_02032978() return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } } -void sub_020329F4() -{ - if (UNK_021C5A00->unk3A > 0x5a) - { +void sub_020329F4() { + if (UNK_021C5A00->unk3A > 0x5a) { UNK_021C5A00->unk3A--; return; } - if (sub_020311F0() != 0) - { + if (sub_020311F0() != 0) { UNK_021C5A00->unk38--; - if (UNK_021C5A00->unk38 == 0) - { + if (UNK_021C5A00->unk38 == 0) { sub_02031D20(sub_020327B4, 0); return; } @@ -1256,21 +1029,18 @@ void sub_020329F4() return; } - if (sub_02030E7C(sub_02031190()) != 0) - { + if (sub_02030E7C(sub_02031190()) != 0) { sub_02031D20(sub_0203279C, 0); return; } - if (UNK_021C5A00->unk3A != 0) - { + if (UNK_021C5A00->unk3A != 0) { UNK_021C5A00->unk3A--; return; } UNK_021C5A00->unk38--; - if (UNK_021C5A00->unk38 == 0) - { + if (UNK_021C5A00->unk38 == 0) { sub_02031D20(sub_020327B4, 0); return; } @@ -1278,25 +1048,20 @@ void sub_020329F4() sub_02031D20(sub_02032924, 0); } -void sub_02032A8C(u8 param0, u32 param1, u8 *param2) -{ +void sub_02032A8C(u8 param0, u32 param1, u8 *param2) { #pragma unused(param1) - if (sub_02031190() == 0) - { + if (sub_02031190() == 0) { u32 i; BOOL r3 = TRUE; - for (i = 0; i < 6; i++) - { - if (UNK_02105D5C[i] != param2[i]) - { + for (i = 0; i < 6; i++) { + if (UNK_02105D5C[i] != param2[i]) { r3 = FALSE; break; } } - if (r3 && UNK_021C5A00->unk48 == 0) - { + if (r3 && UNK_021C5A00->unk48 == 0) { UNK_02105D6C[0] = param0; sub_02030C4C(7, UNK_02105D6C); return; @@ -1307,26 +1072,21 @@ void sub_02032A8C(u8 param0, u32 param1, u8 *param2) } } -void sub_02032AEC(u32 param0, u32 param1, u8 *param2) -{ +void sub_02032AEC(u32 param0, u32 param1, u8 *param2) { #pragma unused(param0) #pragma unused(param1) u32 i; BOOL r4 = TRUE; - for (i = 1; i < 6; i++) - { - if (param2[i] != UNK_02105D6C[i]) - { + for (i = 1; i < 6; i++) { + if (param2[i] != UNK_02105D6C[i]) { r4 = FALSE; break; } } - if (r4) - { + if (r4) { u8 first = param2[0]; - if (first != sub_02031190()) - { + if (first != sub_02031190()) { return; } @@ -1335,20 +1095,16 @@ void sub_02032AEC(u32 param0, u32 param1, u8 *param2) } r4 = TRUE; - for (i = 1; i < 6; i++) - { - if (param2[i] != UNK_02105D64[i]) - { + for (i = 1; i < 6; i++) { + if (param2[i] != UNK_02105D64[i]) { r4 = FALSE; break; } } - if (r4) - { + if (r4) { u8 first = param2[0]; - if (first != (u8)sub_02031190()) - { + if (first != (u8)sub_02031190()) { return; } @@ -1356,43 +1112,34 @@ void sub_02032AEC(u32 param0, u32 param1, u8 *param2) } } -u32 sub_02032B68() -{ +u32 sub_02032B68() { return 6; } -void sub_02032B6C(u8 param0) -{ - if (UNK_021C5A00 != NULL) - { +void sub_02032B6C(u8 param0) { + if (UNK_021C5A00 != NULL) { UNK_021C5A00->unk3C = param0; sub_0202D1B0(param0); } } -void sub_02032B84() -{ +void sub_02032B84() { sub_0202EA54(); } -void sub_02032B8C() -{ - if (sub_0202E4C8()) - { +void sub_02032B8C() { + if (sub_0202E4C8()) { sub_0202E29C(UNK_021C5A00->unk2C); sub_0202DB14(UNK_021C5A00->unk28, 0); - if (sub_0202F950(1, 1, 0x20) != 0) - { + if (sub_0202F950(1, 1, 0x20) != 0) { sub_0202FA10(); sub_02031D20(sub_02032B84, 0); } } } -void sub_02032BD0(struct SaveData *save) -{ - if (sub_02030F40() == 0) - { +void sub_02032BD0(struct SaveData *save) { + if (sub_02030F40() == 0) { CreateHeapAtEnd(3, 0xf, 0x7000); sub_02031734(save, 0xe); UNK_021C5A00->unk40 = 0; @@ -1400,29 +1147,23 @@ void sub_02032BD0(struct SaveData *save) } } -void sub_02032C0C() -{ - if (UNK_021C5A00 != NULL) - { +void sub_02032C0C() { + if (UNK_021C5A00 != NULL) { sub_02031D20(sub_02032440, 5); } } -u32 sub_02032C28() -{ +u32 sub_02032C28() { struct UnkStruct_02031734_const2 st0 = UNK_020EEC48; u32 fun = (u32)UNK_021C5A00->unk24; - if (UNK_021C5A00 == NULL) - { + if (UNK_021C5A00 == NULL) { return 0; } u32 i = 0; - while (st0.unk00[i] != 0) - { - if (st0.unk00[i] == fun) - { + while (st0.unk00[i] != 0) { + if (st0.unk00[i] == fun) { return 1; } @@ -1432,13 +1173,10 @@ u32 sub_02032C28() return 0; } -void sub_02032C6C(u32 param0, u32 param1) -{ - switch (param0) - { +void sub_02032C6C(u32 param0, u32 param1) { + switch (param0) { case 0x333: - if (param1 != 0xf) - { + if (param1 != 0xf) { return; } UNK_021C5A00->unk49 |= 1; @@ -1460,25 +1198,20 @@ void sub_02032C6C(u32 param0, u32 param1) } } -void sub_02032CF4() -{ - if (sub_0202E4C8()) - { +void sub_02032CF4() { + if (sub_0202E4C8()) { sub_0202E29C(UNK_021C5A00->unk2C); sub_0202DB14(UNK_021C5A00->unk28, 0); sub_0202D308(sub_02032C6C); - if (sub_0202F950(1, 1, 0x20) != 0) - { + if (sub_0202F950(1, 1, 0x20) != 0) { sub_0202FA10(); sub_02031D20(sub_02032B84, 0); } } } -void sub_02032D44(struct SaveData *save) -{ - if (sub_02030F40() == 0) - { +void sub_02032D44(struct SaveData *save) { + if (sub_02030F40() == 0) { CreateHeapAtEnd(3, 0xf, 0x7000); sub_02031734(save, 0x11); UNK_021C5A00->unk40 = 0; @@ -1486,121 +1219,95 @@ void sub_02032D44(struct SaveData *save) } } -void sub_02032D80() -{ - if (UNK_021C5A00 != NULL) - { +void sub_02032D80() { + if (UNK_021C5A00 != NULL) { sub_02031D20(sub_02032440, 5); } } -u8 sub_02032D9C() -{ +u8 sub_02032D9C() { return UNK_021C5A00->unk49; } -BOOL sub_02032DAC() -{ +BOOL sub_02032DAC() { sub_02031468(); - if (UNK_021C5A00 == NULL) - { + if (UNK_021C5A00 == NULL) { return TRUE; } - if ((u8)(UNK_021C5A00->unk3F + 0xe8) <= 1) - { + if ((u8)(UNK_021C5A00->unk3F + 0xe8) <= 1) { ov04_021D83C0(); return TRUE; }; - if (sub_02033590() != 0) - { + if (sub_02033590() != 0) { sub_02031D20(sub_0203318C, 0); - } - else - { + } else { sub_02031D20(sub_02032178, 0); } return FALSE; } -void sub_02032E00() -{ - if (sub_0202E4C8()) - { +void sub_02032E00() { + if (sub_0202E4C8()) { sub_0202E29C(UNK_021C5A00->unk2C); sub_0202DB14(UNK_021C5A00->unk28, 0); - if (sub_0202F918(1, 1, 0x200, 1) != 0) - { + if (sub_0202F918(1, 1, 0x200, 1) != 0) { sub_0202FA10(); sub_02031D20(sub_02032218, 0); } } } -void sub_02032E48() -{ - if (sub_0202E4C8()) - { +void sub_02032E48() { + if (sub_0202E4C8()) { sub_0202E29C(UNK_021C5A00->unk2C); sub_0202DB14(UNK_021C5A00->unk28, 0); - if (sub_0202F950(1, 1, 0x200) != 0) - { + if (sub_0202F950(1, 1, 0x200) != 0) { sub_0202FA10(); sub_02031D20(sub_02032290, 0); } } } -void sub_02032E8C() -{ +void sub_02032E8C() { } -void sub_02032E90() -{ - if (ov04_021D7F8C() < 0) - { +void sub_02032E90() { + if (ov04_021D7F8C() < 0) { sub_02031D20(sub_02032E8C, 0); } } -void sub_02032EA8() -{ +void sub_02032EA8() { } -void sub_02032EAC() -{ +void sub_02032EAC() { } -void sub_02032EB0() -{ +void sub_02032EB0() { sub_020313A0(1); s32 res = ov04_021D7F8C(); - if (res >= 0xa) - { + if (res >= 0xa) { sub_02031D20(sub_02032EAC, 0); return; } - if (res < 0) - { + if (res < 0) { sub_02031D20(sub_02032E8C, 0); return; } - if (res == 1) - { + if (res == 1) { sub_02031D20(sub_02032E90, 0); return; } - if (res == 2) - { - if (UNK_021C5A00->unk44 != 0) - { + if (res == 2) { + if (UNK_021C5A00->unk44 != 0) { sub_02031D20(sub_02032E8C, 0); return; } @@ -1609,70 +1316,58 @@ void sub_02032EB0() } } -void sub_02032F20(u32 param0) -{ - if (param0 + 2 > 1) - { +void sub_02032F20(u32 param0) { + if (param0 + 2 > 1) { param0 = -param0; } UNK_021C5A00->unk34 = param0; } -void sub_02032F34() -{ +void sub_02032F34() { s32 res = ov04_021D7800(0); - if (res >= 0xa) - { + if (res >= 0xa) { sub_02031D20(sub_02032EAC, 0); return; } - if (res < 0) - { + if (res < 0) { sub_02032F20((u32)res); sub_02031D20(sub_02032E8C, 0); return; } - if (res == 1) - { + if (res == 1) { sub_02031D20(sub_02032EB0, 0); return; } - if (res == 2) - { + if (res == 2) { sub_02031D20(sub_02032EA8, 0); return; } - if (res == 3) - { + if (res == 3) { sub_02031D20(sub_02032EAC, 0); return; } } -void sub_02032F98() -{ +void sub_02032F98() { s32 res = ov04_021D7800(1); - if (res < 0) - { + if (res < 0) { sub_02032F20((u32)res); sub_02031D20(sub_02032E8C, 0); return; } - if (ov04_021D8494(UNK_021C5A00->unk42) != 0) - { + if (ov04_021D8494(UNK_021C5A00->unk42) != 0) { sub_0202FC60(); sub_02031D20(sub_02032F34, 0); } } -u32 sub_02032FDC(u8 param0) -{ +u32 sub_02032FDC(u8 param0) { ov04_021D77C4(sub_020303BC, sub_02030238); UNK_021C5A00->unk42 = param0; sub_02031D20(sub_02032F98, 0); @@ -1680,72 +1375,57 @@ u32 sub_02032FDC(u8 param0) return 1; } -u32 sub_0203300C() -{ - if (UNK_021C5A00->unk24 == sub_02032F34) - { +u32 sub_0203300C() { + if (UNK_021C5A00->unk24 == sub_02032F34) { return 0; } - if (UNK_021C5A00->unk24 == sub_02032EB0) - { + if (UNK_021C5A00->unk24 == sub_02032EB0) { return 1; } - if (UNK_021C5A00->unk24 == sub_02032E90) - { + if (UNK_021C5A00->unk24 == sub_02032E90) { return 3; } - if (UNK_021C5A00->unk24 == sub_02032EA8) - { + if (UNK_021C5A00->unk24 == sub_02032EA8) { return 4; } - if (UNK_021C5A00->unk24 == sub_02032EAC) - { + if (UNK_021C5A00->unk24 == sub_02032EAC) { return 5; } return 2; } -void sub_02033060() -{ +void sub_02033060() { ov04_021D77C4(sub_020303BC, sub_02030238); - if (ov04_021D8494(-1) != 0) - { + if (ov04_021D8494(-1) != 0) { UNK_021C5A00->unk4D = 0; sub_0202FC60(); sub_02031D20(sub_02032F34, 0); } } -void sub_020330A0() -{ +void sub_020330A0() { sub_020313A0(0); - if (ov04_021D82BC(UNK_021C5A00->unk41) != 0) - { + if (ov04_021D82BC(UNK_021C5A00->unk41) != 0) { ov04_021D836C(); sub_02031D20(sub_02033060, 0); return; } - if (ov04_021D7F8C() < 0) - { + if (ov04_021D7F8C() < 0) { sub_02031D20(sub_02032E8C, 0); } } -void sub_020330E4() -{ - if (sub_02031190() == 0) - { +void sub_020330E4() { + if (sub_02031190() == 0) { UNK_021C5A00->unk41 = 0; sub_02031D20(sub_020330A0, 0); - } - else - { + } else { UNK_021C5A00->unk41 = 1; sub_02031D20(sub_020330A0, 0); } @@ -1753,84 +1433,65 @@ void sub_020330E4() UNK_021C5A00->unk4D = 1; } -u8 sub_02033128() -{ +u8 sub_02033128() { return UNK_021C5A00->unk4D; } -u32 sub_02033138() -{ - if (UNK_021C5A00->unk24 == sub_02033060) - { +u32 sub_02033138() { + if (UNK_021C5A00->unk24 == sub_02033060) { return 1; } return 0; } -u32 sub_02033154() -{ - if (UNK_021C5A00->unk24 == sub_02032F34) - { +u32 sub_02033154() { + if (UNK_021C5A00->unk24 == sub_02032F34) { return 1; } - if (UNK_021C5A00->unk24 == sub_02033060) - { + if (UNK_021C5A00->unk24 == sub_02033060) { return 1; } return 0; } -u32 sub_02033180() -{ +u32 sub_02033180() { return UNK_021C5A00->unk34; } -void sub_0203318C() -{ +void sub_0203318C() { sub_020313A0(0); - if (ov04_021D82BC(0) != 0) - { + if (ov04_021D82BC(0) != 0) { ov04_021D836C(); sub_02031D20(sub_02032440, 0); } - if (ov04_021D7F8C() < 0) - { + if (ov04_021D7F8C() < 0) { sub_02031D20(sub_02032E8C, 0); } } -void sub_020331C4() -{ - if (UNK_021C5A00 != NULL) - { +void sub_020331C4() { + if (UNK_021C5A00 != NULL) { ClearSoftResetDisableMask(1); sub_02031D20(sub_02032440, 5); } } -void sub_020331E8() -{ - if (UNK_021C5A00 != NULL) - { +void sub_020331E8() { + if (UNK_021C5A00 != NULL) { UNK_021C5A00->unk41 = 0; sub_02031D20(sub_020330A0, 0); } } -void sub_02033208() -{ - if (UNK_021C5A00 != NULL) - { - if (sub_02031190() == 0) - { +void sub_02033208() { + if (UNK_021C5A00 != NULL) { + if (sub_02031190() == 0) { UNK_021C5A00->unk41 = 0; - } - else - { + } else { UNK_021C5A00->unk41 = 1; } @@ -1838,23 +1499,18 @@ void sub_02033208() } } -void sub_0203323C() -{ +void sub_0203323C() { u8 res = (u8)sub_02031190(); sub_020311D0(0x15, &res); } -u32 sub_02033250() -{ - if (UNK_021C5A00 != NULL) - { - if (UNK_021C5A00->unk24 == sub_02032E8C) - { +u32 sub_02033250() { + if (UNK_021C5A00 != NULL) { + if (UNK_021C5A00->unk24 == sub_02032E8C) { return 1; } - if (UNK_021C5A00->unk24 == sub_02032E90 && UNK_021C5A00->unk44 != 0) - { + if (UNK_021C5A00->unk24 == sub_02032E90 && UNK_021C5A00->unk44 != 0) { return 1; } } @@ -1862,13 +1518,10 @@ u32 sub_02033250() return 0; } -void sub_02033288(struct SaveData *save) -{ - if (UNK_021C5A00 == NULL) - { +void sub_02033288(struct SaveData *save) { + if (UNK_021C5A00 == NULL) { CreateHeapAtEnd(3, 0xf, 0x100); - UNK_021C5A00 = - (struct UnkStruct_02031734 *)AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct_02031734)); + UNK_021C5A00 = (struct UnkStruct_02031734 *)AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct_02031734)); MI_CpuFill8(UNK_021C5A00, 0, sizeof(struct UnkStruct_02031734)); UNK_021C5A00->unk3F = 0x18; @@ -1879,10 +1532,8 @@ void sub_02033288(struct SaveData *save) } } -void sub_020332DC() -{ - if (UNK_021C5A00 != 0) - { +void sub_020332DC() { + if (UNK_021C5A00 != 0) { ClearSoftResetDisableMask(1); sub_020334E8(0, 0); FreeToHeap(UNK_021C5A00); @@ -1891,13 +1542,10 @@ void sub_020332DC() } } -void sub_02033310(struct SaveData *save) -{ - if (UNK_021C5A00 == NULL) - { +void sub_02033310(struct SaveData *save) { + if (UNK_021C5A00 == NULL) { CreateHeapAtEnd(3, HEAP_ID_15, 0x100); - UNK_021C5A00 = - (struct UnkStruct_02031734 *)AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct_02031734)); + UNK_021C5A00 = (struct UnkStruct_02031734 *)AllocFromHeap(HEAP_ID_15, sizeof(struct UnkStruct_02031734)); MI_CpuFill8(UNK_021C5A00, 0, sizeof(struct UnkStruct_02031734)); UNK_021C5A00->unk3F = 0x19; UNK_021C5A00->unk46 = 1; @@ -1907,10 +1555,8 @@ void sub_02033310(struct SaveData *save) } } -void sub_02033364() -{ - if (UNK_021C5A00 != 0) - { +void sub_02033364() { + if (UNK_021C5A00 != 0) { ClearSoftResetDisableMask(1); sub_020334E8(0, 0); FreeToHeap(UNK_021C5A00); @@ -1919,27 +1565,20 @@ void sub_02033364() } } -u32 sub_02033398() -{ +u32 sub_02033398() { u32 st4; u32 st0; - if (UNK_021C5A00 == NULL) - { + if (UNK_021C5A00 == NULL) { return 0; } - if (UNK_021C5A00->unk3F == 0x18) - { - if (ov04_021DD718(&st4, &st0) != 0) - { + if (UNK_021C5A00->unk3F == 0x18) { + if (ov04_021DD718(&st4, &st0) != 0) { ov04_021DD6F0(); return 1; } - } - else if (UNK_021C5A00->unk3F == 0x19) - { - if (ov04_021DD718(&st4, &st0) != 0 && st0 == 7) - { + } else if (UNK_021C5A00->unk3F == 0x19) { + if (ov04_021DD718(&st4, &st0) != 0 && st0 == 7) { return 1; } } @@ -1947,28 +1586,21 @@ u32 sub_02033398() return 0; } -void sub_020333F0() -{ +void sub_020333F0() { s32 res = ov04_021D76AC(); - if (res < 0) - { + if (res < 0) { sub_02032F20((u32)res); sub_02031D20(sub_02032E8C, 0); return; - } - else if (res > 0) - { + } else if (res > 0) { sub_02031D20(sub_02033060, 0); } } -void sub_0203341C() -{ - if (sub_0202E4C8()) - { +void sub_0203341C() { + if (sub_0202E4C8()) { CreateHeapAtEnd(3, 0x31, 0x31000); - if (sub_0202F918(1, 1, 0x200, 1) != 0) - { + if (sub_0202F918(1, 1, 0x200, 1) != 0) { ov05_021D74E0(UNK_021C5A00->unk28, 0x31); ov04_021D83A8(sub_020335D0); sub_0202FA10(); @@ -1977,11 +1609,9 @@ void sub_0203341C() } } -void *sub_0203346C(struct SaveData *save, u32 param1) -{ +void *sub_0203346C(struct SaveData *save, u32 param1) { Save_PlayerData_GetProfileAddr(save); - if (sub_02030F40() != 0) - { + if (sub_02030F40() != 0) { return 0; } @@ -1998,15 +1628,12 @@ void *sub_0203346C(struct SaveData *save, u32 param1) return UNK_021C5A00->unk00; } -void *sub_020334DC() -{ +void *sub_020334DC() { return UNK_021C5A00->unk00; } -void sub_020334E8(u8 param0, u8 param1) -{ - if (UNK_021C5A00 != NULL) - { +void sub_020334E8(u8 param0, u8 param1) { + if (UNK_021C5A00 != NULL) { UNK_021C5A00->unk44 = param0; UNK_021C5A00->unk45 = param1; } @@ -2015,12 +1642,9 @@ void sub_020334E8(u8 param0, u8 param1) sub_0202EEB0(param0); } -u8 sub_02033510() -{ - if (UNK_021C5A00 != NULL) - { - if (UNK_021C5A00->unk4E != 0) - { +u8 sub_02033510() { + if (UNK_021C5A00 != NULL) { + if (UNK_021C5A00->unk4E != 0) { return 1; } @@ -2030,140 +1654,109 @@ u8 sub_02033510() return 0; } -s32 sub_02033534() -{ - if (UNK_021C5A00 != NULL) - { +s32 sub_02033534() { + if (UNK_021C5A00 != NULL) { return UNK_021C5A00->unk3F; } return 1; } -u8 sub_0203354C() -{ - if (UNK_021C5A00 != NULL) - { +u8 sub_0203354C() { + if (UNK_021C5A00 != NULL) { return UNK_021C5A00->unk40; } return 0; } -void sub_02033564(void *src) -{ +void sub_02033564(void *src) { MI_CpuCopy8(src, UNK_021C5A00->unk04, 0x6); } -void sub_02033578(void *dst) -{ +void sub_02033578(void *dst) { MI_CpuCopy8(UNK_021C5A00->unk04, dst, 0x6); } -u32 sub_02033590() -{ - if (sub_02033534() >= 0x13) - { +u32 sub_02033590() { + if (sub_02033534() >= 0x13) { return 1; } return 0; } -void sub_020335A4(u8 param0) -{ - if (UNK_021C5A00 != NULL) - { +void sub_020335A4(u8 param0) { + if (UNK_021C5A00 != NULL) { UNK_021C5A00->unk47 = param0; } } -u8 sub_020335B8() -{ - if (UNK_021C5A00 != NULL) - { +u8 sub_020335B8() { + if (UNK_021C5A00 != NULL) { return UNK_021C5A00->unk47; } return 0; } -void sub_020335D0(s32 param0) -{ +void sub_020335D0(s32 param0) { ShowCommunicationError(HEAP_ID_DEFAULT, 1, param0); - while (TRUE) - { + while (TRUE) { } } -void sub_020335E0() -{ +void sub_020335E0() { ShowCommunicationError(HEAP_ID_DEFAULT, 4, 0); - while (TRUE) - { + while (TRUE) { } } -void sub_020335F0() -{ +void sub_020335F0() { } -void sub_020335F4() -{ - if (sub_02033510() != 0) - { - if (sub_020311F0() == 0 && sub_02033250() == 0 && sub_02033398() == 0) - { - if (UNK_021C5A00->unk4E == 0) - { +void sub_020335F4() { + if (sub_02033510() != 0) { + if (sub_020311F0() == 0 && sub_02033250() == 0 && sub_02033398() == 0) { + if (UNK_021C5A00->unk4E == 0) { return; } } - if (sub_020335B8() != 0) - { + if (sub_020335B8() != 0) { return; } sub_0200541C(); sub_0202287C(UNK_021C5A00->unk28); gSystem.touchpadReadAuto = 1; - if (UNK_021C5A00->unk4E == 3) - { + if (UNK_021C5A00->unk4E == 3) { sub_020335A4(3); return; } - if (UNK_021C5A00->unk3F == 0x19 || UNK_021C5A00->unk3F == 0xf) - { + if (UNK_021C5A00->unk3F == 0x19 || UNK_021C5A00->unk3F == 0xf) { sub_020335A4(2); - } - else - { + } else { sub_020335A4(1); } } } -BOOL sub_02033678() -{ - if (sub_0202EDD8() || !sub_02031810()) - { +BOOL sub_02033678() { + if (sub_0202EDD8() || !sub_02031810()) { return TRUE; } - if (!sub_0202E344()) - { + if (!sub_0202E344()) { return TRUE; } return FALSE; } -u32 sub_020336A0(u8 param0) -{ - if (UNK_021C5A00 != NULL) - { +u32 sub_020336A0(u8 param0) { + if (UNK_021C5A00 != NULL) { UNK_021C5A00->unk4E = param0; sub_02031468(); return 1; diff --git a/arm9/src/unk_02033778.c b/arm9/src/unk_02033778.c index 6f6e85e40..debcb421c 100644 --- a/arm9/src/unk_02033778.c +++ b/arm9/src/unk_02033778.c @@ -1,7 +1,9 @@ -#include "global.h" #include "unk_02033778.h" -#include "unk_0202F150.h" + +#include "global.h" + #include "player_data.h" +#include "unk_0202F150.h" extern PlayerProfile *sub_0202DFA4(s32 param0); extern u32 sub_0202E020(s32 param0); @@ -9,25 +11,19 @@ extern u32 sub_0202E044(s32 param0); extern u32 sub_02029B40(u32 param0, u32 param1, u32 param2, u32 language); extern void sub_02029B90(u32 param0, u32 param1, u32 param2, u32 param3); -void sub_02033778(u32 param0) -{ +void sub_02033778(u32 param0) { s32 unk = sub_02030F20(); - if (sub_0202DFA4(0) != NULL) - { - for (s32 i = 0; i < unk; i++) - { - if (sub_02031190() != i) - { + if (sub_0202DFA4(0) != NULL) { + for (s32 i = 0; i < unk; i++) { + if (sub_02031190() != i) { sub_020337C8(param0, sub_0202E020(i), sub_0202E044(i), PlayerProfile_GetLanguage(sub_0202DFA4(i))); } } } } -void sub_020337C8(u32 param0, u32 param1, u32 param2, u32 language) -{ - if (sub_02029B40(param0, param1, param2, language) == 0) - { +void sub_020337C8(u32 param0, u32 param1, u32 param2, u32 language) { + if (sub_02029B40(param0, param1, param2, language) == 0) { sub_02029B90(param0, param1, param2, 1); } } diff --git a/arm9/src/unk_020337E8.c b/arm9/src/unk_020337E8.c index e726045fc..9ed4187f9 100644 --- a/arm9/src/unk_020337E8.c +++ b/arm9/src/unk_020337E8.c @@ -1,5 +1,7 @@ -#include "global.h" #include "unk_020337E8.h" + +#include "global.h" + #include "heap.h" extern struct DWC_Struct *sub_020286EC(struct SaveData *save); @@ -17,35 +19,30 @@ extern BOOL DWC_CheckValidConsole(struct DWC_Struct *); extern BOOL DWC_CheckUserData(struct DWC_Struct *); extern s32 DWC_GetGsProfileId(struct DWC_Struct *, struct DWC_token *); -s32 sub_020337E8(HeapID heapId) -{ - s32 ret = (s32)AllocFromHeap(heapId, 0x720); +s32 sub_020337E8(HeapID heapId) { + s32 ret = (s32)AllocFromHeap(heapId, 0x720); s32 ret1 = DWC_Init((ret + 0x1F) & ~0x1F); - FreeToHeap((void*)ret); + FreeToHeap((void *)ret); return ret1; } -void sub_0203380C(struct DWC_Struct *dwc) -{ - struct DWC_Struct * dwc1 = sub_02028228(dwc); - if(!DWC_CheckUserData(dwc1)) - { +void sub_0203380C(struct DWC_Struct *dwc) { + struct DWC_Struct *dwc1 = sub_02028228(dwc); + if (!DWC_CheckUserData(dwc1)) { DWC_CreateUserData(dwc1, 0x4144414A); DWC_ClearDirtyFlag(dwc1); } } -s32 sub_02033830(struct DWC_Struct *dwc) -{ +s32 sub_02033830(struct DWC_Struct *dwc) { struct DWC_token token; - struct DWC_Struct * dwc1 = sub_02028228(dwc); + struct DWC_Struct *dwc1 = sub_02028228(dwc); DWC_CreateExchangeToken(dwc1, &token); return DWC_GetGsProfileId(dwc1, &token); } -BOOL sub_0203384C(struct SaveData *save) -{ - struct DWC_Struct * dwc = sub_02028228(sub_020286EC(save)); - return (DWC_CheckHasProfile(dwc) && DWC_CheckValidConsole(dwc)); +BOOL sub_0203384C(struct SaveData *save) { + struct DWC_Struct *dwc = sub_02028228(sub_020286EC(save)); + return DWC_CheckHasProfile(dwc) && DWC_CheckValidConsole(dwc); } diff --git a/arm9/src/unk_0204AEA8.c b/arm9/src/unk_0204AEA8.c index 2629d705a..1b0d38536 100644 --- a/arm9/src/unk_0204AEA8.c +++ b/arm9/src/unk_0204AEA8.c @@ -1,43 +1,42 @@ -#include "global.h" #include "unk_0204AEA8.h" + +#include "global.h" + #include "heap.h" #include "task.h" #include "unk_020040F4.h" extern void ov05_021E3444(u32, struct FieldSystem *, u32); -BOOL sub_0204AEA8(struct TaskManager *taskManager) -{ +BOOL sub_0204AEA8(struct TaskManager *taskManager) { struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - u32 *v1 = TaskManager_GetEnvironment(taskManager); - - switch (v1[0]) - { - case 0: - ov05_021E3444(v1[2], fieldSystem, (u32)v1 + 4); - sub_0200433C(5, v1[3], 1); - v1[0]++; - break; - case 1: - if (v1[1] == 1) - { - FreeToHeap(v1); - return TRUE; - } - break; + u32 *v1 = TaskManager_GetEnvironment(taskManager); + + switch (v1[0]) { + case 0: + ov05_021E3444(v1[2], fieldSystem, (u32)v1 + 4); + sub_0200433C(5, v1[3], 1); + v1[0]++; + break; + case 1: + if (v1[1] == 1) { + FreeToHeap(v1); + return TRUE; + } + break; } - + return FALSE; } -void sub_0204AEF8(struct TaskManager *taskManager, u32 a1, u32 a2) //taskManager, effect, bgm +void sub_0204AEF8(struct TaskManager *taskManager, u32 a1, u32 a2) // taskManager, effect, bgm { - u32 *v0 = AllocFromHeapAtEnd(HEAP_ID_FIELD, 4 * sizeof(u32)); //todo: make a struct - - v0[0] = 0; //state - v0[1] = 0; //unk - v0[2] = a1; //effect - v0[3] = a2; //bgm - + u32 *v0 = AllocFromHeapAtEnd(HEAP_ID_FIELD, 4 * sizeof(u32)); // todo: make a struct + + v0[0] = 0; // state + v0[1] = 0; // unk + v0[2] = a1; // effect + v0[3] = a2; // bgm + TaskManager_Call(taskManager, sub_0204AEA8, v0); } diff --git a/arm9/src/unk_0204AF24.c b/arm9/src/unk_0204AF24.c index 79dd85d73..a5785742b 100644 --- a/arm9/src/unk_0204AF24.c +++ b/arm9/src/unk_0204AF24.c @@ -1,27 +1,26 @@ +#include "unk_0204AF24.h" + #include "global.h" + #include "constants/rgb.h" + #include "gx.h" -#include "unk_0204AF24.h" extern void sub_02037394(struct FieldSystem *); extern u32 IsPaletteFadeFinished(void); extern void BeginNormalPaletteFade(u32 pattern, u32 typeTop, u32 typeBottom, u16 colour, u32 duration, u32 framesPer, HeapID heapId); extern void ov05_021E331C(struct FieldSystem *); -BOOL sub_0204AF24(struct TaskManager *taskManager) -{ - if(!sub_0203739C(TaskManager_GetFieldSystem(taskManager))) - { +BOOL sub_0204AF24(struct TaskManager *taskManager) { + if (!sub_0203739C(TaskManager_GetFieldSystem(taskManager))) { return TRUE; } return FALSE; } -void sub_0204AF3C(struct TaskManager *taskManager) -{ - struct FieldSystem * fieldSystem = TaskManager_GetFieldSystem(taskManager); - if(!sub_0203739C(fieldSystem)) - { +void sub_0204AF3C(struct TaskManager *taskManager) { + struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); + if (!sub_0203739C(fieldSystem)) { GF_ASSERT(FALSE); return; } @@ -29,20 +28,16 @@ void sub_0204AF3C(struct TaskManager *taskManager) TaskManager_Call(taskManager, &sub_0204AF24, NULL); } -BOOL sub_0204AF6C(struct TaskManager *taskManager) -{ - if(sub_020464A4(TaskManager_GetFieldSystem(taskManager))) - { +BOOL sub_0204AF6C(struct TaskManager *taskManager) { + if (sub_020464A4(TaskManager_GetFieldSystem(taskManager))) { return TRUE; } return FALSE; } -void CallTask_RestoreOverworld(struct TaskManager *taskManager) -{ +void CallTask_RestoreOverworld(struct TaskManager *taskManager) { struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - if(sub_0203739C(fieldSystem)) - { + if (sub_0203739C(fieldSystem)) { GF_ASSERT(FALSE); return; } @@ -50,31 +45,25 @@ void CallTask_RestoreOverworld(struct TaskManager *taskManager) TaskManager_Call(taskManager, &sub_0204AF6C, NULL); } -BOOL Task_ProcessFade(struct TaskManager *taskManager) -{ +BOOL Task_ProcessFade(struct TaskManager *taskManager) { #pragma unused(taskManager) - if(IsPaletteFadeFinished()) - { + if (IsPaletteFadeFinished()) { return TRUE; } return FALSE; } -void CallTask_FadeToBlack(struct TaskManager *taskManager) -{ - if(!sub_0203739C(TaskManager_GetFieldSystem(taskManager))) - { +void CallTask_FadeToBlack(struct TaskManager *taskManager) { + if (!sub_0203739C(TaskManager_GetFieldSystem(taskManager))) { GF_ASSERT(0); return; } - BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, HEAP_ID_4); //TODO: find constants for palette fade + BeginNormalPaletteFade(0, 0, 0, RGB_BLACK, 6, 1, HEAP_ID_4); // TODO: find constants for palette fade TaskManager_Call(taskManager, Task_ProcessFade, 0); } -void CallTask_FadeFromBlack(struct TaskManager *taskManager) -{ - if(!sub_0203739C(TaskManager_GetFieldSystem(taskManager))) - { +void CallTask_FadeFromBlack(struct TaskManager *taskManager) { + if (!sub_0203739C(TaskManager_GetFieldSystem(taskManager))) { GF_ASSERT(0); return; } @@ -82,56 +71,50 @@ void CallTask_FadeFromBlack(struct TaskManager *taskManager) TaskManager_Call(taskManager, Task_ProcessFade, 0); } -BOOL sub_0204B050(struct TaskManager *taskManager) -{ - u32 * r4 = TaskManager_GetStatePtr(taskManager); - switch(r4[0]) - { - case 0: - CallTask_FadeToBlack(taskManager); - r4[0]++; - break; - case 1: - sub_0204AF3C(taskManager); - r4[0]++; - break; - case 2: - return TRUE; - default: - break; +BOOL sub_0204B050(struct TaskManager *taskManager) { + u32 *r4 = TaskManager_GetStatePtr(taskManager); + switch (r4[0]) { + case 0: + CallTask_FadeToBlack(taskManager); + r4[0]++; + break; + case 1: + sub_0204AF3C(taskManager); + r4[0]++; + break; + case 2: + return TRUE; + default: + break; } return FALSE; } -void sub_0204B090(struct TaskManager *taskManager) -{ +void sub_0204B090(struct TaskManager *taskManager) { TaskManager_Call(taskManager, &sub_0204B050, 0); } -BOOL sub_0204B0A0(struct TaskManager *taskManager) -{ - u32 * r4 = TaskManager_GetStatePtr(taskManager); +BOOL sub_0204B0A0(struct TaskManager *taskManager) { + u32 *r4 = TaskManager_GetStatePtr(taskManager); struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - switch(r4[0]) - { - case 0: - CallTask_RestoreOverworld(taskManager); - r4[0]++; - break; - case 1: - ov05_021E331C(fieldSystem); - CallTask_FadeFromBlack(taskManager); - r4[0]++; - break; - case 2: - return TRUE; - default: - break; + switch (r4[0]) { + case 0: + CallTask_RestoreOverworld(taskManager); + r4[0]++; + break; + case 1: + ov05_021E331C(fieldSystem); + CallTask_FadeFromBlack(taskManager); + r4[0]++; + break; + case 2: + return TRUE; + default: + break; } return FALSE; } -void sub_0204B0E8(struct TaskManager *taskManager) -{ +void sub_0204B0E8(struct TaskManager *taskManager) { TaskManager_Call(taskManager, &sub_0204B0A0, 0); } diff --git a/arm9/src/unk_0204B0A0.c b/arm9/src/unk_0204B0A0.c index 21d5878d2..8461b2d89 100644 --- a/arm9/src/unk_0204B0A0.c +++ b/arm9/src/unk_0204B0A0.c @@ -1,74 +1,67 @@ +#include "unk_0204B0A0.h" + #include "global.h" + #include "save_vars_flags.h" #include "unk_02022504.h" -#include "unk_0204B0A0.h" #include "unk_0205FA2C.h" -extern void GF_RTC_CopyDateTime(struct RTCDate* date, struct RTCTime* time); -extern void sub_02029C08(void*); +extern void GF_RTC_CopyDateTime(struct RTCDate *date, struct RTCTime *time); +extern void sub_02029C08(void *); extern void sub_0202B3C4(SafariZone *safariZone, s32, u32); extern u8 GF_RTC_GetTimeOfDayByHour(u32 hour); extern s64 GF_RTC_DateTimeToSec(void); -extern void* sub_02029AFC(struct SaveData* save); -extern void sub_02025B60(struct SaveData* save, s32, BOOL); -extern BOOL sub_0205F668(struct SaveData* save); -extern void sub_0202A9D0(struct SaveData* save, s32); -extern BOOL sub_0205F618(struct SaveData* save, u16); -extern void sub_0204B3D0(struct FieldSystem*, s32); -extern void sub_0205F5A4(struct SaveVarsFlags* state, u16); -extern s32 sub_0205F594(struct SaveVarsFlags* state); -extern void sub_0202A988(void*, u32); -extern void* Save_Roamers_Get(struct SaveData* save); -extern void sub_02060344(struct SaveData* save, s32); -extern void sub_0203959C(struct FieldSystem*); -extern void sub_02025A60(struct SaveData* save, s32); -extern struct SaveData* FieldSystem_GetSaveData(struct FieldSystem*); - -void sub_0204B0F8(struct FieldSystem *fieldSystem) -{ +extern void *sub_02029AFC(struct SaveData *save); +extern void sub_02025B60(struct SaveData *save, s32, BOOL); +extern BOOL sub_0205F668(struct SaveData *save); +extern void sub_0202A9D0(struct SaveData *save, s32); +extern BOOL sub_0205F618(struct SaveData *save, u16); +extern void sub_0204B3D0(struct FieldSystem *, s32); +extern void sub_0205F5A4(struct SaveVarsFlags *state, u16); +extern s32 sub_0205F594(struct SaveVarsFlags *state); +extern void sub_0202A988(void *, u32); +extern void *Save_Roamers_Get(struct SaveData *save); +extern void sub_02060344(struct SaveData *save, s32); +extern void sub_0203959C(struct FieldSystem *); +extern void sub_02025A60(struct SaveData *save, s32); +extern struct SaveData *FieldSystem_GetSaveData(struct FieldSystem *); + +void sub_0204B0F8(struct FieldSystem *fieldSystem) { RTCDate date; RTCTime time; SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); - if (rtc_info->field_00 != 0) - { + if (rtc_info->field_00 != 0) { GF_RTC_CopyDateTime(&date, &time); sub_0204B130(fieldSystem, rtc_info, &date); sub_0204B158(fieldSystem, rtc_info, &date, &time); } } -void sub_0204B130(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate* date) -{ - u32 days = (u32)RTC_ConvertDateToDay(date); +void sub_0204B130(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate *date) { + u32 days = (u32)RTC_ConvertDateToDay(date); u32 days_since_nitro_epoch = (u32)rtc_info->daysSinceNitroEpoch; - if (days < days_since_nitro_epoch) - { + if (days < days_since_nitro_epoch) { rtc_info->daysSinceNitroEpoch = (s32)days; - } - else if (days > days_since_nitro_epoch) - { + } else if (days > days_since_nitro_epoch) { sub_0204B1DC(fieldSystem, (s32)(days - days_since_nitro_epoch)); rtc_info->daysSinceNitroEpoch = (s32)days; } } -void sub_0204B158(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate* date, struct RTCTime* time) -{ +void sub_0204B158(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate *date, struct RTCTime *time) { s64 unk1 = RTC_ConvertDateTimeToSecond(date, time); s64 unk2 = RTC_ConvertDateTimeToSecond(&rtc_info->date, &rtc_info->time); - if (unk2 > unk1) - { + if (unk2 > unk1) { rtc_info->date = *date; rtc_info->time = *time; return; } s32 minutes = (s32)((unk1 - unk2) / 60); - if (minutes > 0) - { + if (minutes > 0) { sub_02023884(rtc_info, (u32)minutes); sub_0204B270(fieldSystem, minutes, time); @@ -77,34 +70,30 @@ void sub_0204B158(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct } } -void sub_0204B1DC(struct FieldSystem *fieldSystem, s32 a1) -{ - struct SaveData* save = FieldSystem_GetSaveData(fieldSystem); +void sub_0204B1DC(struct FieldSystem *fieldSystem, s32 a1) { + struct SaveData *save = FieldSystem_GetSaveData(fieldSystem); sub_02025A60(save, a1); sub_0203959C(fieldSystem); sub_02060344(fieldSystem->saveData, a1); - void* unk_sav_ptr1 = sub_0202881C(fieldSystem->saveData); + void *unk_sav_ptr1 = sub_0202881C(fieldSystem->saveData); sub_02028754(unk_sav_ptr1, (u32)a1); - void* unk_sav_ptr2 = Save_Roamers_Get(fieldSystem->saveData); - unk_sav_ptr1 = sub_0202881C(fieldSystem->saveData); - u32 unk1 = sub_020287A4(unk_sav_ptr1); + void *unk_sav_ptr2 = Save_Roamers_Get(fieldSystem->saveData); + unk_sav_ptr1 = sub_0202881C(fieldSystem->saveData); + u32 unk1 = sub_020287A4(unk_sav_ptr1); sub_0202A988(unk_sav_ptr2, unk1); - struct Party* party = SaveArray_Party_Get(fieldSystem->saveData); + struct Party *party = SaveArray_Party_Get(fieldSystem->saveData); Party_UpdatePokerus(party, a1); - struct SaveVarsFlags* state = Save_VarsFlags_Get(fieldSystem->saveData); - s32 unk2 = sub_0205F594(state); + struct SaveVarsFlags *state = Save_VarsFlags_Get(fieldSystem->saveData); + s32 unk2 = sub_0205F594(state); u16 unk3; - if (unk2 > a1) - { + if (unk2 > a1) { unk3 = (u16)(unk2 - a1); - } - else - { + } else { unk3 = 0; } @@ -113,85 +102,74 @@ void sub_0204B1DC(struct FieldSystem *fieldSystem, s32 a1) sub_0205F668(fieldSystem->saveData); sub_0206007C(fieldSystem->saveData); - void* unk_sav_ptr3 = sub_02029AFC(fieldSystem->saveData); + void *unk_sav_ptr3 = sub_02029AFC(fieldSystem->saveData); sub_02029C08(unk_sav_ptr3); } -void sub_0204B270(struct FieldSystem *fieldSystem, s32 a1, struct RTCTime* time) -{ +void sub_0204B270(struct FieldSystem *fieldSystem, s32 a1, struct RTCTime *time) { sub_0204B3D0(fieldSystem, a1); sub_0202A9D0(fieldSystem->saveData, a1); BOOL unk_bool = sub_0204B33C(fieldSystem); sub_02025B60(fieldSystem->saveData, a1, unk_bool); - SafariZone* safariZone = Save_SafariZone_Get(fieldSystem->saveData); + SafariZone *safariZone = Save_SafariZone_Get(fieldSystem->saveData); sub_0202B3C4(safariZone, a1, time->minute); } -u32 Script_GetTimeOfDay(struct FieldSystem *fieldSystem) -{ +u32 Script_GetTimeOfDay(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); return GF_RTC_GetTimeOfDayByHour(rtc_info->time.hour); } -u32 Script_GetMonth(struct FieldSystem *fieldSystem) -{ +u32 Script_GetMonth(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); return rtc_info->date.month; } -u32 Script_GetDay(struct FieldSystem *fieldSystem) -{ +u32 Script_GetDay(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); return rtc_info->date.day; } -RTCWeek Script_GetWeekday(struct FieldSystem *fieldSystem) -{ +RTCWeek Script_GetWeekday(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); return rtc_info->date.week; } -u32 Script_GetHour(struct FieldSystem *fieldSystem) -{ +u32 Script_GetHour(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); return rtc_info->time.hour; } -u32 Script_GetMinute(struct FieldSystem *fieldSystem) -{ +u32 Script_GetMinute(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); return rtc_info->time.minute; } -void Script_SavRTC_x24toDateTime(struct FieldSystem *fieldSystem, struct RTCDate* date, struct RTCTime* time) -{ +void Script_SavRTC_x24toDateTime(struct FieldSystem *fieldSystem, struct RTCDate *date, struct RTCTime *time) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); RTC_ConvertSecondToDateTime(date, time, rtc_info->secondsSinceNitroEpoch); } -void Script_SavRTC_x2CtoDateTime(struct FieldSystem *fieldSystem, struct RTCDate* date, struct RTCTime* time) -{ +void Script_SavRTC_x2CtoDateTime(struct FieldSystem *fieldSystem, struct RTCDate *date, struct RTCTime *time) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); RTC_ConvertSecondToDateTime(date, time, rtc_info->field_2C); } -void Script_SavRTC_DateTimeTox2C(struct FieldSystem *fieldSystem) -{ +void Script_SavRTC_DateTimeTox2C(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); rtc_info->field_2C = GF_RTC_DateTimeToSec(); } -BOOL sub_0204B33C(struct FieldSystem *fieldSystem) -{ +BOOL sub_0204B33C(struct FieldSystem *fieldSystem) { SysInfo_RTC *rtc_info = Save_SysInfo_RTC_Get(fieldSystem->saveData); return sub_02023874(rtc_info); diff --git a/arm9/src/unk_0205EC84.c b/arm9/src/unk_0205EC84.c index fa9ee3062..bf4c86ca9 100644 --- a/arm9/src/unk_0205EC84.c +++ b/arm9/src/unk_0205EC84.c @@ -1,29 +1,27 @@ -#include "global.h" -#include "proto.h" #include "unk_0205EC84.h" + +#include "global.h" + #include "constants/flags.h" -#include "constants/sndseq.h" #include "constants/maps.h" +#include "constants/sndseq.h" -static void _flag_set(struct SaveVarsFlags * state, u16 flag_id) -{ +#include "proto.h" + +static void _flag_set(struct SaveVarsFlags *state, u16 flag_id) { Save_VarsFlags_SetFlagInArray(state, flag_id); } -static void _flag_clear(struct SaveVarsFlags * state, u16 flag_id) -{ +static void _flag_clear(struct SaveVarsFlags *state, u16 flag_id) { Save_VarsFlags_ClearFlagInArray(state, flag_id); } -static BOOL _flag_check(struct SaveVarsFlags * state, u16 flag_id) -{ +static BOOL _flag_check(struct SaveVarsFlags *state, u16 flag_id) { return Save_VarsFlags_CheckFlagInArray(state, flag_id); } -static BOOL _flag_op(struct SaveVarsFlags * state, u32 op, u32 flag_id) -{ - switch (op) - { +static BOOL _flag_op(struct SaveVarsFlags *state, u32 op, u32 flag_id) { + switch (op) { case 1: _flag_set(state, (u16)flag_id); break; @@ -38,110 +36,88 @@ static BOOL _flag_op(struct SaveVarsFlags * state, u32 op, u32 flag_id) return FALSE; } -void sub_0205ECD4(struct SaveVarsFlags * state) -{ +void sub_0205ECD4(struct SaveVarsFlags *state) { _flag_set(state, 0x960); } -BOOL sub_0205ECE0(struct SaveVarsFlags * state) -{ +BOOL sub_0205ECE0(struct SaveVarsFlags *state) { return _flag_check(state, 0x960); } -BOOL sub_0205ECEC(struct SaveVarsFlags * state) -{ +BOOL sub_0205ECEC(struct SaveVarsFlags *state) { return _flag_check(state, 0x98D); } -void sub_0205ECFC(struct SaveVarsFlags * state) -{ +void sub_0205ECFC(struct SaveVarsFlags *state) { _flag_set(state, 0x964); } -BOOL sub_0205ED0C(struct SaveVarsFlags * state) -{ +BOOL sub_0205ED0C(struct SaveVarsFlags *state) { return _flag_check(state, 0x964); } -void sub_0205ED1C(struct SaveVarsFlags * state) -{ +void sub_0205ED1C(struct SaveVarsFlags *state) { _flag_set(state, 0x961); } -void sub_0205ED2C(struct SaveVarsFlags * state) -{ +void sub_0205ED2C(struct SaveVarsFlags *state) { _flag_clear(state, 0x961); } -BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags * state) -{ +BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags *state) { return _flag_check(state, 0x961); } -void sub_0205ED4C(struct SaveVarsFlags * state) -{ +void sub_0205ED4C(struct SaveVarsFlags *state) { _flag_set(state, 0x965); } -void sub_0205ED5C(struct SaveVarsFlags * state) -{ +void sub_0205ED5C(struct SaveVarsFlags *state) { _flag_clear(state, 0x965); } -BOOL sub_0205ED6C(struct SaveVarsFlags * state) -{ +BOOL sub_0205ED6C(struct SaveVarsFlags *state) { return _flag_check(state, 0x965); } -void sub_0205ED7C(struct SaveVarsFlags * state) -{ +void sub_0205ED7C(struct SaveVarsFlags *state) { _flag_set(state, 0x96D); } -void sub_0205ED8C(struct SaveVarsFlags * state) -{ +void sub_0205ED8C(struct SaveVarsFlags *state) { _flag_clear(state, 0x96D); } -BOOL sub_0205ED9C(struct SaveVarsFlags * state) -{ +BOOL sub_0205ED9C(struct SaveVarsFlags *state) { return _flag_check(state, 0x96D); } -void sub_0205EDAC(struct SaveVarsFlags * state) -{ +void sub_0205EDAC(struct SaveVarsFlags *state) { _flag_set(state, 0x96E); } -void sub_0205EDBC(struct SaveVarsFlags * state) -{ +void sub_0205EDBC(struct SaveVarsFlags *state) { _flag_set(state, 0x96F); } -void sub_0205EDCC(struct SaveVarsFlags * state) -{ +void sub_0205EDCC(struct SaveVarsFlags *state) { _flag_set(state, 0x970); } -void sub_0205EDD8(struct SaveVarsFlags * state) -{ +void sub_0205EDD8(struct SaveVarsFlags *state) { _flag_set(state, 0x971); } -void sub_0205EDE8(struct SaveVarsFlags * state) -{ +void sub_0205EDE8(struct SaveVarsFlags *state) { _flag_set(state, 0x972); } -void sub_0205EDF8(struct SaveVarsFlags * state) -{ +void sub_0205EDF8(struct SaveVarsFlags *state) { _flag_set(state, 0x973); } -void sub_0205EE08(struct SaveVarsFlags * state, u32 a1) -{ - switch (a1) - { +void sub_0205EE08(struct SaveVarsFlags *state, u32 a1) { + switch (a1) { case 0: _flag_set(state, 0x968); break; @@ -160,10 +136,8 @@ void sub_0205EE08(struct SaveVarsFlags * state, u32 a1) } } -BOOL sub_0205EE60(struct SaveVarsFlags * state, u32 a1) -{ - switch (a1) - { +BOOL sub_0205EE60(struct SaveVarsFlags *state, u32 a1) { + switch (a1) { case 0: return _flag_check(state, 0x968); case 1: @@ -178,11 +152,9 @@ BOOL sub_0205EE60(struct SaveVarsFlags * state, u32 a1) // UB: No return value } -BOOL sub_0205EEB8(struct SaveVarsFlags * state, u32 a1) -{ +BOOL sub_0205EEB8(struct SaveVarsFlags *state, u32 a1) { BOOL ret = FALSE; - switch (a1) - { + switch (a1) { case 0: break; case 1: @@ -204,34 +176,38 @@ BOOL sub_0205EEB8(struct SaveVarsFlags * state, u32 a1) return ret; } -s32 sub_0205EF20(struct SaveVarsFlags * state, s32 a1) -{ +s32 sub_0205EF20(struct SaveVarsFlags *state, s32 a1) { s32 ret = 0; - switch (a1) - { + switch (a1) { case MAP_D28R0101: - if (_flag_check(state, 0x984) == TRUE) + if (_flag_check(state, 0x984) == TRUE) { ret = SEQ_D_LAKE; + } break; case MAP_D28R0103: - if (_flag_check(state, 0x984) == TRUE) + if (_flag_check(state, 0x984) == TRUE) { ret = SEQ_D_RYAYHY; + } break; case MAP_D27R0102: - if (_flag_check(state, 0x98E) == TRUE) + if (_flag_check(state, 0x98E) == TRUE) { ret = SEQ_D_LAKE; + } break; case MAP_D29R0102: - if (_flag_check(state, 0x98F) == TRUE) + if (_flag_check(state, 0x98F) == TRUE) { ret = SEQ_D_LAKE; + } break; case MAP_D10R0101: - if (_flag_check(state, 0x995) == TRUE) + if (_flag_check(state, 0x995) == TRUE) { ret = SEQ_D_SAFARI; + } break; case MAP_T02R0101: - if (_flag_check(state, 0x993) == TRUE) + if (_flag_check(state, 0x993) == TRUE) { ret = SEQ_OPENING2; + } break; case MAP_D26R0101: case MAP_D26R0102: @@ -241,199 +217,172 @@ s32 sub_0205EF20(struct SaveVarsFlags * state, s32 a1) case MAP_D26R0106: case MAP_D26R0107: case MAP_D26R0108: - if (_flag_check(state, 0x985) == TRUE) - { - if (!IsNighttime()) + if (_flag_check(state, 0x985) == TRUE) { + if (!IsNighttime()) { ret = SEQ_CITY07_D; - else + } else { ret = SEQ_CITY07_N; - } - else if (a1 == MAP_D26R0101) - { - if (_flag_check(state, 0x986) == TRUE) + } + } else if (a1 == MAP_D26R0101) { + if (_flag_check(state, 0x986) == TRUE) { ret = SEQ_D_AGITO; + } } break; case MAP_C04R0201: case MAP_C04R0202: case MAP_C04R0203: case MAP_C04R0204: - if (_flag_check(state, 0x987) == TRUE) - { - if (!IsNighttime()) + if (_flag_check(state, 0x987) == TRUE) { + if (!IsNighttime()) { ret = SEQ_CITY04_D; - else + } else { ret = SEQ_CITY04_N; + } } break; case MAP_D02R0101: - if (_flag_check(state, 0x988) == TRUE) - { - if (!IsNighttime()) + if (_flag_check(state, 0x988) == TRUE) { + if (!IsNighttime()) { ret = SEQ_ROAD_C_D; - else + } else { ret = SEQ_ROAD_C_N; + } } break; case MAP_D13R0101: - if (_flag_check(state, 0x989) == TRUE) - { - if (!IsNighttime()) + if (_flag_check(state, 0x989) == TRUE) { + if (!IsNighttime()) { ret = SEQ_TOWN03_D; - else + } else { ret = SEQ_TOWN03_N; + } } break; case MAP_R224: - if (_flag_check(state, 0x98A) == TRUE) - { - if (!IsNighttime()) + if (_flag_check(state, 0x98A) == TRUE) { + if (!IsNighttime()) { ret = SEQ_TOWN03_D; - else + } else { ret = SEQ_TOWN03_N; + } } break; case MAP_C10R0111: - if (_flag_check(state, 0x98B) == TRUE) + if (_flag_check(state, 0x98B) == TRUE) { ret = SEQ_SILENCE_FIELD; + } break; } return ret; } - -void sub_0205F154(struct SaveVarsFlags * state) -{ +void sub_0205F154(struct SaveVarsFlags *state) { _flag_set(state, 0x966); } -void sub_0205F164(struct SaveVarsFlags * state) -{ +void sub_0205F164(struct SaveVarsFlags *state) { _flag_clear(state, 0x966); } -BOOL sub_0205F174(struct SaveVarsFlags * state) -{ +BOOL sub_0205F174(struct SaveVarsFlags *state) { return _flag_check(state, 0x966); } -BOOL sub_0205F184(struct SaveVarsFlags * state) -{ +BOOL sub_0205F184(struct SaveVarsFlags *state) { return _flag_check(state, 0x978); } -BOOL sub_0205F194(struct SaveVarsFlags * state) -{ +BOOL sub_0205F194(struct SaveVarsFlags *state) { return _flag_check(state, 0x992); } -BOOL sub_0205F1A4(struct SaveVarsFlags * state) -{ +BOOL sub_0205F1A4(struct SaveVarsFlags *state) { return _flag_check(state, 0x97D); } -BOOL sub_0205F1B4(struct SaveVarsFlags * state) -{ +BOOL sub_0205F1B4(struct SaveVarsFlags *state) { return _flag_check(state, 0x97E); } -void sub_0205F1C4(struct SaveVarsFlags * state) -{ +void sub_0205F1C4(struct SaveVarsFlags *state) { _flag_set(state, 0x97C); } -void sub_0205F1D4(struct SaveVarsFlags * state) -{ +void sub_0205F1D4(struct SaveVarsFlags *state) { _flag_clear(state, 0x97C); } -BOOL sub_0205F1E4(struct SaveVarsFlags * state) -{ +BOOL sub_0205F1E4(struct SaveVarsFlags *state) { return _flag_check(state, 0x97C); } -void Save_VarsFlags_SetSafariSysFlag(struct SaveVarsFlags * state) -{ +void Save_VarsFlags_SetSafariSysFlag(struct SaveVarsFlags *state) { _flag_set(state, FLAG_SYS_SAFARI); } -void Save_VarsFlags_ClearSafariSysFlag(struct SaveVarsFlags * state) -{ +void Save_VarsFlags_ClearSafariSysFlag(struct SaveVarsFlags *state) { _flag_clear(state, FLAG_SYS_SAFARI); } -BOOL Save_VarsFlags_CheckSafariSysFlag(struct SaveVarsFlags * state) //Save_VarsFlags_CheckSafariSysFlag? +BOOL Save_VarsFlags_CheckSafariSysFlag(struct SaveVarsFlags *state) // Save_VarsFlags_CheckSafariSysFlag? { return _flag_check(state, FLAG_SYS_SAFARI); } -void sub_0205F224(struct SaveVarsFlags * state) -{ +void sub_0205F224(struct SaveVarsFlags *state) { _flag_set(state, 0x979); } -void sub_0205F234(struct SaveVarsFlags * state) -{ +void sub_0205F234(struct SaveVarsFlags *state) { _flag_clear(state, 0x979); } -BOOL sub_0205F244(struct SaveVarsFlags * state) -{ +BOOL sub_0205F244(struct SaveVarsFlags *state) { return _flag_check(state, 0x979); } -void sub_0205F254(struct SaveVarsFlags * state) -{ +void sub_0205F254(struct SaveVarsFlags *state) { _flag_clear(state, 0x994); } -BOOL sub_0205F264(struct SaveVarsFlags * state, u32 op) -{ +BOOL sub_0205F264(struct SaveVarsFlags *state, u32 op) { return _flag_op(state, op, 0x962); } -void sub_0205F274(struct SaveVarsFlags * state) -{ +void sub_0205F274(struct SaveVarsFlags *state) { _flag_set(state, 0x97A); } -void sub_0205F284(struct SaveVarsFlags * state) -{ +void sub_0205F284(struct SaveVarsFlags *state) { _flag_clear(state, 0x97A); } -BOOL sub_0205F294(struct SaveVarsFlags * state) -{ +BOOL sub_0205F294(struct SaveVarsFlags *state) { return _flag_check(state, 0x97A); } -void sub_0205F2A4(struct SaveVarsFlags * state) -{ +void sub_0205F2A4(struct SaveVarsFlags *state) { _flag_set(state, 0x97B); } -void sub_0205F2B4(struct SaveVarsFlags * state) -{ +void sub_0205F2B4(struct SaveVarsFlags *state) { _flag_clear(state, 0x97B); } -BOOL sub_0205F2C4(struct SaveVarsFlags * state) -{ +BOOL sub_0205F2C4(struct SaveVarsFlags *state) { return _flag_check(state, 0x97B); } -BOOL sub_0205F2D4(struct SaveVarsFlags * state, u32 op) -{ +BOOL sub_0205F2D4(struct SaveVarsFlags *state, u32 op) { return _flag_op(state, op, 0x963); } -BOOL sub_0205F2E4(struct SaveVarsFlags * state, u32 op, u16 flag_id) -{ +BOOL sub_0205F2E4(struct SaveVarsFlags *state, u32 op, u16 flag_id) { GF_ASSERT(flag_id < 69); return _flag_op(state, op, 0x9B0 + flag_id); } -void sub_0205F304(struct SaveVarsFlags * state) -{ +void sub_0205F304(struct SaveVarsFlags *state) { _flag_set(state, 0x98C); } diff --git a/arm9/src/unk_0205FA2C.c b/arm9/src/unk_0205FA2C.c index cd4dc1312..f487efcea 100644 --- a/arm9/src/unk_0205FA2C.c +++ b/arm9/src/unk_0205FA2C.c @@ -1,9 +1,11 @@ -#include "global.h" #include "unk_0205FA2C.h" + +#include "global.h" + #include "battle_setup.h" -#include "unk_020337E8.h" -#include "unk_0202A1E0.h" #include "overlay_manager.h" +#include "unk_0202A1E0.h" +#include "unk_020337E8.h" extern OverlayManagerTemplate UNK_020F96DC; extern OverlayManagerTemplate UNK_020FA6E8; @@ -31,8 +33,7 @@ const u8 UNK_020F7454[] = { }; u32 sub_0205FA2C( - struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem, HeapID heapId) -{ + struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem, HeapID heapId) { struct UnkPlayerStruct1_0205FA2C *ptr = (struct UnkPlayerStruct1_0205FA2C *)AllocFromHeapAtEnd( heapId, sizeof(struct UnkPlayerStruct1_0205FA2C)); @@ -45,15 +46,14 @@ u32 sub_0205FA2C( ptr->bag = Save_Bag_Get(save); - ptr->unk21 = 0; - ptr->unk20 = param0->unk08; - ptr->unk32 = param0->unk0a; + ptr->unk21 = 0; + ptr->unk20 = param0->unk08; + ptr->unk32 = param0->unk0a; ptr->unk322 = param0->unk0b; - ptr->unk33 = param0->unk0c; - ptr->unk22 = param0->unk0d; + ptr->unk33 = param0->unk0c; + ptr->unk22 = param0->unk0d; - for (u8 i = 0; i < 6; i++) - { + for (u8 i = 0; i < 6; i++) { ptr->unk2c[i] = param0->unk0e[i]; } @@ -65,26 +65,20 @@ u32 sub_0205FA2C( } u32 sub_0205FAD8( - struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem) -{ - if (FieldSystem_ApplicationIsRunning(fieldSystem)) - { + struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem) { + if (FieldSystem_ApplicationIsRunning(fieldSystem)) { return 1; } struct UnkPlayerStruct1_0205FA2C *ptr = (struct UnkPlayerStruct1_0205FA2C *)*param0->unk14; u8 r1 = ptr->unk22; - if (r1 != 6) - { - if (r1 == 7) - { + if (r1 != 6) { + if (r1 == 7) { param0->unk00 = 0; return 4; } - } - else - { + } else { param0->unk00 = 1; return 4; } @@ -100,18 +94,17 @@ u32 sub_0205FAD8( } u32 sub_0205FB34( - struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem, HeapID heapId) -{ + struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem, HeapID heapId) { struct SaveData *save = fieldSystem->saveData; struct UnkPlayerStruct2_0205FA2C *ptr = (struct UnkPlayerStruct2_0205FA2C *)AllocFromHeapAtEnd( heapId, sizeof(struct UnkPlayerStruct2_0205FA2C)); MI_CpuFill8(ptr, 0, sizeof(struct UnkPlayerStruct2_0205FA2C)); - ptr->options = Save_PlayerData_GetOptionsAddr(save); + ptr->options = Save_PlayerData_GetOptionsAddr(save); ptr->player_party = SaveArray_Party_Get(save); - ptr->IsNatDex = SaveArray_IsNatDexEnabled(save); - ptr->unk2c = sub_02079C70(save); + ptr->IsNatDex = SaveArray_IsNatDexEnabled(save); + ptr->unk2c = sub_02079C70(save); ptr->unk11 = 1; ptr->unk14 = param0->unk0d; @@ -135,15 +128,13 @@ u32 sub_0205FB34( } u32 sub_0205FBC0( - struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem) -{ - if (FieldSystem_ApplicationIsRunning(fieldSystem)) - { + struct UnkCallbackStruct1_0205FA2C *param0, struct FieldSystem *fieldSystem) { + if (FieldSystem_ApplicationIsRunning(fieldSystem)) { return 3; } struct UnkPlayerStruct2_0205FA2C *ptr = (struct UnkPlayerStruct2_0205FA2C *)*param0->unk14; - param0->unk0d = ptr->unk14; + param0->unk0d = ptr->unk14; FreeToHeap(ptr); *param0->unk14 = NULL; @@ -151,13 +142,10 @@ u32 sub_0205FBC0( return 0; } -BOOL sub_0205FBE8(struct TaskManager *taskManager) -{ - struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - struct UnkCallbackStruct1_0205FA2C *res2 = - (struct UnkCallbackStruct1_0205FA2C *)TaskManager_GetEnvironment(taskManager); - switch (res2->unk04) - { +BOOL sub_0205FBE8(struct TaskManager *taskManager) { + struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); + struct UnkCallbackStruct1_0205FA2C *res2 = (struct UnkCallbackStruct1_0205FA2C *)TaskManager_GetEnvironment(taskManager); + switch (res2->unk04) { case 0: res2->unk04 = sub_0205FA2C(res2, fieldSystem, HEAP_ID_FIELD); break; @@ -185,8 +173,7 @@ void sub_0205FC50(struct TaskManager *taskManager, u8 param4, u8 param5, u8 param6, - u8 param7) -{ + u8 param7) { struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); struct UnkCallbackStruct1_0205FA2C *ptr = (struct UnkCallbackStruct1_0205FA2C *)AllocFromHeap( @@ -205,10 +192,8 @@ void sub_0205FC50(struct TaskManager *taskManager, } u32 sub_0205FC9C( - struct UnkCallbackStruct2_0205FA2C *param0, struct FieldSystem *fieldSystem) -{ - if (sub_0203384C(fieldSystem->saveData)) - { + struct UnkCallbackStruct2_0205FA2C *param0, struct FieldSystem *fieldSystem) { + if (sub_0203384C(fieldSystem->saveData)) { param0->unk08 = sub_02038790(fieldSystem, param0->unk12, param0->unk14); return 1; @@ -219,10 +204,8 @@ u32 sub_0205FC9C( } u32 sub_0205FCC4( - struct UnkCallbackStruct2_0205FA2C *param0, struct FieldSystem *fieldSystem) -{ - if (FieldSystem_ApplicationIsRunning(fieldSystem)) - { + struct UnkCallbackStruct2_0205FA2C *param0, struct FieldSystem *fieldSystem) { + if (FieldSystem_ApplicationIsRunning(fieldSystem)) { return 1; } @@ -232,14 +215,11 @@ u32 sub_0205FCC4( return 2; } -BOOL sub_0205FCE8(struct TaskManager *taskManager) -{ - struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - struct UnkCallbackStruct2_0205FA2C *res2 = - (struct UnkCallbackStruct2_0205FA2C *)TaskManager_GetEnvironment(taskManager); +BOOL sub_0205FCE8(struct TaskManager *taskManager) { + struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); + struct UnkCallbackStruct2_0205FA2C *res2 = (struct UnkCallbackStruct2_0205FA2C *)TaskManager_GetEnvironment(taskManager); - switch (res2->unk04) - { + switch (res2->unk04) { case 0: res2->unk04 = sub_0205FC9C(res2, fieldSystem); break; @@ -248,7 +228,7 @@ BOOL sub_0205FCE8(struct TaskManager *taskManager) break; case 2: u16 *var = GetVarPointer(fieldSystem, res2->unk10); - *var = (u16)res2->unk00; + *var = (u16)res2->unk00; FreeToHeap(res2); return TRUE; @@ -257,9 +237,8 @@ BOOL sub_0205FCE8(struct TaskManager *taskManager) return FALSE; } -void sub_0205FD38(struct TaskManager *taskManager, u16 param1, u16 param2, u16 param3) -{ - struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); +void sub_0205FD38(struct TaskManager *taskManager, u16 param1, u16 param2, u16 param3) { + struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); struct UnkCallbackStruct2_0205FA2C *ptr = (struct UnkCallbackStruct2_0205FA2C *)AllocFromHeap( HEAP_ID_FIELD, sizeof(struct UnkCallbackStruct2_0205FA2C)); MI_CpuFill8(ptr, 0, sizeof(struct UnkCallbackStruct2_0205FA2C)); @@ -271,19 +250,16 @@ void sub_0205FD38(struct TaskManager *taskManager, u16 param1, u16 param2, u16 p TaskManager_Call(fieldSystem->taskManager, &sub_0205FCE8, (u32 *)ptr); } -BOOL sub_0205FD70(struct TaskManager *taskManager) -{ +BOOL sub_0205FD70(struct TaskManager *taskManager) { struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); - u16 *res2 = (u16 *)TaskManager_GetEnvironment(taskManager); - u8 *res3 = sub_020316E0(1 - sub_02031190()); - if (res3 == NULL) - { + u16 *res2 = (u16 *)TaskManager_GetEnvironment(taskManager); + u8 *res3 = sub_020316E0(1 - sub_02031190()); + if (res3 == NULL) { return FALSE; } u16 *var = GetVarPointer(fieldSystem, res2[1]); - switch (res2[0]) - { + switch (res2[0]) { case 0: *var = ov06_02244660(fieldSystem, res3); break; @@ -300,8 +276,7 @@ BOOL sub_0205FD70(struct TaskManager *taskManager) return TRUE; } -void sub_0205FDDC(struct TaskManager *taskManager, u16 param1, u16 param2) -{ +void sub_0205FDDC(struct TaskManager *taskManager, u16 param1, u16 param2) { struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); u16 *ptr = AllocFromHeap(HEAP_ID_FIELD, 2 * sizeof(u16)); @@ -313,12 +288,10 @@ void sub_0205FDDC(struct TaskManager *taskManager, u16 param1, u16 param2) TaskManager_Call(fieldSystem->taskManager, &sub_0205FD70, (u32 *)ptr); } -u32 sub_0205FE10(struct SaveData *save) -{ +u32 sub_0205FE10(struct SaveData *save) { - u16 res = (u16) GameStats_GetCapped(Save_GameStats_Get(save), 0x35); - if (res < 20) - { + u16 res = (u16)GameStats_GetCapped(Save_GameStats_Get(save), 0x35); + if (res < 20) { return 0; } @@ -332,73 +305,60 @@ u32 sub_0205FE10(struct SaveData *save) BOOL flag2 = (u8)FrontierData_SetFlag(frontierData, 2, DATA_GET); BOOL flag3 = (u8)FrontierData_SetFlag(frontierData, 3, DATA_GET); - if (flagD && flag0 && flag1) - { + if (flagD && flag0 && flag1) { return 0; } u32 res9 = sub_02026CC4(save); - if (!flagD) - { - if (sub_02025D94(res9, 0x55) != 0) - { + if (!flagD) { + if (sub_02025D94(res9, 0x55) != 0) { FrontierData_SetFlag(frontierData, 0xd, DATA_SET); return 1; } - if (!flagE) - { + if (!flagE) { FrontierData_SetFlag(frontierData, 0xe, DATA_SET); } return 4; } - if (res < 50) - { + if (res < 50) { return 0; } - if (!flag0) - { - if (sub_02025D94(res9, 0x56) != 0) - { + if (!flag0) { + if (sub_02025D94(res9, 0x56) != 0) { FrontierData_SetFlag(frontierData, 0, DATA_SET); return 2; } - if (!flag2) - { + if (!flag2) { FrontierData_SetFlag(frontierData, 2, DATA_SET); } return 4; } - if (res < 100 || flag1) - { + if (res < 100 || flag1) { return 0; } - if (sub_02025D94(res9, 0x57) != 0) - { + if (sub_02025D94(res9, 0x57) != 0) { FrontierData_SetFlag(frontierData, 1, DATA_SET); return 3; } - if (!flag3) - { + if (!flag3) { FrontierData_SetFlag(frontierData, 3, DATA_SET); } return 4; } -u32 sub_0205FF5C(struct SaveData *save) -{ - u16 res = (u16) GameStats_GetCapped(Save_GameStats_Get(save), 0x35); - if (res < 20) - { +u32 sub_0205FF5C(struct SaveData *save) { + u16 res = (u16)GameStats_GetCapped(Save_GameStats_Get(save), 0x35); + if (res < 20) { return 0; } @@ -412,48 +372,39 @@ u32 sub_0205FF5C(struct SaveData *save) BOOL flag2 = (u8)FrontierData_SetFlag(frontierData, 2, DATA_GET); BOOL flag3 = (u8)FrontierData_SetFlag(frontierData, 3, DATA_GET); - if (flagD && flag0 && flag1) - { + if (flagD && flag0 && flag1) { return 0; } - if (!flagD) - { - if (flagE) - { + if (!flagD) { + if (flagE) { return 4; } return 1; } - if (res < 50) - { + if (res < 50) { return 0; } - if (!flag0) - { - if (flag2) - { + if (!flag0) { + if (flag2) { return 5; } return 2; } - if (res < 100) - { + if (res < 100) { return 0; } - if (flag1) - { + if (flag1) { return 0; } - if (flag3) - { + if (flag3) { return 6; } @@ -467,18 +418,15 @@ void sub_02060044(FieldSystem *fieldSystem, BattleSetupUnkSub138 *battleSetupSub unkA8->unk26 += battleSetupSub->unk8; } -u32 sub_02060064(u32 param0) -{ +u32 sub_02060064(u32 param0) { return param0 * 0x02E90EDD + 1; } -u32 sub_02060070(u32 param0) -{ +u32 sub_02060070(u32 param0) { return param0 * 0x5D588B65 + 1; } -u32 sub_0206007C(struct SaveData *save) -{ +u32 sub_0206007C(struct SaveData *save) { u32 res = sub_02060070(sub_020287A4(sub_0202881C(save))); FrontierData_SetField_0x4(Save_FrontierData_Get(save), res); @@ -486,8 +434,7 @@ u32 sub_0206007C(struct SaveData *save) return res; } -u32 sub_020600A0(struct SaveData *save) -{ +u32 sub_020600A0(struct SaveData *save) { struct FrontierData *frontierData = Save_FrontierData_Get(save); u32 res2 = sub_02060070(FrontierData_GetField_0x4(frontierData)); @@ -500,19 +447,17 @@ u32 sub_020600A0(struct SaveData *save) return res3; } -u32 sub_020600DC(struct SaveData *save) -{ +u32 sub_020600DC(struct SaveData *save) { struct FrontierData *frontierData = Save_FrontierData_Get(save); struct SaveStruct23_Substruct1 *saveStruct23_substruct1 = SaveStruct23_GetSubstruct1(save); u32 res3 = sub_02060064(FrontierData_GetField_0x4(frontierData)); - int i = 0; + int i = 0; int res4 = FrontierData_SetField_0xC(frontierData, (u16)SaveStruct23_Substruct1_GetField(saveStruct23_substruct1, FIELD_0x0_2, 0), DATA_GET) * 0x18; - for (i = 0; i < res4; i++) - { + for (i = 0; i < res4; i++) { res3 = sub_02060064(res3); } @@ -521,10 +466,8 @@ u32 sub_020600DC(struct SaveData *save) return res3; } -BOOL sub_02060144(u32 **param0) -{ - if (param0[7][0] == SPECIES_ARCEUS) - { +BOOL sub_02060144(u32 **param0) { + if (param0[7][0] == SPECIES_ARCEUS) { return TRUE; } diff --git a/arm9/src/unk_0206015C.c b/arm9/src/unk_0206015C.c index 173f5df37..cde54cc7a 100644 --- a/arm9/src/unk_0206015C.c +++ b/arm9/src/unk_0206015C.c @@ -1,10 +1,12 @@ -#include "global.h" #include "unk_0206015C.h" +#include "global.h" + #include "constants/sndseq.h" -#include "save_vars_flags.h" + #include "heap.h" #include "main.h" +#include "save_vars_flags.h" #include "unk_020051F4.h" #include "unk_0204AF24.h" @@ -12,45 +14,42 @@ in the return type / parameters. They are right for this code but they might not be for every code, please do not blindly trust these prototypes if you are decompiling these functions. */ -extern u32 ov06_02244DB0(HeapID); -extern void ov06_02244DBC(void*); -extern void ov06_02244DC4(void*, void*); -extern void ov06_02244EF8(void*); -extern void ov06_02244F18(void*); -extern BOOL ov06_02244F24(void*); -extern void ov06_02244F2C(void*); -extern void * ov06_02245088(struct FieldSystem *fieldSystem); -extern u32 ov06_02245114(HeapID, struct FieldSystem *); +extern u32 ov06_02244DB0(HeapID); +extern void ov06_02244DBC(void *); +extern void ov06_02244DC4(void *, void *); +extern void ov06_02244EF8(void *); +extern void ov06_02244F18(void *); +extern BOOL ov06_02244F24(void *); +extern void ov06_02244F2C(void *); +extern void *ov06_02245088(struct FieldSystem *fieldSystem); +extern u32 ov06_02245114(HeapID, struct FieldSystem *); extern void ov06_02245190(u32); extern void ov06_02245198(u8, u32); -extern u32 ov06_022451F0(u32); +extern u32 ov06_022451F0(u32); extern void sub_02049160(struct TaskManager *taskManager, u32); -extern void sub_0204C1B4(struct TaskManager *taskManager, u32,u32,u32,u32,u32,u32,u32); +extern void sub_0204C1B4(struct TaskManager *taskManager, u32, u32, u32, u32, u32, u32, u32); extern LocalMapObject *PlayerAvatar_GetMapObject(struct PlayerAvatar *playerAvatar); extern LocalMapObject *MapObject_SetVisible(LocalMapObject *target, BOOL visible); extern void sub_0205F1C4(struct SaveVarsFlags *); extern void sub_0205F1D4(struct SaveVarsFlags *); extern void sub_0206367C(struct FieldSystem *, u32); -void CallTask_UseGreatMarshBinoculars(struct FieldSystem *fieldSystem) -{ +void CallTask_UseGreatMarshBinoculars(struct FieldSystem *fieldSystem) { struct UnkStruct_0206015C *unkStruct = AllocFromHeapAtEnd(HEAP_ID_FIELD, 0x10); - unkStruct->unk0 = ov06_02244DB0(HEAP_ID_FIELD); - unkStruct->unk4 = ov06_02245114(HEAP_ID_FIELD, fieldSystem); - unkStruct->unkC = 0; - unkStruct->unkD = 0; + unkStruct->unk0 = ov06_02244DB0(HEAP_ID_FIELD); + unkStruct->unk4 = ov06_02245114(HEAP_ID_FIELD, fieldSystem); + unkStruct->unkC = 0; + unkStruct->unkD = 0; TaskManager_Call(fieldSystem->taskManager, Task_UseGreatMarshBinoculars, (u32 *)unkStruct); } -BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager) -{ - struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); +BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager) { + struct FieldSystem *fieldSystem = TaskManager_GetFieldSystem(taskManager); struct UnkStruct_0204652C *unkStruct1 = (struct UnkStruct_0204652C *)TaskManager_GetEnvironment(taskManager); - switch (unkStruct1->action) - { + switch (unkStruct1->action) { case 0: sub_0206367C(fieldSystem, 1); ov06_02245198(unkStruct1->unkD, unkStruct1->unk4); @@ -66,13 +65,10 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager) case 2: struct SaveVarsFlags *scrState = Save_VarsFlags_Get(fieldSystem->saveData); - u8 unkD = unkStruct1->unkD; - if (unkD == 0) - { + u8 unkD = unkStruct1->unkD; + if (unkD == 0) { sub_0205F1C4(scrState); - } - else if (unkD == 5) - { + } else if (unkD == 5) { sub_0205F1D4(scrState); } sub_02049160(taskManager, unkStruct1->unk8); @@ -87,8 +83,7 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager) case 4: LocalMapObject *playerObject = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); unkStruct1->unkD += 1; - if (unkStruct1->unkD <= 5) - { + if (unkStruct1->unkD <= 5) { void *unkAddr = ov06_02245088(fieldSystem); MapObject_SetVisible(playerObject, TRUE); ov06_02244DC4(unkStruct1->unk0, unkAddr); @@ -97,9 +92,7 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager) PlaySE(SEQ_SE_DP_KASYA); sub_0204C1B4(taskManager, 0x3, 0x11, 0x0000FFFF, 0, 6, 1, 0xb); unkStruct1->action = 5; - } - else - { + } else { MapObject_SetVisible(playerObject, FALSE); CallTask_FadeFromBlack(taskManager); unkStruct1->action = 8; @@ -108,8 +101,9 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager) case 5: unkStruct1->unkE += 1; - if (unkStruct1->unkE < 0x3c && !(gSystem.newKeys & 1)) + if (unkStruct1->unkE < 0x3c && !(gSystem.newKeys & 1)) { break; + } ov06_02245198(unkStruct1->unkD, unkStruct1->unk4); unkStruct1->unk8 = ov06_022451F0(unkStruct1->unk4); @@ -125,8 +119,7 @@ BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager) break; case 7: - if (ov06_02244F24(unkStruct1->unk0)) - { + if (ov06_02244F24(unkStruct1->unk0)) { ov06_02244F2C(unkStruct1->unk0); unkStruct1->action = 1; } diff --git a/arm9/src/unk_0206439C.c b/arm9/src/unk_0206439C.c index 19a2fc49c..a6cf6d8b7 100644 --- a/arm9/src/unk_0206439C.c +++ b/arm9/src/unk_0206439C.c @@ -1,16 +1,17 @@ +#include "unk_0206439C.h" + #include "global.h" + #include "heap.h" #include "party.h" #include "save.h" -#include "unk_0206439C.h" -struct UnkStruct_0206439C* sub_0206439C(HeapID heapId, u8 mon_idx, struct SaveData* save) -{ - struct UnkStruct_0206439C* ret = AllocFromHeapAtEnd(heapId, sizeof(struct UnkStruct_0206439C)); - struct Party* party = SaveArray_Party_Get(save); +UnkStruct_0206439C *sub_0206439C(HeapID heapId, u8 mon_idx, SaveData *save) { + UnkStruct_0206439C *ret = AllocFromHeapAtEnd(heapId, sizeof(UnkStruct_0206439C)); + Party *party = SaveArray_Party_Get(save); ret->pokemon = Party_GetMonByIndex(party, mon_idx); - ret->unk4 = NULL; + ret->unk4 = NULL; return ret; } diff --git a/arm9/src/unk_02064E20.c b/arm9/src/unk_02064E20.c index c6bb169d1..1b678fa49 100644 --- a/arm9/src/unk_02064E20.c +++ b/arm9/src/unk_02064E20.c @@ -1,17 +1,17 @@ +#include "unk_02064E20.h" + #include "global.h" + #include "scrcmd.h" -#include "unk_02025484.h" #include "unk_02024E64.h" -#include "unk_02064E20.h" +#include "unk_02025484.h" -void KeepSafariTrain(struct FieldSystem* fieldSystem) -{ - struct unk_2025484 * r4 = (struct unk_2025484 *)sub_02024ED8(FieldSystem_GetSaveData(fieldSystem)); - if((u32)sub_020254B4(r4) == 6) - { +void KeepSafariTrain(struct FieldSystem *fieldSystem) { + struct unk_2025484 *r4 = (struct unk_2025484 *)sub_02024ED8(FieldSystem_GetSaveData(fieldSystem)); + if ((u32)sub_020254B4(r4) == 6) { return; } sub_02025490(r4, 6); - u16 * ptr0 = (u16 *)sub_020254A0(r4 , 6); - ptr0[0] = 2; + u16 *ptr0 = (u16 *)sub_020254A0(r4, 6); + ptr0[0] = 2; } diff --git a/arm9/src/unk_02064E4C.c b/arm9/src/unk_02064E4C.c index 04827a7fa..c48ef8271 100644 --- a/arm9/src/unk_02064E4C.c +++ b/arm9/src/unk_02064E4C.c @@ -1,20 +1,21 @@ +#include "unk_02064E4C.h" + #include "global.h" -#include "map_header.h" -#include "msgdata.h" + #include "msgdata/msg.naix" -#include "unk_02064E4C.h" + #include "font.h" +#include "map_header.h" +#include "msgdata.h" -void sub_02064E4C(struct MsgData * msgData, u16 map_sec, struct String * dest) -{ +void sub_02064E4C(struct MsgData *msgData, u16 map_sec, struct String *dest) { ReadMsgDataIntoString(msgData, map_sec, dest); sub_02002E14(0, dest, 0); } -void sub_02064E60(u32 map_no, HeapID heapId, struct String * dest) -{ - struct MsgData * msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0382_bin, heapId); - u16 map_sec = MapHeader_GetMapSec(map_no); +void sub_02064E60(u32 map_no, HeapID heapId, struct String *dest) { + struct MsgData *msgData = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0382_bin, heapId); + u16 map_sec = MapHeader_GetMapSec(map_no); sub_02064E4C(msgData, map_sec, dest); diff --git a/arm9/src/unk_0206B688.c b/arm9/src/unk_0206B688.c index f6298d08d..d7034ad08 100644 --- a/arm9/src/unk_0206B688.c +++ b/arm9/src/unk_0206B688.c @@ -1,58 +1,60 @@ +#include "unk_0206B688.h" + #include "global.h" + #include "pokemon.h" -#include "unk_0206B688.h" -u16 BoxMon_GetAlternateForm(struct BoxPokemon * boxmon); +u16 BoxMon_GetAlternateForm(struct BoxPokemon *boxmon); u32 sub_0206B6D4(u32 species, u32 is_egg, u32 form); -u32 sub_0206B688(struct BoxPokemon * boxmon) -{ - BOOL decry = AcquireBoxMonLock(boxmon); +u32 sub_0206B688(struct BoxPokemon *boxmon) { + BOOL decry = AcquireBoxMonLock(boxmon); u32 species = GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); - u32 is_egg = GetBoxMonData(boxmon, MON_DATA_IS_EGG, NULL); - u32 form = BoxMon_GetAlternateForm(boxmon); - u32 ret = sub_0206B6D4(species, is_egg, form); + u32 is_egg = GetBoxMonData(boxmon, MON_DATA_IS_EGG, NULL); + u32 form = BoxMon_GetAlternateForm(boxmon); + u32 ret = sub_0206B6D4(species, is_egg, form); ReleaseBoxMonLock(boxmon, decry); return ret; } -u32 sub_0206B6C8(struct Pokemon * pokemon) -{ +u32 sub_0206B6C8(struct Pokemon *pokemon) { return sub_0206B688(sub_020690E4(pokemon)); } -u32 sub_0206B6D4(u32 species, u32 is_egg, u32 form) -{ - if (is_egg == TRUE) - { - if (species == SPECIES_MANAPHY) +u32 sub_0206B6D4(u32 species, u32 is_egg, u32 form) { + if (is_egg == TRUE) { + if (species == SPECIES_MANAPHY) { return 502; - else + } else { return 501; + } } - if (form != 0) - { - if (species == SPECIES_DEOXYS) + if (form != 0) { + if (species == SPECIES_DEOXYS) { return 502 + form; - if (species == SPECIES_UNOWN) + } + if (species == SPECIES_UNOWN) { return 506 + form; - if (species == SPECIES_BURMY) + } + if (species == SPECIES_BURMY) { return 533 + form; - if (species == SPECIES_WORMADAM) + } + if (species == SPECIES_WORMADAM) { return 535 + form; - if (species == SPECIES_SHELLOS) + } + if (species == SPECIES_SHELLOS) { return 537 + form; - if (species == SPECIES_GASTRODON) + } + if (species == SPECIES_GASTRODON) { return 538 + form; + } } return (species <= SPECIES_ARCEUS ? species : 0) + 7; } -u16 BoxMon_GetAlternateForm(struct BoxPokemon * boxmon) -{ +u16 BoxMon_GetAlternateForm(struct BoxPokemon *boxmon) { u32 species = GetBoxMonData(boxmon, MON_DATA_SPECIES2, NULL); - switch (species) - { + switch (species) { case SPECIES_UNOWN: return GetBoxMonUnownLetter(boxmon); case SPECIES_DEOXYS: @@ -60,124 +62,80 @@ u16 BoxMon_GetAlternateForm(struct BoxPokemon * boxmon) case SPECIES_WORMADAM: case SPECIES_SHELLOS: case SPECIES_GASTRODON: - return (u16) GetBoxMonData(boxmon, MON_DATA_FORM, NULL); + return (u16)GetBoxMonData(boxmon, MON_DATA_FORM, NULL); default: return 0; } } const u8 UNK_020F8074[] = { - 0, 1, 1, 1, 0, 0, 0, 0, 2, 2, 1, 1, 0, 1, 2, 2, - 0, 0, 0, 2, 1, 0, 0, 2, 2, 2, 0, 2, 2, 2, 2, 2, - 2, 2, 2, 0, 0, 2, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, - 0, 2, 2, 2, 1, 1, 1, 2, 1, 2, 0, 0, 0, 0, 0, 2, - 2, 2, 0, 2, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 2, 2, 0, 0, 0, 1, 1, 1, 2, 2, 1, 2, 2, 1, - 1, 0, 0, 1, 0, 0, 0, 0, 2, 2, 0, 1, 2, 1, 0, 2, - 2, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 1, - 0, 0, 0, 0, 0, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, - 2, 2, 2, 2, 2, 0, 0, 1, 0, 2, 2, 0, 0, 0, 1, 2, - 2, 0, 0, 2, 0, 0, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, - 1, 1, 0, 0, 2, 2, 2, 0, 0, 0, 0, 1, 0, 2, 2, 2, - 0, 0, 2, 0, 0, 1, 2, 0, 0, 2, 0, 0, 2, 2, 0, 0, - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 2, 1, 1, - 1, 1, 1, 0, 2, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 0, 2, 1, 1, 1, - 1, 1, 1, 0, 2, 2, 0, 0, 1, 1, 1, 2, 0, 1, 1, 2, - 2, 1, 1, 1, 1, 0, 2, 2, 2, 1, 2, 0, 0, 2, 2, 2, - 2, 2, 2, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 2, 0, 0, - 2, 0, 1, 0, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, - 2, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 2, 2, 0, 0, 0, - 0, 1, 0, 2, 2, 0, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, - 1, 0, 0, 1, 1, 1, 1, 0, 0, 2, 2, 0, 0, 0, 0, 2, - 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 2, 2, 2, 0, 1, 0, - 2, 0, 2, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, - 2, 1, 1, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, - 0, 2, 1, 0, 2, 1, 1, 0, 2, 2, 0, 1, 0, 2, 2, 0, - 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 1, 0, 0, 0, 0, 0, 0 + 0, 1, 1, 1, 0, 0, 0, 0, 2, 2, 1, 1, 0, 1, 2, 2, 0, 0, 0, 2, 1, 0, 0, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 1, 2, 0, 0, 0, 0, 0, 2, 2, 2, 0, 2, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 0, 0, 0, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 0, 0, 1, 0, 0, 0, 0, 2, 2, 0, 1, 2, 1, 0, 2, 2, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 1, 0, 0, 0, 0, 0, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 0, 2, 2, 0, 0, 0, 1, 2, 2, 0, 0, 2, 0, 0, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 2, 2, 2, 0, 0, 0, 0, 1, 0, 2, 2, 2, 0, 0, 2, 0, 0, 1, 2, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 2, 1, 1, 1, 1, 1, 0, 2, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, 0, 2, 2, 0, 0, 1, 1, 1, 2, 0, 1, 1, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 1, 2, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 2, 0, 0, 2, 0, 1, 0, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 2, 2, 0, 0, 0, 0, 1, 0, 2, 2, 0, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 2, 2, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 2, 2, 2, 0, 1, 0, 2, 0, 2, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 1, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 2, 1, 0, 2, 1, 1, 0, 2, 2, 0, 1, 0, 2, 2, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0 }; -u32 sub_0206B7BC(u32 species, u32 form, u32 is_egg) -{ - if (is_egg == TRUE) - { - if (species == SPECIES_MANAPHY) +u32 sub_0206B7BC(u32 species, u32 form, u32 is_egg) { + if (is_egg == TRUE) { + if (species == SPECIES_MANAPHY) { species = 495; - else + } else { species = 494; - } - else if (species > SPECIES_ARCEUS) + } + } else if (species > SPECIES_ARCEUS) { species = 0; - else if (form != 0) - { - if (species == SPECIES_DEOXYS) + } else if (form != 0) { + if (species == SPECIES_DEOXYS) { species = 495 + form; - else if (species == SPECIES_UNOWN) + } else if (species == SPECIES_UNOWN) { species = 498 + form; - else if (species == SPECIES_BURMY) + } else if (species == SPECIES_BURMY) { species = 526 + form; - else if (species == SPECIES_WORMADAM) + } else if (species == SPECIES_WORMADAM) { species = 528 + form; - else if (species == SPECIES_SHELLOS) + } else if (species == SPECIES_SHELLOS) { species = 530 + form; - else if (species == SPECIES_GASTRODON) + } else if (species == SPECIES_GASTRODON) { species = 531 + form; + } } return UNK_020F8074[species]; } -u32 sub_0206B83C(struct BoxPokemon * boxmon) -{ - BOOL decry = AcquireBoxMonLock(boxmon); - u32 form = BoxMon_GetAlternateForm(boxmon); +u32 sub_0206B83C(struct BoxPokemon *boxmon) { + BOOL decry = AcquireBoxMonLock(boxmon); + u32 form = BoxMon_GetAlternateForm(boxmon); u32 species = GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL); - u32 is_egg = GetBoxMonData(boxmon, MON_DATA_IS_EGG, NULL); + u32 is_egg = GetBoxMonData(boxmon, MON_DATA_IS_EGG, NULL); ReleaseBoxMonLock(boxmon, decry); return sub_0206B7BC(species, form, is_egg); } -u32 sub_0206B87C(struct Pokemon * pokemon) -{ +u32 sub_0206B87C(struct Pokemon *pokemon) { return sub_0206B83C(sub_020690E4(pokemon)); } -u32 sub_0206B888(void) -{ +u32 sub_0206B888(void) { return 0; } -u32 sub_0206B88C(void) -{ +u32 sub_0206B88C(void) { return 2; } -u32 sub_0206B890(void) -{ +u32 sub_0206B890(void) { return 4; } -u32 sub_0206B894(void) -{ +u32 sub_0206B894(void) { return 6; } -u32 sub_0206B898(void) -{ +u32 sub_0206B898(void) { return 1; } -u32 sub_0206B89C(void) -{ +u32 sub_0206B89C(void) { return 3; } -u32 sub_0206B8A0(void) -{ +u32 sub_0206B8A0(void) { return 5; } diff --git a/arm9/src/unk_0206BB28.c b/arm9/src/unk_0206BB28.c index f64b3b624..f3a5cbaa6 100644 --- a/arm9/src/unk_0206BB28.c +++ b/arm9/src/unk_0206BB28.c @@ -1,23 +1,22 @@ +#include "unk_0206BB28.h" + #include "global.h" -#include "save.h" + #include "pokedex.h" #include "pokemon.h" -#include "unk_0206BB28.h" +#include "save.h" -BOOL SaveArray_IsNatDexEnabled(struct SaveData * save) -{ +BOOL SaveArray_IsNatDexEnabled(struct SaveData *save) { return Pokedex_IsNatDexEnabled(Save_Pokedex_Get(save)); } -BOOL Pokedex_IsNatDexEnabled(struct Pokedex * pokedex) -{ +BOOL Pokedex_IsNatDexEnabled(struct Pokedex *pokedex) { return Pokedex_GetNatDexFlag(pokedex) == TRUE; } -u32 Pokedex_ConvertToCurrentDexNo(BOOL isNationalDex, u32 species) -{ - if (!isNationalDex) +u32 Pokedex_ConvertToCurrentDexNo(BOOL isNationalDex, u32 species) { + if (!isNationalDex) { species = SpeciesToSinnohDexNo((u16)species); + } return species; } - diff --git a/arm9/src/unk_0207FC5C.c b/arm9/src/unk_0207FC5C.c index 574acda8c..94208355e 100644 --- a/arm9/src/unk_0207FC5C.c +++ b/arm9/src/unk_0207FC5C.c @@ -1,9 +1,10 @@ -#include "global.h" #include "unk_0207FC5C.h" + +#include "global.h" + #include "constants/pokemon.h" -struct UnkStruct_020FB788 -{ +struct UnkStruct_020FB788 { u32 monDataId; u16 gfxId; u16 palId; @@ -12,493 +13,90 @@ struct UnkStruct_020FB788 }; const struct UnkStruct_020FB788 UNK_020FB788[] = { - { - MON_DATA_HOENN_CHAMPION_RIBBON, - 72, - 0, - RIBBON_HOENN_CHAMPION, - 80 - }, { - MON_DATA_HOENN_COOL_RIBBON, - 73, - 0, - RIBBON_HOENN_COOL, - 81 - }, { - MON_DATA_HOENN_COOL_RIBBON_SUPER, - 74, - 0, - RIBBON_HOENN_COOL_SUPER, - 82 - }, { - MON_DATA_HOENN_COOL_RIBBON_HYPER, - 75, - 0, - RIBBON_HOENN_COOL_HYPER, - 83 - }, { - MON_DATA_HOENN_COOL_RIBBON_MASTER, - 76, - 0, - RIBBON_HOENN_COOL_MASTER, - 84 - }, { - MON_DATA_HOENN_BEAUTY_RIBBON, - 73, - 1, - RIBBON_HOENN_BEAUTY, - 85 - }, { - MON_DATA_HOENN_BEAUTY_RIBBON_SUPER, - 74, - 1, - RIBBON_HOENN_BEAUTY_SUPER, - 86 - }, { - MON_DATA_HOENN_BEAUTY_RIBBON_HYPER, - 75, - 1, - RIBBON_HOENN_BEAUTY_HYPER, - 87 - }, { - MON_DATA_HOENN_BEAUTY_RIBBON_MASTER, - 76, - 1, - RIBBON_HOENN_BEAUTY_MASTER, - 88 - }, { - MON_DATA_HOENN_CUTE_RIBBON, - 73, - 2, - RIBBON_HOENN_CUTE, - 89 - }, { - MON_DATA_HOENN_CUTE_RIBBON_SUPER, - 74, - 2, - RIBBON_HOENN_CUTE_SUPER, - 90 - }, { - MON_DATA_HOENN_CUTE_RIBBON_HYPER, - 75, - 2, - RIBBON_HOENN_CUTE_HYPER, - 91 - }, { - MON_DATA_HOENN_CUTE_RIBBON_MASTER, - 76, - 2, - RIBBON_HOENN_CUTE_MASTER, - 92 - }, { - MON_DATA_HOENN_SMART_RIBBON, - 73, - 3, - RIBBON_HOENN_SMART, - 93 - }, { - MON_DATA_HOENN_SMART_RIBBON_SUPER, - 74, - 3, - RIBBON_HOENN_SMART_SUPER, - 94 - }, { - MON_DATA_HOENN_SMART_RIBBON_HYPER, - 75, - 3, - RIBBON_HOENN_SMART_HYPER, - 95 - }, { - MON_DATA_HOENN_SMART_RIBBON_MASTER, - 76, - 3, - RIBBON_HOENN_SMART_MASTER, - 96 - }, { - MON_DATA_HOENN_TOUGH_RIBBON, - 73, - 4, - RIBBON_HOENN_TOUGH, - 97 - }, { - MON_DATA_HOENN_TOUGH_RIBBON_SUPER, - 74, - 4, - RIBBON_HOENN_TOUGH_SUPER, - 98 - }, { - MON_DATA_HOENN_TOUGH_RIBBON_HYPER, - 75, - 4, - RIBBON_HOENN_TOUGH_HYPER, - 99 - }, { - MON_DATA_HOENN_TOUGH_RIBBON_MASTER, - 76, - 4, - RIBBON_HOENN_TOUGH_MASTER, - 100 - }, { - MON_DATA_HOENN_WINNING_RIBBON, - 78, - 0, - RIBBON_HOENN_WINNING, - 101 - }, { - MON_DATA_HOENN_VICTORY_RIBBON, - 77, - 0, - RIBBON_HOENN_VICTORY, - 102 - }, { - MON_DATA_HOENN_ARTIST_RIBBON, - 79, - 1, - RIBBON_HOENN_ARTIST, - 103 - }, { - MON_DATA_HOENN_EFFORT_RIBBON, - 80, - 2, - RIBBON_HOENN_EFFORT, - 104 - }, { - MON_DATA_HOENN_MARINE_RIBBON, - 81, - 1, - RIBBON_HOENN_MARINE, - 0 | 0x8000 - }, { - MON_DATA_HOENN_LAND_RIBBON, - 81, - 3, - RIBBON_HOENN_LAND, - 1 | 0x8000 - }, { - MON_DATA_HOENN_SKY_RIBBON, - 81, - 4, - RIBBON_HOENN_SKY, - 2 | 0x8000 - }, { - MON_DATA_HOENN_COUNTRY_RIBBON, - 82, - 3, - RIBBON_HOENN_COUNTRY, - 178 - }, { - MON_DATA_HOENN_NATIONAL_RIBBON, - 82, - 4, - RIBBON_HOENN_NATIONAL, - 190 - }, { - MON_DATA_HOENN_EARTH_RIBBON, - 83, - 0, - RIBBON_HOENN_EARTH, - 191 - }, { - MON_DATA_HOENN_WORLD_RIBBON, - 83, - 1, - RIBBON_HOENN_WORLD, - 178 - }, { - MON_DATA_SINNOH_CHAMP_RIBBON, - 88, - 0, - RIBBON_SINNOH_CHAMP, - 105 - }, { - MON_DATA_COOL_RIBBON, - 89, - 0, - RIBBON_COOL, - 106 - }, { - MON_DATA_COOL_RIBBON_GREAT, - 90, - 0, - RIBBON_COOL_GREAT, - 107 - }, { - MON_DATA_COOL_RIBBON_ULTRA, - 91, - 0, - RIBBON_COOL_ULTRA, - 108 - }, { - MON_DATA_COOL_RIBBON_MASTER, - 92, - 0, - RIBBON_COOL_MASTER, - 109 - }, { - MON_DATA_BEAUTY_RIBBON, - 89, - 1, - RIBBON_BEAUTY, - 110 - }, { - MON_DATA_BEAUTY_RIBBON_GREAT, - 90, - 1, - RIBBON_BEAUTY_GREAT, - 111 - }, { - MON_DATA_BEAUTY_RIBBON_ULTRA, - 91, - 1, - RIBBON_BEAUTY_ULTRA, - 112 - }, { - MON_DATA_BEAUTY_RIBBON_MASTER, - 92, - 1, - RIBBON_BEAUTY_MASTER, - 113 - }, { - MON_DATA_CUTE_RIBBON, - 89, - 2, - RIBBON_CUTE, - 114 - }, { - MON_DATA_CUTE_RIBBON_GREAT, - 90, - 2, - RIBBON_CUTE_GREAT, - 115 - }, { - MON_DATA_CUTE_RIBBON_ULTRA, - 91, - 2, - RIBBON_CUTE_ULTRA, - 116 - }, { - MON_DATA_CUTE_RIBBON_MASTER, - 92, - 2, - RIBBON_CUTE_MASTER, - 117 - }, { - MON_DATA_SMART_RIBBON, - 89, - 3, - RIBBON_SMART, - 118 - }, { - MON_DATA_SMART_RIBBON_GREAT, - 90, - 3, - RIBBON_SMART_GREAT, - 119 - }, { - MON_DATA_SMART_RIBBON_ULTRA, - 91, - 3, - RIBBON_SMART_ULTRA, - 120 - }, { - MON_DATA_SMART_RIBBON_MASTER, - 92, - 3, - RIBBON_SMART_MASTER, - 121 - }, { - MON_DATA_TOUGH_RIBBON, - 89, - 4, - RIBBON_TOUGH, - 122 - }, { - MON_DATA_TOUGH_RIBBON_GREAT, - 90, - 4, - RIBBON_TOUGH_GREAT, - 123 - }, { - MON_DATA_TOUGH_RIBBON_ULTRA, - 91, - 4, - RIBBON_TOUGH_ULTRA, - 124 - }, { - MON_DATA_TOUGH_RIBBON_MASTER, - 92, - 4, - RIBBON_TOUGH_MASTER, - 125 - }, { - MON_DATA_ABILITY_RIBBON, - 93, - 0, - RIBBON_ABILITY, - 126 - }, { - MON_DATA_GREAT_ABILITY_RIBBON, - 94, - 0, - RIBBON_GREAT_ABILITY, - 127 - }, { - MON_DATA_DOUBLE_ABILITY_RIBBON, - 95, - 0, - RIBBON_DOUBLE_ABILITY, - 128 - }, { - MON_DATA_MULTI_ABILITY_RIBBON, - 96, - 0, - RIBBON_MULTI_ABILITY, - 129 - }, { - MON_DATA_PAIR_ABILITY_RIBBON, - 97, - 0, - RIBBON_PAIR_ABILITY, - 130 - }, { - MON_DATA_WORLD_ABILITY_RIBBON, - 98, - 0, - RIBBON_WORLD_ABILITY, - 131 - }, { - MON_DATA_ALERT_RIBBON, - 99, - 2, - RIBBON_ALERT, - 132 - }, { - MON_DATA_SHOCK_RIBBON, - 100, - 0, - RIBBON_SHOCK, - 133 - }, { - MON_DATA_DOWNCAST_RIBBON, - 101, - 1, - RIBBON_DOWNCAST, - 134 - }, { - MON_DATA_CARELESS_RIBBON, - 102, - 2, - RIBBON_CARELESS, - 135 - }, { - MON_DATA_RELAX_RIBBON, - 103, - 3, - RIBBON_RELAX, - 136 - }, { - MON_DATA_SNOOZE_RIBBON, - 104, - 0, - RIBBON_SNOOZE, - 137 - }, { - MON_DATA_SMILE_RIBBON, - 105, - 2, - RIBBON_SMILE, - 138 - }, { - MON_DATA_GORGEOUS_RIBBON, - 106, - 1, - RIBBON_GORGEOUS, - 139 - }, { - MON_DATA_ROYAL_RIBBON, - 107, - 3, - RIBBON_ROYAL, - 140 - }, { - MON_DATA_GORGEOUS_ROYAL_RIBBON, - 108, - 0, - RIBBON_GORGEOUS_ROYAL, - 141 - }, { - MON_DATA_FOOTPRINT_RIBBON, - 109, - 0, - RIBBON_FOOTPRINT, - 142 - }, { - MON_DATA_RECORD_RIBBON, - 110, - 1, - RIBBON_RECORD, - 143 - }, { - MON_DATA_HISTORY_RIBBON, - 111, - 3, - RIBBON_HISTORY, - 144 - }, { - MON_DATA_LEGEND_RIBBON, - 112, - 0, - RIBBON_LEGEND, - 145 - }, { - MON_DATA_RED_RIBBON, - 113, - 0, - RIBBON_RED, - 7 | 0x8000 - }, { - MON_DATA_GREEN_RIBBON, - 114, - 3, - RIBBON_GREEN, - 8 | 0x8000 - }, { - MON_DATA_BLUE_RIBBON, - 115, - 1, - RIBBON_BLUE, - 9 | 0x8000 - }, { - MON_DATA_FESTIVAL_RIBBON, - 116, - 1, - RIBBON_FESTIVAL, - 10 | 0x8000 - }, { - MON_DATA_CARNIVAL_RIBBON, - 117, - 0, - RIBBON_CARNIVAL, - 11 | 0x8000 - }, { - MON_DATA_CLASSIC_RIBBON, - 118, - 1, - RIBBON_CLASSIC, - 12 | 0x8000 - }, { - MON_DATA_PREMIER_RIBBON, - 119, - 0, - RIBBON_PREMIER, - 13 | 0x8000 - } + { MON_DATA_HOENN_CHAMPION_RIBBON, 72, 0, RIBBON_HOENN_CHAMPION, 80 }, + { MON_DATA_HOENN_COOL_RIBBON, 73, 0, RIBBON_HOENN_COOL, 81 }, + { MON_DATA_HOENN_COOL_RIBBON_SUPER, 74, 0, RIBBON_HOENN_COOL_SUPER, 82 }, + { MON_DATA_HOENN_COOL_RIBBON_HYPER, 75, 0, RIBBON_HOENN_COOL_HYPER, 83 }, + { MON_DATA_HOENN_COOL_RIBBON_MASTER, 76, 0, RIBBON_HOENN_COOL_MASTER, 84 }, + { MON_DATA_HOENN_BEAUTY_RIBBON, 73, 1, RIBBON_HOENN_BEAUTY, 85 }, + { MON_DATA_HOENN_BEAUTY_RIBBON_SUPER, 74, 1, RIBBON_HOENN_BEAUTY_SUPER, 86 }, + { MON_DATA_HOENN_BEAUTY_RIBBON_HYPER, 75, 1, RIBBON_HOENN_BEAUTY_HYPER, 87 }, + { MON_DATA_HOENN_BEAUTY_RIBBON_MASTER, 76, 1, RIBBON_HOENN_BEAUTY_MASTER, 88 }, + { MON_DATA_HOENN_CUTE_RIBBON, 73, 2, RIBBON_HOENN_CUTE, 89 }, + { MON_DATA_HOENN_CUTE_RIBBON_SUPER, 74, 2, RIBBON_HOENN_CUTE_SUPER, 90 }, + { MON_DATA_HOENN_CUTE_RIBBON_HYPER, 75, 2, RIBBON_HOENN_CUTE_HYPER, 91 }, + { MON_DATA_HOENN_CUTE_RIBBON_MASTER, 76, 2, RIBBON_HOENN_CUTE_MASTER, 92 }, + { MON_DATA_HOENN_SMART_RIBBON, 73, 3, RIBBON_HOENN_SMART, 93 }, + { MON_DATA_HOENN_SMART_RIBBON_SUPER, 74, 3, RIBBON_HOENN_SMART_SUPER, 94 }, + { MON_DATA_HOENN_SMART_RIBBON_HYPER, 75, 3, RIBBON_HOENN_SMART_HYPER, 95 }, + { MON_DATA_HOENN_SMART_RIBBON_MASTER, 76, 3, RIBBON_HOENN_SMART_MASTER, 96 }, + { MON_DATA_HOENN_TOUGH_RIBBON, 73, 4, RIBBON_HOENN_TOUGH, 97 }, + { MON_DATA_HOENN_TOUGH_RIBBON_SUPER, 74, 4, RIBBON_HOENN_TOUGH_SUPER, 98 }, + { MON_DATA_HOENN_TOUGH_RIBBON_HYPER, 75, 4, RIBBON_HOENN_TOUGH_HYPER, 99 }, + { MON_DATA_HOENN_TOUGH_RIBBON_MASTER, 76, 4, RIBBON_HOENN_TOUGH_MASTER, 100 }, + { MON_DATA_HOENN_WINNING_RIBBON, 78, 0, RIBBON_HOENN_WINNING, 101 }, + { MON_DATA_HOENN_VICTORY_RIBBON, 77, 0, RIBBON_HOENN_VICTORY, 102 }, + { MON_DATA_HOENN_ARTIST_RIBBON, 79, 1, RIBBON_HOENN_ARTIST, 103 }, + { MON_DATA_HOENN_EFFORT_RIBBON, 80, 2, RIBBON_HOENN_EFFORT, 104 }, + { MON_DATA_HOENN_MARINE_RIBBON, 81, 1, RIBBON_HOENN_MARINE, 0 | 0x8000 }, + { MON_DATA_HOENN_LAND_RIBBON, 81, 3, RIBBON_HOENN_LAND, 1 | 0x8000 }, + { MON_DATA_HOENN_SKY_RIBBON, 81, 4, RIBBON_HOENN_SKY, 2 | 0x8000 }, + { MON_DATA_HOENN_COUNTRY_RIBBON, 82, 3, RIBBON_HOENN_COUNTRY, 178 }, + { MON_DATA_HOENN_NATIONAL_RIBBON, 82, 4, RIBBON_HOENN_NATIONAL, 190 }, + { MON_DATA_HOENN_EARTH_RIBBON, 83, 0, RIBBON_HOENN_EARTH, 191 }, + { MON_DATA_HOENN_WORLD_RIBBON, 83, 1, RIBBON_HOENN_WORLD, 178 }, + { MON_DATA_SINNOH_CHAMP_RIBBON, 88, 0, RIBBON_SINNOH_CHAMP, 105 }, + { MON_DATA_COOL_RIBBON, 89, 0, RIBBON_COOL, 106 }, + { MON_DATA_COOL_RIBBON_GREAT, 90, 0, RIBBON_COOL_GREAT, 107 }, + { MON_DATA_COOL_RIBBON_ULTRA, 91, 0, RIBBON_COOL_ULTRA, 108 }, + { MON_DATA_COOL_RIBBON_MASTER, 92, 0, RIBBON_COOL_MASTER, 109 }, + { MON_DATA_BEAUTY_RIBBON, 89, 1, RIBBON_BEAUTY, 110 }, + { MON_DATA_BEAUTY_RIBBON_GREAT, 90, 1, RIBBON_BEAUTY_GREAT, 111 }, + { MON_DATA_BEAUTY_RIBBON_ULTRA, 91, 1, RIBBON_BEAUTY_ULTRA, 112 }, + { MON_DATA_BEAUTY_RIBBON_MASTER, 92, 1, RIBBON_BEAUTY_MASTER, 113 }, + { MON_DATA_CUTE_RIBBON, 89, 2, RIBBON_CUTE, 114 }, + { MON_DATA_CUTE_RIBBON_GREAT, 90, 2, RIBBON_CUTE_GREAT, 115 }, + { MON_DATA_CUTE_RIBBON_ULTRA, 91, 2, RIBBON_CUTE_ULTRA, 116 }, + { MON_DATA_CUTE_RIBBON_MASTER, 92, 2, RIBBON_CUTE_MASTER, 117 }, + { MON_DATA_SMART_RIBBON, 89, 3, RIBBON_SMART, 118 }, + { MON_DATA_SMART_RIBBON_GREAT, 90, 3, RIBBON_SMART_GREAT, 119 }, + { MON_DATA_SMART_RIBBON_ULTRA, 91, 3, RIBBON_SMART_ULTRA, 120 }, + { MON_DATA_SMART_RIBBON_MASTER, 92, 3, RIBBON_SMART_MASTER, 121 }, + { MON_DATA_TOUGH_RIBBON, 89, 4, RIBBON_TOUGH, 122 }, + { MON_DATA_TOUGH_RIBBON_GREAT, 90, 4, RIBBON_TOUGH_GREAT, 123 }, + { MON_DATA_TOUGH_RIBBON_ULTRA, 91, 4, RIBBON_TOUGH_ULTRA, 124 }, + { MON_DATA_TOUGH_RIBBON_MASTER, 92, 4, RIBBON_TOUGH_MASTER, 125 }, + { MON_DATA_ABILITY_RIBBON, 93, 0, RIBBON_ABILITY, 126 }, + { MON_DATA_GREAT_ABILITY_RIBBON, 94, 0, RIBBON_GREAT_ABILITY, 127 }, + { MON_DATA_DOUBLE_ABILITY_RIBBON, 95, 0, RIBBON_DOUBLE_ABILITY, 128 }, + { MON_DATA_MULTI_ABILITY_RIBBON, 96, 0, RIBBON_MULTI_ABILITY, 129 }, + { MON_DATA_PAIR_ABILITY_RIBBON, 97, 0, RIBBON_PAIR_ABILITY, 130 }, + { MON_DATA_WORLD_ABILITY_RIBBON, 98, 0, RIBBON_WORLD_ABILITY, 131 }, + { MON_DATA_ALERT_RIBBON, 99, 2, RIBBON_ALERT, 132 }, + { MON_DATA_SHOCK_RIBBON, 100, 0, RIBBON_SHOCK, 133 }, + { MON_DATA_DOWNCAST_RIBBON, 101, 1, RIBBON_DOWNCAST, 134 }, + { MON_DATA_CARELESS_RIBBON, 102, 2, RIBBON_CARELESS, 135 }, + { MON_DATA_RELAX_RIBBON, 103, 3, RIBBON_RELAX, 136 }, + { MON_DATA_SNOOZE_RIBBON, 104, 0, RIBBON_SNOOZE, 137 }, + { MON_DATA_SMILE_RIBBON, 105, 2, RIBBON_SMILE, 138 }, + { MON_DATA_GORGEOUS_RIBBON, 106, 1, RIBBON_GORGEOUS, 139 }, + { MON_DATA_ROYAL_RIBBON, 107, 3, RIBBON_ROYAL, 140 }, + { MON_DATA_GORGEOUS_ROYAL_RIBBON, 108, 0, RIBBON_GORGEOUS_ROYAL, 141 }, + { MON_DATA_FOOTPRINT_RIBBON, 109, 0, RIBBON_FOOTPRINT, 142 }, + { MON_DATA_RECORD_RIBBON, 110, 1, RIBBON_RECORD, 143 }, + { MON_DATA_HISTORY_RIBBON, 111, 3, RIBBON_HISTORY, 144 }, + { MON_DATA_LEGEND_RIBBON, 112, 0, RIBBON_LEGEND, 145 }, + { MON_DATA_RED_RIBBON, 113, 0, RIBBON_RED, 7 | 0x8000 }, + { MON_DATA_GREEN_RIBBON, 114, 3, RIBBON_GREEN, 8 | 0x8000 }, + { MON_DATA_BLUE_RIBBON, 115, 1, RIBBON_BLUE, 9 | 0x8000 }, + { MON_DATA_FESTIVAL_RIBBON, 116, 1, RIBBON_FESTIVAL, 10 | 0x8000 }, + { MON_DATA_CARNIVAL_RIBBON, 117, 0, RIBBON_CARNIVAL, 11 | 0x8000 }, + { MON_DATA_CLASSIC_RIBBON, 118, 1, RIBBON_CLASSIC, 12 | 0x8000 }, + { MON_DATA_PREMIER_RIBBON, 119, 0, RIBBON_PREMIER, 13 | 0x8000 } }; -u32 sub_0207FC5C(u8 a0, u32 a1) -{ - switch (a1) - { +u32 sub_0207FC5C(u8 a0, u32 a1) { + switch (a1) { case 0: return UNK_020FB788[a0].monDataId; case 1: @@ -514,18 +112,18 @@ u32 sub_0207FC5C(u8 a0, u32 a1) } } -int sub_0207FCC0(u8 * a0, u32 a1) -{ +int sub_0207FCC0(u8 *a0, u32 a1) { int ret = (int)UNK_020FB788[a1].descIdx; - if (ret & 0x8000) + if (ret & 0x8000) { ret = a0[(u8)ret] + 0x92; + } return ret; } -u8 sub_0207FCE0(u32 a0) -{ +u8 sub_0207FCE0(u32 a0) { int ret = (int)UNK_020FB788[a0].descIdx; - if (ret & 0x8000) + if (ret & 0x8000) { return (u8)ret; + } return 0xFF; } diff --git a/arm9/src/unk_020851B8.c b/arm9/src/unk_020851B8.c index 5db6d67bb..569affc8e 100644 --- a/arm9/src/unk_020851B8.c +++ b/arm9/src/unk_020851B8.c @@ -1,45 +1,41 @@ -#include "global.h" #include "unk_020851B8.h" + +#include "global.h" + #include "constants/items.h" + #include "heap.h" -struct UnkStruct_020851B8 *sub_020851B8(u8 heapId) -{ +struct UnkStruct_020851B8 *sub_020851B8(u8 heapId) { struct UnkStruct_020851B8 *ptr = AllocFromHeap((HeapID)heapId, sizeof(struct UnkStruct_020851B8)); memset(ptr, 0, sizeof(struct UnkStruct_020851B8)); return ptr; } -void sub_020851DC(struct UnkStruct_020851B8 *param0, u16 item_id, BOOL param2) -{ +void sub_020851DC(struct UnkStruct_020851B8 *param0, u16 item_id, BOOL param2) { u16 berry_id = item_id - FIRST_BERRY_IDX; sub_02085200(param0, berry_id); - if (param2 == TRUE) - { + if (param2 == TRUE) { param0->unk_8 = berry_id; } } -void sub_020851F8(struct UnkStruct_020851B8 *param0, u8 param1, u8 param2, u8 param3) -{ +void sub_020851F8(struct UnkStruct_020851B8 *param0, u8 param1, u8 param2, u8 param3) { param0->unk_9 = param1; param0->unk_A = param2; param0->unk_B = param3; } -void sub_02085200(struct UnkStruct_020851B8 *param0, u16 berry_id) -{ +void sub_02085200(struct UnkStruct_020851B8 *param0, u16 berry_id) { param0->flags[berry_id / 32] |= 1 << (berry_id % 32); } -u8 sub_02085224(struct UnkStruct_020851B8 *param0, u16 berry_id) -{ +u8 sub_02085224(struct UnkStruct_020851B8 *param0, u16 berry_id) { return param0->flags[berry_id / 32] & (1 << (berry_id % 32)) ? 1 : 0; } -void sub_0208524C(struct UnkStruct_020851B8 *param0, u8 *param1, u8 *param2) -{ +void sub_0208524C(struct UnkStruct_020851B8 *param0, u8 *param1, u8 *param2) { *param1 = param0->unk_9; *param2 = param0->unk_A; } diff --git a/arm9/src/unk_02085338.c b/arm9/src/unk_02085338.c index 853485322..6003c3465 100644 --- a/arm9/src/unk_02085338.c +++ b/arm9/src/unk_02085338.c @@ -1,133 +1,110 @@ +#include "unk_02085338.h" + #include "global.h" + #include "heap.h" #include "save_vars_flags.h" -#include "unk_02085338.h" -extern BOOL sub_0205ED0C(struct SaveVarsFlags * state); - -struct UnkStruct_02085338 * sub_02085338(u8 r5, u8 r7, struct SaveData * save, HeapID heapId) -{ - struct UnkStruct_02085338 * ret = (struct UnkStruct_02085338 *) AllocFromHeap(heapId, sizeof(struct UnkStruct_02085338)); - ret->unk_00 = r5; - ret->unk_01 = r7; - ret->unk_0c = Save_Pokedex_Get(save); - ret->unk_10 = Save_EasyChat_Get(save); - ret->unk_04 = (u8)sub_0205ED0C(Save_VarsFlags_Get(save)); - ret->unk_05 = 0; - ret->unk_02 = 1; - ret->unk_03 = 0; - ret->unk_08 = Options_GetFrame(Save_PlayerData_GetOptionsAddr(save)); - if (r5 == 2) - { +extern BOOL sub_0205ED0C(struct SaveVarsFlags *state); + +struct UnkStruct_02085338 *sub_02085338(u8 r5, u8 r7, struct SaveData *save, HeapID heapId) { + struct UnkStruct_02085338 *ret = (struct UnkStruct_02085338 *)AllocFromHeap(heapId, sizeof(struct UnkStruct_02085338)); + ret->unk_00 = r5; + ret->unk_01 = r7; + ret->unk_0c = Save_Pokedex_Get(save); + ret->unk_10 = Save_EasyChat_Get(save); + ret->unk_04 = (u8)sub_0205ED0C(Save_VarsFlags_Get(save)); + ret->unk_05 = 0; + ret->unk_02 = 1; + ret->unk_03 = 0; + ret->unk_08 = Options_GetFrame(Save_PlayerData_GetOptionsAddr(save)); + if (r5 == 2) { MailMsg_Init_WithBank(&ret->unk_14, 3); - } - else - { - for (int i = 0; i < 2; i++) - { + } else { + for (int i = 0; i < 2; i++) { ret->unk_1c[i] = 0xFFFF; } } return ret; } -void sub_020853A8(struct UnkStruct_02085338 * ptr) -{ +void sub_020853A8(struct UnkStruct_02085338 *ptr) { FreeToHeap(ptr); } -void sub_020853B0(struct UnkStruct_02085338 * ptr, u16 a1) -{ +void sub_020853B0(struct UnkStruct_02085338 *ptr, u16 a1) { ptr->unk_1c[0] = a1; } -void sub_020853B4(struct UnkStruct_02085338 * ptr, u16 a1, u16 a2) -{ +void sub_020853B4(struct UnkStruct_02085338 *ptr, u16 a1, u16 a2) { ptr->unk_1c[0] = a1; ptr->unk_1c[1] = a2; } -void sub_020853BC(struct UnkStruct_02085338 * ptr, const struct MailMessage * a1) -{ +void sub_020853BC(struct UnkStruct_02085338 *ptr, const struct MailMessage *a1) { ptr->unk_14 = *a1; } -void sub_020853D0(struct UnkStruct_02085338 * ptr) -{ +void sub_020853D0(struct UnkStruct_02085338 *ptr) { ptr->unk_02 = 1; ptr->unk_03 = 0; } -void sub_020853DC(struct UnkStruct_02085338 * ptr) -{ +void sub_020853DC(struct UnkStruct_02085338 *ptr) { ptr->unk_05 = 1; } -u8 sub_020853E4(struct UnkStruct_02085338 * ptr) -{ +u8 sub_020853E4(struct UnkStruct_02085338 *ptr) { return ptr->unk_02; } -u8 sub_020853E8(struct UnkStruct_02085338 * ptr) -{ +u8 sub_020853E8(struct UnkStruct_02085338 *ptr) { return ptr->unk_03; } -u16 sub_020853EC(struct UnkStruct_02085338 * ptr) -{ +u16 sub_020853EC(struct UnkStruct_02085338 *ptr) { return ptr->unk_1c[0]; } -void sub_020853F0(struct UnkStruct_02085338 * ptr, u16 * a1) -{ +void sub_020853F0(struct UnkStruct_02085338 *ptr, u16 *a1) { a1[0] = ptr->unk_1c[0]; a1[1] = ptr->unk_1c[1]; } -void sub_020853FC(struct UnkStruct_02085338 * ptr, struct MailMessage * a1) -{ +void sub_020853FC(struct UnkStruct_02085338 *ptr, struct MailMessage *a1) { return MailMsg_Copy(a1, &ptr->unk_14); } -u8 sub_0208540C(struct UnkStruct_02085338 * ptr) -{ +u8 sub_0208540C(struct UnkStruct_02085338 *ptr) { return ptr->unk_00; } -u8 sub_02085410(struct UnkStruct_02085338 * ptr) -{ +u8 sub_02085410(struct UnkStruct_02085338 *ptr) { return ptr->unk_01; } -u32 sub_02085414(struct UnkStruct_02085338 * ptr) -{ +u32 sub_02085414(struct UnkStruct_02085338 *ptr) { return ptr->unk_08; } -struct Pokedex * sub_02085418(struct UnkStruct_02085338 * ptr) -{ +struct Pokedex *sub_02085418(struct UnkStruct_02085338 *ptr) { return ptr->unk_0c; } -struct SaveEasyChat * sub_0208541C(struct UnkStruct_02085338 * ptr) -{ +struct SaveEasyChat *sub_0208541C(struct UnkStruct_02085338 *ptr) { return ptr->unk_10; } -u8 sub_02085420(struct UnkStruct_02085338 * ptr) -{ +u8 sub_02085420(struct UnkStruct_02085338 *ptr) { return ptr->unk_04; } -u8 sub_02085424(struct UnkStruct_02085338 * ptr) -{ +u8 sub_02085424(struct UnkStruct_02085338 *ptr) { return ptr->unk_05; } -void sub_02085428(struct UnkStruct_02085338 * ptr, u16 * a1, struct MailMessage * a2) -{ - switch (ptr->unk_00) - { +void sub_02085428(struct UnkStruct_02085338 *ptr, u16 *a1, struct MailMessage *a2) { + switch (ptr->unk_00) { case 0: a1[0] = ptr->unk_1c[0]; break; @@ -141,10 +118,8 @@ void sub_02085428(struct UnkStruct_02085338 * ptr, u16 * a1, struct MailMessage } } -BOOL sub_0208545C(struct UnkStruct_02085338 * ptr, const u16 * a1, const struct MailMessage * a2) -{ - switch (ptr->unk_00) - { +BOOL sub_0208545C(struct UnkStruct_02085338 *ptr, const u16 *a1, const struct MailMessage *a2) { + switch (ptr->unk_00) { case 0: return a1[0] == ptr->unk_1c[0]; case 1: @@ -155,11 +130,11 @@ BOOL sub_0208545C(struct UnkStruct_02085338 * ptr, const u16 * a1, const struct } } -void sub_020854A0(struct UnkStruct_02085338 * r5, u16 * r4, struct MailMessage * r6) -{ +void sub_020854A0(struct UnkStruct_02085338 *r5, u16 *r4, struct MailMessage *r6) { r5->unk_03 = (u8)(!sub_0208545C(r5, r4, r6) ? 1 : 0); r5->unk_02 = 0; - for (int i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { r5->unk_1c[i] = r4[i]; + } r5->unk_14 = *r6; } diff --git a/arm9/src/unk_02087A1C.c b/arm9/src/unk_02087A1C.c index 1c55c8f06..212f9274a 100644 --- a/arm9/src/unk_02087A1C.c +++ b/arm9/src/unk_02087A1C.c @@ -1,67 +1,61 @@ +#include "unk_02087A1C.h" + #include "global.h" + #include "constants/species.h" -#include "unk_02087A1C.h" -struct MeisterRodata -{ +struct MeisterRodata { u16 species[14]; u8 languages[6]; }; static const struct MeisterRodata sMeister = { - { - SPECIES_EKANS, - SPECIES_PIKACHU, - SPECIES_PSYDUCK, - SPECIES_PONYTA, - SPECIES_STARYU, - SPECIES_MAGIKARP, - SPECIES_WOBBUFFET, - SPECIES_HERACROSS, - SPECIES_SNEASEL, - SPECIES_TEDDIURSA, - SPECIES_HOUNDOUR, - SPECIES_WINGULL, - SPECIES_SLAKOTH, - SPECIES_ROSELIA - }, - { - LANGUAGE_JAPANESE, - LANGUAGE_ENGLISH, - LANGUAGE_FRENCH, - LANGUAGE_GERMAN, - LANGUAGE_ITALIAN, - LANGUAGE_SPANISH - } + { SPECIES_EKANS, + SPECIES_PIKACHU, + SPECIES_PSYDUCK, + SPECIES_PONYTA, + SPECIES_STARYU, + SPECIES_MAGIKARP, + SPECIES_WOBBUFFET, + SPECIES_HERACROSS, + SPECIES_SNEASEL, + SPECIES_TEDDIURSA, + SPECIES_HOUNDOUR, + SPECIES_WINGULL, + SPECIES_SLAKOTH, + SPECIES_ROSELIA }, + { LANGUAGE_JAPANESE, + LANGUAGE_ENGLISH, + LANGUAGE_FRENCH, + LANGUAGE_GERMAN, + LANGUAGE_ITALIAN, + LANGUAGE_SPANISH } }; -s32 GetMeisterLanguageIdx(u32 language) -{ +s32 GetMeisterLanguageIdx(u32 language) { s32 i; - const u8 * ptr = sMeister.languages; - for (i = 0; i < 6; i++, ptr++) - { - if (language == *ptr) + const u8 *ptr = sMeister.languages; + for (i = 0; i < 6; i++, ptr++) { + if (language == *ptr) { break; + } } return i; } -u8 GetMeisterLanguage(s32 idx) -{ +u8 GetMeisterLanguage(s32 idx) { GF_ASSERT(idx < 6); - const u8 * ptr = sMeister.languages; + const u8 *ptr = sMeister.languages; return ptr[idx]; } -s32 GetMeisterSpeciesIdx(u32 species) -{ +s32 GetMeisterSpeciesIdx(u32 species) { s32 i; - const u16 * ptr = sMeister.species; - for (i = 0; i < 14; i++, ptr++) - { - if (species == *ptr) + const u16 *ptr = sMeister.species; + for (i = 0; i < 14; i++, ptr++) { + if (species == *ptr) { break; + } } return i; } diff --git a/arm9/src/unk_0208890C.c b/arm9/src/unk_0208890C.c index 6427b86de..d7c8d6372 100644 --- a/arm9/src/unk_0208890C.c +++ b/arm9/src/unk_0208890C.c @@ -1,5 +1,7 @@ -#include "global.h" #include "unk_0208890C.h" + +#include "global.h" + #include "MI_memory.h" #include "bag.h" #include "heap.h" @@ -7,12 +9,12 @@ #include "player_data.h" #include "poke_overlay.h" -extern struct SaveData* FieldSystem_GetSaveData(struct FieldSystem *); -extern SavePoffinData *Save_PoffinData_Get(struct SaveData* save); -extern void sub_020373D4(struct FieldSystem *, struct OverlayManagerTemplate *, void*); -extern BOOL sub_020889B0(struct OverlayManager *, u32*); -extern BOOL sub_02088A00(struct OverlayManager *, u32*); -extern BOOL sub_02088A78(struct OverlayManager *, u32*); +extern struct SaveData *FieldSystem_GetSaveData(struct FieldSystem *); +extern SavePoffinData *Save_PoffinData_Get(struct SaveData *save); +extern void sub_020373D4(struct FieldSystem *, struct OverlayManagerTemplate *, void *); +extern BOOL sub_020889B0(struct OverlayManager *, u32 *); +extern BOOL sub_02088A00(struct OverlayManager *, u32 *); +extern BOOL sub_02088A78(struct OverlayManager *, u32 *); const struct OverlayManagerTemplate UNK_020FD6E4 = { sub_020889B0, @@ -21,31 +23,28 @@ const struct OverlayManagerTemplate UNK_020FD6E4 = { SDK_OVERLAY_INVALID_ID, }; -struct PoffinCaseAppData* sub_0208890C(u32 a0, struct SaveData* save, HeapID heapId, u32 *a3) -{ - struct PoffinCaseAppData* ret = AllocFromHeap(heapId, sizeof(struct PoffinCaseAppData)); +struct PoffinCaseAppData *sub_0208890C(u32 a0, struct SaveData *save, HeapID heapId, u32 *a3) { + struct PoffinCaseAppData *ret = AllocFromHeap(heapId, sizeof(struct PoffinCaseAppData)); MI_CpuFill8(ret, 0, sizeof(struct PoffinCaseAppData)); - ret->save = save; + ret->save = save; ret->savePoffinData = Save_PoffinData_Get(save); - ret->player = Save_PlayerData_GetProfileAddr(save); - ret->bag = Save_Bag_Get(save); - ret->options = Save_PlayerData_GetOptionsAddr(save); - ret->unk1C = a3; - ret->unk4 = a0; + ret->player = Save_PlayerData_GetProfileAddr(save); + ret->bag = Save_Bag_Get(save); + ret->options = Save_PlayerData_GetOptionsAddr(save); + ret->unk1C = a3; + ret->unk4 = a0; return ret; } -void sub_02088950(struct FieldSystem *fieldSystem, struct PoffinCaseAppData *param1) -{ +void sub_02088950(struct FieldSystem *fieldSystem, struct PoffinCaseAppData *param1) { sub_020373D4(fieldSystem, (struct OverlayManagerTemplate *)&UNK_020FD6E4, param1); } -struct PoffinCaseAppData* sub_02088960(struct FieldSystem *fieldSystem, u32 a1, HeapID heapId) -{ - struct SaveData* save = FieldSystem_GetSaveData(fieldSystem); - struct PoffinCaseAppData* ret = sub_0208890C(a1, save, heapId, fieldSystem->unk98); +struct PoffinCaseAppData *sub_02088960(struct FieldSystem *fieldSystem, u32 a1, HeapID heapId) { + struct SaveData *save = FieldSystem_GetSaveData(fieldSystem); + struct PoffinCaseAppData *ret = sub_0208890C(a1, save, heapId, fieldSystem->unk98); sub_02088950(fieldSystem, ret); diff --git a/arm9/src/unk_02088AAC.c b/arm9/src/unk_02088AAC.c index dbe1199a3..3645ab704 100644 --- a/arm9/src/unk_02088AAC.c +++ b/arm9/src/unk_02088AAC.c @@ -1,5 +1,7 @@ -#include "global.h" #include "unk_02088AAC.h" + +#include "global.h" + #include "heap.h" #include "overlay_manager.h" #include "unk_020851B8.h" @@ -16,10 +18,8 @@ extern BOOL ov75_021E6F00(struct OverlayManager *, u32 *); extern BOOL sub_0208898C(struct OverlayManager **r0); -u32 sub_02088AAC(struct UnkStruct_02088AAC *r0, u32 *r1) -{ - switch (*r1) - { +u32 sub_02088AAC(struct UnkStruct_02088AAC *r0, u32 *r1) { + switch (*r1) { case 0: *r1 = sub_02088B4C(r0); break; @@ -41,68 +41,58 @@ u32 sub_02088AAC(struct UnkStruct_02088AAC *r0, u32 *r1) return 0; } -u32 sub_02088AFC(struct UnkStruct_02088AAC *r0) -{ +u32 sub_02088AFC(struct UnkStruct_02088AAC *r0) { FS_EXTERN_OVERLAY(OVERLAY_73); - const struct OverlayManagerTemplate OVERLAY_73_MANAGER = - { + const struct OverlayManagerTemplate OVERLAY_73_MANAGER = { .initFunc = ov73_021D74F0, .mainFunc = ov73_021D758C, .exitFunc = ov73_021D7640, - .ovly = FS_OVERLAY_ID(OVERLAY_73) + .ovly = FS_OVERLAY_ID(OVERLAY_73) }; r0->ovly_data = OverlayManager_New(&OVERLAY_73_MANAGER, (s32 *)r0, r0->heapId); return 2; } -u32 sub_02088B28(struct UnkStruct_02088AAC *r0) -{ - if (!sub_0208898C(&r0->ovly_data)) - { +u32 sub_02088B28(struct UnkStruct_02088AAC *r0) { + if (!sub_0208898C(&r0->ovly_data)) { return 2; } - if (r0->unk20 == TRUE) - { + if (r0->unk20 == TRUE) { return 0; } return 3; } -u32 sub_02088B48() -{ +u32 sub_02088B48() { return 4; } -u32 sub_02088B4C(struct UnkStruct_02088AAC *r0) -{ +u32 sub_02088B4C(struct UnkStruct_02088AAC *r0) { FS_EXTERN_OVERLAY(OVERLAY_75); - static const u8 UNK_020FD6F4[] = { 0x04, 0xFF }; - const struct OverlayManagerTemplate OVERLAY_75_MANAGER = - { - .initFunc = ov75_021E6BA0, - .mainFunc = ov75_021E6D6C, - .exitFunc = ov75_021E6F00, - .ovly = FS_OVERLAY_ID(OVERLAY_75) - }; + static const u8 UNK_020FD6F4[] = { 0x04, 0xFF }; + const struct OverlayManagerTemplate OVERLAY_75_MANAGER = { + .initFunc = ov75_021E6BA0, + .mainFunc = ov75_021E6D6C, + .exitFunc = ov75_021E6F00, + .ovly = FS_OVERLAY_ID(OVERLAY_75) + }; struct BagView *bag_view = Bag_CreateView(r0->poffinCaseAppData->bag, UNK_020FD6F4, r0->heapId); sub_0206E314(bag_view, r0->poffinCaseAppData->save, (u8)((u8)r0->unk06 == 1 ? 5 : 4), r0->unk0C); - r0->ovly_data = OverlayManager_New(&OVERLAY_75_MANAGER, (s32 *)bag_view, r0->heapId); + r0->ovly_data = OverlayManager_New(&OVERLAY_75_MANAGER, (s32 *)bag_view, r0->heapId); r0->ovly_param = bag_view; return 1; } -u32 sub_02088BA8(struct UnkStruct_02088AAC *r0) -{ - if (!sub_0208898C(&r0->ovly_data)) - { +u32 sub_02088BA8(struct UnkStruct_02088AAC *r0) { + if (!sub_0208898C(&r0->ovly_data)) { return 1; } @@ -112,12 +102,11 @@ u32 sub_02088BA8(struct UnkStruct_02088AAC *r0) FreeToHeap(r0->ovly_param); r0->ovly_param = NULL; - r0->item = sub_0206E37C(bag_view); + r0->item = sub_0206E37C(bag_view); FreeToHeap(bag_view); - switch (sub_0206E384(bag_view)) - { + switch (sub_0206E384(bag_view)) { case 1: return 2; case 5: @@ -134,29 +123,25 @@ u32 sub_02088BA8(struct UnkStruct_02088AAC *r0) } } -u32 sub_02088C3C(struct UnkStruct_02088AAC *r0) -{ +u32 sub_02088C3C(struct UnkStruct_02088AAC *r0) { FS_EXTERN_OVERLAY(OVERLAY_68); - struct Bag *bag = r0->poffinCaseAppData->bag; - const struct OverlayManagerTemplate OVERLAY_68_MANAGER = - { - .initFunc = ov68_021D74E0, - .mainFunc = ov68_021D75D8, - .exitFunc = ov68_021D762C, - .ovly = FS_OVERLAY_ID(OVERLAY_68) - }; + struct Bag *bag = r0->poffinCaseAppData->bag; + const struct OverlayManagerTemplate OVERLAY_68_MANAGER = { + .initFunc = ov68_021D74E0, + .mainFunc = ov68_021D75D8, + .exitFunc = ov68_021D762C, + .ovly = FS_OVERLAY_ID(OVERLAY_68) + }; r0->ovly_param = sub_020851B8((u8)r0->heapId); sub_020851DC(r0->ovly_param, (u16)r0->item, TRUE); u8 berry_count = 0; - for (u8 berry_id = 0; berry_id < (u8)NUM_BERRIES; berry_id++) - { + for (u8 berry_id = 0; berry_id < (u8)NUM_BERRIES; berry_id++) { u8 item_id = (u8)BerryToItemId(berry_id); - if (Bag_HasItem(bag, item_id, 1, r0->heapId) == TRUE) - { + if (Bag_HasItem(bag, item_id, 1, r0->heapId) == TRUE) { sub_020851DC(r0->ovly_param, item_id, 0); berry_count++; @@ -174,10 +159,8 @@ u32 sub_02088C3C(struct UnkStruct_02088AAC *r0) return 3; } -u32 sub_02088CDC(struct UnkStruct_02088AAC *r0) -{ - if (!sub_0208898C(&r0->ovly_data)) - { +u32 sub_02088CDC(struct UnkStruct_02088AAC *r0) { + if (!sub_0208898C(&r0->ovly_data)) { return 3; } diff --git a/arm9/src/unk_0208A300.c b/arm9/src/unk_0208A300.c index 5b0144af0..07fe6132a 100644 --- a/arm9/src/unk_0208A300.c +++ b/arm9/src/unk_0208A300.c @@ -1,10 +1,11 @@ +#include "unk_0208A300.h" + #include "global.h" + #include "heap.h" -#include "unk_0208A300.h" -struct UnkStruct_0208A300* sub_0208A300(HeapID heapId) -{ - struct UnkStruct_0208A300* ret = AllocFromHeap(heapId, sizeof(struct UnkStruct_0208A300)); +struct UnkStruct_0208A300 *sub_0208A300(HeapID heapId) { + struct UnkStruct_0208A300 *ret = AllocFromHeap(heapId, sizeof(struct UnkStruct_0208A300)); memset(ret, 0, sizeof(struct UnkStruct_0208A300)); ret->unk4 = 2; @@ -12,27 +13,22 @@ struct UnkStruct_0208A300* sub_0208A300(HeapID heapId) return ret; } -void sub_0208A320(struct UnkStruct_0208A300* unk) -{ +void sub_0208A320(struct UnkStruct_0208A300 *unk) { FreeToHeap(unk); } -u32 sub_0208A328(struct UnkStruct_0208A300* unk) -{ +u32 sub_0208A328(struct UnkStruct_0208A300 *unk) { return unk->unk0; } -void sub_0208A32C(struct UnkStruct_0208A300* unk, u32 a1) -{ +void sub_0208A32C(struct UnkStruct_0208A300 *unk, u32 a1) { unk->unk0 = a1; } -u32 sub_0208A330(struct UnkStruct_0208A300* unk) -{ +u32 sub_0208A330(struct UnkStruct_0208A300 *unk) { return unk->unk4; } -void sub_0208A334(struct UnkStruct_0208A300* unk, u32 a1) -{ +void sub_0208A334(struct UnkStruct_0208A300 *unk, u32 a1) { unk->unk4 = a1; } diff --git a/arm9/src/use_item_on_mon.c b/arm9/src/use_item_on_mon.c index efc04720f..fb5675e3e 100644 --- a/arm9/src/use_item_on_mon.c +++ b/arm9/src/use_item_on_mon.c @@ -1,14 +1,16 @@ +#include "use_item_on_mon.h" + #include "global.h" -#include "pokemon.h" + +#include "constants/moves.h" + #include "heap.h" #include "itemtool.h" #include "move_data.h" #include "party.h" -#include "use_item_on_mon.h" -#include "constants/moves.h" +#include "pokemon.h" -BOOL CanUseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveId, HeapID heapId) -{ +BOOL CanUseItemOnPokemon(struct Pokemon *pokemon, u16 itemId, s32 moveId, HeapID heapId) { s32 atkEv; s32 defEv; s32 speedEv; @@ -16,247 +18,181 @@ BOOL CanUseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveId, HeapI s32 spDefEv; s32 hpEv; u32 hp; - struct ItemData * itemData; + struct ItemData *itemData; u32 status; itemData = LoadItemDataOrGfx(itemId, ITEMDATA_DATA, heapId); - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PARTY_USE) != 1) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PARTY_USE) != 1) { FreeToHeap(itemData); return FALSE; } status = GetMonData(pokemon, MON_DATA_STATUS, NULL); // slp - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SLP_HEAL) && (status & MON_STATUS_SLP_MASK)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SLP_HEAL) && (status & MON_STATUS_SLP_MASK)) { FreeToHeap(itemData); return TRUE; } // psn - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PSN_HEAL) && (status & (MON_STATUS_PSN_MASK | MON_STATUS_TOX_MASK))) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PSN_HEAL) && (status & (MON_STATUS_PSN_MASK | MON_STATUS_TOX_MASK))) { FreeToHeap(itemData); return TRUE; } // brn - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_BRN_HEAL) && (status & MON_STATUS_BRN_MASK)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_BRN_HEAL) && (status & MON_STATUS_BRN_MASK)) { FreeToHeap(itemData); return TRUE; } // frz - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRZ_HEAL) && (status & MON_STATUS_FRZ_MASK)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRZ_HEAL) && (status & MON_STATUS_FRZ_MASK)) { FreeToHeap(itemData); return TRUE; } // prz - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PRZ_HEAL) && (status & MON_STATUS_PRZ_MASK)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PRZ_HEAL) && (status & MON_STATUS_PRZ_MASK)) { FreeToHeap(itemData); return TRUE; } hp = GetMonData(pokemon, MON_DATA_HP, NULL); - if ((GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE) || GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE_ALL)) && !GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP)) - { - if (hp == 0) - { + if ((GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE) || GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE_ALL)) && !GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP)) { + if (hp == 0) { FreeToHeap(itemData); return TRUE; } - } - else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_RESTORE) &&hp != 0 && hp < GetMonData(pokemon, MON_DATA_MAXHP, NULL)) - { + } else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_RESTORE) && hp != 0 && hp < GetMonData(pokemon, MON_DATA_MAXHP, NULL)) { FreeToHeap(itemData); return TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP) && GetMonData(pokemon, MON_DATA_LEVEL, NULL) < MAX_LEVEL) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP) && GetMonData(pokemon, MON_DATA_LEVEL, NULL) < MAX_LEVEL) { FreeToHeap(itemData); return TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_EVOLVE) && GetMonEvolution(NULL, pokemon, 3, itemId, NULL) != SPECIES_NONE) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_EVOLVE) && GetMonEvolution(NULL, pokemon, 3, itemId, NULL) != SPECIES_NONE) { FreeToHeap(itemData); return TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_UP) || GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_MAX)) - { - if (GetMonData(pokemon, MON_DATA_MOVE1PPUP + moveId, NULL) < 3 && WazaGetMaxPp((u16)GetMonData(pokemon, MON_DATA_MOVE1 + moveId, NULL), 0) >= 5) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_UP) || GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_MAX)) { + if (GetMonData(pokemon, MON_DATA_MOVE1PPUP + moveId, NULL) < 3 && WazaGetMaxPp((u16)GetMonData(pokemon, MON_DATA_MOVE1 + moveId, NULL), 0) >= 5) { FreeToHeap(itemData); return TRUE; } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE) && MonMoveCanRestorePP(pokemon, moveId) == TRUE) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE) && MonMoveCanRestorePP(pokemon, moveId) == TRUE) { FreeToHeap(itemData); return TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_ALL)) - { - for (int i = 0; i < MAX_MON_MOVES; i++) - { - if (MonMoveCanRestorePP(pokemon, i) == TRUE) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_ALL)) { + for (int i = 0; i < MAX_MON_MOVES; i++) { + if (MonMoveCanRestorePP(pokemon, i) == TRUE) { FreeToHeap(itemData); return TRUE; } } } - hpEv = (s32)GetMonData(pokemon, MON_DATA_HP_EV, NULL); - atkEv = (s32)GetMonData(pokemon, MON_DATA_ATK_EV, NULL); - defEv = (s32)GetMonData(pokemon, MON_DATA_DEF_EV, NULL); + hpEv = (s32)GetMonData(pokemon, MON_DATA_HP_EV, NULL); + atkEv = (s32)GetMonData(pokemon, MON_DATA_ATK_EV, NULL); + defEv = (s32)GetMonData(pokemon, MON_DATA_DEF_EV, NULL); speedEv = (s32)GetMonData(pokemon, MON_DATA_SPEED_EV, NULL); spAtkEv = (s32)GetMonData(pokemon, MON_DATA_SPATK_EV, NULL); spDefEv = (s32)GetMonData(pokemon, MON_DATA_SPDEF_EV, NULL); - if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_SHEDINJA && GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_EV_UP)) - { + if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_SHEDINJA && GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_EV_UP)) { s32 dHpEv = (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_EV_UP_PARAM); - if (dHpEv > 0) - { - if (hpEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) - { + if (dHpEv > 0) { + if (hpEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) { FreeToHeap(itemData); return TRUE; } - } - else if (dHpEv < 0) - { - if (hpEv > 0) - { + } else if (dHpEv < 0) { + if (hpEv > 0) { FreeToHeap(itemData); return TRUE; - } - else if (CanItemModFriendship(pokemon, itemData) == TRUE) - { + } else if (CanItemModFriendship(pokemon, itemData) == TRUE) { FreeToHeap(itemData); return TRUE; } } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_ATK_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_ATK_EV_UP)) { s32 dAtkEv = (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_ATK_EV_UP_PARAM); - if (dAtkEv > 0) - { - if (atkEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) - { + if (dAtkEv > 0) { + if (atkEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) { FreeToHeap(itemData); return TRUE; } - } - else if (dAtkEv < 0) - { - if (atkEv > 0) - { + } else if (dAtkEv < 0) { + if (atkEv > 0) { FreeToHeap(itemData); return TRUE; - } - else if (CanItemModFriendship(pokemon, itemData) == TRUE) - { + } else if (CanItemModFriendship(pokemon, itemData) == TRUE) { FreeToHeap(itemData); return TRUE; } } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_DEF_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_DEF_EV_UP)) { s32 dDefEv = (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_DEF_EV_UP_PARAM); - if (dDefEv > 0) - { - if (defEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) - { + if (dDefEv > 0) { + if (defEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) { FreeToHeap(itemData); return TRUE; } - } - else if (dDefEv < 0) - { - if (defEv > 0) - { + } else if (dDefEv < 0) { + if (defEv > 0) { FreeToHeap(itemData); return TRUE; - } - else if (CanItemModFriendship(pokemon, itemData) == TRUE) - { + } else if (CanItemModFriendship(pokemon, itemData) == TRUE) { FreeToHeap(itemData); return TRUE; } } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPEED_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPEED_EV_UP)) { s32 dSpeedEv = (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPEED_EV_UP_PARAM); - if (dSpeedEv > 0) - { - if (speedEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) - { + if (dSpeedEv > 0) { + if (speedEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) { FreeToHeap(itemData); return TRUE; } - } - else if (dSpeedEv < 0) - { - if (speedEv > 0) - { + } else if (dSpeedEv < 0) { + if (speedEv > 0) { FreeToHeap(itemData); return TRUE; - } - else if (CanItemModFriendship(pokemon, itemData) == TRUE) - { + } else if (CanItemModFriendship(pokemon, itemData) == TRUE) { FreeToHeap(itemData); return TRUE; } } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPATK_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPATK_EV_UP)) { s32 dSpAtkEv = (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPATK_EV_UP_PARAM); - if (dSpAtkEv > 0) - { - if (spAtkEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) - { + if (dSpAtkEv > 0) { + if (spAtkEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) { FreeToHeap(itemData); return TRUE; } - } - else if (dSpAtkEv < 0) - { - if (spAtkEv > 0) - { + } else if (dSpAtkEv < 0) { + if (spAtkEv > 0) { FreeToHeap(itemData); return TRUE; - } - else if (CanItemModFriendship(pokemon, itemData) == TRUE) - { + } else if (CanItemModFriendship(pokemon, itemData) == TRUE) { FreeToHeap(itemData); return TRUE; } } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPDEF_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPDEF_EV_UP)) { s32 dSpDefEv = (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPDEF_EV_UP_PARAM); - if (dSpDefEv > 0) - { - if (spDefEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) - { + if (dSpDefEv > 0) { + if (spDefEv < MAX_EV && (hpEv + atkEv + defEv + speedEv + spAtkEv + spDefEv) < MAX_EV_SUM) { FreeToHeap(itemData); return TRUE; } - } - else if (dSpDefEv < 0) - { - if (spDefEv > 0) - { + } else if (dSpDefEv < 0) { + if (spDefEv > 0) { FreeToHeap(itemData); return TRUE; - } - else if (CanItemModFriendship(pokemon, itemData) == TRUE) - { + } else if (CanItemModFriendship(pokemon, itemData) == TRUE) { FreeToHeap(itemData); return TRUE; } @@ -266,14 +202,12 @@ BOOL CanUseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveId, HeapI return FALSE; } -BOOL CanUseItemOnMonInParty(struct Party * party, u16 itemId, s32 partyIdx, s32 moveIdx, HeapID heapId) -{ - struct Pokemon * pokemon = Party_GetMonByIndex(party, partyIdx); +BOOL CanUseItemOnMonInParty(struct Party *party, u16 itemId, s32 partyIdx, s32 moveIdx, HeapID heapId) { + struct Pokemon *pokemon = Party_GetMonByIndex(party, partyIdx); return CanUseItemOnPokemon(pokemon, itemId, moveIdx, heapId); } -BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 location, HeapID heapId) -{ +BOOL UseItemOnPokemon(struct Pokemon *pokemon, u16 itemId, s32 moveIdx, u16 location, HeapID heapId) { s32 stack_data[8]; #define sp6C stack_data[7] #define sp68 stack_data[6] @@ -286,43 +220,36 @@ BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 loc BOOL hadEffect; BOOL effectFound; - struct ItemData * itemData = LoadItemDataOrGfx(itemId, ITEMDATA_DATA, heapId); - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PARTY_USE) != 1) - { + struct ItemData *itemData = LoadItemDataOrGfx(itemId, ITEMDATA_DATA, heapId); + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PARTY_USE) != 1) { FreeToHeap(itemData); return FALSE; } - hadEffect = FALSE; + hadEffect = FALSE; effectFound = FALSE; { sp54 = sp50 = (int)GetMonData(pokemon, MON_DATA_STATUS, NULL); - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SLP_HEAL)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SLP_HEAL)) { sp54 &= ~MON_STATUS_SLP_MASK; effectFound = TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PSN_HEAL)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PSN_HEAL)) { sp54 &= ~(MON_STATUS_PSN_MASK | MON_STATUS_TOX_MASK | 0xF00); effectFound = TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_BRN_HEAL)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_BRN_HEAL)) { sp54 &= ~MON_STATUS_BRN_MASK; effectFound = TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRZ_HEAL)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRZ_HEAL)) { sp54 &= ~MON_STATUS_FRZ_MASK; effectFound = TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PRZ_HEAL)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PRZ_HEAL)) { sp54 &= ~MON_STATUS_PRZ_MASK; effectFound = TRUE; } - if (sp50 != sp54) - { + if (sp50 != sp54) { SetMonData(pokemon, MON_DATA_STATUS, &sp54); hadEffect = TRUE; } @@ -330,33 +257,25 @@ BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 loc { sp50 = (int)GetMonData(pokemon, MON_DATA_HP, NULL); sp54 = (int)GetMonData(pokemon, MON_DATA_MAXHP, NULL); - if ((GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE) || GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE_ALL)) && GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP)) - { - if (sp50 == 0) - { + if ((GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE) || GetItemAttr_PreloadedItemData(itemData, ITEMATTR_REVIVE_ALL)) && GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP)) { + if (sp50 == 0) { RestoreMonHPBy(pokemon, (u32)sp50, (u32)sp54, GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_RESTORE_PARAM)); hadEffect = TRUE; } effectFound = TRUE; - } - else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_RESTORE)) - { - if (sp50 < sp54) - { + } else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_RESTORE)) { + if (sp50 < sp54) { RestoreMonHPBy(pokemon, (u32)sp50, (u32)sp54, GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_RESTORE_PARAM)); hadEffect = TRUE; } effectFound = TRUE; } sp58 = (s32)GetMonData(pokemon, MON_DATA_LEVEL, NULL); - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP)) - { - if (sp58 < MAX_LEVEL) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP)) { + if (sp58 < MAX_LEVEL) { AddMonData(pokemon, MON_DATA_EXPERIENCE, (int)CalcMonExpToNextLevel(pokemon)); CalcMonLevelAndStats(pokemon); - if (sp50 == 0) - { + if (sp50 == 0) { sp5C = (s32)GetMonData(pokemon, MON_DATA_MAXHP, NULL); RestoreMonHPBy(pokemon, (u32)sp50, (u32)sp5C, (u32)(sp5C - sp54)); } @@ -365,33 +284,31 @@ BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 loc effectFound = TRUE; } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_EVOLVE)) + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_EVOLVE)) { effectFound = TRUE; - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_UP)) - { - if (BoostMonMovePpUpBy(pokemon, moveIdx, 1) == TRUE) + } + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_UP)) { + if (BoostMonMovePpUpBy(pokemon, moveIdx, 1) == TRUE) { hadEffect = TRUE; + } effectFound = TRUE; - } - else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_MAX)) - { - if (BoostMonMovePpUpBy(pokemon, moveIdx, 3) == TRUE) + } else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_MAX)) { + if (BoostMonMovePpUpBy(pokemon, moveIdx, 3) == TRUE) { hadEffect = TRUE; + } effectFound = TRUE; } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE)) - { - if (MonMoveRestorePP(pokemon, moveIdx, (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_PARAM)) == 1) + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE)) { + if (MonMoveRestorePP(pokemon, moveIdx, (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_PARAM)) == 1) { hadEffect = TRUE; + } effectFound = TRUE; - } - else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_ALL)) - { + } else if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_ALL)) { sp50 = 0; - for (; sp50 < MAX_MON_MOVES; sp50++) - { - if (MonMoveRestorePP(pokemon, sp50, (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_PARAM)) == 1) + for (; sp50 < MAX_MON_MOVES; sp50++) { + if (MonMoveRestorePP(pokemon, sp50, (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_PP_RESTORE_PARAM)) == 1) { hadEffect = TRUE; + } } effectFound = TRUE; } @@ -402,120 +319,105 @@ BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 loc sp5C = (s32)GetMonData(pokemon, MON_DATA_SPEED_EV, NULL); sp60 = (s32)GetMonData(pokemon, MON_DATA_SPATK_EV, NULL); sp64 = (s32)GetMonData(pokemon, MON_DATA_SPDEF_EV, NULL); - if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_SHEDINJA &&GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_EV_UP)) - { + if (GetMonData(pokemon, MON_DATA_SPECIES, NULL) != SPECIES_SHEDINJA && GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_EV_UP)) { sp6C = (int)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_HP_EV_UP_PARAM); sp68 = TryModEV(sp50, sp54 + sp58 + sp5C + sp60 + sp64, sp6C); - if (sp68 != -1) - { + if (sp68 != -1) { sp50 = sp68; SetMonData(pokemon, MON_DATA_HP_EV, &sp50); CalcMonLevelAndStats(pokemon); hadEffect = TRUE; } - if (sp6C > 0) + if (sp6C > 0) { effectFound = TRUE; + } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_ATK_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_ATK_EV_UP)) { sp6C = (int)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_ATK_EV_UP_PARAM); sp68 = TryModEV(sp54, sp50 + sp58 + sp5C + sp60 + sp64, sp6C); - if (sp68 != -1) - { + if (sp68 != -1) { sp54 = sp68; SetMonData(pokemon, MON_DATA_ATK_EV, &sp54); CalcMonLevelAndStats(pokemon); hadEffect = TRUE; } - if (sp6C > 0) + if (sp6C > 0) { effectFound = TRUE; + } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_DEF_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_DEF_EV_UP)) { sp6C = (int)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_DEF_EV_UP_PARAM); sp68 = TryModEV(sp58, sp50 + sp54 + sp5C + sp60 + sp64, sp6C); - if (sp68 != -1) - { + if (sp68 != -1) { sp58 = sp68; SetMonData(pokemon, MON_DATA_DEF_EV, &sp58); CalcMonLevelAndStats(pokemon); hadEffect = TRUE; } - if (sp6C > 0) + if (sp6C > 0) { effectFound = TRUE; + } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPEED_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPEED_EV_UP)) { sp6C = (int)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPEED_EV_UP_PARAM); sp68 = TryModEV(sp5C, sp50 + sp54 + sp58 + sp60 + sp64, sp6C); - if (sp68 != -1) - { + if (sp68 != -1) { sp5C = sp68; SetMonData(pokemon, MON_DATA_SPEED_EV, &sp5C); CalcMonLevelAndStats(pokemon); hadEffect = TRUE; } - if (sp6C > 0) + if (sp6C > 0) { effectFound = TRUE; + } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPATK_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPATK_EV_UP)) { sp6C = (int)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPATK_EV_UP_PARAM); sp68 = TryModEV(sp60, sp50 + sp54 + sp58 + sp5C + sp64, sp6C); - if (sp68 != -1) - { + if (sp68 != -1) { sp60 = sp68; SetMonData(pokemon, MON_DATA_SPATK_EV, &sp60); CalcMonLevelAndStats(pokemon); hadEffect = TRUE; } - if (sp6C > 0) + if (sp6C > 0) { effectFound = TRUE; + } } - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPDEF_EV_UP)) - { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPDEF_EV_UP)) { sp6C = (int)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_SPDEF_EV_UP_PARAM); sp68 = TryModEV(sp64, sp50 + sp54 + sp58 + sp5C + sp60, sp6C); - if (sp68 != -1) - { + if (sp68 != -1) { sp64 = sp68; SetMonData(pokemon, MON_DATA_SPDEF_EV, &sp64); CalcMonLevelAndStats(pokemon); hadEffect = TRUE; } - if (sp6C > 0) + if (sp6C > 0) { effectFound = TRUE; + } } } - if (hadEffect == FALSE && effectFound == TRUE) - { + if (hadEffect == FALSE && effectFound == TRUE) { FreeToHeap(itemData); return FALSE; } { sp50 = (s32)GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL); - if (sp50 < 100) - { - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_LO)) - { + if (sp50 < 100) { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_LO)) { DoItemFriendshipMod(pokemon, sp50, (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_LO_PARAM), location, heapId); FreeToHeap(itemData); return hadEffect; } - } - else if (sp50 >= 100 && sp50 < 200) - { - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_MED)) - { + } else if (sp50 >= 100 && sp50 < 200) { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_MED)) { DoItemFriendshipMod(pokemon, sp50, (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_MED_PARAM), location, heapId); FreeToHeap(itemData); return hadEffect; } - } - else if (sp50 >= 200 && sp50 <= 255) - { - if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_HI)) - { + } else if (sp50 >= 200 && sp50 <= 255) { + if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_HI)) { DoItemFriendshipMod(pokemon, sp50, (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_HI_PARAM), location, heapId); FreeToHeap(itemData); return hadEffect; @@ -534,24 +436,22 @@ BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 loc #undef sp54 #undef sp50 -BOOL UseItemOnMonInParty(struct Party * party, u16 itemId, s32 partyIdx, s32 moveIdx, u16 location, HeapID heapId) -{ - struct Pokemon * pokemon = Party_GetMonByIndex(party, partyIdx); +BOOL UseItemOnMonInParty(struct Party *party, u16 itemId, s32 partyIdx, s32 moveIdx, u16 location, HeapID heapId) { + struct Pokemon *pokemon = Party_GetMonByIndex(party, partyIdx); return UseItemOnPokemon(pokemon, itemId, moveIdx, location, heapId); } -u8 MonMoveCanRestorePP(struct Pokemon * pokemon, s32 moveIdx) -{ +u8 MonMoveCanRestorePP(struct Pokemon *pokemon, s32 moveIdx) { u16 move_id = (u16)GetMonData(pokemon, MON_DATA_MOVE1 + moveIdx, NULL); - if (move_id == MOVE_NONE) + if (move_id == MOVE_NONE) { return FALSE; - u8 pp = (u8)GetMonData(pokemon, MON_DATA_MOVE1PP + moveIdx, NULL); + } + u8 pp = (u8)GetMonData(pokemon, MON_DATA_MOVE1PP + moveIdx, NULL); u8 ppUp = (u8)GetMonData(pokemon, MON_DATA_MOVE1PPUP + moveIdx, NULL); return (u8)(pp < WazaGetMaxPp(move_id, ppUp)); } -BOOL MonMoveRestorePP(struct Pokemon * pokemon, s32 moveIdx, s32 ppRestore) -{ +BOOL MonMoveRestorePP(struct Pokemon *pokemon, s32 moveIdx, s32 ppRestore) { u16 move_id; u8 pp; u8 maxPp; @@ -559,21 +459,21 @@ BOOL MonMoveRestorePP(struct Pokemon * pokemon, s32 moveIdx, s32 ppRestore) s32 ppUpAttr; move_id = (u16)GetMonData(pokemon, MON_DATA_MOVE1 + moveIdx, NULL); - if (move_id == MOVE_NONE) + if (move_id == MOVE_NONE) { return FALSE; - ppAttr = MON_DATA_MOVE1PP + moveIdx; - pp = (u8)GetMonData(pokemon, ppAttr, NULL); + } + ppAttr = MON_DATA_MOVE1PP + moveIdx; + pp = (u8)GetMonData(pokemon, ppAttr, NULL); ppUpAttr = MON_DATA_MOVE1PPUP + moveIdx; - maxPp = WazaGetMaxPp(move_id, (u8)GetMonData(pokemon, ppUpAttr, NULL)); - if (pp < maxPp) - { - if (ppRestore == PP_RESTORE_ALL) + maxPp = WazaGetMaxPp(move_id, (u8)GetMonData(pokemon, ppUpAttr, NULL)); + if (pp < maxPp) { + if (ppRestore == PP_RESTORE_ALL) { pp = maxPp; - else - { + } else { pp += ppRestore; - if (pp > maxPp) + if (pp > maxPp) { pp = maxPp; + } } SetMonData(pokemon, ppAttr, &pp); return TRUE; @@ -581,136 +481,142 @@ BOOL MonMoveRestorePP(struct Pokemon * pokemon, s32 moveIdx, s32 ppRestore) return FALSE; } -BOOL BoostMonMovePpUpBy(struct Pokemon * pokemon, s32 moveIdx, u32 nPpUp) -{ +BOOL BoostMonMovePpUpBy(struct Pokemon *pokemon, s32 moveIdx, u32 nPpUp) { u16 move; u8 pp, ppUp, maxPp, newMaxPp; s32 ppUpAttr; s32 ppAttr; ppUpAttr = MON_DATA_MOVE1PPUP + moveIdx; - ppUp = (u8)GetMonData(pokemon, ppUpAttr, NULL); - if (ppUp == 3) + ppUp = (u8)GetMonData(pokemon, ppUpAttr, NULL); + if (ppUp == 3) { return FALSE; + } move = (u16)GetMonData(pokemon, MON_DATA_MOVE1 + moveIdx, NULL); - if (WazaGetMaxPp(move, 0) < 5) + if (WazaGetMaxPp(move, 0) < 5) { return FALSE; + } ppAttr = MON_DATA_MOVE1PP + moveIdx; - pp = (u8)GetMonData(pokemon, ppAttr, NULL); - maxPp = WazaGetMaxPp(move, ppUp); - if (ppUp + nPpUp > 3) + pp = (u8)GetMonData(pokemon, ppAttr, NULL); + maxPp = WazaGetMaxPp(move, ppUp); + if (ppUp + nPpUp > 3) { ppUp = 3; - else + } else { ppUp = (u8)(ppUp + nPpUp); + } newMaxPp = WazaGetMaxPp(move, ppUp); - pp = (u8)(pp + newMaxPp - maxPp); + pp = (u8)(pp + newMaxPp - maxPp); SetMonData(pokemon, ppUpAttr, &ppUp); SetMonData(pokemon, ppAttr, &pp); return TRUE; } -void RestoreMonHPBy(struct Pokemon * pokemon, u32 hp, u32 maxHp, u32 restoration) -{ - if (maxHp == 1) +void RestoreMonHPBy(struct Pokemon *pokemon, u32 hp, u32 maxHp, u32 restoration) { + if (maxHp == 1) { restoration = 1; - else if (restoration == HP_RESTORE_ALL) + } else if (restoration == HP_RESTORE_ALL) { restoration = maxHp; - else if (restoration == HP_RESTORE_HALF) + } else if (restoration == HP_RESTORE_HALF) { restoration = maxHp / 2; - else if (restoration == HP_RESTORE_QTR) + } else if (restoration == HP_RESTORE_QTR) { restoration = maxHp / 4; - if (hp + restoration > maxHp) + } + if (hp + restoration > maxHp) { hp = maxHp; - else + } else { hp = hp + restoration; + } SetMonData(pokemon, MON_DATA_HP, &hp); } -s32 TryModEV(s32 ev, s32 evSum, s32 by) -{ - if (ev == 0 && by < 0) +s32 TryModEV(s32 ev, s32 evSum, s32 by) { + if (ev == 0 && by < 0) { return -1; - if (ev >= MAX_EV && by > 0) + } + if (ev >= MAX_EV && by > 0) { return -1; - if (ev + evSum >= MAX_EV_SUM && by > 0) + } + if (ev + evSum >= MAX_EV_SUM && by > 0) { return -1; + } ev += by; - if (ev > MAX_EV) + if (ev > MAX_EV) { ev = MAX_EV; - else if (ev < 0) + } else if (ev < 0) { ev = 0; - if (ev + evSum > MAX_EV_SUM) + } + if (ev + evSum > MAX_EV_SUM) { ev = MAX_EV_SUM - evSum; + } return ev; } -BOOL CanItemModFriendship(struct Pokemon * pokemon, struct ItemData * itemData) -{ +BOOL CanItemModFriendship(struct Pokemon *pokemon, struct ItemData *itemData) { s32 friendship = (s32)GetMonData(pokemon, MON_DATA_FRIENDSHIP, NULL); - if (friendship >= 255) + if (friendship >= 255) { return FALSE; - if (friendship < 100) - { - return (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_LO) && (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_LO_PARAM) > 0); } - if (friendship >= 100 && friendship < 200) - { - return (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_MED) && (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_MED_PARAM) > 0); + if (friendship < 100) { + return GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_LO) && (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_LO_PARAM) > 0; } - if (friendship >= 200 && friendship < 255) - { - return (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_HI) && (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_HI_PARAM) > 0); + if (friendship >= 100 && friendship < 200) { + return GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_MED) && (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_MED_PARAM) > 0; + } + if (friendship >= 200 && friendship < 255) { + return GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_HI) && (s32)GetItemAttr_PreloadedItemData(itemData, ITEMATTR_FRIENDSHIP_MOD_HI_PARAM) > 0; } return FALSE; } -BOOL DoItemFriendshipMod(struct Pokemon * pokemon, s32 friendship, s32 mod, u16 location, HeapID heapId) -{ - if (friendship == 255 && mod > 0) +BOOL DoItemFriendshipMod(struct Pokemon *pokemon, s32 friendship, s32 mod, u16 location, HeapID heapId) { + if (friendship == 255 && mod > 0) { return FALSE; - if (friendship == 0 && mod < 0) + } + if (friendship == 0 && mod < 0) { return FALSE; - if (mod > 0) - { - if (GetItemAttr((u16)GetMonData(pokemon, MON_DATA_HELD_ITEM, NULL), ITEMATTR_HOLD_EFFECT, heapId) == HOLD_EFFECT_FRIENDSHIP_UP) + } + if (mod > 0) { + if (GetItemAttr((u16)GetMonData(pokemon, MON_DATA_HELD_ITEM, NULL), ITEMATTR_HOLD_EFFECT, heapId) == HOLD_EFFECT_FRIENDSHIP_UP) { mod = mod * 150 / 100; - if (GetMonData(pokemon, MON_DATA_POKEBALL, NULL) == ITEM_LUXURY_BALL) + } + if (GetMonData(pokemon, MON_DATA_POKEBALL, NULL) == ITEM_LUXURY_BALL) { mod++; - if (location == GetMonData(pokemon, MON_DATA_EGG_MET_LOCATION, NULL)) + } + if (location == GetMonData(pokemon, MON_DATA_EGG_MET_LOCATION, NULL)) { mod++; + } } mod += friendship; - if (mod > 255) + if (mod > 255) { mod = 255; - if (mod < 0) + } + if (mod < 0) { mod = 0; + } SetMonData(pokemon, MON_DATA_FRIENDSHIP, &mod); return TRUE; } -void HealParty(struct Party * party) -{ +void HealParty(struct Party *party) { u32 sp8; s32 nmons; s32 i; s32 j; nmons = Party_GetCount(party); - for (i = 0; i < nmons; i++) - { - struct Pokemon * pokemon = Party_GetMonByIndex(party, i); - if (GetMonData(pokemon, MON_DATA_SPECIES_EXISTS, NULL)) - { + for (i = 0; i < nmons; i++) { + struct Pokemon *pokemon = Party_GetMonByIndex(party, i); + if (GetMonData(pokemon, MON_DATA_SPECIES_EXISTS, NULL)) { sp8 = GetMonData(pokemon, MON_DATA_MAXHP, NULL); SetMonData(pokemon, MON_DATA_HP, &sp8); sp8 = 0; SetMonData(pokemon, MON_DATA_STATUS, &sp8); - for (j = 0; j < MAX_MON_MOVES; j++) - { - if (MonMoveCanRestorePP(pokemon, j) == 1) + for (j = 0; j < MAX_MON_MOVES; j++) { + if (MonMoveCanRestorePP(pokemon, j) == 1) { MonMoveRestorePP(pokemon, j, PP_RESTORE_ALL); + } } } } diff --git a/arm9/src/waza.c b/arm9/src/waza.c index 8dfb620dc..75a9d8eb2 100644 --- a/arm9/src/waza.c +++ b/arm9/src/waza.c @@ -1,40 +1,38 @@ // TODO: RENAME FILE - WE SHOULD NOT BE USING WAZA #include "global.h" -#include "move_data.h" -#include "filesystem.h" + #include "constants/moves.h" -void LoadWazaEntry(u16 waza, struct WazaTbl * dest); +#include "filesystem.h" +#include "move_data.h" + +void LoadWazaEntry(u16 waza, struct WazaTbl *dest); // Effectively reads the entirety of the waza_tbl.narc file image. // Even though each "file" is only 16 bytes, they are arranged // contiguously and in the correct order. -void LoadAllWazaTbl(struct WazaTbl * dest) -{ +void LoadAllWazaTbl(struct WazaTbl *dest) { ReadFromNarcMemberByIdPair(dest, NARC_POKETOOL_WAZA_WAZA_TBL, 0, 0, (NUM_MOVES + 1) * sizeof(struct WazaTbl)); } -u32 GetWazaAttr(u16 waza, MoveAttr attr) -{ +u32 GetWazaAttr(u16 waza, MoveAttr attr) { struct WazaTbl wazaTbl; LoadWazaEntry(waza, &wazaTbl); return GetAttrFromWazaTbl(&wazaTbl, attr); } -u8 WazaGetMaxPp(u16 waza, u8 ppUp) -{ +u8 WazaGetMaxPp(u16 waza, u8 ppUp) { u8 pp; - if (ppUp > 3) + if (ppUp > 3) { ppUp = 3; + } pp = (u8)GetWazaAttr(waza, MOVEATTR_PP); return (u8)(pp + (pp * 20 * ppUp) / 100); } -u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, MoveAttr attr) -{ - switch (attr) - { +u32 GetAttrFromWazaTbl(struct WazaTbl *wazaTbl, MoveAttr attr) { + switch (attr) { case MOVEATTR_EFFECT: return wazaTbl->effect; case MOVEATTR_CLASS: @@ -64,7 +62,6 @@ u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, MoveAttr attr) } } -void LoadWazaEntry(u16 waza, struct WazaTbl * wazaTbl) -{ +void LoadWazaEntry(u16 waza, struct WazaTbl *wazaTbl) { ReadWholeNarcMemberByIdPair(wazaTbl, NARC_POKETOOL_WAZA_WAZA_TBL, waza); } diff --git a/arm9/src/wfc_user_info_warning.c b/arm9/src/wfc_user_info_warning.c index 3900748e6..36a48c92d 100644 --- a/arm9/src/wfc_user_info_warning.c +++ b/arm9/src/wfc_user_info_warning.c @@ -1,72 +1,75 @@ +#include "wfc_user_info_warning.h" + #include "global.h" -#include "bg_window.h" + #include "constants/rgb.h" + +#include "msgdata/msg.naix" +#include "msgdata/msg/narc_0613.h" + +#include "PAD_pad.h" +#include "bg_window.h" +#include "brightness.h" #include "filesystem.h" #include "font.h" #include "game_init.h" #include "gf_gfx_planes.h" #include "main.h" #include "msgdata.h" -#include "msgdata/msg.naix" -#include "msgdata/msg/narc_0613.h" -#include "PAD_pad.h" +#include "render_window.h" #include "string16.h" #include "text.h" -#include "wfc_user_info_warning.h" -#include "brightness.h" -#include "render_window.h" extern void SetMasterBrightnessNeutral(BOOL set_brightness_on_bottom_screen); extern void sub_0200E3A0(BOOL set_brightness_on_bottom_screen, s32); static const struct WindowTemplate sWFCWarningMsgWindowTemplate = { - .bgId = GF_BG_LYR_MAIN_0, - .left = 3, - .top = 3, - .width = 26, - .height = 18, - .palette = 1, + .bgId = GF_BG_LYR_MAIN_0, + .left = 3, + .top = 3, + .width = 26, + .height = 18, + .palette = 1, .baseTile = 0x23, }; static const struct GraphicsModes sWFCWarningMsgGraphicsModes = { - .dispMode = GX_DISPMODE_GRAPHICS, - .bgMode = GX_BGMODE_0, - .subMode = GX_BGMODE_0, + .dispMode = GX_DISPMODE_GRAPHICS, + .bgMode = GX_BGMODE_0, + .subMode = GX_BGMODE_0, ._2d3dMode = GX_BG0_AS_2D, }; static const struct BgTemplate sWFCWarningMsgBgTemplate = { - .x = 0, - .y = 0, + .x = 0, + .y = 0, .bufferSize = 0x800, - .baseTile = 0, - .size = GF_BG_SCR_SIZE_256x256, - .colorMode = GX_BG_COLORMODE_16, + .baseTile = 0, + .size = GF_BG_SCR_SIZE_256x256, + .colorMode = GX_BG_COLORMODE_16, .screenBase = GX_BG_SCRBASE_0x0000, - .charBase = GX_BG_CHARBASE_0x18000, - .bgExtPltt = GX_BG_EXTPLTT_01, - .priority = 1, - .areaOver = GX_BG_AREAOVER_XLU, - .dummy = 0, - .mosaic = FALSE, + .charBase = GX_BG_CHARBASE_0x18000, + .bgExtPltt = GX_BG_EXTPLTT_01, + .priority = 1, + .areaOver = GX_BG_AREAOVER_XLU, + .dummy = 0, + .mosaic = FALSE, }; static const struct GraphicsBanks sWFCWarningMsgGraphicsBanks = { - .bg = GX_VRAM_BG_256_AB, - .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, - .subbg = GX_VRAM_SUB_BG_NONE, - .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, - .obj = GX_VRAM_OBJ_NONE, - .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, - .subobj = GX_VRAM_SUB_OBJ_NONE, + .bg = GX_VRAM_BG_256_AB, + .bgextpltt = GX_VRAM_BGEXTPLTT_NONE, + .subbg = GX_VRAM_SUB_BG_NONE, + .subbgextpltt = GX_VRAM_SUB_BGEXTPLTT_NONE, + .obj = GX_VRAM_OBJ_NONE, + .objextpltt = GX_VRAM_OBJEXTPLTT_NONE, + .subobj = GX_VRAM_SUB_OBJ_NONE, .subobjextpltt = GX_VRAM_SUB_OBJEXTPLTT_NONE, - .tex = GX_VRAM_TEX_NONE, - .texpltt = GX_VRAM_TEXPLTT_NONE, + .tex = GX_VRAM_TEX_NONE, + .texpltt = GX_VRAM_TEXPLTT_NONE, }; -void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) -{ +void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) { #pragma unused(a1) struct Window window; @@ -93,7 +96,7 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) GXS_SetVisibleWnd(0); GfGfx_SetBanks(&sWFCWarningMsgGraphicsBanks); - struct BgConfig* bg_config = BgConfig_Alloc(heapId); + struct BgConfig *bg_config = BgConfig_Alloc(heapId); SetBothScreensModesAndDisable(&sWFCWarningMsgGraphicsModes); @@ -105,8 +108,8 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) BG_SetMaskColor(GF_BG_LYR_MAIN_0, RGB(1, 1, 27)); BG_SetMaskColor(GF_BG_LYR_SUB_0, RGB(1, 1, 27)); - struct MsgData* warning_messages_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0613_bin, heapId); - struct String* warning_message = String_New(384, heapId); + struct MsgData *warning_messages_data = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, NARC_msg_narc_0613_bin, heapId); + struct String *warning_message = String_New(384, heapId); ResetAllTextPrinters(); AddWindow(bg_config, &window, &sWFCWarningMsgWindowTemplate); FillWindowPixelRect(&window, 0xF, 0, 0, 208, 144); @@ -121,14 +124,12 @@ void ShowWFCUserInfoWarning(HeapID heapId, u32 a1) SetMasterBrightnessNeutral(PM_LCD_BOTTOM); SetBlendBrightness(0, (GXBlendPlaneMask)(GX_BLEND_PLANEMASK_BD | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG0), SCREEN_MASK_MAIN | SCREEN_MASK_SUB); - while (TRUE) - { + while (TRUE) { u16 pressed_buttons = PAD_Read(); HandleDSLidAction(); - if (pressed_buttons & PAD_BUTTON_A) - { + if (pressed_buttons & PAD_BUTTON_A) { break; } diff --git a/format.sh b/format.sh new file mode 100644 index 000000000..f1251321c --- /dev/null +++ b/format.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +find arm9 include -not \( -path arm9/lib -prune \) -not \( -path include/nitro -prune \) \( -name "*.c" -or -name "*.cpp" -or -name "*.h" -or -name "*.hpp" \) -exec clang-format -i --verbose {} + diff --git a/include/ascii_util.h b/include/ascii_util.h index 78175f86b..ec25ed975 100644 --- a/include/ascii_util.h +++ b/include/ascii_util.h @@ -3,6 +3,8 @@ #include "nitro/types.h" +#include "NNS_G3D_res_struct.h" + s32 Ascii_StrLen(const s8 *str); const s8 *Ascii_GetDelim(const s8 *src, s8 *dst, s32 c); s32 Ascii_StrToL(const s8 *str); diff --git a/include/bag.h b/include/bag.h index 6115792da..be8c725d0 100644 --- a/include/bag.h +++ b/include/bag.h @@ -33,8 +33,8 @@ BOOL Bag_PocketNotEmpty(Bag *bag, u32 pocket); u16 Bag_GetQuantity(Bag *bag, u16 itemId, HeapID heapId); u16 Pocket_GetQuantity(ItemSlot *slots, u32 count, u16 itemId); void SortPocket(ItemSlot *slots, u32 count); -BagView * Bag_CreateView(Bag *bag, const u8 *pockets, HeapID heapId); +BagView *Bag_CreateView(Bag *bag, const u8 *pockets, HeapID heapId); ItemSlot *Bag_GetPocketSlotN(Bag *bag, u8 pocket, u32 slot); Bag *Save_Bag_Get(SaveData *saveData); -#endif //POKEDIAMOND_BAG_H +#endif // POKEDIAMOND_BAG_H diff --git a/include/bag_cursor.h b/include/bag_cursor.h index a754ef9ec..37567fde6 100644 --- a/include/bag_cursor.h +++ b/include/bag_cursor.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_BAG_CURSOR_H #include "global.h" + #include "heap.h" typedef struct BagCursorField { diff --git a/include/bag_view.h b/include/bag_view.h index c1c168c9b..02c2c1bd2 100644 --- a/include/bag_view.h +++ b/include/bag_view.h @@ -10,12 +10,11 @@ enum ItemUseError { ITEMUSEERROR_OKAY = 0, // no error ITEMUSEERROR_NODISMOUNT = 1, // can't get off bike ITEMUSEERROR_NOFOLLOWER = 2, // have a companion - - ITEMUSEERROR_OAKSWORDS = -1u, + + ITEMUSEERROR_OAKSWORDS = -1u, }; -typedef struct BagViewPocket -{ +typedef struct BagViewPocket { ItemSlot *slot; u8 padding[0x4]; u8 pocket; diff --git a/include/battle_setup.h b/include/battle_setup.h index 53dee0a29..c4f8c22a0 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_BATTLE_SETUP_H #include "global.h" + #include "party.h" #include "trainer_data.h" @@ -31,4 +32,4 @@ struct BattleSetup { u32 unk18C; }; -#endif //POKEDIAMOND_BATTLE_SETUP_H \ No newline at end of file +#endif // POKEDIAMOND_BATTLE_SETUP_H diff --git a/include/bg_window.h b/include/bg_window.h index 0e47b74a4..b94f9a380 100644 --- a/include/bg_window.h +++ b/include/bg_window.h @@ -1,11 +1,12 @@ #ifndef POKEDIAMOND_BG_WINDOW_H #define POKEDIAMOND_BG_WINDOW_H -#include "NNS_g2d.h" #include "global.h" -#include "gf_gfx_planes.h" + #include "MI_uncompress.h" +#include "NNS_g2d.h" #include "OS_cache.h" +#include "gf_gfx_planes.h" #include "gx.h" #include "heap.h" #include "math_util.h" @@ -78,7 +79,7 @@ typedef struct Window { u8 width; u8 height; u8 paletteNum; - u16 baseTile : 15; + u16 baseTile : 15; u16 colorMode : 1; void *pixelBuffer; } Window; @@ -102,20 +103,20 @@ enum GFBgLayer { GF_BG_LYR_SUB_1, GF_BG_LYR_SUB_2, GF_BG_LYR_SUB_3, - GF_BG_LYR_MAIN_CNT = 4, - GF_BG_LYR_SUB_CNT = 4, + GF_BG_LYR_MAIN_CNT = 4, + GF_BG_LYR_SUB_CNT = 4, GF_BG_LYR_MAIN_FIRST = GF_BG_LYR_MAIN_0, - GF_BG_LYR_SUB_FIRST = GF_BG_LYR_SUB_0, - GF_BG_LYR_MAX = 8, + GF_BG_LYR_SUB_FIRST = GF_BG_LYR_SUB_0, + GF_BG_LYR_MAX = 8, GF_BG_LYR_MAIN_0_F = 1 << (GF_BG_LYR_MAIN_0 - GF_BG_LYR_MAIN_FIRST), GF_BG_LYR_MAIN_1_F = 1 << (GF_BG_LYR_MAIN_1 - GF_BG_LYR_MAIN_FIRST), GF_BG_LYR_MAIN_2_F = 1 << (GF_BG_LYR_MAIN_2 - GF_BG_LYR_MAIN_FIRST), GF_BG_LYR_MAIN_3_F = 1 << (GF_BG_LYR_MAIN_3 - GF_BG_LYR_MAIN_FIRST), - GF_BG_LYR_SUB_0_F = 1 << (GF_BG_LYR_SUB_0 - GF_BG_LYR_SUB_FIRST), - GF_BG_LYR_SUB_1_F = 1 << (GF_BG_LYR_SUB_1 - GF_BG_LYR_SUB_FIRST), - GF_BG_LYR_SUB_2_F = 1 << (GF_BG_LYR_SUB_2 - GF_BG_LYR_SUB_FIRST), - GF_BG_LYR_SUB_3_F = 1 << (GF_BG_LYR_SUB_3 - GF_BG_LYR_SUB_FIRST), + GF_BG_LYR_SUB_0_F = 1 << (GF_BG_LYR_SUB_0 - GF_BG_LYR_SUB_FIRST), + GF_BG_LYR_SUB_1_F = 1 << (GF_BG_LYR_SUB_1 - GF_BG_LYR_SUB_FIRST), + GF_BG_LYR_SUB_2_F = 1 << (GF_BG_LYR_SUB_2 - GF_BG_LYR_SUB_FIRST), + GF_BG_LYR_SUB_3_F = 1 << (GF_BG_LYR_SUB_3 - GF_BG_LYR_SUB_FIRST), GF_BG_LYR_UNALLOC = 0xFF, }; @@ -132,16 +133,16 @@ enum GFPalLoadLocation { }; enum GFPalSlotOffset { - GF_PAL_SLOT_0_OFFSET = 0x00, - GF_PAL_SLOT_1_OFFSET = 0x20, - GF_PAL_SLOT_2_OFFSET = 0x40, - GF_PAL_SLOT_3_OFFSET = 0x60, - GF_PAL_SLOT_4_OFFSET = 0x80, - GF_PAL_SLOT_5_OFFSET = 0xA0, - GF_PAL_SLOT_6_OFFSET = 0xC0, - GF_PAL_SLOT_7_OFFSET = 0xE0, - GF_PAL_SLOT_8_OFFSET = 0x100, - GF_PAL_SLOT_9_OFFSET = 0x120, + GF_PAL_SLOT_0_OFFSET = 0x00, + GF_PAL_SLOT_1_OFFSET = 0x20, + GF_PAL_SLOT_2_OFFSET = 0x40, + GF_PAL_SLOT_3_OFFSET = 0x60, + GF_PAL_SLOT_4_OFFSET = 0x80, + GF_PAL_SLOT_5_OFFSET = 0xA0, + GF_PAL_SLOT_6_OFFSET = 0xC0, + GF_PAL_SLOT_7_OFFSET = 0xE0, + GF_PAL_SLOT_8_OFFSET = 0x100, + GF_PAL_SLOT_9_OFFSET = 0x120, GF_PAL_SLOT_10_OFFSET = 0x140, GF_PAL_SLOT_11_OFFSET = 0x160, GF_PAL_SLOT_12_OFFSET = 0x180, @@ -198,12 +199,12 @@ enum { TILE_SIZE_8BPP = 64, }; -#define TILEMAP_COPY_SRC_FLAT 0 // Source dimensions are equal to dest dimensions -#define TILEMAP_COPY_SRC_RECT 1 // Dest dimensions carve out a window from source +#define TILEMAP_COPY_SRC_FLAT 0 // Source dimensions are equal to dest dimensions +#define TILEMAP_COPY_SRC_RECT 1 // Dest dimensions carve out a window from source // Passed to FillBgTilemapRect(Text) mode arg. 0-15 = palette selection. 16,17 as defined. -#define TILEMAP_FILL_KEEP_PAL 16 // Do not replace the selected palette index -#define TILEMAP_FILL_OVWT_PAL 17 // Fill value includes palette +#define TILEMAP_FILL_KEEP_PAL 16 // Do not replace the selected palette index +#define TILEMAP_FILL_OVWT_PAL 17 // Fill value includes palette BgConfig *BgConfig_Alloc(HeapID heapId); HeapID BgConfig_GetHeapId(BgConfig *bgConfig); diff --git a/include/blackout.h b/include/blackout.h index 2c04e86f3..7ca9a1db8 100644 --- a/include/blackout.h +++ b/include/blackout.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_BLACKOUT_H #include "global.h" + #include "field_system.h" #include "message_format.h" #include "msgdata.h" @@ -19,4 +20,4 @@ typedef struct BlackoutScreenEnvironment { BOOL Task_Blackout(TaskManager *taskManager); void CallTask_Blackout(TaskManager *taskManager); -#endif //POKEDIAMOND_BLACKOUT_H +#endif // POKEDIAMOND_BLACKOUT_H diff --git a/include/brightness.h b/include/brightness.h index 8612be4bd..d685ddde2 100644 --- a/include/brightness.h +++ b/include/brightness.h @@ -1,9 +1,11 @@ #ifndef POKEDIAMOND_BRIGHTNESS_H #define POKEDIAMOND_BRIGHTNESS_H +#include "nitro/FX_types.h" + #include "global.h" + #include "GX_g2.h" -#include "nitro/FX_types.h" #define SCREEN_MASK_MAIN 1 #define SCREEN_MASK_SUB 2 diff --git a/include/camera.h b/include/camera.h index 8dd27d118..bd563b9b7 100644 --- a/include/camera.h +++ b/include/camera.h @@ -1,15 +1,16 @@ #ifndef POKEDIAMOND_CAMERA_H #define POKEDIAMOND_CAMERA_H -#include "fx.h" #include "global.h" + +#include "fx.h" #include "heap.h" #define CAMERA_UPDATE_ENABLE_X 1 #define CAMERA_UPDATE_ENABLE_Y 2 #define CAMERA_UPDATE_ENABLE_Z 4 -#define CAMERA_PERSPECTIVE_TYPE_PERSPECTIVE 0 +#define CAMERA_PERSPECTIVE_TYPE_PERSPECTIVE 0 #define CAMERA_PERSPECTIVE_TYPE_ORTHOGRAPHIC 1 typedef struct CameraHistory { diff --git a/include/coins.h b/include/coins.h index 2e5ea6513..b9ede21a5 100644 --- a/include/coins.h +++ b/include/coins.h @@ -1,6 +1,8 @@ #ifndef POKEDIAMOND_COINS_H #define POKEDIAMOND_COINS_H +#include "nitro/types.h" + #define MAX_COINS 50000 void InitCoins(u16 *coins); @@ -10,4 +12,4 @@ BOOL GiveCoins(u16 *coins, u16 amount); BOOL CanGiveCoins(u16 *coins, u16 amount); BOOL TakeCoins(u16 *coins, u16 amount); -#endif //POKEDIAMOND_COINS_H +#endif // POKEDIAMOND_COINS_H diff --git a/include/config.h b/include/config.h index c32220d0b..af6333097 100644 --- a/include/config.h +++ b/include/config.h @@ -1,11 +1,11 @@ #ifndef POKEDIAMOND_CONFIG_H #define POKEDIAMOND_CONFIG_H -#define VERSION_SAPPHIRE 1 -#define VERSION_RUBY 2 -#define VERSION_EMERALD 3 -#define VERSION_FIRE_RED 4 -#define VERSION_LEAF_GREEN 5 +#define VERSION_SAPPHIRE 1 +#define VERSION_RUBY 2 +#define VERSION_EMERALD 3 +#define VERSION_FIRE_RED 4 +#define VERSION_LEAF_GREEN 5 #define VERSION_DIAMOND 10 #define VERSION_PEARL 11 @@ -16,7 +16,7 @@ #define LANGUAGE_GERMAN 5 #define LANGUAGE_SPANISH 7 #define LANGUAGE_KOREAN 8 -#define LANGUAGE_COUNT LANGUAGE_KOREAN +#define LANGUAGE_COUNT LANGUAGE_KOREAN #ifdef DIAMOND #define GAME_VERSION VERSION_DIAMOND @@ -26,4 +26,4 @@ #define GAME_LANGUAGE LANGUAGE_ENGLISH -#endif //POKEDIAMOND_CONFIG_H +#endif // POKEDIAMOND_CONFIG_H diff --git a/include/constants/abilities.h b/include/constants/abilities.h index f107e6231..481315c3a 100644 --- a/include/constants/abilities.h +++ b/include/constants/abilities.h @@ -1,129 +1,129 @@ #ifndef POKEDIAMOND_CONSTANTS_ABILITIES_H #define POKEDIAMOND_CONSTANTS_ABILITIES_H -#define ABILITY_NONE 0 -#define ABILITY_STENCH 1 -#define ABILITY_DRIZZLE 2 -#define ABILITY_SPEED_BOOST 3 -#define ABILITY_BATTLE_ARMOR 4 -#define ABILITY_STURDY 5 -#define ABILITY_DAMP 6 -#define ABILITY_LIMBER 7 -#define ABILITY_SAND_VEIL 8 -#define ABILITY_STATIC 9 -#define ABILITY_VOLT_ABSORB 10 -#define ABILITY_WATER_ABSORB 11 -#define ABILITY_OBLIVIOUS 12 -#define ABILITY_CLOUD_NINE 13 -#define ABILITY_COMPOUND_EYES 14 -#define ABILITY_INSOMNIA 15 -#define ABILITY_COLOR_CHANGE 16 -#define ABILITY_IMMUNITY 17 -#define ABILITY_FLASH_FIRE 18 -#define ABILITY_SHIELD_DUST 19 -#define ABILITY_OWN_TEMPO 20 -#define ABILITY_SUCTION_CUPS 21 -#define ABILITY_INTIMIDATE 22 -#define ABILITY_SHADOW_TAG 23 -#define ABILITY_ROUGH_SKIN 24 -#define ABILITY_WONDER_GUARD 25 -#define ABILITY_LEVITATE 26 -#define ABILITY_EFFECT_SPORE 27 -#define ABILITY_SYNCHRONIZE 28 -#define ABILITY_CLEAR_BODY 29 -#define ABILITY_NATURAL_CURE 30 -#define ABILITY_LIGHTNING_ROD 31 -#define ABILITY_SERENE_GRACE 32 -#define ABILITY_SWIFT_SWIM 33 -#define ABILITY_CHLOROPHYLL 34 -#define ABILITY_ILLUMINATE 35 -#define ABILITY_TRACE 36 -#define ABILITY_HUGE_POWER 37 -#define ABILITY_POISON_POINT 38 -#define ABILITY_INNER_FOCUS 39 -#define ABILITY_MAGMA_ARMOR 40 -#define ABILITY_WATER_VEIL 41 -#define ABILITY_MAGNET_PULL 42 -#define ABILITY_SOUNDPROOF 43 -#define ABILITY_RAIN_DISH 44 -#define ABILITY_SAND_STREAM 45 -#define ABILITY_PRESSURE 46 -#define ABILITY_THICK_FAT 47 -#define ABILITY_EARLY_BIRD 48 -#define ABILITY_FLAME_BODY 49 -#define ABILITY_RUN_AWAY 50 -#define ABILITY_KEEN_EYE 51 -#define ABILITY_HYPER_CUTTER 52 -#define ABILITY_PICKUP 53 -#define ABILITY_TRUANT 54 -#define ABILITY_HUSTLE 55 -#define ABILITY_CUTE_CHARM 56 -#define ABILITY_PLUS 57 -#define ABILITY_MINUS 58 -#define ABILITY_FORECAST 59 -#define ABILITY_STICKY_HOLD 60 -#define ABILITY_SHED_SKIN 61 -#define ABILITY_GUTS 62 -#define ABILITY_MARVEL_SCALE 63 -#define ABILITY_LIQUID_OOZE 64 -#define ABILITY_OVERGROW 65 -#define ABILITY_BLAZE 66 -#define ABILITY_TORRENT 67 -#define ABILITY_SWARM 68 -#define ABILITY_ROCK_HEAD 69 -#define ABILITY_DROUGHT 70 -#define ABILITY_ARENA_TRAP 71 -#define ABILITY_VITAL_SPIRIT 72 -#define ABILITY_WHITE_SMOKE 73 -#define ABILITY_PURE_POWER 74 -#define ABILITY_SHELL_ARMOR 75 -#define ABILITY_AIR_LOCK 76 -#define ABILITY_TANGLED_FEET 77 -#define ABILITY_MOTOR_DRIVE 78 -#define ABILITY_RIVALRY 79 -#define ABILITY_STEADFAST 80 -#define ABILITY_SNOW_CLOAK 81 -#define ABILITY_GLUTTONY 82 -#define ABILITY_ANGER_POINT 83 -#define ABILITY_UNBURDEN 84 -#define ABILITY_HEATPROOF 85 -#define ABILITY_SIMPLE 86 -#define ABILITY_DRY_SKIN 87 -#define ABILITY_DOWNLOAD 88 -#define ABILITY_IRON_FIST 89 -#define ABILITY_POISON_HEAL 90 -#define ABILITY_ADAPTABILITY 91 -#define ABILITY_SKILL_LINK 92 -#define ABILITY_HYDRATION 93 -#define ABILITY_SOLAR_POWER 94 -#define ABILITY_QUICK_FEET 95 -#define ABILITY_NORMALIZE 96 -#define ABILITY_SNIPER 97 -#define ABILITY_MAGIC_GUARD 98 -#define ABILITY_NO_GUARD 99 -#define ABILITY_STALL 100 -#define ABILITY_TECHNICIAN 101 -#define ABILITY_LEAF_GUARD 102 -#define ABILITY_KLUTZ 103 -#define ABILITY_MOLD_BREAKER 104 -#define ABILITY_SUPER_LUCK 105 -#define ABILITY_AFTERMATH 106 -#define ABILITY_ANTICIPATION 107 -#define ABILITY_FOREWARN 108 -#define ABILITY_UNAWARE 109 -#define ABILITY_TINTED_LENS 110 -#define ABILITY_FILTER 111 -#define ABILITY_SLOW_START 112 -#define ABILITY_SCRAPPY 113 -#define ABILITY_STORM_DRAIN 114 -#define ABILITY_ICE_BODY 115 -#define ABILITY_SOLID_ROCK 116 -#define ABILITY_SNOW_WARNING 117 -#define ABILITY_HONEY_GATHER 118 -#define ABILITY_FRISK 119 -#define ABILITY_RECKLESS 120 -#define ABILITY_MULTITYPE 121 -#define ABILITY_FLOWER_GIFT 122 -#define ABILITY_BAD_DREAMS 123 +#define ABILITY_NONE 0 +#define ABILITY_STENCH 1 +#define ABILITY_DRIZZLE 2 +#define ABILITY_SPEED_BOOST 3 +#define ABILITY_BATTLE_ARMOR 4 +#define ABILITY_STURDY 5 +#define ABILITY_DAMP 6 +#define ABILITY_LIMBER 7 +#define ABILITY_SAND_VEIL 8 +#define ABILITY_STATIC 9 +#define ABILITY_VOLT_ABSORB 10 +#define ABILITY_WATER_ABSORB 11 +#define ABILITY_OBLIVIOUS 12 +#define ABILITY_CLOUD_NINE 13 +#define ABILITY_COMPOUND_EYES 14 +#define ABILITY_INSOMNIA 15 +#define ABILITY_COLOR_CHANGE 16 +#define ABILITY_IMMUNITY 17 +#define ABILITY_FLASH_FIRE 18 +#define ABILITY_SHIELD_DUST 19 +#define ABILITY_OWN_TEMPO 20 +#define ABILITY_SUCTION_CUPS 21 +#define ABILITY_INTIMIDATE 22 +#define ABILITY_SHADOW_TAG 23 +#define ABILITY_ROUGH_SKIN 24 +#define ABILITY_WONDER_GUARD 25 +#define ABILITY_LEVITATE 26 +#define ABILITY_EFFECT_SPORE 27 +#define ABILITY_SYNCHRONIZE 28 +#define ABILITY_CLEAR_BODY 29 +#define ABILITY_NATURAL_CURE 30 +#define ABILITY_LIGHTNING_ROD 31 +#define ABILITY_SERENE_GRACE 32 +#define ABILITY_SWIFT_SWIM 33 +#define ABILITY_CHLOROPHYLL 34 +#define ABILITY_ILLUMINATE 35 +#define ABILITY_TRACE 36 +#define ABILITY_HUGE_POWER 37 +#define ABILITY_POISON_POINT 38 +#define ABILITY_INNER_FOCUS 39 +#define ABILITY_MAGMA_ARMOR 40 +#define ABILITY_WATER_VEIL 41 +#define ABILITY_MAGNET_PULL 42 +#define ABILITY_SOUNDPROOF 43 +#define ABILITY_RAIN_DISH 44 +#define ABILITY_SAND_STREAM 45 +#define ABILITY_PRESSURE 46 +#define ABILITY_THICK_FAT 47 +#define ABILITY_EARLY_BIRD 48 +#define ABILITY_FLAME_BODY 49 +#define ABILITY_RUN_AWAY 50 +#define ABILITY_KEEN_EYE 51 +#define ABILITY_HYPER_CUTTER 52 +#define ABILITY_PICKUP 53 +#define ABILITY_TRUANT 54 +#define ABILITY_HUSTLE 55 +#define ABILITY_CUTE_CHARM 56 +#define ABILITY_PLUS 57 +#define ABILITY_MINUS 58 +#define ABILITY_FORECAST 59 +#define ABILITY_STICKY_HOLD 60 +#define ABILITY_SHED_SKIN 61 +#define ABILITY_GUTS 62 +#define ABILITY_MARVEL_SCALE 63 +#define ABILITY_LIQUID_OOZE 64 +#define ABILITY_OVERGROW 65 +#define ABILITY_BLAZE 66 +#define ABILITY_TORRENT 67 +#define ABILITY_SWARM 68 +#define ABILITY_ROCK_HEAD 69 +#define ABILITY_DROUGHT 70 +#define ABILITY_ARENA_TRAP 71 +#define ABILITY_VITAL_SPIRIT 72 +#define ABILITY_WHITE_SMOKE 73 +#define ABILITY_PURE_POWER 74 +#define ABILITY_SHELL_ARMOR 75 +#define ABILITY_AIR_LOCK 76 +#define ABILITY_TANGLED_FEET 77 +#define ABILITY_MOTOR_DRIVE 78 +#define ABILITY_RIVALRY 79 +#define ABILITY_STEADFAST 80 +#define ABILITY_SNOW_CLOAK 81 +#define ABILITY_GLUTTONY 82 +#define ABILITY_ANGER_POINT 83 +#define ABILITY_UNBURDEN 84 +#define ABILITY_HEATPROOF 85 +#define ABILITY_SIMPLE 86 +#define ABILITY_DRY_SKIN 87 +#define ABILITY_DOWNLOAD 88 +#define ABILITY_IRON_FIST 89 +#define ABILITY_POISON_HEAL 90 +#define ABILITY_ADAPTABILITY 91 +#define ABILITY_SKILL_LINK 92 +#define ABILITY_HYDRATION 93 +#define ABILITY_SOLAR_POWER 94 +#define ABILITY_QUICK_FEET 95 +#define ABILITY_NORMALIZE 96 +#define ABILITY_SNIPER 97 +#define ABILITY_MAGIC_GUARD 98 +#define ABILITY_NO_GUARD 99 +#define ABILITY_STALL 100 +#define ABILITY_TECHNICIAN 101 +#define ABILITY_LEAF_GUARD 102 +#define ABILITY_KLUTZ 103 +#define ABILITY_MOLD_BREAKER 104 +#define ABILITY_SUPER_LUCK 105 +#define ABILITY_AFTERMATH 106 +#define ABILITY_ANTICIPATION 107 +#define ABILITY_FOREWARN 108 +#define ABILITY_UNAWARE 109 +#define ABILITY_TINTED_LENS 110 +#define ABILITY_FILTER 111 +#define ABILITY_SLOW_START 112 +#define ABILITY_SCRAPPY 113 +#define ABILITY_STORM_DRAIN 114 +#define ABILITY_ICE_BODY 115 +#define ABILITY_SOLID_ROCK 116 +#define ABILITY_SNOW_WARNING 117 +#define ABILITY_HONEY_GATHER 118 +#define ABILITY_FRISK 119 +#define ABILITY_RECKLESS 120 +#define ABILITY_MULTITYPE 121 +#define ABILITY_FLOWER_GIFT 122 +#define ABILITY_BAD_DREAMS 123 -#endif //POKEDIAMOND_CONSTANTS_ABILITIES_H +#endif // POKEDIAMOND_CONSTANTS_ABILITIES_H diff --git a/include/constants/accessories.h b/include/constants/accessories.h index 907e12cb8..210fbd726 100644 --- a/include/constants/accessories.h +++ b/include/constants/accessories.h @@ -1,18 +1,18 @@ #ifndef POKEDIAMOND_CONSTANTS_ACCESSORIES_H #define POKEDIAMOND_CONSTANTS_ACCESSORIES_H -#define ACCESSORY_WHITE_FLUFF 0 -#define ACCESSORY_YELLOW_FLUFF 1 -#define ACCESSORY_PINK_FLUFF 2 -#define ACCESSORY_BROWN_FLUFF 3 -#define ACCESSORY_BLACK_FLUFF 4 -#define ACCESSORY_ORANGE_FLUFF 5 -#define ACCESSORY_ROUND_PEBBLE 6 -#define ACCESSORY_GLITTER_BOULDER 7 -#define ACCESSORY_SNAGGY_PEBBLE 8 -#define ACCESSORY_JAGGED_BOULDER 9 +#define ACCESSORY_WHITE_FLUFF 0 +#define ACCESSORY_YELLOW_FLUFF 1 +#define ACCESSORY_PINK_FLUFF 2 +#define ACCESSORY_BROWN_FLUFF 3 +#define ACCESSORY_BLACK_FLUFF 4 +#define ACCESSORY_ORANGE_FLUFF 5 +#define ACCESSORY_ROUND_PEBBLE 6 +#define ACCESSORY_GLITTER_BOULDER 7 +#define ACCESSORY_SNAGGY_PEBBLE 8 +#define ACCESSORY_JAGGED_BOULDER 9 #define ACCESSORY_BLACK_PEBBLE 10 -#define ACCESSORY_MINI_PEBBLE 11 +#define ACCESSORY_MINI_PEBBLE 11 #define ACCESSORY_PINK_SCALE 12 #define ACCESSORY_BLUE_SCALE 13 #define ACCESSORY_GREEN_SCALE 14 diff --git a/include/constants/battle.h b/include/constants/battle.h index 6c112b15f..e55443a7a 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_CONSTANTS_BATTLE_H #define POKEDIAMOND_CONSTANTS_BATTLE_H -//Battler IDs +// Battler IDs #define BATTLER_NONE 0xFF #define BATTLER_PLAYER 0 #define BATTLER_ENEMY 1 @@ -10,309 +10,308 @@ // Battle outcome // Used with BattleSetup::winFlag -#define BATTLE_OUTCOME_NONE 0 -#define BATTLE_OUTCOME_WIN 1 -#define BATTLE_OUTCOME_LOSE 2 -#define BATTLE_OUTCOME_DRAW 3 -#define BATTLE_OUTCOME_MON_CAUGHT 4 -#define BATTLE_OUTCOME_PLAYER_FLED 5 -#define BATTLE_OUTCOME_FOE_FLED 6 +#define BATTLE_OUTCOME_NONE 0 +#define BATTLE_OUTCOME_WIN 1 +#define BATTLE_OUTCOME_LOSE 2 +#define BATTLE_OUTCOME_DRAW 3 +#define BATTLE_OUTCOME_MON_CAUGHT 4 +#define BATTLE_OUTCOME_PLAYER_FLED 5 +#define BATTLE_OUTCOME_FOE_FLED 6 -//Battle Type -#define BATTLE_TYPE_NONE 0 -#define BATTLE_TYPE_TRAINER (1 << 0) -#define BATTLE_TYPE_DOUBLES (1 << 1) -#define BATTLE_TYPE_LINK (1 << 2) -#define BATTLE_TYPE_MULTI (1 << 3) -#define BATTLE_TYPE_INGAME_PARTNER (1 << 4) -#define BATTLE_TYPE_SAFARI (1 << 5) -#define BATTLE_TYPE_6 (1 << 6) -#define BATTLE_TYPE_TOWER (1 << 7) -#define BATTLE_TYPE_8 (1 << 8) -#define BATTLE_TYPE_PAL_PARK (1 << 9) -#define BATTLE_TYPE_TUTORIAL (1 << 10) -#define BATTLE_TYPE_11 (1 << 11) -#define BATTLE_TYPE_DEBUG (1 << 31) +// Battle Type +#define BATTLE_TYPE_NONE 0 +#define BATTLE_TYPE_TRAINER (1 << 0) +#define BATTLE_TYPE_DOUBLES (1 << 1) +#define BATTLE_TYPE_LINK (1 << 2) +#define BATTLE_TYPE_MULTI (1 << 3) +#define BATTLE_TYPE_INGAME_PARTNER (1 << 4) +#define BATTLE_TYPE_SAFARI (1 << 5) +#define BATTLE_TYPE_6 (1 << 6) +#define BATTLE_TYPE_TOWER (1 << 7) +#define BATTLE_TYPE_8 (1 << 8) +#define BATTLE_TYPE_PAL_PARK (1 << 9) +#define BATTLE_TYPE_TUTORIAL (1 << 10) +#define BATTLE_TYPE_11 (1 << 11) +#define BATTLE_TYPE_DEBUG (1 << 31) -#define BATTLE_TYPE_NO_EXP (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_TOWER | BATTLE_TYPE_PAL_PARK) +#define BATTLE_TYPE_NO_EXP (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_TOWER | BATTLE_TYPE_PAL_PARK) -#define MOVE_EFFECT_NORMAL_HIT 0 -#define MOVE_EFFECT_SLEEP 1 -#define MOVE_EFFECT_POISON_HIT 2 -#define MOVE_EFFECT_DRAIN_HP 3 -#define MOVE_EFFECT_BURN_HIT 4 -#define MOVE_EFFECT_FREEZE_HIT 5 -#define MOVE_EFFECT_PARALYZE_HIT 6 -#define MOVE_EFFECT_EXPLOSION 7 -#define MOVE_EFFECT_DREAM_EATER 8 -#define MOVE_EFFECT_MIRROR_MOVE 9 -#define MOVE_EFFECT_ATTACK_UP 10 -#define MOVE_EFFECT_DEFENSE_UP 11 -#define MOVE_EFFECT_SPEED_UP 12 // unused -#define MOVE_EFFECT_SPATK_UP 13 -#define MOVE_EFFECT_SPDEF_UP 14 // unused -#define MOVE_EFFECT_ACCURACY_UP 15 // unused -#define MOVE_EFFECT_EVASION_UP 16 -#define MOVE_EFFECT_ALWAYS_HIT 17 -#define MOVE_EFFECT_ATTACK_DOWN 18 -#define MOVE_EFFECT_DEFENSE_DOWN 19 -#define MOVE_EFFECT_SPEED_DOWN 20 -#define MOVE_EFFECT_SPATK_DOWN 21 // unused -#define MOVE_EFFECT_SPDEF_DOWN 22 // unused -#define MOVE_EFFECT_ACCURACY_DOWN 23 -#define MOVE_EFFECT_EVASION_DOWN 24 -#define MOVE_EFFECT_STATS_RESET 25 -#define MOVE_EFFECT_BIDE 26 -#define MOVE_EFFECT_RAMPAGE 27 -#define MOVE_EFFECT_SWITCH_FOE 28 -#define MOVE_EFFECT_MULTIHIT_2_5 29 -#define MOVE_EFFECT_CONVERSION 30 -#define MOVE_EFFECT_FLINCH_HIT 31 -#define MOVE_EFFECT_RESTORE_HP 32 -#define MOVE_EFFECT_TOXIC 33 -#define MOVE_EFFECT_PAYDAY 34 -#define MOVE_EFFECT_LIGHT_SCREEN 35 -#define MOVE_EFFECT_TRI_ATTACK 36 -#define MOVE_EFFECT_SLEEP_USER 37 -#define MOVE_EFFECT_OHKO 38 -#define MOVE_EFFECT_RAZOR_WIND 39 -#define MOVE_EFFECT_SUPER_FANG 40 -#define MOVE_EFFECT_FIXED_40 41 -#define MOVE_EFFECT_TRAP_HIT 42 -#define MOVE_EFFECT_HIGH_CRIT 43 -#define MOVE_EFFECT_DOUBLE_HIT 44 -#define MOVE_EFFECT_JUMP_KICK 45 -#define MOVE_EFFECT_MIST 46 -#define MOVE_EFFECT_CRIT_CHANCE_UP 47 -#define MOVE_EFFECT_RECOIL_HIT 48 -#define MOVE_EFFECT_CONFUSE 49 -#define MOVE_EFFECT_ATTACK_2UP 50 -#define MOVE_EFFECT_DEFENSE_2UP 51 -#define MOVE_EFFECT_SPEED_2UP 52 -#define MOVE_EFFECT_SPATK_2UP 53 -#define MOVE_EFFECT_SPDEF_2UP 54 -#define MOVE_EFFECT_ACCURACY_2UP 55 // unused -#define MOVE_EFFECT_EVASION_2UP 56 // unused -#define MOVE_EFFECT_TRANSFORM 57 -#define MOVE_EFFECT_ATTACK_2DOWN 58 -#define MOVE_EFFECT_DEFENSE_2DOWN 59 -#define MOVE_EFFECT_SPEED_2DOWN 60 -#define MOVE_EFFECT_SPATK_2DOWN 61 // unused -#define MOVE_EFFECT_SPDEF_2DOWN 62 -#define MOVE_EFFECT_ACCURACY_2DOWN 63 // unused -#define MOVE_EFFECT_EVASION_2DOWN 64 // unused -#define MOVE_EFFECT_REFLECT 65 -#define MOVE_EFFECT_POISON 66 -#define MOVE_EFFECT_PARALYZE 67 -#define MOVE_EFFECT_ATTACK_DOWN_HIT 68 -#define MOVE_EFFECT_DEFENSE_DOWN_HIT 69 -#define MOVE_EFFECT_SPEED_DOWN_HIT 70 -#define MOVE_EFFECT_SPATK_DOWN_HIT 71 -#define MOVE_EFFECT_SPDEF_DOWN_HIT 72 -#define MOVE_EFFECT_ACCURACY_DOWN_HIT 73 -#define MOVE_EFFECT_EVASION_DOWN_HIT 74 // unused -#define MOVE_EFFECT_SKY_ATTACK 75 -#define MOVE_EFFECT_CONFUSE_HIT 76 -#define MOVE_EFFECT_POISON_DOUBLE_HIT 77 -#define MOVE_EFFECT_VITAL_THROW 78 -#define MOVE_EFFECT_SUBSTITUTE 79 -#define MOVE_EFFECT_HIT_RECHARGE 80 -#define MOVE_EFFECT_RAGE 81 -#define MOVE_EFFECT_MIMIC 82 -#define MOVE_EFFECT_METRONOME 83 -#define MOVE_EFFECT_LEECH_SEED 84 -#define MOVE_EFFECT_NONE 85 -#define MOVE_EFFECT_DISABLE 86 -#define MOVE_EFFECT_LEVEL_DAMAGE 87 -#define MOVE_EFFECT_RANDOM_DAMAGE 88 -#define MOVE_EFFECT_COUNTER 89 -#define MOVE_EFFECT_ENCORE 90 -#define MOVE_EFFECT_PAIN_SPLIT 91 -#define MOVE_EFFECT_SNORE 92 -#define MOVE_EFFECT_CONVERSION_2 93 -#define MOVE_EFFECT_ENSURE_NEXT_HIT 94 -#define MOVE_EFFECT_SKETCH 95 -#define MOVE_EFFECT_UNK096 96 // unused -#define MOVE_EFFECT_SLEEP_TALK 97 -#define MOVE_EFFECT_DESTINY_BOND 98 -#define MOVE_EFFECT_STRONGER_LOW_HP 99 -#define MOVE_EFFECT_SPITE 100 -#define MOVE_EFFECT_FALSE_SWIPE 101 -#define MOVE_EFFECT_HEAL_ALL_STATUS 102 -#define MOVE_EFFECT_PRIORITY_HIT 103 -#define MOVE_EFFECT_TRIPLE_KICK 104 -#define MOVE_EFFECT_STEAL_ITEM 105 -#define MOVE_EFFECT_PREVENT_ESCAPE 106 -#define MOVE_EFFECT_NIGHTMARE 107 -#define MOVE_EFFECT_MINIMIZE 108 -#define MOVE_EFFECT_CURSE 109 -#define MOVE_EFFECT_UNK110 110 // unused -#define MOVE_EFFECT_PROTECT 111 -#define MOVE_EFFECT_SPIKES 112 -#define MOVE_EFFECT_IDENTIFY 113 -#define MOVE_EFFECT_PERISH_SONG 114 -#define MOVE_EFFECT_SANDSTORM 115 -#define MOVE_EFFECT_ENDURE 116 -#define MOVE_EFFECT_INCREASING_HIT 117 -#define MOVE_EFFECT_SWAGGER 118 -#define MOVE_EFFECT_FURY_CUTTER 119 -#define MOVE_EFFECT_ATTRACT 120 -#define MOVE_EFFECT_RETURN 121 -#define MOVE_EFFECT_PRESENT 122 -#define MOVE_EFFECT_FRUSTRATION 123 -#define MOVE_EFFECT_SAFEGUARD 124 -#define MOVE_EFFECT_BURN_HIT_THAW 125 -#define MOVE_EFFECT_MAGNITUDE 126 -#define MOVE_EFFECT_BATON_PASS 127 -#define MOVE_EFFECT_PURSUIT 128 -#define MOVE_EFFECT_RAPID_SPIN 129 -#define MOVE_EFFECT_FIXED_20 130 -#define MOVE_EFFECT_UNK131 131 // unused -#define MOVE_EFFECT_RESTORE_HP_DAYTIME 132 -#define MOVE_EFFECT_UNK133 133 // unused -#define MOVE_EFFECT_UNK134 134 // unused -#define MOVE_EFFECT_HIDDEN_POWER 135 // unused -#define MOVE_EFFECT_RAIN 136 -#define MOVE_EFFECT_SUNNY 137 -#define MOVE_EFFECT_DEFENSE_UP_HIT 138 -#define MOVE_EFFECT_ATTACK_UP_HIT 139 -#define MOVE_EFFECT_STATS_UP_HIT 140 -#define MOVE_EFFECT_UNK141 141 // unused -#define MOVE_EFFECT_BELLY_DRUM 142 -#define MOVE_EFFECT_PSYCH_UP 143 -#define MOVE_EFFECT_MIRROR_COAT 144 -#define MOVE_EFFECT_SKULL_BASH 145 -#define MOVE_EFFECT_TWISTER 146 -#define MOVE_EFFECT_EARTHQUAKE 147 -#define MOVE_EFFECT_HIT_LATER 148 -#define MOVE_EFFECT_GUST 149 -#define MOVE_EFFECT_STOMP 150 -#define MOVE_EFFECT_SOLAR_BEAM 151 -#define MOVE_EFFECT_THUNDER 152 -#define MOVE_EFFECT_TELEPORT 153 -#define MOVE_EFFECT_BEAT_UP 154 -#define MOVE_EFFECT_FLY 155 -#define MOVE_EFFECT_DEFENSE_CURL 156 -#define MOVE_EFFECT_UNK157 157 // unused -#define MOVE_EFFECT_FAKE_OUT 158 -#define MOVE_EFFECT_UPROAR 159 -#define MOVE_EFFECT_STOCKPILE 160 -#define MOVE_EFFECT_SPIT_UP 161 -#define MOVE_EFFECT_SWALLOW 162 -#define MOVE_EFFECT_UNK163 163 // unused -#define MOVE_EFFECT_HAIL 164 -#define MOVE_EFFECT_TORMENT 165 -#define MOVE_EFFECT_FLATTER 166 -#define MOVE_EFFECT_BURN 167 -#define MOVE_EFFECT_MEMENTO 168 -#define MOVE_EFFECT_FACADE 169 -#define MOVE_EFFECT_FOCUS_PUNCH 170 -#define MOVE_EFFECT_SMELLING_SALTS 171 -#define MOVE_EFFECT_FOLLOW_ME 172 -#define MOVE_EFFECT_NATURE_POWER 173 -#define MOVE_EFFECT_CHARGE 174 -#define MOVE_EFFECT_TAUNT 175 -#define MOVE_EFFECT_HELPING_HAND 176 -#define MOVE_EFFECT_SWAP_ITEMS 177 -#define MOVE_EFFECT_ROLE_PLAY 178 -#define MOVE_EFFECT_WISH 179 -#define MOVE_EFFECT_ASSIST 180 -#define MOVE_EFFECT_INGRAIN 181 -#define MOVE_EFFECT_SUPERPOWER 182 -#define MOVE_EFFECT_MAGIC_COAT 183 -#define MOVE_EFFECT_RECYCLE 184 -#define MOVE_EFFECT_REVENGE 185 -#define MOVE_EFFECT_BRICK_BREAK 186 -#define MOVE_EFFECT_YAWN 187 -#define MOVE_EFFECT_KNOCK_OFF 188 -#define MOVE_EFFECT_ENDEAVOR 189 -#define MOVE_EFFECT_STRONGER_HIGH_HP 190 -#define MOVE_EFFECT_SKILL_SWAP 191 -#define MOVE_EFFECT_IMPRISON 192 -#define MOVE_EFFECT_REFRESH 193 -#define MOVE_EFFECT_GRUDGE 194 -#define MOVE_EFFECT_SNATCH 195 -#define MOVE_EFFECT_STRONGER_HEAVIER 196 -#define MOVE_EFFECT_SECRET_POWER 197 -#define MOVE_EFFECT_RECOIL_HIT_HARD 198 -#define MOVE_EFFECT_CONFUSE_ALL 199 -#define MOVE_EFFECT_BURN_HIT_HIGH_CRIT 200 -#define MOVE_EFFECT_MUD_SPORT 201 -#define MOVE_EFFECT_TOXIC_HIT 202 -#define MOVE_EFFECT_WEATHER_BALL 203 -#define MOVE_EFFECT_HIT_USER_SPATK_2_DOWN 204 -#define MOVE_EFFECT_ATTACK_DEFENSE_DOWN 205 -#define MOVE_EFFECT_DEFENSE_SPDEF_UP 206 -#define MOVE_EFFECT_SKY_UPPERCUT 207 -#define MOVE_EFFECT_ATTACK_DEFENSE_UP 208 -#define MOVE_EFFECT_POISON_HIT_HIGH_CRIT 209 -#define MOVE_EFFECT_WATER_SPORT 210 -#define MOVE_EFFECT_SPATK_SPDEF_UP 211 -#define MOVE_EFFECT_ATTACK_SPEED_UP 212 -#define MOVE_EFFECT_CAMOUFLAGE 213 -#define MOVE_EFFECT_ROOST 214 -#define MOVE_EFFECT_GRAVITY 215 -#define MOVE_EFFECT_MIRACLE_EYE 216 -#define MOVE_EFFECT_WAKE_UP_SLAP 217 -#define MOVE_EFFECT_HAMMER_ARM 218 -#define MOVE_EFFECT_GYRO_BALL 219 -#define MOVE_EFFECT_HEALING_WISH 220 -#define MOVE_EFFECT_BRINE 221 -#define MOVE_EFFECT_NATURAL_GIFT 222 -#define MOVE_EFFECT_FEINT 223 -#define MOVE_EFFECT_BUG_BITE 224 -#define MOVE_EFFECT_TAILWIND 225 -#define MOVE_EFFECT_ACUPRESSURE 226 -#define MOVE_EFFECT_METAL_BURST 227 -#define MOVE_EFFECT_U_TURN 228 -#define MOVE_EFFECT_CLOSE_COMBAT 229 -#define MOVE_EFFECT_PAYBACK 230 -#define MOVE_EFFECT_ASSURANCE 231 -#define MOVE_EFFECT_EMBARGO 232 -#define MOVE_EFFECT_FLING 233 -#define MOVE_EFFECT_PSYCHO_SHIFT 234 -#define MOVE_EFFECT_TRUMP_CARD 235 -#define MOVE_EFFECT_HEAL_BLOCK 236 -#define MOVE_EFFECT_CRUSH_GRIP 237 -#define MOVE_EFFECT_POWER_TRICK 238 -#define MOVE_EFFECT_GASTRO_ACID 239 -#define MOVE_EFFECT_LUCKY_CHANT 240 -#define MOVE_EFFECT_ME_FIRST 241 -#define MOVE_EFFECT_COPYCAT 242 -#define MOVE_EFFECT_POWER_SWAP 243 -#define MOVE_EFFECT_GUARD_SWAP 244 -#define MOVE_EFFECT_PUNISHMENT 245 -#define MOVE_EFFECT_LAST_RESORT 246 -#define MOVE_EFFECT_WORRY_SEED 247 -#define MOVE_EFFECT_SUCKER_PUNCH 248 -#define MOVE_EFFECT_TOXIC_SPIKES 249 -#define MOVE_EFFECT_HEART_SWAP 250 -#define MOVE_EFFECT_AQUA_RING 251 -#define MOVE_EFFECT_MAGNET_RISE 252 -#define MOVE_EFFECT_FLARE_BLITZ 253 -#define MOVE_EFFECT_STRUGGLE 254 -#define MOVE_EFFECT_DIVE 255 -#define MOVE_EFFECT_DIG 256 -#define MOVE_EFFECT_SURF 257 -#define MOVE_EFFECT_DEFOG 258 -#define MOVE_EFFECT_TRICK_ROOM 259 -#define MOVE_EFFECT_BLIZZARD 260 -#define MOVE_EFFECT_WHIRLPOOL 261 -#define MOVE_EFFECT_VOLT_TACKLE 262 -#define MOVE_EFFECT_BOUNCE 263 -#define MOVE_EFFECT_UNK264 264 // unused -#define MOVE_EFFECT_CAPTIVATE 265 -#define MOVE_EFFECT_STEALTH_ROCK 266 -#define MOVE_EFFECT_CHATTER 267 -#define MOVE_EFFECT_JUDGMENT 268 -#define MOVE_EFFECT_HEAD_SMASH 269 -#define MOVE_EFFECT_LUNAR_DANCE 270 -#define MOVE_EFFECT_SEED_FLARE 271 -#define MOVE_EFFECT_SHADOW_FORCE 272 -#define MOVE_EFFECT_FIRE_FANG 273 -#define MOVE_EFFECT_ICE_FANG 274 -#define MOVE_EFFECT_THUNDER_FANG 275 -#define MOVE_EFFECT_CHARGE_BEAM 276 +#define MOVE_EFFECT_NORMAL_HIT 0 +#define MOVE_EFFECT_SLEEP 1 +#define MOVE_EFFECT_POISON_HIT 2 +#define MOVE_EFFECT_DRAIN_HP 3 +#define MOVE_EFFECT_BURN_HIT 4 +#define MOVE_EFFECT_FREEZE_HIT 5 +#define MOVE_EFFECT_PARALYZE_HIT 6 +#define MOVE_EFFECT_EXPLOSION 7 +#define MOVE_EFFECT_DREAM_EATER 8 +#define MOVE_EFFECT_MIRROR_MOVE 9 +#define MOVE_EFFECT_ATTACK_UP 10 +#define MOVE_EFFECT_DEFENSE_UP 11 +#define MOVE_EFFECT_SPEED_UP 12 // unused +#define MOVE_EFFECT_SPATK_UP 13 +#define MOVE_EFFECT_SPDEF_UP 14 // unused +#define MOVE_EFFECT_ACCURACY_UP 15 // unused +#define MOVE_EFFECT_EVASION_UP 16 +#define MOVE_EFFECT_ALWAYS_HIT 17 +#define MOVE_EFFECT_ATTACK_DOWN 18 +#define MOVE_EFFECT_DEFENSE_DOWN 19 +#define MOVE_EFFECT_SPEED_DOWN 20 +#define MOVE_EFFECT_SPATK_DOWN 21 // unused +#define MOVE_EFFECT_SPDEF_DOWN 22 // unused +#define MOVE_EFFECT_ACCURACY_DOWN 23 +#define MOVE_EFFECT_EVASION_DOWN 24 +#define MOVE_EFFECT_STATS_RESET 25 +#define MOVE_EFFECT_BIDE 26 +#define MOVE_EFFECT_RAMPAGE 27 +#define MOVE_EFFECT_SWITCH_FOE 28 +#define MOVE_EFFECT_MULTIHIT_2_5 29 +#define MOVE_EFFECT_CONVERSION 30 +#define MOVE_EFFECT_FLINCH_HIT 31 +#define MOVE_EFFECT_RESTORE_HP 32 +#define MOVE_EFFECT_TOXIC 33 +#define MOVE_EFFECT_PAYDAY 34 +#define MOVE_EFFECT_LIGHT_SCREEN 35 +#define MOVE_EFFECT_TRI_ATTACK 36 +#define MOVE_EFFECT_SLEEP_USER 37 +#define MOVE_EFFECT_OHKO 38 +#define MOVE_EFFECT_RAZOR_WIND 39 +#define MOVE_EFFECT_SUPER_FANG 40 +#define MOVE_EFFECT_FIXED_40 41 +#define MOVE_EFFECT_TRAP_HIT 42 +#define MOVE_EFFECT_HIGH_CRIT 43 +#define MOVE_EFFECT_DOUBLE_HIT 44 +#define MOVE_EFFECT_JUMP_KICK 45 +#define MOVE_EFFECT_MIST 46 +#define MOVE_EFFECT_CRIT_CHANCE_UP 47 +#define MOVE_EFFECT_RECOIL_HIT 48 +#define MOVE_EFFECT_CONFUSE 49 +#define MOVE_EFFECT_ATTACK_2UP 50 +#define MOVE_EFFECT_DEFENSE_2UP 51 +#define MOVE_EFFECT_SPEED_2UP 52 +#define MOVE_EFFECT_SPATK_2UP 53 +#define MOVE_EFFECT_SPDEF_2UP 54 +#define MOVE_EFFECT_ACCURACY_2UP 55 // unused +#define MOVE_EFFECT_EVASION_2UP 56 // unused +#define MOVE_EFFECT_TRANSFORM 57 +#define MOVE_EFFECT_ATTACK_2DOWN 58 +#define MOVE_EFFECT_DEFENSE_2DOWN 59 +#define MOVE_EFFECT_SPEED_2DOWN 60 +#define MOVE_EFFECT_SPATK_2DOWN 61 // unused +#define MOVE_EFFECT_SPDEF_2DOWN 62 +#define MOVE_EFFECT_ACCURACY_2DOWN 63 // unused +#define MOVE_EFFECT_EVASION_2DOWN 64 // unused +#define MOVE_EFFECT_REFLECT 65 +#define MOVE_EFFECT_POISON 66 +#define MOVE_EFFECT_PARALYZE 67 +#define MOVE_EFFECT_ATTACK_DOWN_HIT 68 +#define MOVE_EFFECT_DEFENSE_DOWN_HIT 69 +#define MOVE_EFFECT_SPEED_DOWN_HIT 70 +#define MOVE_EFFECT_SPATK_DOWN_HIT 71 +#define MOVE_EFFECT_SPDEF_DOWN_HIT 72 +#define MOVE_EFFECT_ACCURACY_DOWN_HIT 73 +#define MOVE_EFFECT_EVASION_DOWN_HIT 74 // unused +#define MOVE_EFFECT_SKY_ATTACK 75 +#define MOVE_EFFECT_CONFUSE_HIT 76 +#define MOVE_EFFECT_POISON_DOUBLE_HIT 77 +#define MOVE_EFFECT_VITAL_THROW 78 +#define MOVE_EFFECT_SUBSTITUTE 79 +#define MOVE_EFFECT_HIT_RECHARGE 80 +#define MOVE_EFFECT_RAGE 81 +#define MOVE_EFFECT_MIMIC 82 +#define MOVE_EFFECT_METRONOME 83 +#define MOVE_EFFECT_LEECH_SEED 84 +#define MOVE_EFFECT_NONE 85 +#define MOVE_EFFECT_DISABLE 86 +#define MOVE_EFFECT_LEVEL_DAMAGE 87 +#define MOVE_EFFECT_RANDOM_DAMAGE 88 +#define MOVE_EFFECT_COUNTER 89 +#define MOVE_EFFECT_ENCORE 90 +#define MOVE_EFFECT_PAIN_SPLIT 91 +#define MOVE_EFFECT_SNORE 92 +#define MOVE_EFFECT_CONVERSION_2 93 +#define MOVE_EFFECT_ENSURE_NEXT_HIT 94 +#define MOVE_EFFECT_SKETCH 95 +#define MOVE_EFFECT_UNK096 96 // unused +#define MOVE_EFFECT_SLEEP_TALK 97 +#define MOVE_EFFECT_DESTINY_BOND 98 +#define MOVE_EFFECT_STRONGER_LOW_HP 99 +#define MOVE_EFFECT_SPITE 100 +#define MOVE_EFFECT_FALSE_SWIPE 101 +#define MOVE_EFFECT_HEAL_ALL_STATUS 102 +#define MOVE_EFFECT_PRIORITY_HIT 103 +#define MOVE_EFFECT_TRIPLE_KICK 104 +#define MOVE_EFFECT_STEAL_ITEM 105 +#define MOVE_EFFECT_PREVENT_ESCAPE 106 +#define MOVE_EFFECT_NIGHTMARE 107 +#define MOVE_EFFECT_MINIMIZE 108 +#define MOVE_EFFECT_CURSE 109 +#define MOVE_EFFECT_UNK110 110 // unused +#define MOVE_EFFECT_PROTECT 111 +#define MOVE_EFFECT_SPIKES 112 +#define MOVE_EFFECT_IDENTIFY 113 +#define MOVE_EFFECT_PERISH_SONG 114 +#define MOVE_EFFECT_SANDSTORM 115 +#define MOVE_EFFECT_ENDURE 116 +#define MOVE_EFFECT_INCREASING_HIT 117 +#define MOVE_EFFECT_SWAGGER 118 +#define MOVE_EFFECT_FURY_CUTTER 119 +#define MOVE_EFFECT_ATTRACT 120 +#define MOVE_EFFECT_RETURN 121 +#define MOVE_EFFECT_PRESENT 122 +#define MOVE_EFFECT_FRUSTRATION 123 +#define MOVE_EFFECT_SAFEGUARD 124 +#define MOVE_EFFECT_BURN_HIT_THAW 125 +#define MOVE_EFFECT_MAGNITUDE 126 +#define MOVE_EFFECT_BATON_PASS 127 +#define MOVE_EFFECT_PURSUIT 128 +#define MOVE_EFFECT_RAPID_SPIN 129 +#define MOVE_EFFECT_FIXED_20 130 +#define MOVE_EFFECT_UNK131 131 // unused +#define MOVE_EFFECT_RESTORE_HP_DAYTIME 132 +#define MOVE_EFFECT_UNK133 133 // unused +#define MOVE_EFFECT_UNK134 134 // unused +#define MOVE_EFFECT_HIDDEN_POWER 135 // unused +#define MOVE_EFFECT_RAIN 136 +#define MOVE_EFFECT_SUNNY 137 +#define MOVE_EFFECT_DEFENSE_UP_HIT 138 +#define MOVE_EFFECT_ATTACK_UP_HIT 139 +#define MOVE_EFFECT_STATS_UP_HIT 140 +#define MOVE_EFFECT_UNK141 141 // unused +#define MOVE_EFFECT_BELLY_DRUM 142 +#define MOVE_EFFECT_PSYCH_UP 143 +#define MOVE_EFFECT_MIRROR_COAT 144 +#define MOVE_EFFECT_SKULL_BASH 145 +#define MOVE_EFFECT_TWISTER 146 +#define MOVE_EFFECT_EARTHQUAKE 147 +#define MOVE_EFFECT_HIT_LATER 148 +#define MOVE_EFFECT_GUST 149 +#define MOVE_EFFECT_STOMP 150 +#define MOVE_EFFECT_SOLAR_BEAM 151 +#define MOVE_EFFECT_THUNDER 152 +#define MOVE_EFFECT_TELEPORT 153 +#define MOVE_EFFECT_BEAT_UP 154 +#define MOVE_EFFECT_FLY 155 +#define MOVE_EFFECT_DEFENSE_CURL 156 +#define MOVE_EFFECT_UNK157 157 // unused +#define MOVE_EFFECT_FAKE_OUT 158 +#define MOVE_EFFECT_UPROAR 159 +#define MOVE_EFFECT_STOCKPILE 160 +#define MOVE_EFFECT_SPIT_UP 161 +#define MOVE_EFFECT_SWALLOW 162 +#define MOVE_EFFECT_UNK163 163 // unused +#define MOVE_EFFECT_HAIL 164 +#define MOVE_EFFECT_TORMENT 165 +#define MOVE_EFFECT_FLATTER 166 +#define MOVE_EFFECT_BURN 167 +#define MOVE_EFFECT_MEMENTO 168 +#define MOVE_EFFECT_FACADE 169 +#define MOVE_EFFECT_FOCUS_PUNCH 170 +#define MOVE_EFFECT_SMELLING_SALTS 171 +#define MOVE_EFFECT_FOLLOW_ME 172 +#define MOVE_EFFECT_NATURE_POWER 173 +#define MOVE_EFFECT_CHARGE 174 +#define MOVE_EFFECT_TAUNT 175 +#define MOVE_EFFECT_HELPING_HAND 176 +#define MOVE_EFFECT_SWAP_ITEMS 177 +#define MOVE_EFFECT_ROLE_PLAY 178 +#define MOVE_EFFECT_WISH 179 +#define MOVE_EFFECT_ASSIST 180 +#define MOVE_EFFECT_INGRAIN 181 +#define MOVE_EFFECT_SUPERPOWER 182 +#define MOVE_EFFECT_MAGIC_COAT 183 +#define MOVE_EFFECT_RECYCLE 184 +#define MOVE_EFFECT_REVENGE 185 +#define MOVE_EFFECT_BRICK_BREAK 186 +#define MOVE_EFFECT_YAWN 187 +#define MOVE_EFFECT_KNOCK_OFF 188 +#define MOVE_EFFECT_ENDEAVOR 189 +#define MOVE_EFFECT_STRONGER_HIGH_HP 190 +#define MOVE_EFFECT_SKILL_SWAP 191 +#define MOVE_EFFECT_IMPRISON 192 +#define MOVE_EFFECT_REFRESH 193 +#define MOVE_EFFECT_GRUDGE 194 +#define MOVE_EFFECT_SNATCH 195 +#define MOVE_EFFECT_STRONGER_HEAVIER 196 +#define MOVE_EFFECT_SECRET_POWER 197 +#define MOVE_EFFECT_RECOIL_HIT_HARD 198 +#define MOVE_EFFECT_CONFUSE_ALL 199 +#define MOVE_EFFECT_BURN_HIT_HIGH_CRIT 200 +#define MOVE_EFFECT_MUD_SPORT 201 +#define MOVE_EFFECT_TOXIC_HIT 202 +#define MOVE_EFFECT_WEATHER_BALL 203 +#define MOVE_EFFECT_HIT_USER_SPATK_2_DOWN 204 +#define MOVE_EFFECT_ATTACK_DEFENSE_DOWN 205 +#define MOVE_EFFECT_DEFENSE_SPDEF_UP 206 +#define MOVE_EFFECT_SKY_UPPERCUT 207 +#define MOVE_EFFECT_ATTACK_DEFENSE_UP 208 +#define MOVE_EFFECT_POISON_HIT_HIGH_CRIT 209 +#define MOVE_EFFECT_WATER_SPORT 210 +#define MOVE_EFFECT_SPATK_SPDEF_UP 211 +#define MOVE_EFFECT_ATTACK_SPEED_UP 212 +#define MOVE_EFFECT_CAMOUFLAGE 213 +#define MOVE_EFFECT_ROOST 214 +#define MOVE_EFFECT_GRAVITY 215 +#define MOVE_EFFECT_MIRACLE_EYE 216 +#define MOVE_EFFECT_WAKE_UP_SLAP 217 +#define MOVE_EFFECT_HAMMER_ARM 218 +#define MOVE_EFFECT_GYRO_BALL 219 +#define MOVE_EFFECT_HEALING_WISH 220 +#define MOVE_EFFECT_BRINE 221 +#define MOVE_EFFECT_NATURAL_GIFT 222 +#define MOVE_EFFECT_FEINT 223 +#define MOVE_EFFECT_BUG_BITE 224 +#define MOVE_EFFECT_TAILWIND 225 +#define MOVE_EFFECT_ACUPRESSURE 226 +#define MOVE_EFFECT_METAL_BURST 227 +#define MOVE_EFFECT_U_TURN 228 +#define MOVE_EFFECT_CLOSE_COMBAT 229 +#define MOVE_EFFECT_PAYBACK 230 +#define MOVE_EFFECT_ASSURANCE 231 +#define MOVE_EFFECT_EMBARGO 232 +#define MOVE_EFFECT_FLING 233 +#define MOVE_EFFECT_PSYCHO_SHIFT 234 +#define MOVE_EFFECT_TRUMP_CARD 235 +#define MOVE_EFFECT_HEAL_BLOCK 236 +#define MOVE_EFFECT_CRUSH_GRIP 237 +#define MOVE_EFFECT_POWER_TRICK 238 +#define MOVE_EFFECT_GASTRO_ACID 239 +#define MOVE_EFFECT_LUCKY_CHANT 240 +#define MOVE_EFFECT_ME_FIRST 241 +#define MOVE_EFFECT_COPYCAT 242 +#define MOVE_EFFECT_POWER_SWAP 243 +#define MOVE_EFFECT_GUARD_SWAP 244 +#define MOVE_EFFECT_PUNISHMENT 245 +#define MOVE_EFFECT_LAST_RESORT 246 +#define MOVE_EFFECT_WORRY_SEED 247 +#define MOVE_EFFECT_SUCKER_PUNCH 248 +#define MOVE_EFFECT_TOXIC_SPIKES 249 +#define MOVE_EFFECT_HEART_SWAP 250 +#define MOVE_EFFECT_AQUA_RING 251 +#define MOVE_EFFECT_MAGNET_RISE 252 +#define MOVE_EFFECT_FLARE_BLITZ 253 +#define MOVE_EFFECT_STRUGGLE 254 +#define MOVE_EFFECT_DIVE 255 +#define MOVE_EFFECT_DIG 256 +#define MOVE_EFFECT_SURF 257 +#define MOVE_EFFECT_DEFOG 258 +#define MOVE_EFFECT_TRICK_ROOM 259 +#define MOVE_EFFECT_BLIZZARD 260 +#define MOVE_EFFECT_WHIRLPOOL 261 +#define MOVE_EFFECT_VOLT_TACKLE 262 +#define MOVE_EFFECT_BOUNCE 263 +#define MOVE_EFFECT_UNK264 264 // unused +#define MOVE_EFFECT_CAPTIVATE 265 +#define MOVE_EFFECT_STEALTH_ROCK 266 +#define MOVE_EFFECT_CHATTER 267 +#define MOVE_EFFECT_JUDGMENT 268 +#define MOVE_EFFECT_HEAD_SMASH 269 +#define MOVE_EFFECT_LUNAR_DANCE 270 +#define MOVE_EFFECT_SEED_FLARE 271 +#define MOVE_EFFECT_SHADOW_FORCE 272 +#define MOVE_EFFECT_FIRE_FANG 273 +#define MOVE_EFFECT_ICE_FANG 274 +#define MOVE_EFFECT_THUNDER_FANG 275 +#define MOVE_EFFECT_CHARGE_BEAM 276 - -#endif //POKEDIAMOND_CONSTANTS_BATTLE_H +#endif // POKEDIAMOND_CONSTANTS_BATTLE_H diff --git a/include/constants/charcode.h b/include/constants/charcode.h index e21508be7..0101b72ba 100644 --- a/include/constants/charcode.h +++ b/include/constants/charcode.h @@ -1,271 +1,271 @@ #ifndef POKEDIAMOND_CONSTANTS_CHARCODE_H #define POKEDIAMOND_CONSTANTS_CHARCODE_H -#define CHAR_NUL 0 -#define CHAR_JP_SPACE 1 +#define CHAR_NUL 0 +#define CHAR_JP_SPACE 1 -#define CHAR_JP_HIRA_A_SMALL 2 -#define CHAR_JP_HIRA_A 3 -#define CHAR_JP_HIRA_I_SMALL 4 -#define CHAR_JP_HIRA_I 5 -#define CHAR_JP_HIRA_U_SMALL 6 -#define CHAR_JP_HIRA_U 7 -#define CHAR_JP_HIRA_E_SMALL 8 -#define CHAR_JP_HIRA_E 9 -#define CHAR_JP_HIRA_O_SMALL 10 -#define CHAR_JP_HIRA_O 11 -#define CHAR_JP_HIRA_KA 12 -#define CHAR_JP_HIRA_GA 13 -#define CHAR_JP_HIRA_KI 14 -#define CHAR_JP_HIRA_GI 15 -#define CHAR_JP_HIRA_KU 16 -#define CHAR_JP_HIRA_GU 17 -#define CHAR_JP_HIRA_KE 18 -#define CHAR_JP_HIRA_GE 19 -#define CHAR_JP_HIRA_KO 20 -#define CHAR_JP_HIRA_GO 21 -#define CHAR_JP_HIRA_SA 22 -#define CHAR_JP_HIRA_ZA 23 -#define CHAR_JP_HIRA_SI 24 -#define CHAR_JP_HIRA_ZI 25 -#define CHAR_JP_HIRA_SU 26 -#define CHAR_JP_HIRA_ZU 27 -#define CHAR_JP_HIRA_SE 28 -#define CHAR_JP_HIRA_ZE 29 -#define CHAR_JP_HIRA_SO 30 -#define CHAR_JP_HIRA_ZO 31 -#define CHAR_JP_HIRA_TA 32 -#define CHAR_JP_HIRA_DA 33 -#define CHAR_JP_HIRA_TI 34 -#define CHAR_JP_HIRA_DI 35 -#define CHAR_JP_HIRA_TU_SMALL 36 -#define CHAR_JP_HIRA_TU 37 -#define CHAR_JP_HIRA_DU 38 -#define CHAR_JP_HIRA_TE 39 -#define CHAR_JP_HIRA_DE 40 -#define CHAR_JP_HIRA_TO 41 -#define CHAR_JP_HIRA_DO 42 -#define CHAR_JP_HIRA_NA 43 -#define CHAR_JP_HIRA_NI 44 -#define CHAR_JP_HIRA_NU 45 -#define CHAR_JP_HIRA_NE 46 -#define CHAR_JP_HIRA_NO 47 -#define CHAR_JP_HIRA_HA 48 -#define CHAR_JP_HIRA_BA 49 -#define CHAR_JP_HIRA_PA 50 -#define CHAR_JP_HIRA_HI 51 -#define CHAR_JP_HIRA_BI 52 -#define CHAR_JP_HIRA_PI 53 -#define CHAR_JP_HIRA_HU 54 -#define CHAR_JP_HIRA_BU 55 -#define CHAR_JP_HIRA_PU 56 -#define CHAR_JP_HIRA_HE 57 -#define CHAR_JP_HIRA_BE 58 -#define CHAR_JP_HIRA_PE 59 -#define CHAR_JP_HIRA_HO 60 -#define CHAR_JP_HIRA_BO 61 -#define CHAR_JP_HIRA_PO 62 -#define CHAR_JP_HIRA_MA 63 -#define CHAR_JP_HIRA_MI 64 -#define CHAR_JP_HIRA_MU 65 -#define CHAR_JP_HIRA_ME 66 -#define CHAR_JP_HIRA_MO 67 -#define CHAR_JP_HIRA_YA_SMALL 68 -#define CHAR_JP_HIRA_YA 69 -#define CHAR_JP_HIRA_YU_SMALL 70 -#define CHAR_JP_HIRA_YU 71 -#define CHAR_JP_HIRA_YO_SMALL 72 -#define CHAR_JP_HIRA_YO 73 -#define CHAR_JP_HIRA_RA 74 -#define CHAR_JP_HIRA_RI 75 -#define CHAR_JP_HIRA_RU 76 -#define CHAR_JP_HIRA_RE 77 -#define CHAR_JP_HIRA_RO 78 -#define CHAR_JP_HIRA_WA 79 -#define CHAR_JP_HIRA_WO 80 -#define CHAR_JP_HIRA_N_ 81 +#define CHAR_JP_HIRA_A_SMALL 2 +#define CHAR_JP_HIRA_A 3 +#define CHAR_JP_HIRA_I_SMALL 4 +#define CHAR_JP_HIRA_I 5 +#define CHAR_JP_HIRA_U_SMALL 6 +#define CHAR_JP_HIRA_U 7 +#define CHAR_JP_HIRA_E_SMALL 8 +#define CHAR_JP_HIRA_E 9 +#define CHAR_JP_HIRA_O_SMALL 10 +#define CHAR_JP_HIRA_O 11 +#define CHAR_JP_HIRA_KA 12 +#define CHAR_JP_HIRA_GA 13 +#define CHAR_JP_HIRA_KI 14 +#define CHAR_JP_HIRA_GI 15 +#define CHAR_JP_HIRA_KU 16 +#define CHAR_JP_HIRA_GU 17 +#define CHAR_JP_HIRA_KE 18 +#define CHAR_JP_HIRA_GE 19 +#define CHAR_JP_HIRA_KO 20 +#define CHAR_JP_HIRA_GO 21 +#define CHAR_JP_HIRA_SA 22 +#define CHAR_JP_HIRA_ZA 23 +#define CHAR_JP_HIRA_SI 24 +#define CHAR_JP_HIRA_ZI 25 +#define CHAR_JP_HIRA_SU 26 +#define CHAR_JP_HIRA_ZU 27 +#define CHAR_JP_HIRA_SE 28 +#define CHAR_JP_HIRA_ZE 29 +#define CHAR_JP_HIRA_SO 30 +#define CHAR_JP_HIRA_ZO 31 +#define CHAR_JP_HIRA_TA 32 +#define CHAR_JP_HIRA_DA 33 +#define CHAR_JP_HIRA_TI 34 +#define CHAR_JP_HIRA_DI 35 +#define CHAR_JP_HIRA_TU_SMALL 36 +#define CHAR_JP_HIRA_TU 37 +#define CHAR_JP_HIRA_DU 38 +#define CHAR_JP_HIRA_TE 39 +#define CHAR_JP_HIRA_DE 40 +#define CHAR_JP_HIRA_TO 41 +#define CHAR_JP_HIRA_DO 42 +#define CHAR_JP_HIRA_NA 43 +#define CHAR_JP_HIRA_NI 44 +#define CHAR_JP_HIRA_NU 45 +#define CHAR_JP_HIRA_NE 46 +#define CHAR_JP_HIRA_NO 47 +#define CHAR_JP_HIRA_HA 48 +#define CHAR_JP_HIRA_BA 49 +#define CHAR_JP_HIRA_PA 50 +#define CHAR_JP_HIRA_HI 51 +#define CHAR_JP_HIRA_BI 52 +#define CHAR_JP_HIRA_PI 53 +#define CHAR_JP_HIRA_HU 54 +#define CHAR_JP_HIRA_BU 55 +#define CHAR_JP_HIRA_PU 56 +#define CHAR_JP_HIRA_HE 57 +#define CHAR_JP_HIRA_BE 58 +#define CHAR_JP_HIRA_PE 59 +#define CHAR_JP_HIRA_HO 60 +#define CHAR_JP_HIRA_BO 61 +#define CHAR_JP_HIRA_PO 62 +#define CHAR_JP_HIRA_MA 63 +#define CHAR_JP_HIRA_MI 64 +#define CHAR_JP_HIRA_MU 65 +#define CHAR_JP_HIRA_ME 66 +#define CHAR_JP_HIRA_MO 67 +#define CHAR_JP_HIRA_YA_SMALL 68 +#define CHAR_JP_HIRA_YA 69 +#define CHAR_JP_HIRA_YU_SMALL 70 +#define CHAR_JP_HIRA_YU 71 +#define CHAR_JP_HIRA_YO_SMALL 72 +#define CHAR_JP_HIRA_YO 73 +#define CHAR_JP_HIRA_RA 74 +#define CHAR_JP_HIRA_RI 75 +#define CHAR_JP_HIRA_RU 76 +#define CHAR_JP_HIRA_RE 77 +#define CHAR_JP_HIRA_RO 78 +#define CHAR_JP_HIRA_WA 79 +#define CHAR_JP_HIRA_WO 80 +#define CHAR_JP_HIRA_N_ 81 -#define CHAR_JP_KATA_A_SMALL 82 -#define CHAR_JP_KATA_A 83 -#define CHAR_JP_KATA_I_SMALL 84 -#define CHAR_JP_KATA_I 85 -#define CHAR_JP_KATA_U_SMALL 86 -#define CHAR_JP_KATA_U 87 -#define CHAR_JP_KATA_E_SMALL 88 -#define CHAR_JP_KATA_E 89 -#define CHAR_JP_KATA_O_SMALL 90 -#define CHAR_JP_KATA_O 91 -#define CHAR_JP_KATA_KA 92 -#define CHAR_JP_KATA_GA 93 -#define CHAR_JP_KATA_KI 94 -#define CHAR_JP_KATA_GI 95 -#define CHAR_JP_KATA_KU 96 -#define CHAR_JP_KATA_GU 97 -#define CHAR_JP_KATA_KE 98 -#define CHAR_JP_KATA_GE 99 -#define CHAR_JP_KATA_KO 100 -#define CHAR_JP_KATA_GO 101 -#define CHAR_JP_KATA_SA 102 -#define CHAR_JP_KATA_ZA 103 -#define CHAR_JP_KATA_SI 104 -#define CHAR_JP_KATA_ZI 105 -#define CHAR_JP_KATA_SU 106 -#define CHAR_JP_KATA_ZU 107 -#define CHAR_JP_KATA_SE 108 -#define CHAR_JP_KATA_ZE 109 -#define CHAR_JP_KATA_SO 110 -#define CHAR_JP_KATA_ZO 111 -#define CHAR_JP_KATA_TA 112 -#define CHAR_JP_KATA_DA 113 -#define CHAR_JP_KATA_TI 114 -#define CHAR_JP_KATA_DI 115 -#define CHAR_JP_KATA_TU_SMALL 116 -#define CHAR_JP_KATA_TU 117 -#define CHAR_JP_KATA_DU 118 -#define CHAR_JP_KATA_TE 119 -#define CHAR_JP_KATA_DE 120 -#define CHAR_JP_KATA_TO 121 -#define CHAR_JP_KATA_DO 122 -#define CHAR_JP_KATA_NA 123 -#define CHAR_JP_KATA_NI 124 -#define CHAR_JP_KATA_NU 125 -#define CHAR_JP_KATA_NE 126 -#define CHAR_JP_KATA_NO 127 -#define CHAR_JP_KATA_HA 128 -#define CHAR_JP_KATA_BA 129 -#define CHAR_JP_KATA_PA 130 -#define CHAR_JP_KATA_HI 131 -#define CHAR_JP_KATA_BI 132 -#define CHAR_JP_KATA_PI 133 -#define CHAR_JP_KATA_HU 134 -#define CHAR_JP_KATA_BU 135 -#define CHAR_JP_KATA_PU 136 -#define CHAR_JP_KATA_HE 137 -#define CHAR_JP_KATA_BE 138 -#define CHAR_JP_KATA_PE 139 -#define CHAR_JP_KATA_HO 140 -#define CHAR_JP_KATA_BO 141 -#define CHAR_JP_KATA_PO 142 -#define CHAR_JP_KATA_MA 143 -#define CHAR_JP_KATA_MI 144 -#define CHAR_JP_KATA_MU 145 -#define CHAR_JP_KATA_ME 146 -#define CHAR_JP_KATA_MO 147 -#define CHAR_JP_KATA_YA_SMALL 148 -#define CHAR_JP_KATA_YA 149 -#define CHAR_JP_KATA_YU_SMALL 150 -#define CHAR_JP_KATA_YU 151 -#define CHAR_JP_KATA_YO_SMALL 152 -#define CHAR_JP_KATA_YO 153 -#define CHAR_JP_KATA_RA 154 -#define CHAR_JP_KATA_RI 155 -#define CHAR_JP_KATA_RU 156 -#define CHAR_JP_KATA_RE 157 -#define CHAR_JP_KATA_RO 158 -#define CHAR_JP_KATA_WA 159 -#define CHAR_JP_KATA_WO 160 -#define CHAR_JP_KATA_N_ 161 +#define CHAR_JP_KATA_A_SMALL 82 +#define CHAR_JP_KATA_A 83 +#define CHAR_JP_KATA_I_SMALL 84 +#define CHAR_JP_KATA_I 85 +#define CHAR_JP_KATA_U_SMALL 86 +#define CHAR_JP_KATA_U 87 +#define CHAR_JP_KATA_E_SMALL 88 +#define CHAR_JP_KATA_E 89 +#define CHAR_JP_KATA_O_SMALL 90 +#define CHAR_JP_KATA_O 91 +#define CHAR_JP_KATA_KA 92 +#define CHAR_JP_KATA_GA 93 +#define CHAR_JP_KATA_KI 94 +#define CHAR_JP_KATA_GI 95 +#define CHAR_JP_KATA_KU 96 +#define CHAR_JP_KATA_GU 97 +#define CHAR_JP_KATA_KE 98 +#define CHAR_JP_KATA_GE 99 +#define CHAR_JP_KATA_KO 100 +#define CHAR_JP_KATA_GO 101 +#define CHAR_JP_KATA_SA 102 +#define CHAR_JP_KATA_ZA 103 +#define CHAR_JP_KATA_SI 104 +#define CHAR_JP_KATA_ZI 105 +#define CHAR_JP_KATA_SU 106 +#define CHAR_JP_KATA_ZU 107 +#define CHAR_JP_KATA_SE 108 +#define CHAR_JP_KATA_ZE 109 +#define CHAR_JP_KATA_SO 110 +#define CHAR_JP_KATA_ZO 111 +#define CHAR_JP_KATA_TA 112 +#define CHAR_JP_KATA_DA 113 +#define CHAR_JP_KATA_TI 114 +#define CHAR_JP_KATA_DI 115 +#define CHAR_JP_KATA_TU_SMALL 116 +#define CHAR_JP_KATA_TU 117 +#define CHAR_JP_KATA_DU 118 +#define CHAR_JP_KATA_TE 119 +#define CHAR_JP_KATA_DE 120 +#define CHAR_JP_KATA_TO 121 +#define CHAR_JP_KATA_DO 122 +#define CHAR_JP_KATA_NA 123 +#define CHAR_JP_KATA_NI 124 +#define CHAR_JP_KATA_NU 125 +#define CHAR_JP_KATA_NE 126 +#define CHAR_JP_KATA_NO 127 +#define CHAR_JP_KATA_HA 128 +#define CHAR_JP_KATA_BA 129 +#define CHAR_JP_KATA_PA 130 +#define CHAR_JP_KATA_HI 131 +#define CHAR_JP_KATA_BI 132 +#define CHAR_JP_KATA_PI 133 +#define CHAR_JP_KATA_HU 134 +#define CHAR_JP_KATA_BU 135 +#define CHAR_JP_KATA_PU 136 +#define CHAR_JP_KATA_HE 137 +#define CHAR_JP_KATA_BE 138 +#define CHAR_JP_KATA_PE 139 +#define CHAR_JP_KATA_HO 140 +#define CHAR_JP_KATA_BO 141 +#define CHAR_JP_KATA_PO 142 +#define CHAR_JP_KATA_MA 143 +#define CHAR_JP_KATA_MI 144 +#define CHAR_JP_KATA_MU 145 +#define CHAR_JP_KATA_ME 146 +#define CHAR_JP_KATA_MO 147 +#define CHAR_JP_KATA_YA_SMALL 148 +#define CHAR_JP_KATA_YA 149 +#define CHAR_JP_KATA_YU_SMALL 150 +#define CHAR_JP_KATA_YU 151 +#define CHAR_JP_KATA_YO_SMALL 152 +#define CHAR_JP_KATA_YO 153 +#define CHAR_JP_KATA_RA 154 +#define CHAR_JP_KATA_RI 155 +#define CHAR_JP_KATA_RU 156 +#define CHAR_JP_KATA_RE 157 +#define CHAR_JP_KATA_RO 158 +#define CHAR_JP_KATA_WA 159 +#define CHAR_JP_KATA_WO 160 +#define CHAR_JP_KATA_N_ 161 -#define CHAR_JP_0 162 -#define CHAR_JP_1 163 -#define CHAR_JP_2 164 -#define CHAR_JP_3 165 -#define CHAR_JP_4 166 -#define CHAR_JP_5 167 -#define CHAR_JP_6 168 -#define CHAR_JP_7 169 -#define CHAR_JP_8 170 -#define CHAR_JP_9 171 -#define CHAR_JP_A 172 -#define CHAR_JP_B 173 -#define CHAR_JP_C 174 -#define CHAR_JP_D 175 -#define CHAR_JP_E 176 -#define CHAR_JP_F 177 +#define CHAR_JP_0 162 +#define CHAR_JP_1 163 +#define CHAR_JP_2 164 +#define CHAR_JP_3 165 +#define CHAR_JP_4 166 +#define CHAR_JP_5 167 +#define CHAR_JP_6 168 +#define CHAR_JP_7 169 +#define CHAR_JP_8 170 +#define CHAR_JP_9 171 +#define CHAR_JP_A 172 +#define CHAR_JP_B 173 +#define CHAR_JP_C 174 +#define CHAR_JP_D 175 +#define CHAR_JP_E 176 +#define CHAR_JP_F 177 -#define CHAR_JP_QUESTION_MARK 226 +#define CHAR_JP_QUESTION_MARK 226 -#define CHAR_JP_HYPHEN 241 +#define CHAR_JP_HYPHEN 241 -#define CHAR_0 289 -#define CHAR_1 290 -#define CHAR_2 291 -#define CHAR_3 292 -#define CHAR_4 293 -#define CHAR_5 294 -#define CHAR_6 295 -#define CHAR_7 296 -#define CHAR_8 297 -#define CHAR_9 298 -#define CHAR_A 299 -#define CHAR_B 300 -#define CHAR_C 301 -#define CHAR_D 302 -#define CHAR_E 303 -#define CHAR_F 304 -#define CHAR_G 305 -#define CHAR_H 306 -#define CHAR_I 307 -#define CHAR_J 308 -#define CHAR_K 309 -#define CHAR_L 310 -#define CHAR_M 311 -#define CHAR_N 312 -#define CHAR_O 313 -#define CHAR_P 314 -#define CHAR_Q 315 -#define CHAR_R 316 -#define CHAR_S 317 -#define CHAR_T 318 -#define CHAR_U 319 -#define CHAR_V 320 -#define CHAR_W 321 -#define CHAR_X 322 -#define CHAR_Y 323 -#define CHAR_Z 324 -#define CHAR_a 325 -#define CHAR_b 326 -#define CHAR_c 327 -#define CHAR_d 328 -#define CHAR_e 329 -#define CHAR_f 330 -#define CHAR_g 331 -#define CHAR_h 332 -#define CHAR_i 333 -#define CHAR_j 334 -#define CHAR_k 335 -#define CHAR_l 336 -#define CHAR_m 337 -#define CHAR_n 338 -#define CHAR_o 339 -#define CHAR_p 340 -#define CHAR_q 341 -#define CHAR_r 342 -#define CHAR_s 343 -#define CHAR_t 344 -#define CHAR_u 345 -#define CHAR_v 346 -#define CHAR_w 347 -#define CHAR_x 348 -#define CHAR_y 349 -#define CHAR_z 350 +#define CHAR_0 289 +#define CHAR_1 290 +#define CHAR_2 291 +#define CHAR_3 292 +#define CHAR_4 293 +#define CHAR_5 294 +#define CHAR_6 295 +#define CHAR_7 296 +#define CHAR_8 297 +#define CHAR_9 298 +#define CHAR_A 299 +#define CHAR_B 300 +#define CHAR_C 301 +#define CHAR_D 302 +#define CHAR_E 303 +#define CHAR_F 304 +#define CHAR_G 305 +#define CHAR_H 306 +#define CHAR_I 307 +#define CHAR_J 308 +#define CHAR_K 309 +#define CHAR_L 310 +#define CHAR_M 311 +#define CHAR_N 312 +#define CHAR_O 313 +#define CHAR_P 314 +#define CHAR_Q 315 +#define CHAR_R 316 +#define CHAR_S 317 +#define CHAR_T 318 +#define CHAR_U 319 +#define CHAR_V 320 +#define CHAR_W 321 +#define CHAR_X 322 +#define CHAR_Y 323 +#define CHAR_Z 324 +#define CHAR_a 325 +#define CHAR_b 326 +#define CHAR_c 327 +#define CHAR_d 328 +#define CHAR_e 329 +#define CHAR_f 330 +#define CHAR_g 331 +#define CHAR_h 332 +#define CHAR_i 333 +#define CHAR_j 334 +#define CHAR_k 335 +#define CHAR_l 336 +#define CHAR_m 337 +#define CHAR_n 338 +#define CHAR_o 339 +#define CHAR_p 340 +#define CHAR_q 341 +#define CHAR_r 342 +#define CHAR_s 343 +#define CHAR_t 344 +#define CHAR_u 345 +#define CHAR_v 346 +#define CHAR_w 347 +#define CHAR_x 348 +#define CHAR_y 349 +#define CHAR_z 350 -#define CHAR_ELLIPSIS 431 +#define CHAR_ELLIPSIS 431 -#define CHAR_HYPHEN 446 +#define CHAR_HYPHEN 446 -#define CHAR_SPACE 478 +#define CHAR_SPACE 478 -#define CHAR_NARROW_SPACE 482 +#define CHAR_NARROW_SPACE 482 -#define CHAR_ONE_DOT 491 -#define CHAR_TWO_DOTS 492 +#define CHAR_ONE_DOT 491 +#define CHAR_TWO_DOTS 492 -#define CHAR_LF 0xE000 -#define TRNAMECODE 0xF100 +#define CHAR_LF 0xE000 +#define TRNAMECODE 0xF100 #define EXT_CTRL_CODE_BEGIN 0xFFFE -#define EOS 0xFFFF // _EOM -#define TRNAME_MASK 0x1FF -#define EOS_TRNAME 0x1FF +#define EOS 0xFFFF // _EOM +#define TRNAME_MASK 0x1FF +#define EOS_TRNAME 0x1FF -#endif //POKEDIAMOND_CONSTANTS_CHARCODE_H +#endif // POKEDIAMOND_CONSTANTS_CHARCODE_H diff --git a/include/constants/decorations.h b/include/constants/decorations.h index 20ca34939..c3b65c9ff 100644 --- a/include/constants/decorations.h +++ b/include/constants/decorations.h @@ -1,144 +1,144 @@ #ifndef POKEDIAMOND_DECORATIONS_H #define POKEDIAMOND_DECORATIONS_H -#define DECORATION_NONE 0 -#define DECORATION_DUMMY_1 1 -#define DECORATION_DUMMY_2 2 -#define DECORATION_DUMMY_3 3 -#define DECORATION_DUMMY_4 4 -#define DECORATION_DUMMY_5 5 -#define DECORATION_BIG_BOULDER 6 -#define DECORATION_YELLOW_CUSHION 7 -#define DECORATION_BLUE_CUSHION 8 -#define DECORATION_WOODEN_CHAIR 9 -#define DECORATION_BIG_TABLE 10 -#define DECORATION_PLAIN_TABLE 11 -#define DECORATION_SMALL_TABLE 12 -#define DECORATION_LONG_TABLE 13 -#define DECORATION_WIDE_TABLE 14 -#define DECORATION_POKE_TABLE 15 -#define DECORATION_BIG_BOOKSHELF 16 -#define DECORATION_SMALL_BOOKSHELF 17 -#define DECORATION_RESEARCH_SHELF 18 -#define DECORATION_BIKE_RACK 19 -#define DECORATION_SHOP_SHELF 20 -#define DECORATION_DISPLAY_SHELF 21 -#define DECORATION_CUPBOARD 22 -#define DECORATION_WOOD_DRESSER 23 -#define DECORATION_PINK_DRESSER 24 -#define DECORATION_TV 25 -#define DECORATION_REFRIGERATOR 26 -#define DECORATION_PRETTY_SINK 27 -#define DECORATION_FEATHERY_BED 28 -#define DECORATION_TRASH_CAN 29 -#define DECORATION_CARDBOARD_BOX 30 -#define DECORATION_CRATE 31 -#define DECORATION_CONTAINER 32 -#define DECORATION_OIL_DRUM 33 -#define DECORATION_BIG_OIL_DRUM 34 -#define DECORATION_IRON_BEAM 35 -#define DECORATION_POTTED_PLANT 36 -#define DECORATION_POKE_FLOWER 37 -#define DECORATION_HEALING_MACHINE 38 -#define DECORATION_LAB_MACHINE 39 -#define DECORATION_TEST_MACHINE 40 -#define DECORATION_GAME_SYSTEM 41 -#define DECORATION_VENDING_MACHINE 42 -#define DECORATION_RED_BIKE 43 -#define DECORATION_GREEN_BIKE 44 -#define DECORATION_BINOCULARS 45 -#define DECORATION_GLOBE 46 -#define DECORATION_GYM_STATUE 47 -#define DECORATION_RED_TENT 48 -#define DECORATION_BLUE_TENT 49 -#define DECORATION_CLEAR_TENT 50 -#define DECORATION_MAZE_BLOCK_1 51 -#define DECORATION_MAZE_BLOCK_2 52 -#define DECORATION_MAZE_BLOCK_3 53 -#define DECORATION_MAZE_BLOCK_4 54 -#define DECORATION_MAZE_BLOCK_5 55 -#define DECORATION_HOLE_TOOL 56 -#define DECORATION_PIT_TOOL 57 -#define DECORATION_SMOKE_TOOL 58 -#define DECORATION_BIG_SMOKE_TOOL 59 -#define DECORATION_ROCK_TOOL 60 -#define DECORATION_ROCKFALL_TOOL 61 -#define DECORATION_FOAM_TOOL 62 -#define DECORATION_BUBBLE_TOOL 63 -#define DECORATION_ALERT_TOOL_1 64 -#define DECORATION_ALERT_TOOL_2 65 -#define DECORATION_ALERT_TOOL_3 66 -#define DECORATION_ALERT_TOOL_4 67 -#define DECORATION_LEAF_TOOL 68 -#define DECORATION_FLOWER_TOOL 69 -#define DECORATION_EMBER_TOOL 70 -#define DECORATION_FIRE_TOOL 71 -#define DECORATION_CUTE_CUP 72 -#define DECORATION_COOL_CUP 73 -#define DECORATION_BEAUTY_CUP 74 -#define DECORATION_TOUGH_CUP 75 -#define DECORATION_CLEVER_CUP 76 -#define DECORATION_BLUE_CRYSTAL 77 -#define DECORATION_PINK_CRYSTAL 78 -#define DECORATION_RED_CRYSTAL 79 -#define DECORATION_YELLOW_CRYSTAL 80 -#define DECORATION_PRETTY_GEM 81 -#define DECORATION_SHINY_GEM 82 -#define DECORATION_MYSTIC_GEM 83 -#define DECORATION_GLITTER_GEM 84 -#define DECORATION_BRONZE_TROPHY 85 -#define DECORATION_SILVER_TROPHY 86 -#define DECORATION_GOLD_TROPHY 87 -#define DECORATION_GREAT_TROPHY 88 -#define DECORATION_BALL_ORNAMENT 89 -#define DECORATION_ROUND_ORNAMENT 90 -#define DECORATION_CLEAR_ORNAMENT 91 -#define DECORATION_CHARMANDER_DOLL 92 -#define DECORATION_BULBASAUR_DOLL 93 -#define DECORATION_SQUIRTLE_DOLL 94 -#define DECORATION_CYNDAQUIL_DOLL 95 -#define DECORATION_CHIKORITA_DOLL 96 -#define DECORATION_TOTODILE_DOLL 97 -#define DECORATION_TORCHIC_DOLL 98 -#define DECORATION_TREECKO_DOLL 99 -#define DECORATION_MUDKIP_DOLL 100 -#define DECORATION_CHIMCHAR_DOLL 101 -#define DECORATION_TURTWIG_DOLL 102 -#define DECORATION_PIPLUP_DOLL 103 -#define DECORATION_PIKACHU_DOLL 104 -#define DECORATION_PLUSLE_DOLL 105 -#define DECORATION_MINUN_DOLL 106 -#define DECORATION_CLEFAIRY_DOLL 107 -#define DECORATION_JIGGLYPUFF_DOLL 108 -#define DECORATION_WOBBUFFET_DOLL 109 -#define DECORATION_MEOWTH_DOLL 110 -#define DECORATION_SKITTY_DOLL 111 -#define DECORATION_GLAMEOW_DOLL 112 -#define DECORATION_BUNEARY_DOLL 113 -#define DECORATION_WEAVILE_DOLL 114 -#define DECORATION_MUNCHLAX_DOLL 115 -#define DECORATION_BONSLY_DOLL 116 -#define DECORATION_MIME_JR__DOLL 117 -#define DECORATION_LUCARIO_DOLL 118 -#define DECORATION_MANTYKE_DOLL 119 -#define DECORATION_BUIZEL_DOLL 120 -#define DECORATION_CHATOT_DOLL 121 -#define DECORATION_MANAPHY_DOLL 122 -#define DECORATION_SNORLAX_DOLL 123 -#define DECORATION_WAILORD_DOLL 124 -#define DECORATION_MAGNEZONE_DOLL 125 -#define DECORATION_DRIFLOON_DOLL 126 -#define DECORATION_HAPPINY_DOLL 127 -#define DECORATION_PACHIRISU_DOLL 128 -#define DECORATION_129 129 -#define DECORATION_130 130 -#define DECORATION_131 131 -#define DECORATION_132 132 -#define DECORATION_WIDE_SOFA 133 -#define DECORATION_BONSAI 134 -#define DECORATION_DAINTY_FLOWERS 135 -#define DECORATION_LOVELY_FLOWERS 136 -#define DECORATION_PRETTY_FLOWERS 137 -#define DECORATION_LAVISH_FLOWERS 138 +#define DECORATION_NONE 0 +#define DECORATION_DUMMY_1 1 +#define DECORATION_DUMMY_2 2 +#define DECORATION_DUMMY_3 3 +#define DECORATION_DUMMY_4 4 +#define DECORATION_DUMMY_5 5 +#define DECORATION_BIG_BOULDER 6 +#define DECORATION_YELLOW_CUSHION 7 +#define DECORATION_BLUE_CUSHION 8 +#define DECORATION_WOODEN_CHAIR 9 +#define DECORATION_BIG_TABLE 10 +#define DECORATION_PLAIN_TABLE 11 +#define DECORATION_SMALL_TABLE 12 +#define DECORATION_LONG_TABLE 13 +#define DECORATION_WIDE_TABLE 14 +#define DECORATION_POKE_TABLE 15 +#define DECORATION_BIG_BOOKSHELF 16 +#define DECORATION_SMALL_BOOKSHELF 17 +#define DECORATION_RESEARCH_SHELF 18 +#define DECORATION_BIKE_RACK 19 +#define DECORATION_SHOP_SHELF 20 +#define DECORATION_DISPLAY_SHELF 21 +#define DECORATION_CUPBOARD 22 +#define DECORATION_WOOD_DRESSER 23 +#define DECORATION_PINK_DRESSER 24 +#define DECORATION_TV 25 +#define DECORATION_REFRIGERATOR 26 +#define DECORATION_PRETTY_SINK 27 +#define DECORATION_FEATHERY_BED 28 +#define DECORATION_TRASH_CAN 29 +#define DECORATION_CARDBOARD_BOX 30 +#define DECORATION_CRATE 31 +#define DECORATION_CONTAINER 32 +#define DECORATION_OIL_DRUM 33 +#define DECORATION_BIG_OIL_DRUM 34 +#define DECORATION_IRON_BEAM 35 +#define DECORATION_POTTED_PLANT 36 +#define DECORATION_POKE_FLOWER 37 +#define DECORATION_HEALING_MACHINE 38 +#define DECORATION_LAB_MACHINE 39 +#define DECORATION_TEST_MACHINE 40 +#define DECORATION_GAME_SYSTEM 41 +#define DECORATION_VENDING_MACHINE 42 +#define DECORATION_RED_BIKE 43 +#define DECORATION_GREEN_BIKE 44 +#define DECORATION_BINOCULARS 45 +#define DECORATION_GLOBE 46 +#define DECORATION_GYM_STATUE 47 +#define DECORATION_RED_TENT 48 +#define DECORATION_BLUE_TENT 49 +#define DECORATION_CLEAR_TENT 50 +#define DECORATION_MAZE_BLOCK_1 51 +#define DECORATION_MAZE_BLOCK_2 52 +#define DECORATION_MAZE_BLOCK_3 53 +#define DECORATION_MAZE_BLOCK_4 54 +#define DECORATION_MAZE_BLOCK_5 55 +#define DECORATION_HOLE_TOOL 56 +#define DECORATION_PIT_TOOL 57 +#define DECORATION_SMOKE_TOOL 58 +#define DECORATION_BIG_SMOKE_TOOL 59 +#define DECORATION_ROCK_TOOL 60 +#define DECORATION_ROCKFALL_TOOL 61 +#define DECORATION_FOAM_TOOL 62 +#define DECORATION_BUBBLE_TOOL 63 +#define DECORATION_ALERT_TOOL_1 64 +#define DECORATION_ALERT_TOOL_2 65 +#define DECORATION_ALERT_TOOL_3 66 +#define DECORATION_ALERT_TOOL_4 67 +#define DECORATION_LEAF_TOOL 68 +#define DECORATION_FLOWER_TOOL 69 +#define DECORATION_EMBER_TOOL 70 +#define DECORATION_FIRE_TOOL 71 +#define DECORATION_CUTE_CUP 72 +#define DECORATION_COOL_CUP 73 +#define DECORATION_BEAUTY_CUP 74 +#define DECORATION_TOUGH_CUP 75 +#define DECORATION_CLEVER_CUP 76 +#define DECORATION_BLUE_CRYSTAL 77 +#define DECORATION_PINK_CRYSTAL 78 +#define DECORATION_RED_CRYSTAL 79 +#define DECORATION_YELLOW_CRYSTAL 80 +#define DECORATION_PRETTY_GEM 81 +#define DECORATION_SHINY_GEM 82 +#define DECORATION_MYSTIC_GEM 83 +#define DECORATION_GLITTER_GEM 84 +#define DECORATION_BRONZE_TROPHY 85 +#define DECORATION_SILVER_TROPHY 86 +#define DECORATION_GOLD_TROPHY 87 +#define DECORATION_GREAT_TROPHY 88 +#define DECORATION_BALL_ORNAMENT 89 +#define DECORATION_ROUND_ORNAMENT 90 +#define DECORATION_CLEAR_ORNAMENT 91 +#define DECORATION_CHARMANDER_DOLL 92 +#define DECORATION_BULBASAUR_DOLL 93 +#define DECORATION_SQUIRTLE_DOLL 94 +#define DECORATION_CYNDAQUIL_DOLL 95 +#define DECORATION_CHIKORITA_DOLL 96 +#define DECORATION_TOTODILE_DOLL 97 +#define DECORATION_TORCHIC_DOLL 98 +#define DECORATION_TREECKO_DOLL 99 +#define DECORATION_MUDKIP_DOLL 100 +#define DECORATION_CHIMCHAR_DOLL 101 +#define DECORATION_TURTWIG_DOLL 102 +#define DECORATION_PIPLUP_DOLL 103 +#define DECORATION_PIKACHU_DOLL 104 +#define DECORATION_PLUSLE_DOLL 105 +#define DECORATION_MINUN_DOLL 106 +#define DECORATION_CLEFAIRY_DOLL 107 +#define DECORATION_JIGGLYPUFF_DOLL 108 +#define DECORATION_WOBBUFFET_DOLL 109 +#define DECORATION_MEOWTH_DOLL 110 +#define DECORATION_SKITTY_DOLL 111 +#define DECORATION_GLAMEOW_DOLL 112 +#define DECORATION_BUNEARY_DOLL 113 +#define DECORATION_WEAVILE_DOLL 114 +#define DECORATION_MUNCHLAX_DOLL 115 +#define DECORATION_BONSLY_DOLL 116 +#define DECORATION_MIME_JR__DOLL 117 +#define DECORATION_LUCARIO_DOLL 118 +#define DECORATION_MANTYKE_DOLL 119 +#define DECORATION_BUIZEL_DOLL 120 +#define DECORATION_CHATOT_DOLL 121 +#define DECORATION_MANAPHY_DOLL 122 +#define DECORATION_SNORLAX_DOLL 123 +#define DECORATION_WAILORD_DOLL 124 +#define DECORATION_MAGNEZONE_DOLL 125 +#define DECORATION_DRIFLOON_DOLL 126 +#define DECORATION_HAPPINY_DOLL 127 +#define DECORATION_PACHIRISU_DOLL 128 +#define DECORATION_129 129 +#define DECORATION_130 130 +#define DECORATION_131 131 +#define DECORATION_132 132 +#define DECORATION_WIDE_SOFA 133 +#define DECORATION_BONSAI 134 +#define DECORATION_DAINTY_FLOWERS 135 +#define DECORATION_LOVELY_FLOWERS 136 +#define DECORATION_PRETTY_FLOWERS 137 +#define DECORATION_LAVISH_FLOWERS 138 -#endif //POKEDIAMOND_DECORATIONS_H +#endif // POKEDIAMOND_DECORATIONS_H diff --git a/include/constants/easy_chat.h b/include/constants/easy_chat.h index 2311df004..9186a03a7 100644 --- a/include/constants/easy_chat.h +++ b/include/constants/easy_chat.h @@ -1,458 +1,458 @@ #ifndef POKEDIAMOND_CONSTANTS_EASY_CHAT_H #define POKEDIAMOND_CONSTANTS_EASY_CHAT_H -#define EC_GROUP_POKEMON (0) -#define EC_GROUP_MOVE (1) -#define EC_GROUP_TYPE (2) -#define EC_GROUP_ABILITY (3) -#define EC_GROUP_TRAINER (4) -#define EC_GROUP_PEOPLE (5) -#define EC_GROUP_GREETINGS (6) -#define EC_GROUP_LIFESTYLE (7) -#define EC_GROUP_FEELINGS (8) +#define EC_GROUP_POKEMON (0) +#define EC_GROUP_MOVE (1) +#define EC_GROUP_TYPE (2) +#define EC_GROUP_ABILITY (3) +#define EC_GROUP_TRAINER (4) +#define EC_GROUP_PEOPLE (5) +#define EC_GROUP_GREETINGS (6) +#define EC_GROUP_LIFESTYLE (7) +#define EC_GROUP_FEELINGS (8) #define EC_GROUP_TOUGH_WORDS (9) -#define EC_GROUP_UNION (10) +#define EC_GROUP_UNION (10) -#define EC_WORDS_POKEMON_MIN (0) -#define EC_WORDS_POKEMON_MAX (496) -#define EC_WORDS_POKEMON_COUNT (496) -#define EC_WORDS_MOVE_MIN (496) -#define EC_WORDS_MOVE_MAX (964) -#define EC_WORDS_MOVE_COUNT (468) -#define EC_WORDS_TYPE_MIN (964) -#define EC_WORDS_TYPE_MAX (982) -#define EC_WORDS_TYPE_COUNT (18) -#define EC_WORDS_ABILITY_MIN (982) -#define EC_WORDS_ABILITY_MAX (1106) -#define EC_WORDS_ABILITY_COUNT (124) -#define EC_WORDS_TRAINER_MIN (1106) -#define EC_WORDS_TRAINER_MAX (1144) -#define EC_WORDS_TRAINER_COUNT (38) -#define EC_WORDS_PEOPLE_MIN (1144) -#define EC_WORDS_PEOPLE_MAX (1182) -#define EC_WORDS_PEOPLE_COUNT (38) -#define EC_WORDS_GREETINGS_MIN (1182) -#define EC_WORDS_GREETINGS_MAX (1289) -#define EC_WORDS_GREETINGS_COUNT (107) -#define EC_WORDS_LIFESTYLE_MIN (1289) -#define EC_WORDS_LIFESTYLE_MAX (1393) -#define EC_WORDS_LIFESTYLE_COUNT (104) -#define EC_WORDS_FEELINGS_MIN (1393) -#define EC_WORDS_FEELINGS_MAX (1440) -#define EC_WORDS_FEELINGS_COUNT (47) -#define EC_WORDS_TOUGH_WORDS_MIN (1440) -#define EC_WORDS_TOUGH_WORDS_MAX (1472) +#define EC_WORDS_POKEMON_MIN (0) +#define EC_WORDS_POKEMON_MAX (496) +#define EC_WORDS_POKEMON_COUNT (496) +#define EC_WORDS_MOVE_MIN (496) +#define EC_WORDS_MOVE_MAX (964) +#define EC_WORDS_MOVE_COUNT (468) +#define EC_WORDS_TYPE_MIN (964) +#define EC_WORDS_TYPE_MAX (982) +#define EC_WORDS_TYPE_COUNT (18) +#define EC_WORDS_ABILITY_MIN (982) +#define EC_WORDS_ABILITY_MAX (1106) +#define EC_WORDS_ABILITY_COUNT (124) +#define EC_WORDS_TRAINER_MIN (1106) +#define EC_WORDS_TRAINER_MAX (1144) +#define EC_WORDS_TRAINER_COUNT (38) +#define EC_WORDS_PEOPLE_MIN (1144) +#define EC_WORDS_PEOPLE_MAX (1182) +#define EC_WORDS_PEOPLE_COUNT (38) +#define EC_WORDS_GREETINGS_MIN (1182) +#define EC_WORDS_GREETINGS_MAX (1289) +#define EC_WORDS_GREETINGS_COUNT (107) +#define EC_WORDS_LIFESTYLE_MIN (1289) +#define EC_WORDS_LIFESTYLE_MAX (1393) +#define EC_WORDS_LIFESTYLE_COUNT (104) +#define EC_WORDS_FEELINGS_MIN (1393) +#define EC_WORDS_FEELINGS_MAX (1440) +#define EC_WORDS_FEELINGS_COUNT (47) +#define EC_WORDS_TOUGH_WORDS_MIN (1440) +#define EC_WORDS_TOUGH_WORDS_MAX (1472) #define EC_WORDS_TOUGH_WORDS_COUNT (32) -#define EC_WORDS_UNION_MIN (1472) -#define EC_WORDS_UNION_MAX (1495) -#define EC_WORDS_UNION_COUNT (23) +#define EC_WORDS_UNION_MIN (1472) +#define EC_WORDS_UNION_MAX (1495) +#define EC_WORDS_UNION_COUNT (23) -#define EC_WORD_POKEMON(species) (0+species) +#define EC_WORD_POKEMON(species) (0 + species) -#define EC_WORD_MOVE(move) (496+move) +#define EC_WORD_MOVE(move) (496 + move) -#define EC_WORD_TYPE(type) (964+type) +#define EC_WORD_TYPE(type) (964 + type) -#define EC_WORD_ABILITY(ability) (982+ability) +#define EC_WORD_ABILITY(ability) (982 + ability) -#define EC_WORD_TRAINER_MATCH_UP (1106) -#define EC_WORD_TRAINER_NO_1 (1107) -#define EC_WORD_TRAINER_PREPARATION (1108) -#define EC_WORD_TRAINER_WINS (1109) -#define EC_WORD_TRAINER_NO_MATCH (1110) -#define EC_WORD_TRAINER_SPIRIT (1111) -#define EC_WORD_TRAINER_ACE_CARD (1112) -#define EC_WORD_TRAINER_COME_ON (1113) -#define EC_WORD_TRAINER_ATTACK (1114) -#define EC_WORD_TRAINER_SURRENDER (1115) -#define EC_WORD_TRAINER_COURAGE (1116) -#define EC_WORD_TRAINER_TALENT (1117) -#define EC_WORD_TRAINER_STRATEGY (1118) -#define EC_WORD_TRAINER_MATCH (1119) -#define EC_WORD_TRAINER_VICTORY (1120) -#define EC_WORD_TRAINER_SENSE (1121) -#define EC_WORD_TRAINER_VERSUS (1122) -#define EC_WORD_TRAINER_FIGHTS (1123) -#define EC_WORD_TRAINER_POWER (1124) -#define EC_WORD_TRAINER_CHALLENGE (1125) -#define EC_WORD_TRAINER_STRONG (1126) +#define EC_WORD_TRAINER_MATCH_UP (1106) +#define EC_WORD_TRAINER_NO_1 (1107) +#define EC_WORD_TRAINER_PREPARATION (1108) +#define EC_WORD_TRAINER_WINS (1109) +#define EC_WORD_TRAINER_NO_MATCH (1110) +#define EC_WORD_TRAINER_SPIRIT (1111) +#define EC_WORD_TRAINER_ACE_CARD (1112) +#define EC_WORD_TRAINER_COME_ON (1113) +#define EC_WORD_TRAINER_ATTACK (1114) +#define EC_WORD_TRAINER_SURRENDER (1115) +#define EC_WORD_TRAINER_COURAGE (1116) +#define EC_WORD_TRAINER_TALENT (1117) +#define EC_WORD_TRAINER_STRATEGY (1118) +#define EC_WORD_TRAINER_MATCH (1119) +#define EC_WORD_TRAINER_VICTORY (1120) +#define EC_WORD_TRAINER_SENSE (1121) +#define EC_WORD_TRAINER_VERSUS (1122) +#define EC_WORD_TRAINER_FIGHTS (1123) +#define EC_WORD_TRAINER_POWER (1124) +#define EC_WORD_TRAINER_CHALLENGE (1125) +#define EC_WORD_TRAINER_STRONG (1126) #define EC_WORD_TRAINER_TAKE_IT_EASY (1127) -#define EC_WORD_TRAINER_FOE (1128) -#define EC_WORD_TRAINER_GENIUS (1129) -#define EC_WORD_TRAINER_LEGEND (1130) -#define EC_WORD_TRAINER_BATTLE (1131) -#define EC_WORD_TRAINER_FIGHT (1132) -#define EC_WORD_TRAINER_REVIVE (1133) -#define EC_WORD_TRAINER_POINTS (1134) -#define EC_WORD_TRAINER_SERIOUS (1135) -#define EC_WORD_TRAINER_LOSS (1136) -#define EC_WORD_TRAINER_PARTNER (1137) -#define EC_WORD_TRAINER_INVINCIBLE (1138) -#define EC_WORD_TRAINER_EASY (1139) -#define EC_WORD_TRAINER_WEAK (1140) -#define EC_WORD_TRAINER_EASY_WIN (1141) -#define EC_WORD_TRAINER_MOVE (1142) -#define EC_WORD_TRAINER_TRAINER (1143) +#define EC_WORD_TRAINER_FOE (1128) +#define EC_WORD_TRAINER_GENIUS (1129) +#define EC_WORD_TRAINER_LEGEND (1130) +#define EC_WORD_TRAINER_BATTLE (1131) +#define EC_WORD_TRAINER_FIGHT (1132) +#define EC_WORD_TRAINER_REVIVE (1133) +#define EC_WORD_TRAINER_POINTS (1134) +#define EC_WORD_TRAINER_SERIOUS (1135) +#define EC_WORD_TRAINER_LOSS (1136) +#define EC_WORD_TRAINER_PARTNER (1137) +#define EC_WORD_TRAINER_INVINCIBLE (1138) +#define EC_WORD_TRAINER_EASY (1139) +#define EC_WORD_TRAINER_WEAK (1140) +#define EC_WORD_TRAINER_EASY_WIN (1141) +#define EC_WORD_TRAINER_MOVE (1142) +#define EC_WORD_TRAINER_TRAINER (1143) -#define EC_WORD_PEOPLE_OPPONENT (1144) -#define EC_WORD_PEOPLE_I (1145) -#define EC_WORD_PEOPLE_YOU (1146) -#define EC_WORD_PEOPLE_MOTHER (1147) +#define EC_WORD_PEOPLE_OPPONENT (1144) +#define EC_WORD_PEOPLE_I (1145) +#define EC_WORD_PEOPLE_YOU (1146) +#define EC_WORD_PEOPLE_MOTHER (1147) #define EC_WORD_PEOPLE_GRANDFATHER (1148) -#define EC_WORD_PEOPLE_UNCLE (1149) -#define EC_WORD_PEOPLE_FATHER (1150) -#define EC_WORD_PEOPLE_BOY (1151) -#define EC_WORD_PEOPLE_ADULT (1152) -#define EC_WORD_PEOPLE_BROTHER (1153) -#define EC_WORD_PEOPLE_SISTER (1154) +#define EC_WORD_PEOPLE_UNCLE (1149) +#define EC_WORD_PEOPLE_FATHER (1150) +#define EC_WORD_PEOPLE_BOY (1151) +#define EC_WORD_PEOPLE_ADULT (1152) +#define EC_WORD_PEOPLE_BROTHER (1153) +#define EC_WORD_PEOPLE_SISTER (1154) #define EC_WORD_PEOPLE_GRANDMOTHER (1155) -#define EC_WORD_PEOPLE_AUNT (1156) -#define EC_WORD_PEOPLE_PARENT (1157) -#define EC_WORD_PEOPLE_OLD_MAN (1158) -#define EC_WORD_PEOPLE_ME (1159) -#define EC_WORD_PEOPLE_GIRL (1160) -#define EC_WORD_PEOPLE_GAL (1161) -#define EC_WORD_PEOPLE_FAMILY (1162) -#define EC_WORD_PEOPLE_HER (1163) -#define EC_WORD_PEOPLE_HIM (1164) -#define EC_WORD_PEOPLE_YOU_2 (1165) -#define EC_WORD_PEOPLE_SIBLINGS (1166) -#define EC_WORD_PEOPLE_KIDS (1167) -#define EC_WORD_PEOPLE_MR_ (1168) -#define EC_WORD_PEOPLE_MS_ (1169) -#define EC_WORD_PEOPLE_MYSELF (1170) -#define EC_WORD_PEOPLE_WHO (1171) -#define EC_WORD_PEOPLE_FRIEND (1172) -#define EC_WORD_PEOPLE_ALLY (1173) -#define EC_WORD_PEOPLE_PERSON (1174) -#define EC_WORD_PEOPLE_KIDS_2 (1175) -#define EC_WORD_PEOPLE_I_2 (1176) -#define EC_WORD_PEOPLE_EVERYONE (1177) -#define EC_WORD_PEOPLE_RIVAL (1178) -#define EC_WORD_PEOPLE_I_3 (1179) -#define EC_WORD_PEOPLE_I_4 (1180) -#define EC_WORD_PEOPLE_BABY (1181) +#define EC_WORD_PEOPLE_AUNT (1156) +#define EC_WORD_PEOPLE_PARENT (1157) +#define EC_WORD_PEOPLE_OLD_MAN (1158) +#define EC_WORD_PEOPLE_ME (1159) +#define EC_WORD_PEOPLE_GIRL (1160) +#define EC_WORD_PEOPLE_GAL (1161) +#define EC_WORD_PEOPLE_FAMILY (1162) +#define EC_WORD_PEOPLE_HER (1163) +#define EC_WORD_PEOPLE_HIM (1164) +#define EC_WORD_PEOPLE_YOU_2 (1165) +#define EC_WORD_PEOPLE_SIBLINGS (1166) +#define EC_WORD_PEOPLE_KIDS (1167) +#define EC_WORD_PEOPLE_MR_ (1168) +#define EC_WORD_PEOPLE_MS_ (1169) +#define EC_WORD_PEOPLE_MYSELF (1170) +#define EC_WORD_PEOPLE_WHO (1171) +#define EC_WORD_PEOPLE_FRIEND (1172) +#define EC_WORD_PEOPLE_ALLY (1173) +#define EC_WORD_PEOPLE_PERSON (1174) +#define EC_WORD_PEOPLE_KIDS_2 (1175) +#define EC_WORD_PEOPLE_I_2 (1176) +#define EC_WORD_PEOPLE_EVERYONE (1177) +#define EC_WORD_PEOPLE_RIVAL (1178) +#define EC_WORD_PEOPLE_I_3 (1179) +#define EC_WORD_PEOPLE_I_4 (1180) +#define EC_WORD_PEOPLE_BABY (1181) -#define EC_WORD_GREETINGS_KONNICHIWA (1182) -#define EC_WORD_GREETINGS_HELLO (1183) -#define EC_WORD_GREETINGS_BONJOUR (1184) -#define EC_WORD_GREETINGS_CIAO (1185) -#define EC_WORD_GREETINGS_HALLO (1186) -#define EC_WORD_GREETINGS_HOLA (1187) -#define EC_WORD_GREETINGS_OH_WELL (1188) -#define EC_WORD_GREETINGS_AAH (1189) -#define EC_WORD_GREETINGS_AHAHA (1190) -#define EC_WORD_GREETINGS_HUH_ (1191) -#define EC_WORD_GREETINGS_THANKS (1192) -#define EC_WORD_GREETINGS_NO_PROBLEM (1193) -#define EC_WORD_GREETINGS_NOPE (1194) -#define EC_WORD_GREETINGS_YES (1195) -#define EC_WORD_GREETINGS_HERE_GOES (1196) -#define EC_WORD_GREETINGS_LET_S_GO (1197) -#define EC_WORD_GREETINGS_HERE_I_COME (1198) -#define EC_WORD_GREETINGS_YEAH (1199) -#define EC_WORD_GREETINGS_WELCOME (1200) -#define EC_WORD_GREETINGS_URGH (1201) +#define EC_WORD_GREETINGS_KONNICHIWA (1182) +#define EC_WORD_GREETINGS_HELLO (1183) +#define EC_WORD_GREETINGS_BONJOUR (1184) +#define EC_WORD_GREETINGS_CIAO (1185) +#define EC_WORD_GREETINGS_HALLO (1186) +#define EC_WORD_GREETINGS_HOLA (1187) +#define EC_WORD_GREETINGS_OH_WELL (1188) +#define EC_WORD_GREETINGS_AAH (1189) +#define EC_WORD_GREETINGS_AHAHA (1190) +#define EC_WORD_GREETINGS_HUH_ (1191) +#define EC_WORD_GREETINGS_THANKS (1192) +#define EC_WORD_GREETINGS_NO_PROBLEM (1193) +#define EC_WORD_GREETINGS_NOPE (1194) +#define EC_WORD_GREETINGS_YES (1195) +#define EC_WORD_GREETINGS_HERE_GOES (1196) +#define EC_WORD_GREETINGS_LET_S_GO (1197) +#define EC_WORD_GREETINGS_HERE_I_COME (1198) +#define EC_WORD_GREETINGS_YEAH (1199) +#define EC_WORD_GREETINGS_WELCOME (1200) +#define EC_WORD_GREETINGS_URGH (1201) #define EC_WORD_GREETINGS_LET_ME_THINK (1202) -#define EC_WORD_GREETINGS_HMM (1203) -#define EC_WORD_GREETINGS_WHOA (1204) -#define EC_WORD_GREETINGS_WROOOAAR_ (1205) -#define EC_WORD_GREETINGS_WOW (1206) -#define EC_WORD_GREETINGS_SNICKER (1207) -#define EC_WORD_GREETINGS_CUTE_LAUGH (1208) +#define EC_WORD_GREETINGS_HMM (1203) +#define EC_WORD_GREETINGS_WHOA (1204) +#define EC_WORD_GREETINGS_WROOOAAR_ (1205) +#define EC_WORD_GREETINGS_WOW (1206) +#define EC_WORD_GREETINGS_SNICKER (1207) +#define EC_WORD_GREETINGS_CUTE_LAUGH (1208) #define EC_WORD_GREETINGS_UNBELIEVABLE (1209) -#define EC_WORD_GREETINGS_CRIES (1210) -#define EC_WORD_GREETINGS_OK (1211) -#define EC_WORD_GREETINGS_AGREE (1212) -#define EC_WORD_GREETINGS_EH_ (1213) -#define EC_WORD_GREETINGS_BOO_HOO (1214) -#define EC_WORD_GREETINGS_HEHEHE (1215) -#define EC_WORD_GREETINGS_HEY (1216) -#define EC_WORD_GREETINGS_OH_YEAH (1217) -#define EC_WORD_GREETINGS_OH_WOW_ (1218) -#define EC_WORD_GREETINGS_HEEEY (1219) -#define EC_WORD_GREETINGS_GREETINGS (1220) -#define EC_WORD_GREETINGS_OOPS (1221) -#define EC_WORD_GREETINGS_WELL_DONE (1222) -#define EC_WORD_GREETINGS_OH_MY (1223) -#define EC_WORD_GREETINGS_EEK (1224) -#define EC_WORD_GREETINGS_YAAAH (1225) -#define EC_WORD_GREETINGS_GIGGLE (1226) -#define EC_WORD_GREETINGS_GIVE_ME (1227) -#define EC_WORD_GREETINGS_GWAHAHAHA (1228) -#define EC_WORD_GREETINGS_UGH (1229) -#define EC_WORD_GREETINGS_SORRY (1230) -#define EC_WORD_GREETINGS_FORGIVE_ME (1231) -#define EC_WORD_GREETINGS_I_M_SORRY (1232) -#define EC_WORD_GREETINGS_HEY_ (1233) -#define EC_WORD_GREETINGS_GOOD_BYE (1234) -#define EC_WORD_GREETINGS_THANK_YOU (1235) +#define EC_WORD_GREETINGS_CRIES (1210) +#define EC_WORD_GREETINGS_OK (1211) +#define EC_WORD_GREETINGS_AGREE (1212) +#define EC_WORD_GREETINGS_EH_ (1213) +#define EC_WORD_GREETINGS_BOO_HOO (1214) +#define EC_WORD_GREETINGS_HEHEHE (1215) +#define EC_WORD_GREETINGS_HEY (1216) +#define EC_WORD_GREETINGS_OH_YEAH (1217) +#define EC_WORD_GREETINGS_OH_WOW_ (1218) +#define EC_WORD_GREETINGS_HEEEY (1219) +#define EC_WORD_GREETINGS_GREETINGS (1220) +#define EC_WORD_GREETINGS_OOPS (1221) +#define EC_WORD_GREETINGS_WELL_DONE (1222) +#define EC_WORD_GREETINGS_OH_MY (1223) +#define EC_WORD_GREETINGS_EEK (1224) +#define EC_WORD_GREETINGS_YAAAH (1225) +#define EC_WORD_GREETINGS_GIGGLE (1226) +#define EC_WORD_GREETINGS_GIVE_ME (1227) +#define EC_WORD_GREETINGS_GWAHAHAHA (1228) +#define EC_WORD_GREETINGS_UGH (1229) +#define EC_WORD_GREETINGS_SORRY (1230) +#define EC_WORD_GREETINGS_FORGIVE_ME (1231) +#define EC_WORD_GREETINGS_I_M_SORRY (1232) +#define EC_WORD_GREETINGS_HEY_ (1233) +#define EC_WORD_GREETINGS_GOOD_BYE (1234) +#define EC_WORD_GREETINGS_THANK_YOU (1235) #define EC_WORD_GREETINGS_I_VE_ARRIVED (1236) -#define EC_WORD_GREETINGS_WEEP (1237) -#define EC_WORD_GREETINGS_PARDON_ME (1238) -#define EC_WORD_GREETINGS_SO_SORRY (1239) -#define EC_WORD_GREETINGS_SEE_YA (1240) -#define EC_WORD_GREETINGS_EXCUSE_ME (1241) -#define EC_WORD_GREETINGS_OKAY_THEN (1242) -#define EC_WORD_GREETINGS_TUT (1243) -#define EC_WORD_GREETINGS_BLUSH (1244) -#define EC_WORD_GREETINGS_GO_AHEAD (1245) -#define EC_WORD_GREETINGS_CHEERS (1246) -#define EC_WORD_GREETINGS_HEY__2 (1247) -#define EC_WORD_GREETINGS_WHAT_S_UP_ (1248) -#define EC_WORD_GREETINGS_HUH__2 (1249) -#define EC_WORD_GREETINGS_NO (1250) -#define EC_WORD_GREETINGS_SIGH (1251) -#define EC_WORD_GREETINGS_HI (1252) -#define EC_WORD_GREETINGS_YEP (1253) -#define EC_WORD_GREETINGS_YEAH_YEAH (1254) -#define EC_WORD_GREETINGS_BYE_BYE (1255) -#define EC_WORD_GREETINGS_MEET_YOU (1256) -#define EC_WORD_GREETINGS_HAHAHA (1257) -#define EC_WORD_GREETINGS_AIYEEH (1258) -#define EC_WORD_GREETINGS_HIYAH (1259) -#define EC_WORD_GREETINGS_MUHAHAHA (1260) -#define EC_WORD_GREETINGS_LOL (1261) -#define EC_WORD_GREETINGS_SNORT (1262) -#define EC_WORD_GREETINGS_HUMPH (1263) -#define EC_WORD_GREETINGS_HEY_2 (1264) -#define EC_WORD_GREETINGS_HE_HE_HE (1265) -#define EC_WORD_GREETINGS_HEH (1266) -#define EC_WORD_GREETINGS_HOHOHO (1267) +#define EC_WORD_GREETINGS_WEEP (1237) +#define EC_WORD_GREETINGS_PARDON_ME (1238) +#define EC_WORD_GREETINGS_SO_SORRY (1239) +#define EC_WORD_GREETINGS_SEE_YA (1240) +#define EC_WORD_GREETINGS_EXCUSE_ME (1241) +#define EC_WORD_GREETINGS_OKAY_THEN (1242) +#define EC_WORD_GREETINGS_TUT (1243) +#define EC_WORD_GREETINGS_BLUSH (1244) +#define EC_WORD_GREETINGS_GO_AHEAD (1245) +#define EC_WORD_GREETINGS_CHEERS (1246) +#define EC_WORD_GREETINGS_HEY__2 (1247) +#define EC_WORD_GREETINGS_WHAT_S_UP_ (1248) +#define EC_WORD_GREETINGS_HUH__2 (1249) +#define EC_WORD_GREETINGS_NO (1250) +#define EC_WORD_GREETINGS_SIGH (1251) +#define EC_WORD_GREETINGS_HI (1252) +#define EC_WORD_GREETINGS_YEP (1253) +#define EC_WORD_GREETINGS_YEAH_YEAH (1254) +#define EC_WORD_GREETINGS_BYE_BYE (1255) +#define EC_WORD_GREETINGS_MEET_YOU (1256) +#define EC_WORD_GREETINGS_HAHAHA (1257) +#define EC_WORD_GREETINGS_AIYEEH (1258) +#define EC_WORD_GREETINGS_HIYAH (1259) +#define EC_WORD_GREETINGS_MUHAHAHA (1260) +#define EC_WORD_GREETINGS_LOL (1261) +#define EC_WORD_GREETINGS_SNORT (1262) +#define EC_WORD_GREETINGS_HUMPH (1263) +#define EC_WORD_GREETINGS_HEY_2 (1264) +#define EC_WORD_GREETINGS_HE_HE_HE (1265) +#define EC_WORD_GREETINGS_HEH (1266) +#define EC_WORD_GREETINGS_HOHOHO (1267) #define EC_WORD_GREETINGS_THERE_YOU_GO (1268) -#define EC_WORD_GREETINGS_OH_DEAR (1269) -#define EC_WORD_GREETINGS_BYE_FOR_NOW (1270) -#define EC_WORD_GREETINGS_ANGRY (1271) -#define EC_WORD_GREETINGS_MUFUFU (1272) -#define EC_WORD_GREETINGS_MMM (1273) -#define EC_WORD_GREETINGS_HELLO_ (1274) -#define EC_WORD_GREETINGS_HI_THERE (1275) -#define EC_WORD_GREETINGS_NO_WAY (1276) -#define EC_WORD_GREETINGS_YAHOO (1277) -#define EC_WORD_GREETINGS_YO (1278) -#define EC_WORD_GREETINGS_WELCOME_2 (1279) -#define EC_WORD_GREETINGS_OK_2 (1280) -#define EC_WORD_GREETINGS_REGARDS (1281) -#define EC_WORD_GREETINGS_LALALA (1282) -#define EC_WORD_GREETINGS_YAY (1283) -#define EC_WORD_GREETINGS_WAIL (1284) -#define EC_WORD_GREETINGS_WOW_2 (1285) -#define EC_WORD_GREETINGS_BOO_ (1286) -#define EC_WORD_GREETINGS_WAHAHA (1287) -#define EC_WORD_GREETINGS__ (1288) +#define EC_WORD_GREETINGS_OH_DEAR (1269) +#define EC_WORD_GREETINGS_BYE_FOR_NOW (1270) +#define EC_WORD_GREETINGS_ANGRY (1271) +#define EC_WORD_GREETINGS_MUFUFU (1272) +#define EC_WORD_GREETINGS_MMM (1273) +#define EC_WORD_GREETINGS_HELLO_ (1274) +#define EC_WORD_GREETINGS_HI_THERE (1275) +#define EC_WORD_GREETINGS_NO_WAY (1276) +#define EC_WORD_GREETINGS_YAHOO (1277) +#define EC_WORD_GREETINGS_YO (1278) +#define EC_WORD_GREETINGS_WELCOME_2 (1279) +#define EC_WORD_GREETINGS_OK_2 (1280) +#define EC_WORD_GREETINGS_REGARDS (1281) +#define EC_WORD_GREETINGS_LALALA (1282) +#define EC_WORD_GREETINGS_YAY (1283) +#define EC_WORD_GREETINGS_WAIL (1284) +#define EC_WORD_GREETINGS_WOW_2 (1285) +#define EC_WORD_GREETINGS_BOO_ (1286) +#define EC_WORD_GREETINGS_WAHAHA (1287) +#define EC_WORD_GREETINGS__ (1288) -#define EC_WORD_LIFESTYLE_IDOL (1289) -#define EC_WORD_LIFESTYLE_TOMORROW (1290) -#define EC_WORD_LIFESTYLE_PLAYING (1291) -#define EC_WORD_LIFESTYLE_ANIME (1292) -#define EC_WORD_LIFESTYLE_JOB (1293) -#define EC_WORD_LIFESTYLE_SONG (1294) -#define EC_WORD_LIFESTYLE_HOME (1295) -#define EC_WORD_LIFESTYLE_MOVIE (1296) -#define EC_WORD_LIFESTYLE_SWEETS (1297) -#define EC_WORD_LIFESTYLE_MONEY (1298) +#define EC_WORD_LIFESTYLE_IDOL (1289) +#define EC_WORD_LIFESTYLE_TOMORROW (1290) +#define EC_WORD_LIFESTYLE_PLAYING (1291) +#define EC_WORD_LIFESTYLE_ANIME (1292) +#define EC_WORD_LIFESTYLE_JOB (1293) +#define EC_WORD_LIFESTYLE_SONG (1294) +#define EC_WORD_LIFESTYLE_HOME (1295) +#define EC_WORD_LIFESTYLE_MOVIE (1296) +#define EC_WORD_LIFESTYLE_SWEETS (1297) +#define EC_WORD_LIFESTYLE_MONEY (1298) #define EC_WORD_LIFESTYLE_POCKET_MONEY (1299) -#define EC_WORD_LIFESTYLE_CHIT_CHAT (1300) -#define EC_WORD_LIFESTYLE_TALK (1301) -#define EC_WORD_LIFESTYLE_BATH (1302) -#define EC_WORD_LIFESTYLE_PLAY_HOUSE (1303) -#define EC_WORD_LIFESTYLE_TOYS (1304) -#define EC_WORD_LIFESTYLE_MUSIC (1305) -#define EC_WORD_LIFESTYLE_CARDS (1306) -#define EC_WORD_LIFESTYLE_SHOPPING (1307) +#define EC_WORD_LIFESTYLE_CHIT_CHAT (1300) +#define EC_WORD_LIFESTYLE_TALK (1301) +#define EC_WORD_LIFESTYLE_BATH (1302) +#define EC_WORD_LIFESTYLE_PLAY_HOUSE (1303) +#define EC_WORD_LIFESTYLE_TOYS (1304) +#define EC_WORD_LIFESTYLE_MUSIC (1305) +#define EC_WORD_LIFESTYLE_CARDS (1306) +#define EC_WORD_LIFESTYLE_SHOPPING (1307) #define EC_WORD_LIFESTYLE_CONVERSATION (1308) -#define EC_WORD_LIFESTYLE_SCHOOL (1309) -#define EC_WORD_LIFESTYLE_CAMERA (1310) -#define EC_WORD_LIFESTYLE_VIEWING (1311) -#define EC_WORD_LIFESTYLE_SPECTATE (1312) -#define EC_WORD_LIFESTYLE_ANNIVERSARY (1313) -#define EC_WORD_LIFESTYLE_YESTERDAY (1314) -#define EC_WORD_LIFESTYLE_TODAY (1315) -#define EC_WORD_LIFESTYLE_HABIT (1316) -#define EC_WORD_LIFESTYLE_GROUP (1317) -#define EC_WORD_LIFESTYLE_GOURMET (1318) -#define EC_WORD_LIFESTYLE_GAME (1319) -#define EC_WORD_LIFESTYLE_WORD (1320) -#define EC_WORD_LIFESTYLE_COLLECTION (1321) -#define EC_WORD_LIFESTYLE_STORE (1322) -#define EC_WORD_LIFESTYLE_COMPLETE (1323) -#define EC_WORD_LIFESTYLE_SERVICE (1324) -#define EC_WORD_LIFESTYLE_MAGAZINE (1325) -#define EC_WORD_LIFESTYLE_WALK (1326) -#define EC_WORD_LIFESTYLE_WORK (1327) -#define EC_WORD_LIFESTYLE_SYSTEM (1328) -#define EC_WORD_LIFESTYLE_BICYCLE (1329) -#define EC_WORD_LIFESTYLE_TRAINING (1330) -#define EC_WORD_LIFESTYLE_CLASS (1331) -#define EC_WORD_LIFESTYLE_LESSONS (1332) -#define EC_WORD_LIFESTYLE_HOBBY (1333) -#define EC_WORD_LIFESTYLE_INFORMATION (1334) -#define EC_WORD_LIFESTYLE_SPORTS (1335) -#define EC_WORD_LIFESTYLE_DAILY_LIFE (1336) -#define EC_WORD_LIFESTYLE_TEACHER (1337) -#define EC_WORD_LIFESTYLE_SOFTWARE (1338) -#define EC_WORD_LIFESTYLE_SONGS (1339) -#define EC_WORD_LIFESTYLE_DIET (1340) -#define EC_WORD_LIFESTYLE_TOURNAMENT (1341) -#define EC_WORD_LIFESTYLE_TREASURE (1342) -#define EC_WORD_LIFESTYLE_TRAVEL (1343) -#define EC_WORD_LIFESTYLE_BIRTHDAY (1344) -#define EC_WORD_LIFESTYLE_DANCE (1345) -#define EC_WORD_LIFESTYLE_CHANNEL (1346) -#define EC_WORD_LIFESTYLE_FISHING (1347) -#define EC_WORD_LIFESTYLE_DATE (1348) -#define EC_WORD_LIFESTYLE_LETTER (1349) -#define EC_WORD_LIFESTYLE_EVENT (1350) -#define EC_WORD_LIFESTYLE_DESIGN (1351) -#define EC_WORD_LIFESTYLE_DIGITAL (1352) -#define EC_WORD_LIFESTYLE_TEST (1353) -#define EC_WORD_LIFESTYLE_DEPT_STORE (1354) -#define EC_WORD_LIFESTYLE_TELEVISION (1355) -#define EC_WORD_LIFESTYLE_TRAIN (1356) -#define EC_WORD_LIFESTYLE_PHONE (1357) -#define EC_WORD_LIFESTYLE_ITEM (1358) -#define EC_WORD_LIFESTYLE_NAME (1359) -#define EC_WORD_LIFESTYLE_NEWS (1360) -#define EC_WORD_LIFESTYLE_POPULARITY (1361) -#define EC_WORD_LIFESTYLE_STUFFED_TOY (1362) -#define EC_WORD_LIFESTYLE_PARTY (1363) -#define EC_WORD_LIFESTYLE_COMPUTER (1364) -#define EC_WORD_LIFESTYLE_FLOWERS (1365) -#define EC_WORD_LIFESTYLE_HERO (1366) -#define EC_WORD_LIFESTYLE_NAP (1367) -#define EC_WORD_LIFESTYLE_HEROINE (1368) -#define EC_WORD_LIFESTYLE_FASHION (1369) -#define EC_WORD_LIFESTYLE_STUDY (1370) -#define EC_WORD_LIFESTYLE_ADVENTURE (1371) -#define EC_WORD_LIFESTYLE_BOARD (1372) -#define EC_WORD_LIFESTYLE_BALL (1373) -#define EC_WORD_LIFESTYLE_BOOK (1374) -#define EC_WORD_LIFESTYLE_MACHINE (1375) -#define EC_WORD_LIFESTYLE_FESTIVAL (1376) -#define EC_WORD_LIFESTYLE_COMICS (1377) -#define EC_WORD_LIFESTYLE_MAIL (1378) -#define EC_WORD_LIFESTYLE_MESSAGE (1379) -#define EC_WORD_LIFESTYLE_STORY (1380) -#define EC_WORD_LIFESTYLE_PROMISE (1381) -#define EC_WORD_LIFESTYLE_HOLIDAY (1382) -#define EC_WORD_LIFESTYLE_DREAM (1383) +#define EC_WORD_LIFESTYLE_SCHOOL (1309) +#define EC_WORD_LIFESTYLE_CAMERA (1310) +#define EC_WORD_LIFESTYLE_VIEWING (1311) +#define EC_WORD_LIFESTYLE_SPECTATE (1312) +#define EC_WORD_LIFESTYLE_ANNIVERSARY (1313) +#define EC_WORD_LIFESTYLE_YESTERDAY (1314) +#define EC_WORD_LIFESTYLE_TODAY (1315) +#define EC_WORD_LIFESTYLE_HABIT (1316) +#define EC_WORD_LIFESTYLE_GROUP (1317) +#define EC_WORD_LIFESTYLE_GOURMET (1318) +#define EC_WORD_LIFESTYLE_GAME (1319) +#define EC_WORD_LIFESTYLE_WORD (1320) +#define EC_WORD_LIFESTYLE_COLLECTION (1321) +#define EC_WORD_LIFESTYLE_STORE (1322) +#define EC_WORD_LIFESTYLE_COMPLETE (1323) +#define EC_WORD_LIFESTYLE_SERVICE (1324) +#define EC_WORD_LIFESTYLE_MAGAZINE (1325) +#define EC_WORD_LIFESTYLE_WALK (1326) +#define EC_WORD_LIFESTYLE_WORK (1327) +#define EC_WORD_LIFESTYLE_SYSTEM (1328) +#define EC_WORD_LIFESTYLE_BICYCLE (1329) +#define EC_WORD_LIFESTYLE_TRAINING (1330) +#define EC_WORD_LIFESTYLE_CLASS (1331) +#define EC_WORD_LIFESTYLE_LESSONS (1332) +#define EC_WORD_LIFESTYLE_HOBBY (1333) +#define EC_WORD_LIFESTYLE_INFORMATION (1334) +#define EC_WORD_LIFESTYLE_SPORTS (1335) +#define EC_WORD_LIFESTYLE_DAILY_LIFE (1336) +#define EC_WORD_LIFESTYLE_TEACHER (1337) +#define EC_WORD_LIFESTYLE_SOFTWARE (1338) +#define EC_WORD_LIFESTYLE_SONGS (1339) +#define EC_WORD_LIFESTYLE_DIET (1340) +#define EC_WORD_LIFESTYLE_TOURNAMENT (1341) +#define EC_WORD_LIFESTYLE_TREASURE (1342) +#define EC_WORD_LIFESTYLE_TRAVEL (1343) +#define EC_WORD_LIFESTYLE_BIRTHDAY (1344) +#define EC_WORD_LIFESTYLE_DANCE (1345) +#define EC_WORD_LIFESTYLE_CHANNEL (1346) +#define EC_WORD_LIFESTYLE_FISHING (1347) +#define EC_WORD_LIFESTYLE_DATE (1348) +#define EC_WORD_LIFESTYLE_LETTER (1349) +#define EC_WORD_LIFESTYLE_EVENT (1350) +#define EC_WORD_LIFESTYLE_DESIGN (1351) +#define EC_WORD_LIFESTYLE_DIGITAL (1352) +#define EC_WORD_LIFESTYLE_TEST (1353) +#define EC_WORD_LIFESTYLE_DEPT_STORE (1354) +#define EC_WORD_LIFESTYLE_TELEVISION (1355) +#define EC_WORD_LIFESTYLE_TRAIN (1356) +#define EC_WORD_LIFESTYLE_PHONE (1357) +#define EC_WORD_LIFESTYLE_ITEM (1358) +#define EC_WORD_LIFESTYLE_NAME (1359) +#define EC_WORD_LIFESTYLE_NEWS (1360) +#define EC_WORD_LIFESTYLE_POPULARITY (1361) +#define EC_WORD_LIFESTYLE_STUFFED_TOY (1362) +#define EC_WORD_LIFESTYLE_PARTY (1363) +#define EC_WORD_LIFESTYLE_COMPUTER (1364) +#define EC_WORD_LIFESTYLE_FLOWERS (1365) +#define EC_WORD_LIFESTYLE_HERO (1366) +#define EC_WORD_LIFESTYLE_NAP (1367) +#define EC_WORD_LIFESTYLE_HEROINE (1368) +#define EC_WORD_LIFESTYLE_FASHION (1369) +#define EC_WORD_LIFESTYLE_STUDY (1370) +#define EC_WORD_LIFESTYLE_ADVENTURE (1371) +#define EC_WORD_LIFESTYLE_BOARD (1372) +#define EC_WORD_LIFESTYLE_BALL (1373) +#define EC_WORD_LIFESTYLE_BOOK (1374) +#define EC_WORD_LIFESTYLE_MACHINE (1375) +#define EC_WORD_LIFESTYLE_FESTIVAL (1376) +#define EC_WORD_LIFESTYLE_COMICS (1377) +#define EC_WORD_LIFESTYLE_MAIL (1378) +#define EC_WORD_LIFESTYLE_MESSAGE (1379) +#define EC_WORD_LIFESTYLE_STORY (1380) +#define EC_WORD_LIFESTYLE_PROMISE (1381) +#define EC_WORD_LIFESTYLE_HOLIDAY (1382) +#define EC_WORD_LIFESTYLE_DREAM (1383) #define EC_WORD_LIFESTYLE_KINDERGARTEN (1384) -#define EC_WORD_LIFESTYLE_PLANS (1385) -#define EC_WORD_LIFESTYLE_LIFE (1386) -#define EC_WORD_LIFESTYLE_RADIO (1387) -#define EC_WORD_LIFESTYLE_CRAZE (1388) -#define EC_WORD_LIFESTYLE_VACATION (1389) -#define EC_WORD_LIFESTYLE_LOOKS (1390) -#define EC_WORD_LIFESTYLE_RENTAL (1391) -#define EC_WORD_LIFESTYLE_WORLD (1392) +#define EC_WORD_LIFESTYLE_PLANS (1385) +#define EC_WORD_LIFESTYLE_LIFE (1386) +#define EC_WORD_LIFESTYLE_RADIO (1387) +#define EC_WORD_LIFESTYLE_CRAZE (1388) +#define EC_WORD_LIFESTYLE_VACATION (1389) +#define EC_WORD_LIFESTYLE_LOOKS (1390) +#define EC_WORD_LIFESTYLE_RENTAL (1391) +#define EC_WORD_LIFESTYLE_WORLD (1392) -#define EC_WORD_FEELINGS_BEAUTY (1393) -#define EC_WORD_FEELINGS_DELIGHT (1394) -#define EC_WORD_FEELINGS_STRANGENESS (1395) -#define EC_WORD_FEELINGS_CLEVERNESS (1396) +#define EC_WORD_FEELINGS_BEAUTY (1393) +#define EC_WORD_FEELINGS_DELIGHT (1394) +#define EC_WORD_FEELINGS_STRANGENESS (1395) +#define EC_WORD_FEELINGS_CLEVERNESS (1396) #define EC_WORD_FEELINGS_DISAPPOINTED (1397) -#define EC_WORD_FEELINGS_COOLNESS (1398) -#define EC_WORD_FEELINGS_SADNESS (1399) -#define EC_WORD_FEELINGS_CUTENESS (1400) -#define EC_WORD_FEELINGS_ANGER (1401) -#define EC_WORD_FEELINGS_HEALTHY (1402) -#define EC_WORD_FEELINGS_REGRET (1403) -#define EC_WORD_FEELINGS_HAPPINESS (1404) -#define EC_WORD_FEELINGS_DEPRESSED (1405) -#define EC_WORD_FEELINGS_INCREDIBLE (1406) -#define EC_WORD_FEELINGS_LIKES (1407) -#define EC_WORD_FEELINGS_DISLIKE (1408) -#define EC_WORD_FEELINGS_BORED (1409) -#define EC_WORD_FEELINGS_IMPORTANT (1410) -#define EC_WORD_FEELINGS_ALL_RIGHT (1411) -#define EC_WORD_FEELINGS_ADORE (1412) -#define EC_WORD_FEELINGS_TOUGHNESS (1413) -#define EC_WORD_FEELINGS_ENJOYMENT (1414) -#define EC_WORD_FEELINGS_USELESS (1415) -#define EC_WORD_FEELINGS_DROOLING (1416) -#define EC_WORD_FEELINGS_EXCITED (1417) -#define EC_WORD_FEELINGS_SKILLFUL (1418) -#define EC_WORD_FEELINGS_TEARS (1419) -#define EC_WORD_FEELINGS_HATE (1420) -#define EC_WORD_FEELINGS_ROFL (1421) -#define EC_WORD_FEELINGS_HAPPY (1422) -#define EC_WORD_FEELINGS_ENERGETIC (1423) -#define EC_WORD_FEELINGS_SURPRISE (1424) -#define EC_WORD_FEELINGS_NERVOUS (1425) -#define EC_WORD_FEELINGS_WANT (1426) -#define EC_WORD_FEELINGS_SATISFIED (1427) -#define EC_WORD_FEELINGS_RARE (1428) -#define EC_WORD_FEELINGS_MESSED_UP (1429) -#define EC_WORD_FEELINGS_NO_WAY (1430) -#define EC_WORD_FEELINGS_DANGER (1431) -#define EC_WORD_FEELINGS_LOVEY_DOVEY (1432) +#define EC_WORD_FEELINGS_COOLNESS (1398) +#define EC_WORD_FEELINGS_SADNESS (1399) +#define EC_WORD_FEELINGS_CUTENESS (1400) +#define EC_WORD_FEELINGS_ANGER (1401) +#define EC_WORD_FEELINGS_HEALTHY (1402) +#define EC_WORD_FEELINGS_REGRET (1403) +#define EC_WORD_FEELINGS_HAPPINESS (1404) +#define EC_WORD_FEELINGS_DEPRESSED (1405) +#define EC_WORD_FEELINGS_INCREDIBLE (1406) +#define EC_WORD_FEELINGS_LIKES (1407) +#define EC_WORD_FEELINGS_DISLIKE (1408) +#define EC_WORD_FEELINGS_BORED (1409) +#define EC_WORD_FEELINGS_IMPORTANT (1410) +#define EC_WORD_FEELINGS_ALL_RIGHT (1411) +#define EC_WORD_FEELINGS_ADORE (1412) +#define EC_WORD_FEELINGS_TOUGHNESS (1413) +#define EC_WORD_FEELINGS_ENJOYMENT (1414) +#define EC_WORD_FEELINGS_USELESS (1415) +#define EC_WORD_FEELINGS_DROOLING (1416) +#define EC_WORD_FEELINGS_EXCITED (1417) +#define EC_WORD_FEELINGS_SKILLFUL (1418) +#define EC_WORD_FEELINGS_TEARS (1419) +#define EC_WORD_FEELINGS_HATE (1420) +#define EC_WORD_FEELINGS_ROFL (1421) +#define EC_WORD_FEELINGS_HAPPY (1422) +#define EC_WORD_FEELINGS_ENERGETIC (1423) +#define EC_WORD_FEELINGS_SURPRISE (1424) +#define EC_WORD_FEELINGS_NERVOUS (1425) +#define EC_WORD_FEELINGS_WANT (1426) +#define EC_WORD_FEELINGS_SATISFIED (1427) +#define EC_WORD_FEELINGS_RARE (1428) +#define EC_WORD_FEELINGS_MESSED_UP (1429) +#define EC_WORD_FEELINGS_NO_WAY (1430) +#define EC_WORD_FEELINGS_DANGER (1431) +#define EC_WORD_FEELINGS_LOVEY_DOVEY (1432) #define EC_WORD_FEELINGS_ANTICIPATION (1433) -#define EC_WORD_FEELINGS_SMILE (1434) -#define EC_WORD_FEELINGS_SUBTLE (1435) -#define EC_WORD_FEELINGS_RECOMMEND (1436) -#define EC_WORD_FEELINGS_SIMPLE (1437) -#define EC_WORD_FEELINGS_NICE (1438) -#define EC_WORD_FEELINGS_DIFFICULT (1439) +#define EC_WORD_FEELINGS_SMILE (1434) +#define EC_WORD_FEELINGS_SUBTLE (1435) +#define EC_WORD_FEELINGS_RECOMMEND (1436) +#define EC_WORD_FEELINGS_SIMPLE (1437) +#define EC_WORD_FEELINGS_NICE (1438) +#define EC_WORD_FEELINGS_DIFFICULT (1439) -#define EC_WORD_TOUGH_WORDS_EARTH_TONES (1440) -#define EC_WORD_TOUGH_WORDS_IMPLANT (1441) +#define EC_WORD_TOUGH_WORDS_EARTH_TONES (1440) +#define EC_WORD_TOUGH_WORDS_IMPLANT (1441) #define EC_WORD_TOUGH_WORDS_GOLDEN_RATIO (1442) -#define EC_WORD_TOUGH_WORDS_OMNIBUS (1443) -#define EC_WORD_TOUGH_WORDS_STARBOARD (1444) -#define EC_WORD_TOUGH_WORDS_MONEY_RATE (1445) -#define EC_WORD_TOUGH_WORDS_RESOLUTION (1446) -#define EC_WORD_TOUGH_WORDS_CADENZA (1447) -#define EC_WORD_TOUGH_WORDS_EDUCATION (1448) -#define EC_WORD_TOUGH_WORDS_CUBISM (1449) +#define EC_WORD_TOUGH_WORDS_OMNIBUS (1443) +#define EC_WORD_TOUGH_WORDS_STARBOARD (1444) +#define EC_WORD_TOUGH_WORDS_MONEY_RATE (1445) +#define EC_WORD_TOUGH_WORDS_RESOLUTION (1446) +#define EC_WORD_TOUGH_WORDS_CADENZA (1447) +#define EC_WORD_TOUGH_WORDS_EDUCATION (1448) +#define EC_WORD_TOUGH_WORDS_CUBISM (1449) #define EC_WORD_TOUGH_WORDS_CROSS_STITCH (1450) -#define EC_WORD_TOUGH_WORDS_ARTERY (1451) +#define EC_WORD_TOUGH_WORDS_ARTERY (1451) #define EC_WORD_TOUGH_WORDS_BONE_DENSITY (1452) -#define EC_WORD_TOUGH_WORDS_GOMMAGE (1453) -#define EC_WORD_TOUGH_WORDS_STREAMING (1454) +#define EC_WORD_TOUGH_WORDS_GOMMAGE (1453) +#define EC_WORD_TOUGH_WORDS_STREAMING (1454) #define EC_WORD_TOUGH_WORDS_CONDUCTIVITY (1455) -#define EC_WORD_TOUGH_WORDS_COPYRIGHT (1456) -#define EC_WORD_TOUGH_WORDS_TWO_STEP (1457) -#define EC_WORD_TOUGH_WORDS_CONTOUR (1458) -#define EC_WORD_TOUGH_WORDS_NEUTRINO (1459) -#define EC_WORD_TOUGH_WORDS_HOWLING (1460) -#define EC_WORD_TOUGH_WORDS_SPREADSHEET (1461) -#define EC_WORD_TOUGH_WORDS_GMT (1462) +#define EC_WORD_TOUGH_WORDS_COPYRIGHT (1456) +#define EC_WORD_TOUGH_WORDS_TWO_STEP (1457) +#define EC_WORD_TOUGH_WORDS_CONTOUR (1458) +#define EC_WORD_TOUGH_WORDS_NEUTRINO (1459) +#define EC_WORD_TOUGH_WORDS_HOWLING (1460) +#define EC_WORD_TOUGH_WORDS_SPREADSHEET (1461) +#define EC_WORD_TOUGH_WORDS_GMT (1462) #define EC_WORD_TOUGH_WORDS_IRRITABILITY (1463) -#define EC_WORD_TOUGH_WORDS_FRACTALS (1464) -#define EC_WORD_TOUGH_WORDS_FLAMBE (1465) +#define EC_WORD_TOUGH_WORDS_FRACTALS (1464) +#define EC_WORD_TOUGH_WORDS_FLAMBE (1465) #define EC_WORD_TOUGH_WORDS_STOCK_PRICES (1466) -#define EC_WORD_TOUGH_WORDS_PH_BALANCE (1467) -#define EC_WORD_TOUGH_WORDS_VECTOR (1468) -#define EC_WORD_TOUGH_WORDS_POLYPHENOL (1469) -#define EC_WORD_TOUGH_WORDS_UBIQUITOUS (1470) -#define EC_WORD_TOUGH_WORDS_REM_SLEEP (1471) +#define EC_WORD_TOUGH_WORDS_PH_BALANCE (1467) +#define EC_WORD_TOUGH_WORDS_VECTOR (1468) +#define EC_WORD_TOUGH_WORDS_POLYPHENOL (1469) +#define EC_WORD_TOUGH_WORDS_UBIQUITOUS (1470) +#define EC_WORD_TOUGH_WORDS_REM_SLEEP (1471) -#define EC_WORD_UNION_SINGLE (1472) -#define EC_WORD_UNION_DOUBLE (1473) -#define EC_WORD_UNION_MIX_BATTLE (1474) +#define EC_WORD_UNION_SINGLE (1472) +#define EC_WORD_UNION_DOUBLE (1473) +#define EC_WORD_UNION_MIX_BATTLE (1474) #define EC_WORD_UNION_MULTI_BATTLE (1475) -#define EC_WORD_UNION_LEVEL_50 (1476) -#define EC_WORD_UNION_LEVEL_100 (1477) -#define EC_WORD_UNION_COLOSSEUM (1478) -#define EC_WORD_UNION_POKEMON (1479) -#define EC_WORD_UNION_DRAWING (1480) -#define EC_WORD_UNION_RECORD (1481) -#define EC_WORD_UNION_GOTCHA (1482) -#define EC_WORD_UNION_CHAT (1483) -#define EC_WORD_UNION_FRIEND_CODE (1484) -#define EC_WORD_UNION_CONNECTION (1485) -#define EC_WORD_UNION_VOICE_CHAT (1486) -#define EC_WORD_UNION_WI_FI (1487) -#define EC_WORD_UNION_UNDERGROUND (1488) -#define EC_WORD_UNION_UNION (1489) -#define EC_WORD_UNION_POFFIN (1490) -#define EC_WORD_UNION_CONTEST (1491) +#define EC_WORD_UNION_LEVEL_50 (1476) +#define EC_WORD_UNION_LEVEL_100 (1477) +#define EC_WORD_UNION_COLOSSEUM (1478) +#define EC_WORD_UNION_POKEMON (1479) +#define EC_WORD_UNION_DRAWING (1480) +#define EC_WORD_UNION_RECORD (1481) +#define EC_WORD_UNION_GOTCHA (1482) +#define EC_WORD_UNION_CHAT (1483) +#define EC_WORD_UNION_FRIEND_CODE (1484) +#define EC_WORD_UNION_CONNECTION (1485) +#define EC_WORD_UNION_VOICE_CHAT (1486) +#define EC_WORD_UNION_WI_FI (1487) +#define EC_WORD_UNION_UNDERGROUND (1488) +#define EC_WORD_UNION_UNION (1489) +#define EC_WORD_UNION_POFFIN (1490) +#define EC_WORD_UNION_CONTEST (1491) #define EC_WORD_UNION_BATTLE_TOWER (1492) -#define EC_WORD_UNION_GTS (1493) -#define EC_WORD_UNION_SECRET_BASE (1494) +#define EC_WORD_UNION_GTS (1493) +#define EC_WORD_UNION_SECRET_BASE (1494) #define EC_WORD_NULL (0xFFFF) #define EC_GROUP_MAX (11) #define EC_WORD_MASK (0xFFF) -#endif //POKEDIAMOND_CONSTANTS_EASY_CHAT_H +#endif // POKEDIAMOND_CONSTANTS_EASY_CHAT_H diff --git a/include/constants/flags.h b/include/constants/flags.h index cc83bdd9c..b58cbfb6d 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1,11 +1,11 @@ #ifndef POKEDIAMOND_CONSTANTS_FLAGS_H #define POKEDIAMOND_CONSTANTS_FLAGS_H -#define FLAG_SYS_SAFARI 0x967 +#define FLAG_SYS_SAFARI 0x967 -#define NUM_FLAGS 2912 +#define NUM_FLAGS 2912 -#define NUM_TEMP_FLAGS 64 -#define TEMP_FLAG_BASE 0x4000 +#define NUM_TEMP_FLAGS 64 +#define TEMP_FLAG_BASE 0x4000 -#endif //POKEDIAMOND_CONSTANTS_FLAGS_H \ No newline at end of file +#endif // POKEDIAMOND_CONSTANTS_FLAGS_H diff --git a/include/constants/game_stats.h b/include/constants/game_stats.h index 099ecd160..29e4e39d1 100644 --- a/include/constants/game_stats.h +++ b/include/constants/game_stats.h @@ -1,11 +1,11 @@ #ifndef POKEDIAMOND_CONSTANTS_GAME_STATS_H #define POKEDIAMOND_CONSTANTS_GAME_STATS_H -#define GAME_STAT_UNK7 7 -#define GAME_STAT_UNK8 8 -#define GAME_STAT_UNK9 9 -#define GAME_STAT_UNK10 10 -#define GAME_STAT_UNK11 11 -#define GAME_STAT_UNK21 21 +#define GAME_STAT_UNK7 7 +#define GAME_STAT_UNK8 8 +#define GAME_STAT_UNK9 9 +#define GAME_STAT_UNK10 10 +#define GAME_STAT_UNK11 11 +#define GAME_STAT_UNK21 21 -#endif //POKEDIAMOND_CONSTANTS_GAME_STATS_H \ No newline at end of file +#endif // POKEDIAMOND_CONSTANTS_GAME_STATS_H diff --git a/include/constants/global.h b/include/constants/global.h index 6668f08b6..70186f6db 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -3,7 +3,7 @@ #include "constants/charcode.h" -#define POKEMON_NAME_LENGTH 10 -#define PLAYER_NAME_LENGTH 7 +#define POKEMON_NAME_LENGTH 10 +#define PLAYER_NAME_LENGTH 7 -#endif //POKEDIAMOND_CONSTANTS_GLOBAL_H +#endif // POKEDIAMOND_CONSTANTS_GLOBAL_H diff --git a/include/constants/global_fieldmap.h b/include/constants/global_fieldmap.h index 11da02339..94d6362ed 100644 --- a/include/constants/global_fieldmap.h +++ b/include/constants/global_fieldmap.h @@ -2,19 +2,19 @@ #define POKEDIAMOND_CONSTANTS_GLOBAL_FIELDMAP_H // Facing direction -#define DIR_NORTH 0 -#define DIR_SOUTH 1 -#define DIR_WEST 2 -#define DIR_EAST 3 +#define DIR_NORTH 0 +#define DIR_SOUTH 1 +#define DIR_WEST 2 +#define DIR_EAST 3 // Player avatar state -#define PLAYER_STATE_WALKING 0 -#define PLAYER_STATE_CYCLING 1 -#define PLAYER_STATE_SURFING 2 +#define PLAYER_STATE_WALKING 0 +#define PLAYER_STATE_CYCLING 1 +#define PLAYER_STATE_SURFING 2 // Player transition bits -#define PLAYER_TRANSITION_WALKING 1 << 0 -#define PLAYER_TRANSITION_CYCLING 1 << 1 -#define PLAYER_TRANSITION_SURFING 1 << 2 +#define PLAYER_TRANSITION_WALKING 1 << 0 +#define PLAYER_TRANSITION_CYCLING 1 << 1 +#define PLAYER_TRANSITION_SURFING 1 << 2 -#endif //POKEDIAMOND_CONSTANTS_GLOBAL_FIELDMAP_H +#endif // POKEDIAMOND_CONSTANTS_GLOBAL_FIELDMAP_H diff --git a/include/constants/items.h b/include/constants/items.h index 84c37fe92..ef6e9e569 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -13,182 +13,182 @@ #define POCKET_BAG_VIEW_END 0xFF #define NUM_BAG_ITEMS 165 -#define NUM_BAG_KEY_ITEMS 50 +#define NUM_BAG_KEY_ITEMS 50 #define NUM_BAG_TMS_HMS 100 -#define NUM_BAG_MAIL 12 -#define NUM_BAG_MEDICINE 40 -#define NUM_BAG_BERRIES 64 -#define NUM_BAG_BALLS 15 -#define NUM_BAG_BATTLE_ITEMS 30 +#define NUM_BAG_MAIL 12 +#define NUM_BAG_MEDICINE 40 +#define NUM_BAG_BERRIES 64 +#define NUM_BAG_BALLS 15 +#define NUM_BAG_BATTLE_ITEMS 30 -#define BAG_SLOT_QUANTITY_MAX 999 -#define BAG_TMHM_QUANTITY_MAX 99 +#define BAG_SLOT_QUANTITY_MAX 999 +#define BAG_TMHM_QUANTITY_MAX 99 -#define ITEMATTR_PRICE 0 -#define ITEMATTR_HOLD_EFFECT 1 -#define ITEMATTR_HOLD_EFFECT_PARAM 2 -#define ITEMATTR_PREVENT_TOSS 3 -#define ITEMATTR_SELECTABLE 4 -#define ITEMATTR_POCKET 5 -#define ITEMATTR_UNKA 6 -#define ITEMATTR_UNKB 7 -#define ITEMATTR_UNK4 8 -#define ITEMATTR_UNK5 9 -#define ITEMATTR_UNK6 10 -#define ITEMATTR_NATURAL_GIFT_POWER 11 -#define ITEMATTR_NATURAL_GIFT_TYPE 12 -#define ITEMATTR_UNK8_B 13 -#define ITEMATTR_PARTY_USE 14 -#define ITEMATTR_SLP_HEAL 15 -#define ITEMATTR_PSN_HEAL 16 -#define ITEMATTR_BRN_HEAL 17 -#define ITEMATTR_FRZ_HEAL 18 -#define ITEMATTR_PRZ_HEAL 19 -#define ITEMATTR_CFS_HEAL 20 -#define ITEMATTR_INF_HEAL 21 -#define ITEMATTR_GUARD_SPEC 22 -#define ITEMATTR_REVIVE 23 -#define ITEMATTR_REVIVE_ALL 24 -#define ITEMATTR_LEVEL_UP 25 -#define ITEMATTR_EVOLVE 26 -#define ITEMATTR_ATK_STAGES 27 -#define ITEMATTR_DEF_STAGES 28 -#define ITEMATTR_SPATK_STAGES 29 -#define ITEMATTR_SPDEF_STAGES 30 -#define ITEMATTR_SPEED_STAGES 31 -#define ITEMATTR_ACCURACY_STAGES 32 -#define ITEMATTR_CRITRATE_STAGES 33 -#define ITEMATTR_PP_UP 34 -#define ITEMATTR_PP_MAX 35 -#define ITEMATTR_PP_RESTORE 36 -#define ITEMATTR_PP_RESTORE_ALL 37 -#define ITEMATTR_HP_RESTORE 38 -#define ITEMATTR_HP_EV_UP 39 -#define ITEMATTR_ATK_EV_UP 40 -#define ITEMATTR_DEF_EV_UP 41 -#define ITEMATTR_SPEED_EV_UP 42 -#define ITEMATTR_SPATK_EV_UP 43 -#define ITEMATTR_SPDEF_EV_UP 44 -#define ITEMATTR_FRIENDSHIP_MOD_LO 45 -#define ITEMATTR_FRIENDSHIP_MOD_MED 46 -#define ITEMATTR_FRIENDSHIP_MOD_HI 47 -#define ITEMATTR_HP_EV_UP_PARAM 48 -#define ITEMATTR_ATK_EV_UP_PARAM 49 -#define ITEMATTR_DEF_EV_UP_PARAM 50 -#define ITEMATTR_SPEED_EV_UP_PARAM 51 -#define ITEMATTR_SPATK_EV_UP_PARAM 52 -#define ITEMATTR_SPDEF_EV_UP_PARAM 53 -#define ITEMATTR_HP_RESTORE_PARAM 54 -#define ITEMATTR_PP_RESTORE_PARAM 55 -#define ITEMATTR_FRIENDSHIP_MOD_LO_PARAM 56 -#define ITEMATTR_FRIENDSHIP_MOD_MED_PARAM 57 -#define ITEMATTR_FRIENDSHIP_MOD_HI_PARAM 58 +#define ITEMATTR_PRICE 0 +#define ITEMATTR_HOLD_EFFECT 1 +#define ITEMATTR_HOLD_EFFECT_PARAM 2 +#define ITEMATTR_PREVENT_TOSS 3 +#define ITEMATTR_SELECTABLE 4 +#define ITEMATTR_POCKET 5 +#define ITEMATTR_UNKA 6 +#define ITEMATTR_UNKB 7 +#define ITEMATTR_UNK4 8 +#define ITEMATTR_UNK5 9 +#define ITEMATTR_UNK6 10 +#define ITEMATTR_NATURAL_GIFT_POWER 11 +#define ITEMATTR_NATURAL_GIFT_TYPE 12 +#define ITEMATTR_UNK8_B 13 +#define ITEMATTR_PARTY_USE 14 +#define ITEMATTR_SLP_HEAL 15 +#define ITEMATTR_PSN_HEAL 16 +#define ITEMATTR_BRN_HEAL 17 +#define ITEMATTR_FRZ_HEAL 18 +#define ITEMATTR_PRZ_HEAL 19 +#define ITEMATTR_CFS_HEAL 20 +#define ITEMATTR_INF_HEAL 21 +#define ITEMATTR_GUARD_SPEC 22 +#define ITEMATTR_REVIVE 23 +#define ITEMATTR_REVIVE_ALL 24 +#define ITEMATTR_LEVEL_UP 25 +#define ITEMATTR_EVOLVE 26 +#define ITEMATTR_ATK_STAGES 27 +#define ITEMATTR_DEF_STAGES 28 +#define ITEMATTR_SPATK_STAGES 29 +#define ITEMATTR_SPDEF_STAGES 30 +#define ITEMATTR_SPEED_STAGES 31 +#define ITEMATTR_ACCURACY_STAGES 32 +#define ITEMATTR_CRITRATE_STAGES 33 +#define ITEMATTR_PP_UP 34 +#define ITEMATTR_PP_MAX 35 +#define ITEMATTR_PP_RESTORE 36 +#define ITEMATTR_PP_RESTORE_ALL 37 +#define ITEMATTR_HP_RESTORE 38 +#define ITEMATTR_HP_EV_UP 39 +#define ITEMATTR_ATK_EV_UP 40 +#define ITEMATTR_DEF_EV_UP 41 +#define ITEMATTR_SPEED_EV_UP 42 +#define ITEMATTR_SPATK_EV_UP 43 +#define ITEMATTR_SPDEF_EV_UP 44 +#define ITEMATTR_FRIENDSHIP_MOD_LO 45 +#define ITEMATTR_FRIENDSHIP_MOD_MED 46 +#define ITEMATTR_FRIENDSHIP_MOD_HI 47 +#define ITEMATTR_HP_EV_UP_PARAM 48 +#define ITEMATTR_ATK_EV_UP_PARAM 49 +#define ITEMATTR_DEF_EV_UP_PARAM 50 +#define ITEMATTR_SPEED_EV_UP_PARAM 51 +#define ITEMATTR_SPATK_EV_UP_PARAM 52 +#define ITEMATTR_SPDEF_EV_UP_PARAM 53 +#define ITEMATTR_HP_RESTORE_PARAM 54 +#define ITEMATTR_PP_RESTORE_PARAM 55 +#define ITEMATTR_FRIENDSHIP_MOD_LO_PARAM 56 +#define ITEMATTR_FRIENDSHIP_MOD_MED_PARAM 57 +#define ITEMATTR_FRIENDSHIP_MOD_HI_PARAM 58 #define PP_RESTORE_ALL 127 #define HP_RESTORE_ALL 255 #define HP_RESTORE_HALF 254 #define HP_RESTORE_QTR 253 -#define HOLD_EFFECT_NONE 0 -#define HOLD_EFFECT_HP_RESTORE 1 -#define HOLD_EFFECT_DIALGA_BOOST 2 -#define HOLD_EFFECT_PALKIA_BOOST 3 -#define HOLD_EFFECT_PRZ_RESTORE 4 -#define HOLD_EFFECT_SLP_RESTORE 5 -#define HOLD_EFFECT_PSN_RESTORE 6 -#define HOLD_EFFECT_BRN_RESTORE 7 -#define HOLD_EFFECT_FRZ_RESTORE 8 -#define HOLD_EFFECT_PP_RESTORE 9 -#define HOLD_EFFECT_CONFUSE_RESTORE 10 -#define HOLD_EFFECT_STATUS_RESTORE 11 -#define HOLD_EFFECT_HP_PCT_RESTORE 12 -#define HOLD_EFFECT_HP_RESTORE_SPICY 13 -#define HOLD_EFFECT_HP_RESTORE_DRY 14 -#define HOLD_EFFECT_HP_RESTORE_SWEET 15 -#define HOLD_EFFECT_HP_RESTORE_BITTER 16 -#define HOLD_EFFECT_HP_RESTORE_SOUR 17 -#define HOLD_EFFECT_WEAKEN_SE_FIRE 18 -#define HOLD_EFFECT_WEAKEN_SE_WATER 19 -#define HOLD_EFFECT_WEAKEN_SE_ELECTRIC 20 -#define HOLD_EFFECT_WEAKEN_SE_GRASS 21 -#define HOLD_EFFECT_WEAKEN_SE_ICE 22 -#define HOLD_EFFECT_WEAKEN_SE_FIGHT 23 -#define HOLD_EFFECT_WEAKEN_SE_POISON 24 -#define HOLD_EFFECT_WEAKEN_SE_GROUND 25 -#define HOLD_EFFECT_WEAKEN_SE_FLYING 26 -#define HOLD_EFFECT_WEAKEN_SE_PSYCHIC 27 -#define HOLD_EFFECT_WEAKEN_SE_BUG 28 -#define HOLD_EFFECT_WEAKEN_SE_ROCK 29 -#define HOLD_EFFECT_WEAKEN_SE_GHOST 30 -#define HOLD_EFFECT_WEAKEN_SE_DRAGON 31 -#define HOLD_EFFECT_WEAKEN_SE_DARK 32 -#define HOLD_EFFECT_WEAKEN_SE_STEEL 33 -#define HOLD_EFFECT_WEAKEN_NORMAL 34 -#define HOLD_EFFECT_PINCH_ATK_UP 35 -#define HOLD_EFFECT_PINCH_DEF_UP 36 -#define HOLD_EFFECT_PINCH_SPEED_UP 37 -#define HOLD_EFFECT_PINCH_SPATK_UP 38 -#define HOLD_EFFECT_PINCH_SPDEF_UP 39 -#define HOLD_EFFECT_PINCH_CRITRATE_UP 40 -#define HOLD_EFFECT_PINCH_RANDOM_UP 41 -#define HOLD_EFFECT_HP_RESTORE_SE 42 -#define HOLD_EFFECT_PINCH_ACC_UP 43 -#define HOLD_EFFECT_PINCH_PRIORITY 44 -#define HOLD_EFFECT_RECOIL_PHYSICAL 45 -#define HOLD_EFFECT_RECOIL_SPECIAL 46 -#define HOLD_EFFECT_ACC_REDUCE 47 -#define HOLD_EFFECT_STATDOWN_RESTORE 48 -#define HOLD_EFFECT_EXP_UP_SPEED_DOWN 49 -#define HOLD_EFFECT_EXP_SHARE 50 -#define HOLD_EFFECT_SOMETIMES_PRIORITY 51 -#define HOLD_EFFECT_FRIENDSHIP_UP 52 -#define HOLD_EFFECT_HEAL_INFATUATION 53 -#define HOLD_EFFECT_CHOICE_ATK 54 -#define HOLD_EFFECT_CRIT_UP 55 -#define HOLD_EFFECT_STRENGTHEN_BUG 56 -#define HOLD_EFFECT_MONEY_UP 57 -#define HOLD_EFFECT_ENCOUNTERS_DOWN 58 -#define HOLD_EFFECT_LATI_SPECIAL 59 -#define HOLD_EFFECT_CLAMPERL_SPATK 60 -#define HOLD_EFFECT_CLAMPERL_SPDEF 61 -#define HOLD_EFFECT_FLEE 62 -#define HOLD_EFFECT_NO_EVOLVE 63 -#define HOLD_EFFECT_MAYBE_ENDURE 64 -#define HOLD_EFFECT_EXP_UP 65 -#define HOLD_EFFECT_CRITRATE_UP 66 -#define HOLD_EFFECT_STRENGTHEN_STEEL 67 -#define HOLD_EFFECT_HP_RESTORE_GRADUAL 68 -#define HOLD_EFFECT_EVOLVE_SEADRA 69 -#define HOLD_EFFECT_PIKA_SPATK_UP 70 -#define HOLD_EFFECT_STRENGTHEN_GROUND 71 -#define HOLD_EFFECT_STRENGTHEN_ROCK 72 -#define HOLD_EFFECT_STRENGTHEN_GRASS 73 -#define HOLD_EFFECT_STRENGTHEN_DARK 74 -#define HOLD_EFFECT_STRENGTHEN_FIGHT 75 -#define HOLD_EFFECT_STRENGTHEN_ELECTRIC 76 -#define HOLD_EFFECT_STRENGTHEN_WATER 77 -#define HOLD_EFFECT_STRENGTHEN_FLYING 78 -#define HOLD_EFFECT_STRENGTHEN_POISON 79 -#define HOLD_EFFECT_STRENGTHEN_ICE 80 -#define HOLD_EFFECT_STRENGTHEN_GHOST 81 -#define HOLD_EFFECT_STRENGTHEN_PSYCHIC 82 -#define HOLD_EFFECT_STRENGTHEN_FIRE 83 -#define HOLD_EFFECT_STRENGTHEN_DRAGON 84 -#define HOLD_EFFECT_STRENGTHEN_NORMAL 85 -#define HOLD_EFFECT_EVOLVE_PORYGON 86 -#define HOLD_EFFECT_HP_RESTORE_ON_DMG 87 -#define HOLD_EFFECT_CHANSEY_CRITRATE_UP 88 -#define HOLD_EFFECT_DITTO_DEF_UP 89 -#define HOLD_EFFECT_CUBONE_ATK_UP 90 -#define HOLD_EFFECT_FARFETCHD_CRITRATE_UP 91 -#define HOLD_EFFECT_ACCURACY_UP 92 -#define HOLD_EFFECT_POWER_UP_PHYS 93 -#define HOLD_EFFECT_POWER_UP_SPEC 94 -#define HOLD_EFFECT_POWER_UP_SE 95 -#define HOLD_EFFECT_EXTEND_SCREENS 96 -#define HOLD_EFFECT_HP_DRAIN_ON_ATK 97 -#define HOLD_EFFECT_CHARGE_SKIP 98 -#define HOLD_EFFECT_PSN_USER 99 +#define HOLD_EFFECT_NONE 0 +#define HOLD_EFFECT_HP_RESTORE 1 +#define HOLD_EFFECT_DIALGA_BOOST 2 +#define HOLD_EFFECT_PALKIA_BOOST 3 +#define HOLD_EFFECT_PRZ_RESTORE 4 +#define HOLD_EFFECT_SLP_RESTORE 5 +#define HOLD_EFFECT_PSN_RESTORE 6 +#define HOLD_EFFECT_BRN_RESTORE 7 +#define HOLD_EFFECT_FRZ_RESTORE 8 +#define HOLD_EFFECT_PP_RESTORE 9 +#define HOLD_EFFECT_CONFUSE_RESTORE 10 +#define HOLD_EFFECT_STATUS_RESTORE 11 +#define HOLD_EFFECT_HP_PCT_RESTORE 12 +#define HOLD_EFFECT_HP_RESTORE_SPICY 13 +#define HOLD_EFFECT_HP_RESTORE_DRY 14 +#define HOLD_EFFECT_HP_RESTORE_SWEET 15 +#define HOLD_EFFECT_HP_RESTORE_BITTER 16 +#define HOLD_EFFECT_HP_RESTORE_SOUR 17 +#define HOLD_EFFECT_WEAKEN_SE_FIRE 18 +#define HOLD_EFFECT_WEAKEN_SE_WATER 19 +#define HOLD_EFFECT_WEAKEN_SE_ELECTRIC 20 +#define HOLD_EFFECT_WEAKEN_SE_GRASS 21 +#define HOLD_EFFECT_WEAKEN_SE_ICE 22 +#define HOLD_EFFECT_WEAKEN_SE_FIGHT 23 +#define HOLD_EFFECT_WEAKEN_SE_POISON 24 +#define HOLD_EFFECT_WEAKEN_SE_GROUND 25 +#define HOLD_EFFECT_WEAKEN_SE_FLYING 26 +#define HOLD_EFFECT_WEAKEN_SE_PSYCHIC 27 +#define HOLD_EFFECT_WEAKEN_SE_BUG 28 +#define HOLD_EFFECT_WEAKEN_SE_ROCK 29 +#define HOLD_EFFECT_WEAKEN_SE_GHOST 30 +#define HOLD_EFFECT_WEAKEN_SE_DRAGON 31 +#define HOLD_EFFECT_WEAKEN_SE_DARK 32 +#define HOLD_EFFECT_WEAKEN_SE_STEEL 33 +#define HOLD_EFFECT_WEAKEN_NORMAL 34 +#define HOLD_EFFECT_PINCH_ATK_UP 35 +#define HOLD_EFFECT_PINCH_DEF_UP 36 +#define HOLD_EFFECT_PINCH_SPEED_UP 37 +#define HOLD_EFFECT_PINCH_SPATK_UP 38 +#define HOLD_EFFECT_PINCH_SPDEF_UP 39 +#define HOLD_EFFECT_PINCH_CRITRATE_UP 40 +#define HOLD_EFFECT_PINCH_RANDOM_UP 41 +#define HOLD_EFFECT_HP_RESTORE_SE 42 +#define HOLD_EFFECT_PINCH_ACC_UP 43 +#define HOLD_EFFECT_PINCH_PRIORITY 44 +#define HOLD_EFFECT_RECOIL_PHYSICAL 45 +#define HOLD_EFFECT_RECOIL_SPECIAL 46 +#define HOLD_EFFECT_ACC_REDUCE 47 +#define HOLD_EFFECT_STATDOWN_RESTORE 48 +#define HOLD_EFFECT_EXP_UP_SPEED_DOWN 49 +#define HOLD_EFFECT_EXP_SHARE 50 +#define HOLD_EFFECT_SOMETIMES_PRIORITY 51 +#define HOLD_EFFECT_FRIENDSHIP_UP 52 +#define HOLD_EFFECT_HEAL_INFATUATION 53 +#define HOLD_EFFECT_CHOICE_ATK 54 +#define HOLD_EFFECT_CRIT_UP 55 +#define HOLD_EFFECT_STRENGTHEN_BUG 56 +#define HOLD_EFFECT_MONEY_UP 57 +#define HOLD_EFFECT_ENCOUNTERS_DOWN 58 +#define HOLD_EFFECT_LATI_SPECIAL 59 +#define HOLD_EFFECT_CLAMPERL_SPATK 60 +#define HOLD_EFFECT_CLAMPERL_SPDEF 61 +#define HOLD_EFFECT_FLEE 62 +#define HOLD_EFFECT_NO_EVOLVE 63 +#define HOLD_EFFECT_MAYBE_ENDURE 64 +#define HOLD_EFFECT_EXP_UP 65 +#define HOLD_EFFECT_CRITRATE_UP 66 +#define HOLD_EFFECT_STRENGTHEN_STEEL 67 +#define HOLD_EFFECT_HP_RESTORE_GRADUAL 68 +#define HOLD_EFFECT_EVOLVE_SEADRA 69 +#define HOLD_EFFECT_PIKA_SPATK_UP 70 +#define HOLD_EFFECT_STRENGTHEN_GROUND 71 +#define HOLD_EFFECT_STRENGTHEN_ROCK 72 +#define HOLD_EFFECT_STRENGTHEN_GRASS 73 +#define HOLD_EFFECT_STRENGTHEN_DARK 74 +#define HOLD_EFFECT_STRENGTHEN_FIGHT 75 +#define HOLD_EFFECT_STRENGTHEN_ELECTRIC 76 +#define HOLD_EFFECT_STRENGTHEN_WATER 77 +#define HOLD_EFFECT_STRENGTHEN_FLYING 78 +#define HOLD_EFFECT_STRENGTHEN_POISON 79 +#define HOLD_EFFECT_STRENGTHEN_ICE 80 +#define HOLD_EFFECT_STRENGTHEN_GHOST 81 +#define HOLD_EFFECT_STRENGTHEN_PSYCHIC 82 +#define HOLD_EFFECT_STRENGTHEN_FIRE 83 +#define HOLD_EFFECT_STRENGTHEN_DRAGON 84 +#define HOLD_EFFECT_STRENGTHEN_NORMAL 85 +#define HOLD_EFFECT_EVOLVE_PORYGON 86 +#define HOLD_EFFECT_HP_RESTORE_ON_DMG 87 +#define HOLD_EFFECT_CHANSEY_CRITRATE_UP 88 +#define HOLD_EFFECT_DITTO_DEF_UP 89 +#define HOLD_EFFECT_CUBONE_ATK_UP 90 +#define HOLD_EFFECT_FARFETCHD_CRITRATE_UP 91 +#define HOLD_EFFECT_ACCURACY_UP 92 +#define HOLD_EFFECT_POWER_UP_PHYS 93 +#define HOLD_EFFECT_POWER_UP_SPEC 94 +#define HOLD_EFFECT_POWER_UP_SE 95 +#define HOLD_EFFECT_EXTEND_SCREENS 96 +#define HOLD_EFFECT_HP_DRAIN_ON_ATK 97 +#define HOLD_EFFECT_CHARGE_SKIP 98 +#define HOLD_EFFECT_PSN_USER 99 #define HOLD_EFFECT_BRN_USER 100 #define HOLD_EFFECT_DITTO_SPEED_UP 101 #define HOLD_EFFECT_ENDURE 102 @@ -236,457 +236,457 @@ #define HOLD_EFFECT_EVOLVE_PORYGON2 144 #define HOLD_EFFECT_EVOLVE_DUSCLOPS 145 -#define ITEM_NONE 0 -#define ITEM_MASTER_BALL 1 -#define ITEM_ULTRA_BALL 2 -#define ITEM_GREAT_BALL 3 -#define ITEM_POKE_BALL 4 -#define ITEM_SAFARI_BALL 5 -#define ITEM_NET_BALL 6 -#define ITEM_DIVE_BALL 7 -#define ITEM_NEST_BALL 8 -#define ITEM_REPEAT_BALL 9 -#define ITEM_TIMER_BALL 10 -#define ITEM_LUXURY_BALL 11 -#define ITEM_PREMIER_BALL 12 -#define ITEM_DUSK_BALL 13 -#define ITEM_HEAL_BALL 14 -#define ITEM_QUICK_BALL 15 -#define ITEM_CHERISH_BALL 16 -#define ITEM_POTION 17 -#define ITEM_ANTIDOTE 18 -#define ITEM_BURN_HEAL 19 -#define ITEM_ICE_HEAL 20 -#define ITEM_AWAKENING 21 -#define ITEM_PARLYZ_HEAL 22 -#define ITEM_FULL_RESTORE 23 -#define ITEM_MAX_POTION 24 -#define ITEM_HYPER_POTION 25 -#define ITEM_SUPER_POTION 26 -#define ITEM_FULL_HEAL 27 -#define ITEM_REVIVE 28 -#define ITEM_MAX_REVIVE 29 -#define ITEM_FRESH_WATER 30 -#define ITEM_SODA_POP 31 -#define ITEM_LEMONADE 32 -#define ITEM_MOOMOO_MILK 33 +#define ITEM_NONE 0 +#define ITEM_MASTER_BALL 1 +#define ITEM_ULTRA_BALL 2 +#define ITEM_GREAT_BALL 3 +#define ITEM_POKE_BALL 4 +#define ITEM_SAFARI_BALL 5 +#define ITEM_NET_BALL 6 +#define ITEM_DIVE_BALL 7 +#define ITEM_NEST_BALL 8 +#define ITEM_REPEAT_BALL 9 +#define ITEM_TIMER_BALL 10 +#define ITEM_LUXURY_BALL 11 +#define ITEM_PREMIER_BALL 12 +#define ITEM_DUSK_BALL 13 +#define ITEM_HEAL_BALL 14 +#define ITEM_QUICK_BALL 15 +#define ITEM_CHERISH_BALL 16 +#define ITEM_POTION 17 +#define ITEM_ANTIDOTE 18 +#define ITEM_BURN_HEAL 19 +#define ITEM_ICE_HEAL 20 +#define ITEM_AWAKENING 21 +#define ITEM_PARLYZ_HEAL 22 +#define ITEM_FULL_RESTORE 23 +#define ITEM_MAX_POTION 24 +#define ITEM_HYPER_POTION 25 +#define ITEM_SUPER_POTION 26 +#define ITEM_FULL_HEAL 27 +#define ITEM_REVIVE 28 +#define ITEM_MAX_REVIVE 29 +#define ITEM_FRESH_WATER 30 +#define ITEM_SODA_POP 31 +#define ITEM_LEMONADE 32 +#define ITEM_MOOMOO_MILK 33 -#define ITEM_ENERGYPOWDER 34 -#define ITEM_ENERGY_ROOT 35 -#define ITEM_HEAL_POWDER 36 -#define ITEM_REVIVAL_HERB 37 +#define ITEM_ENERGYPOWDER 34 +#define ITEM_ENERGY_ROOT 35 +#define ITEM_HEAL_POWDER 36 +#define ITEM_REVIVAL_HERB 37 -#define ITEM_ETHER 38 -#define ITEM_MAX_ETHER 39 -#define ITEM_ELIXIR 40 -#define ITEM_MAX_ELIXIR 41 -#define ITEM_LAVA_COOKIE 42 -#define ITEM_BERRY_JUICE 43 -#define ITEM_SACRED_ASH 44 -#define ITEM_HP_UP 45 -#define ITEM_PROTEIN 46 -#define ITEM_IRON 47 -#define ITEM_CARBOS 48 -#define ITEM_CALCIUM 49 -#define ITEM_RARE_CANDY 50 -#define ITEM_PP_UP 51 -#define ITEM_ZINC 52 -#define ITEM_PP_MAX 53 -#define ITEM_OLD_GATEAU 54 -#define ITEM_GUARD_SPEC_ 55 -#define ITEM_DIRE_HIT 56 -#define ITEM_X_ATTACK 57 -#define ITEM_X_DEFENSE 58 -#define ITEM_X_SPEED 59 -#define ITEM_X_ACCURACY 60 -#define ITEM_X_SPECIAL 61 -#define ITEM_X_SP__DEF 62 -#define ITEM_POKE_DOLL 63 -#define ITEM_FLUFFY_TAIL 64 -#define ITEM_BLUE_FLUTE 65 -#define ITEM_YELLOW_FLUTE 66 -#define ITEM_RED_FLUTE 67 -#define ITEM_BLACK_FLUTE 68 -#define ITEM_WHITE_FLUTE 69 -#define ITEM_SHOAL_SALT 70 -#define ITEM_SHOAL_SHELL 71 -#define ITEM_RED_SHARD 72 -#define ITEM_BLUE_SHARD 73 -#define ITEM_YELLOW_SHARD 74 -#define ITEM_GREEN_SHARD 75 -#define ITEM_SUPER_REPEL 76 -#define ITEM_MAX_REPEL 77 -#define ITEM_ESCAPE_ROPE 78 -#define ITEM_REPEL 79 -#define ITEM_SUN_STONE 80 -#define ITEM_MOON_STONE 81 -#define ITEM_FIRE_STONE 82 -#define ITEM_THUNDERSTONE 83 -#define ITEM_WATER_STONE 84 -#define ITEM_LEAF_STONE 85 -#define ITEM_TINYMUSHROOM 86 -#define ITEM_BIG_MUSHROOM 87 -#define ITEM_PEARL 88 -#define ITEM_BIG_PEARL 89 -#define ITEM_STARDUST 90 -#define ITEM_STAR_PIECE 91 -#define ITEM_NUGGET 92 -#define ITEM_HEART_SCALE 93 -#define ITEM_HONEY 94 -#define ITEM_GROWTH_MULCH 95 -#define ITEM_DAMP_MULCH 96 -#define ITEM_STABLE_MULCH 97 -#define ITEM_GOOEY_MULCH 98 -#define ITEM_ROOT_FOSSIL 99 -#define ITEM_CLAW_FOSSIL 100 -#define ITEM_HELIX_FOSSIL 101 -#define ITEM_DOME_FOSSIL 102 -#define ITEM_OLD_AMBER 103 -#define ITEM_ARMOR_FOSSIL 104 -#define ITEM_SKULL_FOSSIL 105 -#define ITEM_RARE_BONE 106 -#define ITEM_SHINY_STONE 107 -#define ITEM_DUSK_STONE 108 -#define ITEM_DAWN_STONE 109 -#define ITEM_OVAL_STONE 110 -#define ITEM_ODD_KEYSTONE 111 +#define ITEM_ETHER 38 +#define ITEM_MAX_ETHER 39 +#define ITEM_ELIXIR 40 +#define ITEM_MAX_ELIXIR 41 +#define ITEM_LAVA_COOKIE 42 +#define ITEM_BERRY_JUICE 43 +#define ITEM_SACRED_ASH 44 +#define ITEM_HP_UP 45 +#define ITEM_PROTEIN 46 +#define ITEM_IRON 47 +#define ITEM_CARBOS 48 +#define ITEM_CALCIUM 49 +#define ITEM_RARE_CANDY 50 +#define ITEM_PP_UP 51 +#define ITEM_ZINC 52 +#define ITEM_PP_MAX 53 +#define ITEM_OLD_GATEAU 54 +#define ITEM_GUARD_SPEC_ 55 +#define ITEM_DIRE_HIT 56 +#define ITEM_X_ATTACK 57 +#define ITEM_X_DEFENSE 58 +#define ITEM_X_SPEED 59 +#define ITEM_X_ACCURACY 60 +#define ITEM_X_SPECIAL 61 +#define ITEM_X_SP__DEF 62 +#define ITEM_POKE_DOLL 63 +#define ITEM_FLUFFY_TAIL 64 +#define ITEM_BLUE_FLUTE 65 +#define ITEM_YELLOW_FLUTE 66 +#define ITEM_RED_FLUTE 67 +#define ITEM_BLACK_FLUTE 68 +#define ITEM_WHITE_FLUTE 69 +#define ITEM_SHOAL_SALT 70 +#define ITEM_SHOAL_SHELL 71 +#define ITEM_RED_SHARD 72 +#define ITEM_BLUE_SHARD 73 +#define ITEM_YELLOW_SHARD 74 +#define ITEM_GREEN_SHARD 75 +#define ITEM_SUPER_REPEL 76 +#define ITEM_MAX_REPEL 77 +#define ITEM_ESCAPE_ROPE 78 +#define ITEM_REPEL 79 +#define ITEM_SUN_STONE 80 +#define ITEM_MOON_STONE 81 +#define ITEM_FIRE_STONE 82 +#define ITEM_THUNDERSTONE 83 +#define ITEM_WATER_STONE 84 +#define ITEM_LEAF_STONE 85 +#define ITEM_TINYMUSHROOM 86 +#define ITEM_BIG_MUSHROOM 87 +#define ITEM_PEARL 88 +#define ITEM_BIG_PEARL 89 +#define ITEM_STARDUST 90 +#define ITEM_STAR_PIECE 91 +#define ITEM_NUGGET 92 +#define ITEM_HEART_SCALE 93 +#define ITEM_HONEY 94 +#define ITEM_GROWTH_MULCH 95 +#define ITEM_DAMP_MULCH 96 +#define ITEM_STABLE_MULCH 97 +#define ITEM_GOOEY_MULCH 98 +#define ITEM_ROOT_FOSSIL 99 +#define ITEM_CLAW_FOSSIL 100 +#define ITEM_HELIX_FOSSIL 101 +#define ITEM_DOME_FOSSIL 102 +#define ITEM_OLD_AMBER 103 +#define ITEM_ARMOR_FOSSIL 104 +#define ITEM_SKULL_FOSSIL 105 +#define ITEM_RARE_BONE 106 +#define ITEM_SHINY_STONE 107 +#define ITEM_DUSK_STONE 108 +#define ITEM_DAWN_STONE 109 +#define ITEM_OVAL_STONE 110 +#define ITEM_ODD_KEYSTONE 111 -#define ITEM_ADAMANT_ORB 135 -#define ITEM_LUSTROUS_ORB 136 -#define ITEM_GRASS_MAIL 137 -#define ITEM_FLAME_MAIL 138 -#define ITEM_BUBBLE_MAIL 139 -#define ITEM_BLOOM_MAIL 140 -#define ITEM_TUNNEL_MAIL 141 -#define ITEM_STEEL_MAIL 142 -#define ITEM_HEART_MAIL 143 -#define ITEM_SNOW_MAIL 144 -#define ITEM_SPACE_MAIL 145 -#define ITEM_AIR_MAIL 146 -#define ITEM_MOSAIC_MAIL 147 -#define ITEM_BRICK_MAIL 148 +#define ITEM_ADAMANT_ORB 135 +#define ITEM_LUSTROUS_ORB 136 +#define ITEM_GRASS_MAIL 137 +#define ITEM_FLAME_MAIL 138 +#define ITEM_BUBBLE_MAIL 139 +#define ITEM_BLOOM_MAIL 140 +#define ITEM_TUNNEL_MAIL 141 +#define ITEM_STEEL_MAIL 142 +#define ITEM_HEART_MAIL 143 +#define ITEM_SNOW_MAIL 144 +#define ITEM_SPACE_MAIL 145 +#define ITEM_AIR_MAIL 146 +#define ITEM_MOSAIC_MAIL 147 +#define ITEM_BRICK_MAIL 148 -#define ITEM_CHERI_BERRY 149 -#define ITEM_CHESTO_BERRY 150 -#define ITEM_PECHA_BERRY 151 -#define ITEM_RAWST_BERRY 152 -#define ITEM_ASPEAR_BERRY 153 -#define ITEM_LEPPA_BERRY 154 -#define ITEM_ORAN_BERRY 155 -#define ITEM_PERSIM_BERRY 156 -#define ITEM_LUM_BERRY 157 -#define ITEM_SITRUS_BERRY 158 -#define ITEM_FIGY_BERRY 159 -#define ITEM_WIKI_BERRY 160 -#define ITEM_MAGO_BERRY 161 -#define ITEM_AGUAV_BERRY 162 -#define ITEM_IAPAPA_BERRY 163 -#define ITEM_RAZZ_BERRY 164 -#define ITEM_BLUK_BERRY 165 -#define ITEM_NANAB_BERRY 166 -#define ITEM_WEPEAR_BERRY 167 -#define ITEM_PINAP_BERRY 168 -#define ITEM_POMEG_BERRY 169 -#define ITEM_KELPSY_BERRY 170 -#define ITEM_QUALOT_BERRY 171 -#define ITEM_HONDEW_BERRY 172 -#define ITEM_GREPA_BERRY 173 -#define ITEM_TAMATO_BERRY 174 -#define ITEM_CORNN_BERRY 175 -#define ITEM_MAGOST_BERRY 176 -#define ITEM_RABUTA_BERRY 177 -#define ITEM_NOMEL_BERRY 178 -#define ITEM_SPELON_BERRY 179 -#define ITEM_PAMTRE_BERRY 180 -#define ITEM_WATMEL_BERRY 181 -#define ITEM_DURIN_BERRY 182 -#define ITEM_BELUE_BERRY 183 -#define ITEM_OCCA_BERRY 184 -#define ITEM_PASSHO_BERRY 185 -#define ITEM_WACAN_BERRY 186 -#define ITEM_RINDO_BERRY 187 -#define ITEM_YACHE_BERRY 188 -#define ITEM_CHOPLE_BERRY 189 -#define ITEM_KEBIA_BERRY 190 -#define ITEM_SHUCA_BERRY 191 -#define ITEM_COBA_BERRY 192 -#define ITEM_PAYAPA_BERRY 193 -#define ITEM_TANGA_BERRY 194 -#define ITEM_CHARTI_BERRY 195 -#define ITEM_KASIB_BERRY 196 -#define ITEM_HABAN_BERRY 197 -#define ITEM_COLBUR_BERRY 198 -#define ITEM_BABIRI_BERRY 199 -#define ITEM_CHILAN_BERRY 200 -#define ITEM_LIECHI_BERRY 201 -#define ITEM_GANLON_BERRY 202 -#define ITEM_SALAC_BERRY 203 -#define ITEM_PETAYA_BERRY 204 -#define ITEM_APICOT_BERRY 205 -#define ITEM_LANSAT_BERRY 206 -#define ITEM_STARF_BERRY 207 -#define ITEM_ENIGMA_BERRY 208 -#define ITEM_MICLE_BERRY 209 -#define ITEM_CUSTAP_BERRY 210 -#define ITEM_JABOCA_BERRY 211 -#define ITEM_ROWAP_BERRY 212 +#define ITEM_CHERI_BERRY 149 +#define ITEM_CHESTO_BERRY 150 +#define ITEM_PECHA_BERRY 151 +#define ITEM_RAWST_BERRY 152 +#define ITEM_ASPEAR_BERRY 153 +#define ITEM_LEPPA_BERRY 154 +#define ITEM_ORAN_BERRY 155 +#define ITEM_PERSIM_BERRY 156 +#define ITEM_LUM_BERRY 157 +#define ITEM_SITRUS_BERRY 158 +#define ITEM_FIGY_BERRY 159 +#define ITEM_WIKI_BERRY 160 +#define ITEM_MAGO_BERRY 161 +#define ITEM_AGUAV_BERRY 162 +#define ITEM_IAPAPA_BERRY 163 +#define ITEM_RAZZ_BERRY 164 +#define ITEM_BLUK_BERRY 165 +#define ITEM_NANAB_BERRY 166 +#define ITEM_WEPEAR_BERRY 167 +#define ITEM_PINAP_BERRY 168 +#define ITEM_POMEG_BERRY 169 +#define ITEM_KELPSY_BERRY 170 +#define ITEM_QUALOT_BERRY 171 +#define ITEM_HONDEW_BERRY 172 +#define ITEM_GREPA_BERRY 173 +#define ITEM_TAMATO_BERRY 174 +#define ITEM_CORNN_BERRY 175 +#define ITEM_MAGOST_BERRY 176 +#define ITEM_RABUTA_BERRY 177 +#define ITEM_NOMEL_BERRY 178 +#define ITEM_SPELON_BERRY 179 +#define ITEM_PAMTRE_BERRY 180 +#define ITEM_WATMEL_BERRY 181 +#define ITEM_DURIN_BERRY 182 +#define ITEM_BELUE_BERRY 183 +#define ITEM_OCCA_BERRY 184 +#define ITEM_PASSHO_BERRY 185 +#define ITEM_WACAN_BERRY 186 +#define ITEM_RINDO_BERRY 187 +#define ITEM_YACHE_BERRY 188 +#define ITEM_CHOPLE_BERRY 189 +#define ITEM_KEBIA_BERRY 190 +#define ITEM_SHUCA_BERRY 191 +#define ITEM_COBA_BERRY 192 +#define ITEM_PAYAPA_BERRY 193 +#define ITEM_TANGA_BERRY 194 +#define ITEM_CHARTI_BERRY 195 +#define ITEM_KASIB_BERRY 196 +#define ITEM_HABAN_BERRY 197 +#define ITEM_COLBUR_BERRY 198 +#define ITEM_BABIRI_BERRY 199 +#define ITEM_CHILAN_BERRY 200 +#define ITEM_LIECHI_BERRY 201 +#define ITEM_GANLON_BERRY 202 +#define ITEM_SALAC_BERRY 203 +#define ITEM_PETAYA_BERRY 204 +#define ITEM_APICOT_BERRY 205 +#define ITEM_LANSAT_BERRY 206 +#define ITEM_STARF_BERRY 207 +#define ITEM_ENIGMA_BERRY 208 +#define ITEM_MICLE_BERRY 209 +#define ITEM_CUSTAP_BERRY 210 +#define ITEM_JABOCA_BERRY 211 +#define ITEM_ROWAP_BERRY 212 #define FIRST_BERRY_IDX ITEM_CHERI_BERRY -#define LAST_BERRY_IDX ITEM_ROWAP_BERRY -#define NUM_BERRIES (LAST_BERRY_IDX - FIRST_BERRY_IDX + 1) +#define LAST_BERRY_IDX ITEM_ROWAP_BERRY +#define NUM_BERRIES (LAST_BERRY_IDX - FIRST_BERRY_IDX + 1) -#define ITEM_BRIGHTPOWDER 213 -#define ITEM_WHITE_HERB 214 -#define ITEM_MACHO_BRACE 215 -#define ITEM_EXP__SHARE 216 -#define ITEM_QUICK_CLAW 217 -#define ITEM_SOOTHE_BELL 218 -#define ITEM_MENTAL_HERB 219 -#define ITEM_CHOICE_BAND 220 -#define ITEM_KINGS_ROCK 221 -#define ITEM_SILVERPOWDER 222 -#define ITEM_AMULET_COIN 223 -#define ITEM_CLEANSE_TAG 224 -#define ITEM_SOUL_DEW 225 -#define ITEM_DEEPSEATOOTH 226 -#define ITEM_DEEPSEASCALE 227 -#define ITEM_SMOKE_BALL 228 -#define ITEM_EVERSTONE 229 -#define ITEM_FOCUS_BAND 230 -#define ITEM_LUCKY_EGG 231 -#define ITEM_SCOPE_LENS 232 -#define ITEM_METAL_COAT 233 -#define ITEM_LEFTOVERS 234 -#define ITEM_DRAGON_SCALE 235 -#define ITEM_LIGHT_BALL 236 -#define ITEM_SOFT_SAND 237 -#define ITEM_HARD_STONE 238 -#define ITEM_MIRACLE_SEED 239 -#define ITEM_BLACKGLASSES 240 -#define ITEM_BLACK_BELT 241 -#define ITEM_MAGNET 242 -#define ITEM_MYSTIC_WATER 243 -#define ITEM_SHARP_BEAK 244 -#define ITEM_POISON_BARB 245 -#define ITEM_NEVERMELTICE 246 -#define ITEM_SPELL_TAG 247 -#define ITEM_TWISTEDSPOON 248 -#define ITEM_CHARCOAL 249 -#define ITEM_DRAGON_FANG 250 -#define ITEM_SILK_SCARF 251 -#define ITEM_UPGRADE 252 -#define ITEM_SHELL_BELL 253 -#define ITEM_SEA_INCENSE 254 -#define ITEM_LAX_INCENSE 255 -#define ITEM_LUCKY_PUNCH 256 -#define ITEM_METAL_POWDER 257 -#define ITEM_THICK_CLUB 258 -#define ITEM_STICK 259 -#define ITEM_RED_SCARF 260 -#define ITEM_BLUE_SCARF 261 -#define ITEM_PINK_SCARF 262 -#define ITEM_GREEN_SCARF 263 -#define ITEM_YELLOW_SCARF 264 -#define ITEM_WIDE_LENS 265 -#define ITEM_MUSCLE_BAND 266 -#define ITEM_WISE_GLASSES 267 -#define ITEM_EXPERT_BELT 268 -#define ITEM_LIGHT_CLAY 269 -#define ITEM_LIFE_ORB 270 -#define ITEM_POWER_HERB 271 -#define ITEM_TOXIC_ORB 272 -#define ITEM_FLAME_ORB 273 -#define ITEM_QUICK_POWDER 274 -#define ITEM_FOCUS_SASH 275 -#define ITEM_ZOOM_LENS 276 -#define ITEM_METRONOME 277 -#define ITEM_IRON_BALL 278 -#define ITEM_LAGGING_TAIL 279 -#define ITEM_DESTINY_KNOT 280 -#define ITEM_BLACK_SLUDGE 281 -#define ITEM_ICY_ROCK 282 -#define ITEM_SMOOTH_ROCK 283 -#define ITEM_HEAT_ROCK 284 -#define ITEM_DAMP_ROCK 285 -#define ITEM_GRIP_CLAW 286 -#define ITEM_CHOICE_SCARF 287 -#define ITEM_STICKY_BARB 288 -#define ITEM_POWER_BRACER 289 -#define ITEM_POWER_BELT 290 -#define ITEM_POWER_LENS 291 -#define ITEM_POWER_BAND 292 -#define ITEM_POWER_ANKLET 293 -#define ITEM_POWER_WEIGHT 294 -#define ITEM_SHED_SHELL 295 -#define ITEM_BIG_ROOT 296 -#define ITEM_CHOICE_SPECS 297 -#define ITEM_FLAME_PLATE 298 -#define ITEM_SPLASH_PLATE 299 -#define ITEM_ZAP_PLATE 300 -#define ITEM_MEADOW_PLATE 301 -#define ITEM_ICICLE_PLATE 302 -#define ITEM_FIST_PLATE 303 -#define ITEM_TOXIC_PLATE 304 -#define ITEM_EARTH_PLATE 305 -#define ITEM_SKY_PLATE 306 -#define ITEM_MIND_PLATE 307 -#define ITEM_INSECT_PLATE 308 -#define ITEM_STONE_PLATE 309 -#define ITEM_SPOOKY_PLATE 310 -#define ITEM_DRACO_PLATE 311 -#define ITEM_DREAD_PLATE 312 -#define ITEM_IRON_PLATE 313 -#define ITEM_ODD_INCENSE 314 -#define ITEM_ROCK_INCENSE 315 -#define ITEM_FULL_INCENSE 316 -#define ITEM_WAVE_INCENSE 317 -#define ITEM_ROSE_INCENSE 318 -#define ITEM_LUCK_INCENSE 319 -#define ITEM_PURE_INCENSE 320 -#define ITEM_PROTECTOR 321 -#define ITEM_ELECTIRIZER 322 -#define ITEM_MAGMARIZER 323 -#define ITEM_DUBIOUS_DISC 324 -#define ITEM_REAPER_CLOTH 325 -#define ITEM_RAZOR_CLAW 326 -#define ITEM_RAZOR_FANG 327 -#define ITEM_TM01 328 -#define ITEM_TM02 329 -#define ITEM_TM03 330 -#define ITEM_TM04 331 -#define ITEM_TM05 332 -#define ITEM_TM06 333 -#define ITEM_TM07 334 -#define ITEM_TM08 335 -#define ITEM_TM09 336 -#define ITEM_TM10 337 -#define ITEM_TM11 338 -#define ITEM_TM12 339 -#define ITEM_TM13 340 -#define ITEM_TM14 341 -#define ITEM_TM15 342 -#define ITEM_TM16 343 -#define ITEM_TM17 344 -#define ITEM_TM18 345 -#define ITEM_TM19 346 -#define ITEM_TM20 347 -#define ITEM_TM21 348 -#define ITEM_TM22 349 -#define ITEM_TM23 350 -#define ITEM_TM24 351 -#define ITEM_TM25 352 -#define ITEM_TM26 353 -#define ITEM_TM27 354 -#define ITEM_TM28 355 -#define ITEM_TM29 356 -#define ITEM_TM30 357 -#define ITEM_TM31 358 -#define ITEM_TM32 359 -#define ITEM_TM33 360 -#define ITEM_TM34 361 -#define ITEM_TM35 362 -#define ITEM_TM36 363 -#define ITEM_TM37 364 -#define ITEM_TM38 365 -#define ITEM_TM39 366 -#define ITEM_TM40 367 -#define ITEM_TM41 368 -#define ITEM_TM42 369 -#define ITEM_TM43 370 -#define ITEM_TM44 371 -#define ITEM_TM45 372 -#define ITEM_TM46 373 -#define ITEM_TM47 374 -#define ITEM_TM48 375 -#define ITEM_TM49 376 -#define ITEM_TM50 377 -#define ITEM_TM51 378 -#define ITEM_TM52 379 -#define ITEM_TM53 380 -#define ITEM_TM54 381 -#define ITEM_TM55 382 -#define ITEM_TM56 383 -#define ITEM_TM57 384 -#define ITEM_TM58 385 -#define ITEM_TM59 386 -#define ITEM_TM60 387 -#define ITEM_TM61 388 -#define ITEM_TM62 389 -#define ITEM_TM63 390 -#define ITEM_TM64 391 -#define ITEM_TM65 392 -#define ITEM_TM66 393 -#define ITEM_TM67 394 -#define ITEM_TM68 395 -#define ITEM_TM69 396 -#define ITEM_TM70 397 -#define ITEM_TM71 398 -#define ITEM_TM72 399 -#define ITEM_TM73 400 -#define ITEM_TM74 401 -#define ITEM_TM75 402 -#define ITEM_TM76 403 -#define ITEM_TM77 404 -#define ITEM_TM78 405 -#define ITEM_TM79 406 -#define ITEM_TM80 407 -#define ITEM_TM81 408 -#define ITEM_TM82 409 -#define ITEM_TM83 410 -#define ITEM_TM84 411 -#define ITEM_TM85 412 -#define ITEM_TM86 413 -#define ITEM_TM87 414 -#define ITEM_TM88 415 -#define ITEM_TM89 416 -#define ITEM_TM90 417 -#define ITEM_TM91 418 -#define ITEM_TM92 419 -#define ITEM_HM01 420 -#define ITEM_HM02 421 -#define ITEM_HM03 422 -#define ITEM_HM04 423 -#define ITEM_HM05 424 -#define ITEM_HM06 425 -#define ITEM_HM07 426 -#define ITEM_HM08 427 -#define ITEM_EXPLORER_KIT 428 -#define ITEM_LOOT_SACK 429 -#define ITEM_RULE_BOOK 430 -#define ITEM_POKE_RADAR 431 -#define ITEM_POINT_CARD 432 -#define ITEM_JOURNAL 433 -#define ITEM_SEAL_CASE 434 -#define ITEM_FASHION_CASE 435 -#define ITEM_SEAL_BAG 436 -#define ITEM_PAL_PAD 437 -#define ITEM_WORKS_KEY 438 -#define ITEM_OLD_CHARM 439 -#define ITEM_GALACTIC_KEY 440 -#define ITEM_RED_CHAIN 441 -#define ITEM_TOWN_MAP 442 -#define ITEM_VS__SEEKER 443 -#define ITEM_COIN_CASE 444 -#define ITEM_OLD_ROD 445 -#define ITEM_GOOD_ROD 446 -#define ITEM_SUPER_ROD 447 -#define ITEM_SPRAYDUCK 448 -#define ITEM_POFFIN_CASE 449 -#define ITEM_BICYCLE 450 -#define ITEM_SUITE_KEY 451 -#define ITEM_OAKS_LETTER 452 -#define ITEM_LUNAR_WING 453 -#define ITEM_MEMBER_CARD 454 -#define ITEM_AZURE_FLUTE 455 -#define ITEM_S_S__TICKET 456 -#define ITEM_CONTEST_PASS 457 -#define ITEM_MAGMA_STONE 458 -#define ITEM_PARCEL 459 -#define ITEM_COUPON_1 460 -#define ITEM_COUPON_2 461 -#define ITEM_COUPON_3 462 -#define ITEM_STORAGE_KEY 463 -#define ITEM_SECRETPOTION 464 +#define ITEM_BRIGHTPOWDER 213 +#define ITEM_WHITE_HERB 214 +#define ITEM_MACHO_BRACE 215 +#define ITEM_EXP__SHARE 216 +#define ITEM_QUICK_CLAW 217 +#define ITEM_SOOTHE_BELL 218 +#define ITEM_MENTAL_HERB 219 +#define ITEM_CHOICE_BAND 220 +#define ITEM_KINGS_ROCK 221 +#define ITEM_SILVERPOWDER 222 +#define ITEM_AMULET_COIN 223 +#define ITEM_CLEANSE_TAG 224 +#define ITEM_SOUL_DEW 225 +#define ITEM_DEEPSEATOOTH 226 +#define ITEM_DEEPSEASCALE 227 +#define ITEM_SMOKE_BALL 228 +#define ITEM_EVERSTONE 229 +#define ITEM_FOCUS_BAND 230 +#define ITEM_LUCKY_EGG 231 +#define ITEM_SCOPE_LENS 232 +#define ITEM_METAL_COAT 233 +#define ITEM_LEFTOVERS 234 +#define ITEM_DRAGON_SCALE 235 +#define ITEM_LIGHT_BALL 236 +#define ITEM_SOFT_SAND 237 +#define ITEM_HARD_STONE 238 +#define ITEM_MIRACLE_SEED 239 +#define ITEM_BLACKGLASSES 240 +#define ITEM_BLACK_BELT 241 +#define ITEM_MAGNET 242 +#define ITEM_MYSTIC_WATER 243 +#define ITEM_SHARP_BEAK 244 +#define ITEM_POISON_BARB 245 +#define ITEM_NEVERMELTICE 246 +#define ITEM_SPELL_TAG 247 +#define ITEM_TWISTEDSPOON 248 +#define ITEM_CHARCOAL 249 +#define ITEM_DRAGON_FANG 250 +#define ITEM_SILK_SCARF 251 +#define ITEM_UPGRADE 252 +#define ITEM_SHELL_BELL 253 +#define ITEM_SEA_INCENSE 254 +#define ITEM_LAX_INCENSE 255 +#define ITEM_LUCKY_PUNCH 256 +#define ITEM_METAL_POWDER 257 +#define ITEM_THICK_CLUB 258 +#define ITEM_STICK 259 +#define ITEM_RED_SCARF 260 +#define ITEM_BLUE_SCARF 261 +#define ITEM_PINK_SCARF 262 +#define ITEM_GREEN_SCARF 263 +#define ITEM_YELLOW_SCARF 264 +#define ITEM_WIDE_LENS 265 +#define ITEM_MUSCLE_BAND 266 +#define ITEM_WISE_GLASSES 267 +#define ITEM_EXPERT_BELT 268 +#define ITEM_LIGHT_CLAY 269 +#define ITEM_LIFE_ORB 270 +#define ITEM_POWER_HERB 271 +#define ITEM_TOXIC_ORB 272 +#define ITEM_FLAME_ORB 273 +#define ITEM_QUICK_POWDER 274 +#define ITEM_FOCUS_SASH 275 +#define ITEM_ZOOM_LENS 276 +#define ITEM_METRONOME 277 +#define ITEM_IRON_BALL 278 +#define ITEM_LAGGING_TAIL 279 +#define ITEM_DESTINY_KNOT 280 +#define ITEM_BLACK_SLUDGE 281 +#define ITEM_ICY_ROCK 282 +#define ITEM_SMOOTH_ROCK 283 +#define ITEM_HEAT_ROCK 284 +#define ITEM_DAMP_ROCK 285 +#define ITEM_GRIP_CLAW 286 +#define ITEM_CHOICE_SCARF 287 +#define ITEM_STICKY_BARB 288 +#define ITEM_POWER_BRACER 289 +#define ITEM_POWER_BELT 290 +#define ITEM_POWER_LENS 291 +#define ITEM_POWER_BAND 292 +#define ITEM_POWER_ANKLET 293 +#define ITEM_POWER_WEIGHT 294 +#define ITEM_SHED_SHELL 295 +#define ITEM_BIG_ROOT 296 +#define ITEM_CHOICE_SPECS 297 +#define ITEM_FLAME_PLATE 298 +#define ITEM_SPLASH_PLATE 299 +#define ITEM_ZAP_PLATE 300 +#define ITEM_MEADOW_PLATE 301 +#define ITEM_ICICLE_PLATE 302 +#define ITEM_FIST_PLATE 303 +#define ITEM_TOXIC_PLATE 304 +#define ITEM_EARTH_PLATE 305 +#define ITEM_SKY_PLATE 306 +#define ITEM_MIND_PLATE 307 +#define ITEM_INSECT_PLATE 308 +#define ITEM_STONE_PLATE 309 +#define ITEM_SPOOKY_PLATE 310 +#define ITEM_DRACO_PLATE 311 +#define ITEM_DREAD_PLATE 312 +#define ITEM_IRON_PLATE 313 +#define ITEM_ODD_INCENSE 314 +#define ITEM_ROCK_INCENSE 315 +#define ITEM_FULL_INCENSE 316 +#define ITEM_WAVE_INCENSE 317 +#define ITEM_ROSE_INCENSE 318 +#define ITEM_LUCK_INCENSE 319 +#define ITEM_PURE_INCENSE 320 +#define ITEM_PROTECTOR 321 +#define ITEM_ELECTIRIZER 322 +#define ITEM_MAGMARIZER 323 +#define ITEM_DUBIOUS_DISC 324 +#define ITEM_REAPER_CLOTH 325 +#define ITEM_RAZOR_CLAW 326 +#define ITEM_RAZOR_FANG 327 +#define ITEM_TM01 328 +#define ITEM_TM02 329 +#define ITEM_TM03 330 +#define ITEM_TM04 331 +#define ITEM_TM05 332 +#define ITEM_TM06 333 +#define ITEM_TM07 334 +#define ITEM_TM08 335 +#define ITEM_TM09 336 +#define ITEM_TM10 337 +#define ITEM_TM11 338 +#define ITEM_TM12 339 +#define ITEM_TM13 340 +#define ITEM_TM14 341 +#define ITEM_TM15 342 +#define ITEM_TM16 343 +#define ITEM_TM17 344 +#define ITEM_TM18 345 +#define ITEM_TM19 346 +#define ITEM_TM20 347 +#define ITEM_TM21 348 +#define ITEM_TM22 349 +#define ITEM_TM23 350 +#define ITEM_TM24 351 +#define ITEM_TM25 352 +#define ITEM_TM26 353 +#define ITEM_TM27 354 +#define ITEM_TM28 355 +#define ITEM_TM29 356 +#define ITEM_TM30 357 +#define ITEM_TM31 358 +#define ITEM_TM32 359 +#define ITEM_TM33 360 +#define ITEM_TM34 361 +#define ITEM_TM35 362 +#define ITEM_TM36 363 +#define ITEM_TM37 364 +#define ITEM_TM38 365 +#define ITEM_TM39 366 +#define ITEM_TM40 367 +#define ITEM_TM41 368 +#define ITEM_TM42 369 +#define ITEM_TM43 370 +#define ITEM_TM44 371 +#define ITEM_TM45 372 +#define ITEM_TM46 373 +#define ITEM_TM47 374 +#define ITEM_TM48 375 +#define ITEM_TM49 376 +#define ITEM_TM50 377 +#define ITEM_TM51 378 +#define ITEM_TM52 379 +#define ITEM_TM53 380 +#define ITEM_TM54 381 +#define ITEM_TM55 382 +#define ITEM_TM56 383 +#define ITEM_TM57 384 +#define ITEM_TM58 385 +#define ITEM_TM59 386 +#define ITEM_TM60 387 +#define ITEM_TM61 388 +#define ITEM_TM62 389 +#define ITEM_TM63 390 +#define ITEM_TM64 391 +#define ITEM_TM65 392 +#define ITEM_TM66 393 +#define ITEM_TM67 394 +#define ITEM_TM68 395 +#define ITEM_TM69 396 +#define ITEM_TM70 397 +#define ITEM_TM71 398 +#define ITEM_TM72 399 +#define ITEM_TM73 400 +#define ITEM_TM74 401 +#define ITEM_TM75 402 +#define ITEM_TM76 403 +#define ITEM_TM77 404 +#define ITEM_TM78 405 +#define ITEM_TM79 406 +#define ITEM_TM80 407 +#define ITEM_TM81 408 +#define ITEM_TM82 409 +#define ITEM_TM83 410 +#define ITEM_TM84 411 +#define ITEM_TM85 412 +#define ITEM_TM86 413 +#define ITEM_TM87 414 +#define ITEM_TM88 415 +#define ITEM_TM89 416 +#define ITEM_TM90 417 +#define ITEM_TM91 418 +#define ITEM_TM92 419 +#define ITEM_HM01 420 +#define ITEM_HM02 421 +#define ITEM_HM03 422 +#define ITEM_HM04 423 +#define ITEM_HM05 424 +#define ITEM_HM06 425 +#define ITEM_HM07 426 +#define ITEM_HM08 427 +#define ITEM_EXPLORER_KIT 428 +#define ITEM_LOOT_SACK 429 +#define ITEM_RULE_BOOK 430 +#define ITEM_POKE_RADAR 431 +#define ITEM_POINT_CARD 432 +#define ITEM_JOURNAL 433 +#define ITEM_SEAL_CASE 434 +#define ITEM_FASHION_CASE 435 +#define ITEM_SEAL_BAG 436 +#define ITEM_PAL_PAD 437 +#define ITEM_WORKS_KEY 438 +#define ITEM_OLD_CHARM 439 +#define ITEM_GALACTIC_KEY 440 +#define ITEM_RED_CHAIN 441 +#define ITEM_TOWN_MAP 442 +#define ITEM_VS__SEEKER 443 +#define ITEM_COIN_CASE 444 +#define ITEM_OLD_ROD 445 +#define ITEM_GOOD_ROD 446 +#define ITEM_SUPER_ROD 447 +#define ITEM_SPRAYDUCK 448 +#define ITEM_POFFIN_CASE 449 +#define ITEM_BICYCLE 450 +#define ITEM_SUITE_KEY 451 +#define ITEM_OAKS_LETTER 452 +#define ITEM_LUNAR_WING 453 +#define ITEM_MEMBER_CARD 454 +#define ITEM_AZURE_FLUTE 455 +#define ITEM_S_S__TICKET 456 +#define ITEM_CONTEST_PASS 457 +#define ITEM_MAGMA_STONE 458 +#define ITEM_PARCEL 459 +#define ITEM_COUPON_1 460 +#define ITEM_COUPON_2 461 +#define ITEM_COUPON_3 462 +#define ITEM_STORAGE_KEY 463 +#define ITEM_SECRETPOTION 464 #define TM_FOCUS_PUNCH ITEM_TM01 #define TM_DRAGON_CLAW ITEM_TM02 @@ -792,4 +792,4 @@ #define NUM_TMS 92 #define NUM_HMS 8 -#endif //POKEDIAMOND_CONSTANTS_ITEMS_H +#endif // POKEDIAMOND_CONSTANTS_ITEMS_H diff --git a/include/constants/map_sections.h b/include/constants/map_sections.h index 462d49ee5..75ba18074 100644 --- a/include/constants/map_sections.h +++ b/include/constants/map_sections.h @@ -1,119 +1,119 @@ #ifndef POKEDIAMOND_CONSTANTS_MAP_SECTIONS_H #define POKEDIAMOND_CONSTANTS_MAP_SECTIONS_H -#define MAPSEC_MYSTERY_ZONE 0 -#define MAPSEC_TWINLEAF_TOWN 1 -#define MAPSEC_SANDGEM_TOWN 2 -#define MAPSEC_FLOAROMA_TOWN 3 -#define MAPSEC_SOLACEON_TOWN 4 -#define MAPSEC_CELESTIC_TOWN 5 -#define MAPSEC_JUBILIFE_CITY 6 -#define MAPSEC_CANALAVE_CITY 7 -#define MAPSEC_OREBURGH_CITY 8 -#define MAPSEC_ETERNA_CITY 9 -#define MAPSEC_HEARTHOME_CITY 10 -#define MAPSEC_PASTORIA_CITY 11 -#define MAPSEC_VEILSTONE_CITY 12 -#define MAPSEC_SUNYSHORE_CITY 13 -#define MAPSEC_SNOWPOINT_CITY 14 -#define MAPSEC_POKEMON_LEAGUE 15 -#define MAPSEC_ROUTE_201 16 -#define MAPSEC_ROUTE_202 17 -#define MAPSEC_ROUTE_203 18 -#define MAPSEC_ROUTE_204 19 -#define MAPSEC_ROUTE_205 20 -#define MAPSEC_ROUTE_206 21 -#define MAPSEC_ROUTE_207 22 -#define MAPSEC_ROUTE_208 23 -#define MAPSEC_ROUTE_209 24 -#define MAPSEC_ROUTE_210 25 -#define MAPSEC_ROUTE_211 26 -#define MAPSEC_ROUTE_212 27 -#define MAPSEC_ROUTE_213 28 -#define MAPSEC_ROUTE_214 29 -#define MAPSEC_ROUTE_215 30 -#define MAPSEC_ROUTE_216 31 -#define MAPSEC_ROUTE_217 32 -#define MAPSEC_ROUTE_218 33 -#define MAPSEC_ROUTE_219 34 -#define MAPSEC_ROUTE_220 35 -#define MAPSEC_ROUTE_221 36 -#define MAPSEC_ROUTE_222 37 -#define MAPSEC_ROUTE_223 38 -#define MAPSEC_ROUTE_224 39 -#define MAPSEC_ROUTE_225 40 -#define MAPSEC_ROUTE_226 41 -#define MAPSEC_ROUTE_227 42 -#define MAPSEC_ROUTE_228 43 -#define MAPSEC_ROUTE_229 44 -#define MAPSEC_ROUTE_230 45 -#define MAPSEC_OREBURGH_MINE 46 -#define MAPSEC_VALLEY_WINDWORKS 47 -#define MAPSEC_ETERNA_FOREST 48 -#define MAPSEC_FUEGO_IRONWORKS 49 -#define MAPSEC_MT_CORONET 50 -#define MAPSEC_SPEAR_PILLAR 51 -#define MAPSEC_GREAT_MARSH 52 -#define MAPSEC_SOLACEON_RUINS 53 -#define MAPSEC_VICTORY_ROAD 54 -#define MAPSEC_PAL_PARK 55 -#define MAPSEC_AMITY_SQUARE 56 -#define MAPSEC_RAVAGED_PATH 57 -#define MAPSEC_FLOAROMA_MEADOW 58 -#define MAPSEC_OREBURGH_GATE 59 -#define MAPSEC_FULLMOON_ISLAND 60 -#define MAPSEC_SENDOFF_SPRING 61 -#define MAPSEC_TURNBACK_CAVE 62 -#define MAPSEC_FLOWER_PARADISE 63 -#define MAPSEC_SNOWPOINT_TEMPLE 64 -#define MAPSEC_WAYWARD_CAVE 65 -#define MAPSEC_RUIN_MANIAC_CAVE 66 -#define MAPSEC_MANIAC_TUNNEL 67 -#define MAPSEC_TROPHY_GARDEN 68 -#define MAPSEC_IRON_ISLAND 69 -#define MAPSEC_OLD_CHATEAU 70 -#define MAPSEC_GALACTIC_HQ 71 -#define MAPSEC_VERITY_LAKEFRONT 72 -#define MAPSEC_VALOR_LAKEFRONT 73 -#define MAPSEC_ACUITY_LAKEFRONT 74 -#define MAPSEC_SPRING_PATH 75 -#define MAPSEC_LAKE_VERITY 76 -#define MAPSEC_LAKE_VALOR 77 -#define MAPSEC_LAKE_ACUITY 78 -#define MAPSEC_NEWMOON_ISLAND 79 -#define MAPSEC_BATTLE_TOWER 80 -#define MAPSEC_FIGHT_AREA 81 -#define MAPSEC_SURVIVAL_AREA 82 -#define MAPSEC_RESORT_AREA 83 -#define MAPSEC_STARK_MOUNTAIN 84 -#define MAPSEC_SEABREAK_PATH 85 -#define MAPSEC_HALL_OF_ORIGIN 86 -#define MAPSEC_VERITY_CAVERN 87 -#define MAPSEC_VALOR_CAVERN 88 -#define MAPSEC_ACUITY_CAVERN 89 -#define MAPSEC_JUBILIFE_TV 90 -#define MAPSEC_POKETCH_CO 91 -#define MAPSEC_GTS 92 -#define MAPSEC_TRAINERS_SCHOOL 93 -#define MAPSEC_MINING_MUSEUM 94 -#define MAPSEC_FLOWER_SHOP 95 -#define MAPSEC_CYCLE_SHOP 96 -#define MAPSEC_CONTEST_HALL 97 -#define MAPSEC_POFFIN_HOUSE 98 -#define MAPSEC_FOREIGN_BUILDING 99 -#define MAPSEC_POKEMON_DAY_CARE 100 -#define MAPSEC_VEILSTONE_STORE 101 -#define MAPSEC_GAME_CORNER 102 -#define MAPSEC_CANALAVE_LIBRARY 103 -#define MAPSEC_VISTA_LIGHTHOUSE 104 -#define MAPSEC_SUNYSHORE_MARKET 105 -#define MAPSEC_POKEMON_MANSION 106 -#define MAPSEC_FOOTSTEP_HOUSE 107 -#define MAPSEC_CAFE 108 -#define MAPSEC_GRAND_LAKE 109 -#define MAPSEC_RESTAURANT 110 -#define MAPSEC_BATTLE_PARK 111 +#define MAPSEC_MYSTERY_ZONE 0 +#define MAPSEC_TWINLEAF_TOWN 1 +#define MAPSEC_SANDGEM_TOWN 2 +#define MAPSEC_FLOAROMA_TOWN 3 +#define MAPSEC_SOLACEON_TOWN 4 +#define MAPSEC_CELESTIC_TOWN 5 +#define MAPSEC_JUBILIFE_CITY 6 +#define MAPSEC_CANALAVE_CITY 7 +#define MAPSEC_OREBURGH_CITY 8 +#define MAPSEC_ETERNA_CITY 9 +#define MAPSEC_HEARTHOME_CITY 10 +#define MAPSEC_PASTORIA_CITY 11 +#define MAPSEC_VEILSTONE_CITY 12 +#define MAPSEC_SUNYSHORE_CITY 13 +#define MAPSEC_SNOWPOINT_CITY 14 +#define MAPSEC_POKEMON_LEAGUE 15 +#define MAPSEC_ROUTE_201 16 +#define MAPSEC_ROUTE_202 17 +#define MAPSEC_ROUTE_203 18 +#define MAPSEC_ROUTE_204 19 +#define MAPSEC_ROUTE_205 20 +#define MAPSEC_ROUTE_206 21 +#define MAPSEC_ROUTE_207 22 +#define MAPSEC_ROUTE_208 23 +#define MAPSEC_ROUTE_209 24 +#define MAPSEC_ROUTE_210 25 +#define MAPSEC_ROUTE_211 26 +#define MAPSEC_ROUTE_212 27 +#define MAPSEC_ROUTE_213 28 +#define MAPSEC_ROUTE_214 29 +#define MAPSEC_ROUTE_215 30 +#define MAPSEC_ROUTE_216 31 +#define MAPSEC_ROUTE_217 32 +#define MAPSEC_ROUTE_218 33 +#define MAPSEC_ROUTE_219 34 +#define MAPSEC_ROUTE_220 35 +#define MAPSEC_ROUTE_221 36 +#define MAPSEC_ROUTE_222 37 +#define MAPSEC_ROUTE_223 38 +#define MAPSEC_ROUTE_224 39 +#define MAPSEC_ROUTE_225 40 +#define MAPSEC_ROUTE_226 41 +#define MAPSEC_ROUTE_227 42 +#define MAPSEC_ROUTE_228 43 +#define MAPSEC_ROUTE_229 44 +#define MAPSEC_ROUTE_230 45 +#define MAPSEC_OREBURGH_MINE 46 +#define MAPSEC_VALLEY_WINDWORKS 47 +#define MAPSEC_ETERNA_FOREST 48 +#define MAPSEC_FUEGO_IRONWORKS 49 +#define MAPSEC_MT_CORONET 50 +#define MAPSEC_SPEAR_PILLAR 51 +#define MAPSEC_GREAT_MARSH 52 +#define MAPSEC_SOLACEON_RUINS 53 +#define MAPSEC_VICTORY_ROAD 54 +#define MAPSEC_PAL_PARK 55 +#define MAPSEC_AMITY_SQUARE 56 +#define MAPSEC_RAVAGED_PATH 57 +#define MAPSEC_FLOAROMA_MEADOW 58 +#define MAPSEC_OREBURGH_GATE 59 +#define MAPSEC_FULLMOON_ISLAND 60 +#define MAPSEC_SENDOFF_SPRING 61 +#define MAPSEC_TURNBACK_CAVE 62 +#define MAPSEC_FLOWER_PARADISE 63 +#define MAPSEC_SNOWPOINT_TEMPLE 64 +#define MAPSEC_WAYWARD_CAVE 65 +#define MAPSEC_RUIN_MANIAC_CAVE 66 +#define MAPSEC_MANIAC_TUNNEL 67 +#define MAPSEC_TROPHY_GARDEN 68 +#define MAPSEC_IRON_ISLAND 69 +#define MAPSEC_OLD_CHATEAU 70 +#define MAPSEC_GALACTIC_HQ 71 +#define MAPSEC_VERITY_LAKEFRONT 72 +#define MAPSEC_VALOR_LAKEFRONT 73 +#define MAPSEC_ACUITY_LAKEFRONT 74 +#define MAPSEC_SPRING_PATH 75 +#define MAPSEC_LAKE_VERITY 76 +#define MAPSEC_LAKE_VALOR 77 +#define MAPSEC_LAKE_ACUITY 78 +#define MAPSEC_NEWMOON_ISLAND 79 +#define MAPSEC_BATTLE_TOWER 80 +#define MAPSEC_FIGHT_AREA 81 +#define MAPSEC_SURVIVAL_AREA 82 +#define MAPSEC_RESORT_AREA 83 +#define MAPSEC_STARK_MOUNTAIN 84 +#define MAPSEC_SEABREAK_PATH 85 +#define MAPSEC_HALL_OF_ORIGIN 86 +#define MAPSEC_VERITY_CAVERN 87 +#define MAPSEC_VALOR_CAVERN 88 +#define MAPSEC_ACUITY_CAVERN 89 +#define MAPSEC_JUBILIFE_TV 90 +#define MAPSEC_POKETCH_CO 91 +#define MAPSEC_GTS 92 +#define MAPSEC_TRAINERS_SCHOOL 93 +#define MAPSEC_MINING_MUSEUM 94 +#define MAPSEC_FLOWER_SHOP 95 +#define MAPSEC_CYCLE_SHOP 96 +#define MAPSEC_CONTEST_HALL 97 +#define MAPSEC_POFFIN_HOUSE 98 +#define MAPSEC_FOREIGN_BUILDING 99 +#define MAPSEC_POKEMON_DAY_CARE 100 +#define MAPSEC_VEILSTONE_STORE 101 +#define MAPSEC_GAME_CORNER 102 +#define MAPSEC_CANALAVE_LIBRARY 103 +#define MAPSEC_VISTA_LIGHTHOUSE 104 +#define MAPSEC_SUNYSHORE_MARKET 105 +#define MAPSEC_POKEMON_MANSION 106 +#define MAPSEC_FOOTSTEP_HOUSE 107 +#define MAPSEC_CAFE 108 +#define MAPSEC_GRAND_LAKE 109 +#define MAPSEC_RESTAURANT 110 +#define MAPSEC_BATTLE_PARK 111 #define METLOC_DAY_CARE_COUPLE 2000 #define METLOC_LOVELY_PLACE 3000 // Used for event Pokémon -#endif //POKEDIAMOND_CONSTANTS_MAP_SECTIONS_H +#endif // POKEDIAMOND_CONSTANTS_MAP_SECTIONS_H diff --git a/include/constants/maps.h b/include/constants/maps.h index d6dac8676..5d7a766d1 100644 --- a/include/constants/maps.h +++ b/include/constants/maps.h @@ -1,564 +1,564 @@ #ifndef POKEDIAMOND_CONSTANTS_MAPS_H #define POKEDIAMOND_CONSTANTS_MAPS_H -#define MAP_EVERYWHERE 0 -#define MAP_NOTHING 1 -#define MAP_UG 2 -#define MAP_C01 3 -#define MAP_C01FS0101 4 -#define MAP_C01GYM0101 5 -#define MAP_C01PC0101 6 -#define MAP_C01PC0102 7 -#define MAP_C01R0101 8 -#define MAP_C01R0102 9 -#define MAP_C01R0103 10 -#define MAP_C01R0201 11 -#define MAP_C01R0202 12 -#define MAP_C01R0203 13 -#define MAP_C01R0204 14 -#define MAP_C01R0205 15 -#define MAP_C01R0206 16 -#define MAP_C01R0207 17 -#define MAP_C01R0208 18 -#define MAP_C01R0301 19 -#define MAP_C01R0302 20 -#define MAP_C01R0303 21 -#define MAP_C01R0304 22 -#define MAP_C01R0401 23 -#define MAP_C01R0501 24 -#define MAP_C01R0502 25 -#define MAP_C01R0503 26 -#define MAP_C01R0504 27 -#define MAP_C01R0601 28 -#define MAP_C01R0701 29 -#define MAP_C01R0801 30 -#define MAP_C01R0901 31 -#define MAP_C01R1001 32 -#define MAP_C02 33 -#define MAP_C02FS0101 34 -#define MAP_C02GYM0101 35 -#define MAP_C02PC0101 36 -#define MAP_C02PC0102 37 -#define MAP_C02R0101 38 -#define MAP_C02R0102 39 -#define MAP_C02R0103 40 -#define MAP_C02R0201 41 -#define MAP_C02R0301 42 -#define MAP_C02R0401 43 -#define MAP_C02R0501 44 -#define MAP_C03 45 -#define MAP_C03FS0101 46 -#define MAP_C03GYM0101 47 -#define MAP_C03PC0101 48 -#define MAP_C03PC0102 49 -#define MAP_C03R0101 50 -#define MAP_C03R0102 51 -#define MAP_C03R0103 52 -#define MAP_C03R0104 53 -#define MAP_C03R0201 54 -#define MAP_C03R0202 55 -#define MAP_C03R0203 56 -#define MAP_C03R0204 57 -#define MAP_C03R0301 58 -#define MAP_C03R0401 59 -#define MAP_C03R0501 60 -#define MAP_C03R0601 61 -#define MAP_C03R0602 62 -#define MAP_C03R0603 63 -#define MAP_C03R0701 64 -#define MAP_C04 65 -#define MAP_C04FS0101 66 -#define MAP_C04GYM0101 67 -#define MAP_C04GYM0102 68 -#define MAP_C04PC0101 69 -#define MAP_C04PC0102 70 -#define MAP_C04R0101 71 -#define MAP_C04R0201 72 -#define MAP_C04R0202 73 -#define MAP_C04R0203 74 -#define MAP_C04R0204 75 -#define MAP_C04R0301 76 -#define MAP_C04R0302 77 -#define MAP_C04R0303 78 -#define MAP_C04R0304 79 -#define MAP_C04R0401 80 -#define MAP_C04R0501 81 -#define MAP_C04R0601 82 -#define MAP_C04R0701 83 -#define MAP_C04R0801 84 -#define MAP_C04R0901 85 -#define MAP_C05 86 -#define MAP_C05FS0101 87 -#define MAP_C05GYM0101 88 -#define MAP_C05GYM0102 89 -#define MAP_C05GYM0103 90 -#define MAP_C05GYM0104 91 -#define MAP_C05GYM0105 92 -#define MAP_C05GYM0106 93 -#define MAP_C05GYM0107 94 -#define MAP_C05GYM0108 95 -#define MAP_C05GYM0109 96 -#define MAP_C05GYM0110 97 -#define MAP_C05GYM0111 98 -#define MAP_C05GYM0112 99 -#define MAP_C05GYM0113 100 -#define MAP_C05PC0101 101 -#define MAP_C05PC0102 102 -#define MAP_C05R0101 103 -#define MAP_C05R0102 104 -#define MAP_C05R0103 105 -#define MAP_C05R0201 106 -#define MAP_C05R0301 107 -#define MAP_C05R0401 108 -#define MAP_C05R0501 109 -#define MAP_C05R0601 110 -#define MAP_C05R0701 111 -#define MAP_C05R0801 112 -#define MAP_C05R0802 113 -#define MAP_C05R0803 114 -#define MAP_C05R0901 115 -#define MAP_C05R1001 116 -#define MAP_C05R1101 117 -#define MAP_C05R1102 118 -#define MAP_C05R1201 119 -#define MAP_C06 120 -#define MAP_C06FS0101 121 -#define MAP_C06GYM0101 122 -#define MAP_C06PC0101 123 -#define MAP_C06PC0102 124 -#define MAP_C06R0101 125 -#define MAP_C06R0102 126 -#define MAP_C06R0201 127 -#define MAP_C06R0301 128 -#define MAP_C06R0401 129 -#define MAP_C06R0501 130 -#define MAP_C06R0601 131 -#define MAP_C07 132 -#define MAP_C07GYM0101 133 -#define MAP_C07PC0101 134 -#define MAP_C07PC0102 135 -#define MAP_C07R0101 136 -#define MAP_C07R0201 137 -#define MAP_C07R0202 138 -#define MAP_C07R0203 139 -#define MAP_C07R0204 140 -#define MAP_C07R0205 141 -#define MAP_C07R0206 142 -#define MAP_C07R0301 143 -#define MAP_C07R0401 144 -#define MAP_C07R0501 145 -#define MAP_C07R0601 146 -#define MAP_C07R0701 147 -#define MAP_C07R0801 148 -#define MAP_C07R0901 149 -#define MAP_C08 150 -#define MAP_C08PC0101 151 -#define MAP_C08PC0102 152 -#define MAP_C08FS0101 153 -#define MAP_C08GYM0101 154 -#define MAP_C08GYM0102 155 -#define MAP_C08GYM0103 156 -#define MAP_C08R0101 157 -#define MAP_C08R0201 158 -#define MAP_C08R0301 159 -#define MAP_C08R0401 160 -#define MAP_C08R0501 161 -#define MAP_C08R0601 162 -#define MAP_C08R0701 163 -#define MAP_C08R0801 164 -#define MAP_C09 165 -#define MAP_C09FS0101 166 -#define MAP_C09GYM0101 167 -#define MAP_C09PC0101 168 -#define MAP_C09PC0102 169 -#define MAP_C09R0101 170 -#define MAP_C09R0201 171 -#define MAP_C10 172 -#define MAP_C10PC0101 173 -#define MAP_C10PC0102 174 -#define MAP_C10R0101 175 -#define MAP_C10R0102 176 -#define MAP_C10R0103 177 -#define MAP_C10R0104 178 -#define MAP_C10R0105 179 -#define MAP_C10R0106 180 -#define MAP_C10R0107 181 -#define MAP_C10R0108 182 -#define MAP_C10R0109 183 -#define MAP_C10R0110 184 -#define MAP_C10R0111 185 -#define MAP_C10R0112 186 -#define MAP_C10R0113 187 -#define MAP_C11 188 -#define MAP_C11PC0101 189 -#define MAP_C11PC0102 190 -#define MAP_C11FS0101 191 -#define MAP_C11R0101 192 -#define MAP_C11R0201 193 -#define MAP_C11R0301 194 -#define MAP_C11R0401 195 -#define MAP_C11R0501 196 -#define MAP_D01 197 -#define MAP_D01R0101 198 -#define MAP_D01R0102 199 -#define MAP_D02 200 -#define MAP_D02R0101 201 -#define MAP_D03 202 -#define MAP_D03R0101 203 -#define MAP_D04 204 -#define MAP_D04R0101 205 -#define MAP_D05 206 -#define MAP_D05R0101 207 -#define MAP_D05R0102 208 -#define MAP_D05R0103 209 -#define MAP_D05R0104 210 -#define MAP_D05R0105 211 -#define MAP_D05R0106 212 -#define MAP_D05R0107 213 -#define MAP_D05R0108 214 -#define MAP_D05R0109 215 -#define MAP_D05R0110 216 -#define MAP_D05R0111 217 -#define MAP_D05R0112 218 -#define MAP_D05R0113 219 -#define MAP_D05R0114 220 -#define MAP_D05R0115 221 -#define MAP_D06 222 -#define MAP_D06R0101 223 -#define MAP_D07 224 -#define MAP_D07R0101 225 -#define MAP_D07R0102 226 -#define MAP_D07R0103 227 -#define MAP_D07R0104 228 -#define MAP_D07R0105 229 -#define MAP_D07R0106 230 -#define MAP_D07R0107 231 -#define MAP_D07R0108 232 -#define MAP_D07R0109 233 -#define MAP_D07R0110 234 -#define MAP_D07R0111 235 -#define MAP_D07R0112 236 -#define MAP_D07R0113 237 -#define MAP_D07R0114 238 -#define MAP_D07R0115 239 -#define MAP_D07R0116 240 -#define MAP_D07R0117 241 -#define MAP_D07R0118 242 -#define MAP_D09 243 -#define MAP_D09R0101 244 -#define MAP_D09R0102 245 -#define MAP_D09R0103 246 -#define MAP_D09R0104 247 -#define MAP_D09R0105 248 -#define MAP_D09R0106 249 -#define MAP_D10 250 -#define MAP_D10R0101 251 -#define MAP_D11 252 -#define MAP_D11R0101 253 -#define MAP_D12R0101 254 -#define MAP_D13 255 -#define MAP_D13R0101 256 -#define MAP_D13R0102 257 -#define MAP_D14R0101 258 -#define MAP_D14R0102 259 -#define MAP_D15 260 -#define MAP_D15R0101 261 -#define MAP_D16 262 -#define MAP_D16R0101 263 -#define MAP_D16R0102 264 -#define MAP_D16R0103 265 -#define MAP_D17 266 -#define MAP_D17R0101 267 -#define MAP_D17R0102 268 -#define MAP_D17R0103 269 -#define MAP_D17R0104 270 -#define MAP_D17R0105 271 -#define MAP_D17R0106 272 -#define MAP_D17R0107 273 -#define MAP_D18 274 -#define MAP_D18R0101 275 -#define MAP_D19A 276 -#define MAP_D19B 277 -#define MAP_D20R0101 278 -#define MAP_D20R0102 279 -#define MAP_D20R0103 280 -#define MAP_D20R0104 281 -#define MAP_D20R0105 282 -#define MAP_D20R0106 283 -#define MAP_D21R0101 284 -#define MAP_D21R0102 285 -#define MAP_D22R0101 286 -#define MAP_D23R0101 287 -#define MAP_D24 288 -#define MAP_D24R0101 289 -#define MAP_D24R0102 290 -#define MAP_D24R0103 291 -#define MAP_D24R0104 292 -#define MAP_D24R0105 293 -#define MAP_D24R0106 294 -#define MAP_D25R0101 295 -#define MAP_D25R0102 296 -#define MAP_D25R0103 297 -#define MAP_D25R0104 298 -#define MAP_D25R0105 299 -#define MAP_D25R0106 300 -#define MAP_D25R0107 301 -#define MAP_D25R0108 302 -#define MAP_D25R0109 303 -#define MAP_D25R1001 304 -#define MAP_D26R0101 305 -#define MAP_D26R0102 306 -#define MAP_D26R0103 307 -#define MAP_D26R0104 308 -#define MAP_D26R0105 309 -#define MAP_D26R0106 310 -#define MAP_D27R0101 311 -#define MAP_D27R0102 312 -#define MAP_D27R0103 313 -#define MAP_D28R0101 314 -#define MAP_D28R0102 315 -#define MAP_D28R0103 316 -#define MAP_D29R0101 317 -#define MAP_D29R0102 318 -#define MAP_D29R0103 319 -#define MAP_D30 320 -#define MAP_D30R0101 321 -#define MAP_D31 322 -#define MAP_D31R0101 323 -#define MAP_D31R0102 324 -#define MAP_D31R0103 325 -#define MAP_D31R0201 326 -#define MAP_D31R0202 327 -#define MAP_D31R0203 328 -#define MAP_D31R0204 329 -#define MAP_D31R0205 330 -#define MAP_D31R0206 331 -#define MAP_DIRECT2 332 -#define MAP_DIRECT4 333 -#define MAP_L01 334 -#define MAP_L01R0101 335 -#define MAP_L02 336 -#define MAP_L02R0101 337 -#define MAP_L02R0201 338 -#define MAP_L02R0301 339 -#define MAP_L03 340 -#define MAP_L04 341 -#define MAP_R201 342 -#define MAP_R202 343 -#define MAP_R203 344 -#define MAP_R204A 345 -#define MAP_R204B 346 -#define MAP_R205A 347 -#define MAP_R205AR0101 348 -#define MAP_R205B 349 -#define MAP_R206 350 -#define MAP_R206R0101 351 -#define MAP_R206R0201 352 -#define MAP_R207 353 -#define MAP_R208 354 -#define MAP_R208R0101 355 -#define MAP_R209 356 -#define MAP_R209R0101 357 -#define MAP_R209R0102 358 -#define MAP_R209R0103 359 -#define MAP_R209R0104 360 -#define MAP_R209R0105 361 -#define MAP_R210A 362 -#define MAP_R210B 363 -#define MAP_R210BR0101 364 -#define MAP_R211A 365 -#define MAP_R211B 366 -#define MAP_R212A 367 -#define MAP_R212AR0101 368 -#define MAP_R212AR0102 369 -#define MAP_R212AR0103 370 -#define MAP_R212B 371 -#define MAP_R212BR0101 372 -#define MAP_R213 373 -#define MAP_R213R0101 374 -#define MAP_R213R0201 375 -#define MAP_R213R0301 376 -#define MAP_R213R0401 377 -#define MAP_R213R0501 378 -#define MAP_R213R0601 379 -#define MAP_R214 380 -#define MAP_R214R0101 381 -#define MAP_R215 382 -#define MAP_R216 383 -#define MAP_R216R0101 384 -#define MAP_R217 385 -#define MAP_R217R0101 386 -#define MAP_R217R0201 387 -#define MAP_R218 388 -#define MAP_R218R0101 389 -#define MAP_R218R0201 390 -#define MAP_R219 391 -#define MAP_R221 392 -#define MAP_R221R0101 393 -#define MAP_R221R0201 394 -#define MAP_R222 395 -#define MAP_R222R0101 396 -#define MAP_R222R0201 397 -#define MAP_R222R0301 398 -#define MAP_R224 399 -#define MAP_R225 400 -#define MAP_R226A 401 -#define MAP_R226B 402 -#define MAP_R227 403 -#define MAP_R227A 404 -#define MAP_R227B 405 -#define MAP_R228 406 -#define MAP_R229 407 -#define MAP_R230 408 -#define MAP_R232 409 -#define MAP_RECORD 410 -#define MAP_T01 411 -#define MAP_T01R0101 412 -#define MAP_T01R0102 413 -#define MAP_T01R0201 414 -#define MAP_T01R0202 415 -#define MAP_T01R0301 416 -#define MAP_T01R0401 417 -#define MAP_T02 418 -#define MAP_T02FS0101 419 -#define MAP_T02PC0101 420 -#define MAP_T02PC0102 421 -#define MAP_T02R0101 422 -#define MAP_T02R0201 423 -#define MAP_T02R0202 424 -#define MAP_T02R0301 425 -#define MAP_T03 426 -#define MAP_T03FS0101 427 -#define MAP_T03PC0101 428 -#define MAP_T03PC0102 429 -#define MAP_T03R0101 430 -#define MAP_T03R0201 431 -#define MAP_T03R0301 432 -#define MAP_T04 433 -#define MAP_T04FS0101 434 -#define MAP_T04PC0101 435 -#define MAP_T04PC0102 436 -#define MAP_T04R0101 437 -#define MAP_T04R0201 438 -#define MAP_T04R0301 439 -#define MAP_T04R0401 440 -#define MAP_T04R0501 441 -#define MAP_T05 442 -#define MAP_T05PC0101 443 -#define MAP_T05PC0102 444 -#define MAP_T05R0101 445 -#define MAP_T05R0201 446 -#define MAP_T05R0301 447 -#define MAP_T05R0401 448 -#define MAP_T05R0501 449 -#define MAP_T06 450 -#define MAP_T06FS0101 451 -#define MAP_T06PC0101 452 -#define MAP_T06PC0102 453 -#define MAP_T06R0101 454 -#define MAP_T06R0201 455 -#define MAP_T06R0301 456 -#define MAP_T07 457 -#define MAP_T07FS0101 458 -#define MAP_T07PC0101 459 -#define MAP_T07PC0102 460 -#define MAP_T07R0101 461 -#define MAP_T07R0102 462 -#define MAP_T07R0103 463 -#define MAP_T07R0201 464 -#define MAP_T07R0301 465 -#define MAP_UNION 466 -#define MAP_W220 467 -#define MAP_W223 468 -#define MAP_W226 469 -#define MAP_W229 470 -#define MAP_W230 471 -#define MAP_W231 472 -#define MAP_W233 473 -#define MAP_C01PC0103 474 -#define MAP_C02PC0103 475 -#define MAP_C03PC0103 476 -#define MAP_C04PC0103 477 -#define MAP_C05PC0103 478 -#define MAP_C06PC0103 479 -#define MAP_C07PC0103 480 -#define MAP_C08PC0103 481 -#define MAP_C09PC0103 482 -#define MAP_C10PC0103 483 -#define MAP_C11PC0103 484 -#define MAP_T02PC0103 485 -#define MAP_T03PC0103 486 -#define MAP_T04PC0103 487 -#define MAP_T05PC0103 488 -#define MAP_T06PC0103 489 -#define MAP_T07PC0103 490 -#define MAP_C02R0601 491 -#define MAP_R210AR0101 492 -#define MAP_D31R0207 493 -#define MAP_D26R0107 494 -#define MAP_C10R0114 495 -#define MAP_C10R0115 496 -#define MAP_D26R0108 497 -#define MAP_R225R0101 498 -#define MAP_W226R0101 499 -#define MAP_R227R0101 500 -#define MAP_R228R0101 501 -#define MAP_R228R0201 502 -#define MAP_R228R0301 503 -#define MAP_D06R0201 504 -#define MAP_D06R0202 505 -#define MAP_D06R0203 506 -#define MAP_D06R0204 507 -#define MAP_D06R0205 508 -#define MAP_D06R0206 509 -#define MAP_D05R0116 510 -#define MAP_D05R0117 511 -#define MAP_D22R0102 512 -#define MAP_D22R0103 513 -#define MAP_D24R0201 514 -#define MAP_D07R0119 515 -#define MAP_C08R0802 516 -#define MAP_C01R0802 517 -#define MAP_D17R0108 518 -#define MAP_D17R0109 519 -#define MAP_D17R0110 520 -#define MAP_D17R0111 521 -#define MAP_D17R0112 522 -#define MAP_D17R0113 523 -#define MAP_D17R0114 524 -#define MAP_D17R0115 525 -#define MAP_D17R0116 526 -#define MAP_D17R0117 527 -#define MAP_D17R0118 528 -#define MAP_D17R0119 529 -#define MAP_D17R0120 530 -#define MAP_D17R0121 531 -#define MAP_D17R0122 532 -#define MAP_D17R0123 533 -#define MAP_D17R0124 534 -#define MAP_D17R0125 535 -#define MAP_D17R0126 536 -#define MAP_D17R0127 537 -#define MAP_D17R0128 538 -#define MAP_D17R0129 539 -#define MAP_D17R0130 540 -#define MAP_D17R0131 541 -#define MAP_D17R0132 542 -#define MAP_D17R0133 543 -#define MAP_D17R0134 544 -#define MAP_D17R0135 545 -#define MAP_D17R0136 546 -#define MAP_D17R0137 547 -#define MAP_D17R0138 548 -#define MAP_D17R0139 549 -#define MAP_D17R0140 550 -#define MAP_D17R0141 551 -#define MAP_D17R0142 552 -#define MAP_D17R0143 553 -#define MAP_D17R0144 554 -#define MAP_D17R0145 555 -#define MAP_D17R0146 556 -#define MAP_D17R0147 557 -#define MAP_C05R1103 558 +#define MAP_EVERYWHERE 0 +#define MAP_NOTHING 1 +#define MAP_UG 2 +#define MAP_C01 3 +#define MAP_C01FS0101 4 +#define MAP_C01GYM0101 5 +#define MAP_C01PC0101 6 +#define MAP_C01PC0102 7 +#define MAP_C01R0101 8 +#define MAP_C01R0102 9 +#define MAP_C01R0103 10 +#define MAP_C01R0201 11 +#define MAP_C01R0202 12 +#define MAP_C01R0203 13 +#define MAP_C01R0204 14 +#define MAP_C01R0205 15 +#define MAP_C01R0206 16 +#define MAP_C01R0207 17 +#define MAP_C01R0208 18 +#define MAP_C01R0301 19 +#define MAP_C01R0302 20 +#define MAP_C01R0303 21 +#define MAP_C01R0304 22 +#define MAP_C01R0401 23 +#define MAP_C01R0501 24 +#define MAP_C01R0502 25 +#define MAP_C01R0503 26 +#define MAP_C01R0504 27 +#define MAP_C01R0601 28 +#define MAP_C01R0701 29 +#define MAP_C01R0801 30 +#define MAP_C01R0901 31 +#define MAP_C01R1001 32 +#define MAP_C02 33 +#define MAP_C02FS0101 34 +#define MAP_C02GYM0101 35 +#define MAP_C02PC0101 36 +#define MAP_C02PC0102 37 +#define MAP_C02R0101 38 +#define MAP_C02R0102 39 +#define MAP_C02R0103 40 +#define MAP_C02R0201 41 +#define MAP_C02R0301 42 +#define MAP_C02R0401 43 +#define MAP_C02R0501 44 +#define MAP_C03 45 +#define MAP_C03FS0101 46 +#define MAP_C03GYM0101 47 +#define MAP_C03PC0101 48 +#define MAP_C03PC0102 49 +#define MAP_C03R0101 50 +#define MAP_C03R0102 51 +#define MAP_C03R0103 52 +#define MAP_C03R0104 53 +#define MAP_C03R0201 54 +#define MAP_C03R0202 55 +#define MAP_C03R0203 56 +#define MAP_C03R0204 57 +#define MAP_C03R0301 58 +#define MAP_C03R0401 59 +#define MAP_C03R0501 60 +#define MAP_C03R0601 61 +#define MAP_C03R0602 62 +#define MAP_C03R0603 63 +#define MAP_C03R0701 64 +#define MAP_C04 65 +#define MAP_C04FS0101 66 +#define MAP_C04GYM0101 67 +#define MAP_C04GYM0102 68 +#define MAP_C04PC0101 69 +#define MAP_C04PC0102 70 +#define MAP_C04R0101 71 +#define MAP_C04R0201 72 +#define MAP_C04R0202 73 +#define MAP_C04R0203 74 +#define MAP_C04R0204 75 +#define MAP_C04R0301 76 +#define MAP_C04R0302 77 +#define MAP_C04R0303 78 +#define MAP_C04R0304 79 +#define MAP_C04R0401 80 +#define MAP_C04R0501 81 +#define MAP_C04R0601 82 +#define MAP_C04R0701 83 +#define MAP_C04R0801 84 +#define MAP_C04R0901 85 +#define MAP_C05 86 +#define MAP_C05FS0101 87 +#define MAP_C05GYM0101 88 +#define MAP_C05GYM0102 89 +#define MAP_C05GYM0103 90 +#define MAP_C05GYM0104 91 +#define MAP_C05GYM0105 92 +#define MAP_C05GYM0106 93 +#define MAP_C05GYM0107 94 +#define MAP_C05GYM0108 95 +#define MAP_C05GYM0109 96 +#define MAP_C05GYM0110 97 +#define MAP_C05GYM0111 98 +#define MAP_C05GYM0112 99 +#define MAP_C05GYM0113 100 +#define MAP_C05PC0101 101 +#define MAP_C05PC0102 102 +#define MAP_C05R0101 103 +#define MAP_C05R0102 104 +#define MAP_C05R0103 105 +#define MAP_C05R0201 106 +#define MAP_C05R0301 107 +#define MAP_C05R0401 108 +#define MAP_C05R0501 109 +#define MAP_C05R0601 110 +#define MAP_C05R0701 111 +#define MAP_C05R0801 112 +#define MAP_C05R0802 113 +#define MAP_C05R0803 114 +#define MAP_C05R0901 115 +#define MAP_C05R1001 116 +#define MAP_C05R1101 117 +#define MAP_C05R1102 118 +#define MAP_C05R1201 119 +#define MAP_C06 120 +#define MAP_C06FS0101 121 +#define MAP_C06GYM0101 122 +#define MAP_C06PC0101 123 +#define MAP_C06PC0102 124 +#define MAP_C06R0101 125 +#define MAP_C06R0102 126 +#define MAP_C06R0201 127 +#define MAP_C06R0301 128 +#define MAP_C06R0401 129 +#define MAP_C06R0501 130 +#define MAP_C06R0601 131 +#define MAP_C07 132 +#define MAP_C07GYM0101 133 +#define MAP_C07PC0101 134 +#define MAP_C07PC0102 135 +#define MAP_C07R0101 136 +#define MAP_C07R0201 137 +#define MAP_C07R0202 138 +#define MAP_C07R0203 139 +#define MAP_C07R0204 140 +#define MAP_C07R0205 141 +#define MAP_C07R0206 142 +#define MAP_C07R0301 143 +#define MAP_C07R0401 144 +#define MAP_C07R0501 145 +#define MAP_C07R0601 146 +#define MAP_C07R0701 147 +#define MAP_C07R0801 148 +#define MAP_C07R0901 149 +#define MAP_C08 150 +#define MAP_C08PC0101 151 +#define MAP_C08PC0102 152 +#define MAP_C08FS0101 153 +#define MAP_C08GYM0101 154 +#define MAP_C08GYM0102 155 +#define MAP_C08GYM0103 156 +#define MAP_C08R0101 157 +#define MAP_C08R0201 158 +#define MAP_C08R0301 159 +#define MAP_C08R0401 160 +#define MAP_C08R0501 161 +#define MAP_C08R0601 162 +#define MAP_C08R0701 163 +#define MAP_C08R0801 164 +#define MAP_C09 165 +#define MAP_C09FS0101 166 +#define MAP_C09GYM0101 167 +#define MAP_C09PC0101 168 +#define MAP_C09PC0102 169 +#define MAP_C09R0101 170 +#define MAP_C09R0201 171 +#define MAP_C10 172 +#define MAP_C10PC0101 173 +#define MAP_C10PC0102 174 +#define MAP_C10R0101 175 +#define MAP_C10R0102 176 +#define MAP_C10R0103 177 +#define MAP_C10R0104 178 +#define MAP_C10R0105 179 +#define MAP_C10R0106 180 +#define MAP_C10R0107 181 +#define MAP_C10R0108 182 +#define MAP_C10R0109 183 +#define MAP_C10R0110 184 +#define MAP_C10R0111 185 +#define MAP_C10R0112 186 +#define MAP_C10R0113 187 +#define MAP_C11 188 +#define MAP_C11PC0101 189 +#define MAP_C11PC0102 190 +#define MAP_C11FS0101 191 +#define MAP_C11R0101 192 +#define MAP_C11R0201 193 +#define MAP_C11R0301 194 +#define MAP_C11R0401 195 +#define MAP_C11R0501 196 +#define MAP_D01 197 +#define MAP_D01R0101 198 +#define MAP_D01R0102 199 +#define MAP_D02 200 +#define MAP_D02R0101 201 +#define MAP_D03 202 +#define MAP_D03R0101 203 +#define MAP_D04 204 +#define MAP_D04R0101 205 +#define MAP_D05 206 +#define MAP_D05R0101 207 +#define MAP_D05R0102 208 +#define MAP_D05R0103 209 +#define MAP_D05R0104 210 +#define MAP_D05R0105 211 +#define MAP_D05R0106 212 +#define MAP_D05R0107 213 +#define MAP_D05R0108 214 +#define MAP_D05R0109 215 +#define MAP_D05R0110 216 +#define MAP_D05R0111 217 +#define MAP_D05R0112 218 +#define MAP_D05R0113 219 +#define MAP_D05R0114 220 +#define MAP_D05R0115 221 +#define MAP_D06 222 +#define MAP_D06R0101 223 +#define MAP_D07 224 +#define MAP_D07R0101 225 +#define MAP_D07R0102 226 +#define MAP_D07R0103 227 +#define MAP_D07R0104 228 +#define MAP_D07R0105 229 +#define MAP_D07R0106 230 +#define MAP_D07R0107 231 +#define MAP_D07R0108 232 +#define MAP_D07R0109 233 +#define MAP_D07R0110 234 +#define MAP_D07R0111 235 +#define MAP_D07R0112 236 +#define MAP_D07R0113 237 +#define MAP_D07R0114 238 +#define MAP_D07R0115 239 +#define MAP_D07R0116 240 +#define MAP_D07R0117 241 +#define MAP_D07R0118 242 +#define MAP_D09 243 +#define MAP_D09R0101 244 +#define MAP_D09R0102 245 +#define MAP_D09R0103 246 +#define MAP_D09R0104 247 +#define MAP_D09R0105 248 +#define MAP_D09R0106 249 +#define MAP_D10 250 +#define MAP_D10R0101 251 +#define MAP_D11 252 +#define MAP_D11R0101 253 +#define MAP_D12R0101 254 +#define MAP_D13 255 +#define MAP_D13R0101 256 +#define MAP_D13R0102 257 +#define MAP_D14R0101 258 +#define MAP_D14R0102 259 +#define MAP_D15 260 +#define MAP_D15R0101 261 +#define MAP_D16 262 +#define MAP_D16R0101 263 +#define MAP_D16R0102 264 +#define MAP_D16R0103 265 +#define MAP_D17 266 +#define MAP_D17R0101 267 +#define MAP_D17R0102 268 +#define MAP_D17R0103 269 +#define MAP_D17R0104 270 +#define MAP_D17R0105 271 +#define MAP_D17R0106 272 +#define MAP_D17R0107 273 +#define MAP_D18 274 +#define MAP_D18R0101 275 +#define MAP_D19A 276 +#define MAP_D19B 277 +#define MAP_D20R0101 278 +#define MAP_D20R0102 279 +#define MAP_D20R0103 280 +#define MAP_D20R0104 281 +#define MAP_D20R0105 282 +#define MAP_D20R0106 283 +#define MAP_D21R0101 284 +#define MAP_D21R0102 285 +#define MAP_D22R0101 286 +#define MAP_D23R0101 287 +#define MAP_D24 288 +#define MAP_D24R0101 289 +#define MAP_D24R0102 290 +#define MAP_D24R0103 291 +#define MAP_D24R0104 292 +#define MAP_D24R0105 293 +#define MAP_D24R0106 294 +#define MAP_D25R0101 295 +#define MAP_D25R0102 296 +#define MAP_D25R0103 297 +#define MAP_D25R0104 298 +#define MAP_D25R0105 299 +#define MAP_D25R0106 300 +#define MAP_D25R0107 301 +#define MAP_D25R0108 302 +#define MAP_D25R0109 303 +#define MAP_D25R1001 304 +#define MAP_D26R0101 305 +#define MAP_D26R0102 306 +#define MAP_D26R0103 307 +#define MAP_D26R0104 308 +#define MAP_D26R0105 309 +#define MAP_D26R0106 310 +#define MAP_D27R0101 311 +#define MAP_D27R0102 312 +#define MAP_D27R0103 313 +#define MAP_D28R0101 314 +#define MAP_D28R0102 315 +#define MAP_D28R0103 316 +#define MAP_D29R0101 317 +#define MAP_D29R0102 318 +#define MAP_D29R0103 319 +#define MAP_D30 320 +#define MAP_D30R0101 321 +#define MAP_D31 322 +#define MAP_D31R0101 323 +#define MAP_D31R0102 324 +#define MAP_D31R0103 325 +#define MAP_D31R0201 326 +#define MAP_D31R0202 327 +#define MAP_D31R0203 328 +#define MAP_D31R0204 329 +#define MAP_D31R0205 330 +#define MAP_D31R0206 331 +#define MAP_DIRECT2 332 +#define MAP_DIRECT4 333 +#define MAP_L01 334 +#define MAP_L01R0101 335 +#define MAP_L02 336 +#define MAP_L02R0101 337 +#define MAP_L02R0201 338 +#define MAP_L02R0301 339 +#define MAP_L03 340 +#define MAP_L04 341 +#define MAP_R201 342 +#define MAP_R202 343 +#define MAP_R203 344 +#define MAP_R204A 345 +#define MAP_R204B 346 +#define MAP_R205A 347 +#define MAP_R205AR0101 348 +#define MAP_R205B 349 +#define MAP_R206 350 +#define MAP_R206R0101 351 +#define MAP_R206R0201 352 +#define MAP_R207 353 +#define MAP_R208 354 +#define MAP_R208R0101 355 +#define MAP_R209 356 +#define MAP_R209R0101 357 +#define MAP_R209R0102 358 +#define MAP_R209R0103 359 +#define MAP_R209R0104 360 +#define MAP_R209R0105 361 +#define MAP_R210A 362 +#define MAP_R210B 363 +#define MAP_R210BR0101 364 +#define MAP_R211A 365 +#define MAP_R211B 366 +#define MAP_R212A 367 +#define MAP_R212AR0101 368 +#define MAP_R212AR0102 369 +#define MAP_R212AR0103 370 +#define MAP_R212B 371 +#define MAP_R212BR0101 372 +#define MAP_R213 373 +#define MAP_R213R0101 374 +#define MAP_R213R0201 375 +#define MAP_R213R0301 376 +#define MAP_R213R0401 377 +#define MAP_R213R0501 378 +#define MAP_R213R0601 379 +#define MAP_R214 380 +#define MAP_R214R0101 381 +#define MAP_R215 382 +#define MAP_R216 383 +#define MAP_R216R0101 384 +#define MAP_R217 385 +#define MAP_R217R0101 386 +#define MAP_R217R0201 387 +#define MAP_R218 388 +#define MAP_R218R0101 389 +#define MAP_R218R0201 390 +#define MAP_R219 391 +#define MAP_R221 392 +#define MAP_R221R0101 393 +#define MAP_R221R0201 394 +#define MAP_R222 395 +#define MAP_R222R0101 396 +#define MAP_R222R0201 397 +#define MAP_R222R0301 398 +#define MAP_R224 399 +#define MAP_R225 400 +#define MAP_R226A 401 +#define MAP_R226B 402 +#define MAP_R227 403 +#define MAP_R227A 404 +#define MAP_R227B 405 +#define MAP_R228 406 +#define MAP_R229 407 +#define MAP_R230 408 +#define MAP_R232 409 +#define MAP_RECORD 410 +#define MAP_T01 411 +#define MAP_T01R0101 412 +#define MAP_T01R0102 413 +#define MAP_T01R0201 414 +#define MAP_T01R0202 415 +#define MAP_T01R0301 416 +#define MAP_T01R0401 417 +#define MAP_T02 418 +#define MAP_T02FS0101 419 +#define MAP_T02PC0101 420 +#define MAP_T02PC0102 421 +#define MAP_T02R0101 422 +#define MAP_T02R0201 423 +#define MAP_T02R0202 424 +#define MAP_T02R0301 425 +#define MAP_T03 426 +#define MAP_T03FS0101 427 +#define MAP_T03PC0101 428 +#define MAP_T03PC0102 429 +#define MAP_T03R0101 430 +#define MAP_T03R0201 431 +#define MAP_T03R0301 432 +#define MAP_T04 433 +#define MAP_T04FS0101 434 +#define MAP_T04PC0101 435 +#define MAP_T04PC0102 436 +#define MAP_T04R0101 437 +#define MAP_T04R0201 438 +#define MAP_T04R0301 439 +#define MAP_T04R0401 440 +#define MAP_T04R0501 441 +#define MAP_T05 442 +#define MAP_T05PC0101 443 +#define MAP_T05PC0102 444 +#define MAP_T05R0101 445 +#define MAP_T05R0201 446 +#define MAP_T05R0301 447 +#define MAP_T05R0401 448 +#define MAP_T05R0501 449 +#define MAP_T06 450 +#define MAP_T06FS0101 451 +#define MAP_T06PC0101 452 +#define MAP_T06PC0102 453 +#define MAP_T06R0101 454 +#define MAP_T06R0201 455 +#define MAP_T06R0301 456 +#define MAP_T07 457 +#define MAP_T07FS0101 458 +#define MAP_T07PC0101 459 +#define MAP_T07PC0102 460 +#define MAP_T07R0101 461 +#define MAP_T07R0102 462 +#define MAP_T07R0103 463 +#define MAP_T07R0201 464 +#define MAP_T07R0301 465 +#define MAP_UNION 466 +#define MAP_W220 467 +#define MAP_W223 468 +#define MAP_W226 469 +#define MAP_W229 470 +#define MAP_W230 471 +#define MAP_W231 472 +#define MAP_W233 473 +#define MAP_C01PC0103 474 +#define MAP_C02PC0103 475 +#define MAP_C03PC0103 476 +#define MAP_C04PC0103 477 +#define MAP_C05PC0103 478 +#define MAP_C06PC0103 479 +#define MAP_C07PC0103 480 +#define MAP_C08PC0103 481 +#define MAP_C09PC0103 482 +#define MAP_C10PC0103 483 +#define MAP_C11PC0103 484 +#define MAP_T02PC0103 485 +#define MAP_T03PC0103 486 +#define MAP_T04PC0103 487 +#define MAP_T05PC0103 488 +#define MAP_T06PC0103 489 +#define MAP_T07PC0103 490 +#define MAP_C02R0601 491 +#define MAP_R210AR0101 492 +#define MAP_D31R0207 493 +#define MAP_D26R0107 494 +#define MAP_C10R0114 495 +#define MAP_C10R0115 496 +#define MAP_D26R0108 497 +#define MAP_R225R0101 498 +#define MAP_W226R0101 499 +#define MAP_R227R0101 500 +#define MAP_R228R0101 501 +#define MAP_R228R0201 502 +#define MAP_R228R0301 503 +#define MAP_D06R0201 504 +#define MAP_D06R0202 505 +#define MAP_D06R0203 506 +#define MAP_D06R0204 507 +#define MAP_D06R0205 508 +#define MAP_D06R0206 509 +#define MAP_D05R0116 510 +#define MAP_D05R0117 511 +#define MAP_D22R0102 512 +#define MAP_D22R0103 513 +#define MAP_D24R0201 514 +#define MAP_D07R0119 515 +#define MAP_C08R0802 516 +#define MAP_C01R0802 517 +#define MAP_D17R0108 518 +#define MAP_D17R0109 519 +#define MAP_D17R0110 520 +#define MAP_D17R0111 521 +#define MAP_D17R0112 522 +#define MAP_D17R0113 523 +#define MAP_D17R0114 524 +#define MAP_D17R0115 525 +#define MAP_D17R0116 526 +#define MAP_D17R0117 527 +#define MAP_D17R0118 528 +#define MAP_D17R0119 529 +#define MAP_D17R0120 530 +#define MAP_D17R0121 531 +#define MAP_D17R0122 532 +#define MAP_D17R0123 533 +#define MAP_D17R0124 534 +#define MAP_D17R0125 535 +#define MAP_D17R0126 536 +#define MAP_D17R0127 537 +#define MAP_D17R0128 538 +#define MAP_D17R0129 539 +#define MAP_D17R0130 540 +#define MAP_D17R0131 541 +#define MAP_D17R0132 542 +#define MAP_D17R0133 543 +#define MAP_D17R0134 544 +#define MAP_D17R0135 545 +#define MAP_D17R0136 546 +#define MAP_D17R0137 547 +#define MAP_D17R0138 548 +#define MAP_D17R0139 549 +#define MAP_D17R0140 550 +#define MAP_D17R0141 551 +#define MAP_D17R0142 552 +#define MAP_D17R0143 553 +#define MAP_D17R0144 554 +#define MAP_D17R0145 555 +#define MAP_D17R0146 556 +#define MAP_D17R0147 557 +#define MAP_C05R1103 558 -#endif //POKEDIAMOND_CONSTANTS_MAPS_H +#endif // POKEDIAMOND_CONSTANTS_MAPS_H diff --git a/include/constants/moves.h b/include/constants/moves.h index b25e5f916..85c8ffdef 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -1,106 +1,106 @@ #ifndef POKEDIAMOND_CONSTANTS_MOVES_H #define POKEDIAMOND_CONSTANTS_MOVES_H -#define MOVE_NONE 0 -#define MOVE_POUND 1 -#define MOVE_KARATE_CHOP 2 -#define MOVE_DOUBLE_SLAP 3 -#define MOVE_COMET_PUNCH 4 -#define MOVE_MEGA_PUNCH 5 -#define MOVE_PAY_DAY 6 -#define MOVE_FIRE_PUNCH 7 -#define MOVE_ICE_PUNCH 8 -#define MOVE_THUNDER_PUNCH 9 -#define MOVE_SCRATCH 10 -#define MOVE_VISE_GRIP 11 -#define MOVE_GUILLOTINE 12 -#define MOVE_RAZOR_WIND 13 -#define MOVE_SWORDS_DANCE 14 -#define MOVE_CUT 15 -#define MOVE_GUST 16 -#define MOVE_WING_ATTACK 17 -#define MOVE_WHIRLWIND 18 -#define MOVE_FLY 19 -#define MOVE_BIND 20 -#define MOVE_SLAM 21 -#define MOVE_VINE_WHIP 22 -#define MOVE_STOMP 23 -#define MOVE_DOUBLE_KICK 24 -#define MOVE_MEGA_KICK 25 -#define MOVE_JUMP_KICK 26 -#define MOVE_ROLLING_KICK 27 -#define MOVE_SAND_ATTACK 28 -#define MOVE_HEADBUTT 29 -#define MOVE_HORN_ATTACK 30 -#define MOVE_FURY_ATTACK 31 -#define MOVE_HORN_DRILL 32 -#define MOVE_TACKLE 33 -#define MOVE_BODY_SLAM 34 -#define MOVE_WRAP 35 -#define MOVE_TAKE_DOWN 36 -#define MOVE_THRASH 37 -#define MOVE_DOUBLE_EDGE 38 -#define MOVE_TAIL_WHIP 39 -#define MOVE_POISON_STING 40 -#define MOVE_TWINEEDLE 41 -#define MOVE_PIN_MISSILE 42 -#define MOVE_LEER 43 -#define MOVE_BITE 44 -#define MOVE_GROWL 45 -#define MOVE_ROAR 46 -#define MOVE_SING 47 -#define MOVE_SUPERSONIC 48 -#define MOVE_SONIC_BOOM 49 -#define MOVE_DISABLE 50 -#define MOVE_ACID 51 -#define MOVE_EMBER 52 -#define MOVE_FLAMETHROWER 53 -#define MOVE_MIST 54 -#define MOVE_WATER_GUN 55 -#define MOVE_HYDRO_PUMP 56 -#define MOVE_SURF 57 -#define MOVE_ICE_BEAM 58 -#define MOVE_BLIZZARD 59 -#define MOVE_PSYBEAM 60 -#define MOVE_BUBBLE_BEAM 61 -#define MOVE_AURORA_BEAM 62 -#define MOVE_HYPER_BEAM 63 -#define MOVE_PECK 64 -#define MOVE_DRILL_PECK 65 -#define MOVE_SUBMISSION 66 -#define MOVE_LOW_KICK 67 -#define MOVE_COUNTER 68 -#define MOVE_SEISMIC_TOSS 69 -#define MOVE_STRENGTH 70 -#define MOVE_ABSORB 71 -#define MOVE_MEGA_DRAIN 72 -#define MOVE_LEECH_SEED 73 -#define MOVE_GROWTH 74 -#define MOVE_RAZOR_LEAF 75 -#define MOVE_SOLAR_BEAM 76 -#define MOVE_POISON_POWDER 77 -#define MOVE_STUN_SPORE 78 -#define MOVE_SLEEP_POWDER 79 -#define MOVE_PETAL_DANCE 80 -#define MOVE_STRING_SHOT 81 -#define MOVE_DRAGON_RAGE 82 -#define MOVE_FIRE_SPIN 83 -#define MOVE_THUNDER_SHOCK 84 -#define MOVE_THUNDERBOLT 85 -#define MOVE_THUNDER_WAVE 86 -#define MOVE_THUNDER 87 -#define MOVE_ROCK_THROW 88 -#define MOVE_EARTHQUAKE 89 -#define MOVE_FISSURE 90 -#define MOVE_DIG 91 -#define MOVE_TOXIC 92 -#define MOVE_CONFUSION 93 -#define MOVE_PSYCHIC 94 -#define MOVE_HYPNOSIS 95 -#define MOVE_MEDITATE 96 -#define MOVE_AGILITY 97 -#define MOVE_QUICK_ATTACK 98 -#define MOVE_RAGE 99 +#define MOVE_NONE 0 +#define MOVE_POUND 1 +#define MOVE_KARATE_CHOP 2 +#define MOVE_DOUBLE_SLAP 3 +#define MOVE_COMET_PUNCH 4 +#define MOVE_MEGA_PUNCH 5 +#define MOVE_PAY_DAY 6 +#define MOVE_FIRE_PUNCH 7 +#define MOVE_ICE_PUNCH 8 +#define MOVE_THUNDER_PUNCH 9 +#define MOVE_SCRATCH 10 +#define MOVE_VISE_GRIP 11 +#define MOVE_GUILLOTINE 12 +#define MOVE_RAZOR_WIND 13 +#define MOVE_SWORDS_DANCE 14 +#define MOVE_CUT 15 +#define MOVE_GUST 16 +#define MOVE_WING_ATTACK 17 +#define MOVE_WHIRLWIND 18 +#define MOVE_FLY 19 +#define MOVE_BIND 20 +#define MOVE_SLAM 21 +#define MOVE_VINE_WHIP 22 +#define MOVE_STOMP 23 +#define MOVE_DOUBLE_KICK 24 +#define MOVE_MEGA_KICK 25 +#define MOVE_JUMP_KICK 26 +#define MOVE_ROLLING_KICK 27 +#define MOVE_SAND_ATTACK 28 +#define MOVE_HEADBUTT 29 +#define MOVE_HORN_ATTACK 30 +#define MOVE_FURY_ATTACK 31 +#define MOVE_HORN_DRILL 32 +#define MOVE_TACKLE 33 +#define MOVE_BODY_SLAM 34 +#define MOVE_WRAP 35 +#define MOVE_TAKE_DOWN 36 +#define MOVE_THRASH 37 +#define MOVE_DOUBLE_EDGE 38 +#define MOVE_TAIL_WHIP 39 +#define MOVE_POISON_STING 40 +#define MOVE_TWINEEDLE 41 +#define MOVE_PIN_MISSILE 42 +#define MOVE_LEER 43 +#define MOVE_BITE 44 +#define MOVE_GROWL 45 +#define MOVE_ROAR 46 +#define MOVE_SING 47 +#define MOVE_SUPERSONIC 48 +#define MOVE_SONIC_BOOM 49 +#define MOVE_DISABLE 50 +#define MOVE_ACID 51 +#define MOVE_EMBER 52 +#define MOVE_FLAMETHROWER 53 +#define MOVE_MIST 54 +#define MOVE_WATER_GUN 55 +#define MOVE_HYDRO_PUMP 56 +#define MOVE_SURF 57 +#define MOVE_ICE_BEAM 58 +#define MOVE_BLIZZARD 59 +#define MOVE_PSYBEAM 60 +#define MOVE_BUBBLE_BEAM 61 +#define MOVE_AURORA_BEAM 62 +#define MOVE_HYPER_BEAM 63 +#define MOVE_PECK 64 +#define MOVE_DRILL_PECK 65 +#define MOVE_SUBMISSION 66 +#define MOVE_LOW_KICK 67 +#define MOVE_COUNTER 68 +#define MOVE_SEISMIC_TOSS 69 +#define MOVE_STRENGTH 70 +#define MOVE_ABSORB 71 +#define MOVE_MEGA_DRAIN 72 +#define MOVE_LEECH_SEED 73 +#define MOVE_GROWTH 74 +#define MOVE_RAZOR_LEAF 75 +#define MOVE_SOLAR_BEAM 76 +#define MOVE_POISON_POWDER 77 +#define MOVE_STUN_SPORE 78 +#define MOVE_SLEEP_POWDER 79 +#define MOVE_PETAL_DANCE 80 +#define MOVE_STRING_SHOT 81 +#define MOVE_DRAGON_RAGE 82 +#define MOVE_FIRE_SPIN 83 +#define MOVE_THUNDER_SHOCK 84 +#define MOVE_THUNDERBOLT 85 +#define MOVE_THUNDER_WAVE 86 +#define MOVE_THUNDER 87 +#define MOVE_ROCK_THROW 88 +#define MOVE_EARTHQUAKE 89 +#define MOVE_FISSURE 90 +#define MOVE_DIG 91 +#define MOVE_TOXIC 92 +#define MOVE_CONFUSION 93 +#define MOVE_PSYCHIC 94 +#define MOVE_HYPNOSIS 95 +#define MOVE_MEDITATE 96 +#define MOVE_AGILITY 97 +#define MOVE_QUICK_ATTACK 98 +#define MOVE_RAGE 99 #define MOVE_TELEPORT 100 #define MOVE_NIGHT_SHADE 101 #define MOVE_MIMIC 102 @@ -474,6 +474,6 @@ #define CLASS_SPECIAL 1 #define CLASS_STATUS 2 -#define NUM_MOVES MOVE_SHADOW_FORCE +#define NUM_MOVES MOVE_SHADOW_FORCE -#endif //POKEDIAMOND_CONSTANTS_MOVES_H +#endif // POKEDIAMOND_CONSTANTS_MOVES_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index d94e793f0..b99dac91c 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -2,100 +2,100 @@ #define POKEDIAMOND_CONSTANTS_POKEMON_H // Value and data limits -#define MAX_LEVEL 100 -#define MAX_MON_MOVES 4 -#define MAX_EV 100 -#define MAX_EV_SUM 510 -#define MAX_LEARNED_MOVES 22 +#define MAX_LEVEL 100 +#define MAX_MON_MOVES 4 +#define MAX_EV 100 +#define MAX_EV_SUM 510 +#define MAX_LEARNED_MOVES 22 // Pokemon types -#define TYPE_NONE 255 -#define TYPE_NORMAL 0 -#define TYPE_FIGHTING 1 -#define TYPE_FLYING 2 -#define TYPE_POISON 3 -#define TYPE_GROUND 4 -#define TYPE_ROCK 5 -#define TYPE_BUG 6 -#define TYPE_GHOST 7 -#define TYPE_STEEL 8 -#define TYPE_MYSTERY 9 -#define TYPE_FIRE 10 -#define TYPE_WATER 11 -#define TYPE_GRASS 12 -#define TYPE_ELECTRIC 13 -#define TYPE_PSYCHIC 14 -#define TYPE_ICE 15 -#define TYPE_DRAGON 16 -#define TYPE_DARK 17 -#define NUMBER_OF_MON_TYPES 18 +#define TYPE_NONE 255 +#define TYPE_NORMAL 0 +#define TYPE_FIGHTING 1 +#define TYPE_FLYING 2 +#define TYPE_POISON 3 +#define TYPE_GROUND 4 +#define TYPE_ROCK 5 +#define TYPE_BUG 6 +#define TYPE_GHOST 7 +#define TYPE_STEEL 8 +#define TYPE_MYSTERY 9 +#define TYPE_FIRE 10 +#define TYPE_WATER 11 +#define TYPE_GRASS 12 +#define TYPE_ELECTRIC 13 +#define TYPE_PSYCHIC 14 +#define TYPE_ICE 15 +#define TYPE_DRAGON 16 +#define TYPE_DARK 17 +#define NUMBER_OF_MON_TYPES 18 // Contest types -#define COOL 0 -#define BEAUTY 1 -#define CUTE 2 -#define SMART 3 -#define TOUGH 4 +#define COOL 0 +#define BEAUTY 1 +#define CUTE 2 +#define SMART 3 +#define TOUGH 4 // Pokemon egg groups -#define EGG_GROUP_NONE 0 -#define EGG_GROUP_MONSTER 1 -#define EGG_GROUP_WATER_1 2 -#define EGG_GROUP_BUG 3 -#define EGG_GROUP_FLYING 4 -#define EGG_GROUP_FIELD 5 -#define EGG_GROUP_FAIRY 6 -#define EGG_GROUP_GRASS 7 -#define EGG_GROUP_HUMAN_LIKE 8 -#define EGG_GROUP_WATER_3 9 -#define EGG_GROUP_MINERAL 10 -#define EGG_GROUP_AMORPHOUS 11 -#define EGG_GROUP_WATER_2 12 -#define EGG_GROUP_DITTO 13 -#define EGG_GROUP_DRAGON 14 -#define EGG_GROUP_UNDISCOVERED 15 +#define EGG_GROUP_NONE 0 +#define EGG_GROUP_MONSTER 1 +#define EGG_GROUP_WATER_1 2 +#define EGG_GROUP_BUG 3 +#define EGG_GROUP_FLYING 4 +#define EGG_GROUP_FIELD 5 +#define EGG_GROUP_FAIRY 6 +#define EGG_GROUP_GRASS 7 +#define EGG_GROUP_HUMAN_LIKE 8 +#define EGG_GROUP_WATER_3 9 +#define EGG_GROUP_MINERAL 10 +#define EGG_GROUP_AMORPHOUS 11 +#define EGG_GROUP_WATER_2 12 +#define EGG_GROUP_DITTO 13 +#define EGG_GROUP_DRAGON 14 +#define EGG_GROUP_UNDISCOVERED 15 -#define EGG_GROUPS_PER_MON 2 +#define EGG_GROUPS_PER_MON 2 -#define MON_STATUS_SLP_MASK 0x7 -#define MON_STATUS_SLP_SHIFT 0 -#define MON_STATUS_PSN_MASK 0x8 -#define MON_STATUS_PSN_SHIFT 3 -#define MON_STATUS_TOX_MASK 0x80 -#define MON_STATUS_TOX_SHIFT 7 -#define MON_STATUS_BRN_MASK 0x10 -#define MON_STATUS_BRN_SHIFT 4 -#define MON_STATUS_FRZ_MASK 0x20 -#define MON_STATUS_FRZ_SHIFT 5 -#define MON_STATUS_PRZ_MASK 0x40 -#define MON_STATUS_PRZ_SHIFT 6 +#define MON_STATUS_SLP_MASK 0x7 +#define MON_STATUS_SLP_SHIFT 0 +#define MON_STATUS_PSN_MASK 0x8 +#define MON_STATUS_PSN_SHIFT 3 +#define MON_STATUS_TOX_MASK 0x80 +#define MON_STATUS_TOX_SHIFT 7 +#define MON_STATUS_BRN_MASK 0x10 +#define MON_STATUS_BRN_SHIFT 4 +#define MON_STATUS_FRZ_MASK 0x20 +#define MON_STATUS_FRZ_SHIFT 5 +#define MON_STATUS_PRZ_MASK 0x40 +#define MON_STATUS_PRZ_SHIFT 6 // Pokemon natures -#define NATURE_HARDY 0 -#define NATURE_LONELY 1 -#define NATURE_BRAVE 2 -#define NATURE_ADAMANT 3 -#define NATURE_NAUGHTY 4 -#define NATURE_BOLD 5 -#define NATURE_DOCILE 6 -#define NATURE_RELAXED 7 -#define NATURE_IMPISH 8 -#define NATURE_LAX 9 -#define NATURE_TIMID 10 -#define NATURE_HASTY 11 -#define NATURE_SERIOUS 12 -#define NATURE_JOLLY 13 -#define NATURE_NAIVE 14 -#define NATURE_MODEST 15 -#define NATURE_MILD 16 -#define NATURE_QUIET 17 -#define NATURE_BASHFUL 18 -#define NATURE_RASH 19 -#define NATURE_CALM 20 -#define NATURE_GENTLE 21 -#define NATURE_SASSY 22 -#define NATURE_CAREFUL 23 -#define NATURE_QUIRKY 24 +#define NATURE_HARDY 0 +#define NATURE_LONELY 1 +#define NATURE_BRAVE 2 +#define NATURE_ADAMANT 3 +#define NATURE_NAUGHTY 4 +#define NATURE_BOLD 5 +#define NATURE_DOCILE 6 +#define NATURE_RELAXED 7 +#define NATURE_IMPISH 8 +#define NATURE_LAX 9 +#define NATURE_TIMID 10 +#define NATURE_HASTY 11 +#define NATURE_SERIOUS 12 +#define NATURE_JOLLY 13 +#define NATURE_NAIVE 14 +#define NATURE_MODEST 15 +#define NATURE_MILD 16 +#define NATURE_QUIET 17 +#define NATURE_BASHFUL 18 +#define NATURE_RASH 19 +#define NATURE_CALM 20 +#define NATURE_GENTLE 21 +#define NATURE_SASSY 22 +#define NATURE_CAREFUL 23 +#define NATURE_QUIRKY 24 // Pokemon Stats #define STAT_HP 0 @@ -113,218 +113,216 @@ // Shiny odds #define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536 - -#define MON_DATA_PERSONALITY 0 -#define MON_DATA_PARTY_LOCK 1 -#define MON_DATA_BOX_LOCK 2 -#define MON_DATA_CHECKSUM_FAILED 3 -#define MON_DATA_CHECKSUM 4 -#define MON_DATA_SPECIES 5 -#define MON_DATA_HELD_ITEM 6 -#define MON_DATA_OTID 7 -#define MON_DATA_EXPERIENCE 8 -#define MON_DATA_FRIENDSHIP 9 -#define MON_DATA_ABILITY 10 -#define MON_DATA_MARKINGS 11 -#define MON_DATA_GAME_LANGUAGE 12 -#define MON_DATA_HP_EV 13 -#define MON_DATA_ATK_EV 14 -#define MON_DATA_DEF_EV 15 -#define MON_DATA_SPEED_EV 16 -#define MON_DATA_SPATK_EV 17 -#define MON_DATA_SPDEF_EV 18 -#define MON_DATA_COOL 19 -#define MON_DATA_BEAUTY 20 -#define MON_DATA_CUTE 21 -#define MON_DATA_SMART 22 -#define MON_DATA_TOUGH 23 -#define MON_DATA_SHEEN 24 -#define MON_DATA_SINNOH_CHAMP_RIBBON 25 -#define MON_DATA_ABILITY_RIBBON 26 -#define MON_DATA_GREAT_ABILITY_RIBBON 27 -#define MON_DATA_DOUBLE_ABILITY_RIBBON 28 -#define MON_DATA_MULTI_ABILITY_RIBBON 29 -#define MON_DATA_PAIR_ABILITY_RIBBON 30 -#define MON_DATA_WORLD_ABILITY_RIBBON 31 -#define MON_DATA_ALERT_RIBBON 32 -#define MON_DATA_SHOCK_RIBBON 33 -#define MON_DATA_DOWNCAST_RIBBON 34 -#define MON_DATA_CARELESS_RIBBON 35 -#define MON_DATA_RELAX_RIBBON 36 -#define MON_DATA_SNOOZE_RIBBON 37 -#define MON_DATA_SMILE_RIBBON 38 -#define MON_DATA_GORGEOUS_RIBBON 39 -#define MON_DATA_ROYAL_RIBBON 40 -#define MON_DATA_GORGEOUS_ROYAL_RIBBON 41 -#define MON_DATA_FOOTPRINT_RIBBON 42 -#define MON_DATA_RECORD_RIBBON 43 -#define MON_DATA_HISTORY_RIBBON 44 -#define MON_DATA_LEGEND_RIBBON 45 -#define MON_DATA_RED_RIBBON 46 -#define MON_DATA_GREEN_RIBBON 47 -#define MON_DATA_BLUE_RIBBON 48 -#define MON_DATA_FESTIVAL_RIBBON 49 -#define MON_DATA_CARNIVAL_RIBBON 50 -#define MON_DATA_CLASSIC_RIBBON 51 -#define MON_DATA_PREMIER_RIBBON 52 -#define MON_DATA_SINNOH_RIBBON_53 53 -#define MON_DATA_MOVE1 54 -#define MON_DATA_MOVE2 55 -#define MON_DATA_MOVE3 56 -#define MON_DATA_MOVE4 57 -#define MON_DATA_MOVE1PP 58 -#define MON_DATA_MOVE2PP 59 -#define MON_DATA_MOVE3PP 60 -#define MON_DATA_MOVE4PP 61 -#define MON_DATA_MOVE1PPUP 62 -#define MON_DATA_MOVE2PPUP 63 -#define MON_DATA_MOVE3PPUP 64 -#define MON_DATA_MOVE4PPUP 65 -#define MON_DATA_MOVE1MAXPP 66 -#define MON_DATA_MOVE2MAXPP 67 -#define MON_DATA_MOVE3MAXPP 68 -#define MON_DATA_MOVE4MAXPP 69 -#define MON_DATA_HP_IV 70 -#define MON_DATA_ATK_IV 71 -#define MON_DATA_DEF_IV 72 -#define MON_DATA_SPEED_IV 73 -#define MON_DATA_SPATK_IV 74 -#define MON_DATA_SPDEF_IV 75 -#define MON_DATA_IS_EGG 76 -#define MON_DATA_HAS_NICKNAME 77 -#define MON_DATA_HOENN_COOL_RIBBON 78 -#define MON_DATA_HOENN_COOL_RIBBON_SUPER 79 -#define MON_DATA_HOENN_COOL_RIBBON_HYPER 80 -#define MON_DATA_HOENN_COOL_RIBBON_MASTER 81 -#define MON_DATA_HOENN_BEAUTY_RIBBON 82 -#define MON_DATA_HOENN_BEAUTY_RIBBON_SUPER 83 -#define MON_DATA_HOENN_BEAUTY_RIBBON_HYPER 84 -#define MON_DATA_HOENN_BEAUTY_RIBBON_MASTER 85 -#define MON_DATA_HOENN_CUTE_RIBBON 86 -#define MON_DATA_HOENN_CUTE_RIBBON_SUPER 87 -#define MON_DATA_HOENN_CUTE_RIBBON_HYPER 88 -#define MON_DATA_HOENN_CUTE_RIBBON_MASTER 89 -#define MON_DATA_HOENN_SMART_RIBBON 90 -#define MON_DATA_HOENN_SMART_RIBBON_SUPER 91 -#define MON_DATA_HOENN_SMART_RIBBON_HYPER 92 -#define MON_DATA_HOENN_SMART_RIBBON_MASTER 93 -#define MON_DATA_HOENN_TOUGH_RIBBON 94 -#define MON_DATA_HOENN_TOUGH_RIBBON_SUPER 95 -#define MON_DATA_HOENN_TOUGH_RIBBON_HYPER 96 -#define MON_DATA_HOENN_TOUGH_RIBBON_MASTER 97 -#define MON_DATA_HOENN_CHAMPION_RIBBON 98 -#define MON_DATA_HOENN_WINNING_RIBBON 99 -#define MON_DATA_HOENN_VICTORY_RIBBON 100 -#define MON_DATA_HOENN_ARTIST_RIBBON 101 -#define MON_DATA_HOENN_EFFORT_RIBBON 102 -#define MON_DATA_HOENN_MARINE_RIBBON 103 -#define MON_DATA_HOENN_LAND_RIBBON 104 -#define MON_DATA_HOENN_SKY_RIBBON 105 -#define MON_DATA_HOENN_COUNTRY_RIBBON 106 -#define MON_DATA_HOENN_NATIONAL_RIBBON 107 -#define MON_DATA_HOENN_EARTH_RIBBON 108 -#define MON_DATA_HOENN_WORLD_RIBBON 109 -#define MON_DATA_FATEFUL_ENCOUNTER 110 -#define MON_DATA_GENDER 111 -#define MON_DATA_FORM 112 -#define MON_DATA_RESERVED_113 113 // HGSS -#define MON_DATA_RESERVED_114 114 // Plat -#define MON_DATA_UNUSED_115 115 -#define MON_DATA_NICKNAME 116 -#define MON_DATA_NICKNAME_2 117 -#define MON_DATA_NICKNAME_3 118 // ??? -#define MON_DATA_NICKNAME_4 119 // ??? -#define MON_DATA_UNK_120 120 -#define MON_DATA_GAME_VERSION 121 -#define MON_DATA_COOL_RIBBON 122 -#define MON_DATA_COOL_RIBBON_GREAT 123 -#define MON_DATA_COOL_RIBBON_ULTRA 124 -#define MON_DATA_COOL_RIBBON_MASTER 125 -#define MON_DATA_BEAUTY_RIBBON 126 -#define MON_DATA_BEAUTY_RIBBON_GREAT 127 -#define MON_DATA_BEAUTY_RIBBON_ULTRA 128 -#define MON_DATA_BEAUTY_RIBBON_MASTER 129 -#define MON_DATA_CUTE_RIBBON 130 -#define MON_DATA_CUTE_RIBBON_GREAT 131 -#define MON_DATA_CUTE_RIBBON_ULTRA 132 -#define MON_DATA_CUTE_RIBBON_MASTER 133 -#define MON_DATA_SMART_RIBBON 134 -#define MON_DATA_SMART_RIBBON_GREAT 135 -#define MON_DATA_SMART_RIBBON_ULTRA 136 -#define MON_DATA_SMART_RIBBON_MASTER 137 -#define MON_DATA_TOUGH_RIBBON 138 -#define MON_DATA_TOUGH_RIBBON_GREAT 139 -#define MON_DATA_TOUGH_RIBBON_ULTRA 140 -#define MON_DATA_TOUGH_RIBBON_MASTER 141 -#define MON_DATA_SINNOH_RIBBON_142 142 -#define MON_DATA_OT_NAME 143 -#define MON_DATA_OT_NAME_2 144 // ??? -#define MON_DATA_EGG_MET_YEAR 145 -#define MON_DATA_EGG_MET_MONTH 146 -#define MON_DATA_EGG_MET_DAY 147 -#define MON_DATA_MET_YEAR 148 -#define MON_DATA_MET_MONTH 149 -#define MON_DATA_MET_DAY 150 -#define MON_DATA_EGG_MET_LOCATION 151 -#define MON_DATA_MET_LOCATION 152 -#define MON_DATA_POKERUS 153 -#define MON_DATA_POKEBALL 154 -#define MON_DATA_MET_LEVEL 155 -#define MON_DATA_MET_GENDER 156 -#define MON_DATA_ENCOUNTER_TYPE 157 -#define MON_DATA_RESERVED_158 158 // HGSS -#define MON_DATA_STATUS 159 -#define MON_DATA_LEVEL 160 -#define MON_DATA_CAPSULE 161 -#define MON_DATA_HP 162 -#define MON_DATA_MAXHP 163 -#define MON_DATA_ATK 164 -#define MON_DATA_DEF 165 -#define MON_DATA_SPEED 166 -#define MON_DATA_SPATK 167 -#define MON_DATA_SPDEF 168 -#define MON_DATA_MAIL_STRUCT 169 -#define MON_DATA_SEAL_COORDS 170 -#define MON_DATA_SPECIES_EXISTS 171 -#define MON_DATA_SANITY_IS_EGG 172 -#define MON_DATA_SPECIES2 173 -#define MON_DATA_IVS_WORD 174 -#define MON_DATA_UNK_175 175 -#define MON_DATA_TYPE_1 176 -#define MON_DATA_TYPE_2 177 -#define MON_DATA_SPECIES_NAME 178 +#define MON_DATA_PERSONALITY 0 +#define MON_DATA_PARTY_LOCK 1 +#define MON_DATA_BOX_LOCK 2 +#define MON_DATA_CHECKSUM_FAILED 3 +#define MON_DATA_CHECKSUM 4 +#define MON_DATA_SPECIES 5 +#define MON_DATA_HELD_ITEM 6 +#define MON_DATA_OTID 7 +#define MON_DATA_EXPERIENCE 8 +#define MON_DATA_FRIENDSHIP 9 +#define MON_DATA_ABILITY 10 +#define MON_DATA_MARKINGS 11 +#define MON_DATA_GAME_LANGUAGE 12 +#define MON_DATA_HP_EV 13 +#define MON_DATA_ATK_EV 14 +#define MON_DATA_DEF_EV 15 +#define MON_DATA_SPEED_EV 16 +#define MON_DATA_SPATK_EV 17 +#define MON_DATA_SPDEF_EV 18 +#define MON_DATA_COOL 19 +#define MON_DATA_BEAUTY 20 +#define MON_DATA_CUTE 21 +#define MON_DATA_SMART 22 +#define MON_DATA_TOUGH 23 +#define MON_DATA_SHEEN 24 +#define MON_DATA_SINNOH_CHAMP_RIBBON 25 +#define MON_DATA_ABILITY_RIBBON 26 +#define MON_DATA_GREAT_ABILITY_RIBBON 27 +#define MON_DATA_DOUBLE_ABILITY_RIBBON 28 +#define MON_DATA_MULTI_ABILITY_RIBBON 29 +#define MON_DATA_PAIR_ABILITY_RIBBON 30 +#define MON_DATA_WORLD_ABILITY_RIBBON 31 +#define MON_DATA_ALERT_RIBBON 32 +#define MON_DATA_SHOCK_RIBBON 33 +#define MON_DATA_DOWNCAST_RIBBON 34 +#define MON_DATA_CARELESS_RIBBON 35 +#define MON_DATA_RELAX_RIBBON 36 +#define MON_DATA_SNOOZE_RIBBON 37 +#define MON_DATA_SMILE_RIBBON 38 +#define MON_DATA_GORGEOUS_RIBBON 39 +#define MON_DATA_ROYAL_RIBBON 40 +#define MON_DATA_GORGEOUS_ROYAL_RIBBON 41 +#define MON_DATA_FOOTPRINT_RIBBON 42 +#define MON_DATA_RECORD_RIBBON 43 +#define MON_DATA_HISTORY_RIBBON 44 +#define MON_DATA_LEGEND_RIBBON 45 +#define MON_DATA_RED_RIBBON 46 +#define MON_DATA_GREEN_RIBBON 47 +#define MON_DATA_BLUE_RIBBON 48 +#define MON_DATA_FESTIVAL_RIBBON 49 +#define MON_DATA_CARNIVAL_RIBBON 50 +#define MON_DATA_CLASSIC_RIBBON 51 +#define MON_DATA_PREMIER_RIBBON 52 +#define MON_DATA_SINNOH_RIBBON_53 53 +#define MON_DATA_MOVE1 54 +#define MON_DATA_MOVE2 55 +#define MON_DATA_MOVE3 56 +#define MON_DATA_MOVE4 57 +#define MON_DATA_MOVE1PP 58 +#define MON_DATA_MOVE2PP 59 +#define MON_DATA_MOVE3PP 60 +#define MON_DATA_MOVE4PP 61 +#define MON_DATA_MOVE1PPUP 62 +#define MON_DATA_MOVE2PPUP 63 +#define MON_DATA_MOVE3PPUP 64 +#define MON_DATA_MOVE4PPUP 65 +#define MON_DATA_MOVE1MAXPP 66 +#define MON_DATA_MOVE2MAXPP 67 +#define MON_DATA_MOVE3MAXPP 68 +#define MON_DATA_MOVE4MAXPP 69 +#define MON_DATA_HP_IV 70 +#define MON_DATA_ATK_IV 71 +#define MON_DATA_DEF_IV 72 +#define MON_DATA_SPEED_IV 73 +#define MON_DATA_SPATK_IV 74 +#define MON_DATA_SPDEF_IV 75 +#define MON_DATA_IS_EGG 76 +#define MON_DATA_HAS_NICKNAME 77 +#define MON_DATA_HOENN_COOL_RIBBON 78 +#define MON_DATA_HOENN_COOL_RIBBON_SUPER 79 +#define MON_DATA_HOENN_COOL_RIBBON_HYPER 80 +#define MON_DATA_HOENN_COOL_RIBBON_MASTER 81 +#define MON_DATA_HOENN_BEAUTY_RIBBON 82 +#define MON_DATA_HOENN_BEAUTY_RIBBON_SUPER 83 +#define MON_DATA_HOENN_BEAUTY_RIBBON_HYPER 84 +#define MON_DATA_HOENN_BEAUTY_RIBBON_MASTER 85 +#define MON_DATA_HOENN_CUTE_RIBBON 86 +#define MON_DATA_HOENN_CUTE_RIBBON_SUPER 87 +#define MON_DATA_HOENN_CUTE_RIBBON_HYPER 88 +#define MON_DATA_HOENN_CUTE_RIBBON_MASTER 89 +#define MON_DATA_HOENN_SMART_RIBBON 90 +#define MON_DATA_HOENN_SMART_RIBBON_SUPER 91 +#define MON_DATA_HOENN_SMART_RIBBON_HYPER 92 +#define MON_DATA_HOENN_SMART_RIBBON_MASTER 93 +#define MON_DATA_HOENN_TOUGH_RIBBON 94 +#define MON_DATA_HOENN_TOUGH_RIBBON_SUPER 95 +#define MON_DATA_HOENN_TOUGH_RIBBON_HYPER 96 +#define MON_DATA_HOENN_TOUGH_RIBBON_MASTER 97 +#define MON_DATA_HOENN_CHAMPION_RIBBON 98 +#define MON_DATA_HOENN_WINNING_RIBBON 99 +#define MON_DATA_HOENN_VICTORY_RIBBON 100 +#define MON_DATA_HOENN_ARTIST_RIBBON 101 +#define MON_DATA_HOENN_EFFORT_RIBBON 102 +#define MON_DATA_HOENN_MARINE_RIBBON 103 +#define MON_DATA_HOENN_LAND_RIBBON 104 +#define MON_DATA_HOENN_SKY_RIBBON 105 +#define MON_DATA_HOENN_COUNTRY_RIBBON 106 +#define MON_DATA_HOENN_NATIONAL_RIBBON 107 +#define MON_DATA_HOENN_EARTH_RIBBON 108 +#define MON_DATA_HOENN_WORLD_RIBBON 109 +#define MON_DATA_FATEFUL_ENCOUNTER 110 +#define MON_DATA_GENDER 111 +#define MON_DATA_FORM 112 +#define MON_DATA_RESERVED_113 113 // HGSS +#define MON_DATA_RESERVED_114 114 // Plat +#define MON_DATA_UNUSED_115 115 +#define MON_DATA_NICKNAME 116 +#define MON_DATA_NICKNAME_2 117 +#define MON_DATA_NICKNAME_3 118 // ??? +#define MON_DATA_NICKNAME_4 119 // ??? +#define MON_DATA_UNK_120 120 +#define MON_DATA_GAME_VERSION 121 +#define MON_DATA_COOL_RIBBON 122 +#define MON_DATA_COOL_RIBBON_GREAT 123 +#define MON_DATA_COOL_RIBBON_ULTRA 124 +#define MON_DATA_COOL_RIBBON_MASTER 125 +#define MON_DATA_BEAUTY_RIBBON 126 +#define MON_DATA_BEAUTY_RIBBON_GREAT 127 +#define MON_DATA_BEAUTY_RIBBON_ULTRA 128 +#define MON_DATA_BEAUTY_RIBBON_MASTER 129 +#define MON_DATA_CUTE_RIBBON 130 +#define MON_DATA_CUTE_RIBBON_GREAT 131 +#define MON_DATA_CUTE_RIBBON_ULTRA 132 +#define MON_DATA_CUTE_RIBBON_MASTER 133 +#define MON_DATA_SMART_RIBBON 134 +#define MON_DATA_SMART_RIBBON_GREAT 135 +#define MON_DATA_SMART_RIBBON_ULTRA 136 +#define MON_DATA_SMART_RIBBON_MASTER 137 +#define MON_DATA_TOUGH_RIBBON 138 +#define MON_DATA_TOUGH_RIBBON_GREAT 139 +#define MON_DATA_TOUGH_RIBBON_ULTRA 140 +#define MON_DATA_TOUGH_RIBBON_MASTER 141 +#define MON_DATA_SINNOH_RIBBON_142 142 +#define MON_DATA_OT_NAME 143 +#define MON_DATA_OT_NAME_2 144 // ??? +#define MON_DATA_EGG_MET_YEAR 145 +#define MON_DATA_EGG_MET_MONTH 146 +#define MON_DATA_EGG_MET_DAY 147 +#define MON_DATA_MET_YEAR 148 +#define MON_DATA_MET_MONTH 149 +#define MON_DATA_MET_DAY 150 +#define MON_DATA_EGG_MET_LOCATION 151 +#define MON_DATA_MET_LOCATION 152 +#define MON_DATA_POKERUS 153 +#define MON_DATA_POKEBALL 154 +#define MON_DATA_MET_LEVEL 155 +#define MON_DATA_MET_GENDER 156 +#define MON_DATA_ENCOUNTER_TYPE 157 +#define MON_DATA_RESERVED_158 158 // HGSS +#define MON_DATA_STATUS 159 +#define MON_DATA_LEVEL 160 +#define MON_DATA_CAPSULE 161 +#define MON_DATA_HP 162 +#define MON_DATA_MAXHP 163 +#define MON_DATA_ATK 164 +#define MON_DATA_DEF 165 +#define MON_DATA_SPEED 166 +#define MON_DATA_SPATK 167 +#define MON_DATA_SPDEF 168 +#define MON_DATA_MAIL_STRUCT 169 +#define MON_DATA_SEAL_COORDS 170 +#define MON_DATA_SPECIES_EXISTS 171 +#define MON_DATA_SANITY_IS_EGG 172 +#define MON_DATA_SPECIES2 173 +#define MON_DATA_IVS_WORD 174 +#define MON_DATA_UNK_175 175 +#define MON_DATA_TYPE_1 176 +#define MON_DATA_TYPE_2 177 +#define MON_DATA_SPECIES_NAME 178 #define OT_ID_PLAYER_ID 0 #define OT_ID_PRESET 1 #define OT_ID_RANDOM_NO_SHINY 2 -#define MON_RATIO_MALE 0 -#define MON_RATIO_EIGHTH 31 -#define MON_RATIO_QUARTER 63 +#define MON_RATIO_MALE 0 +#define MON_RATIO_EIGHTH 31 +#define MON_RATIO_QUARTER 63 #define MON_RATIO_HALF 127 #define MON_RATIO_THREEQUARTER 191 #define MON_RATIO_FEMALE 254 #define MON_RATIO_UNKNOWN 255 -#define GENDER_RATIO(frac) ( (frac) <= 1 ? (u8)((frac) * 254.75) : 255 ) +#define GENDER_RATIO(frac) ((frac) <= 1 ? (u8)((frac) * 254.75) : 255) -enum MonGender -{ - MON_MALE = 0, - MON_FEMALE = 1, +enum MonGender { + MON_MALE = 0, + MON_FEMALE = 1, MON_GENDERLESS = 2 }; // Constants for AdjustFriendship -#define FRIENDSHIP_EVENT_GROW_LEVEL 0 -#define FRIENDSHIP_EVENT_VITAMIN 1 // unused, handled by PokemonUseItemEffects -#define FRIENDSHIP_EVENT_BATTLE_ITEM 2 // unused, handled by PokemonUseItemEffects -#define FRIENDSHIP_EVENT_LEAGUE_BATTLE 3 -#define FRIENDSHIP_EVENT_LEARN_TMHM 4 -#define FRIENDSHIP_EVENT_WALKING 5 -#define FRIENDSHIP_EVENT_FAINT_SMALL 6 -#define FRIENDSHIP_EVENT_HEAL_FIELD_PSN 7 -#define FRIENDSHIP_EVENT_FAINT_LARGE 8 // If opponent was >= 30 levels higher. See AdjustFriendshipOnBattleFaint +#define FRIENDSHIP_EVENT_GROW_LEVEL 0 +#define FRIENDSHIP_EVENT_VITAMIN 1 // unused, handled by PokemonUseItemEffects +#define FRIENDSHIP_EVENT_BATTLE_ITEM 2 // unused, handled by PokemonUseItemEffects +#define FRIENDSHIP_EVENT_LEAGUE_BATTLE 3 +#define FRIENDSHIP_EVENT_LEARN_TMHM 4 +#define FRIENDSHIP_EVENT_WALKING 5 +#define FRIENDSHIP_EVENT_FAINT_SMALL 6 +#define FRIENDSHIP_EVENT_HEAL_FIELD_PSN 7 +#define FRIENDSHIP_EVENT_FAINT_LARGE 8 // If opponent was >= 30 levels higher. See AdjustFriendshipOnBattleFaint // TODO: Identify the rest of these enum BaseStat { @@ -364,95 +362,94 @@ enum BaseStat { }; typedef enum { - EGG = 0, - EVENT = 0, - HATCHED = 0, - PAL_PARK = 0, - TALL_GRASS = 2, + EGG = 0, + EVENT = 0, + HATCHED = 0, + PAL_PARK = 0, + TALL_GRASS = 2, DIALGA_GAME_EVENT = 4, PALKIA_GAME_EVENT = 4, - CAVE = 5, - HALL_OF_ORIGIN = 5, - SURFING = 7, - FISHING = 7, - BUILDING = 9, - SAFARI_ZONE = 10, - STARTER = 12, - FOSSIL = 12, - GIFT_EEVEE = 12 + CAVE = 5, + HALL_OF_ORIGIN = 5, + SURFING = 7, + FISHING = 7, + BUILDING = 9, + SAFARI_ZONE = 10, + STARTER = 12, + FOSSIL = 12, + GIFT_EEVEE = 12 } EncounterType; typedef int OriginLanguage; typedef enum { - ARCEUS_NORMAL = 0, - ARCEUS_FIST = 1, - ARCEUS_SKY = 2, - ARCEUS_TOXIC = 3, - ARCEUS_EARTH = 4, - ARCEUS_STONE = 5, - ARCEUS_INSECT = 6, - ARCEUS_SPOOKY = 7, - ARCEUS_IRON = 8, - ARCEUS_FLAME = 9, - ARCEUS_SPLASH = 10, - ARCEUS_MEADOW = 11, - ARCEUS_ZAP = 12, - ARCEUS_MIND = 13, - ARCEUS_ICICLE = 14, - ARCEUS_DRACO = 15, - ARCEUS_DREAD = 16, - BURMY_PLANT = 0, - BURMY_SANDY = 1, - BURMY_TRASH = 2, - DEOXYS_NORMAL = 0, - DEOXYS_ATTACK = 1, - DEOXYS_DEFENSE = 2, - DEOXYS_SPEED = 3, - GIRATINA_ALTERED = 0, - GIRATINA_ORIGIN = 1, - ROTOM_NORMAL = 0, - ROTOM_HEAT = 1, - ROTOM_WASH = 2, - ROTOM_FROST = 3, - ROTOM_FAN = 4, - ROTOM_MOW = 5, - SHAYMIN_LAND = 0, - SHAYMIN_SKY = 1, - SHELLOS_WEST = 0, - SHELLOS_EAST = 1, - UNOWN_A = 0, - UNOWN_B = 1, - UNOWN_C = 2, - UNOWN_D = 3, - UNOWN_E = 4, - UNOWN_F = 5, - UNOWN_G = 6, - UNOWN_H = 7, - UNOWN_I = 8, - UNOWN_J = 9, - UNOWN_K = 10, - UNOWN_L = 11, - UNOWN_M = 12, - UNOWN_N = 13, - UNOWN_O = 14, - UNOWN_P = 15, - UNOWN_Q = 16, - UNOWN_R = 17, - UNOWN_S = 18, - UNOWN_T = 19, - UNOWN_U = 20, - UNOWN_V = 21, - UNOWN_W = 22, - UNOWN_X = 23, - UNOWN_Y = 24, - UNOWN_Z = 25, + ARCEUS_NORMAL = 0, + ARCEUS_FIST = 1, + ARCEUS_SKY = 2, + ARCEUS_TOXIC = 3, + ARCEUS_EARTH = 4, + ARCEUS_STONE = 5, + ARCEUS_INSECT = 6, + ARCEUS_SPOOKY = 7, + ARCEUS_IRON = 8, + ARCEUS_FLAME = 9, + ARCEUS_SPLASH = 10, + ARCEUS_MEADOW = 11, + ARCEUS_ZAP = 12, + ARCEUS_MIND = 13, + ARCEUS_ICICLE = 14, + ARCEUS_DRACO = 15, + ARCEUS_DREAD = 16, + BURMY_PLANT = 0, + BURMY_SANDY = 1, + BURMY_TRASH = 2, + DEOXYS_NORMAL = 0, + DEOXYS_ATTACK = 1, + DEOXYS_DEFENSE = 2, + DEOXYS_SPEED = 3, + GIRATINA_ALTERED = 0, + GIRATINA_ORIGIN = 1, + ROTOM_NORMAL = 0, + ROTOM_HEAT = 1, + ROTOM_WASH = 2, + ROTOM_FROST = 3, + ROTOM_FAN = 4, + ROTOM_MOW = 5, + SHAYMIN_LAND = 0, + SHAYMIN_SKY = 1, + SHELLOS_WEST = 0, + SHELLOS_EAST = 1, + UNOWN_A = 0, + UNOWN_B = 1, + UNOWN_C = 2, + UNOWN_D = 3, + UNOWN_E = 4, + UNOWN_F = 5, + UNOWN_G = 6, + UNOWN_H = 7, + UNOWN_I = 8, + UNOWN_J = 9, + UNOWN_K = 10, + UNOWN_L = 11, + UNOWN_M = 12, + UNOWN_N = 13, + UNOWN_O = 14, + UNOWN_P = 15, + UNOWN_Q = 16, + UNOWN_R = 17, + UNOWN_S = 18, + UNOWN_T = 19, + UNOWN_U = 20, + UNOWN_V = 21, + UNOWN_W = 22, + UNOWN_X = 23, + UNOWN_Y = 24, + UNOWN_Z = 25, UNOWN_EXCLAMATION_MARK = 26, - UNOWN_QUESTION_MARK = 27 + UNOWN_QUESTION_MARK = 27 } AlternateForms; -typedef enum EvoMethod -{ +typedef enum EvoMethod { EVO_NONE = 0, EVO_FRIENDSHIP, EVO_FRIENDSHIP_DAY, @@ -482,8 +479,7 @@ typedef enum EvoMethod EVO_ROUTE217, } EvoMethod; -enum GrowthRate -{ +enum GrowthRate { GROWTH_MEDIUM_FAST = 0, GROWTH_ERRATIC, GROWTH_FLUCTUATING, @@ -492,4 +488,4 @@ enum GrowthRate GROWTH_SLOW, }; -#endif //POKEDIAMOND_CONSTANTS_POKEMON_H +#endif // POKEDIAMOND_CONSTANTS_POKEMON_H diff --git a/include/constants/rgb.h b/include/constants/rgb.h index 6095fe0f1..b30a16c94 100644 --- a/include/constants/rgb.h +++ b/include/constants/rgb.h @@ -8,4 +8,4 @@ #define RGB_BLACK (RGB(0, 0, 0)) #define RGB_WHITE (RGB(31, 31, 31)) -#endif //POKEDIAMOND_CONSTANTS_RGB_H +#endif // POKEDIAMOND_CONSTANTS_RGB_H diff --git a/include/constants/ribbons.h b/include/constants/ribbons.h new file mode 100644 index 000000000..e45215de1 --- /dev/null +++ b/include/constants/ribbons.h @@ -0,0 +1,85 @@ +#ifndef POKEDIAMOND_CONSTANTS_RIBBONS_H +#define POKEDIAMOND_CONSTANTS_RIBBONS_H + +#define RIBBON_HOENN_CHAMPION 0 +#define RIBBON_HOENN_COOL 1 +#define RIBBON_HOENN_COOL_SUPER 2 +#define RIBBON_HOENN_COOL_HYPER 3 +#define RIBBON_HOENN_COOL_MASTER 4 +#define RIBBON_HOENN_BEAUTY 5 +#define RIBBON_HOENN_BEAUTY_SUPER 6 +#define RIBBON_HOENN_BEAUTY_HYPER 7 +#define RIBBON_HOENN_BEAUTY_MASTER 8 +#define RIBBON_HOENN_CUTE 9 +#define RIBBON_HOENN_CUTE_SUPER 10 +#define RIBBON_HOENN_CUTE_HYPER 11 +#define RIBBON_HOENN_CUTE_MASTER 12 +#define RIBBON_HOENN_SMART 13 +#define RIBBON_HOENN_SMART_SUPER 14 +#define RIBBON_HOENN_SMART_HYPER 15 +#define RIBBON_HOENN_SMART_MASTER 16 +#define RIBBON_HOENN_TOUGH 17 +#define RIBBON_HOENN_TOUGH_SUPER 18 +#define RIBBON_HOENN_TOUGH_HYPER 19 +#define RIBBON_HOENN_TOUGH_MASTER 20 +#define RIBBON_HOENN_WINNING 21 +#define RIBBON_HOENN_VICTORY 22 +#define RIBBON_HOENN_ARTIST 23 +#define RIBBON_HOENN_EFFORT 24 +#define RIBBON_HOENN_MARINE 25 +#define RIBBON_HOENN_LAND 26 +#define RIBBON_HOENN_SKY 27 +#define RIBBON_HOENN_COUNTRY 28 +#define RIBBON_HOENN_NATIONAL 29 +#define RIBBON_HOENN_EARTH 30 +#define RIBBON_HOENN_WORLD 31 +#define RIBBON_SINNOH_CHAMP 32 +#define RIBBON_COOL 33 +#define RIBBON_COOL_GREAT 34 +#define RIBBON_COOL_ULTRA 35 +#define RIBBON_COOL_MASTER 36 +#define RIBBON_BEAUTY 37 +#define RIBBON_BEAUTY_GREAT 38 +#define RIBBON_BEAUTY_ULTRA 39 +#define RIBBON_BEAUTY_MASTER 40 +#define RIBBON_CUTE 41 +#define RIBBON_CUTE_GREAT 42 +#define RIBBON_CUTE_ULTRA 43 +#define RIBBON_CUTE_MASTER 44 +#define RIBBON_SMART 45 +#define RIBBON_SMART_GREAT 46 +#define RIBBON_SMART_ULTRA 47 +#define RIBBON_SMART_MASTER 48 +#define RIBBON_TOUGH 49 +#define RIBBON_TOUGH_GREAT 50 +#define RIBBON_TOUGH_ULTRA 51 +#define RIBBON_TOUGH_MASTER 52 +#define RIBBON_ABILITY 53 +#define RIBBON_GREAT_ABILITY 54 +#define RIBBON_DOUBLE_ABILITY 55 +#define RIBBON_MULTI_ABILITY 56 +#define RIBBON_PAIR_ABILITY 57 +#define RIBBON_WORLD_ABILITY 58 +#define RIBBON_ALERT 59 +#define RIBBON_SHOCK 60 +#define RIBBON_DOWNCAST 61 +#define RIBBON_CARELESS 62 +#define RIBBON_RELAX 63 +#define RIBBON_SNOOZE 64 +#define RIBBON_SMILE 65 +#define RIBBON_GORGEOUS 66 +#define RIBBON_ROYAL 67 +#define RIBBON_GORGEOUS_ROYAL 68 +#define RIBBON_FOOTPRINT 69 +#define RIBBON_RECORD 70 +#define RIBBON_HISTORY 71 +#define RIBBON_LEGEND 72 +#define RIBBON_RED 73 +#define RIBBON_GREEN 74 +#define RIBBON_BLUE 75 +#define RIBBON_FESTIVAL 76 +#define RIBBON_CARNIVAL 77 +#define RIBBON_CLASSIC 78 +#define RIBBON_PREMIER 79 + +#endif // POKEDIAMOND_CONSTATNS_RIBBONS_H diff --git a/include/constants/roamer.h b/include/constants/roamer.h index 3a73aa3e6..5f8685b91 100644 --- a/include/constants/roamer.h +++ b/include/constants/roamer.h @@ -1,34 +1,34 @@ #ifndef POKEDIAMOND_CONSTANTS_ROAMER_H #define POKEDIAMOND_CONSTANTS_ROAMER_H -#define ROAMER_LOC_R201 0 -#define ROAMER_LOC_R202 1 -#define ROAMER_LOC_R203 2 -#define ROAMER_LOC_R204A 3 -#define ROAMER_LOC_R204B 4 -#define ROAMER_LOC_R205A 5 -#define ROAMER_LOC_R205B 6 -#define ROAMER_LOC_R206 7 -#define ROAMER_LOC_R207 8 -#define ROAMER_LOC_R208 9 -#define ROAMER_LOC_R209 10 -#define ROAMER_LOC_R210A 11 -#define ROAMER_LOC_R210B 12 -#define ROAMER_LOC_R211A 13 -#define ROAMER_LOC_R211B 14 -#define ROAMER_LOC_R212A 15 -#define ROAMER_LOC_R212B 16 -#define ROAMER_LOC_R213 17 -#define ROAMER_LOC_R214 18 -#define ROAMER_LOC_R215 19 -#define ROAMER_LOC_R216 20 -#define ROAMER_LOC_R217 21 -#define ROAMER_LOC_R218 22 -#define ROAMER_LOC_R219 23 -#define ROAMER_LOC_W220 24 -#define ROAMER_LOC_R221 25 -#define ROAMER_LOC_R222 26 -#define ROAMER_LOC_D02 27 -#define ROAMER_LOC_D04 28 +#define ROAMER_LOC_R201 0 +#define ROAMER_LOC_R202 1 +#define ROAMER_LOC_R203 2 +#define ROAMER_LOC_R204A 3 +#define ROAMER_LOC_R204B 4 +#define ROAMER_LOC_R205A 5 +#define ROAMER_LOC_R205B 6 +#define ROAMER_LOC_R206 7 +#define ROAMER_LOC_R207 8 +#define ROAMER_LOC_R208 9 +#define ROAMER_LOC_R209 10 +#define ROAMER_LOC_R210A 11 +#define ROAMER_LOC_R210B 12 +#define ROAMER_LOC_R211A 13 +#define ROAMER_LOC_R211B 14 +#define ROAMER_LOC_R212A 15 +#define ROAMER_LOC_R212B 16 +#define ROAMER_LOC_R213 17 +#define ROAMER_LOC_R214 18 +#define ROAMER_LOC_R215 19 +#define ROAMER_LOC_R216 20 +#define ROAMER_LOC_R217 21 +#define ROAMER_LOC_R218 22 +#define ROAMER_LOC_R219 23 +#define ROAMER_LOC_W220 24 +#define ROAMER_LOC_R221 25 +#define ROAMER_LOC_R222 26 +#define ROAMER_LOC_D02 27 +#define ROAMER_LOC_D04 28 #endif // POKEDIAMOND_CONSTANTS_ROAMER_H diff --git a/include/constants/save_arrays.h b/include/constants/save_arrays.h index a16bba863..78ca13c80 100644 --- a/include/constants/save_arrays.h +++ b/include/constants/save_arrays.h @@ -1,14 +1,14 @@ #ifndef POKEDIAMOND_CONSTANTS_SAVE_ARRAYS_H #define POKEDIAMOND_CONSTANTS_SAVE_ARRAYS_H -#define SAVE_BAG 3 -#define SAVE_FLAGS 4 -#define SAVE_DAYCARE 8 -#define SAVE_SAFARI_ZONE 27 -#define SAVE_EASY_CHAT 34 -#define SAVE_BLOCK_NUM 36 +#define SAVE_BAG 3 +#define SAVE_FLAGS 4 +#define SAVE_DAYCARE 8 +#define SAVE_SAFARI_ZONE 27 +#define SAVE_EASY_CHAT 34 +#define SAVE_BLOCK_NUM 36 -#define SAVE_PAGE_MAX 32 -#define SAVE_SECTOR_SIZE 0x1000 +#define SAVE_PAGE_MAX 32 +#define SAVE_SECTOR_SIZE 0x1000 -#endif //POKEDIAMOND_CONSTANTS_SAVE_ARRAYS_H +#endif // POKEDIAMOND_CONSTANTS_SAVE_ARRAYS_H diff --git a/include/constants/script_pokemon_util.h b/include/constants/script_pokemon_util.h index bd2225f20..cb013d07f 100644 --- a/include/constants/script_pokemon_util.h +++ b/include/constants/script_pokemon_util.h @@ -1,8 +1,8 @@ #ifndef POKEDIAMOND_CONSTANTS_SCRIPT_POKEMON_UTIL_H #define POKEDIAMOND_CONSTANTS_SCRIPT_POKEMON_UTIL_H -#define FLDPSN_NONE 0 -#define FLDPSN_PSN 1 -#define FLDPSN_HEAL 2 +#define FLDPSN_NONE 0 +#define FLDPSN_PSN 1 +#define FLDPSN_HEAL 2 -#endif //POKEDIAMOND_CONSTANTS_SCRIPT_POKEMON_UTIL_H +#endif // POKEDIAMOND_CONSTANTS_SCRIPT_POKEMON_UTIL_H diff --git a/include/constants/seal_constants.h b/include/constants/seal_constants.h index 09c63c022..e4926c89e 100644 --- a/include/constants/seal_constants.h +++ b/include/constants/seal_constants.h @@ -2,89 +2,89 @@ #define POKEDIAMOND_CONSTANTS_SEAL_CONSTANTS_H // The different kinds of seals you can have -#define SEAL_NONE 0 -#define SEAL_HEART_A 1 -#define SEAL_HEART_B 2 -#define SEAL_HEART_C 3 -#define SEAL_HEART_D 4 -#define SEAL_HEART_E 5 -#define SEAL_HEART_F 6 -#define SEAL_STAR_A 7 -#define SEAL_STAR_B 8 -#define SEAL_STAR_C 9 -#define SEAL_STAR_D 10 -#define SEAL_STAR_E 11 -#define SEAL_STAR_F 12 -#define SEAL_LINE_A 13 -#define SEAL_LINE_B 14 -#define SEAL_LINE_C 15 -#define SEAL_SMOKE_A 16 -#define SEAL_SMOKE_B 17 -#define SEAL_SMOKE_C 18 -#define SEAL_SMOKE_D 19 -#define SEAL_ELE_A 20 -#define SEAL_ELE_B 21 -#define SEAL_ELE_C 22 -#define SEAL_ELE_D 23 -#define SEAL_FOAMY_A 24 -#define SEAL_FOAMY_B 25 -#define SEAL_FOAMY_C 26 -#define SEAL_FOAMY_D 27 -#define SEAL_FIRE_A 28 -#define SEAL_FIRE_B 29 -#define SEAL_FIRE_C 30 -#define SEAL_FIRE_D 31 -#define SEAL_PARTY_A 32 -#define SEAL_PARTY_B 33 -#define SEAL_PARTY_C 34 -#define SEAL_PARTY_D 35 -#define SEAL_FLORA_A 36 -#define SEAL_FLORA_B 37 -#define SEAL_FLORA_C 38 -#define SEAL_FLORA_D 39 -#define SEAL_FLORA_E 40 -#define SEAL_FLORA_F 41 -#define SEAL_SONG_A 42 -#define SEAL_SONG_B 43 -#define SEAL_SONG_C 44 -#define SEAL_SONG_D 45 -#define SEAL_SONG_E 46 -#define SEAL_SONG_F 47 -#define SEAL_SONG_G 48 -#define SEAL_A 49 -#define SEAL_B 50 -#define SEAL_C 51 -#define SEAL_D 52 -#define SEAL_E 53 -#define SEAL_F 54 -#define SEAL_G 55 -#define SEAL_H 56 -#define SEAL_I 57 -#define SEAL_J 58 -#define SEAL_K 59 -#define SEAL_L 60 -#define SEAL_M 61 -#define SEAL_N 62 -#define SEAL_O 63 -#define SEAL_P 64 -#define SEAL_Q 65 -#define SEAL_R 66 -#define SEAL_S 67 -#define SEAL_T 68 -#define SEAL_U 69 -#define SEAL_V 70 -#define SEAL_W 71 -#define SEAL_X 72 -#define SEAL_Y 73 -#define SEAL_Z 74 -#define SEAL_SHOCK 75 -#define SEAL_MYSTERY 76 -#define SEAL_LINE_D 77 -#define SEAL_LIQUID 78 -#define SEAL_BURST 79 -#define SEAL_TWINKLE 80 +#define SEAL_NONE 0 +#define SEAL_HEART_A 1 +#define SEAL_HEART_B 2 +#define SEAL_HEART_C 3 +#define SEAL_HEART_D 4 +#define SEAL_HEART_E 5 +#define SEAL_HEART_F 6 +#define SEAL_STAR_A 7 +#define SEAL_STAR_B 8 +#define SEAL_STAR_C 9 +#define SEAL_STAR_D 10 +#define SEAL_STAR_E 11 +#define SEAL_STAR_F 12 +#define SEAL_LINE_A 13 +#define SEAL_LINE_B 14 +#define SEAL_LINE_C 15 +#define SEAL_SMOKE_A 16 +#define SEAL_SMOKE_B 17 +#define SEAL_SMOKE_C 18 +#define SEAL_SMOKE_D 19 +#define SEAL_ELE_A 20 +#define SEAL_ELE_B 21 +#define SEAL_ELE_C 22 +#define SEAL_ELE_D 23 +#define SEAL_FOAMY_A 24 +#define SEAL_FOAMY_B 25 +#define SEAL_FOAMY_C 26 +#define SEAL_FOAMY_D 27 +#define SEAL_FIRE_A 28 +#define SEAL_FIRE_B 29 +#define SEAL_FIRE_C 30 +#define SEAL_FIRE_D 31 +#define SEAL_PARTY_A 32 +#define SEAL_PARTY_B 33 +#define SEAL_PARTY_C 34 +#define SEAL_PARTY_D 35 +#define SEAL_FLORA_A 36 +#define SEAL_FLORA_B 37 +#define SEAL_FLORA_C 38 +#define SEAL_FLORA_D 39 +#define SEAL_FLORA_E 40 +#define SEAL_FLORA_F 41 +#define SEAL_SONG_A 42 +#define SEAL_SONG_B 43 +#define SEAL_SONG_C 44 +#define SEAL_SONG_D 45 +#define SEAL_SONG_E 46 +#define SEAL_SONG_F 47 +#define SEAL_SONG_G 48 +#define SEAL_A 49 +#define SEAL_B 50 +#define SEAL_C 51 +#define SEAL_D 52 +#define SEAL_E 53 +#define SEAL_F 54 +#define SEAL_G 55 +#define SEAL_H 56 +#define SEAL_I 57 +#define SEAL_J 58 +#define SEAL_K 59 +#define SEAL_L 60 +#define SEAL_M 61 +#define SEAL_N 62 +#define SEAL_O 63 +#define SEAL_P 64 +#define SEAL_Q 65 +#define SEAL_R 66 +#define SEAL_S 67 +#define SEAL_T 68 +#define SEAL_U 69 +#define SEAL_V 70 +#define SEAL_W 71 +#define SEAL_X 72 +#define SEAL_Y 73 +#define SEAL_Z 74 +#define SEAL_SHOCK 75 +#define SEAL_MYSTERY 76 +#define SEAL_LINE_D 77 +#define SEAL_LIQUID 78 +#define SEAL_BURST 79 +#define SEAL_TWINKLE 80 #define SEAL_MIN SEAL_HEART_A #define SEAL_MAX SEAL_TWINKLE -#endif //POKEDIAMOND_CONSTANTS_SEAL_CONSTANTS_H +#endif // POKEDIAMOND_CONSTANTS_SEAL_CONSTANTS_H diff --git a/include/constants/sinnoh_dex.h b/include/constants/sinnoh_dex.h index 555ced8b9..cb6b013a2 100644 --- a/include/constants/sinnoh_dex.h +++ b/include/constants/sinnoh_dex.h @@ -1,106 +1,106 @@ #ifndef POKEDIAMOND_CONSTANTS_SINNOH_DEX_H #define POKEDIAMOND_CONSTANTS_SINNOH_DEX_H -#define SINNOH_DEX_ARCEUS 0 -#define SINNOH_DEX_TURTWIG 1 -#define SINNOH_DEX_GROTLE 2 -#define SINNOH_DEX_TORTERRA 3 -#define SINNOH_DEX_CHIMCHAR 4 -#define SINNOH_DEX_MONFERNO 5 -#define SINNOH_DEX_INFERNAPE 6 -#define SINNOH_DEX_PIPLUP 7 -#define SINNOH_DEX_PRINPLUP 8 -#define SINNOH_DEX_EMPOLEON 9 -#define SINNOH_DEX_STARLY 10 -#define SINNOH_DEX_STARAVIA 11 -#define SINNOH_DEX_STARAPTOR 12 -#define SINNOH_DEX_BIDOOF 13 -#define SINNOH_DEX_BIBAREL 14 -#define SINNOH_DEX_KRICKETOT 15 -#define SINNOH_DEX_KRICKETUNE 16 -#define SINNOH_DEX_SHINX 17 -#define SINNOH_DEX_LUXIO 18 -#define SINNOH_DEX_LUXRAY 19 -#define SINNOH_DEX_ABRA 20 -#define SINNOH_DEX_KADABRA 21 -#define SINNOH_DEX_ALAKAZAM 22 -#define SINNOH_DEX_MAGIKARP 23 -#define SINNOH_DEX_GYARADOS 24 -#define SINNOH_DEX_BUDEW 25 -#define SINNOH_DEX_ROSELIA 26 -#define SINNOH_DEX_ROSERADE 27 -#define SINNOH_DEX_ZUBAT 28 -#define SINNOH_DEX_GOLBAT 29 -#define SINNOH_DEX_CROBAT 30 -#define SINNOH_DEX_GEODUDE 31 -#define SINNOH_DEX_GRAVELER 32 -#define SINNOH_DEX_GOLEM 33 -#define SINNOH_DEX_ONIX 34 -#define SINNOH_DEX_STEELIX 35 -#define SINNOH_DEX_CRANIDOS 36 -#define SINNOH_DEX_RAMPARDOS 37 -#define SINNOH_DEX_SHIELDON 38 -#define SINNOH_DEX_BASTIODON 39 -#define SINNOH_DEX_MACHOP 40 -#define SINNOH_DEX_MACHOKE 41 -#define SINNOH_DEX_MACHAMP 42 -#define SINNOH_DEX_PSYDUCK 43 -#define SINNOH_DEX_GOLDUCK 44 -#define SINNOH_DEX_BURMY 45 -#define SINNOH_DEX_WORMADAM 46 -#define SINNOH_DEX_MOTHIM 47 -#define SINNOH_DEX_WURMPLE 48 -#define SINNOH_DEX_SILCOON 49 -#define SINNOH_DEX_BEAUTIFLY 50 -#define SINNOH_DEX_CASCOON 51 -#define SINNOH_DEX_DUSTOX 52 -#define SINNOH_DEX_COMBEE 53 -#define SINNOH_DEX_VESPIQUEN 54 -#define SINNOH_DEX_PACHIRISU 55 -#define SINNOH_DEX_BUIZEL 56 -#define SINNOH_DEX_FLOATZEL 57 -#define SINNOH_DEX_CHERUBI 58 -#define SINNOH_DEX_CHERRIM 59 -#define SINNOH_DEX_SHELLOS 60 -#define SINNOH_DEX_GASTRODON 61 -#define SINNOH_DEX_HERACROSS 62 -#define SINNOH_DEX_AIPOM 63 -#define SINNOH_DEX_AMBIPOM 64 -#define SINNOH_DEX_DRIFLOON 65 -#define SINNOH_DEX_DRIFBLIM 66 -#define SINNOH_DEX_BUNEARY 67 -#define SINNOH_DEX_LOPUNNY 68 -#define SINNOH_DEX_GASTLY 69 -#define SINNOH_DEX_HAUNTER 70 -#define SINNOH_DEX_GENGAR 71 -#define SINNOH_DEX_MISDREAVUS 72 -#define SINNOH_DEX_MISMAGIUS 73 -#define SINNOH_DEX_MURKROW 74 -#define SINNOH_DEX_HONCHKROW 75 -#define SINNOH_DEX_GLAMEOW 76 -#define SINNOH_DEX_PURUGLY 77 -#define SINNOH_DEX_GOLDEEN 78 -#define SINNOH_DEX_SEAKING 79 -#define SINNOH_DEX_BARBOACH 80 -#define SINNOH_DEX_WHISCASH 81 -#define SINNOH_DEX_CHINGLING 82 -#define SINNOH_DEX_CHIMECHO 83 -#define SINNOH_DEX_STUNKY 84 -#define SINNOH_DEX_SKUNTANK 85 -#define SINNOH_DEX_MEDITITE 86 -#define SINNOH_DEX_MEDICHAM 87 -#define SINNOH_DEX_BRONZOR 88 -#define SINNOH_DEX_BRONZONG 89 -#define SINNOH_DEX_PONYTA 90 -#define SINNOH_DEX_RAPIDASH 91 -#define SINNOH_DEX_BONSLY 92 -#define SINNOH_DEX_SUDOWOODO 93 -#define SINNOH_DEX_MIME_JR 94 -#define SINNOH_DEX_MR_MIME 95 -#define SINNOH_DEX_HAPPINY 96 -#define SINNOH_DEX_CHANSEY 97 -#define SINNOH_DEX_BLISSEY 98 -#define SINNOH_DEX_CLEFFA 99 +#define SINNOH_DEX_ARCEUS 0 +#define SINNOH_DEX_TURTWIG 1 +#define SINNOH_DEX_GROTLE 2 +#define SINNOH_DEX_TORTERRA 3 +#define SINNOH_DEX_CHIMCHAR 4 +#define SINNOH_DEX_MONFERNO 5 +#define SINNOH_DEX_INFERNAPE 6 +#define SINNOH_DEX_PIPLUP 7 +#define SINNOH_DEX_PRINPLUP 8 +#define SINNOH_DEX_EMPOLEON 9 +#define SINNOH_DEX_STARLY 10 +#define SINNOH_DEX_STARAVIA 11 +#define SINNOH_DEX_STARAPTOR 12 +#define SINNOH_DEX_BIDOOF 13 +#define SINNOH_DEX_BIBAREL 14 +#define SINNOH_DEX_KRICKETOT 15 +#define SINNOH_DEX_KRICKETUNE 16 +#define SINNOH_DEX_SHINX 17 +#define SINNOH_DEX_LUXIO 18 +#define SINNOH_DEX_LUXRAY 19 +#define SINNOH_DEX_ABRA 20 +#define SINNOH_DEX_KADABRA 21 +#define SINNOH_DEX_ALAKAZAM 22 +#define SINNOH_DEX_MAGIKARP 23 +#define SINNOH_DEX_GYARADOS 24 +#define SINNOH_DEX_BUDEW 25 +#define SINNOH_DEX_ROSELIA 26 +#define SINNOH_DEX_ROSERADE 27 +#define SINNOH_DEX_ZUBAT 28 +#define SINNOH_DEX_GOLBAT 29 +#define SINNOH_DEX_CROBAT 30 +#define SINNOH_DEX_GEODUDE 31 +#define SINNOH_DEX_GRAVELER 32 +#define SINNOH_DEX_GOLEM 33 +#define SINNOH_DEX_ONIX 34 +#define SINNOH_DEX_STEELIX 35 +#define SINNOH_DEX_CRANIDOS 36 +#define SINNOH_DEX_RAMPARDOS 37 +#define SINNOH_DEX_SHIELDON 38 +#define SINNOH_DEX_BASTIODON 39 +#define SINNOH_DEX_MACHOP 40 +#define SINNOH_DEX_MACHOKE 41 +#define SINNOH_DEX_MACHAMP 42 +#define SINNOH_DEX_PSYDUCK 43 +#define SINNOH_DEX_GOLDUCK 44 +#define SINNOH_DEX_BURMY 45 +#define SINNOH_DEX_WORMADAM 46 +#define SINNOH_DEX_MOTHIM 47 +#define SINNOH_DEX_WURMPLE 48 +#define SINNOH_DEX_SILCOON 49 +#define SINNOH_DEX_BEAUTIFLY 50 +#define SINNOH_DEX_CASCOON 51 +#define SINNOH_DEX_DUSTOX 52 +#define SINNOH_DEX_COMBEE 53 +#define SINNOH_DEX_VESPIQUEN 54 +#define SINNOH_DEX_PACHIRISU 55 +#define SINNOH_DEX_BUIZEL 56 +#define SINNOH_DEX_FLOATZEL 57 +#define SINNOH_DEX_CHERUBI 58 +#define SINNOH_DEX_CHERRIM 59 +#define SINNOH_DEX_SHELLOS 60 +#define SINNOH_DEX_GASTRODON 61 +#define SINNOH_DEX_HERACROSS 62 +#define SINNOH_DEX_AIPOM 63 +#define SINNOH_DEX_AMBIPOM 64 +#define SINNOH_DEX_DRIFLOON 65 +#define SINNOH_DEX_DRIFBLIM 66 +#define SINNOH_DEX_BUNEARY 67 +#define SINNOH_DEX_LOPUNNY 68 +#define SINNOH_DEX_GASTLY 69 +#define SINNOH_DEX_HAUNTER 70 +#define SINNOH_DEX_GENGAR 71 +#define SINNOH_DEX_MISDREAVUS 72 +#define SINNOH_DEX_MISMAGIUS 73 +#define SINNOH_DEX_MURKROW 74 +#define SINNOH_DEX_HONCHKROW 75 +#define SINNOH_DEX_GLAMEOW 76 +#define SINNOH_DEX_PURUGLY 77 +#define SINNOH_DEX_GOLDEEN 78 +#define SINNOH_DEX_SEAKING 79 +#define SINNOH_DEX_BARBOACH 80 +#define SINNOH_DEX_WHISCASH 81 +#define SINNOH_DEX_CHINGLING 82 +#define SINNOH_DEX_CHIMECHO 83 +#define SINNOH_DEX_STUNKY 84 +#define SINNOH_DEX_SKUNTANK 85 +#define SINNOH_DEX_MEDITITE 86 +#define SINNOH_DEX_MEDICHAM 87 +#define SINNOH_DEX_BRONZOR 88 +#define SINNOH_DEX_BRONZONG 89 +#define SINNOH_DEX_PONYTA 90 +#define SINNOH_DEX_RAPIDASH 91 +#define SINNOH_DEX_BONSLY 92 +#define SINNOH_DEX_SUDOWOODO 93 +#define SINNOH_DEX_MIME_JR 94 +#define SINNOH_DEX_MR_MIME 95 +#define SINNOH_DEX_HAPPINY 96 +#define SINNOH_DEX_CHANSEY 97 +#define SINNOH_DEX_BLISSEY 98 +#define SINNOH_DEX_CLEFFA 99 #define SINNOH_DEX_CLEFAIRY 100 #define SINNOH_DEX_CLEFABLE 101 #define SINNOH_DEX_CHATOT 102 @@ -153,6 +153,6 @@ #define SINNOH_DEX_DIALGA 149 #define SINNOH_DEX_PALKIA 150 #define SINNOH_DEX_MANAPHY 151 -#define SINNOH_DEX_COUNT SINNOH_DEX_MANAPHY +#define SINNOH_DEX_COUNT SINNOH_DEX_MANAPHY -#endif //POKEDIAMOND_CONSTANTS_SINNOH_DEX_H +#endif // POKEDIAMOND_CONSTANTS_SINNOH_DEX_H diff --git a/include/constants/sndseq.h b/include/constants/sndseq.h index 013b565d3..3df108fe5 100644 --- a/include/constants/sndseq.h +++ b/include/constants/sndseq.h @@ -1,839 +1,839 @@ #ifndef POKEDIAMOND_CONSTANTS_SNDSEQ_H #define POKEDIAMOND_CONSTANTS_SNDSEQ_H -//TODO rename to more useful names +// TODO rename to more useful names -#define SNDARC_BGM_BASE 1000 -#define SNDARC_SE_BASE 1500 +#define SNDARC_BGM_BASE 1000 +#define SNDARC_SE_BASE 1500 -#define SEQ_PV001 (0) -#define SEQ_PV (1) -#define SEQ_PV_END (2) -#define SEQ_DUMMY (SNDARC_BGM_BASE + 0) -#define SEQ_SILENCE_FIELD (SNDARC_BGM_BASE + 1) -#define SEQ_SILENCE_DUNGEON (SNDARC_BGM_BASE + 2) -#define SEQ_TEST_TITLE (SNDARC_BGM_BASE + 3) -#define SEQ_TOWN01_D (SNDARC_BGM_BASE + 4) -#define SEQ_TOWN02_D (SNDARC_BGM_BASE + 5) -#define SEQ_TOWN03_D (SNDARC_BGM_BASE + 6) -#define SEQ_TOWN04_D (SNDARC_BGM_BASE + 7) -#define SEQ_TOWN06_D (SNDARC_BGM_BASE + 8) -#define SEQ_TOWN07_D (SNDARC_BGM_BASE + 9) -#define SEQ_CITY01_D (SNDARC_BGM_BASE + 10) -#define SEQ_CITY02_D (SNDARC_BGM_BASE + 11) -#define SEQ_CITY03_D (SNDARC_BGM_BASE + 12) -#define SEQ_CITY04_D (SNDARC_BGM_BASE + 13) -#define SEQ_CITY05_D (SNDARC_BGM_BASE + 14) -#define SEQ_CITY06_D (SNDARC_BGM_BASE + 15) -#define SEQ_CITY07_D (SNDARC_BGM_BASE + 16) -#define SEQ_CITY08_D (SNDARC_BGM_BASE + 17) -#define SEQ_CITY09_D (SNDARC_BGM_BASE + 18) -#define SEQ_CITY10_D (SNDARC_BGM_BASE + 19) -#define SEQ_CITY11_D (SNDARC_BGM_BASE + 20) -#define SEQ_ROAD_A_D (SNDARC_BGM_BASE + 21) -#define SEQ_ROAD_B_D (SNDARC_BGM_BASE + 22) -#define SEQ_ROAD_C_D (SNDARC_BGM_BASE + 23) -#define SEQ_ROAD_D_D (SNDARC_BGM_BASE + 24) -#define SEQ_ROAD_E_D (SNDARC_BGM_BASE + 25) -#define SEQ_ROAD_F_D (SNDARC_BGM_BASE + 26) -#define SEQ_ROAD_SNOW_D (SNDARC_BGM_BASE + 27) -#define SEQ_ROAD_BZA_D (SNDARC_BGM_BASE + 28) -#define SEQ_OPENING (SNDARC_BGM_BASE + 29) -#define SEQ_TV_HOUSOU (SNDARC_BGM_BASE + 30) -#define SEQ_TOWN05_D (SNDARC_BGM_BASE + 31) -#define SEQ_ROAD_BZB_D (SNDARC_BGM_BASE + 32) -#define SEQ_TOWN01_N (SNDARC_BGM_BASE + 33) -#define SEQ_TOWN02_N (SNDARC_BGM_BASE + 34) -#define SEQ_TOWN03_N (SNDARC_BGM_BASE + 35) -#define SEQ_TOWN04_N (SNDARC_BGM_BASE + 36) -#define SEQ_TOWN06_N (SNDARC_BGM_BASE + 37) -#define SEQ_TOWN07_N (SNDARC_BGM_BASE + 38) -#define SEQ_CITY01_N (SNDARC_BGM_BASE + 39) -#define SEQ_CITY02_N (SNDARC_BGM_BASE + 40) -#define SEQ_CITY03_N (SNDARC_BGM_BASE + 41) -#define SEQ_CITY04_N (SNDARC_BGM_BASE + 42) -#define SEQ_CITY05_N (SNDARC_BGM_BASE + 43) -#define SEQ_CITY06_N (SNDARC_BGM_BASE + 44) -#define SEQ_CITY07_N (SNDARC_BGM_BASE + 45) -#define SEQ_CITY08_N (SNDARC_BGM_BASE + 46) -#define SEQ_CITY09_N (SNDARC_BGM_BASE + 47) -#define SEQ_CITY10_N (SNDARC_BGM_BASE + 48) -#define SEQ_CITY11_N (SNDARC_BGM_BASE + 49) -#define SEQ_ROAD_A_N (SNDARC_BGM_BASE + 50) -#define SEQ_ROAD_B_N (SNDARC_BGM_BASE + 51) -#define SEQ_ROAD_C_N (SNDARC_BGM_BASE + 52) -#define SEQ_ROAD_D_N (SNDARC_BGM_BASE + 53) -#define SEQ_ROAD_E_N (SNDARC_BGM_BASE + 54) -#define SEQ_ROAD_F_N (SNDARC_BGM_BASE + 55) -#define SEQ_ROAD_SNOW_N (SNDARC_BGM_BASE + 56) -#define SEQ_ROAD_BZA_N (SNDARC_BGM_BASE + 57) -#define SEQ_TOWN05_N (SNDARC_BGM_BASE + 58) -#define SEQ_ROAD_BZB_N (SNDARC_BGM_BASE + 59) -#define SEQ_TANKOU (SNDARC_BGM_BASE + 60) -#define SEQ_HATANIGE (SNDARC_BGM_BASE + 61) -#define SEQ_D_01 (SNDARC_BGM_BASE + 62) -#define SEQ_D_02 (SNDARC_BGM_BASE + 63) -#define SEQ_D_03 (SNDARC_BGM_BASE + 64) -#define SEQ_D_RYAYHY (SNDARC_BGM_BASE + 65) -#define SEQ_D_KOUEN (SNDARC_BGM_BASE + 66) -#define SEQ_D_AGITO (SNDARC_BGM_BASE + 67) -#define SEQ_D_GINLOBBY (SNDARC_BGM_BASE + 68) -#define SEQ_D_SAFARI (SNDARC_BGM_BASE + 69) -#define SEQ_D_LAKE (SNDARC_BGM_BASE + 70) -#define SEQ_D_MOUNT1 (SNDARC_BGM_BASE + 71) -#define SEQ_D_MOUNT2 (SNDARC_BGM_BASE + 72) -#define SEQ_D_06 (SNDARC_BGM_BASE + 73) -#define SEQ_D_05 (SNDARC_BGM_BASE + 74) -#define SEQ_D_04 (SNDARC_BGM_BASE + 75) -#define SEQ_D_LEAGUE (SNDARC_BGM_BASE + 76) -#define SEQ_BLD_DENDO (SNDARC_BGM_BASE + 77) -#define SEQ_D_CROAD (SNDARC_BGM_BASE + 78) -#define SEQ_D_ICE (SNDARC_BGM_BASE + 79) -#define SEQ_D_SECRET (SNDARC_BGM_BASE + 80) -#define SEQ_D_UNKNOWN (SNDARC_BGM_BASE + 81) -#define SEQ_POKEPARK (SNDARC_BGM_BASE + 82) -#define SEQ_D_HARDMT (SNDARC_BGM_BASE + 83) -#define SEQ_BLD_LEGEND (SNDARC_BGM_BASE + 84) -#define SEQ_PC_01 (SNDARC_BGM_BASE + 85) -#define SEQ_PC_02 (SNDARC_BGM_BASE + 86) -#define SEQ_GYM (SNDARC_BGM_BASE + 87) -#define SEQ_KENKYUJO (SNDARC_BGM_BASE + 88) -#define SEQ_BLD_CON (SNDARC_BGM_BASE + 89) -#define SEQ_FS (SNDARC_BGM_BASE + 90) -#define SEQ_BLD_GAME (SNDARC_BGM_BASE + 91) -#define SEQ_BF_TOWWER (SNDARC_BGM_BASE + 92) -#define SEQ_BLD_TV (SNDARC_BGM_BASE + 93) -#define SEQ_THE_EVENT04 (SNDARC_BGM_BASE + 94) -#define SEQ_FUE (SNDARC_BGM_BASE + 95) -#define SEQ_AUS (SNDARC_BGM_BASE + 96) -#define SEQ_BLD_BLD_GTC (SNDARC_BGM_BASE + 97) -#define SEQ_OPENING2 (SNDARC_BGM_BASE + 98) -#define SEQ_BF_FACT (SNDARC_BGM_BASE + 99) -#define SEQ_EYE_BOY (SNDARC_BGM_BASE + 100) -#define SEQ_EYE_KID (SNDARC_BGM_BASE + 101) -#define SEQ_EYE_FIGHT (SNDARC_BGM_BASE + 102) -#define SEQ_EYE_GINGA (SNDARC_BGM_BASE + 103) -#define SEQ_EYE_LADY (SNDARC_BGM_BASE + 104) -#define SEQ_EYE_MOUNT (SNDARC_BGM_BASE + 105) -#define SEQ_EYE_RICH (SNDARC_BGM_BASE + 106) -#define SEQ_EYE_ENKA (SNDARC_BGM_BASE + 107) -#define SEQ_EYE_MYS (SNDARC_BGM_BASE + 108) -#define SEQ_EYE_ELITE (SNDARC_BGM_BASE + 109) -#define SEQ_EYE_GIRL (SNDARC_BGM_BASE + 110) -#define SEQ_EYE_SPORT (SNDARC_BGM_BASE + 111) -#define SEQ_EYE_FUN (SNDARC_BGM_BASE + 112) -#define SEQ_EYE_TENNO (SNDARC_BGM_BASE + 113) -#define SEQ_EYE_CHAMP (SNDARC_BGM_BASE + 114) -#define SEQ_FIGHT0101 (SNDARC_BGM_BASE + 115) -#define SEQ_BA_POKE (SNDARC_BGM_BASE + 116) -#define SEQ_BA_GYM (SNDARC_BGM_BASE + 117) -#define SEQ_BA_DPOKE1 (SNDARC_BGM_BASE + 118) -#define SEQ_BA_TRAIN (SNDARC_BGM_BASE + 119) -#define SEQ_BA_AKAGI (SNDARC_BGM_BASE + 120) -#define SEQ_BA_DPOKE2 (SNDARC_BGM_BASE + 121) -#define SEQ_BA_CHANP (SNDARC_BGM_BASE + 122) -#define SEQ_BA_GINGA (SNDARC_BGM_BASE + 123) -#define SEQ_BA_RIVAL (SNDARC_BGM_BASE + 124) -#define SEQ_BA_SECRET1 (SNDARC_BGM_BASE + 125) -#define SEQ_BA_SECRET2 (SNDARC_BGM_BASE + 126) -#define SEQ_WINPOKE (SNDARC_BGM_BASE + 127) -#define SEQ_WINTRAIN (SNDARC_BGM_BASE + 128) -#define SEQ_WINTGYM (SNDARC_BGM_BASE + 129) -#define SEQ_WINCHAMP (SNDARC_BGM_BASE + 130) -#define SEQ_WINGINGA (SNDARC_BGM_BASE + 131) -#define SEQ_WINAKAGI (SNDARC_BGM_BASE + 132) -#define SEQ_WINTENNO (SNDARC_BGM_BASE + 133) -#define SEQ_BA_GINGA3 (SNDARC_BGM_BASE + 134) -#define SEQ_CON_TEST (SNDARC_BGM_BASE + 135) -#define SEQ_BA_TENNO (SNDARC_BGM_BASE + 136) -#define SEQ_BA_TOWER (SNDARC_BGM_BASE + 137) -#define SEQ_TSURETEKE (SNDARC_BGM_BASE + 138) -#define SEQ_THE_RIV (SNDARC_BGM_BASE + 139) -#define SEQ_THE_EVENT01 (SNDARC_BGM_BASE + 140) -#define SEQ_SHINKA (SNDARC_BGM_BASE + 141) -#define SEQ_THE_BOY (SNDARC_BGM_BASE + 142) -#define SEQ_THE_GIRL (SNDARC_BGM_BASE + 143) -#define SEQ_THE_EVENT02 (SNDARC_BGM_BASE + 144) -#define SEQ_THE_EVENT03 (SNDARC_BGM_BASE + 145) -#define SEQ_THE_EVENT05 (SNDARC_BGM_BASE + 146) -#define SEQ_THE_AKAGI (SNDARC_BGM_BASE + 147) -#define SEQ_EV_DENDO1 (SNDARC_BGM_BASE + 148) -#define SEQ_EV_LEGEND (SNDARC_BGM_BASE + 149) -#define SEQ_KUSAGASA (SNDARC_BGM_BASE + 150) -#define SEQ_NAMINORI (SNDARC_BGM_BASE + 151) -#define SEQ_BICYCLE (SNDARC_BGM_BASE + 152) -#define SEQ_GONIN (SNDARC_BGM_BASE + 153) -#define SEQ_TV_END (SNDARC_BGM_BASE + 154) -#define SEQ_FANFA1 (SNDARC_BGM_BASE + 155) -#define SEQ_FANFA5 (SNDARC_BGM_BASE + 156) -#define SEQ_FANFA3 (SNDARC_BGM_BASE + 157) -#define SEQ_FANFA4 (SNDARC_BGM_BASE + 158) -#define SEQ_FANFA6 (SNDARC_BGM_BASE + 159) -#define SEQ_FANFA2 (SNDARC_BGM_BASE + 160) -#define SEQ_BADGE (SNDARC_BGM_BASE + 161) -#define SEQ_POCKETCH (SNDARC_BGM_BASE + 162) -#define SEQ_WAZA (SNDARC_BGM_BASE + 163) -#define SEQ_ACCE (SNDARC_BGM_BASE + 164) -#define SEQ_WASURE (SNDARC_BGM_BASE + 165) -#define SEQ_ASA (SNDARC_BGM_BASE + 166) -#define SEQ_KINOMI (SNDARC_BGM_BASE + 167) -#define SEQ_REPORT (SNDARC_BGM_BASE + 168) -#define SEQ_CO_DRESS (SNDARC_BGM_BASE + 169) -#define SEQ_KOUKAN (SNDARC_BGM_BASE + 170) -#define SEQ_BLD_EV_DENDO2 (SNDARC_BGM_BASE + 171) -#define SEQ_TITLE00 (SNDARC_BGM_BASE + 172) -#define SEQ_TITLE01 (SNDARC_BGM_BASE + 173) -#define SEQ_PRESENT (SNDARC_BGM_BASE + 174) -#define SEQ_WIFILOBBY (SNDARC_BGM_BASE + 175) -#define SEQ_CO_KAWAI (SNDARC_BGM_BASE + 176) -#define SEQ_CO_KASHI (SNDARC_BGM_BASE + 177) -#define SEQ_CO_UTSUK (SNDARC_BGM_BASE + 178) -#define SEQ_CO_TAKUMA (SNDARC_BGM_BASE + 179) -#define SEQ_CO_KAKKO (SNDARC_BGM_BASE + 180) -#define SEQ_CO_KEKKA (SNDARC_BGM_BASE + 181) -#define SEQ_CO_FANFA (SNDARC_BGM_BASE + 182) -#define SEQ_KINOMI1 (SNDARC_BGM_BASE + 183) -#define SEQ_SLOT_ATARI (SNDARC_BGM_BASE + 184) -#define SEQ_SLOT_OOATARI (SNDARC_BGM_BASE + 185) -#define SEQ_BLD_ENDING (SNDARC_BGM_BASE + 186) -#define SEQ_KINOMI2 (SNDARC_BGM_BASE + 187) -#define SEQ_SLOT (SNDARC_BGM_BASE + 188) -#define SEQ_AIF_FIELD (SNDARC_BGM_BASE + 189) -#define SEQ_AIF_DUNGEON (SNDARC_BGM_BASE + 190) -#define SEQ_AIF_BATTLE (SNDARC_BGM_BASE + 191) -#define SEQ_BGM_END (SNDARC_BGM_BASE + 192) -#define SEQ_SE_DP_SELECT (SNDARC_SE_BASE + 0) -#define SEQ_SE_DP_DECIDE (SNDARC_SE_BASE + 1) -#define SEQ_SE_DP_TALK2 (SNDARC_SE_BASE + 2) -#define SEQ_SE_DP_SELECT11 (SNDARC_SE_BASE + 3) -#define SEQ_SE_DP_SELECT78 (SNDARC_SE_BASE + 4) -#define SEQ_SE_DP_SELECT5 (SNDARC_SE_BASE + 5) -#define SEQ_SE_DP_PIRORIRO (SNDARC_SE_BASE + 6) -#define SEQ_SE_DP_PIRORIRO2 (SNDARC_SE_BASE + 7) -#define SEQ_SE_DP_BUTTON9 (SNDARC_SE_BASE + 8) -#define SEQ_SE_DP_BUTTON3 (SNDARC_SE_BASE + 9) -#define SEQ_SE_DP_KON (SNDARC_SE_BASE + 10) -#define SEQ_SE_DP_KON2 (SNDARC_SE_BASE + 11) -#define SEQ_SE_DP_KON3 (SNDARC_SE_BASE + 12) -#define SEQ_SE_DP_KON4 (SNDARC_SE_BASE + 13) -#define SEQ_SE_DP_BOX01 (SNDARC_SE_BASE + 14) -#define SEQ_SE_DP_BOX02 (SNDARC_SE_BASE + 15) -#define SEQ_SE_DP_KAIFUKU (SNDARC_SE_BASE + 16) -#define SEQ_SE_DP_ZUKAN02 (SNDARC_SE_BASE + 17) -#define SEQ_SE_DP_OPEN2 (SNDARC_SE_BASE + 18) -#define SEQ_SE_DP_CLOSE2 (SNDARC_SE_BASE + 19) -#define SEQ_SE_DP_025 (SNDARC_SE_BASE + 20) -#define SEQ_SE_DP_PINPON (SNDARC_SE_BASE + 21) -#define SEQ_SE_DP_CUSTOM06 (SNDARC_SE_BASE + 22) -#define SEQ_SE_DP_BOX03 (SNDARC_SE_BASE + 23) -#define SEQ_SE_DP_START (SNDARC_SE_BASE + 24) -#define SEQ_SE_DP_SELECT_SLOT (SNDARC_SE_BASE + 25) -#define SEQ_SE_DP_CARD10 (SNDARC_SE_BASE + 26) -#define SEQ_SE_DP_KATI (SNDARC_SE_BASE + 27) -#define SEQ_SE_DP_CON_014 (SNDARC_SE_BASE + 28) -#define SEQ_SE_DP_W025 (SNDARC_SE_BASE + 29) -#define SEQ_SE_DP_W060C (SNDARC_SE_BASE + 30) -#define SEQ_SE_DP_W062 (SNDARC_SE_BASE + 31) -#define SEQ_SE_DP_W080 (SNDARC_SE_BASE + 32) -#define SEQ_SE_DP_WIN_OPEN (SNDARC_SE_BASE + 33) -#define SEQ_SE_DP_BOWA (SNDARC_SE_BASE + 34) -#define SEQ_SE_DP_Z_SEARCH (SNDARC_SE_BASE + 35) -#define SEQ_SE_DP_CARD2 (SNDARC_SE_BASE + 36) -#define SEQ_SE_DP_WALL_HIT (SNDARC_SE_BASE + 37) -#define SEQ_SE_DP_WALL_HIT2 (SNDARC_SE_BASE + 38) -#define SEQ_SE_DP_KAIDAN2 (SNDARC_SE_BASE + 39) -#define SEQ_SE_DP_DOOR (SNDARC_SE_BASE + 40) -#define SEQ_SE_DP_DOOR_OPEN (SNDARC_SE_BASE + 41) -#define SEQ_SE_DP_DOOR_CLOSE (SNDARC_SE_BASE + 42) -#define SEQ_SE_DP_DOOR_CLOSE2 (SNDARC_SE_BASE + 43) -#define SEQ_SE_DP_DOOR10 (SNDARC_SE_BASE + 44) -#define SEQ_SE_DP_WIN_OPEN2 (SNDARC_SE_BASE + 45) -#define SEQ_SE_DP_WIN_OPEN3 (SNDARC_SE_BASE + 46) -#define SEQ_SE_DP_DANSA (SNDARC_SE_BASE + 47) -#define SEQ_SE_DP_PC_ON (SNDARC_SE_BASE + 48) -#define SEQ_SE_DP_PC_LOGIN (SNDARC_SE_BASE + 49) -#define SEQ_SE_DP_PC_LOGOFF (SNDARC_SE_BASE + 50) -#define SEQ_SE_DP_DENDOU (SNDARC_SE_BASE + 51) -#define SEQ_SE_DP_DOKU2 (SNDARC_SE_BASE + 52) -#define SEQ_SE_DP_ELEBETA (SNDARC_SE_BASE + 53) -#define SEQ_SE_DP_ELEBETA2 (SNDARC_SE_BASE + 54) -#define SEQ_SE_DP_ELEBETA3 (SNDARC_SE_BASE + 55) -#define SEQ_SE_DP_ELEBETA4 (SNDARC_SE_BASE + 56) -#define SEQ_SE_DP_ESUKA (SNDARC_SE_BASE + 57) -#define SEQ_SE_DP_TV_NOISE (SNDARC_SE_BASE + 58) -#define SEQ_SE_DP_JIHANKI (SNDARC_SE_BASE + 59) -#define SEQ_SE_DP_JITENSYA (SNDARC_SE_BASE + 60) -#define SEQ_SE_DP_GEAR (SNDARC_SE_BASE + 61) -#define SEQ_SE_DP_KI_GASYAN (SNDARC_SE_BASE + 62) -#define SEQ_SE_DP_SAVE (SNDARC_SE_BASE + 63) -#define SEQ_SE_DP_GEAR2 (SNDARC_SE_BASE + 64) -#define SEQ_SE_DP_SELECT8 (SNDARC_SE_BASE + 65) -#define SEQ_SE_DP_DORIRU (SNDARC_SE_BASE + 66) -#define SEQ_SE_DP_YUKIASHI (SNDARC_SE_BASE + 67) -#define SEQ_SE_DP_UG_005 (SNDARC_SE_BASE + 68) -#define SEQ_SE_DP_UG_006 (SNDARC_SE_BASE + 69) -#define SEQ_SE_DP_UG_007 (SNDARC_SE_BASE + 70) -#define SEQ_SE_DP_UG_008 (SNDARC_SE_BASE + 71) -#define SEQ_SE_DP_UG_020 (SNDARC_SE_BASE + 72) -#define SEQ_SE_DP_UG_021 (SNDARC_SE_BASE + 73) -#define SEQ_SE_DP_UG_022 (SNDARC_SE_BASE + 74) -#define SEQ_SE_DP_UG_023 (SNDARC_SE_BASE + 75) -#define SEQ_SE_DP_UG_024 (SNDARC_SE_BASE + 76) -#define SEQ_SE_DP_UG_025 (SNDARC_SE_BASE + 77) -#define SEQ_SE_DP_UG_026 (SNDARC_SE_BASE + 78) -#define SEQ_SE_DP_UG_027 (SNDARC_SE_BASE + 79) -#define SEQ_SE_DP_DENSI15 (SNDARC_SE_BASE + 80) -#define SEQ_SE_DP_DENSI16 (SNDARC_SE_BASE + 81) -#define SEQ_SE_DP_DENSI20 (SNDARC_SE_BASE + 82) -#define SEQ_SE_DP_PYUU (SNDARC_SE_BASE + 83) -#define SEQ_SE_DP_PYUU2 (SNDARC_SE_BASE + 84) -#define SEQ_SE_DP_SUTYA (SNDARC_SE_BASE + 85) -#define SEQ_SE_DP_GYURU (SNDARC_SE_BASE + 86) -#define SEQ_SE_DP_OPEN7 (SNDARC_SE_BASE + 87) -#define SEQ_SE_DP_CLOSE7 (SNDARC_SE_BASE + 88) -#define SEQ_SE_DP_ZIZIZI (SNDARC_SE_BASE + 89) -#define SEQ_SE_DP_MAZYO2 (SNDARC_SE_BASE + 90) -#define SEQ_SE_DP_MAZYO4 (SNDARC_SE_BASE + 91) -#define SEQ_SE_DP_BAG_004 (SNDARC_SE_BASE + 92) -#define SEQ_SE_DP_T_AME (SNDARC_SE_BASE + 93) -#define SEQ_SE_DP_T_KOAME (SNDARC_SE_BASE + 94) -#define SEQ_SE_DP_T_OOAME (SNDARC_SE_BASE + 95) -#define SEQ_SE_DP_T_KAMI (SNDARC_SE_BASE + 96) -#define SEQ_SE_DP_T_KAMI2 (SNDARC_SE_BASE + 97) -#define SEQ_SE_DP_HAMARU (SNDARC_SE_BASE + 98) -#define SEQ_SE_DP_GAGAGA (SNDARC_SE_BASE + 99) -#define SEQ_SE_DP_F017 (SNDARC_SE_BASE + 100) -#define SEQ_SE_DP_FOOT3_0 (SNDARC_SE_BASE + 101) -#define SEQ_SE_DP_FOOT3_1 (SNDARC_SE_BASE + 102) -#define SEQ_SE_DP_CON_016 (SNDARC_SE_BASE + 103) -#define SEQ_SE_DP_REGI (SNDARC_SE_BASE + 104) -#define SEQ_SE_DP_CON_F007 (SNDARC_SE_BASE + 105) -#define SEQ_SE_DP_CON_015 (SNDARC_SE_BASE + 106) -#define SEQ_SE_DP_SUTYA2 (SNDARC_SE_BASE + 107) -#define SEQ_SE_DP_FW230 (SNDARC_SE_BASE + 108) -#define SEQ_SE_DP_FW019 (SNDARC_SE_BASE + 109) -#define SEQ_SE_DP_FW088 (SNDARC_SE_BASE + 110) -#define SEQ_SE_DP_FW015 (SNDARC_SE_BASE + 111) -#define SEQ_SE_DP_FBRADE (SNDARC_SE_BASE + 112) -#define SEQ_SE_DP_FW463 (SNDARC_SE_BASE + 113) -#define SEQ_SE_DP_TELE (SNDARC_SE_BASE + 114) -#define SEQ_SE_DP_TELE2 (SNDARC_SE_BASE + 115) -#define SEQ_SE_DP_FW104 (SNDARC_SE_BASE + 116) -#define SEQ_SE_DP_ZUPO (SNDARC_SE_BASE + 117) -#define SEQ_SE_DP_ZUPO2 (SNDARC_SE_BASE + 118) -#define SEQ_SE_DP_KUSA (SNDARC_SE_BASE + 119) -#define SEQ_SE_DP_SUNA (SNDARC_SE_BASE + 120) -#define SEQ_SE_DP_MARSH_WALK (SNDARC_SE_BASE + 121) -#define SEQ_SE_DP_DANSA4 (SNDARC_SE_BASE + 122) -#define SEQ_SE_DP_DANSA5 (SNDARC_SE_BASE + 123) -#define SEQ_SE_DP_F209 (SNDARC_SE_BASE + 124) -#define SEQ_SE_DP_SUBERU (SNDARC_SE_BASE + 125) -#define SEQ_SE_DP_FW056 (SNDARC_SE_BASE + 126) -#define SEQ_SE_DP_FW291 (SNDARC_SE_BASE + 127) -#define SEQ_SE_DP_FW089 (SNDARC_SE_BASE + 128) -#define SEQ_SE_DP_FW452 (SNDARC_SE_BASE + 129) -#define SEQ_SE_DP_FW466 (SNDARC_SE_BASE + 130) -#define SEQ_SE_DP_F007 (SNDARC_SE_BASE + 131) -#define SEQ_SE_DP_FAWA (SNDARC_SE_BASE + 132) -#define SEQ_SE_DP_FPASA2 (SNDARC_SE_BASE + 133) -#define SEQ_SE_DP_FW367 (SNDARC_SE_BASE + 134) -#define SEQ_SE_DP_POKETCH_003 (SNDARC_SE_BASE + 135) -#define SEQ_SE_DP_POKETCH_004 (SNDARC_SE_BASE + 136) -#define SEQ_SE_DP_POKETCH_005 (SNDARC_SE_BASE + 137) -#define SEQ_SE_DP_POKETCH_006 (SNDARC_SE_BASE + 138) -#define SEQ_SE_DP_POKETCH_007 (SNDARC_SE_BASE + 139) -#define SEQ_SE_DP_POKETCH_009 (SNDARC_SE_BASE + 140) -#define SEQ_SE_DP_POKETCH_010 (SNDARC_SE_BASE + 141) -#define SEQ_SE_DP_POKETCH_011 (SNDARC_SE_BASE + 142) -#define SEQ_SE_DP_POKETCH_012 (SNDARC_SE_BASE + 143) -#define SEQ_SE_DP_POKETCH_013 (SNDARC_SE_BASE + 144) -#define SEQ_SE_DP_POKETCH_014 (SNDARC_SE_BASE + 145) -#define SEQ_SE_DP_BEEP (SNDARC_SE_BASE + 146) -#define SEQ_SE_DP_DENSI01 (SNDARC_SE_BASE + 147) -#define SEQ_SE_DP_DENSI02 (SNDARC_SE_BASE + 148) -#define SEQ_SE_DP_DENSI04 (SNDARC_SE_BASE + 149) -#define SEQ_SE_DP_DENSI05 (SNDARC_SE_BASE + 150) -#define SEQ_SE_DP_DENSI07 (SNDARC_SE_BASE + 151) -#define SEQ_SE_DP_DENSI08 (SNDARC_SE_BASE + 152) -#define SEQ_SE_DP_DENSI09 (SNDARC_SE_BASE + 153) -#define SEQ_SE_DP_DENSI10 (SNDARC_SE_BASE + 154) -#define SEQ_SE_DP_DENSI11 (SNDARC_SE_BASE + 155) -#define SEQ_SE_DP_DENSI12 (SNDARC_SE_BASE + 156) -#define SEQ_SE_DP_KASYA (SNDARC_SE_BASE + 157) -#define SEQ_SE_DP_PASO2 (SNDARC_SE_BASE + 158) -#define SEQ_SE_DP_TATA (SNDARC_SE_BASE + 159) -#define SEQ_SE_DP_UP (SNDARC_SE_BASE + 160) -#define SEQ_SE_DP_PASO (SNDARC_SE_BASE + 161) -#define SEQ_SE_DP_SYARAAN (SNDARC_SE_BASE + 162) -#define SEQ_SE_DP_TARARARAN (SNDARC_SE_BASE + 163) -#define SEQ_SE_DP_MAZYO (SNDARC_SE_BASE + 164) -#define SEQ_SE_DP_MAZYO3 (SNDARC_SE_BASE + 165) -#define SEQ_SE_DP_HYUN (SNDARC_SE_BASE + 166) -#define SEQ_SE_DP_HYUN2 (SNDARC_SE_BASE + 167) -#define SEQ_SE_DP_CON_017 (SNDARC_SE_BASE + 168) -#define SEQ_SE_DP_BUTTON01 (SNDARC_SE_BASE + 169) -#define SEQ_SE_DP_Z_PAGE (SNDARC_SE_BASE + 170) -#define SEQ_SE_DP_JOURO (SNDARC_SE_BASE + 171) -#define SEQ_SE_DP_PIKO (SNDARC_SE_BASE + 172) -#define SEQ_SE_DP_PIKO2 (SNDARC_SE_BASE + 173) -#define SEQ_SE_DP_ZUKAN01 (SNDARC_SE_BASE + 174) -#define SEQ_SE_DP_DENSI06 (SNDARC_SE_BASE + 175) -#define SEQ_SE_DP_DENSI17 (SNDARC_SE_BASE + 176) -#define SEQ_SE_DP_DENSI18 (SNDARC_SE_BASE + 177) -#define SEQ_SE_DP_DENSI19 (SNDARC_SE_BASE + 178) -#define SEQ_SE_DP_MEKURU (SNDARC_SE_BASE + 179) -#define SEQ_SE_DP_MEKURU2 (SNDARC_SE_BASE + 180) -#define SEQ_SE_DP_MEKURU3 (SNDARC_SE_BASE + 181) -#define SEQ_SE_DP_MIGAKU01 (SNDARC_SE_BASE + 182) -#define SEQ_SE_DP_MIGAKU02 (SNDARC_SE_BASE + 183) -#define SEQ_SE_DP_BADGE_C (SNDARC_SE_BASE + 184) -#define SEQ_SE_DP_CARD3 (SNDARC_SE_BASE + 185) -#define SEQ_SE_DP_CARD5 (SNDARC_SE_BASE + 186) -#define SEQ_SE_DP_CARD6 (SNDARC_SE_BASE + 187) -#define SEQ_SE_DP_CARD9 (SNDARC_SE_BASE + 188) -#define SEQ_SE_DP_CARD11 (SNDARC_SE_BASE + 189) -#define SEQ_SE_DP_KYU01 (SNDARC_SE_BASE + 190) -#define SEQ_SE_DP_NAMEIN_01 (SNDARC_SE_BASE + 191) -#define SEQ_SE_DP_SYU01 (SNDARC_SE_BASE + 192) -#define SEQ_SE_DP_SYU02 (SNDARC_SE_BASE + 193) -#define SEQ_SE_DP_SYU03 (SNDARC_SE_BASE + 194) -#define SEQ_SE_DP_DECIDE2 (SNDARC_SE_BASE + 195) -#define SEQ_SE_DP_POKELIST_001 (SNDARC_SE_BASE + 196) -#define SEQ_SE_DP_UG_001 (SNDARC_SE_BASE + 197) -#define SEQ_SE_DP_UG_002 (SNDARC_SE_BASE + 198) -#define SEQ_SE_DP_UG_003 (SNDARC_SE_BASE + 199) -#define SEQ_SE_DP_UG_004 (SNDARC_SE_BASE + 200) -#define SEQ_SE_DP_KIRAKIRA3 (SNDARC_SE_BASE + 201) -#define SEQ_SE_DP_KIRAKIRA (SNDARC_SE_BASE + 202) -#define SEQ_SE_DP_KIRAKIRA4 (SNDARC_SE_BASE + 203) -#define SEQ_SE_DP_KOUKAN01 (SNDARC_SE_BASE + 204) -#define SEQ_SE_DP_KOUKAN03 (SNDARC_SE_BASE + 205) -#define SEQ_SE_DP_KOUKAN04 (SNDARC_SE_BASE + 206) -#define SEQ_SE_DP_KOUKAN05 (SNDARC_SE_BASE + 207) -#define SEQ_SE_DP_KOUKAN06 (SNDARC_SE_BASE + 208) -#define SEQ_SE_DP_KOUKAN07 (SNDARC_SE_BASE + 209) -#define SEQ_SE_DP_KOUKAN08 (SNDARC_SE_BASE + 210) -#define SEQ_SE_DP_KOUKAN09 (SNDARC_SE_BASE + 211) -#define SEQ_SE_DP_KOUKAN10 (SNDARC_SE_BASE + 212) -#define SEQ_SE_DP_NM01 (SNDARC_SE_BASE + 213) -#define SEQ_SE_DP_NM02 (SNDARC_SE_BASE + 214) -#define SEQ_SE_DP_NM03 (SNDARC_SE_BASE + 215) -#define SEQ_SE_DP_NM03_2 (SNDARC_SE_BASE + 216) -#define SEQ_SE_DP_NM04 (SNDARC_SE_BASE + 217) -#define SEQ_SE_DP_NM04_2 (SNDARC_SE_BASE + 218) -#define SEQ_SE_DP_NM04_3 (SNDARC_SE_BASE + 219) -#define SEQ_SE_DP_NM05 (SNDARC_SE_BASE + 220) -#define SEQ_SE_DP_NM07 (SNDARC_SE_BASE + 221) -#define SEQ_SE_DP_NM07_2 (SNDARC_SE_BASE + 222) -#define SEQ_SE_DP_NM08 (SNDARC_SE_BASE + 223) -#define SEQ_SE_DP_NM09 (SNDARC_SE_BASE + 224) -#define SEQ_SE_DP_NM10 (SNDARC_SE_BASE + 225) -#define SEQ_SE_DP_NM10_2 (SNDARC_SE_BASE + 226) -#define SEQ_SE_DP_NM11 (SNDARC_SE_BASE + 227) -#define SEQ_SE_DP_NM12 (SNDARC_SE_BASE + 228) -#define SEQ_SE_DP_NM12_2 (SNDARC_SE_BASE + 229) -#define SEQ_SE_DP_NM13 (SNDARC_SE_BASE + 230) -#define SEQ_SE_DP_NM14 (SNDARC_SE_BASE + 231) -#define SEQ_SE_DP_CUSTOM01 (SNDARC_SE_BASE + 232) -#define SEQ_SE_DP_CUSTOM02 (SNDARC_SE_BASE + 233) -#define SEQ_SE_DP_CUSTOM05 (SNDARC_SE_BASE + 234) -#define SEQ_SE_DP_BAG_006 (SNDARC_SE_BASE + 235) -#define SEQ_SE_DP_BAG_011 (SNDARC_SE_BASE + 236) -#define SEQ_SE_DP_BAG_020 (SNDARC_SE_BASE + 237) -#define SEQ_SE_DP_BAG_030 (SNDARC_SE_BASE + 238) -#define SEQ_SE_DP_BAG_031 (SNDARC_SE_BASE + 239) -#define SEQ_SE_DP_GASA01 (SNDARC_SE_BASE + 240) -#define SEQ_SE_DP_GASA02 (SNDARC_SE_BASE + 241) -#define SEQ_SE_DP_GASA03 (SNDARC_SE_BASE + 242) -#define SEQ_SE_DP_CARD7 (SNDARC_SE_BASE + 243) -#define SEQ_SE_DP_SLOT01 (SNDARC_SE_BASE + 244) -#define SEQ_SE_DP_SLOT02 (SNDARC_SE_BASE + 245) -#define SEQ_SE_DP_CLIMAX01 (SNDARC_SE_BASE + 246) -#define SEQ_SE_DP_CLIMAX03 (SNDARC_SE_BASE + 247) -#define SEQ_SE_DP_CLIMAX06 (SNDARC_SE_BASE + 248) -#define SEQ_SE_DP_CLIMAX09 (SNDARC_SE_BASE + 249) -#define SEQ_SE_DP_CLIMAX10 (SNDARC_SE_BASE + 250) -#define SEQ_SE_DP_CLIMAX12 (SNDARC_SE_BASE + 251) -#define SEQ_SE_DP_CLIMAX15 (SNDARC_SE_BASE + 252) -#define SEQ_SE_DP_TRAIN02 (SNDARC_SE_BASE + 253) -#define SEQ_SE_DP_TRAIN03 (SNDARC_SE_BASE + 254) -#define SEQ_SE_DP_TRAIN04 (SNDARC_SE_BASE + 255) -#define SEQ_SE_DP_SHIP01 (SNDARC_SE_BASE + 256) -#define SEQ_SE_DP_SHIP02 (SNDARC_SE_BASE + 257) -#define SEQ_SE_DP_SHIP03 (SNDARC_SE_BASE + 258) -#define SEQ_SE_DP_CON_001 (SNDARC_SE_BASE + 259) -#define SEQ_SE_DP_CON_002 (SNDARC_SE_BASE + 260) -#define SEQ_SE_DP_CON_003 (SNDARC_SE_BASE + 261) -#define SEQ_SE_DP_CON_004 (SNDARC_SE_BASE + 262) -#define SEQ_SE_DP_CON_005 (SNDARC_SE_BASE + 263) -#define SEQ_SE_DP_CON_006 (SNDARC_SE_BASE + 264) -#define SEQ_SE_DP_CON_007 (SNDARC_SE_BASE + 265) -#define SEQ_SE_DP_CON_009 (SNDARC_SE_BASE + 266) -#define SEQ_SE_DP_CON_010 (SNDARC_SE_BASE + 267) -#define SEQ_SE_DP_CON_011 (SNDARC_SE_BASE + 268) -#define SEQ_SE_DP_CON_012 (SNDARC_SE_BASE + 269) -#define SEQ_SE_DP_CON_013 (SNDARC_SE_BASE + 270) -#define SEQ_SE_DP_CON_018 (SNDARC_SE_BASE + 271) -#define SEQ_SE_DP_CON_019 (SNDARC_SE_BASE + 272) -#define SEQ_SE_DP_CON_020 (SNDARC_SE_BASE + 273) -#define SEQ_SE_DP_CON_021 (SNDARC_SE_BASE + 274) -#define SEQ_SE_DP_CON_022 (SNDARC_SE_BASE + 275) -#define SEQ_SE_DP_CON_023 (SNDARC_SE_BASE + 276) -#define SEQ_SE_DP_CON_024 (SNDARC_SE_BASE + 277) -#define SEQ_SE_DP_CON_026 (SNDARC_SE_BASE + 278) -#define SEQ_SE_DP_CON_027_2 (SNDARC_SE_BASE + 279) -#define SEQ_SE_DP_CON_027_3 (SNDARC_SE_BASE + 280) -#define SEQ_SE_DP_CON_028 (SNDARC_SE_BASE + 281) -#define SEQ_SE_DP_CON_029 (SNDARC_SE_BASE + 282) -#define SEQ_SE_DP_CON_030 (SNDARC_SE_BASE + 283) -#define SEQ_SE_DP_CON_031 (SNDARC_SE_BASE + 284) -#define SEQ_SE_DP_CON_032 (SNDARC_SE_BASE + 285) -#define SEQ_SE_DP_CON_033 (SNDARC_SE_BASE + 286) -#define SEQ_SE_DP_CON_034 (SNDARC_SE_BASE + 287) -#define SEQ_SE_DP_KOUKA_H (SNDARC_SE_BASE + 288) -#define SEQ_SE_DP_KOUKA_L (SNDARC_SE_BASE + 289) -#define SEQ_SE_DP_KOUKA_M (SNDARC_SE_BASE + 290) -#define SEQ_SE_DP_NIGERU2 (SNDARC_SE_BASE + 291) -#define SEQ_SE_DP_NIGERU (SNDARC_SE_BASE + 292) -#define SEQ_SE_DP_POKE_DEAD (SNDARC_SE_BASE + 293) -#define SEQ_SE_DP_POKE_DEAD2 (SNDARC_SE_BASE + 294) -#define SEQ_SE_DP_POKE_DEAD3 (SNDARC_SE_BASE + 295) -#define SEQ_SE_DP_HINSI (SNDARC_SE_BASE + 296) -#define SEQ_SE_DP_SUIKOMU (SNDARC_SE_BASE + 297) -#define SEQ_SE_DP_BOWA2 (SNDARC_SE_BASE + 298) -#define SEQ_SE_DP_BOWA3 (SNDARC_SE_BASE + 299) -#define SEQ_SE_DP_BOWA4 (SNDARC_SE_BASE + 300) -#define SEQ_SE_DP_GETTING (SNDARC_SE_BASE + 301) -#define SEQ_SE_DP_NAGERU (SNDARC_SE_BASE + 302) -#define SEQ_SE_DP_EXP (SNDARC_SE_BASE + 303) -#define SEQ_SE_DP_EXPMAX (SNDARC_SE_BASE + 304) -#define SEQ_SE_DP_EXPMAX2 (SNDARC_SE_BASE + 305) -#define SEQ_SE_DP_SLIDEIN (SNDARC_SE_BASE + 306) -#define SEQ_SE_DP_BT_001 (SNDARC_SE_BASE + 307) -#define SEQ_SE_DP_REAPOKE (SNDARC_SE_BASE + 308) -#define SEQ_SE_DP_TB_START (SNDARC_SE_BASE + 309) -#define SEQ_SE_DP_TB_KON (SNDARC_SE_BASE + 310) -#define SEQ_SE_DP_TB_KARA (SNDARC_SE_BASE + 311) -#define SEQ_SE_DP_EGG01 (SNDARC_SE_BASE + 312) -#define SEQ_SE_DP_VSDEMO01 (SNDARC_SE_BASE + 313) -#define SEQ_SE_DP_VSDEMO02 (SNDARC_SE_BASE + 314) -#define SEQ_SE_DP_VSDEMO03 (SNDARC_SE_BASE + 315) -#define SEQ_SE_DP_VSDEMO04 (SNDARC_SE_BASE + 316) -#define SEQ_SE_DP_VSDEMO05 (SNDARC_SE_BASE + 317) -#define SEQ_SE_DP_VSDEMO06 (SNDARC_SE_BASE + 318) -#define SEQ_SE_DP_VSDEMO07 (SNDARC_SE_BASE + 319) -#define SEQ_SE_DP_000 (SNDARC_SE_BASE + 320) -#define SEQ_SE_DP_001 (SNDARC_SE_BASE + 321) -#define SEQ_SE_DP_003 (SNDARC_SE_BASE + 322) -#define SEQ_SE_DP_007 (SNDARC_SE_BASE + 323) -#define SEQ_SE_DP_020 (SNDARC_SE_BASE + 324) -#define SEQ_SE_DP_021 (SNDARC_SE_BASE + 325) -#define SEQ_SE_DP_023 (SNDARC_SE_BASE + 326) -#define SEQ_SE_DP_030 (SNDARC_SE_BASE + 327) -#define SEQ_SE_DP_030C (SNDARC_SE_BASE + 328) -#define SEQ_SE_DP_031 (SNDARC_SE_BASE + 329) -#define SEQ_SE_DP_032 (SNDARC_SE_BASE + 330) -#define SEQ_SE_DP_040 (SNDARC_SE_BASE + 331) -#define SEQ_SE_DP_041 (SNDARC_SE_BASE + 332) -#define SEQ_SE_DP_050 (SNDARC_SE_BASE + 333) -#define SEQ_SE_DP_051 (SNDARC_SE_BASE + 334) -#define SEQ_SE_DP_052 (SNDARC_SE_BASE + 335) -#define SEQ_SE_DP_053 (SNDARC_SE_BASE + 336) -#define SEQ_SE_DP_060 (SNDARC_SE_BASE + 337) -#define SEQ_SE_DP_061 (SNDARC_SE_BASE + 338) -#define SEQ_SE_DP_080 (SNDARC_SE_BASE + 339) -#define SEQ_SE_DP_081 (SNDARC_SE_BASE + 340) -#define SEQ_SE_DP_100 (SNDARC_SE_BASE + 341) -#define SEQ_SE_DP_110 (SNDARC_SE_BASE + 342) -#define SEQ_SE_DP_111 (SNDARC_SE_BASE + 343) -#define SEQ_SE_DP_112 (SNDARC_SE_BASE + 344) -#define SEQ_SE_DP_130 (SNDARC_SE_BASE + 345) -#define SEQ_SE_DP_131 (SNDARC_SE_BASE + 346) -#define SEQ_SE_DP_140 (SNDARC_SE_BASE + 347) -#define SEQ_SE_DP_141 (SNDARC_SE_BASE + 348) -#define SEQ_SE_DP_143 (SNDARC_SE_BASE + 349) -#define SEQ_SE_DP_145 (SNDARC_SE_BASE + 350) -#define SEQ_SE_DP_146 (SNDARC_SE_BASE + 351) -#define SEQ_SE_DP_150 (SNDARC_SE_BASE + 352) -#define SEQ_SE_DP_151 (SNDARC_SE_BASE + 353) -#define SEQ_SE_DP_152 (SNDARC_SE_BASE + 354) -#define SEQ_SE_DP_153 (SNDARC_SE_BASE + 355) -#define SEQ_SE_DP_154 (SNDARC_SE_BASE + 356) -#define SEQ_SE_DP_155 (SNDARC_SE_BASE + 357) -#define SEQ_SE_DP_160 (SNDARC_SE_BASE + 358) -#define SEQ_SE_DP_161 (SNDARC_SE_BASE + 359) -#define SEQ_SE_DP_162 (SNDARC_SE_BASE + 360) -#define SEQ_SE_DP_163 (SNDARC_SE_BASE + 361) -#define SEQ_SE_DP_164 (SNDARC_SE_BASE + 362) -#define SEQ_SE_DP_165 (SNDARC_SE_BASE + 363) -#define SEQ_SE_DP_166 (SNDARC_SE_BASE + 364) -#define SEQ_SE_DP_170 (SNDARC_SE_BASE + 365) -#define SEQ_SE_DP_171 (SNDARC_SE_BASE + 366) -#define SEQ_SE_DP_172 (SNDARC_SE_BASE + 367) -#define SEQ_SE_DP_180 (SNDARC_SE_BASE + 368) -#define SEQ_SE_DP_181 (SNDARC_SE_BASE + 369) -#define SEQ_SE_DP_182 (SNDARC_SE_BASE + 370) -#define SEQ_SE_DP_183 (SNDARC_SE_BASE + 371) -#define SEQ_SE_DP_184 (SNDARC_SE_BASE + 372) -#define SEQ_SE_DP_185 (SNDARC_SE_BASE + 373) -#define SEQ_SE_DP_186 (SNDARC_SE_BASE + 374) -#define SEQ_SE_DP_187 (SNDARC_SE_BASE + 375) -#define SEQ_SE_DP_200 (SNDARC_SE_BASE + 376) -#define SEQ_SE_DP_201 (SNDARC_SE_BASE + 377) -#define SEQ_SE_DP_202 (SNDARC_SE_BASE + 378) -#define SEQ_SE_DP_203 (SNDARC_SE_BASE + 379) -#define SEQ_SE_DP_204 (SNDARC_SE_BASE + 380) -#define SEQ_SE_DP_205 (SNDARC_SE_BASE + 381) -#define SEQ_SE_DP_206 (SNDARC_SE_BASE + 382) -#define SEQ_SE_DP_207 (SNDARC_SE_BASE + 383) -#define SEQ_SE_DP_208 (SNDARC_SE_BASE + 384) -#define SEQ_SE_DP_209 (SNDARC_SE_BASE + 385) -#define SEQ_SE_DP_210 (SNDARC_SE_BASE + 386) -#define SEQ_SE_DP_211 (SNDARC_SE_BASE + 387) -#define SEQ_SE_DP_212 (SNDARC_SE_BASE + 388) -#define SEQ_SE_DP_213 (SNDARC_SE_BASE + 389) -#define SEQ_SE_DP_214 (SNDARC_SE_BASE + 390) -#define SEQ_SE_DP_280 (SNDARC_SE_BASE + 391) -#define SEQ_SE_DP_281 (SNDARC_SE_BASE + 392) -#define SEQ_SE_DP_282 (SNDARC_SE_BASE + 393) -#define SEQ_SE_DP_290 (SNDARC_SE_BASE + 394) -#define SEQ_SE_DP_291 (SNDARC_SE_BASE + 395) -#define SEQ_SE_DP_293 (SNDARC_SE_BASE + 396) -#define SEQ_SE_DP_300 (SNDARC_SE_BASE + 397) -#define SEQ_SE_DP_350 (SNDARC_SE_BASE + 398) -#define SEQ_SE_DP_351 (SNDARC_SE_BASE + 399) -#define SEQ_SE_DP_400 (SNDARC_SE_BASE + 400) -#define SEQ_SE_DP_401 (SNDARC_SE_BASE + 401) -#define SEQ_SE_DP_402 (SNDARC_SE_BASE + 402) -#define SEQ_SE_DP_480 (SNDARC_SE_BASE + 403) -#define SEQ_SE_DP_W003 (SNDARC_SE_BASE + 404) -#define SEQ_SE_DP_W004 (SNDARC_SE_BASE + 405) -#define SEQ_SE_DP_W006 (SNDARC_SE_BASE + 406) -#define SEQ_SE_DP_W007 (SNDARC_SE_BASE + 407) -#define SEQ_SE_DP_W010 (SNDARC_SE_BASE + 408) -#define SEQ_SE_DP_W011 (SNDARC_SE_BASE + 409) -#define SEQ_SE_DP_W013 (SNDARC_SE_BASE + 410) -#define SEQ_SE_DP_W013B (SNDARC_SE_BASE + 411) -#define SEQ_SE_DP_W014 (SNDARC_SE_BASE + 412) -#define SEQ_SE_DP_W015 (SNDARC_SE_BASE + 413) -#define SEQ_SE_DP_W016 (SNDARC_SE_BASE + 414) -#define SEQ_SE_DP_W016B (SNDARC_SE_BASE + 415) -#define SEQ_SE_DP_W017 (SNDARC_SE_BASE + 416) -#define SEQ_SE_DP_W019 (SNDARC_SE_BASE + 417) -#define SEQ_SE_DP_W020 (SNDARC_SE_BASE + 418) -#define SEQ_SE_DP_W020B (SNDARC_SE_BASE + 419) -#define SEQ_SE_DP_W025B (SNDARC_SE_BASE + 420) -#define SEQ_SE_DP_W025C (SNDARC_SE_BASE + 421) -#define SEQ_SE_DP_W026 (SNDARC_SE_BASE + 422) -#define SEQ_SE_DP_W028 (SNDARC_SE_BASE + 423) -#define SEQ_SE_DP_W028B (SNDARC_SE_BASE + 424) -#define SEQ_SE_DP_W029 (SNDARC_SE_BASE + 425) -#define SEQ_SE_DP_W030 (SNDARC_SE_BASE + 426) -#define SEQ_SE_DP_W036 (SNDARC_SE_BASE + 427) -#define SEQ_SE_DP_W039 (SNDARC_SE_BASE + 428) -#define SEQ_SE_DP_W040 (SNDARC_SE_BASE + 429) -#define SEQ_SE_DP_W043 (SNDARC_SE_BASE + 430) -#define SEQ_SE_DP_W043B (SNDARC_SE_BASE + 431) -#define SEQ_SE_DP_W043C (SNDARC_SE_BASE + 432) -#define SEQ_SE_DP_W043D (SNDARC_SE_BASE + 433) -#define SEQ_SE_DP_W044 (SNDARC_SE_BASE + 434) -#define SEQ_SE_DP_W047 (SNDARC_SE_BASE + 435) -#define SEQ_SE_DP_W048 (SNDARC_SE_BASE + 436) -#define SEQ_SE_DP_W052 (SNDARC_SE_BASE + 437) -#define SEQ_SE_DP_W053 (SNDARC_SE_BASE + 438) -#define SEQ_SE_DP_W053B (SNDARC_SE_BASE + 439) -#define SEQ_SE_DP_W054 (SNDARC_SE_BASE + 440) -#define SEQ_SE_DP_W055 (SNDARC_SE_BASE + 441) -#define SEQ_SE_DP_W056 (SNDARC_SE_BASE + 442) -#define SEQ_SE_DP_W056B (SNDARC_SE_BASE + 443) -#define SEQ_SE_DP_W057 (SNDARC_SE_BASE + 444) -#define SEQ_SE_DP_W057B (SNDARC_SE_BASE + 445) -#define SEQ_SE_DP_W059 (SNDARC_SE_BASE + 446) -#define SEQ_SE_DP_W059B (SNDARC_SE_BASE + 447) -#define SEQ_SE_DP_W060 (SNDARC_SE_BASE + 448) -#define SEQ_SE_DP_W062D (SNDARC_SE_BASE + 449) -#define SEQ_SE_DP_W060B (SNDARC_SE_BASE + 450) -#define SEQ_SE_DP_W063 (SNDARC_SE_BASE + 451) -#define SEQ_SE_DP_W063B (SNDARC_SE_BASE + 452) -#define SEQ_SE_DP_W063C (SNDARC_SE_BASE + 453) -#define SEQ_SE_DP_W070 (SNDARC_SE_BASE + 454) -#define SEQ_SE_DP_W071 (SNDARC_SE_BASE + 455) -#define SEQ_SE_DP_W071B (SNDARC_SE_BASE + 456) -#define SEQ_SE_DP_W076 (SNDARC_SE_BASE + 457) -#define SEQ_SE_DP_W076B (SNDARC_SE_BASE + 458) -#define SEQ_SE_DP_W077 (SNDARC_SE_BASE + 459) -#define SEQ_SE_DP_W077B (SNDARC_SE_BASE + 460) -#define SEQ_SE_DP_W080B (SNDARC_SE_BASE + 461) -#define SEQ_SE_DP_W080C (SNDARC_SE_BASE + 462) -#define SEQ_SE_DP_W081 (SNDARC_SE_BASE + 463) -#define SEQ_SE_DP_W081B (SNDARC_SE_BASE + 464) -#define SEQ_SE_DP_W082 (SNDARC_SE_BASE + 465) -#define SEQ_SE_DP_W082B (SNDARC_SE_BASE + 466) -#define SEQ_SE_DP_W082C (SNDARC_SE_BASE + 467) -#define SEQ_SE_DP_W085 (SNDARC_SE_BASE + 468) -#define SEQ_SE_DP_W085B (SNDARC_SE_BASE + 469) -#define SEQ_SE_DP_W085C (SNDARC_SE_BASE + 470) -#define SEQ_SE_DP_W086 (SNDARC_SE_BASE + 471) -#define SEQ_SE_DP_W088 (SNDARC_SE_BASE + 472) -#define SEQ_SE_DP_W089 (SNDARC_SE_BASE + 473) -#define SEQ_SE_DP_W089B (SNDARC_SE_BASE + 474) -#define SEQ_SE_DP_W090 (SNDARC_SE_BASE + 475) -#define SEQ_SE_DP_W091 (SNDARC_SE_BASE + 476) -#define SEQ_SE_DP_W092 (SNDARC_SE_BASE + 477) -#define SEQ_SE_DP_W092B (SNDARC_SE_BASE + 478) -#define SEQ_SE_DP_W092D (SNDARC_SE_BASE + 479) -#define SEQ_SE_DP_W100 (SNDARC_SE_BASE + 480) -#define SEQ_SE_DP_W100B (SNDARC_SE_BASE + 481) -#define SEQ_SE_DP_W103 (SNDARC_SE_BASE + 482) -#define SEQ_SE_DP_W104 (SNDARC_SE_BASE + 483) -#define SEQ_SE_DP_W107 (SNDARC_SE_BASE + 484) -#define SEQ_SE_DP_W109 (SNDARC_SE_BASE + 485) -#define SEQ_SE_DP_W109B (SNDARC_SE_BASE + 486) -#define SEQ_SE_DP_W112 (SNDARC_SE_BASE + 487) -#define SEQ_SE_DP_W112B (SNDARC_SE_BASE + 488) -#define SEQ_SE_DP_W114 (SNDARC_SE_BASE + 489) -#define SEQ_SE_DP_W115 (SNDARC_SE_BASE + 490) -#define SEQ_SE_DP_W118 (SNDARC_SE_BASE + 491) -#define SEQ_SE_DP_W118B (SNDARC_SE_BASE + 492) -#define SEQ_SE_DP_W120 (SNDARC_SE_BASE + 493) -#define SEQ_SE_DP_W122 (SNDARC_SE_BASE + 494) -#define SEQ_SE_DP_W127 (SNDARC_SE_BASE + 495) -#define SEQ_SE_DP_W129 (SNDARC_SE_BASE + 496) -#define SEQ_SE_DP_W145 (SNDARC_SE_BASE + 497) -#define SEQ_SE_DP_W145B (SNDARC_SE_BASE + 498) -#define SEQ_SE_DP_W145C (SNDARC_SE_BASE + 499) -#define SEQ_SE_DP_W145D (SNDARC_SE_BASE + 500) -#define SEQ_SE_DP_W146 (SNDARC_SE_BASE + 501) -#define SEQ_SE_DP_W151 (SNDARC_SE_BASE + 502) -#define SEQ_SE_DP_W152 (SNDARC_SE_BASE + 503) -#define SEQ_SE_DP_W153 (SNDARC_SE_BASE + 504) -#define SEQ_SE_DP_W155 (SNDARC_SE_BASE + 505) -#define SEQ_SE_DP_W161 (SNDARC_SE_BASE + 506) -#define SEQ_SE_DP_W161B (SNDARC_SE_BASE + 507) -#define SEQ_SE_DP_W166 (SNDARC_SE_BASE + 508) -#define SEQ_SE_DP_W171 (SNDARC_SE_BASE + 509) -#define SEQ_SE_DP_W172 (SNDARC_SE_BASE + 510) -#define SEQ_SE_DP_W172B (SNDARC_SE_BASE + 511) -#define SEQ_SE_DP_W173 (SNDARC_SE_BASE + 512) -#define SEQ_SE_DP_W173B (SNDARC_SE_BASE + 513) -#define SEQ_SE_DP_W173C (SNDARC_SE_BASE + 514) -#define SEQ_SE_DP_W179 (SNDARC_SE_BASE + 515) -#define SEQ_SE_DP_W185 (SNDARC_SE_BASE + 516) -#define SEQ_SE_DP_W187 (SNDARC_SE_BASE + 517) -#define SEQ_SE_DP_W195 (SNDARC_SE_BASE + 518) -#define SEQ_SE_DP_W196 (SNDARC_SE_BASE + 519) -#define SEQ_SE_DP_W197 (SNDARC_SE_BASE + 520) -#define SEQ_SE_DP_W199 (SNDARC_SE_BASE + 521) -#define SEQ_SE_DP_W201 (SNDARC_SE_BASE + 522) -#define SEQ_SE_DP_W202 (SNDARC_SE_BASE + 523) -#define SEQ_SE_DP_W202B (SNDARC_SE_BASE + 524) -#define SEQ_SE_DP_W204 (SNDARC_SE_BASE + 525) -#define SEQ_SE_DP_W207 (SNDARC_SE_BASE + 526) -#define SEQ_SE_DP_W207B (SNDARC_SE_BASE + 527) -#define SEQ_SE_DP_W207C (SNDARC_SE_BASE + 528) -#define SEQ_SE_DP_W207D (SNDARC_SE_BASE + 529) -#define SEQ_SE_DP_W208 (SNDARC_SE_BASE + 530) -#define SEQ_SE_DP_W209 (SNDARC_SE_BASE + 531) -#define SEQ_SE_DP_W213 (SNDARC_SE_BASE + 532) -#define SEQ_SE_DP_W215 (SNDARC_SE_BASE + 533) -#define SEQ_SE_DP_W221B (SNDARC_SE_BASE + 534) -#define SEQ_SE_DP_W227 (SNDARC_SE_BASE + 535) -#define SEQ_SE_DP_W227B (SNDARC_SE_BASE + 536) -#define SEQ_SE_DP_W230 (SNDARC_SE_BASE + 537) -#define SEQ_SE_DP_W231 (SNDARC_SE_BASE + 538) -#define SEQ_SE_DP_W233 (SNDARC_SE_BASE + 539) -#define SEQ_SE_DP_W233B (SNDARC_SE_BASE + 540) -#define SEQ_SE_DP_W234 (SNDARC_SE_BASE + 541) -#define SEQ_SE_DP_W236 (SNDARC_SE_BASE + 542) -#define SEQ_SE_DP_W239 (SNDARC_SE_BASE + 543) -#define SEQ_SE_DP_W240 (SNDARC_SE_BASE + 544) -#define SEQ_SE_DP_W250 (SNDARC_SE_BASE + 545) -#define SEQ_SE_DP_W253 (SNDARC_SE_BASE + 546) -#define SEQ_SE_DP_W255 (SNDARC_SE_BASE + 547) -#define SEQ_SE_DP_W255B (SNDARC_SE_BASE + 548) -#define SEQ_SE_DP_W255E (SNDARC_SE_BASE + 549) -#define SEQ_SE_DP_W255F (SNDARC_SE_BASE + 550) -#define SEQ_SE_DP_W257 (SNDARC_SE_BASE + 551) -#define SEQ_SE_DP_W258 (SNDARC_SE_BASE + 552) -#define SEQ_SE_DP_W260 (SNDARC_SE_BASE + 553) -#define SEQ_SE_DP_W278 (SNDARC_SE_BASE + 554) -#define SEQ_SE_DP_W280 (SNDARC_SE_BASE + 555) -#define SEQ_SE_DP_W280B (SNDARC_SE_BASE + 556) -#define SEQ_SE_DP_W281 (SNDARC_SE_BASE + 557) -#define SEQ_SE_DP_W287B (SNDARC_SE_BASE + 558) -#define SEQ_SE_DP_W287 (SNDARC_SE_BASE + 559) -#define SEQ_SE_DP_W291 (SNDARC_SE_BASE + 560) -#define SEQ_SE_DP_W298 (SNDARC_SE_BASE + 561) -#define SEQ_SE_DP_W320 (SNDARC_SE_BASE + 562) -#define SEQ_SE_DP_W322 (SNDARC_SE_BASE + 563) -#define SEQ_SE_DP_W327 (SNDARC_SE_BASE + 564) -#define SEQ_SE_DP_W356 (SNDARC_SE_BASE + 565) -#define SEQ_SE_DP_W360 (SNDARC_SE_BASE + 566) -#define SEQ_SE_DP_W360B (SNDARC_SE_BASE + 567) -#define SEQ_SE_DP_W360C (SNDARC_SE_BASE + 568) -#define SEQ_SE_DP_W361 (SNDARC_SE_BASE + 569) -#define SEQ_SE_DP_W362 (SNDARC_SE_BASE + 570) -#define SEQ_SE_DP_W363 (SNDARC_SE_BASE + 571) -#define SEQ_SE_DP_W367 (SNDARC_SE_BASE + 572) -#define SEQ_SE_DP_W368 (SNDARC_SE_BASE + 573) -#define SEQ_SE_DP_W373 (SNDARC_SE_BASE + 574) -#define SEQ_SE_DP_W374 (SNDARC_SE_BASE + 575) -#define SEQ_SE_DP_W375 (SNDARC_SE_BASE + 576) -#define SEQ_SE_DP_W376 (SNDARC_SE_BASE + 577) -#define SEQ_SE_DP_W376B (SNDARC_SE_BASE + 578) -#define SEQ_SE_DP_W377 (SNDARC_SE_BASE + 579) -#define SEQ_SE_DP_W379 (SNDARC_SE_BASE + 580) -#define SEQ_SE_DP_W380 (SNDARC_SE_BASE + 581) -#define SEQ_SE_DP_W381 (SNDARC_SE_BASE + 582) -#define SEQ_SE_DP_W383 (SNDARC_SE_BASE + 583) -#define SEQ_SE_DP_W387 (SNDARC_SE_BASE + 584) -#define SEQ_SE_DP_W392 (SNDARC_SE_BASE + 585) -#define SEQ_SE_DP_W399 (SNDARC_SE_BASE + 586) -#define SEQ_SE_DP_W405 (SNDARC_SE_BASE + 587) -#define SEQ_SE_DP_W408 (SNDARC_SE_BASE + 588) -#define SEQ_SE_DP_W411 (SNDARC_SE_BASE + 589) -#define SEQ_SE_DP_W412 (SNDARC_SE_BASE + 590) -#define SEQ_SE_DP_W413 (SNDARC_SE_BASE + 591) -#define SEQ_SE_DP_W419 (SNDARC_SE_BASE + 592) -#define SEQ_SE_DP_W426 (SNDARC_SE_BASE + 593) -#define SEQ_SE_DP_W428 (SNDARC_SE_BASE + 594) -#define SEQ_SE_DP_W434 (SNDARC_SE_BASE + 595) -#define SEQ_SE_DP_W436 (SNDARC_SE_BASE + 596) -#define SEQ_SE_DP_W443B (SNDARC_SE_BASE + 597) -#define SEQ_SE_DP_W452 (SNDARC_SE_BASE + 598) -#define SEQ_SE_DP_W456 (SNDARC_SE_BASE + 599) -#define SEQ_SE_DP_W459 (SNDARC_SE_BASE + 600) -#define SEQ_SE_DP_W460 (SNDARC_SE_BASE + 601) -#define SEQ_SE_DP_W461 (SNDARC_SE_BASE + 602) -#define SEQ_SE_DP_W462 (SNDARC_SE_BASE + 603) -#define SEQ_SE_DP_W463 (SNDARC_SE_BASE + 604) -#define SEQ_SE_DP_W464 (SNDARC_SE_BASE + 605) -#define SEQ_SE_DP_W465 (SNDARC_SE_BASE + 606) -#define SEQ_SE_DP_W466 (SNDARC_SE_BASE + 607) -#define SEQ_SE_DP_W467 (SNDARC_SE_BASE + 608) -#define SEQ_SE_DP_SUIRYU (SNDARC_SE_BASE + 609) -#define SEQ_SE_DP_KIRAKIRA2 (SNDARC_SE_BASE + 610) -#define SEQ_SE_DP_BAN (SNDARC_SE_BASE + 611) -#define SEQ_SE_DP_BASABASA (SNDARC_SE_BASE + 612) -#define SEQ_SE_DP_SHUSHU (SNDARC_SE_BASE + 613) -#define SEQ_SE_DP_KAMI (SNDARC_SE_BASE + 614) -#define SEQ_SE_DP_KAMI2 (SNDARC_SE_BASE + 615) -#define SEQ_SE_DP_BASI (SNDARC_SE_BASE + 616) -#define SEQ_SE_DP_AWA (SNDARC_SE_BASE + 617) -#define SEQ_SE_DP_NAMI (SNDARC_SE_BASE + 618) -#define SEQ_SE_DP_HURU (SNDARC_SE_BASE + 619) -#define SEQ_SE_DP_HURU2 (SNDARC_SE_BASE + 620) -#define SEQ_SE_DP_KAZE (SNDARC_SE_BASE + 621) -#define SEQ_SE_DP_KAZE2 (SNDARC_SE_BASE + 622) -#define SEQ_SE_DP_MUCHI (SNDARC_SE_BASE + 623) -#define SEQ_SE_DP_BRADE (SNDARC_SE_BASE + 624) -#define SEQ_SE_DP_BFBRADE (SNDARC_SE_BASE + 625) -#define SEQ_SE_DP_PASA (SNDARC_SE_BASE + 626) -#define SEQ_SE_DP_PASA2 (SNDARC_SE_BASE + 627) -#define SEQ_SE_DP_PASA3 (SNDARC_SE_BASE + 628) -#define SEQ_SE_DP_KIRAN (SNDARC_SE_BASE + 629) -#define SEQ_SE_DP_GASHIN (SNDARC_SE_BASE + 630) -#define SEQ_SE_DP_DODON (SNDARC_SE_BASE + 631) -#define SEQ_SE_END (SNDARC_SE_BASE + 632) +#define SEQ_PV001 (0) +#define SEQ_PV (1) +#define SEQ_PV_END (2) +#define SEQ_DUMMY (SNDARC_BGM_BASE + 0) +#define SEQ_SILENCE_FIELD (SNDARC_BGM_BASE + 1) +#define SEQ_SILENCE_DUNGEON (SNDARC_BGM_BASE + 2) +#define SEQ_TEST_TITLE (SNDARC_BGM_BASE + 3) +#define SEQ_TOWN01_D (SNDARC_BGM_BASE + 4) +#define SEQ_TOWN02_D (SNDARC_BGM_BASE + 5) +#define SEQ_TOWN03_D (SNDARC_BGM_BASE + 6) +#define SEQ_TOWN04_D (SNDARC_BGM_BASE + 7) +#define SEQ_TOWN06_D (SNDARC_BGM_BASE + 8) +#define SEQ_TOWN07_D (SNDARC_BGM_BASE + 9) +#define SEQ_CITY01_D (SNDARC_BGM_BASE + 10) +#define SEQ_CITY02_D (SNDARC_BGM_BASE + 11) +#define SEQ_CITY03_D (SNDARC_BGM_BASE + 12) +#define SEQ_CITY04_D (SNDARC_BGM_BASE + 13) +#define SEQ_CITY05_D (SNDARC_BGM_BASE + 14) +#define SEQ_CITY06_D (SNDARC_BGM_BASE + 15) +#define SEQ_CITY07_D (SNDARC_BGM_BASE + 16) +#define SEQ_CITY08_D (SNDARC_BGM_BASE + 17) +#define SEQ_CITY09_D (SNDARC_BGM_BASE + 18) +#define SEQ_CITY10_D (SNDARC_BGM_BASE + 19) +#define SEQ_CITY11_D (SNDARC_BGM_BASE + 20) +#define SEQ_ROAD_A_D (SNDARC_BGM_BASE + 21) +#define SEQ_ROAD_B_D (SNDARC_BGM_BASE + 22) +#define SEQ_ROAD_C_D (SNDARC_BGM_BASE + 23) +#define SEQ_ROAD_D_D (SNDARC_BGM_BASE + 24) +#define SEQ_ROAD_E_D (SNDARC_BGM_BASE + 25) +#define SEQ_ROAD_F_D (SNDARC_BGM_BASE + 26) +#define SEQ_ROAD_SNOW_D (SNDARC_BGM_BASE + 27) +#define SEQ_ROAD_BZA_D (SNDARC_BGM_BASE + 28) +#define SEQ_OPENING (SNDARC_BGM_BASE + 29) +#define SEQ_TV_HOUSOU (SNDARC_BGM_BASE + 30) +#define SEQ_TOWN05_D (SNDARC_BGM_BASE + 31) +#define SEQ_ROAD_BZB_D (SNDARC_BGM_BASE + 32) +#define SEQ_TOWN01_N (SNDARC_BGM_BASE + 33) +#define SEQ_TOWN02_N (SNDARC_BGM_BASE + 34) +#define SEQ_TOWN03_N (SNDARC_BGM_BASE + 35) +#define SEQ_TOWN04_N (SNDARC_BGM_BASE + 36) +#define SEQ_TOWN06_N (SNDARC_BGM_BASE + 37) +#define SEQ_TOWN07_N (SNDARC_BGM_BASE + 38) +#define SEQ_CITY01_N (SNDARC_BGM_BASE + 39) +#define SEQ_CITY02_N (SNDARC_BGM_BASE + 40) +#define SEQ_CITY03_N (SNDARC_BGM_BASE + 41) +#define SEQ_CITY04_N (SNDARC_BGM_BASE + 42) +#define SEQ_CITY05_N (SNDARC_BGM_BASE + 43) +#define SEQ_CITY06_N (SNDARC_BGM_BASE + 44) +#define SEQ_CITY07_N (SNDARC_BGM_BASE + 45) +#define SEQ_CITY08_N (SNDARC_BGM_BASE + 46) +#define SEQ_CITY09_N (SNDARC_BGM_BASE + 47) +#define SEQ_CITY10_N (SNDARC_BGM_BASE + 48) +#define SEQ_CITY11_N (SNDARC_BGM_BASE + 49) +#define SEQ_ROAD_A_N (SNDARC_BGM_BASE + 50) +#define SEQ_ROAD_B_N (SNDARC_BGM_BASE + 51) +#define SEQ_ROAD_C_N (SNDARC_BGM_BASE + 52) +#define SEQ_ROAD_D_N (SNDARC_BGM_BASE + 53) +#define SEQ_ROAD_E_N (SNDARC_BGM_BASE + 54) +#define SEQ_ROAD_F_N (SNDARC_BGM_BASE + 55) +#define SEQ_ROAD_SNOW_N (SNDARC_BGM_BASE + 56) +#define SEQ_ROAD_BZA_N (SNDARC_BGM_BASE + 57) +#define SEQ_TOWN05_N (SNDARC_BGM_BASE + 58) +#define SEQ_ROAD_BZB_N (SNDARC_BGM_BASE + 59) +#define SEQ_TANKOU (SNDARC_BGM_BASE + 60) +#define SEQ_HATANIGE (SNDARC_BGM_BASE + 61) +#define SEQ_D_01 (SNDARC_BGM_BASE + 62) +#define SEQ_D_02 (SNDARC_BGM_BASE + 63) +#define SEQ_D_03 (SNDARC_BGM_BASE + 64) +#define SEQ_D_RYAYHY (SNDARC_BGM_BASE + 65) +#define SEQ_D_KOUEN (SNDARC_BGM_BASE + 66) +#define SEQ_D_AGITO (SNDARC_BGM_BASE + 67) +#define SEQ_D_GINLOBBY (SNDARC_BGM_BASE + 68) +#define SEQ_D_SAFARI (SNDARC_BGM_BASE + 69) +#define SEQ_D_LAKE (SNDARC_BGM_BASE + 70) +#define SEQ_D_MOUNT1 (SNDARC_BGM_BASE + 71) +#define SEQ_D_MOUNT2 (SNDARC_BGM_BASE + 72) +#define SEQ_D_06 (SNDARC_BGM_BASE + 73) +#define SEQ_D_05 (SNDARC_BGM_BASE + 74) +#define SEQ_D_04 (SNDARC_BGM_BASE + 75) +#define SEQ_D_LEAGUE (SNDARC_BGM_BASE + 76) +#define SEQ_BLD_DENDO (SNDARC_BGM_BASE + 77) +#define SEQ_D_CROAD (SNDARC_BGM_BASE + 78) +#define SEQ_D_ICE (SNDARC_BGM_BASE + 79) +#define SEQ_D_SECRET (SNDARC_BGM_BASE + 80) +#define SEQ_D_UNKNOWN (SNDARC_BGM_BASE + 81) +#define SEQ_POKEPARK (SNDARC_BGM_BASE + 82) +#define SEQ_D_HARDMT (SNDARC_BGM_BASE + 83) +#define SEQ_BLD_LEGEND (SNDARC_BGM_BASE + 84) +#define SEQ_PC_01 (SNDARC_BGM_BASE + 85) +#define SEQ_PC_02 (SNDARC_BGM_BASE + 86) +#define SEQ_GYM (SNDARC_BGM_BASE + 87) +#define SEQ_KENKYUJO (SNDARC_BGM_BASE + 88) +#define SEQ_BLD_CON (SNDARC_BGM_BASE + 89) +#define SEQ_FS (SNDARC_BGM_BASE + 90) +#define SEQ_BLD_GAME (SNDARC_BGM_BASE + 91) +#define SEQ_BF_TOWWER (SNDARC_BGM_BASE + 92) +#define SEQ_BLD_TV (SNDARC_BGM_BASE + 93) +#define SEQ_THE_EVENT04 (SNDARC_BGM_BASE + 94) +#define SEQ_FUE (SNDARC_BGM_BASE + 95) +#define SEQ_AUS (SNDARC_BGM_BASE + 96) +#define SEQ_BLD_BLD_GTC (SNDARC_BGM_BASE + 97) +#define SEQ_OPENING2 (SNDARC_BGM_BASE + 98) +#define SEQ_BF_FACT (SNDARC_BGM_BASE + 99) +#define SEQ_EYE_BOY (SNDARC_BGM_BASE + 100) +#define SEQ_EYE_KID (SNDARC_BGM_BASE + 101) +#define SEQ_EYE_FIGHT (SNDARC_BGM_BASE + 102) +#define SEQ_EYE_GINGA (SNDARC_BGM_BASE + 103) +#define SEQ_EYE_LADY (SNDARC_BGM_BASE + 104) +#define SEQ_EYE_MOUNT (SNDARC_BGM_BASE + 105) +#define SEQ_EYE_RICH (SNDARC_BGM_BASE + 106) +#define SEQ_EYE_ENKA (SNDARC_BGM_BASE + 107) +#define SEQ_EYE_MYS (SNDARC_BGM_BASE + 108) +#define SEQ_EYE_ELITE (SNDARC_BGM_BASE + 109) +#define SEQ_EYE_GIRL (SNDARC_BGM_BASE + 110) +#define SEQ_EYE_SPORT (SNDARC_BGM_BASE + 111) +#define SEQ_EYE_FUN (SNDARC_BGM_BASE + 112) +#define SEQ_EYE_TENNO (SNDARC_BGM_BASE + 113) +#define SEQ_EYE_CHAMP (SNDARC_BGM_BASE + 114) +#define SEQ_FIGHT0101 (SNDARC_BGM_BASE + 115) +#define SEQ_BA_POKE (SNDARC_BGM_BASE + 116) +#define SEQ_BA_GYM (SNDARC_BGM_BASE + 117) +#define SEQ_BA_DPOKE1 (SNDARC_BGM_BASE + 118) +#define SEQ_BA_TRAIN (SNDARC_BGM_BASE + 119) +#define SEQ_BA_AKAGI (SNDARC_BGM_BASE + 120) +#define SEQ_BA_DPOKE2 (SNDARC_BGM_BASE + 121) +#define SEQ_BA_CHANP (SNDARC_BGM_BASE + 122) +#define SEQ_BA_GINGA (SNDARC_BGM_BASE + 123) +#define SEQ_BA_RIVAL (SNDARC_BGM_BASE + 124) +#define SEQ_BA_SECRET1 (SNDARC_BGM_BASE + 125) +#define SEQ_BA_SECRET2 (SNDARC_BGM_BASE + 126) +#define SEQ_WINPOKE (SNDARC_BGM_BASE + 127) +#define SEQ_WINTRAIN (SNDARC_BGM_BASE + 128) +#define SEQ_WINTGYM (SNDARC_BGM_BASE + 129) +#define SEQ_WINCHAMP (SNDARC_BGM_BASE + 130) +#define SEQ_WINGINGA (SNDARC_BGM_BASE + 131) +#define SEQ_WINAKAGI (SNDARC_BGM_BASE + 132) +#define SEQ_WINTENNO (SNDARC_BGM_BASE + 133) +#define SEQ_BA_GINGA3 (SNDARC_BGM_BASE + 134) +#define SEQ_CON_TEST (SNDARC_BGM_BASE + 135) +#define SEQ_BA_TENNO (SNDARC_BGM_BASE + 136) +#define SEQ_BA_TOWER (SNDARC_BGM_BASE + 137) +#define SEQ_TSURETEKE (SNDARC_BGM_BASE + 138) +#define SEQ_THE_RIV (SNDARC_BGM_BASE + 139) +#define SEQ_THE_EVENT01 (SNDARC_BGM_BASE + 140) +#define SEQ_SHINKA (SNDARC_BGM_BASE + 141) +#define SEQ_THE_BOY (SNDARC_BGM_BASE + 142) +#define SEQ_THE_GIRL (SNDARC_BGM_BASE + 143) +#define SEQ_THE_EVENT02 (SNDARC_BGM_BASE + 144) +#define SEQ_THE_EVENT03 (SNDARC_BGM_BASE + 145) +#define SEQ_THE_EVENT05 (SNDARC_BGM_BASE + 146) +#define SEQ_THE_AKAGI (SNDARC_BGM_BASE + 147) +#define SEQ_EV_DENDO1 (SNDARC_BGM_BASE + 148) +#define SEQ_EV_LEGEND (SNDARC_BGM_BASE + 149) +#define SEQ_KUSAGASA (SNDARC_BGM_BASE + 150) +#define SEQ_NAMINORI (SNDARC_BGM_BASE + 151) +#define SEQ_BICYCLE (SNDARC_BGM_BASE + 152) +#define SEQ_GONIN (SNDARC_BGM_BASE + 153) +#define SEQ_TV_END (SNDARC_BGM_BASE + 154) +#define SEQ_FANFA1 (SNDARC_BGM_BASE + 155) +#define SEQ_FANFA5 (SNDARC_BGM_BASE + 156) +#define SEQ_FANFA3 (SNDARC_BGM_BASE + 157) +#define SEQ_FANFA4 (SNDARC_BGM_BASE + 158) +#define SEQ_FANFA6 (SNDARC_BGM_BASE + 159) +#define SEQ_FANFA2 (SNDARC_BGM_BASE + 160) +#define SEQ_BADGE (SNDARC_BGM_BASE + 161) +#define SEQ_POCKETCH (SNDARC_BGM_BASE + 162) +#define SEQ_WAZA (SNDARC_BGM_BASE + 163) +#define SEQ_ACCE (SNDARC_BGM_BASE + 164) +#define SEQ_WASURE (SNDARC_BGM_BASE + 165) +#define SEQ_ASA (SNDARC_BGM_BASE + 166) +#define SEQ_KINOMI (SNDARC_BGM_BASE + 167) +#define SEQ_REPORT (SNDARC_BGM_BASE + 168) +#define SEQ_CO_DRESS (SNDARC_BGM_BASE + 169) +#define SEQ_KOUKAN (SNDARC_BGM_BASE + 170) +#define SEQ_BLD_EV_DENDO2 (SNDARC_BGM_BASE + 171) +#define SEQ_TITLE00 (SNDARC_BGM_BASE + 172) +#define SEQ_TITLE01 (SNDARC_BGM_BASE + 173) +#define SEQ_PRESENT (SNDARC_BGM_BASE + 174) +#define SEQ_WIFILOBBY (SNDARC_BGM_BASE + 175) +#define SEQ_CO_KAWAI (SNDARC_BGM_BASE + 176) +#define SEQ_CO_KASHI (SNDARC_BGM_BASE + 177) +#define SEQ_CO_UTSUK (SNDARC_BGM_BASE + 178) +#define SEQ_CO_TAKUMA (SNDARC_BGM_BASE + 179) +#define SEQ_CO_KAKKO (SNDARC_BGM_BASE + 180) +#define SEQ_CO_KEKKA (SNDARC_BGM_BASE + 181) +#define SEQ_CO_FANFA (SNDARC_BGM_BASE + 182) +#define SEQ_KINOMI1 (SNDARC_BGM_BASE + 183) +#define SEQ_SLOT_ATARI (SNDARC_BGM_BASE + 184) +#define SEQ_SLOT_OOATARI (SNDARC_BGM_BASE + 185) +#define SEQ_BLD_ENDING (SNDARC_BGM_BASE + 186) +#define SEQ_KINOMI2 (SNDARC_BGM_BASE + 187) +#define SEQ_SLOT (SNDARC_BGM_BASE + 188) +#define SEQ_AIF_FIELD (SNDARC_BGM_BASE + 189) +#define SEQ_AIF_DUNGEON (SNDARC_BGM_BASE + 190) +#define SEQ_AIF_BATTLE (SNDARC_BGM_BASE + 191) +#define SEQ_BGM_END (SNDARC_BGM_BASE + 192) +#define SEQ_SE_DP_SELECT (SNDARC_SE_BASE + 0) +#define SEQ_SE_DP_DECIDE (SNDARC_SE_BASE + 1) +#define SEQ_SE_DP_TALK2 (SNDARC_SE_BASE + 2) +#define SEQ_SE_DP_SELECT11 (SNDARC_SE_BASE + 3) +#define SEQ_SE_DP_SELECT78 (SNDARC_SE_BASE + 4) +#define SEQ_SE_DP_SELECT5 (SNDARC_SE_BASE + 5) +#define SEQ_SE_DP_PIRORIRO (SNDARC_SE_BASE + 6) +#define SEQ_SE_DP_PIRORIRO2 (SNDARC_SE_BASE + 7) +#define SEQ_SE_DP_BUTTON9 (SNDARC_SE_BASE + 8) +#define SEQ_SE_DP_BUTTON3 (SNDARC_SE_BASE + 9) +#define SEQ_SE_DP_KON (SNDARC_SE_BASE + 10) +#define SEQ_SE_DP_KON2 (SNDARC_SE_BASE + 11) +#define SEQ_SE_DP_KON3 (SNDARC_SE_BASE + 12) +#define SEQ_SE_DP_KON4 (SNDARC_SE_BASE + 13) +#define SEQ_SE_DP_BOX01 (SNDARC_SE_BASE + 14) +#define SEQ_SE_DP_BOX02 (SNDARC_SE_BASE + 15) +#define SEQ_SE_DP_KAIFUKU (SNDARC_SE_BASE + 16) +#define SEQ_SE_DP_ZUKAN02 (SNDARC_SE_BASE + 17) +#define SEQ_SE_DP_OPEN2 (SNDARC_SE_BASE + 18) +#define SEQ_SE_DP_CLOSE2 (SNDARC_SE_BASE + 19) +#define SEQ_SE_DP_025 (SNDARC_SE_BASE + 20) +#define SEQ_SE_DP_PINPON (SNDARC_SE_BASE + 21) +#define SEQ_SE_DP_CUSTOM06 (SNDARC_SE_BASE + 22) +#define SEQ_SE_DP_BOX03 (SNDARC_SE_BASE + 23) +#define SEQ_SE_DP_START (SNDARC_SE_BASE + 24) +#define SEQ_SE_DP_SELECT_SLOT (SNDARC_SE_BASE + 25) +#define SEQ_SE_DP_CARD10 (SNDARC_SE_BASE + 26) +#define SEQ_SE_DP_KATI (SNDARC_SE_BASE + 27) +#define SEQ_SE_DP_CON_014 (SNDARC_SE_BASE + 28) +#define SEQ_SE_DP_W025 (SNDARC_SE_BASE + 29) +#define SEQ_SE_DP_W060C (SNDARC_SE_BASE + 30) +#define SEQ_SE_DP_W062 (SNDARC_SE_BASE + 31) +#define SEQ_SE_DP_W080 (SNDARC_SE_BASE + 32) +#define SEQ_SE_DP_WIN_OPEN (SNDARC_SE_BASE + 33) +#define SEQ_SE_DP_BOWA (SNDARC_SE_BASE + 34) +#define SEQ_SE_DP_Z_SEARCH (SNDARC_SE_BASE + 35) +#define SEQ_SE_DP_CARD2 (SNDARC_SE_BASE + 36) +#define SEQ_SE_DP_WALL_HIT (SNDARC_SE_BASE + 37) +#define SEQ_SE_DP_WALL_HIT2 (SNDARC_SE_BASE + 38) +#define SEQ_SE_DP_KAIDAN2 (SNDARC_SE_BASE + 39) +#define SEQ_SE_DP_DOOR (SNDARC_SE_BASE + 40) +#define SEQ_SE_DP_DOOR_OPEN (SNDARC_SE_BASE + 41) +#define SEQ_SE_DP_DOOR_CLOSE (SNDARC_SE_BASE + 42) +#define SEQ_SE_DP_DOOR_CLOSE2 (SNDARC_SE_BASE + 43) +#define SEQ_SE_DP_DOOR10 (SNDARC_SE_BASE + 44) +#define SEQ_SE_DP_WIN_OPEN2 (SNDARC_SE_BASE + 45) +#define SEQ_SE_DP_WIN_OPEN3 (SNDARC_SE_BASE + 46) +#define SEQ_SE_DP_DANSA (SNDARC_SE_BASE + 47) +#define SEQ_SE_DP_PC_ON (SNDARC_SE_BASE + 48) +#define SEQ_SE_DP_PC_LOGIN (SNDARC_SE_BASE + 49) +#define SEQ_SE_DP_PC_LOGOFF (SNDARC_SE_BASE + 50) +#define SEQ_SE_DP_DENDOU (SNDARC_SE_BASE + 51) +#define SEQ_SE_DP_DOKU2 (SNDARC_SE_BASE + 52) +#define SEQ_SE_DP_ELEBETA (SNDARC_SE_BASE + 53) +#define SEQ_SE_DP_ELEBETA2 (SNDARC_SE_BASE + 54) +#define SEQ_SE_DP_ELEBETA3 (SNDARC_SE_BASE + 55) +#define SEQ_SE_DP_ELEBETA4 (SNDARC_SE_BASE + 56) +#define SEQ_SE_DP_ESUKA (SNDARC_SE_BASE + 57) +#define SEQ_SE_DP_TV_NOISE (SNDARC_SE_BASE + 58) +#define SEQ_SE_DP_JIHANKI (SNDARC_SE_BASE + 59) +#define SEQ_SE_DP_JITENSYA (SNDARC_SE_BASE + 60) +#define SEQ_SE_DP_GEAR (SNDARC_SE_BASE + 61) +#define SEQ_SE_DP_KI_GASYAN (SNDARC_SE_BASE + 62) +#define SEQ_SE_DP_SAVE (SNDARC_SE_BASE + 63) +#define SEQ_SE_DP_GEAR2 (SNDARC_SE_BASE + 64) +#define SEQ_SE_DP_SELECT8 (SNDARC_SE_BASE + 65) +#define SEQ_SE_DP_DORIRU (SNDARC_SE_BASE + 66) +#define SEQ_SE_DP_YUKIASHI (SNDARC_SE_BASE + 67) +#define SEQ_SE_DP_UG_005 (SNDARC_SE_BASE + 68) +#define SEQ_SE_DP_UG_006 (SNDARC_SE_BASE + 69) +#define SEQ_SE_DP_UG_007 (SNDARC_SE_BASE + 70) +#define SEQ_SE_DP_UG_008 (SNDARC_SE_BASE + 71) +#define SEQ_SE_DP_UG_020 (SNDARC_SE_BASE + 72) +#define SEQ_SE_DP_UG_021 (SNDARC_SE_BASE + 73) +#define SEQ_SE_DP_UG_022 (SNDARC_SE_BASE + 74) +#define SEQ_SE_DP_UG_023 (SNDARC_SE_BASE + 75) +#define SEQ_SE_DP_UG_024 (SNDARC_SE_BASE + 76) +#define SEQ_SE_DP_UG_025 (SNDARC_SE_BASE + 77) +#define SEQ_SE_DP_UG_026 (SNDARC_SE_BASE + 78) +#define SEQ_SE_DP_UG_027 (SNDARC_SE_BASE + 79) +#define SEQ_SE_DP_DENSI15 (SNDARC_SE_BASE + 80) +#define SEQ_SE_DP_DENSI16 (SNDARC_SE_BASE + 81) +#define SEQ_SE_DP_DENSI20 (SNDARC_SE_BASE + 82) +#define SEQ_SE_DP_PYUU (SNDARC_SE_BASE + 83) +#define SEQ_SE_DP_PYUU2 (SNDARC_SE_BASE + 84) +#define SEQ_SE_DP_SUTYA (SNDARC_SE_BASE + 85) +#define SEQ_SE_DP_GYURU (SNDARC_SE_BASE + 86) +#define SEQ_SE_DP_OPEN7 (SNDARC_SE_BASE + 87) +#define SEQ_SE_DP_CLOSE7 (SNDARC_SE_BASE + 88) +#define SEQ_SE_DP_ZIZIZI (SNDARC_SE_BASE + 89) +#define SEQ_SE_DP_MAZYO2 (SNDARC_SE_BASE + 90) +#define SEQ_SE_DP_MAZYO4 (SNDARC_SE_BASE + 91) +#define SEQ_SE_DP_BAG_004 (SNDARC_SE_BASE + 92) +#define SEQ_SE_DP_T_AME (SNDARC_SE_BASE + 93) +#define SEQ_SE_DP_T_KOAME (SNDARC_SE_BASE + 94) +#define SEQ_SE_DP_T_OOAME (SNDARC_SE_BASE + 95) +#define SEQ_SE_DP_T_KAMI (SNDARC_SE_BASE + 96) +#define SEQ_SE_DP_T_KAMI2 (SNDARC_SE_BASE + 97) +#define SEQ_SE_DP_HAMARU (SNDARC_SE_BASE + 98) +#define SEQ_SE_DP_GAGAGA (SNDARC_SE_BASE + 99) +#define SEQ_SE_DP_F017 (SNDARC_SE_BASE + 100) +#define SEQ_SE_DP_FOOT3_0 (SNDARC_SE_BASE + 101) +#define SEQ_SE_DP_FOOT3_1 (SNDARC_SE_BASE + 102) +#define SEQ_SE_DP_CON_016 (SNDARC_SE_BASE + 103) +#define SEQ_SE_DP_REGI (SNDARC_SE_BASE + 104) +#define SEQ_SE_DP_CON_F007 (SNDARC_SE_BASE + 105) +#define SEQ_SE_DP_CON_015 (SNDARC_SE_BASE + 106) +#define SEQ_SE_DP_SUTYA2 (SNDARC_SE_BASE + 107) +#define SEQ_SE_DP_FW230 (SNDARC_SE_BASE + 108) +#define SEQ_SE_DP_FW019 (SNDARC_SE_BASE + 109) +#define SEQ_SE_DP_FW088 (SNDARC_SE_BASE + 110) +#define SEQ_SE_DP_FW015 (SNDARC_SE_BASE + 111) +#define SEQ_SE_DP_FBRADE (SNDARC_SE_BASE + 112) +#define SEQ_SE_DP_FW463 (SNDARC_SE_BASE + 113) +#define SEQ_SE_DP_TELE (SNDARC_SE_BASE + 114) +#define SEQ_SE_DP_TELE2 (SNDARC_SE_BASE + 115) +#define SEQ_SE_DP_FW104 (SNDARC_SE_BASE + 116) +#define SEQ_SE_DP_ZUPO (SNDARC_SE_BASE + 117) +#define SEQ_SE_DP_ZUPO2 (SNDARC_SE_BASE + 118) +#define SEQ_SE_DP_KUSA (SNDARC_SE_BASE + 119) +#define SEQ_SE_DP_SUNA (SNDARC_SE_BASE + 120) +#define SEQ_SE_DP_MARSH_WALK (SNDARC_SE_BASE + 121) +#define SEQ_SE_DP_DANSA4 (SNDARC_SE_BASE + 122) +#define SEQ_SE_DP_DANSA5 (SNDARC_SE_BASE + 123) +#define SEQ_SE_DP_F209 (SNDARC_SE_BASE + 124) +#define SEQ_SE_DP_SUBERU (SNDARC_SE_BASE + 125) +#define SEQ_SE_DP_FW056 (SNDARC_SE_BASE + 126) +#define SEQ_SE_DP_FW291 (SNDARC_SE_BASE + 127) +#define SEQ_SE_DP_FW089 (SNDARC_SE_BASE + 128) +#define SEQ_SE_DP_FW452 (SNDARC_SE_BASE + 129) +#define SEQ_SE_DP_FW466 (SNDARC_SE_BASE + 130) +#define SEQ_SE_DP_F007 (SNDARC_SE_BASE + 131) +#define SEQ_SE_DP_FAWA (SNDARC_SE_BASE + 132) +#define SEQ_SE_DP_FPASA2 (SNDARC_SE_BASE + 133) +#define SEQ_SE_DP_FW367 (SNDARC_SE_BASE + 134) +#define SEQ_SE_DP_POKETCH_003 (SNDARC_SE_BASE + 135) +#define SEQ_SE_DP_POKETCH_004 (SNDARC_SE_BASE + 136) +#define SEQ_SE_DP_POKETCH_005 (SNDARC_SE_BASE + 137) +#define SEQ_SE_DP_POKETCH_006 (SNDARC_SE_BASE + 138) +#define SEQ_SE_DP_POKETCH_007 (SNDARC_SE_BASE + 139) +#define SEQ_SE_DP_POKETCH_009 (SNDARC_SE_BASE + 140) +#define SEQ_SE_DP_POKETCH_010 (SNDARC_SE_BASE + 141) +#define SEQ_SE_DP_POKETCH_011 (SNDARC_SE_BASE + 142) +#define SEQ_SE_DP_POKETCH_012 (SNDARC_SE_BASE + 143) +#define SEQ_SE_DP_POKETCH_013 (SNDARC_SE_BASE + 144) +#define SEQ_SE_DP_POKETCH_014 (SNDARC_SE_BASE + 145) +#define SEQ_SE_DP_BEEP (SNDARC_SE_BASE + 146) +#define SEQ_SE_DP_DENSI01 (SNDARC_SE_BASE + 147) +#define SEQ_SE_DP_DENSI02 (SNDARC_SE_BASE + 148) +#define SEQ_SE_DP_DENSI04 (SNDARC_SE_BASE + 149) +#define SEQ_SE_DP_DENSI05 (SNDARC_SE_BASE + 150) +#define SEQ_SE_DP_DENSI07 (SNDARC_SE_BASE + 151) +#define SEQ_SE_DP_DENSI08 (SNDARC_SE_BASE + 152) +#define SEQ_SE_DP_DENSI09 (SNDARC_SE_BASE + 153) +#define SEQ_SE_DP_DENSI10 (SNDARC_SE_BASE + 154) +#define SEQ_SE_DP_DENSI11 (SNDARC_SE_BASE + 155) +#define SEQ_SE_DP_DENSI12 (SNDARC_SE_BASE + 156) +#define SEQ_SE_DP_KASYA (SNDARC_SE_BASE + 157) +#define SEQ_SE_DP_PASO2 (SNDARC_SE_BASE + 158) +#define SEQ_SE_DP_TATA (SNDARC_SE_BASE + 159) +#define SEQ_SE_DP_UP (SNDARC_SE_BASE + 160) +#define SEQ_SE_DP_PASO (SNDARC_SE_BASE + 161) +#define SEQ_SE_DP_SYARAAN (SNDARC_SE_BASE + 162) +#define SEQ_SE_DP_TARARARAN (SNDARC_SE_BASE + 163) +#define SEQ_SE_DP_MAZYO (SNDARC_SE_BASE + 164) +#define SEQ_SE_DP_MAZYO3 (SNDARC_SE_BASE + 165) +#define SEQ_SE_DP_HYUN (SNDARC_SE_BASE + 166) +#define SEQ_SE_DP_HYUN2 (SNDARC_SE_BASE + 167) +#define SEQ_SE_DP_CON_017 (SNDARC_SE_BASE + 168) +#define SEQ_SE_DP_BUTTON01 (SNDARC_SE_BASE + 169) +#define SEQ_SE_DP_Z_PAGE (SNDARC_SE_BASE + 170) +#define SEQ_SE_DP_JOURO (SNDARC_SE_BASE + 171) +#define SEQ_SE_DP_PIKO (SNDARC_SE_BASE + 172) +#define SEQ_SE_DP_PIKO2 (SNDARC_SE_BASE + 173) +#define SEQ_SE_DP_ZUKAN01 (SNDARC_SE_BASE + 174) +#define SEQ_SE_DP_DENSI06 (SNDARC_SE_BASE + 175) +#define SEQ_SE_DP_DENSI17 (SNDARC_SE_BASE + 176) +#define SEQ_SE_DP_DENSI18 (SNDARC_SE_BASE + 177) +#define SEQ_SE_DP_DENSI19 (SNDARC_SE_BASE + 178) +#define SEQ_SE_DP_MEKURU (SNDARC_SE_BASE + 179) +#define SEQ_SE_DP_MEKURU2 (SNDARC_SE_BASE + 180) +#define SEQ_SE_DP_MEKURU3 (SNDARC_SE_BASE + 181) +#define SEQ_SE_DP_MIGAKU01 (SNDARC_SE_BASE + 182) +#define SEQ_SE_DP_MIGAKU02 (SNDARC_SE_BASE + 183) +#define SEQ_SE_DP_BADGE_C (SNDARC_SE_BASE + 184) +#define SEQ_SE_DP_CARD3 (SNDARC_SE_BASE + 185) +#define SEQ_SE_DP_CARD5 (SNDARC_SE_BASE + 186) +#define SEQ_SE_DP_CARD6 (SNDARC_SE_BASE + 187) +#define SEQ_SE_DP_CARD9 (SNDARC_SE_BASE + 188) +#define SEQ_SE_DP_CARD11 (SNDARC_SE_BASE + 189) +#define SEQ_SE_DP_KYU01 (SNDARC_SE_BASE + 190) +#define SEQ_SE_DP_NAMEIN_01 (SNDARC_SE_BASE + 191) +#define SEQ_SE_DP_SYU01 (SNDARC_SE_BASE + 192) +#define SEQ_SE_DP_SYU02 (SNDARC_SE_BASE + 193) +#define SEQ_SE_DP_SYU03 (SNDARC_SE_BASE + 194) +#define SEQ_SE_DP_DECIDE2 (SNDARC_SE_BASE + 195) +#define SEQ_SE_DP_POKELIST_001 (SNDARC_SE_BASE + 196) +#define SEQ_SE_DP_UG_001 (SNDARC_SE_BASE + 197) +#define SEQ_SE_DP_UG_002 (SNDARC_SE_BASE + 198) +#define SEQ_SE_DP_UG_003 (SNDARC_SE_BASE + 199) +#define SEQ_SE_DP_UG_004 (SNDARC_SE_BASE + 200) +#define SEQ_SE_DP_KIRAKIRA3 (SNDARC_SE_BASE + 201) +#define SEQ_SE_DP_KIRAKIRA (SNDARC_SE_BASE + 202) +#define SEQ_SE_DP_KIRAKIRA4 (SNDARC_SE_BASE + 203) +#define SEQ_SE_DP_KOUKAN01 (SNDARC_SE_BASE + 204) +#define SEQ_SE_DP_KOUKAN03 (SNDARC_SE_BASE + 205) +#define SEQ_SE_DP_KOUKAN04 (SNDARC_SE_BASE + 206) +#define SEQ_SE_DP_KOUKAN05 (SNDARC_SE_BASE + 207) +#define SEQ_SE_DP_KOUKAN06 (SNDARC_SE_BASE + 208) +#define SEQ_SE_DP_KOUKAN07 (SNDARC_SE_BASE + 209) +#define SEQ_SE_DP_KOUKAN08 (SNDARC_SE_BASE + 210) +#define SEQ_SE_DP_KOUKAN09 (SNDARC_SE_BASE + 211) +#define SEQ_SE_DP_KOUKAN10 (SNDARC_SE_BASE + 212) +#define SEQ_SE_DP_NM01 (SNDARC_SE_BASE + 213) +#define SEQ_SE_DP_NM02 (SNDARC_SE_BASE + 214) +#define SEQ_SE_DP_NM03 (SNDARC_SE_BASE + 215) +#define SEQ_SE_DP_NM03_2 (SNDARC_SE_BASE + 216) +#define SEQ_SE_DP_NM04 (SNDARC_SE_BASE + 217) +#define SEQ_SE_DP_NM04_2 (SNDARC_SE_BASE + 218) +#define SEQ_SE_DP_NM04_3 (SNDARC_SE_BASE + 219) +#define SEQ_SE_DP_NM05 (SNDARC_SE_BASE + 220) +#define SEQ_SE_DP_NM07 (SNDARC_SE_BASE + 221) +#define SEQ_SE_DP_NM07_2 (SNDARC_SE_BASE + 222) +#define SEQ_SE_DP_NM08 (SNDARC_SE_BASE + 223) +#define SEQ_SE_DP_NM09 (SNDARC_SE_BASE + 224) +#define SEQ_SE_DP_NM10 (SNDARC_SE_BASE + 225) +#define SEQ_SE_DP_NM10_2 (SNDARC_SE_BASE + 226) +#define SEQ_SE_DP_NM11 (SNDARC_SE_BASE + 227) +#define SEQ_SE_DP_NM12 (SNDARC_SE_BASE + 228) +#define SEQ_SE_DP_NM12_2 (SNDARC_SE_BASE + 229) +#define SEQ_SE_DP_NM13 (SNDARC_SE_BASE + 230) +#define SEQ_SE_DP_NM14 (SNDARC_SE_BASE + 231) +#define SEQ_SE_DP_CUSTOM01 (SNDARC_SE_BASE + 232) +#define SEQ_SE_DP_CUSTOM02 (SNDARC_SE_BASE + 233) +#define SEQ_SE_DP_CUSTOM05 (SNDARC_SE_BASE + 234) +#define SEQ_SE_DP_BAG_006 (SNDARC_SE_BASE + 235) +#define SEQ_SE_DP_BAG_011 (SNDARC_SE_BASE + 236) +#define SEQ_SE_DP_BAG_020 (SNDARC_SE_BASE + 237) +#define SEQ_SE_DP_BAG_030 (SNDARC_SE_BASE + 238) +#define SEQ_SE_DP_BAG_031 (SNDARC_SE_BASE + 239) +#define SEQ_SE_DP_GASA01 (SNDARC_SE_BASE + 240) +#define SEQ_SE_DP_GASA02 (SNDARC_SE_BASE + 241) +#define SEQ_SE_DP_GASA03 (SNDARC_SE_BASE + 242) +#define SEQ_SE_DP_CARD7 (SNDARC_SE_BASE + 243) +#define SEQ_SE_DP_SLOT01 (SNDARC_SE_BASE + 244) +#define SEQ_SE_DP_SLOT02 (SNDARC_SE_BASE + 245) +#define SEQ_SE_DP_CLIMAX01 (SNDARC_SE_BASE + 246) +#define SEQ_SE_DP_CLIMAX03 (SNDARC_SE_BASE + 247) +#define SEQ_SE_DP_CLIMAX06 (SNDARC_SE_BASE + 248) +#define SEQ_SE_DP_CLIMAX09 (SNDARC_SE_BASE + 249) +#define SEQ_SE_DP_CLIMAX10 (SNDARC_SE_BASE + 250) +#define SEQ_SE_DP_CLIMAX12 (SNDARC_SE_BASE + 251) +#define SEQ_SE_DP_CLIMAX15 (SNDARC_SE_BASE + 252) +#define SEQ_SE_DP_TRAIN02 (SNDARC_SE_BASE + 253) +#define SEQ_SE_DP_TRAIN03 (SNDARC_SE_BASE + 254) +#define SEQ_SE_DP_TRAIN04 (SNDARC_SE_BASE + 255) +#define SEQ_SE_DP_SHIP01 (SNDARC_SE_BASE + 256) +#define SEQ_SE_DP_SHIP02 (SNDARC_SE_BASE + 257) +#define SEQ_SE_DP_SHIP03 (SNDARC_SE_BASE + 258) +#define SEQ_SE_DP_CON_001 (SNDARC_SE_BASE + 259) +#define SEQ_SE_DP_CON_002 (SNDARC_SE_BASE + 260) +#define SEQ_SE_DP_CON_003 (SNDARC_SE_BASE + 261) +#define SEQ_SE_DP_CON_004 (SNDARC_SE_BASE + 262) +#define SEQ_SE_DP_CON_005 (SNDARC_SE_BASE + 263) +#define SEQ_SE_DP_CON_006 (SNDARC_SE_BASE + 264) +#define SEQ_SE_DP_CON_007 (SNDARC_SE_BASE + 265) +#define SEQ_SE_DP_CON_009 (SNDARC_SE_BASE + 266) +#define SEQ_SE_DP_CON_010 (SNDARC_SE_BASE + 267) +#define SEQ_SE_DP_CON_011 (SNDARC_SE_BASE + 268) +#define SEQ_SE_DP_CON_012 (SNDARC_SE_BASE + 269) +#define SEQ_SE_DP_CON_013 (SNDARC_SE_BASE + 270) +#define SEQ_SE_DP_CON_018 (SNDARC_SE_BASE + 271) +#define SEQ_SE_DP_CON_019 (SNDARC_SE_BASE + 272) +#define SEQ_SE_DP_CON_020 (SNDARC_SE_BASE + 273) +#define SEQ_SE_DP_CON_021 (SNDARC_SE_BASE + 274) +#define SEQ_SE_DP_CON_022 (SNDARC_SE_BASE + 275) +#define SEQ_SE_DP_CON_023 (SNDARC_SE_BASE + 276) +#define SEQ_SE_DP_CON_024 (SNDARC_SE_BASE + 277) +#define SEQ_SE_DP_CON_026 (SNDARC_SE_BASE + 278) +#define SEQ_SE_DP_CON_027_2 (SNDARC_SE_BASE + 279) +#define SEQ_SE_DP_CON_027_3 (SNDARC_SE_BASE + 280) +#define SEQ_SE_DP_CON_028 (SNDARC_SE_BASE + 281) +#define SEQ_SE_DP_CON_029 (SNDARC_SE_BASE + 282) +#define SEQ_SE_DP_CON_030 (SNDARC_SE_BASE + 283) +#define SEQ_SE_DP_CON_031 (SNDARC_SE_BASE + 284) +#define SEQ_SE_DP_CON_032 (SNDARC_SE_BASE + 285) +#define SEQ_SE_DP_CON_033 (SNDARC_SE_BASE + 286) +#define SEQ_SE_DP_CON_034 (SNDARC_SE_BASE + 287) +#define SEQ_SE_DP_KOUKA_H (SNDARC_SE_BASE + 288) +#define SEQ_SE_DP_KOUKA_L (SNDARC_SE_BASE + 289) +#define SEQ_SE_DP_KOUKA_M (SNDARC_SE_BASE + 290) +#define SEQ_SE_DP_NIGERU2 (SNDARC_SE_BASE + 291) +#define SEQ_SE_DP_NIGERU (SNDARC_SE_BASE + 292) +#define SEQ_SE_DP_POKE_DEAD (SNDARC_SE_BASE + 293) +#define SEQ_SE_DP_POKE_DEAD2 (SNDARC_SE_BASE + 294) +#define SEQ_SE_DP_POKE_DEAD3 (SNDARC_SE_BASE + 295) +#define SEQ_SE_DP_HINSI (SNDARC_SE_BASE + 296) +#define SEQ_SE_DP_SUIKOMU (SNDARC_SE_BASE + 297) +#define SEQ_SE_DP_BOWA2 (SNDARC_SE_BASE + 298) +#define SEQ_SE_DP_BOWA3 (SNDARC_SE_BASE + 299) +#define SEQ_SE_DP_BOWA4 (SNDARC_SE_BASE + 300) +#define SEQ_SE_DP_GETTING (SNDARC_SE_BASE + 301) +#define SEQ_SE_DP_NAGERU (SNDARC_SE_BASE + 302) +#define SEQ_SE_DP_EXP (SNDARC_SE_BASE + 303) +#define SEQ_SE_DP_EXPMAX (SNDARC_SE_BASE + 304) +#define SEQ_SE_DP_EXPMAX2 (SNDARC_SE_BASE + 305) +#define SEQ_SE_DP_SLIDEIN (SNDARC_SE_BASE + 306) +#define SEQ_SE_DP_BT_001 (SNDARC_SE_BASE + 307) +#define SEQ_SE_DP_REAPOKE (SNDARC_SE_BASE + 308) +#define SEQ_SE_DP_TB_START (SNDARC_SE_BASE + 309) +#define SEQ_SE_DP_TB_KON (SNDARC_SE_BASE + 310) +#define SEQ_SE_DP_TB_KARA (SNDARC_SE_BASE + 311) +#define SEQ_SE_DP_EGG01 (SNDARC_SE_BASE + 312) +#define SEQ_SE_DP_VSDEMO01 (SNDARC_SE_BASE + 313) +#define SEQ_SE_DP_VSDEMO02 (SNDARC_SE_BASE + 314) +#define SEQ_SE_DP_VSDEMO03 (SNDARC_SE_BASE + 315) +#define SEQ_SE_DP_VSDEMO04 (SNDARC_SE_BASE + 316) +#define SEQ_SE_DP_VSDEMO05 (SNDARC_SE_BASE + 317) +#define SEQ_SE_DP_VSDEMO06 (SNDARC_SE_BASE + 318) +#define SEQ_SE_DP_VSDEMO07 (SNDARC_SE_BASE + 319) +#define SEQ_SE_DP_000 (SNDARC_SE_BASE + 320) +#define SEQ_SE_DP_001 (SNDARC_SE_BASE + 321) +#define SEQ_SE_DP_003 (SNDARC_SE_BASE + 322) +#define SEQ_SE_DP_007 (SNDARC_SE_BASE + 323) +#define SEQ_SE_DP_020 (SNDARC_SE_BASE + 324) +#define SEQ_SE_DP_021 (SNDARC_SE_BASE + 325) +#define SEQ_SE_DP_023 (SNDARC_SE_BASE + 326) +#define SEQ_SE_DP_030 (SNDARC_SE_BASE + 327) +#define SEQ_SE_DP_030C (SNDARC_SE_BASE + 328) +#define SEQ_SE_DP_031 (SNDARC_SE_BASE + 329) +#define SEQ_SE_DP_032 (SNDARC_SE_BASE + 330) +#define SEQ_SE_DP_040 (SNDARC_SE_BASE + 331) +#define SEQ_SE_DP_041 (SNDARC_SE_BASE + 332) +#define SEQ_SE_DP_050 (SNDARC_SE_BASE + 333) +#define SEQ_SE_DP_051 (SNDARC_SE_BASE + 334) +#define SEQ_SE_DP_052 (SNDARC_SE_BASE + 335) +#define SEQ_SE_DP_053 (SNDARC_SE_BASE + 336) +#define SEQ_SE_DP_060 (SNDARC_SE_BASE + 337) +#define SEQ_SE_DP_061 (SNDARC_SE_BASE + 338) +#define SEQ_SE_DP_080 (SNDARC_SE_BASE + 339) +#define SEQ_SE_DP_081 (SNDARC_SE_BASE + 340) +#define SEQ_SE_DP_100 (SNDARC_SE_BASE + 341) +#define SEQ_SE_DP_110 (SNDARC_SE_BASE + 342) +#define SEQ_SE_DP_111 (SNDARC_SE_BASE + 343) +#define SEQ_SE_DP_112 (SNDARC_SE_BASE + 344) +#define SEQ_SE_DP_130 (SNDARC_SE_BASE + 345) +#define SEQ_SE_DP_131 (SNDARC_SE_BASE + 346) +#define SEQ_SE_DP_140 (SNDARC_SE_BASE + 347) +#define SEQ_SE_DP_141 (SNDARC_SE_BASE + 348) +#define SEQ_SE_DP_143 (SNDARC_SE_BASE + 349) +#define SEQ_SE_DP_145 (SNDARC_SE_BASE + 350) +#define SEQ_SE_DP_146 (SNDARC_SE_BASE + 351) +#define SEQ_SE_DP_150 (SNDARC_SE_BASE + 352) +#define SEQ_SE_DP_151 (SNDARC_SE_BASE + 353) +#define SEQ_SE_DP_152 (SNDARC_SE_BASE + 354) +#define SEQ_SE_DP_153 (SNDARC_SE_BASE + 355) +#define SEQ_SE_DP_154 (SNDARC_SE_BASE + 356) +#define SEQ_SE_DP_155 (SNDARC_SE_BASE + 357) +#define SEQ_SE_DP_160 (SNDARC_SE_BASE + 358) +#define SEQ_SE_DP_161 (SNDARC_SE_BASE + 359) +#define SEQ_SE_DP_162 (SNDARC_SE_BASE + 360) +#define SEQ_SE_DP_163 (SNDARC_SE_BASE + 361) +#define SEQ_SE_DP_164 (SNDARC_SE_BASE + 362) +#define SEQ_SE_DP_165 (SNDARC_SE_BASE + 363) +#define SEQ_SE_DP_166 (SNDARC_SE_BASE + 364) +#define SEQ_SE_DP_170 (SNDARC_SE_BASE + 365) +#define SEQ_SE_DP_171 (SNDARC_SE_BASE + 366) +#define SEQ_SE_DP_172 (SNDARC_SE_BASE + 367) +#define SEQ_SE_DP_180 (SNDARC_SE_BASE + 368) +#define SEQ_SE_DP_181 (SNDARC_SE_BASE + 369) +#define SEQ_SE_DP_182 (SNDARC_SE_BASE + 370) +#define SEQ_SE_DP_183 (SNDARC_SE_BASE + 371) +#define SEQ_SE_DP_184 (SNDARC_SE_BASE + 372) +#define SEQ_SE_DP_185 (SNDARC_SE_BASE + 373) +#define SEQ_SE_DP_186 (SNDARC_SE_BASE + 374) +#define SEQ_SE_DP_187 (SNDARC_SE_BASE + 375) +#define SEQ_SE_DP_200 (SNDARC_SE_BASE + 376) +#define SEQ_SE_DP_201 (SNDARC_SE_BASE + 377) +#define SEQ_SE_DP_202 (SNDARC_SE_BASE + 378) +#define SEQ_SE_DP_203 (SNDARC_SE_BASE + 379) +#define SEQ_SE_DP_204 (SNDARC_SE_BASE + 380) +#define SEQ_SE_DP_205 (SNDARC_SE_BASE + 381) +#define SEQ_SE_DP_206 (SNDARC_SE_BASE + 382) +#define SEQ_SE_DP_207 (SNDARC_SE_BASE + 383) +#define SEQ_SE_DP_208 (SNDARC_SE_BASE + 384) +#define SEQ_SE_DP_209 (SNDARC_SE_BASE + 385) +#define SEQ_SE_DP_210 (SNDARC_SE_BASE + 386) +#define SEQ_SE_DP_211 (SNDARC_SE_BASE + 387) +#define SEQ_SE_DP_212 (SNDARC_SE_BASE + 388) +#define SEQ_SE_DP_213 (SNDARC_SE_BASE + 389) +#define SEQ_SE_DP_214 (SNDARC_SE_BASE + 390) +#define SEQ_SE_DP_280 (SNDARC_SE_BASE + 391) +#define SEQ_SE_DP_281 (SNDARC_SE_BASE + 392) +#define SEQ_SE_DP_282 (SNDARC_SE_BASE + 393) +#define SEQ_SE_DP_290 (SNDARC_SE_BASE + 394) +#define SEQ_SE_DP_291 (SNDARC_SE_BASE + 395) +#define SEQ_SE_DP_293 (SNDARC_SE_BASE + 396) +#define SEQ_SE_DP_300 (SNDARC_SE_BASE + 397) +#define SEQ_SE_DP_350 (SNDARC_SE_BASE + 398) +#define SEQ_SE_DP_351 (SNDARC_SE_BASE + 399) +#define SEQ_SE_DP_400 (SNDARC_SE_BASE + 400) +#define SEQ_SE_DP_401 (SNDARC_SE_BASE + 401) +#define SEQ_SE_DP_402 (SNDARC_SE_BASE + 402) +#define SEQ_SE_DP_480 (SNDARC_SE_BASE + 403) +#define SEQ_SE_DP_W003 (SNDARC_SE_BASE + 404) +#define SEQ_SE_DP_W004 (SNDARC_SE_BASE + 405) +#define SEQ_SE_DP_W006 (SNDARC_SE_BASE + 406) +#define SEQ_SE_DP_W007 (SNDARC_SE_BASE + 407) +#define SEQ_SE_DP_W010 (SNDARC_SE_BASE + 408) +#define SEQ_SE_DP_W011 (SNDARC_SE_BASE + 409) +#define SEQ_SE_DP_W013 (SNDARC_SE_BASE + 410) +#define SEQ_SE_DP_W013B (SNDARC_SE_BASE + 411) +#define SEQ_SE_DP_W014 (SNDARC_SE_BASE + 412) +#define SEQ_SE_DP_W015 (SNDARC_SE_BASE + 413) +#define SEQ_SE_DP_W016 (SNDARC_SE_BASE + 414) +#define SEQ_SE_DP_W016B (SNDARC_SE_BASE + 415) +#define SEQ_SE_DP_W017 (SNDARC_SE_BASE + 416) +#define SEQ_SE_DP_W019 (SNDARC_SE_BASE + 417) +#define SEQ_SE_DP_W020 (SNDARC_SE_BASE + 418) +#define SEQ_SE_DP_W020B (SNDARC_SE_BASE + 419) +#define SEQ_SE_DP_W025B (SNDARC_SE_BASE + 420) +#define SEQ_SE_DP_W025C (SNDARC_SE_BASE + 421) +#define SEQ_SE_DP_W026 (SNDARC_SE_BASE + 422) +#define SEQ_SE_DP_W028 (SNDARC_SE_BASE + 423) +#define SEQ_SE_DP_W028B (SNDARC_SE_BASE + 424) +#define SEQ_SE_DP_W029 (SNDARC_SE_BASE + 425) +#define SEQ_SE_DP_W030 (SNDARC_SE_BASE + 426) +#define SEQ_SE_DP_W036 (SNDARC_SE_BASE + 427) +#define SEQ_SE_DP_W039 (SNDARC_SE_BASE + 428) +#define SEQ_SE_DP_W040 (SNDARC_SE_BASE + 429) +#define SEQ_SE_DP_W043 (SNDARC_SE_BASE + 430) +#define SEQ_SE_DP_W043B (SNDARC_SE_BASE + 431) +#define SEQ_SE_DP_W043C (SNDARC_SE_BASE + 432) +#define SEQ_SE_DP_W043D (SNDARC_SE_BASE + 433) +#define SEQ_SE_DP_W044 (SNDARC_SE_BASE + 434) +#define SEQ_SE_DP_W047 (SNDARC_SE_BASE + 435) +#define SEQ_SE_DP_W048 (SNDARC_SE_BASE + 436) +#define SEQ_SE_DP_W052 (SNDARC_SE_BASE + 437) +#define SEQ_SE_DP_W053 (SNDARC_SE_BASE + 438) +#define SEQ_SE_DP_W053B (SNDARC_SE_BASE + 439) +#define SEQ_SE_DP_W054 (SNDARC_SE_BASE + 440) +#define SEQ_SE_DP_W055 (SNDARC_SE_BASE + 441) +#define SEQ_SE_DP_W056 (SNDARC_SE_BASE + 442) +#define SEQ_SE_DP_W056B (SNDARC_SE_BASE + 443) +#define SEQ_SE_DP_W057 (SNDARC_SE_BASE + 444) +#define SEQ_SE_DP_W057B (SNDARC_SE_BASE + 445) +#define SEQ_SE_DP_W059 (SNDARC_SE_BASE + 446) +#define SEQ_SE_DP_W059B (SNDARC_SE_BASE + 447) +#define SEQ_SE_DP_W060 (SNDARC_SE_BASE + 448) +#define SEQ_SE_DP_W062D (SNDARC_SE_BASE + 449) +#define SEQ_SE_DP_W060B (SNDARC_SE_BASE + 450) +#define SEQ_SE_DP_W063 (SNDARC_SE_BASE + 451) +#define SEQ_SE_DP_W063B (SNDARC_SE_BASE + 452) +#define SEQ_SE_DP_W063C (SNDARC_SE_BASE + 453) +#define SEQ_SE_DP_W070 (SNDARC_SE_BASE + 454) +#define SEQ_SE_DP_W071 (SNDARC_SE_BASE + 455) +#define SEQ_SE_DP_W071B (SNDARC_SE_BASE + 456) +#define SEQ_SE_DP_W076 (SNDARC_SE_BASE + 457) +#define SEQ_SE_DP_W076B (SNDARC_SE_BASE + 458) +#define SEQ_SE_DP_W077 (SNDARC_SE_BASE + 459) +#define SEQ_SE_DP_W077B (SNDARC_SE_BASE + 460) +#define SEQ_SE_DP_W080B (SNDARC_SE_BASE + 461) +#define SEQ_SE_DP_W080C (SNDARC_SE_BASE + 462) +#define SEQ_SE_DP_W081 (SNDARC_SE_BASE + 463) +#define SEQ_SE_DP_W081B (SNDARC_SE_BASE + 464) +#define SEQ_SE_DP_W082 (SNDARC_SE_BASE + 465) +#define SEQ_SE_DP_W082B (SNDARC_SE_BASE + 466) +#define SEQ_SE_DP_W082C (SNDARC_SE_BASE + 467) +#define SEQ_SE_DP_W085 (SNDARC_SE_BASE + 468) +#define SEQ_SE_DP_W085B (SNDARC_SE_BASE + 469) +#define SEQ_SE_DP_W085C (SNDARC_SE_BASE + 470) +#define SEQ_SE_DP_W086 (SNDARC_SE_BASE + 471) +#define SEQ_SE_DP_W088 (SNDARC_SE_BASE + 472) +#define SEQ_SE_DP_W089 (SNDARC_SE_BASE + 473) +#define SEQ_SE_DP_W089B (SNDARC_SE_BASE + 474) +#define SEQ_SE_DP_W090 (SNDARC_SE_BASE + 475) +#define SEQ_SE_DP_W091 (SNDARC_SE_BASE + 476) +#define SEQ_SE_DP_W092 (SNDARC_SE_BASE + 477) +#define SEQ_SE_DP_W092B (SNDARC_SE_BASE + 478) +#define SEQ_SE_DP_W092D (SNDARC_SE_BASE + 479) +#define SEQ_SE_DP_W100 (SNDARC_SE_BASE + 480) +#define SEQ_SE_DP_W100B (SNDARC_SE_BASE + 481) +#define SEQ_SE_DP_W103 (SNDARC_SE_BASE + 482) +#define SEQ_SE_DP_W104 (SNDARC_SE_BASE + 483) +#define SEQ_SE_DP_W107 (SNDARC_SE_BASE + 484) +#define SEQ_SE_DP_W109 (SNDARC_SE_BASE + 485) +#define SEQ_SE_DP_W109B (SNDARC_SE_BASE + 486) +#define SEQ_SE_DP_W112 (SNDARC_SE_BASE + 487) +#define SEQ_SE_DP_W112B (SNDARC_SE_BASE + 488) +#define SEQ_SE_DP_W114 (SNDARC_SE_BASE + 489) +#define SEQ_SE_DP_W115 (SNDARC_SE_BASE + 490) +#define SEQ_SE_DP_W118 (SNDARC_SE_BASE + 491) +#define SEQ_SE_DP_W118B (SNDARC_SE_BASE + 492) +#define SEQ_SE_DP_W120 (SNDARC_SE_BASE + 493) +#define SEQ_SE_DP_W122 (SNDARC_SE_BASE + 494) +#define SEQ_SE_DP_W127 (SNDARC_SE_BASE + 495) +#define SEQ_SE_DP_W129 (SNDARC_SE_BASE + 496) +#define SEQ_SE_DP_W145 (SNDARC_SE_BASE + 497) +#define SEQ_SE_DP_W145B (SNDARC_SE_BASE + 498) +#define SEQ_SE_DP_W145C (SNDARC_SE_BASE + 499) +#define SEQ_SE_DP_W145D (SNDARC_SE_BASE + 500) +#define SEQ_SE_DP_W146 (SNDARC_SE_BASE + 501) +#define SEQ_SE_DP_W151 (SNDARC_SE_BASE + 502) +#define SEQ_SE_DP_W152 (SNDARC_SE_BASE + 503) +#define SEQ_SE_DP_W153 (SNDARC_SE_BASE + 504) +#define SEQ_SE_DP_W155 (SNDARC_SE_BASE + 505) +#define SEQ_SE_DP_W161 (SNDARC_SE_BASE + 506) +#define SEQ_SE_DP_W161B (SNDARC_SE_BASE + 507) +#define SEQ_SE_DP_W166 (SNDARC_SE_BASE + 508) +#define SEQ_SE_DP_W171 (SNDARC_SE_BASE + 509) +#define SEQ_SE_DP_W172 (SNDARC_SE_BASE + 510) +#define SEQ_SE_DP_W172B (SNDARC_SE_BASE + 511) +#define SEQ_SE_DP_W173 (SNDARC_SE_BASE + 512) +#define SEQ_SE_DP_W173B (SNDARC_SE_BASE + 513) +#define SEQ_SE_DP_W173C (SNDARC_SE_BASE + 514) +#define SEQ_SE_DP_W179 (SNDARC_SE_BASE + 515) +#define SEQ_SE_DP_W185 (SNDARC_SE_BASE + 516) +#define SEQ_SE_DP_W187 (SNDARC_SE_BASE + 517) +#define SEQ_SE_DP_W195 (SNDARC_SE_BASE + 518) +#define SEQ_SE_DP_W196 (SNDARC_SE_BASE + 519) +#define SEQ_SE_DP_W197 (SNDARC_SE_BASE + 520) +#define SEQ_SE_DP_W199 (SNDARC_SE_BASE + 521) +#define SEQ_SE_DP_W201 (SNDARC_SE_BASE + 522) +#define SEQ_SE_DP_W202 (SNDARC_SE_BASE + 523) +#define SEQ_SE_DP_W202B (SNDARC_SE_BASE + 524) +#define SEQ_SE_DP_W204 (SNDARC_SE_BASE + 525) +#define SEQ_SE_DP_W207 (SNDARC_SE_BASE + 526) +#define SEQ_SE_DP_W207B (SNDARC_SE_BASE + 527) +#define SEQ_SE_DP_W207C (SNDARC_SE_BASE + 528) +#define SEQ_SE_DP_W207D (SNDARC_SE_BASE + 529) +#define SEQ_SE_DP_W208 (SNDARC_SE_BASE + 530) +#define SEQ_SE_DP_W209 (SNDARC_SE_BASE + 531) +#define SEQ_SE_DP_W213 (SNDARC_SE_BASE + 532) +#define SEQ_SE_DP_W215 (SNDARC_SE_BASE + 533) +#define SEQ_SE_DP_W221B (SNDARC_SE_BASE + 534) +#define SEQ_SE_DP_W227 (SNDARC_SE_BASE + 535) +#define SEQ_SE_DP_W227B (SNDARC_SE_BASE + 536) +#define SEQ_SE_DP_W230 (SNDARC_SE_BASE + 537) +#define SEQ_SE_DP_W231 (SNDARC_SE_BASE + 538) +#define SEQ_SE_DP_W233 (SNDARC_SE_BASE + 539) +#define SEQ_SE_DP_W233B (SNDARC_SE_BASE + 540) +#define SEQ_SE_DP_W234 (SNDARC_SE_BASE + 541) +#define SEQ_SE_DP_W236 (SNDARC_SE_BASE + 542) +#define SEQ_SE_DP_W239 (SNDARC_SE_BASE + 543) +#define SEQ_SE_DP_W240 (SNDARC_SE_BASE + 544) +#define SEQ_SE_DP_W250 (SNDARC_SE_BASE + 545) +#define SEQ_SE_DP_W253 (SNDARC_SE_BASE + 546) +#define SEQ_SE_DP_W255 (SNDARC_SE_BASE + 547) +#define SEQ_SE_DP_W255B (SNDARC_SE_BASE + 548) +#define SEQ_SE_DP_W255E (SNDARC_SE_BASE + 549) +#define SEQ_SE_DP_W255F (SNDARC_SE_BASE + 550) +#define SEQ_SE_DP_W257 (SNDARC_SE_BASE + 551) +#define SEQ_SE_DP_W258 (SNDARC_SE_BASE + 552) +#define SEQ_SE_DP_W260 (SNDARC_SE_BASE + 553) +#define SEQ_SE_DP_W278 (SNDARC_SE_BASE + 554) +#define SEQ_SE_DP_W280 (SNDARC_SE_BASE + 555) +#define SEQ_SE_DP_W280B (SNDARC_SE_BASE + 556) +#define SEQ_SE_DP_W281 (SNDARC_SE_BASE + 557) +#define SEQ_SE_DP_W287B (SNDARC_SE_BASE + 558) +#define SEQ_SE_DP_W287 (SNDARC_SE_BASE + 559) +#define SEQ_SE_DP_W291 (SNDARC_SE_BASE + 560) +#define SEQ_SE_DP_W298 (SNDARC_SE_BASE + 561) +#define SEQ_SE_DP_W320 (SNDARC_SE_BASE + 562) +#define SEQ_SE_DP_W322 (SNDARC_SE_BASE + 563) +#define SEQ_SE_DP_W327 (SNDARC_SE_BASE + 564) +#define SEQ_SE_DP_W356 (SNDARC_SE_BASE + 565) +#define SEQ_SE_DP_W360 (SNDARC_SE_BASE + 566) +#define SEQ_SE_DP_W360B (SNDARC_SE_BASE + 567) +#define SEQ_SE_DP_W360C (SNDARC_SE_BASE + 568) +#define SEQ_SE_DP_W361 (SNDARC_SE_BASE + 569) +#define SEQ_SE_DP_W362 (SNDARC_SE_BASE + 570) +#define SEQ_SE_DP_W363 (SNDARC_SE_BASE + 571) +#define SEQ_SE_DP_W367 (SNDARC_SE_BASE + 572) +#define SEQ_SE_DP_W368 (SNDARC_SE_BASE + 573) +#define SEQ_SE_DP_W373 (SNDARC_SE_BASE + 574) +#define SEQ_SE_DP_W374 (SNDARC_SE_BASE + 575) +#define SEQ_SE_DP_W375 (SNDARC_SE_BASE + 576) +#define SEQ_SE_DP_W376 (SNDARC_SE_BASE + 577) +#define SEQ_SE_DP_W376B (SNDARC_SE_BASE + 578) +#define SEQ_SE_DP_W377 (SNDARC_SE_BASE + 579) +#define SEQ_SE_DP_W379 (SNDARC_SE_BASE + 580) +#define SEQ_SE_DP_W380 (SNDARC_SE_BASE + 581) +#define SEQ_SE_DP_W381 (SNDARC_SE_BASE + 582) +#define SEQ_SE_DP_W383 (SNDARC_SE_BASE + 583) +#define SEQ_SE_DP_W387 (SNDARC_SE_BASE + 584) +#define SEQ_SE_DP_W392 (SNDARC_SE_BASE + 585) +#define SEQ_SE_DP_W399 (SNDARC_SE_BASE + 586) +#define SEQ_SE_DP_W405 (SNDARC_SE_BASE + 587) +#define SEQ_SE_DP_W408 (SNDARC_SE_BASE + 588) +#define SEQ_SE_DP_W411 (SNDARC_SE_BASE + 589) +#define SEQ_SE_DP_W412 (SNDARC_SE_BASE + 590) +#define SEQ_SE_DP_W413 (SNDARC_SE_BASE + 591) +#define SEQ_SE_DP_W419 (SNDARC_SE_BASE + 592) +#define SEQ_SE_DP_W426 (SNDARC_SE_BASE + 593) +#define SEQ_SE_DP_W428 (SNDARC_SE_BASE + 594) +#define SEQ_SE_DP_W434 (SNDARC_SE_BASE + 595) +#define SEQ_SE_DP_W436 (SNDARC_SE_BASE + 596) +#define SEQ_SE_DP_W443B (SNDARC_SE_BASE + 597) +#define SEQ_SE_DP_W452 (SNDARC_SE_BASE + 598) +#define SEQ_SE_DP_W456 (SNDARC_SE_BASE + 599) +#define SEQ_SE_DP_W459 (SNDARC_SE_BASE + 600) +#define SEQ_SE_DP_W460 (SNDARC_SE_BASE + 601) +#define SEQ_SE_DP_W461 (SNDARC_SE_BASE + 602) +#define SEQ_SE_DP_W462 (SNDARC_SE_BASE + 603) +#define SEQ_SE_DP_W463 (SNDARC_SE_BASE + 604) +#define SEQ_SE_DP_W464 (SNDARC_SE_BASE + 605) +#define SEQ_SE_DP_W465 (SNDARC_SE_BASE + 606) +#define SEQ_SE_DP_W466 (SNDARC_SE_BASE + 607) +#define SEQ_SE_DP_W467 (SNDARC_SE_BASE + 608) +#define SEQ_SE_DP_SUIRYU (SNDARC_SE_BASE + 609) +#define SEQ_SE_DP_KIRAKIRA2 (SNDARC_SE_BASE + 610) +#define SEQ_SE_DP_BAN (SNDARC_SE_BASE + 611) +#define SEQ_SE_DP_BASABASA (SNDARC_SE_BASE + 612) +#define SEQ_SE_DP_SHUSHU (SNDARC_SE_BASE + 613) +#define SEQ_SE_DP_KAMI (SNDARC_SE_BASE + 614) +#define SEQ_SE_DP_KAMI2 (SNDARC_SE_BASE + 615) +#define SEQ_SE_DP_BASI (SNDARC_SE_BASE + 616) +#define SEQ_SE_DP_AWA (SNDARC_SE_BASE + 617) +#define SEQ_SE_DP_NAMI (SNDARC_SE_BASE + 618) +#define SEQ_SE_DP_HURU (SNDARC_SE_BASE + 619) +#define SEQ_SE_DP_HURU2 (SNDARC_SE_BASE + 620) +#define SEQ_SE_DP_KAZE (SNDARC_SE_BASE + 621) +#define SEQ_SE_DP_KAZE2 (SNDARC_SE_BASE + 622) +#define SEQ_SE_DP_MUCHI (SNDARC_SE_BASE + 623) +#define SEQ_SE_DP_BRADE (SNDARC_SE_BASE + 624) +#define SEQ_SE_DP_BFBRADE (SNDARC_SE_BASE + 625) +#define SEQ_SE_DP_PASA (SNDARC_SE_BASE + 626) +#define SEQ_SE_DP_PASA2 (SNDARC_SE_BASE + 627) +#define SEQ_SE_DP_PASA3 (SNDARC_SE_BASE + 628) +#define SEQ_SE_DP_KIRAN (SNDARC_SE_BASE + 629) +#define SEQ_SE_DP_GASHIN (SNDARC_SE_BASE + 630) +#define SEQ_SE_DP_DODON (SNDARC_SE_BASE + 631) +#define SEQ_SE_END (SNDARC_SE_BASE + 632) -#endif //POKEDIAMOND_CONSTANTS_SNDSEQ_H +#endif // POKEDIAMOND_CONSTANTS_SNDSEQ_H diff --git a/include/constants/species.h b/include/constants/species.h index fcb9b6b7f..be6254365 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -1,511 +1,511 @@ #ifndef GUARD_CONSTANTS_SPECIES_H #define GUARD_CONSTANTS_SPECIES_H -#define SPECIES_NONE 0 -#define SPECIES_BULBASAUR 1 -#define SPECIES_IVYSAUR 2 -#define SPECIES_VENUSAUR 3 -#define SPECIES_CHARMANDER 4 -#define SPECIES_CHARMELEON 5 -#define SPECIES_CHARIZARD 6 -#define SPECIES_SQUIRTLE 7 -#define SPECIES_WARTORTLE 8 -#define SPECIES_BLASTOISE 9 -#define SPECIES_CATERPIE 10 -#define SPECIES_METAPOD 11 -#define SPECIES_BUTTERFREE 12 -#define SPECIES_WEEDLE 13 -#define SPECIES_KAKUNA 14 -#define SPECIES_BEEDRILL 15 -#define SPECIES_PIDGEY 16 -#define SPECIES_PIDGEOTTO 17 -#define SPECIES_PIDGEOT 18 -#define SPECIES_RATTATA 19 -#define SPECIES_RATICATE 20 -#define SPECIES_SPEAROW 21 -#define SPECIES_FEAROW 22 -#define SPECIES_EKANS 23 -#define SPECIES_ARBOK 24 -#define SPECIES_PIKACHU 25 -#define SPECIES_RAICHU 26 -#define SPECIES_SANDSHREW 27 -#define SPECIES_SANDSLASH 28 -#define SPECIES_NIDORAN_F 29 -#define SPECIES_NIDORINA 30 -#define SPECIES_NIDOQUEEN 31 -#define SPECIES_NIDORAN_M 32 -#define SPECIES_NIDORINO 33 -#define SPECIES_NIDOKING 34 -#define SPECIES_CLEFAIRY 35 -#define SPECIES_CLEFABLE 36 -#define SPECIES_VULPIX 37 -#define SPECIES_NINETALES 38 -#define SPECIES_JIGGLYPUFF 39 -#define SPECIES_WIGGLYTUFF 40 -#define SPECIES_ZUBAT 41 -#define SPECIES_GOLBAT 42 -#define SPECIES_ODDISH 43 -#define SPECIES_GLOOM 44 -#define SPECIES_VILEPLUME 45 -#define SPECIES_PARAS 46 -#define SPECIES_PARASECT 47 -#define SPECIES_VENONAT 48 -#define SPECIES_VENOMOTH 49 -#define SPECIES_DIGLETT 50 -#define SPECIES_DUGTRIO 51 -#define SPECIES_MEOWTH 52 -#define SPECIES_PERSIAN 53 -#define SPECIES_PSYDUCK 54 -#define SPECIES_GOLDUCK 55 -#define SPECIES_MANKEY 56 -#define SPECIES_PRIMEAPE 57 -#define SPECIES_GROWLITHE 58 -#define SPECIES_ARCANINE 59 -#define SPECIES_POLIWAG 60 -#define SPECIES_POLIWHIRL 61 -#define SPECIES_POLIWRATH 62 -#define SPECIES_ABRA 63 -#define SPECIES_KADABRA 64 -#define SPECIES_ALAKAZAM 65 -#define SPECIES_MACHOP 66 -#define SPECIES_MACHOKE 67 -#define SPECIES_MACHAMP 68 -#define SPECIES_BELLSPROUT 69 -#define SPECIES_WEEPINBELL 70 -#define SPECIES_VICTREEBEL 71 -#define SPECIES_TENTACOOL 72 -#define SPECIES_TENTACRUEL 73 -#define SPECIES_GEODUDE 74 -#define SPECIES_GRAVELER 75 -#define SPECIES_GOLEM 76 -#define SPECIES_PONYTA 77 -#define SPECIES_RAPIDASH 78 -#define SPECIES_SLOWPOKE 79 -#define SPECIES_SLOWBRO 80 -#define SPECIES_MAGNEMITE 81 -#define SPECIES_MAGNETON 82 -#define SPECIES_FARFETCHD 83 -#define SPECIES_DODUO 84 -#define SPECIES_DODRIO 85 -#define SPECIES_SEEL 86 -#define SPECIES_DEWGONG 87 -#define SPECIES_GRIMER 88 -#define SPECIES_MUK 89 -#define SPECIES_SHELLDER 90 -#define SPECIES_CLOYSTER 91 -#define SPECIES_GASTLY 92 -#define SPECIES_HAUNTER 93 -#define SPECIES_GENGAR 94 -#define SPECIES_ONIX 95 -#define SPECIES_DROWZEE 96 -#define SPECIES_HYPNO 97 -#define SPECIES_KRABBY 98 -#define SPECIES_KINGLER 99 -#define SPECIES_VOLTORB 100 -#define SPECIES_ELECTRODE 101 -#define SPECIES_EXEGGCUTE 102 -#define SPECIES_EXEGGUTOR 103 -#define SPECIES_CUBONE 104 -#define SPECIES_MAROWAK 105 -#define SPECIES_HITMONLEE 106 -#define SPECIES_HITMONCHAN 107 -#define SPECIES_LICKITUNG 108 -#define SPECIES_KOFFING 109 -#define SPECIES_WEEZING 110 -#define SPECIES_RHYHORN 111 -#define SPECIES_RHYDON 112 -#define SPECIES_CHANSEY 113 -#define SPECIES_TANGELA 114 -#define SPECIES_KANGASKHAN 115 -#define SPECIES_HORSEA 116 -#define SPECIES_SEADRA 117 -#define SPECIES_GOLDEEN 118 -#define SPECIES_SEAKING 119 -#define SPECIES_STARYU 120 -#define SPECIES_STARMIE 121 -#define SPECIES_MR_MIME 122 -#define SPECIES_SCYTHER 123 -#define SPECIES_JYNX 124 -#define SPECIES_ELECTABUZZ 125 -#define SPECIES_MAGMAR 126 -#define SPECIES_PINSIR 127 -#define SPECIES_TAUROS 128 -#define SPECIES_MAGIKARP 129 -#define SPECIES_GYARADOS 130 -#define SPECIES_LAPRAS 131 -#define SPECIES_DITTO 132 -#define SPECIES_EEVEE 133 -#define SPECIES_VAPOREON 134 -#define SPECIES_JOLTEON 135 -#define SPECIES_FLAREON 136 -#define SPECIES_PORYGON 137 -#define SPECIES_OMANYTE 138 -#define SPECIES_OMASTAR 139 -#define SPECIES_KABUTO 140 -#define SPECIES_KABUTOPS 141 -#define SPECIES_AERODACTYL 142 -#define SPECIES_SNORLAX 143 -#define SPECIES_ARTICUNO 144 -#define SPECIES_ZAPDOS 145 -#define SPECIES_MOLTRES 146 -#define SPECIES_DRATINI 147 -#define SPECIES_DRAGONAIR 148 -#define SPECIES_DRAGONITE 149 -#define SPECIES_MEWTWO 150 -#define SPECIES_MEW 151 +#define SPECIES_NONE 0 +#define SPECIES_BULBASAUR 1 +#define SPECIES_IVYSAUR 2 +#define SPECIES_VENUSAUR 3 +#define SPECIES_CHARMANDER 4 +#define SPECIES_CHARMELEON 5 +#define SPECIES_CHARIZARD 6 +#define SPECIES_SQUIRTLE 7 +#define SPECIES_WARTORTLE 8 +#define SPECIES_BLASTOISE 9 +#define SPECIES_CATERPIE 10 +#define SPECIES_METAPOD 11 +#define SPECIES_BUTTERFREE 12 +#define SPECIES_WEEDLE 13 +#define SPECIES_KAKUNA 14 +#define SPECIES_BEEDRILL 15 +#define SPECIES_PIDGEY 16 +#define SPECIES_PIDGEOTTO 17 +#define SPECIES_PIDGEOT 18 +#define SPECIES_RATTATA 19 +#define SPECIES_RATICATE 20 +#define SPECIES_SPEAROW 21 +#define SPECIES_FEAROW 22 +#define SPECIES_EKANS 23 +#define SPECIES_ARBOK 24 +#define SPECIES_PIKACHU 25 +#define SPECIES_RAICHU 26 +#define SPECIES_SANDSHREW 27 +#define SPECIES_SANDSLASH 28 +#define SPECIES_NIDORAN_F 29 +#define SPECIES_NIDORINA 30 +#define SPECIES_NIDOQUEEN 31 +#define SPECIES_NIDORAN_M 32 +#define SPECIES_NIDORINO 33 +#define SPECIES_NIDOKING 34 +#define SPECIES_CLEFAIRY 35 +#define SPECIES_CLEFABLE 36 +#define SPECIES_VULPIX 37 +#define SPECIES_NINETALES 38 +#define SPECIES_JIGGLYPUFF 39 +#define SPECIES_WIGGLYTUFF 40 +#define SPECIES_ZUBAT 41 +#define SPECIES_GOLBAT 42 +#define SPECIES_ODDISH 43 +#define SPECIES_GLOOM 44 +#define SPECIES_VILEPLUME 45 +#define SPECIES_PARAS 46 +#define SPECIES_PARASECT 47 +#define SPECIES_VENONAT 48 +#define SPECIES_VENOMOTH 49 +#define SPECIES_DIGLETT 50 +#define SPECIES_DUGTRIO 51 +#define SPECIES_MEOWTH 52 +#define SPECIES_PERSIAN 53 +#define SPECIES_PSYDUCK 54 +#define SPECIES_GOLDUCK 55 +#define SPECIES_MANKEY 56 +#define SPECIES_PRIMEAPE 57 +#define SPECIES_GROWLITHE 58 +#define SPECIES_ARCANINE 59 +#define SPECIES_POLIWAG 60 +#define SPECIES_POLIWHIRL 61 +#define SPECIES_POLIWRATH 62 +#define SPECIES_ABRA 63 +#define SPECIES_KADABRA 64 +#define SPECIES_ALAKAZAM 65 +#define SPECIES_MACHOP 66 +#define SPECIES_MACHOKE 67 +#define SPECIES_MACHAMP 68 +#define SPECIES_BELLSPROUT 69 +#define SPECIES_WEEPINBELL 70 +#define SPECIES_VICTREEBEL 71 +#define SPECIES_TENTACOOL 72 +#define SPECIES_TENTACRUEL 73 +#define SPECIES_GEODUDE 74 +#define SPECIES_GRAVELER 75 +#define SPECIES_GOLEM 76 +#define SPECIES_PONYTA 77 +#define SPECIES_RAPIDASH 78 +#define SPECIES_SLOWPOKE 79 +#define SPECIES_SLOWBRO 80 +#define SPECIES_MAGNEMITE 81 +#define SPECIES_MAGNETON 82 +#define SPECIES_FARFETCHD 83 +#define SPECIES_DODUO 84 +#define SPECIES_DODRIO 85 +#define SPECIES_SEEL 86 +#define SPECIES_DEWGONG 87 +#define SPECIES_GRIMER 88 +#define SPECIES_MUK 89 +#define SPECIES_SHELLDER 90 +#define SPECIES_CLOYSTER 91 +#define SPECIES_GASTLY 92 +#define SPECIES_HAUNTER 93 +#define SPECIES_GENGAR 94 +#define SPECIES_ONIX 95 +#define SPECIES_DROWZEE 96 +#define SPECIES_HYPNO 97 +#define SPECIES_KRABBY 98 +#define SPECIES_KINGLER 99 +#define SPECIES_VOLTORB 100 +#define SPECIES_ELECTRODE 101 +#define SPECIES_EXEGGCUTE 102 +#define SPECIES_EXEGGUTOR 103 +#define SPECIES_CUBONE 104 +#define SPECIES_MAROWAK 105 +#define SPECIES_HITMONLEE 106 +#define SPECIES_HITMONCHAN 107 +#define SPECIES_LICKITUNG 108 +#define SPECIES_KOFFING 109 +#define SPECIES_WEEZING 110 +#define SPECIES_RHYHORN 111 +#define SPECIES_RHYDON 112 +#define SPECIES_CHANSEY 113 +#define SPECIES_TANGELA 114 +#define SPECIES_KANGASKHAN 115 +#define SPECIES_HORSEA 116 +#define SPECIES_SEADRA 117 +#define SPECIES_GOLDEEN 118 +#define SPECIES_SEAKING 119 +#define SPECIES_STARYU 120 +#define SPECIES_STARMIE 121 +#define SPECIES_MR_MIME 122 +#define SPECIES_SCYTHER 123 +#define SPECIES_JYNX 124 +#define SPECIES_ELECTABUZZ 125 +#define SPECIES_MAGMAR 126 +#define SPECIES_PINSIR 127 +#define SPECIES_TAUROS 128 +#define SPECIES_MAGIKARP 129 +#define SPECIES_GYARADOS 130 +#define SPECIES_LAPRAS 131 +#define SPECIES_DITTO 132 +#define SPECIES_EEVEE 133 +#define SPECIES_VAPOREON 134 +#define SPECIES_JOLTEON 135 +#define SPECIES_FLAREON 136 +#define SPECIES_PORYGON 137 +#define SPECIES_OMANYTE 138 +#define SPECIES_OMASTAR 139 +#define SPECIES_KABUTO 140 +#define SPECIES_KABUTOPS 141 +#define SPECIES_AERODACTYL 142 +#define SPECIES_SNORLAX 143 +#define SPECIES_ARTICUNO 144 +#define SPECIES_ZAPDOS 145 +#define SPECIES_MOLTRES 146 +#define SPECIES_DRATINI 147 +#define SPECIES_DRAGONAIR 148 +#define SPECIES_DRAGONITE 149 +#define SPECIES_MEWTWO 150 +#define SPECIES_MEW 151 -#define KANTO_DEX_COUNT SPECIES_MEW +#define KANTO_DEX_COUNT SPECIES_MEW -#define SPECIES_CHIKORITA 152 -#define SPECIES_BAYLEEF 153 -#define SPECIES_MEGANIUM 154 -#define SPECIES_CYNDAQUIL 155 -#define SPECIES_QUILAVA 156 -#define SPECIES_TYPHLOSION 157 -#define SPECIES_TOTODILE 158 -#define SPECIES_CROCONAW 159 -#define SPECIES_FERALIGATR 160 -#define SPECIES_SENTRET 161 -#define SPECIES_FURRET 162 -#define SPECIES_HOOTHOOT 163 -#define SPECIES_NOCTOWL 164 -#define SPECIES_LEDYBA 165 -#define SPECIES_LEDIAN 166 -#define SPECIES_SPINARAK 167 -#define SPECIES_ARIADOS 168 -#define SPECIES_CROBAT 169 -#define SPECIES_CHINCHOU 170 -#define SPECIES_LANTURN 171 -#define SPECIES_PICHU 172 -#define SPECIES_CLEFFA 173 -#define SPECIES_IGGLYBUFF 174 -#define SPECIES_TOGEPI 175 -#define SPECIES_TOGETIC 176 -#define SPECIES_NATU 177 -#define SPECIES_XATU 178 -#define SPECIES_MAREEP 179 -#define SPECIES_FLAAFFY 180 -#define SPECIES_AMPHAROS 181 -#define SPECIES_BELLOSSOM 182 -#define SPECIES_MARILL 183 -#define SPECIES_AZUMARILL 184 -#define SPECIES_SUDOWOODO 185 -#define SPECIES_POLITOED 186 -#define SPECIES_HOPPIP 187 -#define SPECIES_SKIPLOOM 188 -#define SPECIES_JUMPLUFF 189 -#define SPECIES_AIPOM 190 -#define SPECIES_SUNKERN 191 -#define SPECIES_SUNFLORA 192 -#define SPECIES_YANMA 193 -#define SPECIES_WOOPER 194 -#define SPECIES_QUAGSIRE 195 -#define SPECIES_ESPEON 196 -#define SPECIES_UMBREON 197 -#define SPECIES_MURKROW 198 -#define SPECIES_SLOWKING 199 -#define SPECIES_MISDREAVUS 200 -#define SPECIES_UNOWN 201 -#define SPECIES_WOBBUFFET 202 -#define SPECIES_GIRAFARIG 203 -#define SPECIES_PINECO 204 -#define SPECIES_FORRETRESS 205 -#define SPECIES_DUNSPARCE 206 -#define SPECIES_GLIGAR 207 -#define SPECIES_STEELIX 208 -#define SPECIES_SNUBBULL 209 -#define SPECIES_GRANBULL 210 -#define SPECIES_QWILFISH 211 -#define SPECIES_SCIZOR 212 -#define SPECIES_SHUCKLE 213 -#define SPECIES_HERACROSS 214 -#define SPECIES_SNEASEL 215 -#define SPECIES_TEDDIURSA 216 -#define SPECIES_URSARING 217 -#define SPECIES_SLUGMA 218 -#define SPECIES_MAGCARGO 219 -#define SPECIES_SWINUB 220 -#define SPECIES_PILOSWINE 221 -#define SPECIES_CORSOLA 222 -#define SPECIES_REMORAID 223 -#define SPECIES_OCTILLERY 224 -#define SPECIES_DELIBIRD 225 -#define SPECIES_MANTINE 226 -#define SPECIES_SKARMORY 227 -#define SPECIES_HOUNDOUR 228 -#define SPECIES_HOUNDOOM 229 -#define SPECIES_KINGDRA 230 -#define SPECIES_PHANPY 231 -#define SPECIES_DONPHAN 232 -#define SPECIES_PORYGON2 233 -#define SPECIES_STANTLER 234 -#define SPECIES_SMEARGLE 235 -#define SPECIES_TYROGUE 236 -#define SPECIES_HITMONTOP 237 -#define SPECIES_SMOOCHUM 238 -#define SPECIES_ELEKID 239 -#define SPECIES_MAGBY 240 -#define SPECIES_MILTANK 241 -#define SPECIES_BLISSEY 242 -#define SPECIES_RAIKOU 243 -#define SPECIES_ENTEI 244 -#define SPECIES_SUICUNE 245 -#define SPECIES_LARVITAR 246 -#define SPECIES_PUPITAR 247 -#define SPECIES_TYRANITAR 248 -#define SPECIES_LUGIA 249 -#define SPECIES_HO_OH 250 -#define SPECIES_CELEBI 251 +#define SPECIES_CHIKORITA 152 +#define SPECIES_BAYLEEF 153 +#define SPECIES_MEGANIUM 154 +#define SPECIES_CYNDAQUIL 155 +#define SPECIES_QUILAVA 156 +#define SPECIES_TYPHLOSION 157 +#define SPECIES_TOTODILE 158 +#define SPECIES_CROCONAW 159 +#define SPECIES_FERALIGATR 160 +#define SPECIES_SENTRET 161 +#define SPECIES_FURRET 162 +#define SPECIES_HOOTHOOT 163 +#define SPECIES_NOCTOWL 164 +#define SPECIES_LEDYBA 165 +#define SPECIES_LEDIAN 166 +#define SPECIES_SPINARAK 167 +#define SPECIES_ARIADOS 168 +#define SPECIES_CROBAT 169 +#define SPECIES_CHINCHOU 170 +#define SPECIES_LANTURN 171 +#define SPECIES_PICHU 172 +#define SPECIES_CLEFFA 173 +#define SPECIES_IGGLYBUFF 174 +#define SPECIES_TOGEPI 175 +#define SPECIES_TOGETIC 176 +#define SPECIES_NATU 177 +#define SPECIES_XATU 178 +#define SPECIES_MAREEP 179 +#define SPECIES_FLAAFFY 180 +#define SPECIES_AMPHAROS 181 +#define SPECIES_BELLOSSOM 182 +#define SPECIES_MARILL 183 +#define SPECIES_AZUMARILL 184 +#define SPECIES_SUDOWOODO 185 +#define SPECIES_POLITOED 186 +#define SPECIES_HOPPIP 187 +#define SPECIES_SKIPLOOM 188 +#define SPECIES_JUMPLUFF 189 +#define SPECIES_AIPOM 190 +#define SPECIES_SUNKERN 191 +#define SPECIES_SUNFLORA 192 +#define SPECIES_YANMA 193 +#define SPECIES_WOOPER 194 +#define SPECIES_QUAGSIRE 195 +#define SPECIES_ESPEON 196 +#define SPECIES_UMBREON 197 +#define SPECIES_MURKROW 198 +#define SPECIES_SLOWKING 199 +#define SPECIES_MISDREAVUS 200 +#define SPECIES_UNOWN 201 +#define SPECIES_WOBBUFFET 202 +#define SPECIES_GIRAFARIG 203 +#define SPECIES_PINECO 204 +#define SPECIES_FORRETRESS 205 +#define SPECIES_DUNSPARCE 206 +#define SPECIES_GLIGAR 207 +#define SPECIES_STEELIX 208 +#define SPECIES_SNUBBULL 209 +#define SPECIES_GRANBULL 210 +#define SPECIES_QWILFISH 211 +#define SPECIES_SCIZOR 212 +#define SPECIES_SHUCKLE 213 +#define SPECIES_HERACROSS 214 +#define SPECIES_SNEASEL 215 +#define SPECIES_TEDDIURSA 216 +#define SPECIES_URSARING 217 +#define SPECIES_SLUGMA 218 +#define SPECIES_MAGCARGO 219 +#define SPECIES_SWINUB 220 +#define SPECIES_PILOSWINE 221 +#define SPECIES_CORSOLA 222 +#define SPECIES_REMORAID 223 +#define SPECIES_OCTILLERY 224 +#define SPECIES_DELIBIRD 225 +#define SPECIES_MANTINE 226 +#define SPECIES_SKARMORY 227 +#define SPECIES_HOUNDOUR 228 +#define SPECIES_HOUNDOOM 229 +#define SPECIES_KINGDRA 230 +#define SPECIES_PHANPY 231 +#define SPECIES_DONPHAN 232 +#define SPECIES_PORYGON2 233 +#define SPECIES_STANTLER 234 +#define SPECIES_SMEARGLE 235 +#define SPECIES_TYROGUE 236 +#define SPECIES_HITMONTOP 237 +#define SPECIES_SMOOCHUM 238 +#define SPECIES_ELEKID 239 +#define SPECIES_MAGBY 240 +#define SPECIES_MILTANK 241 +#define SPECIES_BLISSEY 242 +#define SPECIES_RAIKOU 243 +#define SPECIES_ENTEI 244 +#define SPECIES_SUICUNE 245 +#define SPECIES_LARVITAR 246 +#define SPECIES_PUPITAR 247 +#define SPECIES_TYRANITAR 248 +#define SPECIES_LUGIA 249 +#define SPECIES_HO_OH 250 +#define SPECIES_CELEBI 251 -#define JOHTO_DEX_COUNT SPECIES_CELEBI +#define JOHTO_DEX_COUNT SPECIES_CELEBI -#define SPECIES_TREECKO 252 -#define SPECIES_GROVYLE 253 -#define SPECIES_SCEPTILE 254 -#define SPECIES_TORCHIC 255 -#define SPECIES_COMBUSKEN 256 -#define SPECIES_BLAZIKEN 257 -#define SPECIES_MUDKIP 258 -#define SPECIES_MARSHTOMP 259 -#define SPECIES_SWAMPERT 260 -#define SPECIES_POOCHYENA 261 -#define SPECIES_MIGHTYENA 262 -#define SPECIES_ZIGZAGOON 263 -#define SPECIES_LINOONE 264 -#define SPECIES_WURMPLE 265 -#define SPECIES_SILCOON 266 -#define SPECIES_BEAUTIFLY 267 -#define SPECIES_CASCOON 268 -#define SPECIES_DUSTOX 269 -#define SPECIES_LOTAD 270 -#define SPECIES_LOMBRE 271 -#define SPECIES_LUDICOLO 272 -#define SPECIES_SEEDOT 273 -#define SPECIES_NUZLEAF 274 -#define SPECIES_SHIFTRY 275 -#define SPECIES_TAILLOW 276 -#define SPECIES_SWELLOW 277 -#define SPECIES_WINGULL 278 -#define SPECIES_PELIPPER 279 -#define SPECIES_RALTS 280 -#define SPECIES_KIRLIA 281 -#define SPECIES_GARDEVOIR 282 -#define SPECIES_SURSKIT 283 -#define SPECIES_MASQUERAIN 284 -#define SPECIES_SHROOMISH 285 -#define SPECIES_BRELOOM 286 -#define SPECIES_SLAKOTH 287 -#define SPECIES_VIGOROTH 288 -#define SPECIES_SLAKING 289 -#define SPECIES_NINCADA 290 -#define SPECIES_NINJASK 291 -#define SPECIES_SHEDINJA 292 -#define SPECIES_WHISMUR 293 -#define SPECIES_LOUDRED 294 -#define SPECIES_EXPLOUD 295 -#define SPECIES_MAKUHITA 296 -#define SPECIES_HARIYAMA 297 -#define SPECIES_AZURILL 298 -#define SPECIES_NOSEPASS 299 -#define SPECIES_SKITTY 300 -#define SPECIES_DELCATTY 301 -#define SPECIES_SABLEYE 302 -#define SPECIES_MAWILE 303 -#define SPECIES_ARON 304 -#define SPECIES_LAIRON 305 -#define SPECIES_AGGRON 306 -#define SPECIES_MEDITITE 307 -#define SPECIES_MEDICHAM 308 -#define SPECIES_ELECTRIKE 309 -#define SPECIES_MANECTRIC 310 -#define SPECIES_PLUSLE 311 -#define SPECIES_MINUN 312 -#define SPECIES_VOLBEAT 313 -#define SPECIES_ILLUMISE 314 -#define SPECIES_ROSELIA 315 -#define SPECIES_GULPIN 316 -#define SPECIES_SWALOT 317 -#define SPECIES_CARVANHA 318 -#define SPECIES_SHARPEDO 319 -#define SPECIES_WAILMER 320 -#define SPECIES_WAILORD 321 -#define SPECIES_NUMEL 322 -#define SPECIES_CAMERUPT 323 -#define SPECIES_TORKOAL 324 -#define SPECIES_SPOINK 325 -#define SPECIES_GRUMPIG 326 -#define SPECIES_SPINDA 327 -#define SPECIES_TRAPINCH 328 -#define SPECIES_VIBRAVA 329 -#define SPECIES_FLYGON 330 -#define SPECIES_CACNEA 331 -#define SPECIES_CACTURNE 332 -#define SPECIES_SWABLU 333 -#define SPECIES_ALTARIA 334 -#define SPECIES_ZANGOOSE 335 -#define SPECIES_SEVIPER 336 -#define SPECIES_LUNATONE 337 -#define SPECIES_SOLROCK 338 -#define SPECIES_BARBOACH 339 -#define SPECIES_WHISCASH 340 -#define SPECIES_CORPHISH 341 -#define SPECIES_CRAWDAUNT 342 -#define SPECIES_BALTOY 343 -#define SPECIES_CLAYDOL 344 -#define SPECIES_LILEEP 345 -#define SPECIES_CRADILY 346 -#define SPECIES_ANORITH 347 -#define SPECIES_ARMALDO 348 -#define SPECIES_FEEBAS 349 -#define SPECIES_MILOTIC 350 -#define SPECIES_CASTFORM 351 -#define SPECIES_KECLEON 352 -#define SPECIES_SHUPPET 353 -#define SPECIES_BANETTE 354 -#define SPECIES_DUSKULL 355 -#define SPECIES_DUSCLOPS 356 -#define SPECIES_TROPIUS 357 -#define SPECIES_CHIMECHO 358 -#define SPECIES_ABSOL 359 -#define SPECIES_WYNAUT 360 -#define SPECIES_SNORUNT 361 -#define SPECIES_GLALIE 362 -#define SPECIES_SPHEAL 363 -#define SPECIES_SEALEO 364 -#define SPECIES_WALREIN 365 -#define SPECIES_CLAMPERL 366 -#define SPECIES_HUNTAIL 367 -#define SPECIES_GOREBYSS 368 -#define SPECIES_RELICANTH 369 -#define SPECIES_LUVDISC 370 -#define SPECIES_BAGON 371 -#define SPECIES_SHELGON 372 -#define SPECIES_SALAMENCE 373 -#define SPECIES_BELDUM 374 -#define SPECIES_METANG 375 -#define SPECIES_METAGROSS 376 -#define SPECIES_REGIROCK 377 -#define SPECIES_REGICE 378 -#define SPECIES_REGISTEEL 379 -#define SPECIES_LATIAS 380 -#define SPECIES_LATIOS 381 -#define SPECIES_KYOGRE 382 -#define SPECIES_GROUDON 383 -#define SPECIES_RAYQUAZA 384 -#define SPECIES_JIRACHI 385 -#define SPECIES_DEOXYS 386 +#define SPECIES_TREECKO 252 +#define SPECIES_GROVYLE 253 +#define SPECIES_SCEPTILE 254 +#define SPECIES_TORCHIC 255 +#define SPECIES_COMBUSKEN 256 +#define SPECIES_BLAZIKEN 257 +#define SPECIES_MUDKIP 258 +#define SPECIES_MARSHTOMP 259 +#define SPECIES_SWAMPERT 260 +#define SPECIES_POOCHYENA 261 +#define SPECIES_MIGHTYENA 262 +#define SPECIES_ZIGZAGOON 263 +#define SPECIES_LINOONE 264 +#define SPECIES_WURMPLE 265 +#define SPECIES_SILCOON 266 +#define SPECIES_BEAUTIFLY 267 +#define SPECIES_CASCOON 268 +#define SPECIES_DUSTOX 269 +#define SPECIES_LOTAD 270 +#define SPECIES_LOMBRE 271 +#define SPECIES_LUDICOLO 272 +#define SPECIES_SEEDOT 273 +#define SPECIES_NUZLEAF 274 +#define SPECIES_SHIFTRY 275 +#define SPECIES_TAILLOW 276 +#define SPECIES_SWELLOW 277 +#define SPECIES_WINGULL 278 +#define SPECIES_PELIPPER 279 +#define SPECIES_RALTS 280 +#define SPECIES_KIRLIA 281 +#define SPECIES_GARDEVOIR 282 +#define SPECIES_SURSKIT 283 +#define SPECIES_MASQUERAIN 284 +#define SPECIES_SHROOMISH 285 +#define SPECIES_BRELOOM 286 +#define SPECIES_SLAKOTH 287 +#define SPECIES_VIGOROTH 288 +#define SPECIES_SLAKING 289 +#define SPECIES_NINCADA 290 +#define SPECIES_NINJASK 291 +#define SPECIES_SHEDINJA 292 +#define SPECIES_WHISMUR 293 +#define SPECIES_LOUDRED 294 +#define SPECIES_EXPLOUD 295 +#define SPECIES_MAKUHITA 296 +#define SPECIES_HARIYAMA 297 +#define SPECIES_AZURILL 298 +#define SPECIES_NOSEPASS 299 +#define SPECIES_SKITTY 300 +#define SPECIES_DELCATTY 301 +#define SPECIES_SABLEYE 302 +#define SPECIES_MAWILE 303 +#define SPECIES_ARON 304 +#define SPECIES_LAIRON 305 +#define SPECIES_AGGRON 306 +#define SPECIES_MEDITITE 307 +#define SPECIES_MEDICHAM 308 +#define SPECIES_ELECTRIKE 309 +#define SPECIES_MANECTRIC 310 +#define SPECIES_PLUSLE 311 +#define SPECIES_MINUN 312 +#define SPECIES_VOLBEAT 313 +#define SPECIES_ILLUMISE 314 +#define SPECIES_ROSELIA 315 +#define SPECIES_GULPIN 316 +#define SPECIES_SWALOT 317 +#define SPECIES_CARVANHA 318 +#define SPECIES_SHARPEDO 319 +#define SPECIES_WAILMER 320 +#define SPECIES_WAILORD 321 +#define SPECIES_NUMEL 322 +#define SPECIES_CAMERUPT 323 +#define SPECIES_TORKOAL 324 +#define SPECIES_SPOINK 325 +#define SPECIES_GRUMPIG 326 +#define SPECIES_SPINDA 327 +#define SPECIES_TRAPINCH 328 +#define SPECIES_VIBRAVA 329 +#define SPECIES_FLYGON 330 +#define SPECIES_CACNEA 331 +#define SPECIES_CACTURNE 332 +#define SPECIES_SWABLU 333 +#define SPECIES_ALTARIA 334 +#define SPECIES_ZANGOOSE 335 +#define SPECIES_SEVIPER 336 +#define SPECIES_LUNATONE 337 +#define SPECIES_SOLROCK 338 +#define SPECIES_BARBOACH 339 +#define SPECIES_WHISCASH 340 +#define SPECIES_CORPHISH 341 +#define SPECIES_CRAWDAUNT 342 +#define SPECIES_BALTOY 343 +#define SPECIES_CLAYDOL 344 +#define SPECIES_LILEEP 345 +#define SPECIES_CRADILY 346 +#define SPECIES_ANORITH 347 +#define SPECIES_ARMALDO 348 +#define SPECIES_FEEBAS 349 +#define SPECIES_MILOTIC 350 +#define SPECIES_CASTFORM 351 +#define SPECIES_KECLEON 352 +#define SPECIES_SHUPPET 353 +#define SPECIES_BANETTE 354 +#define SPECIES_DUSKULL 355 +#define SPECIES_DUSCLOPS 356 +#define SPECIES_TROPIUS 357 +#define SPECIES_CHIMECHO 358 +#define SPECIES_ABSOL 359 +#define SPECIES_WYNAUT 360 +#define SPECIES_SNORUNT 361 +#define SPECIES_GLALIE 362 +#define SPECIES_SPHEAL 363 +#define SPECIES_SEALEO 364 +#define SPECIES_WALREIN 365 +#define SPECIES_CLAMPERL 366 +#define SPECIES_HUNTAIL 367 +#define SPECIES_GOREBYSS 368 +#define SPECIES_RELICANTH 369 +#define SPECIES_LUVDISC 370 +#define SPECIES_BAGON 371 +#define SPECIES_SHELGON 372 +#define SPECIES_SALAMENCE 373 +#define SPECIES_BELDUM 374 +#define SPECIES_METANG 375 +#define SPECIES_METAGROSS 376 +#define SPECIES_REGIROCK 377 +#define SPECIES_REGICE 378 +#define SPECIES_REGISTEEL 379 +#define SPECIES_LATIAS 380 +#define SPECIES_LATIOS 381 +#define SPECIES_KYOGRE 382 +#define SPECIES_GROUDON 383 +#define SPECIES_RAYQUAZA 384 +#define SPECIES_JIRACHI 385 +#define SPECIES_DEOXYS 386 -#define HOENN_DEX_COUNT SPECIES_DEOXYS +#define HOENN_DEX_COUNT SPECIES_DEOXYS -#define SPECIES_TURTWIG 387 -#define SPECIES_GROTLE 388 -#define SPECIES_TORTERRA 389 -#define SPECIES_CHIMCHAR 390 -#define SPECIES_MONFERNO 391 -#define SPECIES_INFERNAPE 392 -#define SPECIES_PIPLUP 393 -#define SPECIES_PRINPLUP 394 -#define SPECIES_EMPOLEON 395 -#define SPECIES_STARLY 396 -#define SPECIES_STARAVIA 397 -#define SPECIES_STARAPTOR 398 -#define SPECIES_BIDOOF 399 -#define SPECIES_BIBAREL 400 -#define SPECIES_KRICKETOT 401 -#define SPECIES_KRICKETUNE 402 -#define SPECIES_SHINX 403 -#define SPECIES_LUXIO 404 -#define SPECIES_LUXRAY 405 -#define SPECIES_BUDEW 406 -#define SPECIES_ROSERADE 407 -#define SPECIES_CRANIDOS 408 -#define SPECIES_RAMPARDOS 409 -#define SPECIES_SHIELDON 410 -#define SPECIES_BASTIODON 411 -#define SPECIES_BURMY 412 -#define SPECIES_WORMADAM 413 -#define SPECIES_MOTHIM 414 -#define SPECIES_COMBEE 415 -#define SPECIES_VESPIQUEN 416 -#define SPECIES_PACHIRISU 417 -#define SPECIES_BUIZEL 418 -#define SPECIES_FLOATZEL 419 -#define SPECIES_CHERUBI 420 -#define SPECIES_CHERRIM 421 -#define SPECIES_SHELLOS 422 -#define SPECIES_GASTRODON 423 -#define SPECIES_AMBIPOM 424 -#define SPECIES_DRIFLOON 425 -#define SPECIES_DRIFBLIM 426 -#define SPECIES_BUNEARY 427 -#define SPECIES_LOPUNNY 428 -#define SPECIES_MISMAGIUS 429 -#define SPECIES_HONCHKROW 430 -#define SPECIES_GLAMEOW 431 -#define SPECIES_PURUGLY 432 -#define SPECIES_CHINGLING 433 -#define SPECIES_STUNKY 434 -#define SPECIES_SKUNTANK 435 -#define SPECIES_BRONZOR 436 -#define SPECIES_BRONZONG 437 -#define SPECIES_BONSLY 438 -#define SPECIES_MIME_JR 439 -#define SPECIES_HAPPINY 440 -#define SPECIES_CHATOT 441 -#define SPECIES_SPIRITOMB 442 -#define SPECIES_GIBLE 443 -#define SPECIES_GABITE 444 -#define SPECIES_GARCHOMP 445 -#define SPECIES_MUNCHLAX 446 -#define SPECIES_RIOLU 447 -#define SPECIES_LUCARIO 448 -#define SPECIES_HIPPOPOTAS 449 -#define SPECIES_HIPPOWDON 450 -#define SPECIES_SKORUPI 451 -#define SPECIES_DRAPION 452 -#define SPECIES_CROAGUNK 453 -#define SPECIES_TOXICROAK 454 -#define SPECIES_CARNIVINE 455 -#define SPECIES_FINNEON 456 -#define SPECIES_LUMINEON 457 -#define SPECIES_MANTYKE 458 -#define SPECIES_SNOVER 459 -#define SPECIES_ABOMASNOW 460 -#define SPECIES_WEAVILE 461 -#define SPECIES_MAGNEZONE 462 -#define SPECIES_LICKILICKY 463 -#define SPECIES_RHYPERIOR 464 -#define SPECIES_TANGROWTH 465 -#define SPECIES_ELECTIVIRE 466 -#define SPECIES_MAGMORTAR 467 -#define SPECIES_TOGEKISS 468 -#define SPECIES_YANMEGA 469 -#define SPECIES_LEAFEON 470 -#define SPECIES_GLACEON 471 -#define SPECIES_GLISCOR 472 -#define SPECIES_MAMOSWINE 473 -#define SPECIES_PORYGON_Z 474 -#define SPECIES_GALLADE 475 -#define SPECIES_PROBOPASS 476 -#define SPECIES_DUSKNOIR 477 -#define SPECIES_FROSLASS 478 -#define SPECIES_ROTOM 479 -#define SPECIES_UXIE 480 -#define SPECIES_MESPRIT 481 -#define SPECIES_AZELF 482 -#define SPECIES_DIALGA 483 -#define SPECIES_PALKIA 484 -#define SPECIES_HEATRAN 485 -#define SPECIES_REGIGIGAS 486 -#define SPECIES_GIRATINA 487 -#define SPECIES_CRESSELIA 488 -#define SPECIES_PHIONE 489 -#define SPECIES_MANAPHY 490 -#define SPECIES_DARKRAI 491 -#define SPECIES_SHAYMIN 492 -#define SPECIES_ARCEUS 493 +#define SPECIES_TURTWIG 387 +#define SPECIES_GROTLE 388 +#define SPECIES_TORTERRA 389 +#define SPECIES_CHIMCHAR 390 +#define SPECIES_MONFERNO 391 +#define SPECIES_INFERNAPE 392 +#define SPECIES_PIPLUP 393 +#define SPECIES_PRINPLUP 394 +#define SPECIES_EMPOLEON 395 +#define SPECIES_STARLY 396 +#define SPECIES_STARAVIA 397 +#define SPECIES_STARAPTOR 398 +#define SPECIES_BIDOOF 399 +#define SPECIES_BIBAREL 400 +#define SPECIES_KRICKETOT 401 +#define SPECIES_KRICKETUNE 402 +#define SPECIES_SHINX 403 +#define SPECIES_LUXIO 404 +#define SPECIES_LUXRAY 405 +#define SPECIES_BUDEW 406 +#define SPECIES_ROSERADE 407 +#define SPECIES_CRANIDOS 408 +#define SPECIES_RAMPARDOS 409 +#define SPECIES_SHIELDON 410 +#define SPECIES_BASTIODON 411 +#define SPECIES_BURMY 412 +#define SPECIES_WORMADAM 413 +#define SPECIES_MOTHIM 414 +#define SPECIES_COMBEE 415 +#define SPECIES_VESPIQUEN 416 +#define SPECIES_PACHIRISU 417 +#define SPECIES_BUIZEL 418 +#define SPECIES_FLOATZEL 419 +#define SPECIES_CHERUBI 420 +#define SPECIES_CHERRIM 421 +#define SPECIES_SHELLOS 422 +#define SPECIES_GASTRODON 423 +#define SPECIES_AMBIPOM 424 +#define SPECIES_DRIFLOON 425 +#define SPECIES_DRIFBLIM 426 +#define SPECIES_BUNEARY 427 +#define SPECIES_LOPUNNY 428 +#define SPECIES_MISMAGIUS 429 +#define SPECIES_HONCHKROW 430 +#define SPECIES_GLAMEOW 431 +#define SPECIES_PURUGLY 432 +#define SPECIES_CHINGLING 433 +#define SPECIES_STUNKY 434 +#define SPECIES_SKUNTANK 435 +#define SPECIES_BRONZOR 436 +#define SPECIES_BRONZONG 437 +#define SPECIES_BONSLY 438 +#define SPECIES_MIME_JR 439 +#define SPECIES_HAPPINY 440 +#define SPECIES_CHATOT 441 +#define SPECIES_SPIRITOMB 442 +#define SPECIES_GIBLE 443 +#define SPECIES_GABITE 444 +#define SPECIES_GARCHOMP 445 +#define SPECIES_MUNCHLAX 446 +#define SPECIES_RIOLU 447 +#define SPECIES_LUCARIO 448 +#define SPECIES_HIPPOPOTAS 449 +#define SPECIES_HIPPOWDON 450 +#define SPECIES_SKORUPI 451 +#define SPECIES_DRAPION 452 +#define SPECIES_CROAGUNK 453 +#define SPECIES_TOXICROAK 454 +#define SPECIES_CARNIVINE 455 +#define SPECIES_FINNEON 456 +#define SPECIES_LUMINEON 457 +#define SPECIES_MANTYKE 458 +#define SPECIES_SNOVER 459 +#define SPECIES_ABOMASNOW 460 +#define SPECIES_WEAVILE 461 +#define SPECIES_MAGNEZONE 462 +#define SPECIES_LICKILICKY 463 +#define SPECIES_RHYPERIOR 464 +#define SPECIES_TANGROWTH 465 +#define SPECIES_ELECTIVIRE 466 +#define SPECIES_MAGMORTAR 467 +#define SPECIES_TOGEKISS 468 +#define SPECIES_YANMEGA 469 +#define SPECIES_LEAFEON 470 +#define SPECIES_GLACEON 471 +#define SPECIES_GLISCOR 472 +#define SPECIES_MAMOSWINE 473 +#define SPECIES_PORYGON_Z 474 +#define SPECIES_GALLADE 475 +#define SPECIES_PROBOPASS 476 +#define SPECIES_DUSKNOIR 477 +#define SPECIES_FROSLASS 478 +#define SPECIES_ROTOM 479 +#define SPECIES_UXIE 480 +#define SPECIES_MESPRIT 481 +#define SPECIES_AZELF 482 +#define SPECIES_DIALGA 483 +#define SPECIES_PALKIA 484 +#define SPECIES_HEATRAN 485 +#define SPECIES_REGIGIGAS 486 +#define SPECIES_GIRATINA 487 +#define SPECIES_CRESSELIA 488 +#define SPECIES_PHIONE 489 +#define SPECIES_MANAPHY 490 +#define SPECIES_DARKRAI 491 +#define SPECIES_SHAYMIN 492 +#define SPECIES_ARCEUS 493 -#define NATIONAL_DEX_COUNT SPECIES_ARCEUS +#define NATIONAL_DEX_COUNT SPECIES_ARCEUS #define SPECIES_EGG 494 #define SPECIES_MANAPHY_EGG 495 @@ -515,6 +515,6 @@ #define SPECIES_WORMADAM_SANDY 499 #define SPECIES_WORMADAM_TRASH 500 -#define NUM_SPECIES SPECIES_WORMADAM_TRASH +#define NUM_SPECIES SPECIES_WORMADAM_TRASH -#endif //GUARD_CONSTANTS_SPECIES_H +#endif // GUARD_CONSTANTS_SPECIES_H diff --git a/include/constants/sprites.h b/include/constants/sprites.h index b534d9745..4260e230c 100644 --- a/include/constants/sprites.h +++ b/include/constants/sprites.h @@ -1,6 +1,6 @@ #ifndef POKEDIAMOND_CONSTANTS_SPRITES_H #define POKEDIAMOND_CONSTANTS_SPRITES_H -#define SPRITE_CAMERA_FOCUS 8192 +#define SPRITE_CAMERA_FOCUS 8192 -#endif //POKEDIAMOND_CONSTANTS_SPRITES_H \ No newline at end of file +#endif // POKEDIAMOND_CONSTANTS_SPRITES_H diff --git a/include/constants/trainer_classes.h b/include/constants/trainer_classes.h index f1a24bc22..b24c743fa 100644 --- a/include/constants/trainer_classes.h +++ b/include/constants/trainer_classes.h @@ -1,112 +1,112 @@ #ifndef POKEDIAMOND_CONSTANTS_TRAINER_CLASSES_H #define POKEDIAMOND_CONSTANTS_TRAINER_CLASSES_H -#define TRAINER_CLASS_PKMN_TRAINER_M 0 -#define TRAINER_CLASS_PKMN_TRAINER_F 1 -#define TRAINER_CLASS_YOUNGSTER 2 -#define TRAINER_CLASS_LASS 3 -#define TRAINER_CLASS_CAMPER 4 -#define TRAINER_CLASS_PICNICKER 5 -#define TRAINER_CLASS_BUG_CATCHER 6 -#define TRAINER_CLASS_AROMA_LADY 7 -#define TRAINER_CLASS_TWINS 8 -#define TRAINER_CLASS_HIKER 9 -#define TRAINER_CLASS_BATTLE_GIRL 10 -#define TRAINER_CLASS_FISHERMAN 11 -#define TRAINER_CLASS_CYCLIST_M 12 -#define TRAINER_CLASS_CYCLIST_F 13 -#define TRAINER_CLASS_BLACK_BELT 14 -#define TRAINER_CLASS_ARTIST 15 -#define TRAINER_CLASS_PKMN_BREEDER_M 16 -#define TRAINER_CLASS_PKMN_BREEDER_F 17 -#define TRAINER_CLASS_COWGIRL 18 -#define TRAINER_CLASS_JOGGER 19 -#define TRAINER_CLASS_POKEFAN_M 20 -#define TRAINER_CLASS_POKEFAN_F 21 -#define TRAINER_CLASS_POKE_KID 22 -#define TRAINER_CLASS_YOUNG_COUPLE 23 -#define TRAINER_CLASS_ACE_TRAINER_M 24 -#define TRAINER_CLASS_ACE_TRAINER_F 25 -#define TRAINER_CLASS_WAITRESS 26 -#define TRAINER_CLASS_VETERAN 27 -#define TRAINER_CLASS_NINJA_BOY 28 -#define TRAINER_CLASS_DRAGON_TAMER 29 -#define TRAINER_CLASS_BIRD_KEEPER 30 -#define TRAINER_CLASS_DOUBLE_TEAM 31 -#define TRAINER_CLASS_RICH_BOY 32 -#define TRAINER_CLASS_LADY 33 -#define TRAINER_CLASS_GENTLEMAN 34 -#define TRAINER_CLASS_SOCIALITE 35 -#define TRAINER_CLASS_BEAUTY 36 -#define TRAINER_CLASS_COLLECTOR 37 -#define TRAINER_CLASS_POLICEMAN 38 -#define TRAINER_CLASS_PKMN_RANGER_M 39 -#define TRAINER_CLASS_PKMN_RANGER_F 40 -#define TRAINER_CLASS_SCIENTIST 41 -#define TRAINER_CLASS_SWIMMER_M 42 -#define TRAINER_CLASS_SWIMMER_F 43 -#define TRAINER_CLASS_TUBER_M 44 -#define TRAINER_CLASS_TUBER_F 45 -#define TRAINER_CLASS_SAILOR 46 -#define TRAINER_CLASS_SIS_AND_BRO 47 -#define TRAINER_CLASS_RUIN_MANIAC 48 -#define TRAINER_CLASS_PSYCHIC_M 49 -#define TRAINER_CLASS_PSYCHIC_F 50 -#define TRAINER_CLASS_PI 51 -#define TRAINER_CLASS_GUITARIST 52 -#define TRAINER_CLASS_ACE_TRAINER_SNOW_M 53 -#define TRAINER_CLASS_ACE_TRAINER_SNOW_F 54 -#define TRAINER_CLASS_SKIER_M 55 -#define TRAINER_CLASS_SKIER_F 56 -#define TRAINER_CLASS_ROUGHNECK 57 -#define TRAINER_CLASS_CLOWN 58 -#define TRAINER_CLASS_WORKER 59 -#define TRAINER_CLASS_SCHOOL_KID_M 60 -#define TRAINER_CLASS_SCHOOL_KID_F 61 -#define TRAINER_CLASS_LEADER_ROARK 62 -#define TRAINER_CLASS_PKMN_TRAINER_BARRY 63 -#define TRAINER_CLASS_LEADER_BYRON 64 -#define TRAINER_CLASS_ELITE_FOUR_AARON 65 -#define TRAINER_CLASS_ELITE_FOUR_BERTHA 66 -#define TRAINER_CLASS_ELITE_FOUR_FLINT 67 -#define TRAINER_CLASS_ELITE_FOUR_LUCIEN 68 -#define TRAINER_CLASS_CHAMPION 69 -#define TRAINER_CLASS_BELLE__PA 70 -#define TRAINER_CLASS_RANCHER 71 -#define TRAINER_CLASS_COMMANDER_MARS 72 -#define TRAINER_CLASS_GALACTIC 73 -#define TRAINER_CLASS_LEADER_GARDENIA 74 -#define TRAINER_CLASS_LEADER_WAKE 75 -#define TRAINER_CLASS_LEADER_MAYLENE 76 -#define TRAINER_CLASS_LEADER_FANTINA 77 -#define TRAINER_CLASS_LEADER_CANDICE 78 -#define TRAINER_CLASS_LEADER_VOLKNER 79 -#define TRAINER_CLASS_PARASOL_LADY 80 -#define TRAINER_CLASS_WAITER 81 -#define TRAINER_CLASS_INTERVIEWERS 82 -#define TRAINER_CLASS_CAMERAMAN 83 -#define TRAINER_CLASS_REPORTER 84 -#define TRAINER_CLASS_IDOL 85 -#define TRAINER_CLASS_GALACTIC_BOSS 86 -#define TRAINER_CLASS_COMMANDER_JUPITER 87 -#define TRAINER_CLASS_COMMANDER_SATURN 88 -#define TRAINER_CLASS_GALACTIC_F 89 -#define TRAINER_CLASS_PKMN_TRAINER_CHERYL 90 -#define TRAINER_CLASS_PKMN_TRAINER_RILEY 91 -#define TRAINER_CLASS_PKMN_TRAINER_MARLEY 92 -#define TRAINER_CLASS_PKMN_TRAINER_BUCK 93 -#define TRAINER_CLASS_PKMN_TRAINER_MIRA 94 -#define TRAINER_CLASS_PKMN_TRAINER_LUCAS 95 -#define TRAINER_CLASS_PKMN_TRAINER_DAWN 96 -#define TRAINER_CLASS_TOWER_TYCOON 97 +#define TRAINER_CLASS_PKMN_TRAINER_M 0 +#define TRAINER_CLASS_PKMN_TRAINER_F 1 +#define TRAINER_CLASS_YOUNGSTER 2 +#define TRAINER_CLASS_LASS 3 +#define TRAINER_CLASS_CAMPER 4 +#define TRAINER_CLASS_PICNICKER 5 +#define TRAINER_CLASS_BUG_CATCHER 6 +#define TRAINER_CLASS_AROMA_LADY 7 +#define TRAINER_CLASS_TWINS 8 +#define TRAINER_CLASS_HIKER 9 +#define TRAINER_CLASS_BATTLE_GIRL 10 +#define TRAINER_CLASS_FISHERMAN 11 +#define TRAINER_CLASS_CYCLIST_M 12 +#define TRAINER_CLASS_CYCLIST_F 13 +#define TRAINER_CLASS_BLACK_BELT 14 +#define TRAINER_CLASS_ARTIST 15 +#define TRAINER_CLASS_PKMN_BREEDER_M 16 +#define TRAINER_CLASS_PKMN_BREEDER_F 17 +#define TRAINER_CLASS_COWGIRL 18 +#define TRAINER_CLASS_JOGGER 19 +#define TRAINER_CLASS_POKEFAN_M 20 +#define TRAINER_CLASS_POKEFAN_F 21 +#define TRAINER_CLASS_POKE_KID 22 +#define TRAINER_CLASS_YOUNG_COUPLE 23 +#define TRAINER_CLASS_ACE_TRAINER_M 24 +#define TRAINER_CLASS_ACE_TRAINER_F 25 +#define TRAINER_CLASS_WAITRESS 26 +#define TRAINER_CLASS_VETERAN 27 +#define TRAINER_CLASS_NINJA_BOY 28 +#define TRAINER_CLASS_DRAGON_TAMER 29 +#define TRAINER_CLASS_BIRD_KEEPER 30 +#define TRAINER_CLASS_DOUBLE_TEAM 31 +#define TRAINER_CLASS_RICH_BOY 32 +#define TRAINER_CLASS_LADY 33 +#define TRAINER_CLASS_GENTLEMAN 34 +#define TRAINER_CLASS_SOCIALITE 35 +#define TRAINER_CLASS_BEAUTY 36 +#define TRAINER_CLASS_COLLECTOR 37 +#define TRAINER_CLASS_POLICEMAN 38 +#define TRAINER_CLASS_PKMN_RANGER_M 39 +#define TRAINER_CLASS_PKMN_RANGER_F 40 +#define TRAINER_CLASS_SCIENTIST 41 +#define TRAINER_CLASS_SWIMMER_M 42 +#define TRAINER_CLASS_SWIMMER_F 43 +#define TRAINER_CLASS_TUBER_M 44 +#define TRAINER_CLASS_TUBER_F 45 +#define TRAINER_CLASS_SAILOR 46 +#define TRAINER_CLASS_SIS_AND_BRO 47 +#define TRAINER_CLASS_RUIN_MANIAC 48 +#define TRAINER_CLASS_PSYCHIC_M 49 +#define TRAINER_CLASS_PSYCHIC_F 50 +#define TRAINER_CLASS_PI 51 +#define TRAINER_CLASS_GUITARIST 52 +#define TRAINER_CLASS_ACE_TRAINER_SNOW_M 53 +#define TRAINER_CLASS_ACE_TRAINER_SNOW_F 54 +#define TRAINER_CLASS_SKIER_M 55 +#define TRAINER_CLASS_SKIER_F 56 +#define TRAINER_CLASS_ROUGHNECK 57 +#define TRAINER_CLASS_CLOWN 58 +#define TRAINER_CLASS_WORKER 59 +#define TRAINER_CLASS_SCHOOL_KID_M 60 +#define TRAINER_CLASS_SCHOOL_KID_F 61 +#define TRAINER_CLASS_LEADER_ROARK 62 +#define TRAINER_CLASS_PKMN_TRAINER_BARRY 63 +#define TRAINER_CLASS_LEADER_BYRON 64 +#define TRAINER_CLASS_ELITE_FOUR_AARON 65 +#define TRAINER_CLASS_ELITE_FOUR_BERTHA 66 +#define TRAINER_CLASS_ELITE_FOUR_FLINT 67 +#define TRAINER_CLASS_ELITE_FOUR_LUCIEN 68 +#define TRAINER_CLASS_CHAMPION 69 +#define TRAINER_CLASS_BELLE__PA 70 +#define TRAINER_CLASS_RANCHER 71 +#define TRAINER_CLASS_COMMANDER_MARS 72 +#define TRAINER_CLASS_GALACTIC 73 +#define TRAINER_CLASS_LEADER_GARDENIA 74 +#define TRAINER_CLASS_LEADER_WAKE 75 +#define TRAINER_CLASS_LEADER_MAYLENE 76 +#define TRAINER_CLASS_LEADER_FANTINA 77 +#define TRAINER_CLASS_LEADER_CANDICE 78 +#define TRAINER_CLASS_LEADER_VOLKNER 79 +#define TRAINER_CLASS_PARASOL_LADY 80 +#define TRAINER_CLASS_WAITER 81 +#define TRAINER_CLASS_INTERVIEWERS 82 +#define TRAINER_CLASS_CAMERAMAN 83 +#define TRAINER_CLASS_REPORTER 84 +#define TRAINER_CLASS_IDOL 85 +#define TRAINER_CLASS_GALACTIC_BOSS 86 +#define TRAINER_CLASS_COMMANDER_JUPITER 87 +#define TRAINER_CLASS_COMMANDER_SATURN 88 +#define TRAINER_CLASS_GALACTIC_F 89 +#define TRAINER_CLASS_PKMN_TRAINER_CHERYL 90 +#define TRAINER_CLASS_PKMN_TRAINER_RILEY 91 +#define TRAINER_CLASS_PKMN_TRAINER_MARLEY 92 +#define TRAINER_CLASS_PKMN_TRAINER_BUCK 93 +#define TRAINER_CLASS_PKMN_TRAINER_MIRA 94 +#define TRAINER_CLASS_PKMN_TRAINER_LUCAS 95 +#define TRAINER_CLASS_PKMN_TRAINER_DAWN 96 +#define TRAINER_CLASS_TOWER_TYCOON 97 -#define TRAINER_BACKPIC_LUCAS 0 -#define TRAINER_BACKPIC_DAWN 1 -#define TRAINER_BACKPIC_BARRY 2 -#define TRAINER_BACKPIC_CHERYL 3 -#define TRAINER_BACKPIC_RILEY 4 -#define TRAINER_BACKPIC_MARLEY 5 -#define TRAINER_BACKPIC_BUCK 6 -#define TRAINER_BACKPIC_MIRA 7 +#define TRAINER_BACKPIC_LUCAS 0 +#define TRAINER_BACKPIC_DAWN 1 +#define TRAINER_BACKPIC_BARRY 2 +#define TRAINER_BACKPIC_CHERYL 3 +#define TRAINER_BACKPIC_RILEY 4 +#define TRAINER_BACKPIC_MARLEY 5 +#define TRAINER_BACKPIC_BUCK 6 +#define TRAINER_BACKPIC_MIRA 7 -#endif //POKEDIAMOND_CONSTANTS_TRAINER_CLASSES_H +#endif // POKEDIAMOND_CONSTANTS_TRAINER_CLASSES_H diff --git a/include/constants/trainers.h b/include/constants/trainers.h index d8f480179..b1c89b5d1 100644 --- a/include/constants/trainers.h +++ b/include/constants/trainers.h @@ -1,854 +1,854 @@ #ifndef POKEDIAMOND_CONSTANTS_TRAINERS_H #define POKEDIAMOND_CONSTANTS_TRAINERS_H -#define TRAINER_YOUNGSTER_TRISTAN 1 -#define TRAINER_YOUNGSTER_LOGAN 2 -#define TRAINER_LASS_NATALIE 3 -#define TRAINER_YOUNGSTER_MICHAEL 4 -#define TRAINER_CAMPER_MICKEY 5 -#define TRAINER_CAMPER_MICKEY_2 6 -#define TRAINER_PICNICKER_ANGELICA 7 -#define TRAINER_PICNICKER_ANGELICA_2 8 -#define TRAINER_YOUNGSTER_MICKEY 9 -#define TRAINER_YOUNGSTER_TYLER 10 -#define TRAINER_LASS_SAMANTHA 11 -#define TRAINER_LASS_SARAH 12 -#define TRAINER_BUG_CATCHER_BRANDON 13 -#define TRAINER_AROMA_LADY_TAYLOR 14 -#define TRAINER_TWINS_LIV_LIZ 15 -#define TRAINER_CAMPER_JACOB 16 -#define TRAINER_PICNICKER_SIENA 17 -#define TRAINER_HIKER_DANIEL 18 -#define TRAINER_HIKER_NICHOLAS 19 -#define TRAINER_BATTLE_GIRL_KELSEY 20 -#define TRAINER_AROMA_LADY_ELIZABETH 21 -#define TRAINER_FISHERMAN_ANDREW 22 -#define TRAINER_FISHERMAN_JOSEPH 23 -#define TRAINER_FISHERMAN_ZACHARY 24 -#define TRAINER_CYCLIST_M_AXEL 25 -#define TRAINER_CYCLIST_M_JAMES 26 -#define TRAINER_CYCLIST_M_JOHN 27 -#define TRAINER_CYCLIST_M_RYAN 28 -#define TRAINER_CYCLIST_F_MEGAN 29 -#define TRAINER_CYCLIST_F_NICOLE 30 -#define TRAINER_CYCLIST_F_KAYLA 31 -#define TRAINER_CYCLIST_F_RACHEL 32 -#define TRAINER_YOUNGSTER_AUSTIN 33 -#define TRAINER_CAMPER_ANTHONY 34 -#define TRAINER_PICNICKER_LAUREN 35 -#define TRAINER_HIKER_KEVIN 36 -#define TRAINER_HIKER_JUSTIN 37 -#define TRAINER_BATTLE_GIRL_HELEN 38 -#define TRAINER_HIKER_ROBERT 39 -#define TRAINER_HIKER_ALEXANDER 40 -#define TRAINER_HIKER_JONATHAN 41 -#define TRAINER_BLACK_BELT_KYLE 42 -#define TRAINER_FISHERMAN_CODY 43 -#define TRAINER_AROMA_LADY_HANNAH 44 -#define TRAINER_ARTIST_WILLIAM 45 -#define TRAINER_PKMN_BREEDER_M_ALBERT 46 -#define TRAINER_PKMN_BREEDER_F_JENNIFER 47 -#define TRAINER_COWGIRL_SHELLEY 48 -#define TRAINER_JOGGER_RICHARD 49 -#define TRAINER_POKEFAN_M_MICKEY 50 -#define TRAINER_POKEFAN_F_ANGELICA 51 -#define TRAINER_YOUNGSTER_MICKEY_2 52 -#define TRAINER_POKE_KID_DANIELLE 53 -#define TRAINER_FISHERMAN_MICKEY 54 -#define TRAINER_YOUNG_COUPLE_TY_SUE 55 -#define TRAINER_PKMN_BREEDER_M_KAHLIL 56 -#define TRAINER_PKMN_BREEDER_F_AMBER 57 -#define TRAINER_COWGIRL_ANGELICA 58 -#define TRAINER_JOGGER_MICKEY 59 -#define TRAINER_POKEFAN_M_MICKEY_2 60 -#define TRAINER_POKEFAN_F_ANGELICA_2 61 -#define TRAINER_ACE_TRAINER_M_MICKEY 62 -#define TRAINER_ACE_TRAINER_F_ANGELICA 63 -#define TRAINER_WAITRESS_ANGELICA 64 -#define TRAINER_TWINS_TERI_TIA 65 -#define TRAINER_ACE_TRAINER_M_ERNEST 66 -#define TRAINER_ACE_TRAINER_F_ALYSSA 67 -#define TRAINER_VETERAN_BRIAN 68 -#define TRAINER_BLACK_BELT_ADAM 69 -#define TRAINER_NINJA_BOY_JOEL 70 -#define TRAINER_NINJA_BOY_NATHAN 71 -#define TRAINER_NINJA_BOY_DAVIDO 72 -#define TRAINER_DRAGON_TAMER_PATRICK 73 -#define TRAINER_BIRD_KEEPER_BRIANNA 74 -#define TRAINER_DOUBLE_TEAM_ZAC_JEN 75 -#define TRAINER_BIRD_KEEPER_ALEXANDRA 76 -#define TRAINER_BATTLE_GIRL_ANGELICA 77 -#define TRAINER_NINJA_BOY_ZACH 78 -#define TRAINER_BLACK_BELT_SEAN 79 -#define TRAINER_NINJA_BOY_NICK 80 -#define TRAINER_BIRD_KEEPER_KATHERINE 81 -#define TRAINER_RICH_BOY_JASON 82 -#define TRAINER_LADY_MELISSA 83 -#define TRAINER_GENTLEMAN_JEREMY 84 -#define TRAINER_SOCIALITE_REINA 85 -#define TRAINER_BEAUTY_ANGELICA 86 -#define TRAINER_COLLECTOR_MICKEY 87 -#define TRAINER_POLICEMAN_BOBBY 88 -#define TRAINER_POLICEMAN_ALEX 89 -#define TRAINER_POLICEMAN_DYLAN 90 -#define TRAINER_FISHERMAN_JUAN 91 -#define TRAINER_FISHERMAN_CAMERON 92 -#define TRAINER_FISHERMAN_TRAVIS 93 -#define TRAINER_PKMN_RANGER_M_TAYLOR 94 -#define TRAINER_PKMN_RANGER_M_JEFFREY 95 -#define TRAINER_PKMN_RANGER_F_ALLISON 96 -#define TRAINER_PKMN_RANGER_F_ANGELICA 97 -#define TRAINER_SCIENTIST_MICKEY 98 -#define TRAINER_SCIENTIST_STEFANO 99 -#define TRAINER_YOUNGSTER_MICKEY_3 100 -#define TRAINER_YOUNGSTER_MICKEY_4 101 -#define TRAINER_POLICEMAN_CALEB 102 -#define TRAINER_SWIMMER_M_SHELTIN 103 -#define TRAINER_SWIMMER_M_EVAN 104 -#define TRAINER_SWIMMER_F_HALEY 105 -#define TRAINER_SWIMMER_F_MARY 106 -#define TRAINER_TUBER_M_JARED 107 -#define TRAINER_TUBER_F_CHELSEA 108 -#define TRAINER_BATTLE_GIRL_ANGELICA_2 109 -#define TRAINER_SAILOR_PAUL 110 -#define TRAINER_FISHERMAN_KENNETH 111 -#define TRAINER_SIS_AND_BRO_TARA_TIM 112 -#define TRAINER_RUIN_MANIAC_BRYAN 113 -#define TRAINER_RUIN_MANIAC_HUNTER 114 -#define TRAINER_HIKER_MICKEY 115 -#define TRAINER_VETERAN_MICKEY 116 -#define TRAINER_CAMPER_MICKEY_3 117 -#define TRAINER_PICNICKER_ANGELICA_3 118 -#define TRAINER_PSYCHIC_M_MITCHELL 119 -#define TRAINER_PSYCHIC_F_ABIGAIL 120 -#define TRAINER_PI_CARLOS 121 -#define TRAINER_GUITARIST_MICKEY 122 -#define TRAINER_PI_MICKEY 123 -#define TRAINER_BEAUTY_ANGELICA_2 124 -#define TRAINER_BEAUTY_ANGELICA_3 125 -#define TRAINER_BLACK_BELT_MICKEY 126 -#define TRAINER_BLACK_BELT_GREGORY 127 -#define TRAINER_BLACK_BELT_DEREK 128 -#define TRAINER_BLACK_BELT_NATHANIEL 129 -#define TRAINER_JOGGER_SCOTT 130 -#define TRAINER_BIRD_KEEPER_ANGELICA 131 -#define TRAINER_ACE_TRAINER_SNOW_M_BLAKE 132 -#define TRAINER_ACE_TRAINER_SNOW_M_GARRETT 133 -#define TRAINER_ACE_TRAINER_SNOW_F_LAURA 134 -#define TRAINER_ACE_TRAINER_SNOW_F_MARIA 135 -#define TRAINER_SKIER_M_BRADLEY 136 -#define TRAINER_SKIER_M_EDWARD 137 -#define TRAINER_SKIER_F_KAITLYN 138 -#define TRAINER_SKIER_F_ANDREA 139 -#define TRAINER_ACE_TRAINER_SNOW_M_DALTON 140 -#define TRAINER_ACE_TRAINER_SNOW_F_OLIVIA 141 -#define TRAINER_SKIER_M_SHAWN 142 -#define TRAINER_SKIER_M_BJORN 143 -#define TRAINER_SKIER_F_LEXIE 144 -#define TRAINER_SKIER_F_MADISON 145 -#define TRAINER_NINJA_BOY_ANTONIO 146 -#define TRAINER_NINJA_BOY_ETHAN 147 -#define TRAINER_BLACK_BELT_LUKE 148 -#define TRAINER_SWIMMER_M_MICKEY 149 -#define TRAINER_SWIMMER_M_MICKEY_2 150 -#define TRAINER_SWIMMER_F_ANGELICA 151 -#define TRAINER_SWIMMER_F_ANGELICA_2 152 -#define TRAINER_FISHERMAN_MIGUEL 153 -#define TRAINER_FISHERMAN_LUC 154 -#define TRAINER_SIS_AND_BRO_TARA_TIM_2 155 -#define TRAINER_SWIMMER_M_MICKEY_3 156 -#define TRAINER_SWIMMER_M_MICKEY_4 157 -#define TRAINER_SWIMMER_F_ANGELICA_3 158 -#define TRAINER_SWIMMER_M_ADRIAN 159 -#define TRAINER_SWIMMER_M_ERIK 160 -#define TRAINER_SWIMMER_M_VINCENT 161 -#define TRAINER_SWIMMER_F_JESSICA 162 -#define TRAINER_SWIMMER_F_ERICA 163 -#define TRAINER_SWIMMER_F_KATELYN 164 -#define TRAINER_SIS_AND_BRO_TARA_TIM_3 165 -#define TRAINER_SWIMMER_M_DILLON 166 -#define TRAINER_SWIMMER_F_VANESSA 167 -#define TRAINER_FISHERMAN_CORY 168 -#define TRAINER_RUIN_MANIAC_MICKEY 169 -#define TRAINER_ACE_TRAINER_M_JAKE 170 -#define TRAINER_ACE_TRAINER_F_SHANNON 171 -#define TRAINER_FISHERMAN_BRETT 172 -#define TRAINER_FISHERMAN_ALEC 173 -#define TRAINER_FISHERMAN_GEORGE 174 -#define TRAINER_FISHERMAN_COLE 175 -#define TRAINER_ROUGHNECK_MICKEY 176 -#define TRAINER_ROUGHNECK_MICKEY_2 177 -#define TRAINER_GUITARIST_MICKEY_2 178 -#define TRAINER_CLOWN_MICKEY 179 -#define TRAINER_SAILOR_LUTHER 180 -#define TRAINER_ARTIST_MICKEY 181 -#define TRAINER_YOUNG_COUPLE_TARA_TIM 182 -#define TRAINER_SWIMMER_M_WESLEY 183 -#define TRAINER_SWIMMER_M_RICARDO 184 -#define TRAINER_SWIMMER_M_FRANCISCO 185 -#define TRAINER_SWIMMER_M_COLTON 186 -#define TRAINER_SWIMMER_M_TROY 187 -#define TRAINER_SWIMMER_M_OSCAR 188 -#define TRAINER_SWIMMER_F_MIRANDA 189 -#define TRAINER_SWIMMER_F_AUBREE 190 -#define TRAINER_SWIMMER_F_PAIGE 191 -#define TRAINER_SWIMMER_F_CRYSTAL 192 -#define TRAINER_SWIMMER_F_CASSANDRA 193 -#define TRAINER_SWIMMER_F_GABRIELLE 194 -#define TRAINER_WORKER_COLIN 195 -#define TRAINER_WORKER_MASON 196 -#define TRAINER_WORKER_MICKEY 197 -#define TRAINER_SCIENTIST_MICKEY_2 198 -#define TRAINER_SCIENTIST_MICKEY_3 199 -#define TRAINER_SCIENTIST_MICKEY_4 200 -#define TRAINER_BUG_CATCHER_JACK 201 -#define TRAINER_BUG_CATCHER_PHILLIP 202 -#define TRAINER_BUG_CATCHER_DONALD 203 -#define TRAINER_LASS_BRIANA 204 -#define TRAINER_PSYCHIC_M_ELIJAH 205 -#define TRAINER_PSYCHIC_F_LINDSEY 206 -#define TRAINER_YOUNG_COUPLE_TARA_TIM_2 207 -#define TRAINER_WORKER_MICKEY_2 208 -#define TRAINER_WORKER_MICKEY_3 209 -#define TRAINER_WORKER_MICKEY_4 210 -#define TRAINER_ACE_TRAINER_SNOW_M_MICKEY 211 -#define TRAINER_ACE_TRAINER_SNOW_M_MICKEY_2 212 -#define TRAINER_ACE_TRAINER_SNOW_F_ANGELICA 213 -#define TRAINER_ACE_TRAINER_SNOW_F_ANGELICA_2 214 -#define TRAINER_VETERAN_MICKEY_2 215 -#define TRAINER_VETERAN_MICKEY_3 216 -#define TRAINER_PSYCHIC_M_MICKEY 217 -#define TRAINER_PSYCHIC_F_ANGELICA 218 -#define TRAINER_DRAGON_TAMER_MICKEY 219 -#define TRAINER_SAILOR_MICKEY 220 -#define TRAINER_SCHOOL_KID_M_MICKEY 221 -#define TRAINER_SCHOOL_KID_F_ANGELICA 222 -#define TRAINER_YOUNG_COUPLE_TARA_TIM_3 223 -#define TRAINER_ACE_TRAINER_M_OMAR 224 -#define TRAINER_ACE_TRAINER_M_HENRY 225 -#define TRAINER_ACE_TRAINER_F_MARIAH 226 -#define TRAINER_ACE_TRAINER_F_SYDNEY 227 -#define TRAINER_VETERAN_EDGAR 228 -#define TRAINER_VETERAN_CLAYTON 229 -#define TRAINER_DRAGON_TAMER_ONDREJ 230 -#define TRAINER_DRAGON_TAMER_CLINTON 231 -#define TRAINER_BLACK_BELT_DAVID 232 -#define TRAINER_BIRD_KEEPER_HANA 233 -#define TRAINER_PSYCHIC_M_BRYCE 234 -#define TRAINER_PSYCHIC_F_VALENCIA 235 -#define TRAINER_DOUBLE_TEAM_JO_PAT 236 -#define TRAINER_DOUBLE_TEAM_AL_KAY 237 -#define TRAINER_YOUNGSTER_MICKEY_5 238 -#define TRAINER_LASS_ANGELICA 239 -#define TRAINER_VETERAN_GRANT 240 -#define TRAINER_FISHERMAN_MICKEY_2 241 -#define TRAINER_SAILOR_MICKEY_2 242 -#define TRAINER_BEAUTY_ANGELICA_4 243 -#define TRAINER_YOUNGSTER_JONATHON 244 -#define TRAINER_YOUNGSTER_DARIUS 245 -#define TRAINER_LEADER_ROARK_ROARK 246 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC 247 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_2 248 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_3 249 -#define TRAINER_LEADER_BYRON_BYRON 250 -#define TRAINER_ACE_TRAINER_F_ANGELICA_2 251 -#define TRAINER_CAMPER_MICKEY_4 252 -#define TRAINER_CAMPER_MICKEY_5 253 -#define TRAINER_CAMPER_MICKEY_6 254 -#define TRAINER_CAMPER_MICKEY_7 255 -#define TRAINER_WORKER_JACKSON 256 -#define TRAINER_WORKER_GARY 257 -#define TRAINER_BLACK_BELT_PHILIP 258 -#define TRAINER_AROMA_LADY_JENNA 259 -#define TRAINER_AROMA_LADY_ANGELA 260 -#define TRAINER_ELITE_FOUR_AARON_AARON 261 -#define TRAINER_ELITE_FOUR_BERTHA_BERTHA 262 -#define TRAINER_ELITE_FOUR_FLINT_FLINT 263 -#define TRAINER_ELITE_FOUR_LUCIEN_LUCIAN 264 -#define TRAINER_CAMPER_CURTIS 265 -#define TRAINER_CAMPER_DREW 266 -#define TRAINER_CHAMPION_CYNTHIA 267 -#define TRAINER_ACE_TRAINER_SNOW_M_SERGIO 268 -#define TRAINER_ACE_TRAINER_SNOW_M_ISAIAH 269 -#define TRAINER_ACE_TRAINER_SNOW_F_SAVANNAH 270 -#define TRAINER_ACE_TRAINER_SNOW_F_ALICIA 271 -#define TRAINER_COLLECTOR_DOUGLAS 272 -#define TRAINER_COLLECTOR_BRADY 273 -#define TRAINER_COLLECTOR_IVAN 274 -#define TRAINER_COLLECTOR_FERNANDO 275 -#define TRAINER_COLLECTOR_EDWIN 276 -#define TRAINER_DRAGON_TAMER_HAYDEN 277 -#define TRAINER_ACE_TRAINER_M_DENNIS 278 -#define TRAINER_ACE_TRAINER_M_CESAR 279 -#define TRAINER_ACE_TRAINER_M_ALLEN 280 -#define TRAINER_ACE_TRAINER_M_ZACHERY 281 -#define TRAINER_ACE_TRAINER_M_RUBEN 282 -#define TRAINER_ACE_TRAINER_F_BREANNA 283 -#define TRAINER_ACE_TRAINER_F_CATHERINE 284 -#define TRAINER_ACE_TRAINER_F_DESTINY 285 -#define TRAINER_ACE_TRAINER_F_JAMIE 286 -#define TRAINER_ACE_TRAINER_F_MAYA 287 -#define TRAINER_PSYCHIC_M_MAXWELL 288 -#define TRAINER_PSYCHIC_F_BRITTNEY 289 -#define TRAINER_BELLE__PA_AVA_MATT 290 -#define TRAINER_RANCHER_MICKEY 291 -#define TRAINER_RANCHER_MARCO 292 -#define TRAINER_FISHERMAN_ERICK 293 -#define TRAINER_TWINS_EMMA_LIL 294 -#define TRAINER_COMMANDER_MARS_MARS 295 -#define TRAINER_GALACTIC_GRUNT 296 -#define TRAINER_GALACTIC_GRUNT_2 297 -#define TRAINER_GALACTIC_GRUNT_3 298 -#define TRAINER_GALACTIC_GRUNT_4 299 -#define TRAINER_GUITARIST_TONY 300 -#define TRAINER_GUITARIST_JERRY 301 -#define TRAINER_GUITARIST_PRESTON 302 -#define TRAINER_GUITARIST_LONNIE 303 -#define TRAINER_RUIN_MANIAC_CALVIN 304 -#define TRAINER_RUIN_MANIAC_LARRY 305 -#define TRAINER_JOGGER_WYATT 306 -#define TRAINER_JOGGER_CRAIG 307 -#define TRAINER_JOGGER_RAUL 308 -#define TRAINER_BLACK_BELT_COLBY 309 -#define TRAINER_BLACK_BELT_DARREN 310 -#define TRAINER_BLACK_BELT_RAFAEL 311 -#define TRAINER_BLACK_BELT_JEFFERY 312 -#define TRAINER_BLACK_BELT_CARL 313 -#define TRAINER_BLACK_BELT_RICKY 314 -#define TRAINER_LEADER_GARDENIA_GARDENIA 315 -#define TRAINER_LEADER_WAKE_WAKE 316 -#define TRAINER_LEADER_MAYLENE_MAYLENE 317 -#define TRAINER_LEADER_FANTINA_FANTINA 318 -#define TRAINER_LEADER_CANDICE_CANDICE 319 -#define TRAINER_LEADER_VOLKNER_VOLKNER 320 -#define TRAINER_LASS_ANGELICA_2 321 -#define TRAINER_LASS_MADELINE 322 -#define TRAINER_LASS_KAITLIN 323 -#define TRAINER_LASS_CAROLINE 324 -#define TRAINER_LASS_MOLLY 325 -#define TRAINER_HIKER_LOUIS 326 -#define TRAINER_PARASOL_LADY_ALEXA 327 -#define TRAINER_PARASOL_LADY_SABRINA 328 -#define TRAINER_PICNICKER_DIANA 329 -#define TRAINER_PICNICKER_CHEYENNE 330 -#define TRAINER_POKE_KID_MEGHAN 331 -#define TRAINER_POLICEMAN_DANNY 332 -#define TRAINER_POLICEMAN_THOMAS 333 -#define TRAINER_RICH_BOY_MICKEY 334 -#define TRAINER_RICH_BOY_TREY 335 -#define TRAINER_LADY_ANGELICA 336 -#define TRAINER_SAILOR_MARC 337 -#define TRAINER_SAILOR_SKYLER 338 -#define TRAINER_SAILOR_DAMIAN 339 -#define TRAINER_SCHOOL_KID_M_CHANCE 340 -#define TRAINER_SCHOOL_KID_M_FORREST 341 -#define TRAINER_SCHOOL_KID_M_HARRISON 342 -#define TRAINER_SCHOOL_KID_F_MACKENZIE 343 -#define TRAINER_SCHOOL_KID_F_TIERA 344 -#define TRAINER_SCHOOL_KID_F_CHRISTINE 345 -#define TRAINER_BEAUTY_CYNDY 346 -#define TRAINER_BEAUTY_ANGELICA_5 347 -#define TRAINER_BEAUTY_LINDSAY 348 -#define TRAINER_SKIER_M_MICKEY 349 -#define TRAINER_SKIER_F_ANGELICA 350 -#define TRAINER_SWIMMER_M_MICKEY_5 351 -#define TRAINER_SWIMMER_M_MICKEY_6 352 -#define TRAINER_SWIMMER_F_ANGELICA_4 353 -#define TRAINER_SWIMMER_F_ANGELICA_5 354 -#define TRAINER_YOUNGSTER_DALLAS 355 -#define TRAINER_YOUNGSTER_SEBASTIAN 356 -#define TRAINER_YOUNGSTER_DONNY 357 -#define TRAINER_TUBER_M_TRENTON 358 -#define TRAINER_TUBER_M_CONNER 359 -#define TRAINER_TUBER_F_MARIEL 360 -#define TRAINER_TUBER_F_HOLLY 361 -#define TRAINER_VETERAN_ARMANDO 362 -#define TRAINER_WAITER_MICKEY 363 -#define TRAINER_WAITER_MICKEY_2 364 -#define TRAINER_WAITER_MICKEY_3 365 -#define TRAINER_WAITRESS_KATI 366 -#define TRAINER_WORKER_GERARDO 367 -#define TRAINER_INTERVIEWERS_ROXY_OLI 368 -#define TRAINER_CAMERAMAN_TEVIN 369 -#define TRAINER_REPORTER_KINSEY 370 -#define TRAINER_IDOL_GRACE 371 -#define TRAINER_BATTLE_GIRL_TYLER 372 -#define TRAINER_BIRD_KEEPER_AUTUMN 373 -#define TRAINER_PKMN_BREEDER_M_MICKEY 374 -#define TRAINER_PKMN_BREEDER_F_ANGELICA 375 -#define TRAINER_CAMERAMAN_MICKEY 376 -#define TRAINER_CAMPER_ZACKARY 377 -#define TRAINER_CAMPER_LAWRENCE 378 -#define TRAINER_CAMPER_DIEGO 379 -#define TRAINER_CAMPER_PARKER 380 -#define TRAINER_COLLECTOR_DOMINIQUE 381 -#define TRAINER_COLLECTOR_JAMAL 382 -#define TRAINER_COLLECTOR_TERRY 383 -#define TRAINER_POKEFAN_M_MICKEY_3 384 -#define TRAINER_POKEFAN_F_ANGELICA_3 385 -#define TRAINER_DRAGON_TAMER_JOE 386 -#define TRAINER_ACE_TRAINER_M_MICKEY_2 387 -#define TRAINER_ACE_TRAINER_M_JONAH 388 -#define TRAINER_ACE_TRAINER_M_MICAH 389 -#define TRAINER_ACE_TRAINER_M_ARTHUR 390 -#define TRAINER_ACE_TRAINER_F_ANGELICA_3 391 -#define TRAINER_ACE_TRAINER_F_BRENDA 392 -#define TRAINER_ACE_TRAINER_F_BRANDI 393 -#define TRAINER_ACE_TRAINER_F_CLARICE 394 -#define TRAINER_PSYCHIC_M_KODY 395 -#define TRAINER_PSYCHIC_M_LANDON 396 -#define TRAINER_PSYCHIC_M_DEANDRE 397 -#define TRAINER_PSYCHIC_F_RACHAEL 398 -#define TRAINER_PSYCHIC_F_DESIREE 399 -#define TRAINER_PSYCHIC_F_KENDRA 400 -#define TRAINER_FISHERMAN_WALTER 401 -#define TRAINER_GENTLEMAN_MICKEY 402 -#define TRAINER_GALACTIC_BOSS_CYRUS 403 -#define TRAINER_GALACTIC_BOSS_CYRUS_2 404 -#define TRAINER_COMMANDER_MARS_MARS_2 405 -#define TRAINER_COMMANDER_JUPITER_JUPITER 406 -#define TRAINER_COMMANDER_JUPITER_JUPITER_2 407 -#define TRAINER_COMMANDER_SATURN_SATURN 408 -#define TRAINER_COMMANDER_SATURN_SATURN_2 409 -#define TRAINER_GALACTIC_GRUNT_5 410 -#define TRAINER_GALACTIC_GRUNT_6 411 -#define TRAINER_GALACTIC_GRUNT_7 412 -#define TRAINER_GALACTIC_GRUNT_8 413 -#define TRAINER_GALACTIC_GRUNT_9 414 -#define TRAINER_GALACTIC_GRUNT_10 415 -#define TRAINER_GALACTIC_GRUNT_11 416 -#define TRAINER_GALACTIC_GRUNT_12 417 -#define TRAINER_GALACTIC_GRUNT_13 418 -#define TRAINER_GALACTIC_GRUNT_14 419 -#define TRAINER_GALACTIC_GRUNT_15 420 -#define TRAINER_GALACTIC_F_GRUNT 421 -#define TRAINER_GALACTIC_F_GRUNT_2 422 -#define TRAINER_GALACTIC_F_GRUNT_3 423 -#define TRAINER_GALACTIC_F_GRUNT_4 424 -#define TRAINER_GALACTIC_F_GRUNT_5 425 -#define TRAINER_GALACTIC_F_GRUNT_6 426 -#define TRAINER_GALACTIC_F_GRUNT_7 427 -#define TRAINER_GALACTIC_F_GRUNT_8 428 -#define TRAINER_GALACTIC_F_GRUNT_9 429 -#define TRAINER_GALACTIC_F_GRUNT_10 430 -#define TRAINER_GUITARIST_ARTURO 431 -#define TRAINER_GUITARIST_MICKEY_3 432 -#define TRAINER_GUITARIST_MICKEY_4 433 -#define TRAINER_GUITARIST_MICKEY_5 434 -#define TRAINER_GUITARIST_MICKEY_6 435 -#define TRAINER_GUITARIST_MICKEY_7 436 -#define TRAINER_IDOL_ANGELICA 437 -#define TRAINER_IDOL_ANGELICA_2 438 -#define TRAINER_IDOL_ANGELICA_3 439 -#define TRAINER_IDOL_ANGELICA_4 440 -#define TRAINER_RUIN_MANIAC_MICKEY_2 441 -#define TRAINER_RUIN_MANIAC_HARRY 442 -#define TRAINER_RUIN_MANIAC_GERALD 443 -#define TRAINER_BLACK_BELT_MILES 444 -#define TRAINER_BLACK_BELT_KENDAL 445 -#define TRAINER_BLACK_BELT_EDDIE 446 -#define TRAINER_BLACK_BELT_WILLIE 447 -#define TRAINER_SOCIALITE_ANGELICA 448 -#define TRAINER_LASS_ANGELICA_3 449 -#define TRAINER_LASS_CASSIDY 450 -#define TRAINER_HIKER_THEODORE 451 -#define TRAINER_HIKER_DAMON 452 -#define TRAINER_HIKER_MAURICE 453 -#define TRAINER_HIKER_REGINALD 454 -#define TRAINER_HIKER_LORENZO 455 -#define TRAINER_PICNICKER_KARINA 456 -#define TRAINER_PICNICKER_SUMMER 457 -#define TRAINER_PICNICKER_TORI 458 -#define TRAINER_PICNICKER_ANA 459 -#define TRAINER_CLOWN_LEE 460 -#define TRAINER_CLOWN_MICKEY_2 461 -#define TRAINER_CLOWN_MICKEY_3 462 -#define TRAINER_CLOWN_MICKEY_4 463 -#define TRAINER_CLOWN_MICKEY_5 464 -#define TRAINER_POKE_KID_ARIEL 465 -#define TRAINER_POLICEMAN_MICKEY 466 -#define TRAINER_RICH_BOY_MICKEY_2 467 -#define TRAINER_RICH_BOY_MICKEY_3 468 -#define TRAINER_LADY_ANGELICA_2 469 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_4 470 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_5 471 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_6 472 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_7 473 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_8 474 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_9 475 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_10 476 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_11 477 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_12 478 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_13 479 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_14 480 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_15 481 -#define TRAINER_SAILOR_ZACHARIAH 482 -#define TRAINER_SAILOR_SAMSON 483 -#define TRAINER_SCHOOL_KID_M_MICKEY_2 484 -#define TRAINER_SCHOOL_KID_F_ANGELICA_2 485 -#define TRAINER_SCIENTIST_SHAUN 486 -#define TRAINER_SCIENTIST_MICKEY_5 487 -#define TRAINER_NINJA_BOY_FABIAN 488 -#define TRAINER_NINJA_BOY_BRENNAN 489 -#define TRAINER_NINJA_BOY_BRUCE 490 -#define TRAINER_BEAUTY_DEVON 491 -#define TRAINER_BEAUTY_NICOLA 492 -#define TRAINER_SWIMMER_M_MICKEY_7 493 -#define TRAINER_SWIMMER_F_CLAIRE 494 -#define TRAINER_YOUNGSTER_MICKEY_6 495 -#define TRAINER_YOUNGSTER_WAYNE 496 -#define TRAINER_TUBER_M_JACKY 497 -#define TRAINER_TUBER_F_CAITLYN 498 -#define TRAINER_VETERAN_TERRELL 499 -#define TRAINER_VETERAN_BRENDEN 500 -#define TRAINER_WAITER_MICKEY_4 501 -#define TRAINER_WORKER_MICKEY_5 502 -#define TRAINER_WORKER_WILLY 503 -#define TRAINER_WORKER_BRADEN 504 -#define TRAINER_WORKER_BRENDON 505 -#define TRAINER_WORKER_QUENTIN 506 -#define TRAINER_GALACTIC_GRUNT_16 507 -#define TRAINER_GALACTIC_GRUNT_17 508 -#define TRAINER_GALACTIC_GRUNT_18 509 -#define TRAINER_GALACTIC_GRUNT_19 510 -#define TRAINER_GALACTIC_GRUNT_20 511 -#define TRAINER_GALACTIC_GRUNT_21 512 -#define TRAINER_GALACTIC_GRUNT_22 513 -#define TRAINER_GALACTIC_GRUNT_23 514 -#define TRAINER_GALACTIC_GRUNT_24 515 -#define TRAINER_GALACTIC_GRUNT_25 516 -#define TRAINER_GALACTIC_GRUNT_26 517 -#define TRAINER_GALACTIC_GRUNT_27 518 -#define TRAINER_GALACTIC_GRUNT_28 519 -#define TRAINER_GALACTIC_GRUNT_29 520 -#define TRAINER_GALACTIC_GRUNT_30 521 -#define TRAINER_GALACTIC_F_GRUNT_11 522 -#define TRAINER_GALACTIC_F_GRUNT_12 523 -#define TRAINER_GALACTIC_F_GRUNT_13 524 -#define TRAINER_GALACTIC_F_GRUNT_14 525 -#define TRAINER_GALACTIC_F_GRUNT_15 526 -#define TRAINER_GALACTIC_F_GRUNT_16 527 -#define TRAINER_COMMANDER_MARS_MARS_3 528 -#define TRAINER_ROUGHNECK_KIRBY 529 -#define TRAINER_POKEFAN_M_LEONARD 530 -#define TRAINER_POKEFAN_F_REBEKAH 531 -#define TRAINER_YOUNGSTER_OLIVER 532 -#define TRAINER_BELLE__PA_BETH_BOB 533 -#define TRAINER_YOUNG_COUPLE_MIKE_NAT 534 -#define TRAINER_AROMA_LADY_ALISON 535 -#define TRAINER_ARTIST_ISMAEL 536 -#define TRAINER_PKMN_BREEDER_F_KAYLEE 537 -#define TRAINER_CAMERAMAN_DARRYL 538 -#define TRAINER_COLLECTOR_EUGENE 539 -#define TRAINER_POKEFAN_F_MEREDITH 540 -#define TRAINER_PI_KENDRICK 541 -#define TRAINER_GENTLEMAN_LEONARDO 542 -#define TRAINER_SOCIALITE_REBECCA 543 -#define TRAINER_LASS_BLYTHE 544 -#define TRAINER_RICH_BOY_ROMAN 545 -#define TRAINER_LADY_KYLIE 546 -#define TRAINER_REPORTER_VALERIE 547 -#define TRAINER_SCHOOL_KID_M_ESTEBAN 548 -#define TRAINER_SCIENTIST_EMILIO 549 -#define TRAINER_BEAUTY_GABRIELLA 550 -#define TRAINER_BEAUTY_HARLEY 551 -#define TRAINER_VETERAN_EMANUEL 552 -#define TRAINER_RUIN_MANIAC_KARL 553 -#define TRAINER_BIRD_KEEPER_AUDREY 554 -#define TRAINER_BIRD_KEEPER_GENEVA 555 -#define TRAINER_BIRD_KEEPER_KRYSTAL 556 -#define TRAINER_DRAGON_TAMER_GEOFFREY 557 -#define TRAINER_DRAGON_TAMER_DARIEN 558 -#define TRAINER_DRAGON_TAMER_KEEGAN 559 -#define TRAINER_DRAGON_TAMER_STANLEY 560 -#define TRAINER_DRAGON_TAMER_DRAKE 561 -#define TRAINER_DRAGON_TAMER_KENNY 562 -#define TRAINER_ACE_TRAINER_M_RODOLFO 563 -#define TRAINER_ACE_TRAINER_M_SAUL 564 -#define TRAINER_ACE_TRAINER_M_JOSE 565 -#define TRAINER_ACE_TRAINER_M_FELIX 566 -#define TRAINER_ACE_TRAINER_M_QUINN 567 -#define TRAINER_ACE_TRAINER_M_GRAHAM 568 -#define TRAINER_ACE_TRAINER_M_KEENAN 569 -#define TRAINER_ACE_TRAINER_M_STEFAN 570 -#define TRAINER_ACE_TRAINER_M_SKYLAR 571 -#define TRAINER_ACE_TRAINER_M_ABEL 572 -#define TRAINER_ACE_TRAINER_F_DEANNA 573 -#define TRAINER_ACE_TRAINER_F_ARIANA 574 -#define TRAINER_ACE_TRAINER_F_DANA 575 -#define TRAINER_ACE_TRAINER_F_MIKAYLA 576 -#define TRAINER_ACE_TRAINER_F_MEAGAN 577 -#define TRAINER_ACE_TRAINER_F_SANDRA 578 -#define TRAINER_ACE_TRAINER_F_KASSANDRA 579 -#define TRAINER_ACE_TRAINER_F_JASMIN 580 -#define TRAINER_ACE_TRAINER_F_NATASHA 581 -#define TRAINER_ACE_TRAINER_F_MONIQUE 582 -#define TRAINER_PSYCHIC_M_CORBIN 583 -#define TRAINER_PSYCHIC_M_STERLING 584 -#define TRAINER_PSYCHIC_F_DAISY 585 -#define TRAINER_PSYCHIC_F_CHELSEY 586 -#define TRAINER_BLACK_BELT_DAVON 587 -#define TRAINER_BLACK_BELT_GRIFFIN 588 -#define TRAINER_BLACK_BELT_RAY 589 -#define TRAINER_BLACK_BELT_JARRETT 590 -#define TRAINER_PKMN_RANGER_M_KYLER 591 -#define TRAINER_PKMN_RANGER_M_DESHAWN 592 -#define TRAINER_PKMN_RANGER_M_DWAYNE 593 -#define TRAINER_PKMN_RANGER_F_ASHLEE 594 -#define TRAINER_PKMN_RANGER_F_FELICIA 595 -#define TRAINER_PKMN_RANGER_F_KRISTA 596 -#define TRAINER_SWIMMER_M_GLENN 597 -#define TRAINER_SWIMMER_M_KURT 598 -#define TRAINER_SWIMMER_M_SAM 599 -#define TRAINER_SWIMMER_M_WADE 600 -#define TRAINER_SWIMMER_F_JOANNA 601 -#define TRAINER_SWIMMER_F_SOPHIA 602 -#define TRAINER_SWIMMER_F_MALLORY 603 -#define TRAINER_SWIMMER_F_LYDIA 604 -#define TRAINER_VETERAN_MICKEY_4 605 -#define TRAINER_VETERAN_HARLAN 606 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_16 607 -#define TRAINER_PKMN_TRAINER_AROMA_LADY_CHERYL 608 -#define TRAINER_PKMN_TRAINER_RICH_BOY_RILEY 609 -#define TRAINER_PKMN_TRAINER_PICNICKER_MARLEY 610 -#define TRAINER_PKMN_TRAINER_CAMPER_BUCK 611 -#define TRAINER_PKMN_TRAINER_POKEKID_MIRA 612 -#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS 613 -#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_2 614 -#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_3 615 -#define TRAINER_PKMN_TRAINER_DAWN_DAWN 616 -#define TRAINER_PKMN_TRAINER_DAWN_DAWN_2 617 -#define TRAINER_PKMN_TRAINER_DAWN_DAWN_3 618 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_17 619 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_18 620 -#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_4 621 -#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_5 622 -#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_6 623 -#define TRAINER_PKMN_TRAINER_DAWN_DAWN_4 624 -#define TRAINER_PKMN_TRAINER_DAWN_DAWN_5 625 -#define TRAINER_PKMN_TRAINER_DAWN_DAWN_6 626 -#define TRAINER_AROMA_LADY_ELIZABETH_2 627 -#define TRAINER_AROMA_LADY_ELIZABETH_3 628 -#define TRAINER_AROMA_LADY_ELIZABETH_4 629 -#define TRAINER_ARTIST_KEVIN 630 -#define TRAINER_ARTIST_KEVIN_2 631 -#define TRAINER_ARTIST_KEVIN_3 632 -#define TRAINER_BATTLE_GIRL_HELEN_2 633 -#define TRAINER_BATTLE_GIRL_HELEN_3 634 -#define TRAINER_BATTLE_GIRL_HELEN_4 635 -#define TRAINER_BIRD_KEEPER_BRIANNA_2 636 -#define TRAINER_BIRD_KEEPER_BRIANNA_3 637 -#define TRAINER_BIRD_KEEPER_AUDREY_2 638 -#define TRAINER_PKMN_BREEDER_M_ALBERT_2 639 -#define TRAINER_PKMN_BREEDER_M_ALBERT_3 640 -#define TRAINER_PKMN_BREEDER_M_ALBERT_4 641 -#define TRAINER_PKMN_BREEDER_F_JENNIFER_2 642 -#define TRAINER_PKMN_BREEDER_F_JENNIFER_3 643 -#define TRAINER_PKMN_BREEDER_F_JENNIFER_4 644 -#define TRAINER_CAMPER_ZACKARY_2 645 -#define TRAINER_CAMPER_ZACKARY_3 646 -#define TRAINER_CAMPER_ZACKARY_4 647 -#define TRAINER_ACE_TRAINER_SNOW_M_DALTON_2 648 -#define TRAINER_ACE_TRAINER_SNOW_F_OLIVIA_2 649 -#define TRAINER_COLLECTOR_IVAN_2 650 -#define TRAINER_COWGIRL_ANGELICA_2 651 -#define TRAINER_COWGIRL_ANGELICA_3 652 -#define TRAINER_CYCLIST_M_JOHN_2 653 -#define TRAINER_CYCLIST_M_JOHN_3 654 -#define TRAINER_CYCLIST_M_JOHN_4 655 -#define TRAINER_CYCLIST_F_KAYLA_2 656 -#define TRAINER_CYCLIST_F_KAYLA_3 657 -#define TRAINER_CYCLIST_F_KAYLA_4 658 -#define TRAINER_DRAGON_TAMER_PATRICK_2 659 -#define TRAINER_DRAGON_TAMER_PATRICK_3 660 -#define TRAINER_DRAGON_TAMER_HAYDEN_2 661 -#define TRAINER_DRAGON_TAMER_GEOFFREY_2 662 -#define TRAINER_ACE_TRAINER_M_JAKE_2 663 -#define TRAINER_ACE_TRAINER_M_DENNIS_2 664 -#define TRAINER_ACE_TRAINER_M_DENNIS_3 665 -#define TRAINER_ACE_TRAINER_M_RODOLFO_2 666 -#define TRAINER_ACE_TRAINER_M_SAUL_2 667 -#define TRAINER_ACE_TRAINER_F_SHANNON_2 668 -#define TRAINER_ACE_TRAINER_F_MAYA_2 669 -#define TRAINER_ACE_TRAINER_F_MAYA_3 670 -#define TRAINER_ACE_TRAINER_F_DEANNA_2 671 -#define TRAINER_ACE_TRAINER_F_ARIANA_2 672 -#define TRAINER_PSYCHIC_M_MITCHELL_2 673 -#define TRAINER_PSYCHIC_M_MITCHELL_3 674 -#define TRAINER_PSYCHIC_M_MAXWELL_2 675 -#define TRAINER_PSYCHIC_M_CORBIN_2 676 -#define TRAINER_PSYCHIC_F_ABIGAIL_2 677 -#define TRAINER_PSYCHIC_F_ABIGAIL_3 678 -#define TRAINER_PSYCHIC_F_BRITTNEY_2 679 -#define TRAINER_PSYCHIC_F_DAISY_2 680 -#define TRAINER_RANCHER_MARCO_2 681 -#define TRAINER_RANCHER_MARCO_3 682 -#define TRAINER_FISHERMAN_JOSEPH_2 683 -#define TRAINER_FISHERMAN_JOSEPH_3 684 -#define TRAINER_FISHERMAN_MIGUEL_2 685 -#define TRAINER_FISHERMAN_ALEC_2 686 -#define TRAINER_TWINS_TERI_TIA_2 687 -#define TRAINER_TWINS_TERI_TIA_3 688 -#define TRAINER_PI_CARLOS_2 689 -#define TRAINER_PI_CARLOS_3 690 -#define TRAINER_GENTLEMAN_JEREMY_2 691 -#define TRAINER_GENTLEMAN_JEREMY_3 692 -#define TRAINER_GENTLEMAN_JEREMY_4 693 -#define TRAINER_GUITARIST_TONY_2 694 -#define TRAINER_RUIN_MANIAC_HARRY_2 695 -#define TRAINER_RUIN_MANIAC_HARRY_3 696 -#define TRAINER_JOGGER_CRAIG_2 697 -#define TRAINER_JOGGER_CRAIG_3 698 -#define TRAINER_BLACK_BELT_PHILIP_2 699 -#define TRAINER_BLACK_BELT_DAVON_2 700 -#define TRAINER_SOCIALITE_REINA_2 701 -#define TRAINER_SOCIALITE_REINA_3 702 -#define TRAINER_LASS_SAMANTHA_2 703 -#define TRAINER_LASS_SAMANTHA_3 704 -#define TRAINER_LASS_SAMANTHA_4 705 -#define TRAINER_LASS_MADELINE_2 706 -#define TRAINER_LASS_MADELINE_3 707 -#define TRAINER_LASS_MADELINE_4 708 -#define TRAINER_HIKER_THEODORE_2 709 -#define TRAINER_HIKER_THEODORE_3 710 -#define TRAINER_HIKER_THEODORE_4 711 -#define TRAINER_BUG_CATCHER_BRANDON_2 712 -#define TRAINER_BUG_CATCHER_BRANDON_3 713 -#define TRAINER_BUG_CATCHER_BRANDON_4 714 -#define TRAINER_PARASOL_LADY_ALEXA_2 715 -#define TRAINER_PARASOL_LADY_ALEXA_3 716 -#define TRAINER_PARASOL_LADY_ALEXA_4 717 -#define TRAINER_PICNICKER_KARINA_2 718 -#define TRAINER_PICNICKER_KARINA_3 719 -#define TRAINER_PICNICKER_KARINA_4 720 -#define TRAINER_POKE_KID_DANIELLE_2 721 -#define TRAINER_POKE_KID_DANIELLE_3 722 -#define TRAINER_POKE_KID_DANIELLE_4 723 -#define TRAINER_POLICEMAN_DANNY_2 724 -#define TRAINER_POLICEMAN_DANNY_3 725 -#define TRAINER_POLICEMAN_DANNY_4 726 -#define TRAINER_RICH_BOY_TREY_2 727 -#define TRAINER_RICH_BOY_TREY_3 728 -#define TRAINER_LADY_MELISSA_2 729 -#define TRAINER_LADY_MELISSA_3 730 -#define TRAINER_LADY_MELISSA_4 731 -#define TRAINER_PKMN_RANGER_M_TAYLOR_2 732 -#define TRAINER_PKMN_RANGER_M_TAYLOR_3 733 -#define TRAINER_PKMN_RANGER_M_TAYLOR_4 734 -#define TRAINER_PKMN_RANGER_M_KYLER_2 735 -#define TRAINER_PKMN_RANGER_F_ALLISON_2 736 -#define TRAINER_PKMN_RANGER_F_ALLISON_3 737 -#define TRAINER_PKMN_RANGER_F_ALLISON_4 738 -#define TRAINER_PKMN_RANGER_F_ASHLEE_2 739 -#define TRAINER_SAILOR_MARC_2 740 -#define TRAINER_SAILOR_MARC_3 741 -#define TRAINER_SAILOR_ZACHARIAH_2 742 -#define TRAINER_SCIENTIST_SHAUN_2 743 -#define TRAINER_SCIENTIST_SHAUN_3 744 -#define TRAINER_SCIENTIST_SHAUN_4 745 -#define TRAINER_NINJA_BOY_ZACH_2 746 -#define TRAINER_NINJA_BOY_ZACH_3 747 -#define TRAINER_NINJA_BOY_ZACH_4 748 -#define TRAINER_BEAUTY_CYNDY_2 749 -#define TRAINER_BEAUTY_CYNDY_3 750 -#define TRAINER_SKIER_M_EDWARD_2 751 -#define TRAINER_SKIER_M_EDWARD_3 752 -#define TRAINER_SKIER_M_BJORN_2 753 -#define TRAINER_SKIER_M_BJORN_3 754 -#define TRAINER_SKIER_F_ANDREA_2 755 -#define TRAINER_SKIER_F_ANDREA_3 756 -#define TRAINER_SKIER_F_MADISON_2 757 -#define TRAINER_SKIER_F_MADISON_3 758 -#define TRAINER_SWIMMER_M_WESLEY_2 759 -#define TRAINER_SWIMMER_M_FRANCISCO_2 760 -#define TRAINER_SWIMMER_M_GLENN_2 761 -#define TRAINER_SWIMMER_F_MIRANDA_2 762 -#define TRAINER_SWIMMER_F_CRYSTAL_2 763 -#define TRAINER_SWIMMER_F_JOANNA_2 764 -#define TRAINER_YOUNGSTER_TRISTAN_2 765 -#define TRAINER_YOUNGSTER_TRISTAN_3 766 -#define TRAINER_YOUNGSTER_TRISTAN_4 767 -#define TRAINER_YOUNGSTER_DALLAS_2 768 -#define TRAINER_YOUNGSTER_DALLAS_3 769 -#define TRAINER_YOUNGSTER_DALLAS_4 770 -#define TRAINER_TUBER_M_JARED_2 771 -#define TRAINER_TUBER_M_JARED_3 772 -#define TRAINER_TUBER_F_CHELSEA_2 773 -#define TRAINER_VETERAN_BRIAN_2 774 -#define TRAINER_TUBER_F_CHELSEA_3 775 -#define TRAINER_VETERAN_BRIAN_3 776 -#define TRAINER_VETERAN_ARMANDO_2 777 -#define TRAINER_VETERAN_MICKEY_5 778 -#define TRAINER_CAMERAMAN_MICKEY_2 779 -#define TRAINER_CAMERAMAN_MICKEY_3 780 -#define TRAINER_CAMERAMAN_MICKEY_4 781 -#define TRAINER_CAMERAMAN_MICKEY_5 782 -#define TRAINER_CAMERAMAN_MICKEY_6 783 -#define TRAINER_GUITARIST_MICKEY_8 784 -#define TRAINER_GUITARIST_ARTURO_2 785 -#define TRAINER_GUITARIST_ARTURO_3 786 -#define TRAINER_GUITARIST_MICKEY_9 787 -#define TRAINER_GUITARIST_MICKEY_10 788 -#define TRAINER_GUITARIST_MICKEY_11 789 -#define TRAINER_IDOL_ANGELICA_5 790 -#define TRAINER_IDOL_ANGELICA_6 791 -#define TRAINER_IDOL_ANGELICA_7 792 -#define TRAINER_IDOL_ANGELICA_8 793 -#define TRAINER_IDOL_ANGELICA_9 794 -#define TRAINER_INTERVIEWERS_TARA_TIM 795 -#define TRAINER_INTERVIEWERS_TARA_TIM_2 796 -#define TRAINER_INTERVIEWERS_TARA_TIM_3 797 -#define TRAINER_INTERVIEWERS_TARA_TIM_4 798 -#define TRAINER_CLOWN_MICKEY_6 799 -#define TRAINER_CLOWN_MICKEY_7 800 -#define TRAINER_CLOWN_MICKEY_8 801 -#define TRAINER_CLOWN_MICKEY_9 802 -#define TRAINER_CLOWN_MICKEY_10 803 -#define TRAINER_POKE_KID_ANGELICA 804 -#define TRAINER_POKE_KID_ANGELICA_2 805 -#define TRAINER_POKE_KID_ANGELICA_3 806 -#define TRAINER_POKE_KID_ANGELICA_4 807 -#define TRAINER_POLICEMAN_MICKEY_2 808 -#define TRAINER_REPORTER_ANGELICA 809 -#define TRAINER_REPORTER_ANGELICA_2 810 -#define TRAINER_REPORTER_ANGELICA_3 811 -#define TRAINER_REPORTER_ANGELICA_4 812 -#define TRAINER_SCIENTIST_MICKEY_6 813 -#define TRAINER_SWIMMER_M_MICKEY_8 814 -#define TRAINER_WAITER_MICKEY_5 815 -#define TRAINER_WORKER_MICKEY_6 816 -#define TRAINER_YOUNGSTER_ROLAND 817 -#define TRAINER_LASS_CARRIE 818 -#define TRAINER_YOUNGSTER_NORMAN 819 -#define TRAINER_YOUNGSTER_ROLAND_2 820 -#define TRAINER_LASS_CARRIE_2 821 -#define TRAINER_YOUNGSTER_NORMAN_2 822 -#define TRAINER_YOUNGSTER_ROLAND_3 823 -#define TRAINER_LASS_CARRIE_3 824 -#define TRAINER_YOUNGSTER_NORMAN_3 825 -#define TRAINER_TOWER_TYCOON_PALMER 826 -#define TRAINER_ACE_TRAINER_SNOW_M_ANTON 827 -#define TRAINER_ACE_TRAINER_SNOW_F_BRENNA 828 -#define TRAINER_SCIENTIST_DARRIUS 829 -#define TRAINER_SCIENTIST_FREDRICK 830 -#define TRAINER_SCIENTIST_TRAVON 831 -#define TRAINER_POKE_KID_JANET 832 -#define TRAINER_GALACTIC_GRUNT_31 833 -#define TRAINER_GALACTIC_GRUNT_32 834 -#define TRAINER_GALACTIC_GRUNT_33 835 -#define TRAINER_GALACTIC_GRUNT_34 836 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_19 837 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_20 838 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_21 839 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_22 840 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_23 841 -#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_24 842 -#define TRAINER_GALACTIC_GRUNT_35 843 -#define TRAINER_WORKER_DILLAN 844 -#define TRAINER_WORKER_HOLDEN 845 -#define TRAINER_WORKER_CONRAD 846 -#define TRAINER_GALACTIC_GRUNT_36 847 -#define TRAINER_GALACTIC_GRUNT_37 848 -#define TRAINER_GALACTIC_GRUNT_38 849 +#define TRAINER_YOUNGSTER_TRISTAN 1 +#define TRAINER_YOUNGSTER_LOGAN 2 +#define TRAINER_LASS_NATALIE 3 +#define TRAINER_YOUNGSTER_MICHAEL 4 +#define TRAINER_CAMPER_MICKEY 5 +#define TRAINER_CAMPER_MICKEY_2 6 +#define TRAINER_PICNICKER_ANGELICA 7 +#define TRAINER_PICNICKER_ANGELICA_2 8 +#define TRAINER_YOUNGSTER_MICKEY 9 +#define TRAINER_YOUNGSTER_TYLER 10 +#define TRAINER_LASS_SAMANTHA 11 +#define TRAINER_LASS_SARAH 12 +#define TRAINER_BUG_CATCHER_BRANDON 13 +#define TRAINER_AROMA_LADY_TAYLOR 14 +#define TRAINER_TWINS_LIV_LIZ 15 +#define TRAINER_CAMPER_JACOB 16 +#define TRAINER_PICNICKER_SIENA 17 +#define TRAINER_HIKER_DANIEL 18 +#define TRAINER_HIKER_NICHOLAS 19 +#define TRAINER_BATTLE_GIRL_KELSEY 20 +#define TRAINER_AROMA_LADY_ELIZABETH 21 +#define TRAINER_FISHERMAN_ANDREW 22 +#define TRAINER_FISHERMAN_JOSEPH 23 +#define TRAINER_FISHERMAN_ZACHARY 24 +#define TRAINER_CYCLIST_M_AXEL 25 +#define TRAINER_CYCLIST_M_JAMES 26 +#define TRAINER_CYCLIST_M_JOHN 27 +#define TRAINER_CYCLIST_M_RYAN 28 +#define TRAINER_CYCLIST_F_MEGAN 29 +#define TRAINER_CYCLIST_F_NICOLE 30 +#define TRAINER_CYCLIST_F_KAYLA 31 +#define TRAINER_CYCLIST_F_RACHEL 32 +#define TRAINER_YOUNGSTER_AUSTIN 33 +#define TRAINER_CAMPER_ANTHONY 34 +#define TRAINER_PICNICKER_LAUREN 35 +#define TRAINER_HIKER_KEVIN 36 +#define TRAINER_HIKER_JUSTIN 37 +#define TRAINER_BATTLE_GIRL_HELEN 38 +#define TRAINER_HIKER_ROBERT 39 +#define TRAINER_HIKER_ALEXANDER 40 +#define TRAINER_HIKER_JONATHAN 41 +#define TRAINER_BLACK_BELT_KYLE 42 +#define TRAINER_FISHERMAN_CODY 43 +#define TRAINER_AROMA_LADY_HANNAH 44 +#define TRAINER_ARTIST_WILLIAM 45 +#define TRAINER_PKMN_BREEDER_M_ALBERT 46 +#define TRAINER_PKMN_BREEDER_F_JENNIFER 47 +#define TRAINER_COWGIRL_SHELLEY 48 +#define TRAINER_JOGGER_RICHARD 49 +#define TRAINER_POKEFAN_M_MICKEY 50 +#define TRAINER_POKEFAN_F_ANGELICA 51 +#define TRAINER_YOUNGSTER_MICKEY_2 52 +#define TRAINER_POKE_KID_DANIELLE 53 +#define TRAINER_FISHERMAN_MICKEY 54 +#define TRAINER_YOUNG_COUPLE_TY_SUE 55 +#define TRAINER_PKMN_BREEDER_M_KAHLIL 56 +#define TRAINER_PKMN_BREEDER_F_AMBER 57 +#define TRAINER_COWGIRL_ANGELICA 58 +#define TRAINER_JOGGER_MICKEY 59 +#define TRAINER_POKEFAN_M_MICKEY_2 60 +#define TRAINER_POKEFAN_F_ANGELICA_2 61 +#define TRAINER_ACE_TRAINER_M_MICKEY 62 +#define TRAINER_ACE_TRAINER_F_ANGELICA 63 +#define TRAINER_WAITRESS_ANGELICA 64 +#define TRAINER_TWINS_TERI_TIA 65 +#define TRAINER_ACE_TRAINER_M_ERNEST 66 +#define TRAINER_ACE_TRAINER_F_ALYSSA 67 +#define TRAINER_VETERAN_BRIAN 68 +#define TRAINER_BLACK_BELT_ADAM 69 +#define TRAINER_NINJA_BOY_JOEL 70 +#define TRAINER_NINJA_BOY_NATHAN 71 +#define TRAINER_NINJA_BOY_DAVIDO 72 +#define TRAINER_DRAGON_TAMER_PATRICK 73 +#define TRAINER_BIRD_KEEPER_BRIANNA 74 +#define TRAINER_DOUBLE_TEAM_ZAC_JEN 75 +#define TRAINER_BIRD_KEEPER_ALEXANDRA 76 +#define TRAINER_BATTLE_GIRL_ANGELICA 77 +#define TRAINER_NINJA_BOY_ZACH 78 +#define TRAINER_BLACK_BELT_SEAN 79 +#define TRAINER_NINJA_BOY_NICK 80 +#define TRAINER_BIRD_KEEPER_KATHERINE 81 +#define TRAINER_RICH_BOY_JASON 82 +#define TRAINER_LADY_MELISSA 83 +#define TRAINER_GENTLEMAN_JEREMY 84 +#define TRAINER_SOCIALITE_REINA 85 +#define TRAINER_BEAUTY_ANGELICA 86 +#define TRAINER_COLLECTOR_MICKEY 87 +#define TRAINER_POLICEMAN_BOBBY 88 +#define TRAINER_POLICEMAN_ALEX 89 +#define TRAINER_POLICEMAN_DYLAN 90 +#define TRAINER_FISHERMAN_JUAN 91 +#define TRAINER_FISHERMAN_CAMERON 92 +#define TRAINER_FISHERMAN_TRAVIS 93 +#define TRAINER_PKMN_RANGER_M_TAYLOR 94 +#define TRAINER_PKMN_RANGER_M_JEFFREY 95 +#define TRAINER_PKMN_RANGER_F_ALLISON 96 +#define TRAINER_PKMN_RANGER_F_ANGELICA 97 +#define TRAINER_SCIENTIST_MICKEY 98 +#define TRAINER_SCIENTIST_STEFANO 99 +#define TRAINER_YOUNGSTER_MICKEY_3 100 +#define TRAINER_YOUNGSTER_MICKEY_4 101 +#define TRAINER_POLICEMAN_CALEB 102 +#define TRAINER_SWIMMER_M_SHELTIN 103 +#define TRAINER_SWIMMER_M_EVAN 104 +#define TRAINER_SWIMMER_F_HALEY 105 +#define TRAINER_SWIMMER_F_MARY 106 +#define TRAINER_TUBER_M_JARED 107 +#define TRAINER_TUBER_F_CHELSEA 108 +#define TRAINER_BATTLE_GIRL_ANGELICA_2 109 +#define TRAINER_SAILOR_PAUL 110 +#define TRAINER_FISHERMAN_KENNETH 111 +#define TRAINER_SIS_AND_BRO_TARA_TIM 112 +#define TRAINER_RUIN_MANIAC_BRYAN 113 +#define TRAINER_RUIN_MANIAC_HUNTER 114 +#define TRAINER_HIKER_MICKEY 115 +#define TRAINER_VETERAN_MICKEY 116 +#define TRAINER_CAMPER_MICKEY_3 117 +#define TRAINER_PICNICKER_ANGELICA_3 118 +#define TRAINER_PSYCHIC_M_MITCHELL 119 +#define TRAINER_PSYCHIC_F_ABIGAIL 120 +#define TRAINER_PI_CARLOS 121 +#define TRAINER_GUITARIST_MICKEY 122 +#define TRAINER_PI_MICKEY 123 +#define TRAINER_BEAUTY_ANGELICA_2 124 +#define TRAINER_BEAUTY_ANGELICA_3 125 +#define TRAINER_BLACK_BELT_MICKEY 126 +#define TRAINER_BLACK_BELT_GREGORY 127 +#define TRAINER_BLACK_BELT_DEREK 128 +#define TRAINER_BLACK_BELT_NATHANIEL 129 +#define TRAINER_JOGGER_SCOTT 130 +#define TRAINER_BIRD_KEEPER_ANGELICA 131 +#define TRAINER_ACE_TRAINER_SNOW_M_BLAKE 132 +#define TRAINER_ACE_TRAINER_SNOW_M_GARRETT 133 +#define TRAINER_ACE_TRAINER_SNOW_F_LAURA 134 +#define TRAINER_ACE_TRAINER_SNOW_F_MARIA 135 +#define TRAINER_SKIER_M_BRADLEY 136 +#define TRAINER_SKIER_M_EDWARD 137 +#define TRAINER_SKIER_F_KAITLYN 138 +#define TRAINER_SKIER_F_ANDREA 139 +#define TRAINER_ACE_TRAINER_SNOW_M_DALTON 140 +#define TRAINER_ACE_TRAINER_SNOW_F_OLIVIA 141 +#define TRAINER_SKIER_M_SHAWN 142 +#define TRAINER_SKIER_M_BJORN 143 +#define TRAINER_SKIER_F_LEXIE 144 +#define TRAINER_SKIER_F_MADISON 145 +#define TRAINER_NINJA_BOY_ANTONIO 146 +#define TRAINER_NINJA_BOY_ETHAN 147 +#define TRAINER_BLACK_BELT_LUKE 148 +#define TRAINER_SWIMMER_M_MICKEY 149 +#define TRAINER_SWIMMER_M_MICKEY_2 150 +#define TRAINER_SWIMMER_F_ANGELICA 151 +#define TRAINER_SWIMMER_F_ANGELICA_2 152 +#define TRAINER_FISHERMAN_MIGUEL 153 +#define TRAINER_FISHERMAN_LUC 154 +#define TRAINER_SIS_AND_BRO_TARA_TIM_2 155 +#define TRAINER_SWIMMER_M_MICKEY_3 156 +#define TRAINER_SWIMMER_M_MICKEY_4 157 +#define TRAINER_SWIMMER_F_ANGELICA_3 158 +#define TRAINER_SWIMMER_M_ADRIAN 159 +#define TRAINER_SWIMMER_M_ERIK 160 +#define TRAINER_SWIMMER_M_VINCENT 161 +#define TRAINER_SWIMMER_F_JESSICA 162 +#define TRAINER_SWIMMER_F_ERICA 163 +#define TRAINER_SWIMMER_F_KATELYN 164 +#define TRAINER_SIS_AND_BRO_TARA_TIM_3 165 +#define TRAINER_SWIMMER_M_DILLON 166 +#define TRAINER_SWIMMER_F_VANESSA 167 +#define TRAINER_FISHERMAN_CORY 168 +#define TRAINER_RUIN_MANIAC_MICKEY 169 +#define TRAINER_ACE_TRAINER_M_JAKE 170 +#define TRAINER_ACE_TRAINER_F_SHANNON 171 +#define TRAINER_FISHERMAN_BRETT 172 +#define TRAINER_FISHERMAN_ALEC 173 +#define TRAINER_FISHERMAN_GEORGE 174 +#define TRAINER_FISHERMAN_COLE 175 +#define TRAINER_ROUGHNECK_MICKEY 176 +#define TRAINER_ROUGHNECK_MICKEY_2 177 +#define TRAINER_GUITARIST_MICKEY_2 178 +#define TRAINER_CLOWN_MICKEY 179 +#define TRAINER_SAILOR_LUTHER 180 +#define TRAINER_ARTIST_MICKEY 181 +#define TRAINER_YOUNG_COUPLE_TARA_TIM 182 +#define TRAINER_SWIMMER_M_WESLEY 183 +#define TRAINER_SWIMMER_M_RICARDO 184 +#define TRAINER_SWIMMER_M_FRANCISCO 185 +#define TRAINER_SWIMMER_M_COLTON 186 +#define TRAINER_SWIMMER_M_TROY 187 +#define TRAINER_SWIMMER_M_OSCAR 188 +#define TRAINER_SWIMMER_F_MIRANDA 189 +#define TRAINER_SWIMMER_F_AUBREE 190 +#define TRAINER_SWIMMER_F_PAIGE 191 +#define TRAINER_SWIMMER_F_CRYSTAL 192 +#define TRAINER_SWIMMER_F_CASSANDRA 193 +#define TRAINER_SWIMMER_F_GABRIELLE 194 +#define TRAINER_WORKER_COLIN 195 +#define TRAINER_WORKER_MASON 196 +#define TRAINER_WORKER_MICKEY 197 +#define TRAINER_SCIENTIST_MICKEY_2 198 +#define TRAINER_SCIENTIST_MICKEY_3 199 +#define TRAINER_SCIENTIST_MICKEY_4 200 +#define TRAINER_BUG_CATCHER_JACK 201 +#define TRAINER_BUG_CATCHER_PHILLIP 202 +#define TRAINER_BUG_CATCHER_DONALD 203 +#define TRAINER_LASS_BRIANA 204 +#define TRAINER_PSYCHIC_M_ELIJAH 205 +#define TRAINER_PSYCHIC_F_LINDSEY 206 +#define TRAINER_YOUNG_COUPLE_TARA_TIM_2 207 +#define TRAINER_WORKER_MICKEY_2 208 +#define TRAINER_WORKER_MICKEY_3 209 +#define TRAINER_WORKER_MICKEY_4 210 +#define TRAINER_ACE_TRAINER_SNOW_M_MICKEY 211 +#define TRAINER_ACE_TRAINER_SNOW_M_MICKEY_2 212 +#define TRAINER_ACE_TRAINER_SNOW_F_ANGELICA 213 +#define TRAINER_ACE_TRAINER_SNOW_F_ANGELICA_2 214 +#define TRAINER_VETERAN_MICKEY_2 215 +#define TRAINER_VETERAN_MICKEY_3 216 +#define TRAINER_PSYCHIC_M_MICKEY 217 +#define TRAINER_PSYCHIC_F_ANGELICA 218 +#define TRAINER_DRAGON_TAMER_MICKEY 219 +#define TRAINER_SAILOR_MICKEY 220 +#define TRAINER_SCHOOL_KID_M_MICKEY 221 +#define TRAINER_SCHOOL_KID_F_ANGELICA 222 +#define TRAINER_YOUNG_COUPLE_TARA_TIM_3 223 +#define TRAINER_ACE_TRAINER_M_OMAR 224 +#define TRAINER_ACE_TRAINER_M_HENRY 225 +#define TRAINER_ACE_TRAINER_F_MARIAH 226 +#define TRAINER_ACE_TRAINER_F_SYDNEY 227 +#define TRAINER_VETERAN_EDGAR 228 +#define TRAINER_VETERAN_CLAYTON 229 +#define TRAINER_DRAGON_TAMER_ONDREJ 230 +#define TRAINER_DRAGON_TAMER_CLINTON 231 +#define TRAINER_BLACK_BELT_DAVID 232 +#define TRAINER_BIRD_KEEPER_HANA 233 +#define TRAINER_PSYCHIC_M_BRYCE 234 +#define TRAINER_PSYCHIC_F_VALENCIA 235 +#define TRAINER_DOUBLE_TEAM_JO_PAT 236 +#define TRAINER_DOUBLE_TEAM_AL_KAY 237 +#define TRAINER_YOUNGSTER_MICKEY_5 238 +#define TRAINER_LASS_ANGELICA 239 +#define TRAINER_VETERAN_GRANT 240 +#define TRAINER_FISHERMAN_MICKEY_2 241 +#define TRAINER_SAILOR_MICKEY_2 242 +#define TRAINER_BEAUTY_ANGELICA_4 243 +#define TRAINER_YOUNGSTER_JONATHON 244 +#define TRAINER_YOUNGSTER_DARIUS 245 +#define TRAINER_LEADER_ROARK_ROARK 246 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC 247 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_2 248 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_3 249 +#define TRAINER_LEADER_BYRON_BYRON 250 +#define TRAINER_ACE_TRAINER_F_ANGELICA_2 251 +#define TRAINER_CAMPER_MICKEY_4 252 +#define TRAINER_CAMPER_MICKEY_5 253 +#define TRAINER_CAMPER_MICKEY_6 254 +#define TRAINER_CAMPER_MICKEY_7 255 +#define TRAINER_WORKER_JACKSON 256 +#define TRAINER_WORKER_GARY 257 +#define TRAINER_BLACK_BELT_PHILIP 258 +#define TRAINER_AROMA_LADY_JENNA 259 +#define TRAINER_AROMA_LADY_ANGELA 260 +#define TRAINER_ELITE_FOUR_AARON_AARON 261 +#define TRAINER_ELITE_FOUR_BERTHA_BERTHA 262 +#define TRAINER_ELITE_FOUR_FLINT_FLINT 263 +#define TRAINER_ELITE_FOUR_LUCIEN_LUCIAN 264 +#define TRAINER_CAMPER_CURTIS 265 +#define TRAINER_CAMPER_DREW 266 +#define TRAINER_CHAMPION_CYNTHIA 267 +#define TRAINER_ACE_TRAINER_SNOW_M_SERGIO 268 +#define TRAINER_ACE_TRAINER_SNOW_M_ISAIAH 269 +#define TRAINER_ACE_TRAINER_SNOW_F_SAVANNAH 270 +#define TRAINER_ACE_TRAINER_SNOW_F_ALICIA 271 +#define TRAINER_COLLECTOR_DOUGLAS 272 +#define TRAINER_COLLECTOR_BRADY 273 +#define TRAINER_COLLECTOR_IVAN 274 +#define TRAINER_COLLECTOR_FERNANDO 275 +#define TRAINER_COLLECTOR_EDWIN 276 +#define TRAINER_DRAGON_TAMER_HAYDEN 277 +#define TRAINER_ACE_TRAINER_M_DENNIS 278 +#define TRAINER_ACE_TRAINER_M_CESAR 279 +#define TRAINER_ACE_TRAINER_M_ALLEN 280 +#define TRAINER_ACE_TRAINER_M_ZACHERY 281 +#define TRAINER_ACE_TRAINER_M_RUBEN 282 +#define TRAINER_ACE_TRAINER_F_BREANNA 283 +#define TRAINER_ACE_TRAINER_F_CATHERINE 284 +#define TRAINER_ACE_TRAINER_F_DESTINY 285 +#define TRAINER_ACE_TRAINER_F_JAMIE 286 +#define TRAINER_ACE_TRAINER_F_MAYA 287 +#define TRAINER_PSYCHIC_M_MAXWELL 288 +#define TRAINER_PSYCHIC_F_BRITTNEY 289 +#define TRAINER_BELLE__PA_AVA_MATT 290 +#define TRAINER_RANCHER_MICKEY 291 +#define TRAINER_RANCHER_MARCO 292 +#define TRAINER_FISHERMAN_ERICK 293 +#define TRAINER_TWINS_EMMA_LIL 294 +#define TRAINER_COMMANDER_MARS_MARS 295 +#define TRAINER_GALACTIC_GRUNT 296 +#define TRAINER_GALACTIC_GRUNT_2 297 +#define TRAINER_GALACTIC_GRUNT_3 298 +#define TRAINER_GALACTIC_GRUNT_4 299 +#define TRAINER_GUITARIST_TONY 300 +#define TRAINER_GUITARIST_JERRY 301 +#define TRAINER_GUITARIST_PRESTON 302 +#define TRAINER_GUITARIST_LONNIE 303 +#define TRAINER_RUIN_MANIAC_CALVIN 304 +#define TRAINER_RUIN_MANIAC_LARRY 305 +#define TRAINER_JOGGER_WYATT 306 +#define TRAINER_JOGGER_CRAIG 307 +#define TRAINER_JOGGER_RAUL 308 +#define TRAINER_BLACK_BELT_COLBY 309 +#define TRAINER_BLACK_BELT_DARREN 310 +#define TRAINER_BLACK_BELT_RAFAEL 311 +#define TRAINER_BLACK_BELT_JEFFERY 312 +#define TRAINER_BLACK_BELT_CARL 313 +#define TRAINER_BLACK_BELT_RICKY 314 +#define TRAINER_LEADER_GARDENIA_GARDENIA 315 +#define TRAINER_LEADER_WAKE_WAKE 316 +#define TRAINER_LEADER_MAYLENE_MAYLENE 317 +#define TRAINER_LEADER_FANTINA_FANTINA 318 +#define TRAINER_LEADER_CANDICE_CANDICE 319 +#define TRAINER_LEADER_VOLKNER_VOLKNER 320 +#define TRAINER_LASS_ANGELICA_2 321 +#define TRAINER_LASS_MADELINE 322 +#define TRAINER_LASS_KAITLIN 323 +#define TRAINER_LASS_CAROLINE 324 +#define TRAINER_LASS_MOLLY 325 +#define TRAINER_HIKER_LOUIS 326 +#define TRAINER_PARASOL_LADY_ALEXA 327 +#define TRAINER_PARASOL_LADY_SABRINA 328 +#define TRAINER_PICNICKER_DIANA 329 +#define TRAINER_PICNICKER_CHEYENNE 330 +#define TRAINER_POKE_KID_MEGHAN 331 +#define TRAINER_POLICEMAN_DANNY 332 +#define TRAINER_POLICEMAN_THOMAS 333 +#define TRAINER_RICH_BOY_MICKEY 334 +#define TRAINER_RICH_BOY_TREY 335 +#define TRAINER_LADY_ANGELICA 336 +#define TRAINER_SAILOR_MARC 337 +#define TRAINER_SAILOR_SKYLER 338 +#define TRAINER_SAILOR_DAMIAN 339 +#define TRAINER_SCHOOL_KID_M_CHANCE 340 +#define TRAINER_SCHOOL_KID_M_FORREST 341 +#define TRAINER_SCHOOL_KID_M_HARRISON 342 +#define TRAINER_SCHOOL_KID_F_MACKENZIE 343 +#define TRAINER_SCHOOL_KID_F_TIERA 344 +#define TRAINER_SCHOOL_KID_F_CHRISTINE 345 +#define TRAINER_BEAUTY_CYNDY 346 +#define TRAINER_BEAUTY_ANGELICA_5 347 +#define TRAINER_BEAUTY_LINDSAY 348 +#define TRAINER_SKIER_M_MICKEY 349 +#define TRAINER_SKIER_F_ANGELICA 350 +#define TRAINER_SWIMMER_M_MICKEY_5 351 +#define TRAINER_SWIMMER_M_MICKEY_6 352 +#define TRAINER_SWIMMER_F_ANGELICA_4 353 +#define TRAINER_SWIMMER_F_ANGELICA_5 354 +#define TRAINER_YOUNGSTER_DALLAS 355 +#define TRAINER_YOUNGSTER_SEBASTIAN 356 +#define TRAINER_YOUNGSTER_DONNY 357 +#define TRAINER_TUBER_M_TRENTON 358 +#define TRAINER_TUBER_M_CONNER 359 +#define TRAINER_TUBER_F_MARIEL 360 +#define TRAINER_TUBER_F_HOLLY 361 +#define TRAINER_VETERAN_ARMANDO 362 +#define TRAINER_WAITER_MICKEY 363 +#define TRAINER_WAITER_MICKEY_2 364 +#define TRAINER_WAITER_MICKEY_3 365 +#define TRAINER_WAITRESS_KATI 366 +#define TRAINER_WORKER_GERARDO 367 +#define TRAINER_INTERVIEWERS_ROXY_OLI 368 +#define TRAINER_CAMERAMAN_TEVIN 369 +#define TRAINER_REPORTER_KINSEY 370 +#define TRAINER_IDOL_GRACE 371 +#define TRAINER_BATTLE_GIRL_TYLER 372 +#define TRAINER_BIRD_KEEPER_AUTUMN 373 +#define TRAINER_PKMN_BREEDER_M_MICKEY 374 +#define TRAINER_PKMN_BREEDER_F_ANGELICA 375 +#define TRAINER_CAMERAMAN_MICKEY 376 +#define TRAINER_CAMPER_ZACKARY 377 +#define TRAINER_CAMPER_LAWRENCE 378 +#define TRAINER_CAMPER_DIEGO 379 +#define TRAINER_CAMPER_PARKER 380 +#define TRAINER_COLLECTOR_DOMINIQUE 381 +#define TRAINER_COLLECTOR_JAMAL 382 +#define TRAINER_COLLECTOR_TERRY 383 +#define TRAINER_POKEFAN_M_MICKEY_3 384 +#define TRAINER_POKEFAN_F_ANGELICA_3 385 +#define TRAINER_DRAGON_TAMER_JOE 386 +#define TRAINER_ACE_TRAINER_M_MICKEY_2 387 +#define TRAINER_ACE_TRAINER_M_JONAH 388 +#define TRAINER_ACE_TRAINER_M_MICAH 389 +#define TRAINER_ACE_TRAINER_M_ARTHUR 390 +#define TRAINER_ACE_TRAINER_F_ANGELICA_3 391 +#define TRAINER_ACE_TRAINER_F_BRENDA 392 +#define TRAINER_ACE_TRAINER_F_BRANDI 393 +#define TRAINER_ACE_TRAINER_F_CLARICE 394 +#define TRAINER_PSYCHIC_M_KODY 395 +#define TRAINER_PSYCHIC_M_LANDON 396 +#define TRAINER_PSYCHIC_M_DEANDRE 397 +#define TRAINER_PSYCHIC_F_RACHAEL 398 +#define TRAINER_PSYCHIC_F_DESIREE 399 +#define TRAINER_PSYCHIC_F_KENDRA 400 +#define TRAINER_FISHERMAN_WALTER 401 +#define TRAINER_GENTLEMAN_MICKEY 402 +#define TRAINER_GALACTIC_BOSS_CYRUS 403 +#define TRAINER_GALACTIC_BOSS_CYRUS_2 404 +#define TRAINER_COMMANDER_MARS_MARS_2 405 +#define TRAINER_COMMANDER_JUPITER_JUPITER 406 +#define TRAINER_COMMANDER_JUPITER_JUPITER_2 407 +#define TRAINER_COMMANDER_SATURN_SATURN 408 +#define TRAINER_COMMANDER_SATURN_SATURN_2 409 +#define TRAINER_GALACTIC_GRUNT_5 410 +#define TRAINER_GALACTIC_GRUNT_6 411 +#define TRAINER_GALACTIC_GRUNT_7 412 +#define TRAINER_GALACTIC_GRUNT_8 413 +#define TRAINER_GALACTIC_GRUNT_9 414 +#define TRAINER_GALACTIC_GRUNT_10 415 +#define TRAINER_GALACTIC_GRUNT_11 416 +#define TRAINER_GALACTIC_GRUNT_12 417 +#define TRAINER_GALACTIC_GRUNT_13 418 +#define TRAINER_GALACTIC_GRUNT_14 419 +#define TRAINER_GALACTIC_GRUNT_15 420 +#define TRAINER_GALACTIC_F_GRUNT 421 +#define TRAINER_GALACTIC_F_GRUNT_2 422 +#define TRAINER_GALACTIC_F_GRUNT_3 423 +#define TRAINER_GALACTIC_F_GRUNT_4 424 +#define TRAINER_GALACTIC_F_GRUNT_5 425 +#define TRAINER_GALACTIC_F_GRUNT_6 426 +#define TRAINER_GALACTIC_F_GRUNT_7 427 +#define TRAINER_GALACTIC_F_GRUNT_8 428 +#define TRAINER_GALACTIC_F_GRUNT_9 429 +#define TRAINER_GALACTIC_F_GRUNT_10 430 +#define TRAINER_GUITARIST_ARTURO 431 +#define TRAINER_GUITARIST_MICKEY_3 432 +#define TRAINER_GUITARIST_MICKEY_4 433 +#define TRAINER_GUITARIST_MICKEY_5 434 +#define TRAINER_GUITARIST_MICKEY_6 435 +#define TRAINER_GUITARIST_MICKEY_7 436 +#define TRAINER_IDOL_ANGELICA 437 +#define TRAINER_IDOL_ANGELICA_2 438 +#define TRAINER_IDOL_ANGELICA_3 439 +#define TRAINER_IDOL_ANGELICA_4 440 +#define TRAINER_RUIN_MANIAC_MICKEY_2 441 +#define TRAINER_RUIN_MANIAC_HARRY 442 +#define TRAINER_RUIN_MANIAC_GERALD 443 +#define TRAINER_BLACK_BELT_MILES 444 +#define TRAINER_BLACK_BELT_KENDAL 445 +#define TRAINER_BLACK_BELT_EDDIE 446 +#define TRAINER_BLACK_BELT_WILLIE 447 +#define TRAINER_SOCIALITE_ANGELICA 448 +#define TRAINER_LASS_ANGELICA_3 449 +#define TRAINER_LASS_CASSIDY 450 +#define TRAINER_HIKER_THEODORE 451 +#define TRAINER_HIKER_DAMON 452 +#define TRAINER_HIKER_MAURICE 453 +#define TRAINER_HIKER_REGINALD 454 +#define TRAINER_HIKER_LORENZO 455 +#define TRAINER_PICNICKER_KARINA 456 +#define TRAINER_PICNICKER_SUMMER 457 +#define TRAINER_PICNICKER_TORI 458 +#define TRAINER_PICNICKER_ANA 459 +#define TRAINER_CLOWN_LEE 460 +#define TRAINER_CLOWN_MICKEY_2 461 +#define TRAINER_CLOWN_MICKEY_3 462 +#define TRAINER_CLOWN_MICKEY_4 463 +#define TRAINER_CLOWN_MICKEY_5 464 +#define TRAINER_POKE_KID_ARIEL 465 +#define TRAINER_POLICEMAN_MICKEY 466 +#define TRAINER_RICH_BOY_MICKEY_2 467 +#define TRAINER_RICH_BOY_MICKEY_3 468 +#define TRAINER_LADY_ANGELICA_2 469 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_4 470 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_5 471 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_6 472 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_7 473 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_8 474 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_9 475 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_10 476 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_11 477 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_12 478 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_13 479 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_14 480 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_15 481 +#define TRAINER_SAILOR_ZACHARIAH 482 +#define TRAINER_SAILOR_SAMSON 483 +#define TRAINER_SCHOOL_KID_M_MICKEY_2 484 +#define TRAINER_SCHOOL_KID_F_ANGELICA_2 485 +#define TRAINER_SCIENTIST_SHAUN 486 +#define TRAINER_SCIENTIST_MICKEY_5 487 +#define TRAINER_NINJA_BOY_FABIAN 488 +#define TRAINER_NINJA_BOY_BRENNAN 489 +#define TRAINER_NINJA_BOY_BRUCE 490 +#define TRAINER_BEAUTY_DEVON 491 +#define TRAINER_BEAUTY_NICOLA 492 +#define TRAINER_SWIMMER_M_MICKEY_7 493 +#define TRAINER_SWIMMER_F_CLAIRE 494 +#define TRAINER_YOUNGSTER_MICKEY_6 495 +#define TRAINER_YOUNGSTER_WAYNE 496 +#define TRAINER_TUBER_M_JACKY 497 +#define TRAINER_TUBER_F_CAITLYN 498 +#define TRAINER_VETERAN_TERRELL 499 +#define TRAINER_VETERAN_BRENDEN 500 +#define TRAINER_WAITER_MICKEY_4 501 +#define TRAINER_WORKER_MICKEY_5 502 +#define TRAINER_WORKER_WILLY 503 +#define TRAINER_WORKER_BRADEN 504 +#define TRAINER_WORKER_BRENDON 505 +#define TRAINER_WORKER_QUENTIN 506 +#define TRAINER_GALACTIC_GRUNT_16 507 +#define TRAINER_GALACTIC_GRUNT_17 508 +#define TRAINER_GALACTIC_GRUNT_18 509 +#define TRAINER_GALACTIC_GRUNT_19 510 +#define TRAINER_GALACTIC_GRUNT_20 511 +#define TRAINER_GALACTIC_GRUNT_21 512 +#define TRAINER_GALACTIC_GRUNT_22 513 +#define TRAINER_GALACTIC_GRUNT_23 514 +#define TRAINER_GALACTIC_GRUNT_24 515 +#define TRAINER_GALACTIC_GRUNT_25 516 +#define TRAINER_GALACTIC_GRUNT_26 517 +#define TRAINER_GALACTIC_GRUNT_27 518 +#define TRAINER_GALACTIC_GRUNT_28 519 +#define TRAINER_GALACTIC_GRUNT_29 520 +#define TRAINER_GALACTIC_GRUNT_30 521 +#define TRAINER_GALACTIC_F_GRUNT_11 522 +#define TRAINER_GALACTIC_F_GRUNT_12 523 +#define TRAINER_GALACTIC_F_GRUNT_13 524 +#define TRAINER_GALACTIC_F_GRUNT_14 525 +#define TRAINER_GALACTIC_F_GRUNT_15 526 +#define TRAINER_GALACTIC_F_GRUNT_16 527 +#define TRAINER_COMMANDER_MARS_MARS_3 528 +#define TRAINER_ROUGHNECK_KIRBY 529 +#define TRAINER_POKEFAN_M_LEONARD 530 +#define TRAINER_POKEFAN_F_REBEKAH 531 +#define TRAINER_YOUNGSTER_OLIVER 532 +#define TRAINER_BELLE__PA_BETH_BOB 533 +#define TRAINER_YOUNG_COUPLE_MIKE_NAT 534 +#define TRAINER_AROMA_LADY_ALISON 535 +#define TRAINER_ARTIST_ISMAEL 536 +#define TRAINER_PKMN_BREEDER_F_KAYLEE 537 +#define TRAINER_CAMERAMAN_DARRYL 538 +#define TRAINER_COLLECTOR_EUGENE 539 +#define TRAINER_POKEFAN_F_MEREDITH 540 +#define TRAINER_PI_KENDRICK 541 +#define TRAINER_GENTLEMAN_LEONARDO 542 +#define TRAINER_SOCIALITE_REBECCA 543 +#define TRAINER_LASS_BLYTHE 544 +#define TRAINER_RICH_BOY_ROMAN 545 +#define TRAINER_LADY_KYLIE 546 +#define TRAINER_REPORTER_VALERIE 547 +#define TRAINER_SCHOOL_KID_M_ESTEBAN 548 +#define TRAINER_SCIENTIST_EMILIO 549 +#define TRAINER_BEAUTY_GABRIELLA 550 +#define TRAINER_BEAUTY_HARLEY 551 +#define TRAINER_VETERAN_EMANUEL 552 +#define TRAINER_RUIN_MANIAC_KARL 553 +#define TRAINER_BIRD_KEEPER_AUDREY 554 +#define TRAINER_BIRD_KEEPER_GENEVA 555 +#define TRAINER_BIRD_KEEPER_KRYSTAL 556 +#define TRAINER_DRAGON_TAMER_GEOFFREY 557 +#define TRAINER_DRAGON_TAMER_DARIEN 558 +#define TRAINER_DRAGON_TAMER_KEEGAN 559 +#define TRAINER_DRAGON_TAMER_STANLEY 560 +#define TRAINER_DRAGON_TAMER_DRAKE 561 +#define TRAINER_DRAGON_TAMER_KENNY 562 +#define TRAINER_ACE_TRAINER_M_RODOLFO 563 +#define TRAINER_ACE_TRAINER_M_SAUL 564 +#define TRAINER_ACE_TRAINER_M_JOSE 565 +#define TRAINER_ACE_TRAINER_M_FELIX 566 +#define TRAINER_ACE_TRAINER_M_QUINN 567 +#define TRAINER_ACE_TRAINER_M_GRAHAM 568 +#define TRAINER_ACE_TRAINER_M_KEENAN 569 +#define TRAINER_ACE_TRAINER_M_STEFAN 570 +#define TRAINER_ACE_TRAINER_M_SKYLAR 571 +#define TRAINER_ACE_TRAINER_M_ABEL 572 +#define TRAINER_ACE_TRAINER_F_DEANNA 573 +#define TRAINER_ACE_TRAINER_F_ARIANA 574 +#define TRAINER_ACE_TRAINER_F_DANA 575 +#define TRAINER_ACE_TRAINER_F_MIKAYLA 576 +#define TRAINER_ACE_TRAINER_F_MEAGAN 577 +#define TRAINER_ACE_TRAINER_F_SANDRA 578 +#define TRAINER_ACE_TRAINER_F_KASSANDRA 579 +#define TRAINER_ACE_TRAINER_F_JASMIN 580 +#define TRAINER_ACE_TRAINER_F_NATASHA 581 +#define TRAINER_ACE_TRAINER_F_MONIQUE 582 +#define TRAINER_PSYCHIC_M_CORBIN 583 +#define TRAINER_PSYCHIC_M_STERLING 584 +#define TRAINER_PSYCHIC_F_DAISY 585 +#define TRAINER_PSYCHIC_F_CHELSEY 586 +#define TRAINER_BLACK_BELT_DAVON 587 +#define TRAINER_BLACK_BELT_GRIFFIN 588 +#define TRAINER_BLACK_BELT_RAY 589 +#define TRAINER_BLACK_BELT_JARRETT 590 +#define TRAINER_PKMN_RANGER_M_KYLER 591 +#define TRAINER_PKMN_RANGER_M_DESHAWN 592 +#define TRAINER_PKMN_RANGER_M_DWAYNE 593 +#define TRAINER_PKMN_RANGER_F_ASHLEE 594 +#define TRAINER_PKMN_RANGER_F_FELICIA 595 +#define TRAINER_PKMN_RANGER_F_KRISTA 596 +#define TRAINER_SWIMMER_M_GLENN 597 +#define TRAINER_SWIMMER_M_KURT 598 +#define TRAINER_SWIMMER_M_SAM 599 +#define TRAINER_SWIMMER_M_WADE 600 +#define TRAINER_SWIMMER_F_JOANNA 601 +#define TRAINER_SWIMMER_F_SOPHIA 602 +#define TRAINER_SWIMMER_F_MALLORY 603 +#define TRAINER_SWIMMER_F_LYDIA 604 +#define TRAINER_VETERAN_MICKEY_4 605 +#define TRAINER_VETERAN_HARLAN 606 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_16 607 +#define TRAINER_PKMN_TRAINER_AROMA_LADY_CHERYL 608 +#define TRAINER_PKMN_TRAINER_RICH_BOY_RILEY 609 +#define TRAINER_PKMN_TRAINER_PICNICKER_MARLEY 610 +#define TRAINER_PKMN_TRAINER_CAMPER_BUCK 611 +#define TRAINER_PKMN_TRAINER_POKEKID_MIRA 612 +#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS 613 +#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_2 614 +#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_3 615 +#define TRAINER_PKMN_TRAINER_DAWN_DAWN 616 +#define TRAINER_PKMN_TRAINER_DAWN_DAWN_2 617 +#define TRAINER_PKMN_TRAINER_DAWN_DAWN_3 618 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_17 619 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_18 620 +#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_4 621 +#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_5 622 +#define TRAINER_PKMN_TRAINER_LUCAS_LUCAS_6 623 +#define TRAINER_PKMN_TRAINER_DAWN_DAWN_4 624 +#define TRAINER_PKMN_TRAINER_DAWN_DAWN_5 625 +#define TRAINER_PKMN_TRAINER_DAWN_DAWN_6 626 +#define TRAINER_AROMA_LADY_ELIZABETH_2 627 +#define TRAINER_AROMA_LADY_ELIZABETH_3 628 +#define TRAINER_AROMA_LADY_ELIZABETH_4 629 +#define TRAINER_ARTIST_KEVIN 630 +#define TRAINER_ARTIST_KEVIN_2 631 +#define TRAINER_ARTIST_KEVIN_3 632 +#define TRAINER_BATTLE_GIRL_HELEN_2 633 +#define TRAINER_BATTLE_GIRL_HELEN_3 634 +#define TRAINER_BATTLE_GIRL_HELEN_4 635 +#define TRAINER_BIRD_KEEPER_BRIANNA_2 636 +#define TRAINER_BIRD_KEEPER_BRIANNA_3 637 +#define TRAINER_BIRD_KEEPER_AUDREY_2 638 +#define TRAINER_PKMN_BREEDER_M_ALBERT_2 639 +#define TRAINER_PKMN_BREEDER_M_ALBERT_3 640 +#define TRAINER_PKMN_BREEDER_M_ALBERT_4 641 +#define TRAINER_PKMN_BREEDER_F_JENNIFER_2 642 +#define TRAINER_PKMN_BREEDER_F_JENNIFER_3 643 +#define TRAINER_PKMN_BREEDER_F_JENNIFER_4 644 +#define TRAINER_CAMPER_ZACKARY_2 645 +#define TRAINER_CAMPER_ZACKARY_3 646 +#define TRAINER_CAMPER_ZACKARY_4 647 +#define TRAINER_ACE_TRAINER_SNOW_M_DALTON_2 648 +#define TRAINER_ACE_TRAINER_SNOW_F_OLIVIA_2 649 +#define TRAINER_COLLECTOR_IVAN_2 650 +#define TRAINER_COWGIRL_ANGELICA_2 651 +#define TRAINER_COWGIRL_ANGELICA_3 652 +#define TRAINER_CYCLIST_M_JOHN_2 653 +#define TRAINER_CYCLIST_M_JOHN_3 654 +#define TRAINER_CYCLIST_M_JOHN_4 655 +#define TRAINER_CYCLIST_F_KAYLA_2 656 +#define TRAINER_CYCLIST_F_KAYLA_3 657 +#define TRAINER_CYCLIST_F_KAYLA_4 658 +#define TRAINER_DRAGON_TAMER_PATRICK_2 659 +#define TRAINER_DRAGON_TAMER_PATRICK_3 660 +#define TRAINER_DRAGON_TAMER_HAYDEN_2 661 +#define TRAINER_DRAGON_TAMER_GEOFFREY_2 662 +#define TRAINER_ACE_TRAINER_M_JAKE_2 663 +#define TRAINER_ACE_TRAINER_M_DENNIS_2 664 +#define TRAINER_ACE_TRAINER_M_DENNIS_3 665 +#define TRAINER_ACE_TRAINER_M_RODOLFO_2 666 +#define TRAINER_ACE_TRAINER_M_SAUL_2 667 +#define TRAINER_ACE_TRAINER_F_SHANNON_2 668 +#define TRAINER_ACE_TRAINER_F_MAYA_2 669 +#define TRAINER_ACE_TRAINER_F_MAYA_3 670 +#define TRAINER_ACE_TRAINER_F_DEANNA_2 671 +#define TRAINER_ACE_TRAINER_F_ARIANA_2 672 +#define TRAINER_PSYCHIC_M_MITCHELL_2 673 +#define TRAINER_PSYCHIC_M_MITCHELL_3 674 +#define TRAINER_PSYCHIC_M_MAXWELL_2 675 +#define TRAINER_PSYCHIC_M_CORBIN_2 676 +#define TRAINER_PSYCHIC_F_ABIGAIL_2 677 +#define TRAINER_PSYCHIC_F_ABIGAIL_3 678 +#define TRAINER_PSYCHIC_F_BRITTNEY_2 679 +#define TRAINER_PSYCHIC_F_DAISY_2 680 +#define TRAINER_RANCHER_MARCO_2 681 +#define TRAINER_RANCHER_MARCO_3 682 +#define TRAINER_FISHERMAN_JOSEPH_2 683 +#define TRAINER_FISHERMAN_JOSEPH_3 684 +#define TRAINER_FISHERMAN_MIGUEL_2 685 +#define TRAINER_FISHERMAN_ALEC_2 686 +#define TRAINER_TWINS_TERI_TIA_2 687 +#define TRAINER_TWINS_TERI_TIA_3 688 +#define TRAINER_PI_CARLOS_2 689 +#define TRAINER_PI_CARLOS_3 690 +#define TRAINER_GENTLEMAN_JEREMY_2 691 +#define TRAINER_GENTLEMAN_JEREMY_3 692 +#define TRAINER_GENTLEMAN_JEREMY_4 693 +#define TRAINER_GUITARIST_TONY_2 694 +#define TRAINER_RUIN_MANIAC_HARRY_2 695 +#define TRAINER_RUIN_MANIAC_HARRY_3 696 +#define TRAINER_JOGGER_CRAIG_2 697 +#define TRAINER_JOGGER_CRAIG_3 698 +#define TRAINER_BLACK_BELT_PHILIP_2 699 +#define TRAINER_BLACK_BELT_DAVON_2 700 +#define TRAINER_SOCIALITE_REINA_2 701 +#define TRAINER_SOCIALITE_REINA_3 702 +#define TRAINER_LASS_SAMANTHA_2 703 +#define TRAINER_LASS_SAMANTHA_3 704 +#define TRAINER_LASS_SAMANTHA_4 705 +#define TRAINER_LASS_MADELINE_2 706 +#define TRAINER_LASS_MADELINE_3 707 +#define TRAINER_LASS_MADELINE_4 708 +#define TRAINER_HIKER_THEODORE_2 709 +#define TRAINER_HIKER_THEODORE_3 710 +#define TRAINER_HIKER_THEODORE_4 711 +#define TRAINER_BUG_CATCHER_BRANDON_2 712 +#define TRAINER_BUG_CATCHER_BRANDON_3 713 +#define TRAINER_BUG_CATCHER_BRANDON_4 714 +#define TRAINER_PARASOL_LADY_ALEXA_2 715 +#define TRAINER_PARASOL_LADY_ALEXA_3 716 +#define TRAINER_PARASOL_LADY_ALEXA_4 717 +#define TRAINER_PICNICKER_KARINA_2 718 +#define TRAINER_PICNICKER_KARINA_3 719 +#define TRAINER_PICNICKER_KARINA_4 720 +#define TRAINER_POKE_KID_DANIELLE_2 721 +#define TRAINER_POKE_KID_DANIELLE_3 722 +#define TRAINER_POKE_KID_DANIELLE_4 723 +#define TRAINER_POLICEMAN_DANNY_2 724 +#define TRAINER_POLICEMAN_DANNY_3 725 +#define TRAINER_POLICEMAN_DANNY_4 726 +#define TRAINER_RICH_BOY_TREY_2 727 +#define TRAINER_RICH_BOY_TREY_3 728 +#define TRAINER_LADY_MELISSA_2 729 +#define TRAINER_LADY_MELISSA_3 730 +#define TRAINER_LADY_MELISSA_4 731 +#define TRAINER_PKMN_RANGER_M_TAYLOR_2 732 +#define TRAINER_PKMN_RANGER_M_TAYLOR_3 733 +#define TRAINER_PKMN_RANGER_M_TAYLOR_4 734 +#define TRAINER_PKMN_RANGER_M_KYLER_2 735 +#define TRAINER_PKMN_RANGER_F_ALLISON_2 736 +#define TRAINER_PKMN_RANGER_F_ALLISON_3 737 +#define TRAINER_PKMN_RANGER_F_ALLISON_4 738 +#define TRAINER_PKMN_RANGER_F_ASHLEE_2 739 +#define TRAINER_SAILOR_MARC_2 740 +#define TRAINER_SAILOR_MARC_3 741 +#define TRAINER_SAILOR_ZACHARIAH_2 742 +#define TRAINER_SCIENTIST_SHAUN_2 743 +#define TRAINER_SCIENTIST_SHAUN_3 744 +#define TRAINER_SCIENTIST_SHAUN_4 745 +#define TRAINER_NINJA_BOY_ZACH_2 746 +#define TRAINER_NINJA_BOY_ZACH_3 747 +#define TRAINER_NINJA_BOY_ZACH_4 748 +#define TRAINER_BEAUTY_CYNDY_2 749 +#define TRAINER_BEAUTY_CYNDY_3 750 +#define TRAINER_SKIER_M_EDWARD_2 751 +#define TRAINER_SKIER_M_EDWARD_3 752 +#define TRAINER_SKIER_M_BJORN_2 753 +#define TRAINER_SKIER_M_BJORN_3 754 +#define TRAINER_SKIER_F_ANDREA_2 755 +#define TRAINER_SKIER_F_ANDREA_3 756 +#define TRAINER_SKIER_F_MADISON_2 757 +#define TRAINER_SKIER_F_MADISON_3 758 +#define TRAINER_SWIMMER_M_WESLEY_2 759 +#define TRAINER_SWIMMER_M_FRANCISCO_2 760 +#define TRAINER_SWIMMER_M_GLENN_2 761 +#define TRAINER_SWIMMER_F_MIRANDA_2 762 +#define TRAINER_SWIMMER_F_CRYSTAL_2 763 +#define TRAINER_SWIMMER_F_JOANNA_2 764 +#define TRAINER_YOUNGSTER_TRISTAN_2 765 +#define TRAINER_YOUNGSTER_TRISTAN_3 766 +#define TRAINER_YOUNGSTER_TRISTAN_4 767 +#define TRAINER_YOUNGSTER_DALLAS_2 768 +#define TRAINER_YOUNGSTER_DALLAS_3 769 +#define TRAINER_YOUNGSTER_DALLAS_4 770 +#define TRAINER_TUBER_M_JARED_2 771 +#define TRAINER_TUBER_M_JARED_3 772 +#define TRAINER_TUBER_F_CHELSEA_2 773 +#define TRAINER_VETERAN_BRIAN_2 774 +#define TRAINER_TUBER_F_CHELSEA_3 775 +#define TRAINER_VETERAN_BRIAN_3 776 +#define TRAINER_VETERAN_ARMANDO_2 777 +#define TRAINER_VETERAN_MICKEY_5 778 +#define TRAINER_CAMERAMAN_MICKEY_2 779 +#define TRAINER_CAMERAMAN_MICKEY_3 780 +#define TRAINER_CAMERAMAN_MICKEY_4 781 +#define TRAINER_CAMERAMAN_MICKEY_5 782 +#define TRAINER_CAMERAMAN_MICKEY_6 783 +#define TRAINER_GUITARIST_MICKEY_8 784 +#define TRAINER_GUITARIST_ARTURO_2 785 +#define TRAINER_GUITARIST_ARTURO_3 786 +#define TRAINER_GUITARIST_MICKEY_9 787 +#define TRAINER_GUITARIST_MICKEY_10 788 +#define TRAINER_GUITARIST_MICKEY_11 789 +#define TRAINER_IDOL_ANGELICA_5 790 +#define TRAINER_IDOL_ANGELICA_6 791 +#define TRAINER_IDOL_ANGELICA_7 792 +#define TRAINER_IDOL_ANGELICA_8 793 +#define TRAINER_IDOL_ANGELICA_9 794 +#define TRAINER_INTERVIEWERS_TARA_TIM 795 +#define TRAINER_INTERVIEWERS_TARA_TIM_2 796 +#define TRAINER_INTERVIEWERS_TARA_TIM_3 797 +#define TRAINER_INTERVIEWERS_TARA_TIM_4 798 +#define TRAINER_CLOWN_MICKEY_6 799 +#define TRAINER_CLOWN_MICKEY_7 800 +#define TRAINER_CLOWN_MICKEY_8 801 +#define TRAINER_CLOWN_MICKEY_9 802 +#define TRAINER_CLOWN_MICKEY_10 803 +#define TRAINER_POKE_KID_ANGELICA 804 +#define TRAINER_POKE_KID_ANGELICA_2 805 +#define TRAINER_POKE_KID_ANGELICA_3 806 +#define TRAINER_POKE_KID_ANGELICA_4 807 +#define TRAINER_POLICEMAN_MICKEY_2 808 +#define TRAINER_REPORTER_ANGELICA 809 +#define TRAINER_REPORTER_ANGELICA_2 810 +#define TRAINER_REPORTER_ANGELICA_3 811 +#define TRAINER_REPORTER_ANGELICA_4 812 +#define TRAINER_SCIENTIST_MICKEY_6 813 +#define TRAINER_SWIMMER_M_MICKEY_8 814 +#define TRAINER_WAITER_MICKEY_5 815 +#define TRAINER_WORKER_MICKEY_6 816 +#define TRAINER_YOUNGSTER_ROLAND 817 +#define TRAINER_LASS_CARRIE 818 +#define TRAINER_YOUNGSTER_NORMAN 819 +#define TRAINER_YOUNGSTER_ROLAND_2 820 +#define TRAINER_LASS_CARRIE_2 821 +#define TRAINER_YOUNGSTER_NORMAN_2 822 +#define TRAINER_YOUNGSTER_ROLAND_3 823 +#define TRAINER_LASS_CARRIE_3 824 +#define TRAINER_YOUNGSTER_NORMAN_3 825 +#define TRAINER_TOWER_TYCOON_PALMER 826 +#define TRAINER_ACE_TRAINER_SNOW_M_ANTON 827 +#define TRAINER_ACE_TRAINER_SNOW_F_BRENNA 828 +#define TRAINER_SCIENTIST_DARRIUS 829 +#define TRAINER_SCIENTIST_FREDRICK 830 +#define TRAINER_SCIENTIST_TRAVON 831 +#define TRAINER_POKE_KID_JANET 832 +#define TRAINER_GALACTIC_GRUNT_31 833 +#define TRAINER_GALACTIC_GRUNT_32 834 +#define TRAINER_GALACTIC_GRUNT_33 835 +#define TRAINER_GALACTIC_GRUNT_34 836 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_19 837 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_20 838 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_21 839 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_22 840 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_23 841 +#define TRAINER_PKMN_TRAINER_BARRY_CEDRIC_24 842 +#define TRAINER_GALACTIC_GRUNT_35 843 +#define TRAINER_WORKER_DILLAN 844 +#define TRAINER_WORKER_HOLDEN 845 +#define TRAINER_WORKER_CONRAD 846 +#define TRAINER_GALACTIC_GRUNT_36 847 +#define TRAINER_GALACTIC_GRUNT_37 848 +#define TRAINER_GALACTIC_GRUNT_38 849 -#endif //POKEDIAMOND_CONSTANTS_TRAINERS_H +#endif // POKEDIAMOND_CONSTANTS_TRAINERS_H diff --git a/include/constants/trdata.h b/include/constants/trdata.h index 659423cfd..4e697b524 100644 --- a/include/constants/trdata.h +++ b/include/constants/trdata.h @@ -5,4 +5,4 @@ #ifndef POKEDIAMOND_TRDATA_H #define POKEDIAMOND_TRDATA_H -#endif //POKEDIAMOND_TRDATA_H +#endif // POKEDIAMOND_TRDATA_H diff --git a/include/constants/vars.h b/include/constants/vars.h index 007e6c1c8..0eb2cd875 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -1,8 +1,8 @@ #ifndef POKEDIAMOND_CONSTANTS_VARS_H #define POKEDIAMOND_CONSTANTS_VARS_H -#define VAR_BASE 0x4000 +#define VAR_BASE 0x4000 -#define NUM_VARS 0x120 +#define NUM_VARS 0x120 -#endif //POKEDIAMOND_CONSTANTS_VARS_H \ No newline at end of file +#endif // POKEDIAMOND_CONSTANTS_VARS_H diff --git a/include/constants/weather.h b/include/constants/weather.h index e8ade5e30..2c4863423 100644 --- a/include/constants/weather.h +++ b/include/constants/weather.h @@ -1,36 +1,36 @@ #ifndef POKEDIAMOND_CONSTANTS_WEATHER_H #define POKEDIAMOND_CONSTANTS_WEATHER_H -#define WEATHER_SUNNY 0 -#define WEATHER_CLOUDY 1 -#define WEATHER_RAIN 2 -#define WEATHER_HEAVY_RAIN 3 -#define WEATHER_THUNDERSTORM 4 -#define WEATHER_LIGHT_SNOW 5 -#define WEATHER_SNOW 6 -#define WEATHER_BLIZZARD 7 -#define WEATHER_FOG 8 -#define WEATHER_ASH 9 -#define WEATHER_SANDSTORM 10 -#define WEATHER_DIAMOND_DUST 11 -#define WEATHER_UNKNOWN_12 12 //WEATHER_SPIRIT? -#define WEATHER_UNKNOWN_13 13 //WEATHER_MYSTIC? -#define WEATHER_UNKNOWN_14 14 //WEATHER_MIST_1? -#define WEATHER_UNKNOWN_15 15 //WEATHER_MIST_2? -#define WEATHER_FLASH 16 -#define WEATHER_LIGHTNING 17 -#define WEATHER_UNKNOWN_18 18 //WEATHER_FOGS? -#define WEATHER_UNKNOWN_19 19 //WEATHER_FOGM? -#define WEATHER_UNKNOWN_20 20 //WEATHER_RAINBOW? -#define WEATHER_UNKNOWN_21 21 //WEATHER_SNOW_STORM? -#define WEATHER_UNKNOWN_22 22 //WEATHER_STORM? -#define WEATHER_CANOPY 23 -#define WEATHER_UNKNOWN_24 24 //WEATHER_CAVE_1? -#define WEATHER_CAVE_2 25 -#define WEATHER_UNKNOWN_26 26 //WEATHER_GALAXY? -#define WEATHER_LOST_TOWER 27 -#define WEATHER_UNKNOWN_28 28 //WEATHER_HARD_MOUNTAIN? -#define WEATHER_CAVE_3 29 -#define WEATHER_LOW_LIGHT 30 +#define WEATHER_SUNNY 0 +#define WEATHER_CLOUDY 1 +#define WEATHER_RAIN 2 +#define WEATHER_HEAVY_RAIN 3 +#define WEATHER_THUNDERSTORM 4 +#define WEATHER_LIGHT_SNOW 5 +#define WEATHER_SNOW 6 +#define WEATHER_BLIZZARD 7 +#define WEATHER_FOG 8 +#define WEATHER_ASH 9 +#define WEATHER_SANDSTORM 10 +#define WEATHER_DIAMOND_DUST 11 +#define WEATHER_UNKNOWN_12 12 // WEATHER_SPIRIT? +#define WEATHER_UNKNOWN_13 13 // WEATHER_MYSTIC? +#define WEATHER_UNKNOWN_14 14 // WEATHER_MIST_1? +#define WEATHER_UNKNOWN_15 15 // WEATHER_MIST_2? +#define WEATHER_FLASH 16 +#define WEATHER_LIGHTNING 17 +#define WEATHER_UNKNOWN_18 18 // WEATHER_FOGS? +#define WEATHER_UNKNOWN_19 19 // WEATHER_FOGM? +#define WEATHER_UNKNOWN_20 20 // WEATHER_RAINBOW? +#define WEATHER_UNKNOWN_21 21 // WEATHER_SNOW_STORM? +#define WEATHER_UNKNOWN_22 22 // WEATHER_STORM? +#define WEATHER_CANOPY 23 +#define WEATHER_UNKNOWN_24 24 // WEATHER_CAVE_1? +#define WEATHER_CAVE_2 25 +#define WEATHER_UNKNOWN_26 26 // WEATHER_GALAXY? +#define WEATHER_LOST_TOWER 27 +#define WEATHER_UNKNOWN_28 28 // WEATHER_HARD_MOUNTAIN? +#define WEATHER_CAVE_3 29 +#define WEATHER_LOW_LIGHT 30 -#endif //POKEDIAMOND_CONSTANTS_WEATHER_H +#endif // POKEDIAMOND_CONSTANTS_WEATHER_H diff --git a/include/daycare.h b/include/daycare.h index 90efbe638..ba0600a23 100644 --- a/include/daycare.h +++ b/include/daycare.h @@ -2,7 +2,9 @@ #define POKEDIAMOND_DAYCARE_H #include "global.h" + #include "mail.h" +#include "pokemon.h" typedef struct DaycareMail { Mail mail; @@ -43,4 +45,4 @@ void DaycareMon_Extras_Init(DaycareMail *mail); void DaycareMon_Init(DaycareMon *mon); Daycare *Save_Daycare_Get(SaveData *savedata); -#endif //POKEDIAMOND_DAYCARE_H +#endif // POKEDIAMOND_DAYCARE_H diff --git a/include/easy_chat.h b/include/easy_chat.h index 9b8833935..3f27aecd6 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -1,9 +1,10 @@ #ifndef POKEDIAMOND_EASY_CHAT_H #define POKEDIAMOND_EASY_CHAT_H -#include "msgdata.h" #include "constants/easy_chat.h" +#include "msgdata.h" + typedef u16 ecword_t; typedef struct EasyChatManager { @@ -34,4 +35,4 @@ void Save_EasyChat_SetGreetingFlag(SaveEasyChat *saveEasyChat, u32 flag); s32 GetDuplicateWordNum(ecword_t word); ecword_t RemapDuplicateWord(ecword_t word, s32 target); -#endif //POKEDIAMOND_EASY_CHAT_H +#endif // POKEDIAMOND_EASY_CHAT_H diff --git a/include/encounter.h b/include/encounter.h index 4d2a3c08a..89f04b639 100644 --- a/include/encounter.h +++ b/include/encounter.h @@ -36,4 +36,4 @@ void sub_020471C0(TaskManager *taskManager, s32 target, s32 maxLevel, u32 flag); void sub_0204726C(FieldSystem *fieldSystem, void *param1, s32 battleType); void sub_020472B0(FieldSystem *fieldSystem, Party *party, s32 battleType); -#endif //POKEDIAMOND_ENCOUNTER_H \ No newline at end of file +#endif // POKEDIAMOND_ENCOUNTER_H diff --git a/include/error_handling.h b/include/error_handling.h index c14c93fe5..f0ea60675 100644 --- a/include/error_handling.h +++ b/include/error_handling.h @@ -3,4 +3,4 @@ void GF_AssertFail(void); -#endif //POKEDIAMOND_ERROR_HANDLING_H +#endif // POKEDIAMOND_ERROR_HANDLING_H diff --git a/include/error_message_reset.h b/include/error_message_reset.h index 01286ca91..d179ad572 100644 --- a/include/error_message_reset.h +++ b/include/error_message_reset.h @@ -2,14 +2,14 @@ #define POKEDIAMOND_ERROR_MESSAGE_RESET_H #include "global.h" -#include "heap.h" + #include "SPI_pm.h" #include "game_init.h" +#include "heap.h" #include "msgdata.h" #include "text.h" - void VBlankHandler(); void PrintErrorMessageAndReset(); -#endif //POKEDIAMOND_ERROR_MESSAGE_RESET_H +#endif // POKEDIAMOND_ERROR_MESSAGE_RESET_H diff --git a/include/fashion_case.h b/include/fashion_case.h index 348b89e76..38387c710 100644 --- a/include/fashion_case.h +++ b/include/fashion_case.h @@ -3,10 +3,10 @@ typedef struct FashionCase { -} FashionCase; //todo: complete +} FashionCase; // todo: complete typedef struct SaveFashionData { -} SaveFashionData; //todo: complete +} SaveFashionData; // todo: complete -#endif //POKEDIAMOND_FASHION_CASE_H \ No newline at end of file +#endif // POKEDIAMOND_FASHION_CASE_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 164968d13..57ffb1c7f 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -3,9 +3,8 @@ #include "global.h" -typedef struct PlayerAvatar -{ +typedef struct PlayerAvatar { u8 padding0[0x40]; -} PlayerAvatar; //TODO: populate once we know more +} PlayerAvatar; // TODO: populate once we know more #endif // POKEDIAMOND_FIELD_PLAYER_AVATAR_H diff --git a/include/field_system.h b/include/field_system.h index 7a034da7c..c0faa1bb7 100644 --- a/include/field_system.h +++ b/include/field_system.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_FIELD_SYSTEM_H #include "global.h" + #include "bg_window.h" #include "camera.h" #include "field_player_avatar.h" @@ -21,32 +22,29 @@ typedef struct UnkFieldStruct04 { u32 unk0C; } UnkFieldStruct04; -typedef struct MapObjectManager { //must be in this func, cause otheriwse build will fail +typedef struct MapObjectManager { // must be in this func, cause otheriwse build will fail u8 padding[0x12C]; -} MapObjectManager; //todo: fill out +} MapObjectManager; // todo: fill out -typedef struct UnkStruct_020464D4 -{ +typedef struct UnkStruct_020464D4 { u16 unk0[4]; u8 padding[0x108]; } UnkStruct_020464D4; -typedef struct UnkStruct_02046444 -{ +typedef struct UnkStruct_02046444 { u8 padding[0x24]; u16 unk24; u16 unk26; u16 unk28; u8 padding2[0x66]; - UnkStruct_020464D4 unk90[1]; //todo find size + UnkStruct_020464D4 unk90[1]; // todo find size } UnkStruct_02046444; -typedef struct FieldSystem -{ +typedef struct FieldSystem { u32 *unk00; UnkFieldStruct04 *unk04; BgConfig *bgConfig; - SaveData *saveData; //0xC + SaveData *saveData; // 0xC TaskManager *taskManager; u8 padding2[0x8]; Location *location; @@ -66,7 +64,7 @@ typedef struct FieldSystem u8 padding7[0x4]; u32 *unk98; u8 padding8[0xC]; - UnkStruct_02046444 * unkA8; + UnkStruct_02046444 *unkA8; } FieldSystem; -#endif //POKEDIAMOND_FIELD_SYSTEM_H \ No newline at end of file +#endif // POKEDIAMOND_FIELD_SYSTEM_H diff --git a/include/field_system_rtc_weather.h b/include/field_system_rtc_weather.h index bfdf1e3b5..dc61cf780 100644 --- a/include/field_system_rtc_weather.h +++ b/include/field_system_rtc_weather.h @@ -2,8 +2,9 @@ #define POKEDIAMOND_FIELD_SYSTEM_RTC_WEATHER_H #include "nitro/types.h" + #include "script.h" u32 FieldSystem_GetWeather(FieldSystem *fieldSystem, u32 mapId); -#endif //POKEDIAMOND_FIELD_SYSTEM_RTC_WEATHER_H +#endif // POKEDIAMOND_FIELD_SYSTEM_RTC_WEATHER_H diff --git a/include/filesystem.h b/include/filesystem.h index de8ba3fb6..9c6315d01 100644 --- a/include/filesystem.h +++ b/include/filesystem.h @@ -1,120 +1,119 @@ #ifndef POKEDIAMOND_FILESYSTEM_H #define POKEDIAMOND_FILESYSTEM_H -#include "heap.h" #include "nitro/types.h" + #include "FS_file.h" +#include "heap.h" -typedef struct NARC -{ +typedef struct NARC { FSFile file; u32 btaf_start; u32 gmif_start; u16 num_files; } NARC; -typedef enum NarcId -{ - NARC_BATTLE_SKILL_WAZA_SEQ = 0, - NARC_BATTLE_SKILL_SUB_SEQ = 1, - NARC_POKETOOL_PERSONAL_PERSONAL = 2, - NARC_POKETOOL_PERSONAL_GROWTBL = 3, - NARC_POKETOOL_POKEGRA_POKEGRA = 4, - NARC_POKETOOL_POKEGRA_HEIGHT = 5, - NARC_POKETOOL_TRGRA_TRBGRA = 6, - NARC_BATTLE_GRAPHIC_BATT_BG = 7, - NARC_WAZAEFFECT_WE = 8, - NARC_POKETOOL_WAZA_WAZA_TBL = 9, - NARC_FIELDDATA_SCRIPT_SCR_SEQ_RELEASE = 10, - NARC_MSGDATA_SCENARIO_SCR_MSG = 11, - NARC_GRAPHIC_POKETCH = 12, - NARC_GRAPHIC_BAG_GRA = 13, - NARC_GRAPHIC_FONT = 14, - NARC_ITEMTOOL_ITEMDATA_ITEM_DATA = 15, - NARC_ITEMTOOL_ITEMDATA_ITEM_ICON = 16, - NARC_GRAPHIC_TMAP_GRA = 17, - NARC_GRAPHIC_BOX = 18, - NARC_POKETOOL_ICONGRA_POKE_ICON = 19, - NARC_GRAPHIC_PLIST_GRA = 20, - NARC_WAZAEFFECT_EFFECTCLACT_WECHAR = 21, - NARC_WAZAEFFECT_EFFECTCLACT_WEPLTT = 22, - NARC_WAZAEFFECT_EFFECTCLACT_WECELL = 23, - NARC_WAZAEFFECT_EFFECTCLACT_WECELLANM = 24, - NARC_GRAPHIC_IMAGECLIP = 25, - NARC_MSGDATA_MSG = 26, - NARC_BATTLE_GRAPHIC_BATT_OBJ = 27, - NARC_DATA_UNDERG_RADAR = 28, - NARC_WAZAEFFECT_EFFECTDATA_WAZA_PARTICLE = 29, - NARC_BATTLE_SKILL_BE_SEQ = 30, - NARC_DATA_NAMEIN = 31, - NARC_FIELDDATA_EVENTDATA_ZONE_EVENT_RELEASE = 32, - NARC_POKETOOL_PERSONAL_WOTBL = 33, - NARC_POKETOOL_PERSONAL_EVO = 34, - NARC_GRAPHIC_FONTOAM = 35, - NARC_GRAPHIC_FIELD_BOARD = 36, - NARC_FIELDDATA_ENCOUNTDATA_D_ENC_DATA = 37, - NARC_GRAPHIC_WINFRAME = 38, - NARC_GRAPHIC_PST_GRA = 39, - NARC_FIELDDATA_BUILD_MODEL_BUILD_MODEL = 40, - NARC_FIELDDATA_MAPMATRIX_MAP_MATRIX = 41, - NARC_FIELDDATA_AREADATA_AREA_DATA = 42, - NARC_FIELDDATA_AREADATA_AREA_BUILD_MODEL_AREA_BUILD = 43, - NARC_FIELDDATA_AREADATA_AREA_MAP_TEX_MAP_TEX_SET = 44, - NARC_CONTEST_GRAPHIC_CONTEST_BG = 45, - NARC_CONTEST_GRAPHIC_CONTEST_OBJ = 46, - NARC_DATA_UGEFFECT_OBJ_GRAPHIC = 47, - NARC_DEMO_TITLE_TITLEDEMO = 48, - NARC_FIELDDATA_AREADATA_AREA_MOVE_MODEL_MOVE_MODEL_LIST = 49, - NARC_DATA_UG_TRAP = 50, - NARC_GRAPHIC_TRAINER_CASE = 51, - NARC_DATA_UG_FOSSIL = 52, - NARC_GRAPHIC_NTAG_GRA = 53, - NARC_DATA_TRADELIST = 54, - NARC_DATA_UG_PARTS = 55, - NARC_GRAPHIC_OPENING = 56, - NARC_POKETOOL_TRAINER_TRDATA = 57, - NARC_POKETOOL_TRAINER_TRPOKE = 58, - NARC_POKETOOL_TRMSG_TRTBL = 59, - NARC_POKETOOL_TRGRA_TRFGRA = 60, - NARC_PARTICLEDATA_PARTICLEDATA = 61, - NARC_GRAPHIC_SHOP_GRA = 62, - NARC_WAZAEFFECT_WE_SUB = 63, - NARC_DATA_UG_ANIM = 64, - NARC_DATA_WEATHER_SYS = 65, - NARC_GRAPHIC_MENU_GRA = 66, - NARC_FIELDDATA_LAND_DATA_LAND_DATA_RELEASE = 67, - NARC_ITEMTOOL_ITEMDATA_NUTS_DATA = 68, - NARC_RESOURCE_ENG_ZUKAN_ZUKAN = 69, - NARC_POKETOOL_POKEFOOT_POKEFOOT = 70, - NARC_FIELDDATA_AREADATA_AREA_BUILD_MODEL_AREABM_TEXSET = 71, - NARC_BATTLE_GRAPHIC_B_PLIST_GRA = 72, - NARC_GRAPHIC_CONFIG_GRA = 73, - NARC_GRAPHIC_UNIONROOM = 74, - NARC_APPLICATION_ZUKANLIST_ZKN_DATA_ZUKAN_DATA = 75, - NARC_GRAPHIC_PMSI = 76, - NARC_BATTLE_GRAPHIC_B_BAG_GRA = 77, - NARC_GRAPHIC_OEKAKI = 78, - NARC_GRAPHIC_MAIL_GRA = 79, - NARC_GRAPHIC_F_NOTE_GRA = 80, - NARC_DATA_MMODEL_MMODEL = 81, - NARC_GRAPHIC_EV_POKESELECT = 82, - NARC_GRAPHIC_PORU_GRA = 83, - NARC_GRAPHIC_TOUCH_SUBWINDOW = 84, - NARC_GRAPHIC_FLD_COMACT = 85, - NARC_GRAPHIC_RECORD = 86, - NARC_GRAPHIC_PORUDEMO = 87, - NARC_GRAPHIC_PORUACT = 88, - NARC_DATA_WIFINOTE = 89, - NARC_CONTEST_DATA_CONTEST_DATA = 90, - NARC_APPLICATION_CUSTOM_BALL_DATA_CB_DATA = 91, - NARC_DATA_WIFIP2PMATCH = 92, - NARC_GRAPHIC_DEMO_TRADE = 93, - NARC_POKEANIME_POKE_ANM = 94, - NARC_GRAPHIC_MYSIGN = 95, - NARC_FIELDDATA_MM_LIST_MOVE_MODEL_LIST = 96, - NARC_DATA_FIELD_CUTIN = 97, - NARC_DATA_DEMO_CLIMAX = 98, - NARC_WAZAEFFECT_EFFECTDATA_BALL_PARTICLE = 99, +typedef enum NarcId { + NARC_BATTLE_SKILL_WAZA_SEQ = 0, + NARC_BATTLE_SKILL_SUB_SEQ = 1, + NARC_POKETOOL_PERSONAL_PERSONAL = 2, + NARC_POKETOOL_PERSONAL_GROWTBL = 3, + NARC_POKETOOL_POKEGRA_POKEGRA = 4, + NARC_POKETOOL_POKEGRA_HEIGHT = 5, + NARC_POKETOOL_TRGRA_TRBGRA = 6, + NARC_BATTLE_GRAPHIC_BATT_BG = 7, + NARC_WAZAEFFECT_WE = 8, + NARC_POKETOOL_WAZA_WAZA_TBL = 9, + NARC_FIELDDATA_SCRIPT_SCR_SEQ_RELEASE = 10, + NARC_MSGDATA_SCENARIO_SCR_MSG = 11, + NARC_GRAPHIC_POKETCH = 12, + NARC_GRAPHIC_BAG_GRA = 13, + NARC_GRAPHIC_FONT = 14, + NARC_ITEMTOOL_ITEMDATA_ITEM_DATA = 15, + NARC_ITEMTOOL_ITEMDATA_ITEM_ICON = 16, + NARC_GRAPHIC_TMAP_GRA = 17, + NARC_GRAPHIC_BOX = 18, + NARC_POKETOOL_ICONGRA_POKE_ICON = 19, + NARC_GRAPHIC_PLIST_GRA = 20, + NARC_WAZAEFFECT_EFFECTCLACT_WECHAR = 21, + NARC_WAZAEFFECT_EFFECTCLACT_WEPLTT = 22, + NARC_WAZAEFFECT_EFFECTCLACT_WECELL = 23, + NARC_WAZAEFFECT_EFFECTCLACT_WECELLANM = 24, + NARC_GRAPHIC_IMAGECLIP = 25, + NARC_MSGDATA_MSG = 26, + NARC_BATTLE_GRAPHIC_BATT_OBJ = 27, + NARC_DATA_UNDERG_RADAR = 28, + NARC_WAZAEFFECT_EFFECTDATA_WAZA_PARTICLE = 29, + NARC_BATTLE_SKILL_BE_SEQ = 30, + NARC_DATA_NAMEIN = 31, + NARC_FIELDDATA_EVENTDATA_ZONE_EVENT_RELEASE = 32, + NARC_POKETOOL_PERSONAL_WOTBL = 33, + NARC_POKETOOL_PERSONAL_EVO = 34, + NARC_GRAPHIC_FONTOAM = 35, + NARC_GRAPHIC_FIELD_BOARD = 36, + NARC_FIELDDATA_ENCOUNTDATA_D_ENC_DATA = 37, + NARC_GRAPHIC_WINFRAME = 38, + NARC_GRAPHIC_PST_GRA = 39, + NARC_FIELDDATA_BUILD_MODEL_BUILD_MODEL = 40, + NARC_FIELDDATA_MAPMATRIX_MAP_MATRIX = 41, + NARC_FIELDDATA_AREADATA_AREA_DATA = 42, + NARC_FIELDDATA_AREADATA_AREA_BUILD_MODEL_AREA_BUILD = 43, + NARC_FIELDDATA_AREADATA_AREA_MAP_TEX_MAP_TEX_SET = 44, + NARC_CONTEST_GRAPHIC_CONTEST_BG = 45, + NARC_CONTEST_GRAPHIC_CONTEST_OBJ = 46, + NARC_DATA_UGEFFECT_OBJ_GRAPHIC = 47, + NARC_DEMO_TITLE_TITLEDEMO = 48, + NARC_FIELDDATA_AREADATA_AREA_MOVE_MODEL_MOVE_MODEL_LIST = 49, + NARC_DATA_UG_TRAP = 50, + NARC_GRAPHIC_TRAINER_CASE = 51, + NARC_DATA_UG_FOSSIL = 52, + NARC_GRAPHIC_NTAG_GRA = 53, + NARC_DATA_TRADELIST = 54, + NARC_DATA_UG_PARTS = 55, + NARC_GRAPHIC_OPENING = 56, + NARC_POKETOOL_TRAINER_TRDATA = 57, + NARC_POKETOOL_TRAINER_TRPOKE = 58, + NARC_POKETOOL_TRMSG_TRTBL = 59, + NARC_POKETOOL_TRGRA_TRFGRA = 60, + NARC_PARTICLEDATA_PARTICLEDATA = 61, + NARC_GRAPHIC_SHOP_GRA = 62, + NARC_WAZAEFFECT_WE_SUB = 63, + NARC_DATA_UG_ANIM = 64, + NARC_DATA_WEATHER_SYS = 65, + NARC_GRAPHIC_MENU_GRA = 66, + NARC_FIELDDATA_LAND_DATA_LAND_DATA_RELEASE = 67, + NARC_ITEMTOOL_ITEMDATA_NUTS_DATA = 68, + NARC_RESOURCE_ENG_ZUKAN_ZUKAN = 69, + NARC_POKETOOL_POKEFOOT_POKEFOOT = 70, + NARC_FIELDDATA_AREADATA_AREA_BUILD_MODEL_AREABM_TEXSET = 71, + NARC_BATTLE_GRAPHIC_B_PLIST_GRA = 72, + NARC_GRAPHIC_CONFIG_GRA = 73, + NARC_GRAPHIC_UNIONROOM = 74, + NARC_APPLICATION_ZUKANLIST_ZKN_DATA_ZUKAN_DATA = 75, + NARC_GRAPHIC_PMSI = 76, + NARC_BATTLE_GRAPHIC_B_BAG_GRA = 77, + NARC_GRAPHIC_OEKAKI = 78, + NARC_GRAPHIC_MAIL_GRA = 79, + NARC_GRAPHIC_F_NOTE_GRA = 80, + NARC_DATA_MMODEL_MMODEL = 81, + NARC_GRAPHIC_EV_POKESELECT = 82, + NARC_GRAPHIC_PORU_GRA = 83, + NARC_GRAPHIC_TOUCH_SUBWINDOW = 84, + NARC_GRAPHIC_FLD_COMACT = 85, + NARC_GRAPHIC_RECORD = 86, + NARC_GRAPHIC_PORUDEMO = 87, + NARC_GRAPHIC_PORUACT = 88, + NARC_DATA_WIFINOTE = 89, + NARC_CONTEST_DATA_CONTEST_DATA = 90, + NARC_APPLICATION_CUSTOM_BALL_DATA_CB_DATA = 91, + NARC_DATA_WIFIP2PMATCH = 92, + NARC_GRAPHIC_DEMO_TRADE = 93, + NARC_POKEANIME_POKE_ANM = 94, + NARC_GRAPHIC_MYSIGN = 95, + NARC_FIELDDATA_MM_LIST_MOVE_MODEL_LIST = 96, + NARC_DATA_FIELD_CUTIN = 97, + NARC_DATA_DEMO_CLIMAX = 98, + NARC_WAZAEFFECT_EFFECTDATA_BALL_PARTICLE = 99, NARC_WAZAEFFECT_PT_DEBUG_DEBUG_PARTICLE = 100, NARC_GRAPHIC_DENDOU_PC = 101, NARC_APPLICATION_WIFI_EARTH_WIFI_EARTH_PLACE = 102, @@ -163,22 +162,22 @@ typedef enum NarcId NARC_POKETOOL_SHINZUKAN = 145, } NarcId; -void ReadFromNarcMemberByPathAndId(void * dest, const char * path, s32 file_idx, u32 offset, u32 size); -void * AllocAndReadFromNarcMemberByPathAndId(const char * path, s32 file_idx, HeapID heapId, u32 offset, u32 size, BOOL r4); -void ReadWholeNarcMemberByIdPair(void * dest, NarcId narc_id, s32 file_id); -void * AllocAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId); -void * AllocAtEndAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId); -void ReadFromNarcMemberByIdPair(void * dest, NarcId narc_id, s32 file_id, u32 offset, u32 size); -void * AllocAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size); -void * AllocAtEndAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size); +void ReadFromNarcMemberByPathAndId(void *dest, const char *path, s32 file_idx, u32 offset, u32 size); +void *AllocAndReadFromNarcMemberByPathAndId(const char *path, s32 file_idx, HeapID heapId, u32 offset, u32 size, BOOL r4); +void ReadWholeNarcMemberByIdPair(void *dest, NarcId narc_id, s32 file_id); +void *AllocAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId); +void *AllocAtEndAndReadWholeNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId); +void ReadFromNarcMemberByIdPair(void *dest, NarcId narc_id, s32 file_id, u32 offset, u32 size); +void *AllocAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size); +void *AllocAtEndAndReadFromNarcMemberByIdPair(NarcId narc_id, s32 file_id, HeapID heapId, u32 offset, u32 size); u32 GetNarcMemberSizeByIdPair(NarcId narc_id, s32 file_idx); -NARC * NARC_New(NarcId narc_id, HeapID heapId); -void NARC_Delete(NARC * narc); -void * NARC_AllocAndReadWholeMember(NARC * narc, u32 file_id, HeapID heapId); -void NARC_ReadWholeMember(NARC * narc, u32 file_id, void * dest); -u32 NARC_GetMemberSize(NARC * narc, u32 file_id); -void NARC_ReadFromMember(NARC * narc, u32 file_id, u32 pos, u32 size, void * dest); -void NARC_ReadFile(NARC * narc, u32 size, void * dest); -u16 NARC_GetFileCount(NARC * narc); +NARC *NARC_New(NarcId narc_id, HeapID heapId); +void NARC_Delete(NARC *narc); +void *NARC_AllocAndReadWholeMember(NARC *narc, u32 file_id, HeapID heapId); +void NARC_ReadWholeMember(NARC *narc, u32 file_id, void *dest); +u32 NARC_GetMemberSize(NARC *narc, u32 file_id); +void NARC_ReadFromMember(NARC *narc, u32 file_id, u32 pos, u32 size, void *dest); +void NARC_ReadFile(NARC *narc, u32 size, void *dest); +u16 NARC_GetFileCount(NARC *narc); -#endif //POKEDIAMOND_FILESYSTEM_H +#endif // POKEDIAMOND_FILESYSTEM_H diff --git a/include/font.h b/include/font.h index 9b6507b63..e2d3e0cb9 100644 --- a/include/font.h +++ b/include/font.h @@ -2,17 +2,16 @@ #define POKEDIAMOND_FONT_H #include "global.h" + #include "text.h" -struct UnkStruct_02002C14_sub -{ +struct UnkStruct_02002C14_sub { const char buf[0x80]; u8 width; u8 height; }; -struct UnkStruct_02002C14 -{ +struct UnkStruct_02002C14 { struct UnkStruct_02002C14_sub unk00; void *unk84[4]; struct FontData *unk94[4]; diff --git a/include/game_init.h b/include/game_init.h index 6bbf2dedb..9a3d862c5 100644 --- a/include/game_init.h +++ b/include/game_init.h @@ -9,30 +9,29 @@ typedef volatile struct u8 svc_stack[0x40]; u8 reserved[0x38]; u32 intr_check; - void * intr_vector; -} -OS_DTCM; + void *intr_vector; +} OS_DTCM; #define DTCM (*(OS_DTCM *)HW_DTCM) void sub_02015EA0(void); void sub_02015ED4(void); void sub_02015EF4(void); -void Main_SetVBlankIntrCB(void (*a0)(void *), void * a1); +void Main_SetVBlankIntrCB(void (*a0)(void *), void *a1); void sub_02015F1C(void); -BOOL Main_SetHBlankIntrCB(void (*a0)(void *), void * a1); +BOOL Main_SetHBlankIntrCB(void (*a0)(void *), void *a1); void Main_CallHBlankCallback(void); void Main_ToggleHBlankInterrupt(BOOL enableFlag); void sub_02015FC8(void); void InitSystemForTheGame(void); void InitGraphicMemory(void); -void * AllocAndReadFile(HeapID heapId, const char * path); -void OpenAndReadWholeFile(const char * path, void ** ptr); -u32 GetFilenameHash(const s8 * str); +void *AllocAndReadFile(HeapID heapId, const char *path); +void OpenAndReadWholeFile(const char *path, void **ptr); +u32 GetFilenameHash(const s8 *str); int GetFileCacheId(u32 hash); -int AddFileToCache(void * contents, u32 hash); +int AddFileToCache(void *contents, u32 hash); void ClearFileCache(void); -void * OpenFileCached(const s8 * str, HeapID heapId); +void *OpenFileCached(const s8 *str, HeapID heapId); void InitKeypadAndTouchpad(void); void sub_02016438(u8 a0); void sub_02016444(u8 a0); @@ -43,4 +42,4 @@ void SetKeyRepeatTimers(int continueDelay, int startDelay); void SetSoftResetDisableMask(u8 a0); void ClearSoftResetDisableMask(u8 a0); -#endif //POKEDIAMOND_GAME_INIT_H +#endif // POKEDIAMOND_GAME_INIT_H diff --git a/include/gf_gfx_loader.h b/include/gf_gfx_loader.h index 4ac738064..6a084d514 100644 --- a/include/gf_gfx_loader.h +++ b/include/gf_gfx_loader.h @@ -5,21 +5,21 @@ #include "filesystem.h" #include "heap.h" -u32 GfGfxLoader_LoadCharData(NarcId narcId, s32 memberNo, struct BgConfig * unkStruct02016B94_2, u32 layer, u32 numTiles, u32 szByte, BOOL isCompressed, HeapID heapId); -void GfGfxLoader_LoadScrnData(NarcId narcId, s32 memberNo, struct BgConfig * unkStruct02016B94_2, u32 layer, u32 tileOffset, u32 szByte, BOOL isCompressed, HeapID heapId); +u32 GfGfxLoader_LoadCharData(NarcId narcId, s32 memberNo, struct BgConfig *unkStruct02016B94_2, u32 layer, u32 numTiles, u32 szByte, BOOL isCompressed, HeapID heapId); +void GfGfxLoader_LoadScrnData(NarcId narcId, s32 memberNo, struct BgConfig *unkStruct02016B94_2, u32 layer, u32 tileOffset, u32 szByte, BOOL isCompressed, HeapID heapId); void GfGfxLoader_GXLoadPal(NarcId narcId, s32 memberNo, enum GFPalLoadLocation location, enum GFPalSlotOffset palSlotOffset, u32 szByte, HeapID heapId); void GfGfxLoader_GXLoadPalWithSrcOffset(NarcId narcId, s32 memberNo, enum GFPalLoadLocation location, u32 srcOffset, enum GFPalSlotOffset palSlotOffset, u32 szByte, HeapID heapId); u32 GfGfxLoader_LoadWholePalette(NarcId narcId, s32 memberId, u32 layer, u32 baseAddr, u32 szByte, BOOL isCompressed, HeapID heapId); -void GfGfxLoader_PartiallyLoadPalette(NarcId narcId, s32 memberId, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, HeapID heapId, NNSG2dImagePaletteProxy * pPltProxy); +void GfGfxLoader_PartiallyLoadPalette(NarcId narcId, s32 memberId, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, HeapID heapId, NNSG2dImagePaletteProxy *pPltProxy); u32 GfGfxLoader_LoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 layer, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, HeapID heapId, NNSG2dImageProxy *pImgProxy); -void GfGfxLoader_SetObjCntFlagsAndLoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 layer, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, HeapID heapId, NNSG2dImageProxy * pImageProxy); -void * GfGfxLoader_GetCharData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCharacterData ** ppCharData, HeapID heapId); -void * GfGfxLoader_GetScrnData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dScreenData ** ppScrData, HeapID heapId); -void * GfGfxLoader_GetPlttData(NarcId narcId, s32 memberId, NNSG2dPaletteData ** ppPltData, HeapID heapId); -void * GfGfxLoader_GetCellBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCellDataBank ** ppCellBank, HeapID heapId); -void * GfGfxLoader_GetAnimBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dAnimBankData ** ppAnimBank, HeapID heapId); -void * GfGfxLoader_UncompressFromNarc(NarcId narcId, s32 memberId, HeapID heapId); -void * GfGfxLoader_LoadFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd); -void * GfGfxLoader_LoadFromNarc_GetSizeOut(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd, u32 *size_p); +void GfGfxLoader_SetObjCntFlagsAndLoadImageMapping(NarcId narcId, s32 memberId, BOOL isCompressed, u32 layer, u32 szByte, NNS_G2D_VRAM_TYPE type, u32 baseAddr, HeapID heapId, NNSG2dImageProxy *pImageProxy); +void *GfGfxLoader_GetCharData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCharacterData **ppCharData, HeapID heapId); +void *GfGfxLoader_GetScrnData(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dScreenData **ppScrData, HeapID heapId); +void *GfGfxLoader_GetPlttData(NarcId narcId, s32 memberId, NNSG2dPaletteData **ppPltData, HeapID heapId); +void *GfGfxLoader_GetCellBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dCellDataBank **ppCellBank, HeapID heapId); +void *GfGfxLoader_GetAnimBank(NarcId narcId, s32 memberId, BOOL isCompressed, NNSG2dAnimBankData **ppAnimBank, HeapID heapId); +void *GfGfxLoader_UncompressFromNarc(NarcId narcId, s32 memberId, HeapID heapId); +void *GfGfxLoader_LoadFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd); +void *GfGfxLoader_LoadFromNarc_GetSizeOut(NarcId narcId, s32 memberNo, BOOL isCompressed, HeapID heapId, BOOL allocAtEnd, u32 *size_p); -#endif //POKEDIAMOND_GF_GFX_LOADER_H +#endif // POKEDIAMOND_GF_GFX_LOADER_H diff --git a/include/gf_gfx_planes.h b/include/gf_gfx_planes.h index 0d0b1c600..a6e9eb222 100644 --- a/include/gf_gfx_planes.h +++ b/include/gf_gfx_planes.h @@ -1,18 +1,16 @@ #ifndef POKEDIAMOND_GF_GX_PLANES_H #define POKEDIAMOND_GF_GX_PLANES_H - #include "global.h" -#include "gx.h" +#include "gx.h" typedef enum { GX_PLANE_TOGGLE_OFF, GX_PLANE_TOGGLE_ON, } GXPlaneToggle; -typedef struct GraphicsBanks -{ +typedef struct GraphicsBanks { GXVRamBG bg; GXVRamBGExtPltt bgextpltt; GXVRamSubBG subbg; @@ -42,4 +40,4 @@ void GfGfx_BothDispOn(void); void GfGfx_SwapDisplay(void); u32 GfGfx_EngineAGetPlanes(void); -#endif //POKEDIAMOND_GF_GX_PLANES_H +#endif // POKEDIAMOND_GF_GX_PLANES_H diff --git a/include/gf_rtc.h b/include/gf_rtc.h index 820f9f05b..513bd8ec1 100644 --- a/include/gf_rtc.h +++ b/include/gf_rtc.h @@ -1,11 +1,11 @@ #ifndef POKEDIAMOND_GF_RTC_H #define POKEDIAMOND_GF_RTC_H -#include "RTC_api.h" #include "nitro/types.h" -enum RTC_Month -{ +#include "RTC_api.h" + +enum RTC_Month { RTC_MONTH_JANUARY = 1, RTC_MONTH_FEBRUARY, RTC_MONTH_MARCH, @@ -20,8 +20,7 @@ enum RTC_Month RTC_MONTH_DECEMBER, }; -enum RTC_TimeOfDay -{ +enum RTC_TimeOfDay { RTC_TIMEOFDAY_MORN = 0, RTC_TIMEOFDAY_DAY, RTC_TIMEOFDAY_EVE, @@ -31,16 +30,16 @@ enum RTC_TimeOfDay void GF_InitRTCWork(void); void GF_RTC_UpdateOnFrame(void); -void GF_RTC_GetDateTime_Callback(RTCResult result, void * data); -void GF_RTC_CopyDateTime(RTCDate * date, RTCTime * time); -void GF_RTC_CopyTime(RTCTime * time); -void GF_RTC_CopyDate(RTCDate * date); +void GF_RTC_GetDateTime_Callback(RTCResult result, void *data); +void GF_RTC_CopyDateTime(RTCDate *date, RTCTime *time); +void GF_RTC_CopyTime(RTCTime *time); +void GF_RTC_CopyDate(RTCDate *date); s32 GF_RTC_TimeToSec(void); s64 GF_RTC_DateTimeToSec(void); -s32 GF_RTC_GetDayOfYear(const RTCDate * date); +s32 GF_RTC_GetDayOfYear(const RTCDate *date); BOOL IsNighttime(void); enum RTC_TimeOfDay GF_RTC_GetTimeOfDay(void); enum RTC_TimeOfDay GF_RTC_GetTimeOfDayByHour(s32 hour); s64 GF_RTC_TimeDelta(s64 first, s64 last); -#endif //POKEDIAMOND_GF_RTC_H +#endif // POKEDIAMOND_GF_RTC_H diff --git a/include/global.h b/include/global.h index 78088710b..47cc2d3eb 100644 --- a/include/global.h +++ b/include/global.h @@ -1,25 +1,29 @@ #ifndef GUARD_GLOBAL_H #define GUARD_GLOBAL_H -#include "config.h" - -#include "NNS_G3D_res_struct.h" //todo: add to nnsys.h - -#include -#include "function_target.h" #include "nitro/types.h" +#include + #include "constants/global.h" + +#include "NNS_G3D_res_struct.h" //todo: add to nnsys.h +#include "config.h" #include "error_handling.h" +#include "function_target.h" #define NELEMS(a) (sizeof(a) / sizeof(*(a))) -#define GF_ASSERT(expr) do {if (!(expr)) GF_AssertFail();} while (0) +#define GF_ASSERT(expr) \ + do { \ + if (!(expr)) \ + GF_AssertFail(); \ + } while (0) #ifndef IN_MAIN_C extern const u8 gGameLanguage; extern const u8 gGameVersion; -#endif //IN_MAIN_C +#endif // IN_MAIN_C #include "code16.h" -#endif //GUARD_GLOBAL_H +#endif // GUARD_GLOBAL_H diff --git a/include/hall_of_fame.h b/include/hall_of_fame.h index 72323b650..33a4de50b 100644 --- a/include/hall_of_fame.h +++ b/include/hall_of_fame.h @@ -6,8 +6,7 @@ #include "RTC_api.h" #include "pokemon.h" -struct HOFMon -{ +struct HOFMon { /* 0x00 */ u16 species; /* 0x02 */ u8 level; /* 0x03 */ u8 form; @@ -19,25 +18,22 @@ struct HOFMon /* 0x3A */ u8 padding[2]; }; -struct HOFParty -{ +struct HOFParty { struct HOFMon party[6]; u16 year; u8 month; u8 day; }; -typedef struct HallOfFame -{ +typedef struct HallOfFame { struct HOFParty parties[NUM_HOF_RECORDS]; u32 next_record; u32 num_total; } HallOfFame; -struct HofDisplayMon -{ - struct String * nickname; - struct String * otname; +struct HofDisplayMon { + struct String *nickname; + struct String *otname; u32 personality; u32 otid; u16 species; @@ -47,12 +43,12 @@ struct HofDisplayMon }; u32 Save_HOF_sizeof(void); -void Save_HOF_Init(struct HallOfFame * hof); -void Save_HOF_RecordParty(struct HallOfFame * hof, struct Party * party, RTCDate * date); -u32 Save_HOF_GetNumRecords(struct HallOfFame * hof); -int Save_HOF_TranslateRecordIdx(struct HallOfFame * hof, int a1); -u32 Save_HOF_RecordCountMons(struct HallOfFame * hof, int a1); -void Save_HOF_GetMonStatsByIndexPair(struct HallOfFame * hof, int a1, int a2, struct HofDisplayMon * dest); -void Save_HOF_GetClearDate(struct HallOfFame * hof, int a1, RTCDate * dest); - -#endif //POKEDIAMOND_HALL_OF_FAME_H +void Save_HOF_Init(struct HallOfFame *hof); +void Save_HOF_RecordParty(struct HallOfFame *hof, struct Party *party, RTCDate *date); +u32 Save_HOF_GetNumRecords(struct HallOfFame *hof); +int Save_HOF_TranslateRecordIdx(struct HallOfFame *hof, int a1); +u32 Save_HOF_RecordCountMons(struct HallOfFame *hof, int a1); +void Save_HOF_GetMonStatsByIndexPair(struct HallOfFame *hof, int a1, int a2, struct HofDisplayMon *dest); +void Save_HOF_GetClearDate(struct HallOfFame *hof, int a1, RTCDate *dest); + +#endif // POKEDIAMOND_HALL_OF_FAME_H diff --git a/include/heap.h b/include/heap.h index 41f74e891..debc074b9 100644 --- a/include/heap.h +++ b/include/heap.h @@ -1,10 +1,12 @@ #ifndef POKEDIAMOND_HEAP_H #define POKEDIAMOND_HEAP_H -#include "global.h" #include "nitro/OS_arena_shared.h" -#include "NNS_FND_expheap.h" + +#include "global.h" + #include "NNS_FND_allocator.h" +#include "NNS_FND_expheap.h" typedef enum HeapID { HEAP_ID_DEFAULT, @@ -15,17 +17,16 @@ typedef enum HeapID { HEAP_ID_POKETCH_MAIN = 7, HEAP_ID_POKETCH_APP, HEAP_ID_FIELD = 11, - HEAP_ID_15 = 15, - HEAP_ID_32 = 32, - HEAP_ID_49 = 49, - HEAP_ID_76 = 76, + HEAP_ID_15 = 15, + HEAP_ID_32 = 32, + HEAP_ID_49 = 49, + HEAP_ID_76 = 76, HEAP_ID_77, - HEAP_ID_INTRO = 82, + HEAP_ID_INTRO = 82, HEAP_ID_INTRO_TV = 83, } HeapID; -struct HeapParam -{ +struct HeapParam { u32 size; OSArenaId arena; }; @@ -41,10 +42,10 @@ void AllocFail(void); void *AllocFromHeap(HeapID heapId, u32 size); void *AllocFromHeapAtEnd(HeapID heapId, u32 size); void FreeToHeap(void *ptr); -void FreeToHeapExplicit(HeapID heapId, void * ptr); +void FreeToHeapExplicit(HeapID heapId, void *ptr); u32 GF_ExpHeap_FndGetTotalFreeSize(HeapID heapId); -void GF_ExpHeap_FndInitAllocator(NNSFndAllocator * pAllocator, HeapID heapId, int alignment); +void GF_ExpHeap_FndInitAllocator(NNSFndAllocator *pAllocator, HeapID heapId, int alignment); void ReallocFromHeap(void *ptr, u32 newSize); BOOL GF_heap_c_dummy_return_true(HeapID heapId); -#endif //POKEDIAMOND_HEAP_H +#endif // POKEDIAMOND_HEAP_H diff --git a/include/igt.h b/include/igt.h index 4d88d2095..a9e3ed897 100644 --- a/include/igt.h +++ b/include/igt.h @@ -1,16 +1,17 @@ #ifndef POKEDIAMOND_IGT_H #define POKEDIAMOND_IGT_H -typedef struct IGT -{ +#include "nitro/types.h" + +typedef struct IGT { u16 hours; u8 minutes; u8 seconds; } IGT; -void InitIGT(struct IGT * igt); -void AddIGTSeconds(struct IGT * igt, u32 seconds); -u16 GetIGTHours(struct IGT * igt); -u8 GetIGTMinutes(struct IGT * igt); +void InitIGT(struct IGT *igt); +void AddIGTSeconds(struct IGT *igt, u32 seconds); +u16 GetIGTHours(struct IGT *igt); +u8 GetIGTMinutes(struct IGT *igt); -#endif //POKEDIAMOND_IGT_H +#endif // POKEDIAMOND_IGT_H diff --git a/include/itemtool.h b/include/itemtool.h index 6056f8a01..e4128fe7b 100644 --- a/include/itemtool.h +++ b/include/itemtool.h @@ -2,9 +2,11 @@ #define POKEDIAMOND_ITEMTOOL_H #include "global.h" + +#include "constants/items.h" + #include "filesystem.h" #include "string16.h" -#include "constants/items.h" #define ITEMDATA_DATA 0 #define ITEMDATA_NCGR 1 @@ -13,47 +15,45 @@ // Berries (nutdata) -typedef struct ItemSlot -{ +typedef struct ItemSlot { u16 id; u16 quantity; } ItemSlot; -struct ItemPartyUseParam -{ - u8 slp_heal:1; - u8 psn_heal:1; - u8 brn_heal:1; - u8 frz_heal:1; - u8 prz_heal:1; - u8 cfs_heal:1; - u8 inf_heal:1; - u8 guard_spec:1; - u8 revive:1; - u8 revive_all:1; - u8 level_up:1; - u8 evolve:1; - u8 atk_stages:4; - u8 def_stages:4; - u8 spatk_stages:4; - u8 spdef_stages:4; - u8 speed_stages:4; - u8 accuracy_stages:4; - u8 critrate_stages:2; - u8 pp_up:1; - u8 pp_max:1; - u8 pp_restore:1; - u8 pp_restore_all:1; - u8 hp_restore:1; - u8 hp_ev_up:1; - u8 atk_ev_up:1; - u8 def_ev_up:1; - u8 speed_ev_up:1; - u8 spatk_ev_up:1; - u8 spdef_ev_up:1; - u8 friendship_mod_lo:1; - u8 friendship_mod_med:1; - u8 friendship_mod_hi:1; +struct ItemPartyUseParam { + u8 slp_heal : 1; + u8 psn_heal : 1; + u8 brn_heal : 1; + u8 frz_heal : 1; + u8 prz_heal : 1; + u8 cfs_heal : 1; + u8 inf_heal : 1; + u8 guard_spec : 1; + u8 revive : 1; + u8 revive_all : 1; + u8 level_up : 1; + u8 evolve : 1; + u8 atk_stages : 4; + u8 def_stages : 4; + u8 spatk_stages : 4; + u8 spdef_stages : 4; + u8 speed_stages : 4; + u8 accuracy_stages : 4; + u8 critrate_stages : 2; + u8 pp_up : 1; + u8 pp_max : 1; + u8 pp_restore : 1; + u8 pp_restore_all : 1; + u8 hp_restore : 1; + u8 hp_ev_up : 1; + u8 atk_ev_up : 1; + u8 def_ev_up : 1; + u8 speed_ev_up : 1; + u8 spatk_ev_up : 1; + u8 spdef_ev_up : 1; + u8 friendship_mod_lo : 1; + u8 friendship_mod_med : 1; + u8 friendship_mod_hi : 1; s8 hp_ev_up_param; s8 atk_ev_up_param; s8 def_ev_up_param; @@ -68,8 +68,7 @@ struct ItemPartyUseParam u8 paddding[2]; }; -struct ItemData -{ +struct ItemData { u16 price; u8 holdEffect; u8 holdEffectParam; @@ -77,11 +76,11 @@ struct ItemData u8 unk5; u8 unk6; u8 naturalGiftPower; - u16 naturalGiftType:5; - u16 prevent_toss:1; - u16 selectable:1; - u16 pocket:4; - u16 unk8_B:5; + u16 naturalGiftType : 5; + u16 prevent_toss : 1; + u16 selectable : 1; + u16 pocket : 4; + u16 unk8_B : 5; u8 unkA; u8 unkB; u8 partyUse; @@ -93,17 +92,17 @@ struct ItemData u8 padding_22[2]; }; -void MoveItemSlotInList(struct ItemSlot * itemSlots, u16 from, u16 to); +void MoveItemSlotInList(struct ItemSlot *itemSlots, u16 from, u16 to); u16 GetItemIndexMapping(u16 a0, u16 a1); u16 UpConvertItemId_Gen3to4(u16 a0); int sub_0206E708(); int sub_0206E70C(); -void * LoadItemDataOrGfx(u16 itemId, u16 which, HeapID heapId); -void GetItemNameIntoString(struct String * dest, u16 item_id, HeapID heapId); -void GetItemDescIntoString(struct String * dest, u16 item_id, HeapID heapId); +void *LoadItemDataOrGfx(u16 itemId, u16 which, HeapID heapId); +void GetItemNameIntoString(struct String *dest, u16 item_id, HeapID heapId); +void GetItemDescIntoString(struct String *dest, u16 item_id, HeapID heapId); u32 GetItemAttr(u16 item, u32 attr, HeapID heapId); -u32 GetItemAttr_PreloadedItemData(struct ItemData * itemData, u32 attr); -u32 GetItemAttrSub(struct ItemPartyUseParam * sub, u32 attr); +u32 GetItemAttr_PreloadedItemData(struct ItemData *itemData, u32 attr); +u32 GetItemAttrSub(struct ItemPartyUseParam *sub, u32 attr); u16 TMHMGetMove(u16 a0); BOOL MoveIsHM(u16 a0); u8 ItemToTMHMId(u16 a0); @@ -114,7 +113,7 @@ BOOL ItemIdIsBerry(u16 item_id); u8 ItemToBerryId(u16 item_id); u16 BerryToItemId(u8 a0); u8 ItemIsBitter(u16 item_id); -struct ItemData * LoadAllItemData(HeapID heapId); -struct ItemData * GetItemDataPtrFromArray(struct ItemData * a0, u16 item_id); +struct ItemData *LoadAllItemData(HeapID heapId); +struct ItemData *GetItemDataPtrFromArray(struct ItemData *a0, u16 item_id); -#endif //POKEDIAMOND_ITEMTOOL_H +#endif // POKEDIAMOND_ITEMTOOL_H diff --git a/include/list_menu.h b/include/list_menu.h index 983c1071e..747b7b531 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -4,13 +4,13 @@ #include "list_menu_cursor.h" #include "list_menu_items.h" -#define LIST_HEADER -3 -#define LIST_CANCEL -2 -#define LIST_NOTHING_CHOSEN -1 +#define LIST_HEADER -3 +#define LIST_CANCEL -2 +#define LIST_NOTHING_CHOSEN -1 -#define LIST_NO_MULTIPLE_SCROLL 0 -#define LIST_MULTIPLE_SCROLL_DPAD 1 -#define LIST_MULTIPLE_SCROLL_L_R 2 +#define LIST_NO_MULTIPLE_SCROLL 0 +#define LIST_MULTIPLE_SCROLL_DPAD 1 +#define LIST_MULTIPLE_SCROLL_L_R 2 struct ListMenu; @@ -20,41 +20,39 @@ struct ListMenu; typedef void (*LM_MoveCursorFunc_t)(struct ListMenu *list, s32 index, u8 onInit); typedef void (*LM_ItemPrintFunc_t)(struct ListMenu *list, s32 index, u8 y); -struct ListMenuTemplate -{ - /*0x00*/ struct ListMenuItem * items; +struct ListMenuTemplate { + /*0x00*/ struct ListMenuItem *items; /*0x04*/ LM_MoveCursorFunc_t moveCursorFunc; /*0x08*/ LM_ItemPrintFunc_t itemPrintFunc; - /*0x0C*/ struct Window * window; + /*0x0C*/ struct Window *window; /*0x10*/ u16 totalItems; /*0x12*/ u16 maxShowed; /*0x14*/ u8 header_X; /*0x15*/ u8 item_X; /*0x16*/ u8 cursor_X; - /*0x17*/ u8 upText_Y:4; - u8 cursorPal:4; - /*0x18*/ u8 fillValue:4; - u8 cursorShadowPal:4; - /*0x1A*/ u16 lettersSpacing:3; - u16 itemVerticalPadding:4; - u16 scrollMultiple:2; - u16 fontId:6; - u16 cursorKind:1; + /*0x17*/ u8 upText_Y : 4; + u8 cursorPal : 4; + /*0x18*/ u8 fillValue : 4; + u8 cursorShadowPal : 4; + /*0x1A*/ u16 lettersSpacing : 3; + u16 itemVerticalPadding : 4; + u16 scrollMultiple : 2; + u16 fontId : 6; + u16 cursorKind : 1; /*0x1C*/ u32 unk_1C; }; -struct ListMenu -{ +struct ListMenu { /*0x00*/ struct ListMenuTemplate template; // ListMenuOverride from gen 3 - /*0x20*/ u8 cursorPal:4; - u8 fillValue:4; - /*0x21*/ u8 cursorShadowPal:4; - u8 unk_21_4:4; - /*0x22*/ u8 lettersSpacing:6; + /*0x20*/ u8 cursorPal : 4; + u8 fillValue : 4; + /*0x21*/ u8 cursorShadowPal : 4; + u8 unk_21_4 : 4; + /*0x22*/ u8 lettersSpacing : 6; /*0x23*/ u8 unk_23; - /*0x24*/ u8 fontId:7; - u8 overrideEnabled:1; + /*0x24*/ u8 fontId : 7; + u8 overrideEnabled : 1; /*0x28*/ struct ListMenuCursor *cursor; /*0x2c*/ u16 cursorPos; /*0x2e*/ u16 itemsAbove; @@ -65,24 +63,24 @@ struct ListMenu /*0x34*/ u8 heapId; }; -struct ListMenu * ListMenuInit(const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u8 heapId); -s32 ListMenu_ProcessInput(struct ListMenu * list); -void DestroyListMenu(struct ListMenu * list, u16 * cursorPos, u16 * itemsAbove); -void RedrawListMenu(struct ListMenu * list); -s32 ListMenuTestInputInternal(struct ListMenu * list, const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u16 updateFlag, u16 input, u16 *newCursorPos, u16 *newItemsAbove); -s32 ListMenuTestInput(struct ListMenu * list, const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u16 input, u16 *newCursorPos, u16 *newItemsAbove); -void ListMenuOverrideSetColors(struct ListMenu * list, u8 cursorPal, u8 fillValue, u8 cursorShadowPal); -void ListMenuGetCurrentItemArrayId(struct ListMenu * list, u16 * index_p); -void ListMenuGetScrollAndRow(struct ListMenu * list, u16 * cursorPos_p, u16 * itemsAbove_p); -u8 ListMenuGetUnk33(struct ListMenu * list); -s32 ListMenuGetValueByArrayId(struct ListMenu * list, s32 index); -s32 ListMenuGetTemplateField(struct ListMenu * list, u32 attr); -void ListMenuSetTemplateField(struct ListMenu * list, u32 attr, s32 value); -void ListMenuGetItemStr(struct ListMenu * list, struct ListMenuItem * items); -void ListMenuPrint(struct ListMenu * list, struct String * str, u8 x, u8 y); -void ListMenuErasePrintedCursor(struct ListMenu * list, u16 itemsAbove); +struct ListMenu *ListMenuInit(const struct ListMenuTemplate *template, u16 cursorPos, u16 itemsAbove, u8 heapId); +s32 ListMenu_ProcessInput(struct ListMenu *list); +void DestroyListMenu(struct ListMenu *list, u16 *cursorPos, u16 *itemsAbove); +void RedrawListMenu(struct ListMenu *list); +s32 ListMenuTestInputInternal(struct ListMenu *list, const struct ListMenuTemplate *template, u16 cursorPos, u16 itemsAbove, u16 updateFlag, u16 input, u16 *newCursorPos, u16 *newItemsAbove); +s32 ListMenuTestInput(struct ListMenu *list, const struct ListMenuTemplate *template, u16 cursorPos, u16 itemsAbove, u16 input, u16 *newCursorPos, u16 *newItemsAbove); +void ListMenuOverrideSetColors(struct ListMenu *list, u8 cursorPal, u8 fillValue, u8 cursorShadowPal); +void ListMenuGetCurrentItemArrayId(struct ListMenu *list, u16 *index_p); +void ListMenuGetScrollAndRow(struct ListMenu *list, u16 *cursorPos_p, u16 *itemsAbove_p); +u8 ListMenuGetUnk33(struct ListMenu *list); +s32 ListMenuGetValueByArrayId(struct ListMenu *list, s32 index); +s32 ListMenuGetTemplateField(struct ListMenu *list, u32 attr); +void ListMenuSetTemplateField(struct ListMenu *list, u32 attr, s32 value); +void ListMenuGetItemStr(struct ListMenu *list, struct ListMenuItem *items); +void ListMenuPrint(struct ListMenu *list, struct String *str, u8 x, u8 y); +void ListMenuErasePrintedCursor(struct ListMenu *list, u16 itemsAbove); u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *list, u8 movingDown); -void ListMenuScroll(struct ListMenu * list, u8 count, u8 movingDown); -void ListMenuCopyToVram(struct ListMenu * list); +void ListMenuScroll(struct ListMenu *list, u8 count, u8 movingDown); +void ListMenuCopyToVram(struct ListMenu *list); #endif // POKEDIAMOND_LIST_MENU_H diff --git a/include/list_menu_cursor.h b/include/list_menu_cursor.h index e024e00e7..6503d0fba 100644 --- a/include/list_menu_cursor.h +++ b/include/list_menu_cursor.h @@ -4,12 +4,11 @@ #include "bg_window.h" // TODO: Move to its own header, and fill it out -struct ListMenuCursor -{ +struct ListMenuCursor { // ??? }; -extern struct ListMenuCursor * ListMenuCursorNew(HeapID heapId); +extern struct ListMenuCursor *ListMenuCursorNew(HeapID heapId); extern void ListMenuUpdateCursorObj(struct ListMenuCursor *, struct Window *, u8 x, u8 y); extern void ListMenuCursorSetColor(struct ListMenuCursor *, u32); extern void DestroyListMenuCursorObj(struct ListMenuCursor *); diff --git a/include/list_menu_items.h b/include/list_menu_items.h index 432f8b6e7..4a98b63ea 100644 --- a/include/list_menu_items.h +++ b/include/list_menu_items.h @@ -1,21 +1,20 @@ #ifndef POKEDIAMOND_LIST_MENU_ITEMS_H #define POKEDIAMOND_LIST_MENU_ITEMS_H -#include "string16.h" #include "msgdata.h" +#include "string16.h" -struct ListMenuItem -{ - struct String * text; +struct ListMenuItem { + struct String *text; s32 value; }; -struct ListMenuItem * ListMenuItems_New(u32 count, HeapID heapId); -void ListMenuItems_Delete(struct ListMenuItem * items); -void ListMenuItems_AppendFromMsgData(struct ListMenuItem * items, struct MsgData * msgData, u32 msgNo, s32 value); -void ListMenuItems_AddItem(struct ListMenuItem * items, struct String * str, s32 value); -void ListMenuItems_CopyItem(struct ListMenuItem * items, struct ListMenuItem * src); -struct ListMenuItem * ListMenuItems_SeekEnd(struct ListMenuItem * items, HeapID* heapIdPtr); -void ListMenuItems_DestroyMenuStrings(struct ListMenuItem * items); +struct ListMenuItem *ListMenuItems_New(u32 count, HeapID heapId); +void ListMenuItems_Delete(struct ListMenuItem *items); +void ListMenuItems_AppendFromMsgData(struct ListMenuItem *items, struct MsgData *msgData, u32 msgNo, s32 value); +void ListMenuItems_AddItem(struct ListMenuItem *items, struct String *str, s32 value); +void ListMenuItems_CopyItem(struct ListMenuItem *items, struct ListMenuItem *src); +struct ListMenuItem *ListMenuItems_SeekEnd(struct ListMenuItem *items, HeapID *heapIdPtr); +void ListMenuItems_DestroyMenuStrings(struct ListMenuItem *items); #endif // POKEDIAMOND_LIST_MENU_ITEMS_H diff --git a/include/mail.h b/include/mail.h index f9cc27819..99a60f0e5 100644 --- a/include/mail.h +++ b/include/mail.h @@ -1,60 +1,58 @@ #ifndef POKEDIAMOND_SEALS_H #define POKEDIAMOND_SEALS_H -#include "save.h" -#include "mail_message.h" #include "heap.h" +#include "mail_message.h" +#include "save.h" -union MailPatternData -{ +union MailPatternData { u16 raw; struct { - u16 unk_0:12; - u16 unk_C:4; + u16 unk_0 : 12; + u16 unk_C : 4; } bits; }; -typedef struct Mail -{ - u32 author_otId; // author otid - u8 author_gender; // author gender - u8 author_language; // language - u8 author_version; // version - u8 mail_type; // mail type +typedef struct Mail { + u32 author_otId; // author otid + u8 author_gender; // author gender + u8 author_language; // language + u8 author_version; // version + u8 mail_type; // mail type u16 author_name[PLAYER_NAME_LENGTH + 1]; // author name union MailPatternData unk_18[3]; u8 padding_1E[2]; struct MailMessage unk_20[3]; } Mail; -struct Mail * Mail_New(HeapID heapId); +struct Mail *Mail_New(HeapID heapId); -void Mail_Init(struct Mail * mail); -BOOL Mail_TypeIsValid(struct Mail * mail); -struct Mail * Mail_New(HeapID heapId); -void Mail_Copy(const struct Mail * src, struct Mail * dest); -void Mail_SetNewMessageDetails(struct Mail * mail, u8 type, u8 monIdx, struct SaveData * save); -u32 Mail_GetOTID(struct Mail * mail); -u16 * Mail_GetAuthorNamePtr(struct Mail * mail); -u8 Mail_GetAuthorGender(struct Mail * mail); -u8 Mail_GetType(struct Mail * mail); -void Mail_SetType(struct Mail * mail, u8 type); -u8 Mail_GetLanguage(struct Mail * mail); -u8 Mail_GetVersion(struct Mail * mail); -u16 Mail_GetAttrFromUnk18Array(struct Mail * mail, u32 idx, u32 attr); -struct MailMessage * Mail_GetUnk20Array(struct Mail * mail, u32 idx); -void Mail_CopyToUnk20Array(struct Mail * mail, const struct MailMessage * src, u32 idx); -struct Mail * Save_Mailbox_Get(struct SaveData * save); +void Mail_Init(struct Mail *mail); +BOOL Mail_TypeIsValid(struct Mail *mail); +struct Mail *Mail_New(HeapID heapId); +void Mail_Copy(const struct Mail *src, struct Mail *dest); +void Mail_SetNewMessageDetails(struct Mail *mail, u8 type, u8 monIdx, struct SaveData *save); +u32 Mail_GetOTID(struct Mail *mail); +u16 *Mail_GetAuthorNamePtr(struct Mail *mail); +u8 Mail_GetAuthorGender(struct Mail *mail); +u8 Mail_GetType(struct Mail *mail); +void Mail_SetType(struct Mail *mail, u8 type); +u8 Mail_GetLanguage(struct Mail *mail); +u8 Mail_GetVersion(struct Mail *mail); +u16 Mail_GetAttrFromUnk18Array(struct Mail *mail, u32 idx, u32 attr); +struct MailMessage *Mail_GetUnk20Array(struct Mail *mail, u32 idx); +void Mail_CopyToUnk20Array(struct Mail *mail, const struct MailMessage *src, u32 idx); +struct Mail *Save_Mailbox_Get(struct SaveData *save); u32 Save_Mailbox_sizeof(void); -void Save_Mailbox_Init(struct Mail * mail); -s32 Mailbox_GetFirstEmptySlotIdx(struct Mail * mail, BOOL r1); -void Mailbox_DeleteSlotI(struct Mail * mail, BOOL r1, s32 idx); -void Mailbox_CopyMailToSlotI(struct Mail * mail, BOOL r1, s32 idx, const struct Mail * src); -s32 Mailbox_CountMessages(struct Mail * mail, BOOL r1); -struct Mail * Mailbox_AllocAndFetchMailI(struct Mail * mail, BOOL r1, s32 idx, HeapID heapId); -void Mailbox_FetchMailIToBuffer(struct Mail * mail, BOOL r1, s32 idx, struct Mail * dest); -s32 MailArray_GetFirstEmptySlotIdx(struct Mail * mail, s32 count); -s32 MailArray_CountMessages(struct Mail * mail, s32 count); -struct Mail * Mailbox_GetPtrToSlotI(struct Mail * mail, BOOL r1, s32 idx); +void Save_Mailbox_Init(struct Mail *mail); +s32 Mailbox_GetFirstEmptySlotIdx(struct Mail *mail, BOOL r1); +void Mailbox_DeleteSlotI(struct Mail *mail, BOOL r1, s32 idx); +void Mailbox_CopyMailToSlotI(struct Mail *mail, BOOL r1, s32 idx, const struct Mail *src); +s32 Mailbox_CountMessages(struct Mail *mail, BOOL r1); +struct Mail *Mailbox_AllocAndFetchMailI(struct Mail *mail, BOOL r1, s32 idx, HeapID heapId); +void Mailbox_FetchMailIToBuffer(struct Mail *mail, BOOL r1, s32 idx, struct Mail *dest); +s32 MailArray_GetFirstEmptySlotIdx(struct Mail *mail, s32 count); +s32 MailArray_CountMessages(struct Mail *mail, s32 count); +struct Mail *Mailbox_GetPtrToSlotI(struct Mail *mail, BOOL r1, s32 idx); -#endif //POKEDIAMOND_SEALS_H +#endif // POKEDIAMOND_SEALS_H diff --git a/include/mail_message.h b/include/mail_message.h index 835e9d0ed..aa8746114 100644 --- a/include/mail_message.h +++ b/include/mail_message.h @@ -3,33 +3,32 @@ #include "heap.h" -struct MailMessage -{ +struct MailMessage { u16 msg_bank; u16 msg_no; u16 fields[2]; }; -#define MAILMSG_BANK_NONE (0xFFFF) -#define MAILMSG_FIELDS_MAX (2) +#define MAILMSG_BANK_NONE (0xFFFF) +#define MAILMSG_FIELDS_MAX (2) -void MailMsg_Init(struct MailMessage * mailMsg); -void MailMsg_Init_WithBank(struct MailMessage * mailMsg, u16 bank); -void MailMsg_Init_Default(struct MailMessage * mailMsg); -void MailMsg_Init_FromTemplate(struct MailMessage * mailMsg, u32 a1); -struct String * MailMsg_GetExpandedString(struct MailMessage * mailMsg, HeapID heapId); -struct String * MailMsg_GetRawString(struct MailMessage * mailMsg, HeapID heapId); -BOOL MailMsg_IsInit(struct MailMessage * mailMsg); -BOOL MailMsg_AllFieldsAreInit(struct MailMessage * mailMsg); +void MailMsg_Init(struct MailMessage *mailMsg); +void MailMsg_Init_WithBank(struct MailMessage *mailMsg, u16 bank); +void MailMsg_Init_Default(struct MailMessage *mailMsg); +void MailMsg_Init_FromTemplate(struct MailMessage *mailMsg, u32 a1); +struct String *MailMsg_GetExpandedString(struct MailMessage *mailMsg, HeapID heapId); +struct String *MailMsg_GetRawString(struct MailMessage *mailMsg, HeapID heapId); +BOOL MailMsg_IsInit(struct MailMessage *mailMsg); +BOOL MailMsg_AllFieldsAreInit(struct MailMessage *mailMsg); u32 MailMsg_NumFields(u16 bank, u16 num); -u16 MailMsg_GetFieldI(struct MailMessage * mailMsg, u32 a1); -u16 MailMsg_GetMsgBank(struct MailMessage * mailMsg); -u16 MailMsg_GetMsgNo(struct MailMessage * mailMsg); +u16 MailMsg_GetFieldI(struct MailMessage *mailMsg, u32 a1); +u16 MailMsg_GetMsgBank(struct MailMessage *mailMsg); +u16 MailMsg_GetMsgNo(struct MailMessage *mailMsg); BOOL MailMsg_Compare(const struct MailMessage *mailMsg, const struct MailMessage *a1); -void MailMsg_Copy(struct MailMessage * mailMsg, const struct MailMessage * a1); +void MailMsg_Copy(struct MailMessage *mailMsg, const struct MailMessage *a1); u32 MailMsg_NumMsgsInBank(u16 bank); -void MailMsg_SetMsgBankAndNum(struct MailMessage * mailMsg, u16 bank, u16 num); -void MailMsg_SetFieldI(struct MailMessage * mailMsg, u32 idx, u16 word); -void MailMsg_SetTrailingFieldsEmpty(struct MailMessage * mailMsg); +void MailMsg_SetMsgBankAndNum(struct MailMessage *mailMsg, u16 bank, u16 num); +void MailMsg_SetFieldI(struct MailMessage *mailMsg, u32 idx, u16 word); +void MailMsg_SetTrailingFieldsEmpty(struct MailMessage *mailMsg); -#endif //POKEDIAMOND_MAIL_MESSAGE_H +#endif // POKEDIAMOND_MAIL_MESSAGE_H diff --git a/include/main.h b/include/main.h index 10b017a15..08638a2fc 100644 --- a/include/main.h +++ b/include/main.h @@ -6,16 +6,14 @@ #include "overlay_manager.h" #include "save.h" -struct Unk21C4818 -{ +struct Unk21C4818 { u32 unk0; u32 unk4; u32 unk8; u32 unkC; }; -struct Unk21C4828 -{ +struct Unk21C4828 { u32 unk0; u32 unk4; u32 unk8; @@ -31,18 +29,17 @@ struct UnkStruct_021C4918 { u8 padding[3]; }; -struct Main -{ +struct Main { void (*vBlankIntr)(void *); - void * vBlankIntrArg; + void *vBlankIntrArg; void (*hBlankIntr)(void *); - void * hBlankIntrArg; + void *hBlankIntrArg; s32 unk10; s32 unk14; - void * unk18; - void * unk1C; - void * unk20; - void * unk24; + void *unk18; + void *unk1C; + void *unk20; + void *unk24; s32 unk28; u32 unk2C; s32 unk30; @@ -69,13 +66,12 @@ struct Main s32 unk6C; }; -//extern struct UnkStruct_021C4918 gSystem + 0x60; +// extern struct UnkStruct_021C4918 gSystem + 0x60; extern PMBackLightSwitch gBacklightTop; extern s32 UNK_02016FA4; -struct UnkStruct_02016FA8 -{ +struct UnkStruct_02016FA8 { FSOverlayID mainOverlayId; struct OverlayManager *overlayManager; FSOverlayID queuedMainOverlayId; @@ -83,7 +79,6 @@ struct UnkStruct_02016FA8 s32 unk10; s32 unk14; struct SaveData *save; - }; extern struct UnkStruct_02016FA8 UNK_02016FA8; @@ -103,4 +98,4 @@ void sub_02000F4C(u32 arg0, u32 arg1); void InitializeMainRNG(void); void HandleDSLidAction(void); -#endif //GUARD_MAIN_H +#endif // GUARD_MAIN_H diff --git a/include/map_header.h b/include/map_header.h index cb2c3dae1..926e135e3 100644 --- a/include/map_header.h +++ b/include/map_header.h @@ -1,8 +1,9 @@ #ifndef POKEDIAMOND_MAP_HEADER_H #define POKEDIAMOND_MAP_HEADER_H -struct MapHeader -{ +#include "nitro/types.h" + +struct MapHeader { u8 area_data_bank; u8 move_model_bank; u16 matrix_id; @@ -17,11 +18,11 @@ struct MapHeader u8 weather_type; u8 camera_type; u8 map_type; - u8 battle_bg:4; - u8 is_bike_allowed:1; - u8 is_running_allowed:1; // unused - u8 is_escape_rope_allowed:1; - u8 is_fly_allowed:1; + u8 battle_bg : 4; + u8 is_bike_allowed : 1; + u8 is_running_allowed : 1; // unused + u8 is_escape_rope_allowed : 1; + u8 is_fly_allowed : 1; }; u8 MapHeader_GetAreaDataBank(u32 mapno); @@ -58,4 +59,4 @@ BOOL MapHeader_MapIsSpearPillar(u32 mapno); BOOL MapHeader_MapIsPokemonCenterSecondFloor(u32 mapno); u16 MapHeader_GetMapEvolutionMethod(u32 mapno); -#endif //POKEDIAMOND_MAP_HEADER_H +#endif // POKEDIAMOND_MAP_HEADER_H diff --git a/include/map_matrix.h b/include/map_matrix.h index cb08ad4b2..586879d82 100644 --- a/include/map_matrix.h +++ b/include/map_matrix.h @@ -3,19 +3,17 @@ #include "heap.h" -#define MAP_MATRIX_MAX_WIDTH 30 +#define MAP_MATRIX_MAX_WIDTH 30 #define MAP_MATRIX_MAX_HEIGHT 30 -#define MAP_MATRIX_MAX_SIZE (MAP_MATRIX_MAX_WIDTH * MAP_MATRIX_MAX_HEIGHT) +#define MAP_MATRIX_MAX_SIZE (MAP_MATRIX_MAX_WIDTH * MAP_MATRIX_MAX_HEIGHT) #define MAP_MATRIX_MAX_NAME_LENGTH 16 -struct MapData -{ +struct MapData { u16 data[MAP_MATRIX_MAX_SIZE]; }; -struct MapMatrixData -{ +struct MapMatrixData { u8 height; u8 width; u16 headers[MAP_MATRIX_MAX_SIZE]; @@ -24,8 +22,7 @@ struct MapMatrixData u8 name[MAP_MATRIX_MAX_NAME_LENGTH]; }; -struct MapMatrix -{ +struct MapMatrix { u8 width; u8 height; u8 matrix_id; diff --git a/include/map_object.h b/include/map_object.h index 164c29038..e5e38d121 100644 --- a/include/map_object.h +++ b/include/map_object.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_MAP_OBJECT_H #include "global.h" + #include "field_system.h" #include "heap.h" @@ -33,53 +34,52 @@ typedef struct SavedMapObject { } SavedMapObject; typedef struct LocalMapObject { - u8 padding[0x128]; //todo verify size + u8 padding[0x128]; // todo verify size } LocalMapObject; -typedef struct ObjectEvent -{ +typedef struct ObjectEvent { u8 padding[0x8]; u16 flag; u8 padding2[0x16]; - //todo fill out - //todo this should be in map_events_internal.h + // todo fill out + // todo this should be in map_events_internal.h } ObjectEvent; -typedef void (*LocalMapObject_UnkCallback)(LocalMapObject* object); +typedef void (*LocalMapObject_UnkCallback)(LocalMapObject *object); typedef enum MapObjectFlagBits { - MAPOBJECTFLAG_ACTIVE = (1 << 0), + MAPOBJECTFLAG_ACTIVE = (1 << 0), MAPOBJECTFLAG_SINGLE_MOVEMENT = (1 << 1), - MAPOBJECTFLAG_UNK2 = (1 << 2), - MAPOBJECTFLAG_UNK3 = (1 << 3), - MAPOBJECTFLAG_UNK4 = (1 << 4), - MAPOBJECTFLAG_UNK5 = (1 << 5), + MAPOBJECTFLAG_UNK2 = (1 << 2), + MAPOBJECTFLAG_UNK3 = (1 << 3), + MAPOBJECTFLAG_UNK4 = (1 << 4), + MAPOBJECTFLAG_UNK5 = (1 << 5), MAPOBJECTFLAG_MOVEMENT_PAUSED = (1 << 6), - MAPOBJECTFLAG_UNK7 = (1 << 7), - MAPOBJECTFLAG_UNK8 = (1 << 8), - MAPOBJECTFLAG_VISIBLE = (1 << 9), - MAPOBJECTFLAG_UNK10 = (1 << 10), - MAPOBJECTFLAG_UNK11 = (1 << 11), - MAPOBJECTFLAG_UNK12 = (1 << 12), - MAPOBJECTFLAG_UNK13 = (1 << 13), - MAPOBJECTFLAG_UNK14 = (1 << 14), - MAPOBJECTFLAG_UNK15 = (1 << 15), - MAPOBJECTFLAG_UNK16 = (1 << 16), - MAPOBJECTFLAG_UNK17 = (1 << 17), - MAPOBJECTFLAG_UNK18 = (1 << 18), - MAPOBJECTFLAG_UNK19 = (1 << 19), - MAPOBJECTFLAG_UNK20 = (1 << 20), - MAPOBJECTFLAG_UNK21 = (1 << 21), - MAPOBJECTFLAG_UNK22 = (1 << 22), - MAPOBJECTFLAG_IGNORE_HEIGHTS = (1 << 23), - MAPOBJECTFLAG_UNK24 = (1 << 24), - MAPOBJECTFLAG_UNK25 = (1 << 25), - MAPOBJECTFLAG_UNK26 = (1 << 26), - MAPOBJECTFLAG_UNK27 = (1 << 27), - MAPOBJECTFLAG_UNK28 = (1 << 28), - MAPOBJECTFLAG_UNK29 = (1 << 29), - MAPOBJECTFLAG_UNK30 = (1 << 30), - MAPOBJECTFLAG_UNK31 = (1 << 31), + MAPOBJECTFLAG_UNK7 = (1 << 7), + MAPOBJECTFLAG_UNK8 = (1 << 8), + MAPOBJECTFLAG_VISIBLE = (1 << 9), + MAPOBJECTFLAG_UNK10 = (1 << 10), + MAPOBJECTFLAG_UNK11 = (1 << 11), + MAPOBJECTFLAG_UNK12 = (1 << 12), + MAPOBJECTFLAG_UNK13 = (1 << 13), + MAPOBJECTFLAG_UNK14 = (1 << 14), + MAPOBJECTFLAG_UNK15 = (1 << 15), + MAPOBJECTFLAG_UNK16 = (1 << 16), + MAPOBJECTFLAG_UNK17 = (1 << 17), + MAPOBJECTFLAG_UNK18 = (1 << 18), + MAPOBJECTFLAG_UNK19 = (1 << 19), + MAPOBJECTFLAG_UNK20 = (1 << 20), + MAPOBJECTFLAG_UNK21 = (1 << 21), + MAPOBJECTFLAG_UNK22 = (1 << 22), + MAPOBJECTFLAG_IGNORE_HEIGHTS = (1 << 23), + MAPOBJECTFLAG_UNK24 = (1 << 24), + MAPOBJECTFLAG_UNK25 = (1 << 25), + MAPOBJECTFLAG_UNK26 = (1 << 26), + MAPOBJECTFLAG_UNK27 = (1 << 27), + MAPOBJECTFLAG_UNK28 = (1 << 28), + MAPOBJECTFLAG_UNK29 = (1 << 29), + MAPOBJECTFLAG_UNK30 = (1 << 30), + MAPOBJECTFLAG_UNK31 = (1 << 31), } MapObjectFlagBits; #define MAP_OBJECT_GFX_ID_INVALID 0xFFFF @@ -130,4 +130,4 @@ BOOL MapObjectManager_GetNextObjectWithFlagFromIndex(MapObjectManager *manager, u32 sub_0205829C(LocalMapObject *object, u32 param1); BOOL sub_020582A8(LocalMapObject *object, u32 mapId, u32 flagId); -#endif //POKEDIAMOND_MAP_OBJECT_H +#endif // POKEDIAMOND_MAP_OBJECT_H diff --git a/include/math_util.h b/include/math_util.h index 8305df4ee..646d61e99 100644 --- a/include/math_util.h +++ b/include/math_util.h @@ -27,7 +27,7 @@ u32 MTRandom(void); /* * Nitro FX specific functions */ -void MTX22_2DAffine(struct Mtx22 * mtx, u16 radians, fx32 x, fx32 y, u8 type); +void MTX22_2DAffine(struct Mtx22 *mtx, u16 radians, fx32 x, fx32 y, u8 type); /* * Vector functions @@ -37,4 +37,4 @@ s32 MathUtil_0201BC84(u16 arg0, s32 arg1); s32 CALC_SomeDeadstrippedFunction(s32 arg); -#endif //POKEDIAMOND_MATH_UTIL_H +#endif // POKEDIAMOND_MATH_UTIL_H diff --git a/include/message_format.h b/include/message_format.h index 81d759cf5..2ac181f8d 100644 --- a/include/message_format.h +++ b/include/message_format.h @@ -1,52 +1,48 @@ #ifndef POKEDIAMOND_MESSAGE_FORMAT_H #define POKEDIAMOND_MESSAGE_FORMAT_H +#include "bg_window.h" #include "pokemon.h" #include "pokemon_storage_system.h" #include "trainer_data.h" -#include "bg_window.h" -typedef struct MessageFormatAttrs -{ +typedef struct MessageFormatAttrs { u8 data[4]; } MessageFormatAttrs; -typedef struct MessageFormatFields -{ +typedef struct MessageFormatFields { MessageFormatAttrs attrs; struct String *msg; } MessageFormatFields; -typedef struct MessageFormat -{ +typedef struct MessageFormat { u32 count; HeapID heapId; MessageFormatFields *fields; struct String *buffer; } MessageFormat; -struct UnkStruct_0200B870 -{ - void * unk_0; - struct NNSG2dCharacterData * unk_4; +struct UnkStruct_0200B870 { + void *unk_0; + struct NNSG2dCharacterData *unk_4; u16 data[16]; u32 unk_28; }; -MessageFormat * MessageFormat_New(HeapID heapId); -MessageFormat * MessageFormat_New_Custom(u32 nstr, u32 strlen, HeapID heapId); +MessageFormat *MessageFormat_New(HeapID heapId); +MessageFormat *MessageFormat_New_Custom(u32 nstr, u32 strlen, HeapID heapId); void MessageFormat_Delete(MessageFormat *messageFormat); void MessageFormat_InitFields(MessageFormatFields *fields); -void SetStringAsPlaceholder(MessageFormat *messageFormat, u32 idx, struct String * str, MessageFormatAttrs *attrs); -void BufferString(MessageFormat *messageFormat, u32 idx, struct String * str, u32 a3, u32 a4, u32 a5); -void BufferPlayersName(MessageFormat *messageFormat, u32 idx, PlayerProfile * data); -void BufferRivalsName(MessageFormat *messageFormat, u32 idx, struct SaveData * save); -void BufferFriendsName(MessageFormat *messageFormat, u32 idx, struct SaveData * save); -void BufferBoxMonSpeciesName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon); -void BufferBoxMonSpeciesNameWithArticle(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon); +void SetStringAsPlaceholder(MessageFormat *messageFormat, u32 idx, struct String *str, MessageFormatAttrs *attrs); +void BufferString(MessageFormat *messageFormat, u32 idx, struct String *str, u32 a3, u32 a4, u32 a5); +void BufferPlayersName(MessageFormat *messageFormat, u32 idx, PlayerProfile *data); +void BufferRivalsName(MessageFormat *messageFormat, u32 idx, struct SaveData *save); +void BufferFriendsName(MessageFormat *messageFormat, u32 idx, struct SaveData *save); +void BufferBoxMonSpeciesName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon); +void BufferBoxMonSpeciesNameWithArticle(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon); void BufferSpeciesNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 species); -void BufferBoxMonNickname(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon); -void BufferBoxMonOTName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon * mon); +void BufferBoxMonNickname(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon); +void BufferBoxMonOTName(MessageFormat *messageFormat, u32 idx, struct BoxPokemon *mon); void BufferIntegerAsString(MessageFormat *messageFormat, u32 idx, s32 num, u32 ndigits, enum PrintingMode printingMode, BOOL whichCharset); void BufferMoveName(MessageFormat *messageFormat, u32 idx, u32 move); void BufferRibbonNameOrDesc(MessageFormat *messageFormat, u32 idx, u32 ribbon); @@ -64,9 +60,9 @@ void BufferLandmarkName(MessageFormat *messageFormat, u32 idx, u32 landmark); void BufferPoketchAppName(MessageFormat *messageFormat, u32 idx, u32 app); void BufferTrainerClassName(MessageFormat *messageFormat, u32 idx, u32 trclass); void BufferTrainerClassNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 trclass); -void BufferTrainerClassNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer * tr); +void BufferTrainerClassNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer *tr); void BufferTrainerName(MessageFormat *messageFormat, u32 idx, u32 msgno); -void BufferTrainerNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer * trdata); +void BufferTrainerNameFromDataStruct(MessageFormat *messageFormat, u32 idx, Trainer *trdata); void BufferUndergroundItemName(MessageFormat *messageFormat, u32 idx, u32 item); void BufferUndergroundItemNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 item); void BufferUndergroundTrapName(MessageFormat *messageFormat, u32 idx, u32 trap); @@ -79,7 +75,7 @@ void BufferInterviewAnswer(MessageFormat *messageFormat, u32 idx, u32 answer); void BufferDecorationName(MessageFormat *messageFormat, u32 idx, u32 decor); void BufferDecorationNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 decor); void BufferGenderSymbol(MessageFormat *messageFormat, u32 idx, u32 gender); -void BufferBoxName(MessageFormat *messageFormat, u32 idx, struct PCStorage * pc, s32 boxno); +void BufferBoxName(MessageFormat *messageFormat, u32 idx, struct PCStorage *pc, s32 boxno); void BufferGymName(MessageFormat *messageFormat, u32 idx, u32 gym); void BufferTimeOfDayName(MessageFormat *messageFormat, u32 idx, u32 time); void BufferCountryName(MessageFormat *messageFormat, u32 idx, u32 country); @@ -92,14 +88,14 @@ void BufferPoffinName(MessageFormat *messageFormat, u32 idx, u32 poffin); void BufferFashionName(MessageFormat *messageFormat, u32 idx, u32 fashion); void BufferFashionNameWithArticle(MessageFormat *messageFormat, u32 idx, u32 fashion); void BufferContestBackgroundName(MessageFormat *messageFormat, u32 idx, u32 bg); -void BufferGroupName(MessageFormat *messageFormat, struct SaveData * save, u32 r5, u32 idx, u32 sp28); +void BufferGroupName(MessageFormat *messageFormat, struct SaveData *save, u32 r5, u32 idx, u32 sp28); void BufferMonthNameAbbr(MessageFormat *messageFormat, u32 idx, u32 month); void MessageFormat_UpperFirstChar(MessageFormat *messageFormat, u32 idx); -void StringExpandPlaceholders(MessageFormat *messageFormat, struct String * dest, struct String * src); +void StringExpandPlaceholders(MessageFormat *messageFormat, struct String *dest, struct String *src); void MessageFormat_ResetBuffers(MessageFormat *messageFormat); -struct UnkStruct_0200B870 * MessagePrinter_New(u32 color1, u32 color2, u32 color3, HeapID heapId); -void MessagePrinter_Delete(struct UnkStruct_0200B870 * a0); -void sub_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, struct Window * a2, int a3, int a4); -void sub_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, struct Window *window, int x, int y); +struct UnkStruct_0200B870 *MessagePrinter_New(u32 color1, u32 color2, u32 color3, HeapID heapId); +void MessagePrinter_Delete(struct UnkStruct_0200B870 *a0); +void sub_0200B9A8(struct UnkStruct_0200B870 *a0, int a1, struct Window *a2, int a3, int a4); +void sub_0200B9EC(struct UnkStruct_0200B870 *string, u32 value, u32 n, enum PrintingMode mode, struct Window *window, int x, int y); #endif // POKEDIAMOND_MESSAGE_FORMAT_H diff --git a/include/misc.h b/include/misc.h index c3b162920..4ec4fc949 100644 --- a/include/misc.h +++ b/include/misc.h @@ -3,11 +3,11 @@ // specify force-link. void OSi_ReferSymbol(void *symbol); -#define SDK_REFER_SYMBOL(symbol) OSi_ReferSymbol((void*)(symbol)) +#define SDK_REFER_SYMBOL(symbol) OSi_ReferSymbol((void *)(symbol)) // for embedding middleware version string in VERSION section. -#define SDK_MIDDLEWARE_STRING(vender, module) "[SDK+" vender ":" module "]" -#define SDK_DEFINE_MIDDLEWARE(id, vender, module) static char id [] = SDK_MIDDLEWARE_STRING(vender, module) -#define SDK_USING_MIDDLEWARE(id) SDK_REFER_SYMBOL(id) +#define SDK_MIDDLEWARE_STRING(vender, module) "[SDK+" vender ":" module "]" +#define SDK_DEFINE_MIDDLEWARE(id, vender, module) static char id[] = SDK_MIDDLEWARE_STRING(vender, module) +#define SDK_USING_MIDDLEWARE(id) SDK_REFER_SYMBOL(id) -#endif //GUARD_MISC_H +#endif // GUARD_MISC_H diff --git a/include/move_data.h b/include/move_data.h index 9f8656d76..6d66c6ae9 100644 --- a/include/move_data.h +++ b/include/move_data.h @@ -1,8 +1,7 @@ #ifndef POKEDIAMOND_MOVE_DATA_H #define POKEDIAMOND_MOVE_DATA_H -struct WazaTbl -{ +struct WazaTbl { u16 effect; u8 class; u8 power; @@ -33,9 +32,9 @@ typedef enum MoveAttr { MOVEATTR_CONTEST_TYPE, } MoveAttr; -void LoadAllWazaTbl(struct WazaTbl * dest); +void LoadAllWazaTbl(struct WazaTbl *dest); u8 WazaGetMaxPp(u16 move, u8 ppUp); u32 GetWazaAttr(u16 move, MoveAttr attr); -u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, MoveAttr attr); +u32 GetAttrFromWazaTbl(struct WazaTbl *wazaTbl, MoveAttr attr); -#endif //POKEDIAMOND_MOVE_DATA_H +#endif // POKEDIAMOND_MOVE_DATA_H diff --git a/include/move_relearner.h b/include/move_relearner.h index c36f371d4..f4961b23e 100644 --- a/include/move_relearner.h +++ b/include/move_relearner.h @@ -20,4 +20,4 @@ void MoveRelearner_Delete(MoveRelearner *moveRelearner); u16 *MoveRelearner_GetEligibleLevelUpMoves(Pokemon *mon, HeapID heapId); BOOL MoveRelearner_IsValidMove(const u16 *ptr); -#endif //POKEDIAMOND_MOVE_RELEARNER_H +#endif // POKEDIAMOND_MOVE_RELEARNER_H diff --git a/include/msgdata.h b/include/msgdata.h index f17953764..02e3d0eb3 100644 --- a/include/msgdata.h +++ b/include/msgdata.h @@ -10,42 +10,39 @@ typedef enum MsgDataLoadType { MSGDATA_LOAD_LAZY, } MsgDataLoadType; -struct MsgDataAlloc -{ +struct MsgDataAlloc { u32 offset; u32 length; }; -struct MsgDataTable -{ +struct MsgDataTable { u16 count; u16 key; struct MsgDataAlloc alloc[1]; }; -typedef struct MsgData -{ +typedef struct MsgData { u16 type; u16 heapId; u16 narc_id; u16 file_id; union { - struct MsgDataTable * raw; - NARC * narc; + struct MsgDataTable *raw; + NARC *narc; } data; } MsgData; -void ReadMsgData_NewNarc_ExistingString(NarcId narc_id, u32 group, u32 num, HeapID heapId, struct String * dest); -struct MsgData * NewMsgDataFromNarc(MsgDataLoadType type, NarcId narcId, s32 msgId, HeapID heapId); +void ReadMsgData_NewNarc_ExistingString(NarcId narc_id, u32 group, u32 num, HeapID heapId, struct String *dest); +struct MsgData *NewMsgDataFromNarc(MsgDataLoadType type, NarcId narcId, s32 msgId, HeapID heapId); void DestroyMsgData(struct MsgData *); -struct String * ReadMsgData_NewNarc_NewString(NarcId narc_id, u32 group, u32 num, HeapID heapId); -void ReadMsgDataIntoString(struct MsgData * msgData, u32 msg_no, struct String * dest); -struct String * NewString_ReadMsgData(struct MsgData *, u32); -u16 MsgDataGetCount(struct MsgData * msgData); -void ReadMsgDataIntoU16Array(struct MsgData * msgData, u32 msg_no, u16 * dest); -void GetSpeciesNameIntoArray(u16 species, HeapID heapId, u16 * dest); -struct String * ReadMsgData_ExpandPlaceholders(MessageFormat *messageFormat, struct MsgData * msgData, u32 msgno, HeapID heapId); -struct String * GetMoveName(u32 move, HeapID heapId); -struct String * GetSpeciesName(u16 species, HeapID heapId); +struct String *ReadMsgData_NewNarc_NewString(NarcId narc_id, u32 group, u32 num, HeapID heapId); +void ReadMsgDataIntoString(struct MsgData *msgData, u32 msg_no, struct String *dest); +struct String *NewString_ReadMsgData(struct MsgData *, u32); +u16 MsgDataGetCount(struct MsgData *msgData); +void ReadMsgDataIntoU16Array(struct MsgData *msgData, u32 msg_no, u16 *dest); +void GetSpeciesNameIntoArray(u16 species, HeapID heapId, u16 *dest); +struct String *ReadMsgData_ExpandPlaceholders(MessageFormat *messageFormat, struct MsgData *msgData, u32 msgno, HeapID heapId); +struct String *GetMoveName(u32 move, HeapID heapId); +struct String *GetSpeciesName(u16 species, HeapID heapId); -#endif //POKEDIAMOND_MSG_DATA_H +#endif // POKEDIAMOND_MSG_DATA_H diff --git a/include/nutdata.h b/include/nutdata.h index 0f66e8cbf..64d186053 100644 --- a/include/nutdata.h +++ b/include/nutdata.h @@ -3,14 +3,13 @@ #include "filesystem.h" -#define FIRMNESS_VERY_SOFT 1 -#define FIRMNESS_SOFT 2 -#define FIRMNESS_HARD 3 -#define FIRMNESS_VERY_HARD 4 -#define FIRMNESS_SUPER_HARD 5 +#define FIRMNESS_VERY_SOFT 1 +#define FIRMNESS_SOFT 2 +#define FIRMNESS_HARD 3 +#define FIRMNESS_VERY_HARD 4 +#define FIRMNESS_SUPER_HARD 5 -struct NutData -{ +struct NutData { u16 size; u8 firmness; u8 yieldCategory; @@ -24,13 +23,13 @@ struct NutData u8 smoothness; }; -NARC * OpenNutsDataNarc(HeapID heapId); -struct NutData * ReadNutDataFromNarc(NARC * narc, u32 berry_idx, HeapID heapId); -void CloseNutsDataNarc(NARC * narc); -struct NutData * LoadNutDataSingle(s32 berry_idx, HeapID heapId); -struct NutData * LoadNutDataSingleByItemId(s32 item_id, HeapID heapId); -u32 GetNutAttr(struct NutData * nut, u32 attr); -struct String * GetNutName(u32 berry_idx, HeapID heapId); -struct String * GetNutDesc(u32 berry_idx, HeapID heapId); +NARC *OpenNutsDataNarc(HeapID heapId); +struct NutData *ReadNutDataFromNarc(NARC *narc, u32 berry_idx, HeapID heapId); +void CloseNutsDataNarc(NARC *narc); +struct NutData *LoadNutDataSingle(s32 berry_idx, HeapID heapId); +struct NutData *LoadNutDataSingleByItemId(s32 item_id, HeapID heapId); +u32 GetNutAttr(struct NutData *nut, u32 attr); +struct String *GetNutName(u32 berry_idx, HeapID heapId); +struct String *GetNutDesc(u32 berry_idx, HeapID heapId); -#endif //POKEDIAMOND_NUTDATA_H +#endif // POKEDIAMOND_NUTDATA_H diff --git a/include/oam.h b/include/oam.h index 1e05b02c8..5bc0b30da 100644 --- a/include/oam.h +++ b/include/oam.h @@ -2,11 +2,11 @@ #define POKEDIAMOND_UNK_02009EAC_H #include "global.h" + #include "NNS_g2d.h" #include "heap.h" -struct OamData -{ +struct OamData { NNSG2dOamManager oamManagers[2]; HeapID heapId; }; diff --git a/include/options.h b/include/options.h index 7f06ef806..f3a8b85a9 100644 --- a/include/options.h +++ b/include/options.h @@ -6,30 +6,30 @@ struct SaveData; typedef struct Options { - u16 textSpeed:4; - u16 soundMethod:2; - u16 battleStyle:1; - u16 battleScene:1; - u16 buttonMode:2; - u16 frame:5; + u16 textSpeed : 4; + u16 soundMethod : 2; + u16 battleStyle : 1; + u16 battleScene : 1; + u16 buttonMode : 2; + u16 frame : 5; } Options; -struct Options * Options_New(HeapID heapId); -void Options_Copy(struct Options * src, struct Options * dest); -void Options_Init(struct Options * options); -void Options_SetButtonModeOnMain(struct SaveData * save, u32 buttonMode); -u16 Options_GetTextSpeed(struct Options * options); -void Options_SetTextSpeed(struct Options * options, u16 textSpeed); -u32 Options_GetTextFrameDelay(struct Options * options); -u16 Options_GetSoundMethod(struct Options * options); -void Options_SetSoundMethod(struct Options * options, u16 soundMethod); -u16 Options_GetBattleScene(struct Options * options); -void Options_SetBattleScene(struct Options * options, u16 battleScene); -u16 Options_GetBattleStyle(struct Options * options); -void Options_SetBattleStyle(struct Options * options, u16 battleStyle); -u16 Options_GetButtonMode(struct Options * options); -void Options_SetButtonMode(struct Options * options, u16 buttonMode); -u16 Options_GetFrame(struct Options * options); -void Options_SetFrame(struct Options * options, u16 frame); +struct Options *Options_New(HeapID heapId); +void Options_Copy(struct Options *src, struct Options *dest); +void Options_Init(struct Options *options); +void Options_SetButtonModeOnMain(struct SaveData *save, u32 buttonMode); +u16 Options_GetTextSpeed(struct Options *options); +void Options_SetTextSpeed(struct Options *options, u16 textSpeed); +u32 Options_GetTextFrameDelay(struct Options *options); +u16 Options_GetSoundMethod(struct Options *options); +void Options_SetSoundMethod(struct Options *options, u16 soundMethod); +u16 Options_GetBattleScene(struct Options *options); +void Options_SetBattleScene(struct Options *options, u16 battleScene); +u16 Options_GetBattleStyle(struct Options *options); +void Options_SetBattleStyle(struct Options *options, u16 battleStyle); +u16 Options_GetButtonMode(struct Options *options); +void Options_SetButtonMode(struct Options *options, u16 buttonMode); +u16 Options_GetFrame(struct Options *options); +void Options_SetFrame(struct Options *options, u16 frame); -#endif //POKEDIAMOND_OPTIONS_H +#endif // POKEDIAMOND_OPTIONS_H diff --git a/include/overlay_manager.h b/include/overlay_manager.h index 5f44eb0d3..605b7ee66 100644 --- a/include/overlay_manager.h +++ b/include/overlay_manager.h @@ -2,35 +2,35 @@ #define POKEDIAMOND_OVERLAY_MANAGER_H #include "nitro/types.h" + +#include "FS_overlay.h" #include "heap.h" struct OverlayManager; -typedef struct OverlayManagerTemplate -{ +typedef struct OverlayManagerTemplate { BOOL (*initFunc)(struct OverlayManager *manager, u32 *status); BOOL (*mainFunc)(struct OverlayManager *manager, u32 *status); BOOL (*exitFunc)(struct OverlayManager *manager, u32 *status); FSOverlayID ovly; } OverlayManagerTemplate; -struct OverlayManager -{ +struct OverlayManager { struct OverlayManagerTemplate template; u32 managerStatus; u32 overlayStatus; - s32 * unk18; //args? - void * data; + s32 *unk18; // args? + void *data; struct SaveData *save; u32 unk24; }; -struct OverlayManager * OverlayManager_New(const struct OverlayManagerTemplate *template, s32 * a1, HeapID heapId); -void OverlayManager_Delete(struct OverlayManager * overlayManager); -void * OverlayManager_CreateAndGetData(struct OverlayManager * overlayManager, u32 size, HeapID heapId); -void * OverlayManager_GetData(struct OverlayManager * overlayManager); -void OverlayManager_FreeData(struct OverlayManager * overlayManager); -s32 * OverlayManager_GetField18(struct OverlayManager * overlayManager); -BOOL OverlayManager_Run(struct OverlayManager * overlayManager); +struct OverlayManager *OverlayManager_New(const struct OverlayManagerTemplate *template, s32 *a1, HeapID heapId); +void OverlayManager_Delete(struct OverlayManager *overlayManager); +void *OverlayManager_CreateAndGetData(struct OverlayManager *overlayManager, u32 size, HeapID heapId); +void *OverlayManager_GetData(struct OverlayManager *overlayManager); +void OverlayManager_FreeData(struct OverlayManager *overlayManager); +s32 *OverlayManager_GetField18(struct OverlayManager *overlayManager); +BOOL OverlayManager_Run(struct OverlayManager *overlayManager); -#endif //POKEDIAMOND_OVERLAY_MANAGER_H +#endif // POKEDIAMOND_OVERLAY_MANAGER_H diff --git a/include/palette.h b/include/palette.h index cfb380045..160496df0 100644 --- a/include/palette.h +++ b/include/palette.h @@ -2,50 +2,47 @@ #define POKEDIAMOND_PALETTE_H #include "global.h" + #include "filesystem.h" #include "unk_0200CA44.h" -struct PlttData -{ - u16 r : 5; // red - u16 g : 5; // green - u16 b : 5; // blue +struct PlttData { + u16 r : 5; // red + u16 g : 5; // green + u16 b : 5; // blue u16 unused_15 : 1; }; -struct PaletteFadeControl -{ +struct PaletteFadeControl { u16 selectedPalettes; - u16 delay : 6; - u16 y : 5; + u16 delay : 6; + u16 y : 5; u16 targetY : 5; u16 blendColor : 15; - u16 yDec : 1; + u16 yDec : 1; - u16 deltaY : 4; + u16 deltaY : 4; u16 delayCounter : 6; - u16 unk06_a : 6; + u16 unk06_a : 6; }; -struct Palette -{ +struct Palette { u16 *unfadedBuf; u16 *fadedBuf; u32 bufSize; struct PaletteFadeControl fadeCtrl; }; -struct PaletteData -{ +struct PaletteData { struct Palette pltt[14]; - u16 unk118_0 : 2; + u16 unk118_0 : 2; u16 activeFadePalettes : 14; - u16 unk11a_0 : 14; - u16 unk11a_e : 1; - u16 unk11a_f : 1; + u16 unk11a_0 : 14; + u16 unk11a_e : 1; + u16 unk11a_f : 1; u8 unk11c; u8 unk11d; u16 unk11e; diff --git a/include/party.h b/include/party.h index 3ec36a2eb..b07fe2650 100644 --- a/include/party.h +++ b/include/party.h @@ -4,18 +4,18 @@ #include "pokemon.h" #include "save.h" -BOOL Party_HasMon(struct Party * party_p, u16 species); -int Party_GetCount(struct Party * party_p); -struct Pokemon * Party_GetMonByIndex(struct Party * party_p, int idx); +BOOL Party_HasMon(struct Party *party_p, u16 species); +int Party_GetCount(struct Party *party_p); +struct Pokemon *Party_GetMonByIndex(struct Party *party_p, int idx); u32 SaveArray_Party_sizeof(void); -struct Party * SaveArray_Party_Alloc(HeapID heapId); -void SaveArray_Party_Init(struct Party * party); -void Party_InitWithMaxSize(struct Party * party, int count); -BOOL Party_AddMon(struct Party * party, struct Pokemon * pokemon); -BOOL Party_RemoveMon(struct Party * party, int pos); -void ReplacePartySlotWithMon(struct Party * party, int pos, struct Pokemon * pokemon); -BOOL SwapSlotsInParty(struct Party * party, int pos1, int pos2); -void CopyParty(struct Party * src, struct Party * dest); -struct Party * SaveArray_Party_Get(struct SaveData * ptr); +struct Party *SaveArray_Party_Alloc(HeapID heapId); +void SaveArray_Party_Init(struct Party *party); +void Party_InitWithMaxSize(struct Party *party, int count); +BOOL Party_AddMon(struct Party *party, struct Pokemon *pokemon); +BOOL Party_RemoveMon(struct Party *party, int pos); +void ReplacePartySlotWithMon(struct Party *party, int pos, struct Pokemon *pokemon); +BOOL SwapSlotsInParty(struct Party *party, int pos1, int pos2); +void CopyParty(struct Party *src, struct Party *dest); +struct Party *SaveArray_Party_Get(struct SaveData *ptr); -#endif //POKEDIAMOND_PARTY_H +#endif // POKEDIAMOND_PARTY_H diff --git a/include/play_timer.h b/include/play_timer.h index f6cfcbba0..078dbcac8 100644 --- a/include/play_timer.h +++ b/include/play_timer.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_PLAY_TIMER_H #include "global.h" + #include "igt.h" #include "timer3.h" @@ -9,4 +10,4 @@ void PlayTimerInit(void); void PlayTimerStart(struct IGT *igt); void PlayTimerUpdate(void); -#endif //POKEDIAMOND_PLAY_TIMER_H +#endif // POKEDIAMOND_PLAY_TIMER_H diff --git a/include/player_data.h b/include/player_data.h index 9de06e5d5..54a2992ad 100644 --- a/include/player_data.h +++ b/include/player_data.h @@ -1,22 +1,20 @@ #ifndef POKEDIAMOND_PLAYER_DATA_H #define POKEDIAMOND_PLAYER_DATA_H -#include "options.h" #include "igt.h" +#include "options.h" #include "string16.h" struct SaveData; #define MAX_MONEY 999999 -typedef enum PlayerGender -{ - PLAYER_GENDER_MALE = 0, +typedef enum PlayerGender { + PLAYER_GENDER_MALE = 0, PLAYER_GENDER_FEMALE = 1 } PlayerGender; -typedef struct PlayerProfile -{ +typedef struct PlayerProfile { /* 0x00 */ u16 playerName[PLAYER_NAME_LENGTH + 1]; /* 0x10 */ u32 playerId; /* 0x14 */ u32 money; @@ -25,14 +23,13 @@ typedef struct PlayerProfile /* 0x1A */ u8 badges; /* 0x1B */ u8 avatar; /* 0x1C */ u8 version; - /* 0x1D */ u8 gameCleared:1; - u8 nationalDex:1; - u8 field_1D_pad:6; + /* 0x1D */ u8 gameCleared : 1; + u8 nationalDex : 1; + u8 field_1D_pad : 6; /* 0x1E */ u8 padding_1E[2]; } PlayerProfile; -typedef struct PlayerData -{ +typedef struct PlayerData { struct Options options; u8 padding[2]; PlayerProfile profile; @@ -42,42 +39,42 @@ typedef struct PlayerData } PlayerData; u32 Save_PlayerData_sizeof(void); -void Save_PlayerData_Init(PlayerData * data); -PlayerProfile * Save_PlayerData_GetProfileAddr(struct SaveData * save); -struct Options * Save_PlayerData_GetOptionsAddr(struct SaveData * save); -u16 * Save_PlayerData_GetCoinsAddr(struct SaveData * save); -struct IGT * Save_PlayerData_GetIGTAddr(struct SaveData * save); +void Save_PlayerData_Init(PlayerData *data); +PlayerProfile *Save_PlayerData_GetProfileAddr(struct SaveData *save); +struct Options *Save_PlayerData_GetOptionsAddr(struct SaveData *save); +u16 *Save_PlayerData_GetCoinsAddr(struct SaveData *save); +struct IGT *Save_PlayerData_GetIGTAddr(struct SaveData *save); u32 PlayerProfile_sizeof(void); -PlayerProfile * PlayerProfile_New(HeapID heapId); -void PlayerProfile_Copy(const PlayerProfile * src, PlayerProfile * dest); -void PlayerProfile_Init(PlayerProfile * data); -void CopyPlayerName(u16 * dest, PlayerProfile * data); -void PlayerName_StringToFlat(PlayerProfile * data, struct String * str); -u16 * PlayerProfile_GetNamePtr(PlayerProfile * data); -void PlayerName_FlatToString(PlayerProfile * data, struct String * str); -struct String * PlayerProfile_GetPlayerName_NewString(PlayerProfile * data, HeapID heapId); +PlayerProfile *PlayerProfile_New(HeapID heapId); +void PlayerProfile_Copy(const PlayerProfile *src, PlayerProfile *dest); +void PlayerProfile_Init(PlayerProfile *data); +void CopyPlayerName(u16 *dest, PlayerProfile *data); +void PlayerName_StringToFlat(PlayerProfile *data, struct String *str); +u16 *PlayerProfile_GetNamePtr(PlayerProfile *data); +void PlayerName_FlatToString(PlayerProfile *data, struct String *str); +struct String *PlayerProfile_GetPlayerName_NewString(PlayerProfile *data, HeapID heapId); void PlayerProfile_SetTrainerID(PlayerProfile *playerProfile, u32 otid); -u32 PlayerProfile_GetTrainerID(PlayerProfile * data); -u16 PlayerProfile_GetTrainerID_VisibleHalf(PlayerProfile * data); -void PlayerProfile_SetTrainerGender(PlayerProfile * data, PlayerGender gender); -PlayerGender PlayerProfile_GetTrainerGender(PlayerProfile * data); -BOOL PlayerProfile_TestBadgeFlag(PlayerProfile * data, u32 badgeno); -void PlayerProfile_SetBadgeFlag(PlayerProfile * data, u32 badgeno); -u32 PlayerProfile_CountBadges(PlayerProfile * data); -u32 PlayerProfile_GetMoney(PlayerProfile * data); -u32 PlayerProfile_SetMoney(PlayerProfile * data, u32 amount); -u8 PlayerProfile_GetAvatar(PlayerProfile * data); -void PlayerProfile_SetAvatar(PlayerProfile * data, u8 avatar); -u32 PlayerProfile_AddMoney(PlayerProfile * data, u32 amount); -u32 PlayerProfile_SubMoney(PlayerProfile * data, u32 amount); -u8 PlayerProfile_GetVersion(PlayerProfile * data); -void PlayerProfile_SetVersion(PlayerProfile * data, u8 a1); -u8 PlayerProfile_GetLanguage(PlayerProfile * data); -void PlayerProfile_SetLanguage(PlayerProfile * data, u8 language); -void PlayerProfile_SetGameClearFlag(PlayerProfile * data); -BOOL PlayerProfile_GetGameClearFlag(PlayerProfile * data); -void PlayerProfile_SetNatDexFlag(PlayerProfile * data); -BOOL PlayerProfile_GetNatDexFlag(PlayerProfile * data); -BOOL PlayerProfile_NameAndOTIDMatchPlayer(PlayerProfile * a, PlayerProfile * b); +u32 PlayerProfile_GetTrainerID(PlayerProfile *data); +u16 PlayerProfile_GetTrainerID_VisibleHalf(PlayerProfile *data); +void PlayerProfile_SetTrainerGender(PlayerProfile *data, PlayerGender gender); +PlayerGender PlayerProfile_GetTrainerGender(PlayerProfile *data); +BOOL PlayerProfile_TestBadgeFlag(PlayerProfile *data, u32 badgeno); +void PlayerProfile_SetBadgeFlag(PlayerProfile *data, u32 badgeno); +u32 PlayerProfile_CountBadges(PlayerProfile *data); +u32 PlayerProfile_GetMoney(PlayerProfile *data); +u32 PlayerProfile_SetMoney(PlayerProfile *data, u32 amount); +u8 PlayerProfile_GetAvatar(PlayerProfile *data); +void PlayerProfile_SetAvatar(PlayerProfile *data, u8 avatar); +u32 PlayerProfile_AddMoney(PlayerProfile *data, u32 amount); +u32 PlayerProfile_SubMoney(PlayerProfile *data, u32 amount); +u8 PlayerProfile_GetVersion(PlayerProfile *data); +void PlayerProfile_SetVersion(PlayerProfile *data, u8 a1); +u8 PlayerProfile_GetLanguage(PlayerProfile *data); +void PlayerProfile_SetLanguage(PlayerProfile *data, u8 language); +void PlayerProfile_SetGameClearFlag(PlayerProfile *data); +BOOL PlayerProfile_GetGameClearFlag(PlayerProfile *data); +void PlayerProfile_SetNatDexFlag(PlayerProfile *data); +BOOL PlayerProfile_GetNatDexFlag(PlayerProfile *data); +BOOL PlayerProfile_NameAndOTIDMatchPlayer(PlayerProfile *a, PlayerProfile *b); -#endif //POKEDIAMOND_PLAYER_DATA_H +#endif // POKEDIAMOND_PLAYER_DATA_H diff --git a/include/poke_overlay.h b/include/poke_overlay.h index 1ac696657..4ac8f83e4 100644 --- a/include/poke_overlay.h +++ b/include/poke_overlay.h @@ -14,15 +14,15 @@ struct LoadedOverlay { BOOL active; }; -void FreeOverlayAllocation(struct LoadedOverlay * loaded); +void FreeOverlayAllocation(struct LoadedOverlay *loaded); void UnloadOverlayByID(FSOverlayID id); s32 GetOverlayLoadDestination(FSOverlayID id); BOOL HandleLoadOverlay(FSOverlayID id, s32 a1); BOOL CanOverlayBeLoaded(FSOverlayID id); -struct LoadedOverlay* GetLoadedOverlaysInRegion(s32 a0); -BOOL GetOverlayRamBounds(FSOverlayID id, void ** start, void ** end); +struct LoadedOverlay *GetLoadedOverlaysInRegion(s32 a0); +BOOL GetOverlayRamBounds(FSOverlayID id, void **start, void **end); BOOL LoadOverlayNormal(MIProcessor target, FSOverlayID id); BOOL LoadOverlayNoInit(MIProcessor target, FSOverlayID id); BOOL LoadOverlayNoInitAsync(MIProcessor target, FSOverlayID id); -#endif //GUARD_POKE_OVERLAY_H +#endif // GUARD_POKE_OVERLAY_H diff --git a/include/pokedex.h b/include/pokedex.h index 7c80510af..c163efb3b 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -2,22 +2,22 @@ #define POKEDIAMOND_POKEDEX_H #include "global.h" + #include "pokemon.h" #include "save.h" -typedef struct Pokedex -{ +typedef struct Pokedex { /* 0x0000 */ u32 magic; // BEEFCAFE /* 0x0004 */ u8 caughtFlags[0x3C]; /* 0x0040 */ u32 caughtFlagsHi_Deoxys1; // Deoxys form plus top 13 dex flags /* 0x0044 */ u8 seenFlags[0x3C]; /* 0x0080 */ u32 seenFlagsHi_Deoxys2; // Deoxys form plus top 13 dex flags - /* 0x0084 */ u8 field_0084[0x40]; // Genders - /* 0x00C4 */ u8 field_00C4[0x40]; // Genders - /* 0x0104 */ u32 spindaPersonality; // spinda personality - /* 0x0108 */ u8 shellosGastrodon[2]; // Shellos/Gastrodon - /* 0x0108 */ u8 burmyWormadam[2]; // Burmy/Wormadam - /* 0x010C */ u8 seenUnown[28]; // Unown + /* 0x0084 */ u8 field_0084[0x40]; // Genders + /* 0x00C4 */ u8 field_00C4[0x40]; // Genders + /* 0x0104 */ u32 spindaPersonality; // spinda personality + /* 0x0108 */ u8 shellosGastrodon[2]; // Shellos/Gastrodon + /* 0x0108 */ u8 burmyWormadam[2]; // Burmy/Wormadam + /* 0x010C */ u8 seenUnown[28]; // Unown /* 0x0128 */ u8 unlockedGenderEntries; /* 0x0129 */ u8 meister[14]; // Meister? /* 0x0137 */ u8 unlockedForeignEntries; @@ -27,62 +27,62 @@ typedef struct Pokedex } Pokedex; u32 Save_Pokedex_sizeof(void); -struct Pokedex * Save_Pokedex_New(HeapID heapId); -void Save_Pokedex_Copy(const struct Pokedex * src, struct Pokedex * dest); -s32 Pokedex_CountSeenShellosOrGastrodon_Internal(struct Pokedex * pokedex, u32 species); -BOOL Pokedex_HasSeenShellosOrGastrodonForm(struct Pokedex * pokedex, u32 species, u8 state); -void Pokedex_SetSeenShellosOrGastrodonForm(struct Pokedex * pokedex, u32 species, u32 state); -s32 Pokedex_CountSeenBurmyOrWormadam_Internal(struct Pokedex * pokedex, u32 species); -BOOL Pokedex_HasSeenBurmyOrWormadamForm(struct Pokedex * pokedex, u32 species, u8 state); -void Pokedex_SetSeenBurmyOrWormadamForm(struct Pokedex * pokedex, u32 species, s32 state); -void Pokedex_SetSeenDeoxysFormAt(struct Pokedex * pokedex, u8 r4, u8 r6); -s32 Pokedex_CountSeenDeoxysForms_Internal(struct Pokedex * pokedex); -BOOL Pokedex_HasSeenDeoxysForm(struct Pokedex * pokedex, u32 state); -void Pokedex_TrySetSeenDeoxysForm(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon); -void Pokedex_InitSeenDeoxysFormsArray(struct Pokedex * pokedex); -void Pokedex_SetMonSeenForm(struct Pokedex * pokedex, u16 species, struct Pokemon * pokemon); -void Pokedex_SetMeisterFlagBySpeciesAndLanguage(struct Pokedex * pokedex, u32 species, u32 language); -s32 sub_020242C8(struct Pokedex * pokedex, u16 species, s32 r4); +struct Pokedex *Save_Pokedex_New(HeapID heapId); +void Save_Pokedex_Copy(const struct Pokedex *src, struct Pokedex *dest); +s32 Pokedex_CountSeenShellosOrGastrodon_Internal(struct Pokedex *pokedex, u32 species); +BOOL Pokedex_HasSeenShellosOrGastrodonForm(struct Pokedex *pokedex, u32 species, u8 state); +void Pokedex_SetSeenShellosOrGastrodonForm(struct Pokedex *pokedex, u32 species, u32 state); +s32 Pokedex_CountSeenBurmyOrWormadam_Internal(struct Pokedex *pokedex, u32 species); +BOOL Pokedex_HasSeenBurmyOrWormadamForm(struct Pokedex *pokedex, u32 species, u8 state); +void Pokedex_SetSeenBurmyOrWormadamForm(struct Pokedex *pokedex, u32 species, s32 state); +void Pokedex_SetSeenDeoxysFormAt(struct Pokedex *pokedex, u8 r4, u8 r6); +s32 Pokedex_CountSeenDeoxysForms_Internal(struct Pokedex *pokedex); +BOOL Pokedex_HasSeenDeoxysForm(struct Pokedex *pokedex, u32 state); +void Pokedex_TrySetSeenDeoxysForm(struct Pokedex *pokedex, u16 species, struct Pokemon *pokemon); +void Pokedex_InitSeenDeoxysFormsArray(struct Pokedex *pokedex); +void Pokedex_SetMonSeenForm(struct Pokedex *pokedex, u16 species, struct Pokemon *pokemon); +void Pokedex_SetMeisterFlagBySpeciesAndLanguage(struct Pokedex *pokedex, u32 species, u32 language); +s32 sub_020242C8(struct Pokedex *pokedex, u16 species, s32 r4); BOOL Pokedex_SpeciesIsNotMythical(u16 species); BOOL Pokedex_SpeciesIsNotSinnohMythical(u16 species); -void Save_Pokedex_Init(struct Pokedex * pokedex); -u16 Pokedex_CountNationalDexOwned(struct Pokedex * pokedex); -u16 Pokedex_CountNationalDexSeen(struct Pokedex * pokedex); -u16 Pokedex_CountSeenMons(struct Pokedex * pokedex); -u16 Pokedex_CountSinnohDexOwned(struct Pokedex * pokedex); -u16 Pokedex_CountSinnohDexSeen(struct Pokedex * pokedex); -BOOL Pokedex_NationalDexIsComplete(struct Pokedex * pokedex); -BOOL Pokedex_SinnohDexIsComplete(struct Pokedex * pokedex); -u16 Pokedex_CountNationalDexOwned_OmitMythicals(struct Pokedex * pokedex); -u16 Pokedex_CountSinnohDexSeen_OmitMythicals(struct Pokedex * pokedex); -BOOL Pokedex_CheckMonCaughtFlag(struct Pokedex * pokedex, u16 species); -BOOL Pokedex_CheckMonSeenFlag(struct Pokedex * pokedex, u16 species); -u32 Pokedex_GetSeenSpindaPersonality(struct Pokedex * pokedex, u32 a1); -s32 sub_02024674(struct Pokedex * pokedex, u16 species, s32 r6); -s32 Pokedex_GetSeenUnownI(struct Pokedex * pokedex, s32 a1); -s32 Pokedex_CountSeenUnown(struct Pokedex * pokedex); -BOOL Pokedex_GetSeenShellosForm(struct Pokedex * pokedex, s32 a1); -s32 Pokedex_CountSeenShellos(struct Pokedex * pokedex); -BOOL Pokedex_GetSeenGastrodonForm(struct Pokedex * pokedex, s32 a1); -s32 Pokedex_CountSeenGastrodon(struct Pokedex * pokedex); -s32 Pokedex_GetSeenBurmyForm(struct Pokedex * pokedex, s32 a1); -s32 Pokedex_CountSeenBurmy(struct Pokedex * pokedex); -s32 Pokedex_GetSeenWormadamForm(struct Pokedex * pokedex, s32 a1); -s32 Pokedex_CountSeenWormadam(struct Pokedex * pokedex); -s32 Pokedex_GetSeenDeoxysForm(struct Pokedex * pokedex, s32 a1); -s32 Pokedex_CountSeenDeoxys(struct Pokedex * pokedex); -void Pokedex_SetMonSeenFlag(struct Pokedex * pokedex, struct Pokemon * pokemon); -void Pokedex_SetMonCaughtFlag(struct Pokedex * pokedex, struct Pokemon * pokemon); -void Pokedex_SetNatDexFlag(struct Pokedex * pokedex); -BOOL Pokedex_GetNatDexFlag(struct Pokedex * pokedex); -BOOL Pokedex_GetGenderEntriesFlag(struct Pokedex * pokedex); -void Pokedex_SetGenderEntriesFlag(struct Pokedex * pokedex); -s32 Pokedex_GetMeisterFlagBySpeciesAndLanguage(struct Pokedex * pokedex, u32 species, u32 language); -void Pokedex_SetForeignEntriesFlag(struct Pokedex * pokedex); -BOOL Pokedex_GetForeignEntriesFlag(struct Pokedex * pokedex); -BOOL Pokedex_GetSinnohDexFlag(struct Pokedex * pokedex); -void Pokedex_SetSinnohDexFlag(struct Pokedex * pokedex); -struct Pokedex * Save_Pokedex_Get(struct SaveData * save); -s32 Pokedex_GetSeenMonForm(struct Pokedex * pokedex, s32 a1, u32 a2); +void Save_Pokedex_Init(struct Pokedex *pokedex); +u16 Pokedex_CountNationalDexOwned(struct Pokedex *pokedex); +u16 Pokedex_CountNationalDexSeen(struct Pokedex *pokedex); +u16 Pokedex_CountSeenMons(struct Pokedex *pokedex); +u16 Pokedex_CountSinnohDexOwned(struct Pokedex *pokedex); +u16 Pokedex_CountSinnohDexSeen(struct Pokedex *pokedex); +BOOL Pokedex_NationalDexIsComplete(struct Pokedex *pokedex); +BOOL Pokedex_SinnohDexIsComplete(struct Pokedex *pokedex); +u16 Pokedex_CountNationalDexOwned_OmitMythicals(struct Pokedex *pokedex); +u16 Pokedex_CountSinnohDexSeen_OmitMythicals(struct Pokedex *pokedex); +BOOL Pokedex_CheckMonCaughtFlag(struct Pokedex *pokedex, u16 species); +BOOL Pokedex_CheckMonSeenFlag(struct Pokedex *pokedex, u16 species); +u32 Pokedex_GetSeenSpindaPersonality(struct Pokedex *pokedex, u32 a1); +s32 sub_02024674(struct Pokedex *pokedex, u16 species, s32 r6); +s32 Pokedex_GetSeenUnownI(struct Pokedex *pokedex, s32 a1); +s32 Pokedex_CountSeenUnown(struct Pokedex *pokedex); +BOOL Pokedex_GetSeenShellosForm(struct Pokedex *pokedex, s32 a1); +s32 Pokedex_CountSeenShellos(struct Pokedex *pokedex); +BOOL Pokedex_GetSeenGastrodonForm(struct Pokedex *pokedex, s32 a1); +s32 Pokedex_CountSeenGastrodon(struct Pokedex *pokedex); +s32 Pokedex_GetSeenBurmyForm(struct Pokedex *pokedex, s32 a1); +s32 Pokedex_CountSeenBurmy(struct Pokedex *pokedex); +s32 Pokedex_GetSeenWormadamForm(struct Pokedex *pokedex, s32 a1); +s32 Pokedex_CountSeenWormadam(struct Pokedex *pokedex); +s32 Pokedex_GetSeenDeoxysForm(struct Pokedex *pokedex, s32 a1); +s32 Pokedex_CountSeenDeoxys(struct Pokedex *pokedex); +void Pokedex_SetMonSeenFlag(struct Pokedex *pokedex, struct Pokemon *pokemon); +void Pokedex_SetMonCaughtFlag(struct Pokedex *pokedex, struct Pokemon *pokemon); +void Pokedex_SetNatDexFlag(struct Pokedex *pokedex); +BOOL Pokedex_GetNatDexFlag(struct Pokedex *pokedex); +BOOL Pokedex_GetGenderEntriesFlag(struct Pokedex *pokedex); +void Pokedex_SetGenderEntriesFlag(struct Pokedex *pokedex); +s32 Pokedex_GetMeisterFlagBySpeciesAndLanguage(struct Pokedex *pokedex, u32 species, u32 language); +void Pokedex_SetForeignEntriesFlag(struct Pokedex *pokedex); +BOOL Pokedex_GetForeignEntriesFlag(struct Pokedex *pokedex); +BOOL Pokedex_GetSinnohDexFlag(struct Pokedex *pokedex); +void Pokedex_SetSinnohDexFlag(struct Pokedex *pokedex); +struct Pokedex *Save_Pokedex_Get(struct SaveData *save); +s32 Pokedex_GetSeenMonForm(struct Pokedex *pokedex, s32 a1, u32 a2); -#endif //POKEDIAMOND_POKEDEX_H +#endif // POKEDIAMOND_POKEDEX_H diff --git a/include/pokemon.h b/include/pokemon.h index 74c5037b1..d9d499da8 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -5,23 +5,24 @@ // Enums +#include "constants/pokemon.h" #include "constants/species.h" + #include "mail.h" -#include "constants/pokemon.h" -#include "string16.h" #include "player_data.h" #include "sound_chatot.h" +#include "string16.h" -#define LEVEL_UP_LEARNSET_END 0xFFFF -#define LEVEL_UP_LEARNSET_MAX 22 +#define LEVEL_UP_LEARNSET_END 0xFFFF +#define LEVEL_UP_LEARNSET_MAX 22 -#define LEVEL_UP_LEARNSET_MOVEID_MASK 0x01FF -#define LEVEL_UP_LEARNSET_MOVEID_SHIFT 0 -#define LEVEL_UP_LEARNSET_LEVEL_MASK 0xFE00 -#define LEVEL_UP_LEARNSET_LEVEL_SHIFT 9 +#define LEVEL_UP_LEARNSET_MOVEID_MASK 0x01FF +#define LEVEL_UP_LEARNSET_MOVEID_SHIFT 0 +#define LEVEL_UP_LEARNSET_LEVEL_MASK 0xFE00 +#define LEVEL_UP_LEARNSET_LEVEL_SHIFT 9 #define LEVEL_UP_LEARNSET_MOVE(x) ((u16)(((x) & LEVEL_UP_LEARNSET_MOVEID_MASK) >> LEVEL_UP_LEARNSET_MOVEID_SHIFT)) -#define LEVEL_UP_LEARNSET_LVL(x) (((x) & LEVEL_UP_LEARNSET_LEVEL_MASK) >> LEVEL_UP_LEARNSET_LEVEL_SHIFT) +#define LEVEL_UP_LEARNSET_LVL(x) (((x) & LEVEL_UP_LEARNSET_LEVEL_MASK) >> LEVEL_UP_LEARNSET_LEVEL_SHIFT) struct BaseStats { /* 0x00 */ u8 hp; @@ -33,13 +34,13 @@ struct BaseStats { /* 0x06 */ u8 types[2]; /* 0x08 */ u8 catchRate; /* 0x09 */ u8 expYield; - /* 0x0A */ u16 hp_yield:2; - u16 atk_yield:2; - u16 def_yield:2; - u16 speed_yield:2; - /* 0x0B */ u16 spatk_yield:2; - u16 spdef_yield:2; - u16 padding_B_4:4; + /* 0x0A */ u16 hp_yield : 2; + u16 atk_yield : 2; + u16 def_yield : 2; + u16 speed_yield : 2; + /* 0x0B */ u16 spatk_yield : 2; + u16 spdef_yield : 2; + u16 padding_B_4 : 4; /* 0x0C */ u16 item1; /* 0x0E */ u16 item2; /* 0x10 */ u8 genderRatio; @@ -49,9 +50,9 @@ struct BaseStats { /* 0x14 */ u8 eggGroups[2]; /* 0x16 */ u8 abilities[2]; /* 0x18 */ u8 greatMarshRate; - /* 0x19 */ u8 color:7; - u8 flip:1; - u8 padding_1A[2]; + /* 0x19 */ u8 color : 7; + u8 flip : 1; + u8 padding_1A[2]; /* 0x1C */ u32 unk1C; /* 0x20 */ u32 unk20; /* 0x24 */ u32 unk24; @@ -83,20 +84,20 @@ typedef struct { /* 0x1B */ u8 sheen; // TODO: Finish SinnohRibbonSet1 /* 0x1C */ u32 sinnohRibbons; -// u8 sinnohChampRibbon:1, abilityRibbon:1; -// u8 field_0x1d; -// u8 gorgeousRoyalRibbon:1, footprintRibbon:1; -// u8 field_0x1f; + // u8 sinnohChampRibbon:1, abilityRibbon:1; + // u8 field_0x1d; + // u8 gorgeousRoyalRibbon:1, footprintRibbon:1; + // u8 field_0x1f; } PokemonDataBlockA; typedef struct { /* 0x00 */ u16 moves[4]; /* 0x08 */ u8 movePP[4]; /* 0x0C */ u8 movePpUps[4]; - /* 0x10 */ u32 hpIV:5, atkIV:5, defIV:5, spdIV:5, spatkIV:5, spdefIV:5, isEgg:1, isNicknamed:1; + /* 0x10 */ u32 hpIV : 5, atkIV : 5, defIV : 5, spdIV : 5, spatkIV : 5, spdefIV : 5, isEgg : 1, isNicknamed : 1; // TODO: Finish HoennRibbonSet /* 0x14 */ u32 ribbonFlags; // cool, ... - /* 0x18 */ u8 fatefulEncounter:1, gender:2, alternateForm:5; + /* 0x18 */ u8 fatefulEncounter : 1, gender : 2, alternateForm : 5; /* 0x19 */ u8 HGSS_shinyLeaves; // TODO: Turn into bitfield /* 0x1A */ u16 Unused; /* 0x1C */ u16 Platinum_EggLocation; @@ -119,8 +120,8 @@ typedef struct { /* 0x18 */ u16 DP_MetLocation; /* 0x1A */ u8 pokerus; /* 0x1B */ u8 pokeball; - /* 0x1C */ u8 metLevel:7; - u8 metGender:1; + /* 0x1C */ u8 metLevel : 7; + u8 metGender : 1; /* 0x1D */ u8 encounterType; /* 0x1E */ u16 HGSS_Pokeball; } PokemonDataBlockD; @@ -134,16 +135,15 @@ typedef union { typedef struct BoxPokemon { /* 0x000 */ u32 pid; - /* 0x004 */ u16 party_lock:1; - u16 box_lock:1; - u16 checksum_fail:1; - u16 Unused:13; // Might be used for validity checks - /* 0x006 */ u16 checksum; // Stored checksum of pokemon + /* 0x004 */ u16 party_lock : 1; + u16 box_lock : 1; + u16 checksum_fail : 1; + u16 Unused : 13; // Might be used for validity checks + /* 0x006 */ u16 checksum; // Stored checksum of pokemon /* 0x008 */ PokemonDataBlock substructs[4]; } BoxPokemon; -struct PartyPokemon -{ +struct PartyPokemon { /* 0x088 */ u32 status; // slp:3, psn:1, brn:1, frz:1, prz:1, tox:1, ... /* 0x08C */ u8 level; /* 0x08D */ u8 capsule; @@ -163,8 +163,7 @@ typedef struct Pokemon { /* 0x088 */ struct PartyPokemon party; } Pokemon; // size: 0xEC -struct SomeDrawPokemonStruct -{ +struct SomeDrawPokemonStruct { u16 unk0; u16 unk2; u16 unk4; @@ -174,20 +173,17 @@ struct SomeDrawPokemonStruct u32 unkC; }; -struct PokeanmSub -{ +struct PokeanmSub { s8 unk0; u8 unk1; }; -struct Pokeanm -{ +struct Pokeanm { struct PokeanmSub unk0[4]; u8 unk8[20]; }; -struct UnkStruct_02069038 -{ +struct UnkStruct_02069038 { u16 unk0; u16 unk2; u8 unk4; @@ -195,8 +191,7 @@ struct UnkStruct_02069038 struct Pokeanm anim; }; -struct Evolution -{ +struct Evolution { u16 method; u16 param; u16 target; @@ -204,121 +199,120 @@ struct Evolution #define PARTY_SIZE 6 -typedef struct Party -{ +typedef struct Party { int maxCount; int curCount; struct Pokemon mons[PARTY_SIZE]; } Party; -void ZeroMonData(struct Pokemon * pokemon); -void ZeroBoxMonData(struct BoxPokemon * boxmon); +void ZeroMonData(struct Pokemon *pokemon); +void ZeroBoxMonData(struct BoxPokemon *boxmon); u32 SizeOfStructPokemon(void); -struct Pokemon * AllocMonZeroed(HeapID heapId); -BOOL AcquireMonLock(struct Pokemon * mon); -BOOL ReleaseMonLock(struct Pokemon * mon, BOOL decrypt_result); -BOOL AcquireBoxMonLock(struct BoxPokemon * mon); -BOOL ReleaseBoxMonLock(struct BoxPokemon * mon, BOOL decrypt_result); -void CreateMon(struct Pokemon * pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); -void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); -void CreateMonWithNature(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 nature); -void CreateMonWithGenderNatureLetter(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 gender, u8 nature, u8 letter); +struct Pokemon *AllocMonZeroed(HeapID heapId); +BOOL AcquireMonLock(struct Pokemon *mon); +BOOL ReleaseMonLock(struct Pokemon *mon, BOOL decrypt_result); +BOOL AcquireBoxMonLock(struct BoxPokemon *mon); +BOOL ReleaseBoxMonLock(struct BoxPokemon *mon, BOOL decrypt_result); +void CreateMon(struct Pokemon *pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); +void CreateBoxMon(struct BoxPokemon *boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); +void CreateMonWithNature(struct Pokemon *pokemon, u16 species, u8 level, u8 fixedIv, u8 nature); +void CreateMonWithGenderNatureLetter(struct Pokemon *pokemon, u16 species, u8 level, u8 fixedIv, u8 gender, u8 nature, u8 letter); u32 GenPersonalityByGenderAndNature(u16 species, u8 gender, u8 nature); -void CreateMonWithFixedIVs(struct Pokemon * pokemon, int species, int level, int ivs, int personality); -void CalcMonLevelAndStats(struct Pokemon * pokemon); -void CalcMonStats(struct Pokemon * pokemon); +void CreateMonWithFixedIVs(struct Pokemon *pokemon, int species, int level, int ivs, int personality); +void CalcMonLevelAndStats(struct Pokemon *pokemon); +void CalcMonStats(struct Pokemon *pokemon); #ifndef IN_POKEMON_C u32 GetMonData(); u32 GetBoxMonData(); #else -u32 GetMonData(struct Pokemon * pokemon, int attr, void * ptr); -u32 GetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); +u32 GetMonData(struct Pokemon *pokemon, int attr, void *ptr); +u32 GetBoxMonData(struct BoxPokemon *pokemon, int attr, void *ptr); #endif -void SetMonData(struct Pokemon * pokemon, int attr, void * ptr); -void SetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); -void AddMonData(struct Pokemon * pokemon, int attr, int amount); -struct BaseStats * AllocAndLoadMonPersonal(int species, HeapID heapId); -int GetPersonalAttr(struct BaseStats * baseStats, enum BaseStat attr); -void FreeMonPersonal(struct BaseStats * personal); +void SetMonData(struct Pokemon *pokemon, int attr, void *ptr); +void SetBoxMonData(struct BoxPokemon *pokemon, int attr, void *ptr); +void AddMonData(struct Pokemon *pokemon, int attr, int amount); +struct BaseStats *AllocAndLoadMonPersonal(int species, HeapID heapId); +int GetPersonalAttr(struct BaseStats *baseStats, enum BaseStat attr); +void FreeMonPersonal(struct BaseStats *personal); int GetMonBaseStat_HandleFormConversion(int species, int form, enum BaseStat stat_id); int GetMonBaseStat(int species, enum BaseStat stat_id); -u8 GetPercentProgressTowardsNextLevel(struct Pokemon * pokemon); -u32 CalcMonExpToNextLevel(struct Pokemon * pokemon); -u32 GetMonBaseExperienceAtCurrentLevel(struct Pokemon * pokemon); +u8 GetPercentProgressTowardsNextLevel(struct Pokemon *pokemon); +u32 CalcMonExpToNextLevel(struct Pokemon *pokemon); +u32 GetMonBaseExperienceAtCurrentLevel(struct Pokemon *pokemon); u32 GetMonExpBySpeciesAndLevel(int species, int level); -void LoadGrowthTable(int growthRate, u32 * table); +void LoadGrowthTable(int growthRate, u32 *table); u32 GetExpByGrowthRateAndLevel(int rate, int level); -int CalcMonLevel(struct Pokemon * pokemon); -int CalcBoxMonLevel(struct BoxPokemon * boxmon); +int CalcMonLevel(struct Pokemon *pokemon); +int CalcBoxMonLevel(struct BoxPokemon *boxmon); int CalcLevelBySpeciesAndExp(u16 species, u32 experience); -int CalcLevelBySpeciesAndExp_PreloadedPersonal(struct BaseStats * personal, u16 species, u32 experience); -u8 GetBoxMonNature(struct BoxPokemon * boxmon); -u8 GetMonNature(struct Pokemon * mon); +int CalcLevelBySpeciesAndExp_PreloadedPersonal(struct BaseStats *personal, u16 species, u32 experience); +u8 GetBoxMonNature(struct BoxPokemon *boxmon); +u8 GetMonNature(struct Pokemon *mon); u8 GetNatureFromPersonality(u32 pid); -void MonApplyFriendshipMod(struct Pokemon * pokemon, u32 kind, u32 location); -u8 GetMonGender(struct Pokemon * pokemon); -u8 GetBoxMonGender(struct BoxPokemon * boxmon); +void MonApplyFriendshipMod(struct Pokemon *pokemon, u32 kind, u32 location); +u8 GetMonGender(struct Pokemon *pokemon); +u8 GetBoxMonGender(struct BoxPokemon *boxmon); u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); -u8 MonIsShiny(struct Pokemon * pokemon); +u8 MonIsShiny(struct Pokemon *pokemon); u32 GenerateShinyPersonality(u32 otid); -void sub_02068B70(struct SomeDrawPokemonStruct * spC, struct BoxPokemon * boxmon, u8 sp10); -void sub_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 sp10, u8 shiny, u8 form, u32 personality); -u8 sub_02068E14(struct Pokemon * pokemon, u32 a1); -u8 sub_02068E1C(struct BoxPokemon * boxmon, u32 a1); +void sub_02068B70(struct SomeDrawPokemonStruct *spC, struct BoxPokemon *boxmon, u8 sp10); +void sub_02068C00(struct SomeDrawPokemonStruct *spC, int species, u8 gender, u8 sp10, u8 shiny, u8 form, u32 personality); +u8 sub_02068E14(struct Pokemon *pokemon, u32 a1); +u8 sub_02068E1C(struct BoxPokemon *boxmon, u32 a1); u8 sub_02068E88(int species, u8 gender, u32 a2, u8 form, u32 pid); u32 GetArceusTypeByHeldItemEffect(u16 plate); int sub_0206AA30(int a0); -void sub_02068B68(struct SomeDrawPokemonStruct * spC, struct Pokemon * pokemon, u8 sp10); -void sub_02068FE0(struct SomeDrawPokemonStruct * a0, u16 a1, int a2); -void sub_02069010(void * dest, int a1); +void sub_02068B68(struct SomeDrawPokemonStruct *spC, struct Pokemon *pokemon, u8 sp10); +void sub_02068FE0(struct SomeDrawPokemonStruct *a0, u16 a1, int a2); +void sub_02069010(void *dest, int a1); void sub_02069038(u32 a0, u32 a1, u32 a2, s32 a3, u32 a4, u32 a5, u32 a6); -void sub_020690AC(struct SomeDrawPokemonStruct * a0, u32 a1); +void sub_020690AC(struct SomeDrawPokemonStruct *a0, u32 a1); u32 sub_020690C4(void); u32 sub_020690C8(void); -u8 GetBoxMonUnownLetter(struct BoxPokemon * boxmon); -u8 GetMonUnownLetter(struct Pokemon * pokemon); +u8 GetBoxMonUnownLetter(struct BoxPokemon *boxmon); +u8 GetMonUnownLetter(struct Pokemon *pokemon); void LoadLevelUpLearnset_HandleAlternateForm(int species, int form, u16 *levelUpLearnset); -struct BoxPokemon * sub_020690E4(struct Pokemon * pokemon); +struct BoxPokemon *sub_020690E4(struct Pokemon *pokemon); -u16 GetMonEvolution(struct Party * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret); +u16 GetMonEvolution(struct Party *party, struct Pokemon *pokemon, u32 context, u32 usedItem, u32 *method_ret); u16 ReadFromPersonalPmsNarc(u16 species); u16 GetEggSpecies(u16 species); -BOOL sub_020690E8(struct Pokemon * pokemon); -u32 sub_02069698(struct Pokemon * pokemon, u16 move); -void sub_02069708(struct Pokemon * pokemon, u16 move); -void sub_02069718(struct BoxPokemon * boxmon, u16 move); -void MonSetMoveInSlot(struct Pokemon * pokemon, u16 move, u8 slot); -u32 sub_02069818(struct Pokemon * pokemon, u32 * r5, u16 * sp0); -void sub_020698E0(struct Pokemon * pokemon, int slot1, int slot2); -void sub_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2); -void sub_020699A4(struct Pokemon * pokemon, u32 slot); -void CopyBoxPokemonToPokemon(struct BoxPokemon * src, struct Pokemon * dest); -u8 Party_GetMaxLevel(struct Party * party); +BOOL sub_020690E8(struct Pokemon *pokemon); +u32 sub_02069698(struct Pokemon *pokemon, u16 move); +void sub_02069708(struct Pokemon *pokemon, u16 move); +void sub_02069718(struct BoxPokemon *boxmon, u16 move); +void MonSetMoveInSlot(struct Pokemon *pokemon, u16 move, u8 slot); +u32 sub_02069818(struct Pokemon *pokemon, u32 *r5, u16 *sp0); +void sub_020698E0(struct Pokemon *pokemon, int slot1, int slot2); +void sub_020698E8(struct BoxPokemon *boxmon, int slot1, int slot2); +void sub_020699A4(struct Pokemon *pokemon, u32 slot); +void CopyBoxPokemonToPokemon(struct BoxPokemon *src, struct Pokemon *dest); +u8 Party_GetMaxLevel(struct Party *party); u16 SpeciesToSinnohDexNo(u16 species); u16 SinnohDexNoToSpecies(u16 sinnoh_dex); -void CopyPokemonToPokemon(struct Pokemon * src, struct Pokemon * dest); -void CopyPokemonToBoxPokemon(struct Pokemon * src, struct BoxPokemon * dest); -void CopyBoxPokemonToBoxPokemon(struct BoxPokemon * src, struct BoxPokemon * dest); -s8 MonGetFlavorPreference(struct Pokemon * pokemon, int flavor); -int Species_LoadLearnsetTable(u16 species, u32 form, u16 * dest); -void Party_GivePokerusAtRandom(struct Party * party); -void Party_UpdatePokerus(struct Party * party, int r5); -void Party_SpreadPokerus(struct Party * party); -BOOL Pokemon_HasPokerus(struct Pokemon * pokemon); -BOOL Pokemon_IsImmuneToPokerus(struct Pokemon * pokemon); -void Pokemon_UpdateArceusForm(struct Pokemon * pokemon); +void CopyPokemonToPokemon(struct Pokemon *src, struct Pokemon *dest); +void CopyPokemonToBoxPokemon(struct Pokemon *src, struct BoxPokemon *dest); +void CopyBoxPokemonToBoxPokemon(struct BoxPokemon *src, struct BoxPokemon *dest); +s8 MonGetFlavorPreference(struct Pokemon *pokemon, int flavor); +int Species_LoadLearnsetTable(u16 species, u32 form, u16 *dest); +void Party_GivePokerusAtRandom(struct Party *party); +void Party_UpdatePokerus(struct Party *party, int r5); +void Party_SpreadPokerus(struct Party *party); +BOOL Pokemon_HasPokerus(struct Pokemon *pokemon); +BOOL Pokemon_IsImmuneToPokerus(struct Pokemon *pokemon); +void Pokemon_UpdateArceusForm(struct Pokemon *pokemon); void sub_02069FB0(struct SaveChatotSoundClip *r7, u32 r5, u16 r4, s32 r6, s32 sp18, u32 sp1C, HeapID heapId); -void sub_0206A014(struct Pokemon * pokemon, PlayerProfile * a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId); -void sub_0206A094(struct Pokemon * pokemon, u32 a1, u32 a2); -BOOL sub_0206A13C(struct Pokemon * pokemon, u32 a1); -void sub_0206A1C4(struct Pokemon * pokemon); -void sub_0206A23C(struct Pokemon * r5, u32 personality); +void sub_0206A014(struct Pokemon *pokemon, PlayerProfile *a1, u32 pokeball, u32 a3, u32 encounterType, HeapID heapId); +void sub_0206A094(struct Pokemon *pokemon, u32 a1, u32 a2); +BOOL sub_0206A13C(struct Pokemon *pokemon, u32 a1); +void sub_0206A1C4(struct Pokemon *pokemon); +void sub_0206A23C(struct Pokemon *r5, u32 personality); int LowestFlagNo(u32 mask); BOOL IsPokemonLegendaryOrMythical(u16 species); u16 GetLegendaryMon(u32 idx); -BOOL sub_0206A998(struct Pokemon * pokemon); -BOOL sub_0206A9AC(struct BoxPokemon * boxmon, PlayerProfile * sb2, HeapID heapId); -void Pokemon_RemoveCapsule(struct Pokemon * pokemon); -void RestoreBoxMonPP(struct BoxPokemon * boxmon); +BOOL sub_0206A998(struct Pokemon *pokemon); +BOOL sub_0206A9AC(struct BoxPokemon *boxmon, PlayerProfile *sb2, HeapID heapId); +void Pokemon_RemoveCapsule(struct Pokemon *pokemon); +void RestoreBoxMonPP(struct BoxPokemon *boxmon); -#endif //POKEDIAMOND_POKEMON_H +#endif // POKEDIAMOND_POKEMON_H diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 0d383c9fc..399a6b181 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -3,15 +3,14 @@ #include "pokemon.h" -#define NUM_BOXES 18u -#define MONS_PER_BOX 30u -#define BOX_NAME_LENGTH 20u -#define NUM_DEFAULT_WALLPAPERS 16u -#define NUM_BONUS_WALLPAPERS 8u -#define NUM_WALLPAPERS ((u32)(NUM_DEFAULT_WALLPAPERS + NUM_BONUS_WALLPAPERS)) +#define NUM_BOXES 18u +#define MONS_PER_BOX 30u +#define BOX_NAME_LENGTH 20u +#define NUM_DEFAULT_WALLPAPERS 16u +#define NUM_BONUS_WALLPAPERS 8u +#define NUM_WALLPAPERS ((u32)(NUM_DEFAULT_WALLPAPERS + NUM_BONUS_WALLPAPERS)) -typedef struct PCStorage -{ +typedef struct PCStorage { /* 0x00000 */ u32 curBox; /* 0x00004 */ struct BoxPokemon boxes[NUM_BOXES][MONS_PER_BOX]; /* 0x11EE4 */ u16 names[NUM_BOXES][BOX_NAME_LENGTH]; @@ -20,29 +19,29 @@ typedef struct PCStorage /* 0x121C7 */ u8 pad_byte; // suppresses mwcc warning } PCStorage; -void PCStorage_Init(struct PCStorage * pc); +void PCStorage_Init(struct PCStorage *pc); u32 PCStorage_sizeof(void); -void PCStorage_InitializeBoxes(struct PCStorage * pc); -BOOL PCStorage_PlaceMonInFirstEmptySlotInAnyBox(struct PCStorage * pc, struct BoxPokemon * boxmon); -BOOL PCStorage_PlaceMonInBoxFirstEmptySlot(struct PCStorage * pc, int boxno, struct BoxPokemon * boxmon); -BOOL PCStorage_PlaceMonInBoxByIndexPair(struct PCStorage * pc, int boxno, int slotno, struct BoxPokemon * boxmon); -void PCStorage_DeleteBoxMonByIndexPair(struct PCStorage * pc, int boxno, int slotno); -int PCStorage_GetActiveBox(struct PCStorage * pc); -int PCStorage_FindFirstBoxWithEmptySlot(struct PCStorage * pc); -BOOL PCStorage_FindFirstEmptySlot(struct PCStorage * pc, int * boxno, int * slotno); -int PCStorage_CountMonsAndEggsInAllBoxes(struct PCStorage * pc); -void PCStorage_SetActiveBox(struct PCStorage * pc, int boxno); -u8 PCStorage_GetBoxWallpaper(struct PCStorage * pc, int boxno); -void PCStorage_SetBoxWallpaper(struct PCStorage * pc, int boxno, u8 wallpaper); -void PCStorage_GetBoxName(struct PCStorage * pc, int boxno, struct String * ret); -void PCStorage_SetBoxName(struct PCStorage * pc, int boxno, struct String * src); -int PCStorage_CountMonsAndEggsInBox(struct PCStorage * pc, int boxno); -int PCStorage_CountMonsInBox(struct PCStorage * pc, int boxno); -int PCStorage_CountMonsInAllBoxes(struct PCStorage * pc); -void PCStorage_SetBoxMonDataByIndexPair(struct PCStorage * pc, int boxno, int slotno, u32 attr, void * value); -struct BoxPokemon * PCStorage_GetMonByIndexPair(struct PCStorage * pc, int boxno, int slotno); -void PCStorage_UnlockBonusWallpaper(struct PCStorage * pc, int wallpaper); -BOOL PCStorage_IsBonusWallpaperUnlocked(struct PCStorage * pc, int wallpaper); -int PCStorage_CountUnlockedBonusWallpapers(struct PCStorage * pc); +void PCStorage_InitializeBoxes(struct PCStorage *pc); +BOOL PCStorage_PlaceMonInFirstEmptySlotInAnyBox(struct PCStorage *pc, struct BoxPokemon *boxmon); +BOOL PCStorage_PlaceMonInBoxFirstEmptySlot(struct PCStorage *pc, int boxno, struct BoxPokemon *boxmon); +BOOL PCStorage_PlaceMonInBoxByIndexPair(struct PCStorage *pc, int boxno, int slotno, struct BoxPokemon *boxmon); +void PCStorage_DeleteBoxMonByIndexPair(struct PCStorage *pc, int boxno, int slotno); +int PCStorage_GetActiveBox(struct PCStorage *pc); +int PCStorage_FindFirstBoxWithEmptySlot(struct PCStorage *pc); +BOOL PCStorage_FindFirstEmptySlot(struct PCStorage *pc, int *boxno, int *slotno); +int PCStorage_CountMonsAndEggsInAllBoxes(struct PCStorage *pc); +void PCStorage_SetActiveBox(struct PCStorage *pc, int boxno); +u8 PCStorage_GetBoxWallpaper(struct PCStorage *pc, int boxno); +void PCStorage_SetBoxWallpaper(struct PCStorage *pc, int boxno, u8 wallpaper); +void PCStorage_GetBoxName(struct PCStorage *pc, int boxno, struct String *ret); +void PCStorage_SetBoxName(struct PCStorage *pc, int boxno, struct String *src); +int PCStorage_CountMonsAndEggsInBox(struct PCStorage *pc, int boxno); +int PCStorage_CountMonsInBox(struct PCStorage *pc, int boxno); +int PCStorage_CountMonsInAllBoxes(struct PCStorage *pc); +void PCStorage_SetBoxMonDataByIndexPair(struct PCStorage *pc, int boxno, int slotno, u32 attr, void *value); +struct BoxPokemon *PCStorage_GetMonByIndexPair(struct PCStorage *pc, int boxno, int slotno); +void PCStorage_UnlockBonusWallpaper(struct PCStorage *pc, int wallpaper); +BOOL PCStorage_IsBonusWallpaperUnlocked(struct PCStorage *pc, int wallpaper); +int PCStorage_CountUnlockedBonusWallpapers(struct PCStorage *pc); -#endif //POKEDIAMOND_POKEMON_STORAGE_SYSTEM_H +#endif // POKEDIAMOND_POKEMON_STORAGE_SYSTEM_H diff --git a/include/poketch.h b/include/poketch.h index 7b10f5207..835016869 100644 --- a/include/poketch.h +++ b/include/poketch.h @@ -1,13 +1,13 @@ #ifndef POKEDIAMOND_POKETCH_H #define POKEDIAMOND_POKETCH_H +#include "pokemon.h" #include "save.h" #define DOT_ARTIST_SIZE (480 / 4) // 2bpp -typedef enum PoketchApp -{ - FIRST_POKETCH_APP_ID = 0, +typedef enum PoketchApp { + FIRST_POKETCH_APP_ID = 0, POKETCH_DIGITAL_WATCH = FIRST_POKETCH_APP_ID, POKETCH_CALCULATOR, POKETCH_MEMO_PAD, @@ -34,28 +34,26 @@ typedef enum PoketchApp POKETCH_STOPWATCH, POKETCH_ALARM_CLOCK, NUM_POKETCH_APPS -} -PoketchApp; +} PoketchApp; -typedef struct Poketch -{ - u8 isGiven:1; // set by completing the coupon sidequest in Jubilife - u8 pedometerActive:1; // set when you receive the Pedometer - u8 dotArtistEnabled:1; // set when you access dotArtist for the first time - u8 color:3; // set by Color Changer +typedef struct Poketch { + u8 isGiven : 1; // set by completing the coupon sidequest in Jubilife + u8 pedometerActive : 1; // set when you receive the Pedometer + u8 dotArtistEnabled : 1; // set when you access dotArtist for the first time + u8 color : 3; // set by Color Changer // Green, Yellow, Orange, Red, Purple, Blue, Turquoise, White - u8 padding_00_6:2; // silence warnings + u8 padding_00_6 : 2; // silence warnings s8 numApps; s8 selectedApp; u8 unlockedApps[32]; // should be 25, one for each app - u8 filler_23[1]; // silence warnings - u32 stepCounter; // increments while pedometerActive is 1 - u16 alarmActive:1; - u16 alarmHour:5; - u16 alarmMinute:6; - u16 padding_28_C:4; // silence warnings + u8 filler_23[1]; // silence warnings + u32 stepCounter; // increments while pedometerActive is 1 + u16 alarmActive : 1; + u16 alarmHour : 5; + u16 alarmMinute : 6; + u16 padding_28_C : 4; // silence warnings u8 dotArtistGrid[DOT_ARTIST_SIZE]; - u8 filler_A2[1]; // silence warnings + u8 filler_A2[1]; // silence warnings u32 calendarFlags; // flag X set == day (X + 1) marked u8 calendarMonth; // X and Y coordinates for each of six markings @@ -65,31 +63,31 @@ typedef struct Poketch } Poketch; u32 Save_Poketch_sizeof(void); -void Save_Poketch_Init(struct Poketch * poketch); -void Save_Poketch_Give(struct Poketch * poketch); -BOOL Save_Poketch_IsGiven(struct Poketch * poketch); -u8 Save_Poketch_AppIsUnlocked(struct Poketch * poketch, PoketchApp app); -BOOL Save_Poketch_UnlockApp(struct Poketch * poketch, PoketchApp app); -PoketchApp Save_Poketch_GetSelectedApp(struct Poketch * poketch); -PoketchApp Save_Poketch_CycleNextApp(struct Poketch * poketch); -u8 Save_Poketch_GetScreenTint(struct Poketch * poketch); -void Save_Poketch_SetScreenTint(struct Poketch * poketch, u32 color); -u32 Save_Poketch_GetStepCounter(struct Poketch * poketch); -void Save_Poketch_SetStepCounter(struct Poketch * poketch, u32 steps); -BOOL Save_Poketch_GetAlarmState(struct Poketch * poketch); -void Save_Poketch_GetAlarmSetTime(struct Poketch * poketch, u32 * hour_p, u32 * min_p); -void Save_Poketch_SetAlarm(struct Poketch * poketch, BOOL enabled, u32 hour, u32 minute); -void Save_Poketch_CalendarDateHighlight(struct Poketch * poketch, u32 month, u32 day); -void Save_Poketch_CalendarDateUnhighlight(struct Poketch * poketch, u32 month, u32 day); -BOOL Save_Poketch_CalendarDateIsHighlighted(struct Poketch * poketch, u32 month, u32 day); -void Save_Poketch_MarkingMapSetPos(struct Poketch * poketch, s32 mark, u8 x, u8 y); -void Save_Poketch_MarkingMapGetPos(struct Poketch * poketch, s32 mark, u8 * x_p, u8 * y_p); -u32 Save_Poketch_DotArtistIsEnabled(struct Poketch * poketch); -void Save_Poketch_DotArtistGetDrawing(struct Poketch * poketch, void * grid); -void Save_Poketch_DotArtistSetDrawingAndEnable(struct Poketch * poketch, void * grid); -void Save_Poketch_PokemonHistoryAddMon(struct Poketch * poketch, struct BoxPokemon * mon); -int Save_Poketch_PokemonHistoryGetFirstEmptySlot(struct Poketch * poketch); -void Save_Poketch_PokemonHistoryGetSlotN(struct Poketch * poketch, s32 i, u32 * species_p, u32 * form_p); -struct Poketch * Save_Poketch_Get(struct SaveData * save); +void Save_Poketch_Init(struct Poketch *poketch); +void Save_Poketch_Give(struct Poketch *poketch); +BOOL Save_Poketch_IsGiven(struct Poketch *poketch); +u8 Save_Poketch_AppIsUnlocked(struct Poketch *poketch, PoketchApp app); +BOOL Save_Poketch_UnlockApp(struct Poketch *poketch, PoketchApp app); +PoketchApp Save_Poketch_GetSelectedApp(struct Poketch *poketch); +PoketchApp Save_Poketch_CycleNextApp(struct Poketch *poketch); +u8 Save_Poketch_GetScreenTint(struct Poketch *poketch); +void Save_Poketch_SetScreenTint(struct Poketch *poketch, u32 color); +u32 Save_Poketch_GetStepCounter(struct Poketch *poketch); +void Save_Poketch_SetStepCounter(struct Poketch *poketch, u32 steps); +BOOL Save_Poketch_GetAlarmState(struct Poketch *poketch); +void Save_Poketch_GetAlarmSetTime(struct Poketch *poketch, u32 *hour_p, u32 *min_p); +void Save_Poketch_SetAlarm(struct Poketch *poketch, BOOL enabled, u32 hour, u32 minute); +void Save_Poketch_CalendarDateHighlight(struct Poketch *poketch, u32 month, u32 day); +void Save_Poketch_CalendarDateUnhighlight(struct Poketch *poketch, u32 month, u32 day); +BOOL Save_Poketch_CalendarDateIsHighlighted(struct Poketch *poketch, u32 month, u32 day); +void Save_Poketch_MarkingMapSetPos(struct Poketch *poketch, s32 mark, u8 x, u8 y); +void Save_Poketch_MarkingMapGetPos(struct Poketch *poketch, s32 mark, u8 *x_p, u8 *y_p); +u32 Save_Poketch_DotArtistIsEnabled(struct Poketch *poketch); +void Save_Poketch_DotArtistGetDrawing(struct Poketch *poketch, void *grid); +void Save_Poketch_DotArtistSetDrawingAndEnable(struct Poketch *poketch, void *grid); +void Save_Poketch_PokemonHistoryAddMon(struct Poketch *poketch, struct BoxPokemon *mon); +int Save_Poketch_PokemonHistoryGetFirstEmptySlot(struct Poketch *poketch); +void Save_Poketch_PokemonHistoryGetSlotN(struct Poketch *poketch, s32 i, u32 *species_p, u32 *form_p); +struct Poketch *Save_Poketch_Get(struct SaveData *save); -#endif //POKEDIAMOND_POKETCH_H +#endif // POKEDIAMOND_POKETCH_H diff --git a/include/proto.h b/include/proto.h index 1c09f4c00..b5c11c4fb 100644 --- a/include/proto.h +++ b/include/proto.h @@ -3,9 +3,9 @@ // For homeless function declarations -#include "pokemon.h" // for struct definitions -#include "string16.h" // for struct definitions #include "player_data.h" // for struct definitions +#include "pokemon.h" // for struct definitions +#include "string16.h" // for struct definitions int TrainerClass_GetGenderOrTrainerCount(int x); int sub_02014C3C(u8); @@ -13,4 +13,4 @@ void sub_02014C54(int, int, struct UnkStruct_02069038 *, u8); u32 IsNighttime(void); // is day or night void sub_020808AC(struct BoxPokemon *, PlayerProfile *, int, u32, u32); -#endif //POKEDIAMOND_PROTO_H +#endif // POKEDIAMOND_PROTO_H diff --git a/include/render_text.h b/include/render_text.h index 27424f45d..30e1029da 100644 --- a/include/render_text.h +++ b/include/render_text.h @@ -2,30 +2,30 @@ #define POKEDIAMOND_RENDER_TEXT_H #include "global.h" + #include "text.h" typedef struct { - u8 canABSpeedUpPrint : 1; + u8 canABSpeedUpPrint : 1; u8 useAlternateDownArrow : 1; - u8 autoScroll : 1; - u8 forceMidTextSpeed : 1; - u8 unk0_4 : 1; - u8 unk0_5 : 1; - u8 unk0_6 : 1; - u8 unk0_7 : 1; + u8 autoScroll : 1; + u8 forceMidTextSpeed : 1; + u8 unk0_4 : 1; + u8 unk0_5 : 1; + u8 unk0_6 : 1; + u8 unk0_7 : 1; u8 unk1; } TextFlags; -struct TextPrinterSubStruct -{ - u8 glyphId : 4; // 0x14 +struct TextPrinterSubStruct { + u8 glyphId : 4; // 0x14 u8 hasPrintBeenSpedUp : 1; - u8 unk : 3; - u8 downArrowDelay : 5; - u8 downArrowYPosIdx : 2; - u8 hasGlyphIdBeenSet : 1; - u8 autoScrollDelay : 8; + u8 unk : 3; + u8 downArrowDelay : 5; + u8 downArrowYPosIdx : 2; + u8 hasGlyphIdBeenSet : 1; + u8 autoScrollDelay : 8; }; u32 RenderText(struct TextPrinter *printer); diff --git a/include/render_window.h b/include/render_window.h index 9784da04d..a77c15383 100644 --- a/include/render_window.h +++ b/include/render_window.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_0200CABC_H #include "global.h" + #include "bg_window.h" #include "heap.h" #include "pokemon.h" @@ -10,7 +11,7 @@ typedef struct PokepicManager { u8 unk00; -} PokepicManager; //todo: fill out +} PokepicManager; // todo: fill out typedef struct WaitingIcon { struct Window *window; @@ -21,8 +22,7 @@ typedef struct WaitingIcon { u8 unk488 : 2; } WaitingIcon; -struct UnkStruct_0200CABC_2 -{ +struct UnkStruct_0200CABC_2 { u32 unk000; u8 unk004[0x12c]; struct UnkStruct_02008DEC_1 *unk130; @@ -37,8 +37,7 @@ struct UnkStruct_0200CABC_2 PokepicManager pokepicManager; }; -struct UnkStruct_0200CABC_3 -{ +struct UnkStruct_0200CABC_3 { u32 unk00; u32 unk04; u32 unk08; @@ -78,7 +77,7 @@ void BlitRect4Bit(u8 *srcPixels, u16 width, u16 height); void sub_0200D18C(struct Window *window, u16 fill_value); -void sub_0200D274(struct BgConfig *bg_config, u8 bg_id, u16 param2, u8 param3, u8 param4, HeapID heapId); //todo: LoadUserFrameGfx1? +void sub_0200D274(struct BgConfig *bg_config, u8 bg_id, u16 param2, u8 param3, u8 param4, HeapID heapId); // todo: LoadUserFrameGfx1? void sub_0200D300(struct BgConfig *bg_config, u8 bg_id, u16 numtiles, @@ -86,7 +85,7 @@ void sub_0200D300(struct BgConfig *bg_config, u8 param4, u16 param5, HeapID heapId); -void sub_0200D378(struct BgConfig *bg_config, u8 bg_id, u16 numtiles, u8 param3, u16 param4, HeapID heapId); //todo: LoadUserFrameGfx2? +void sub_0200D378(struct BgConfig *bg_config, u8 bg_id, u16 numtiles, u8 param3, u16 param4, HeapID heapId); // todo: LoadUserFrameGfx2? void DrawFrame3(struct BgConfig *bgConfig, u8 bgId, u8 x, @@ -98,7 +97,7 @@ void DrawFrame3(struct BgConfig *bgConfig, void DrawWindowCorner(struct Window *window, u16 fillValue, u8 paletteNum); void DrawFrameAndWindow3(struct Window *window, BOOL copy_to_vram, u16 fillValue, u8 paletteNum, u8 param4); void ClearFrameAndWindow3(struct Window *window, u8 param1, BOOL copy_to_vram); -WaitingIcon *WaitingIcon_New(struct Window *window, u32 param1); //todo param1 -> u16 tileNum? +WaitingIcon *WaitingIcon_New(struct Window *window, u32 param1); // todo param1 -> u16 tileNum? void sub_0200D980(WaitingIcon *waitingIcon, u32 param1); void sub_0200DB7C(u32 param0, void *param1); void sub_0200DBE8(u32 param0, void *param1); diff --git a/include/rs_migrate_string.h b/include/rs_migrate_string.h index 1e6ef1fdd..ba71580bc 100644 --- a/include/rs_migrate_string.h +++ b/include/rs_migrate_string.h @@ -1,5 +1,7 @@ -#ifndef POKEDIAMOND_UNK_02015D14_H -#define POKEDIAMOND_UNK_02015D14_H +#ifndef POKEDIAMOND_RS_MIGRATE_STRING_H +#define POKEDIAMOND_RS_MIGRATE_STRING_H + +#include "nitro/types.h" // -------------------------------------------- // ConvertRSStringToDPStringInternational @@ -21,6 +23,6 @@ // successfully. Otherwise, dp_str will // be filled with up to 10 question mark // characters. -BOOL ConvertRSStringToDPStringInternational(const u8 * rs_str, u16 * dp_str, u32 length, u32 language); +BOOL ConvertRSStringToDPStringInternational(const u8 *rs_str, u16 *dp_str, u32 length, u32 language); -#endif //POKEDIAMOND_UNK_02015D14_H +#endif // POKEDIAMOND_RS_MIGRATE_STRING_H diff --git a/include/safari_zone.h b/include/safari_zone.h index f737a183a..9beaf5499 100644 --- a/include/safari_zone.h +++ b/include/safari_zone.h @@ -3,6 +3,6 @@ typedef struct SafariZone { -} SafariZone; //todo fill out +} SafariZone; // todo fill out -#endif //POKEDIAMOND_SAFARI_ZONE_H \ No newline at end of file +#endif // POKEDIAMOND_SAFARI_ZONE_H diff --git a/include/sav_chatot.h b/include/sav_chatot.h index aa81cc38f..9b2127529 100644 --- a/include/sav_chatot.h +++ b/include/sav_chatot.h @@ -3,22 +3,21 @@ #include "save.h" -struct SaveChatotSoundClip -{ +struct SaveChatotSoundClip { // TODO: Fill this in BOOL exists; s8 data[1000]; }; u32 Save_Chatot_sizeof(void); -void Save_Chatot_Init(struct SaveChatotSoundClip * chatot); -struct SaveChatotSoundClip * Chatot_New(HeapID heapId); -struct SaveChatotSoundClip * Save_Chatot_Get(struct SaveData * save); -BOOL Chatot_Exists(struct SaveChatotSoundClip * chatot); -void Chatot_Invalidate(struct SaveChatotSoundClip * chatot); -s8 * Chatot_GetData(struct SaveChatotSoundClip * chatot); -void Chatot_Decode(s8 * dest, const s8 * data); -void Chatot_Encode(struct SaveChatotSoundClip * chatot, const s8 * data); -void Chatot_Copy(struct SaveChatotSoundClip * dest, const struct SaveChatotSoundClip * src); +void Save_Chatot_Init(struct SaveChatotSoundClip *chatot); +struct SaveChatotSoundClip *Chatot_New(HeapID heapId); +struct SaveChatotSoundClip *Save_Chatot_Get(struct SaveData *save); +BOOL Chatot_Exists(struct SaveChatotSoundClip *chatot); +void Chatot_Invalidate(struct SaveChatotSoundClip *chatot); +s8 *Chatot_GetData(struct SaveChatotSoundClip *chatot); +void Chatot_Decode(s8 *dest, const s8 *data); +void Chatot_Encode(struct SaveChatotSoundClip *chatot, const s8 *data); +void Chatot_Copy(struct SaveChatotSoundClip *dest, const struct SaveChatotSoundClip *src); -#endif //POKEDIAMOND_SAV_CHATOT_H +#endif // POKEDIAMOND_SAV_CHATOT_H diff --git a/include/save.h b/include/save.h index b9cef4212..c41b4464a 100644 --- a/include/save.h +++ b/include/save.h @@ -1,12 +1,12 @@ #ifndef POKEDIAMOND_SAVE_H #define POKEDIAMOND_SAVE_H -#include "heap.h" -#include "MATH_crc.h" #include "constants/save_arrays.h" -struct SaveArrayHeader -{ +#include "MATH_crc.h" +#include "heap.h" + +struct SaveArrayHeader { int id; u32 size; u32 offset; @@ -14,8 +14,7 @@ struct SaveArrayHeader u16 slot; }; -struct SaveArrayFooter -{ +struct SaveArrayFooter { u32 magic; u32 saveno; u32 size; @@ -23,8 +22,7 @@ struct SaveArrayFooter u16 crc; }; -struct SaveChunkFooter -{ +struct SaveChunkFooter { u32 unk_0; u32 offset; u32 size; @@ -43,8 +41,7 @@ struct SaveSlotSpec { u32 size; }; -struct AsyncWriteManager -{ +struct AsyncWriteManager { int rollbackCounter; int unk_4; int curSector; @@ -52,18 +49,16 @@ struct AsyncWriteManager int lockId; u32 state; u32 count; - u32 unk_1C[2]; //differes from HG + u32 unk_1C[2]; // differes from HG }; -struct UnkStruct_0202288C -{ +struct UnkStruct_0202288C { BOOL unk_0; u32 offset; u32 size; }; -typedef struct SaveData -{ +typedef struct SaveData { /* 0x00000 */ BOOL flashOkay; /* 0x00004 */ u32 saveFileExists; /* 0x00008 */ u32 isNewGame; @@ -85,8 +80,7 @@ typedef struct SaveData typedef u32 (*SAVSIZEFN)(void); typedef void (*SAVINITFN)(void *); -struct SaveChunkHeader -{ +struct SaveChunkHeader { int id; int linkedId; SAVSIZEFN sizeFunc; @@ -98,62 +92,62 @@ extern const struct SaveChunkHeader UNK_020EE700[]; extern const int UNK_020EE6DC; extern const int UNK_020EE6D8; -struct SaveData * SaveData_New(void); -struct SaveData * sub_020225F8(void); -void * SaveArray_Get(struct SaveData * save, int idx); -void * sub_02022634(struct SaveData * save, int idx); -BOOL sub_0202263C(struct SaveData * save); -BOOL sub_020226FC(struct SaveData * save); -int SaveGame(struct SaveData * save); -void sub_020227A0(struct SaveData * save, int a1); -void Save_InitDynamicRegion(struct SaveData * save); -int sub_020227FC(struct SaveData * save); -int sub_02022800(struct SaveData * save); -u32 Save_FileExists(struct SaveData * save); -u32 Save_IsNewGame(struct SaveData * save); -BOOL Save_FileDoesNotBelongToPlayer(struct SaveData * save); -int Save_GetDirtyBit(struct SaveData * save); +struct SaveData *SaveData_New(void); +struct SaveData *sub_020225F8(void); +void *SaveArray_Get(struct SaveData *save, int idx); +void *sub_02022634(struct SaveData *save, int idx); +BOOL sub_0202263C(struct SaveData *save); +BOOL sub_020226FC(struct SaveData *save); +int SaveGame(struct SaveData *save); +void sub_020227A0(struct SaveData *save, int a1); +void Save_InitDynamicRegion(struct SaveData *save); +int sub_020227FC(struct SaveData *save); +int sub_02022800(struct SaveData *save); +u32 Save_FileExists(struct SaveData *save); +u32 Save_IsNewGame(struct SaveData *save); +BOOL Save_FileDoesNotBelongToPlayer(struct SaveData *save); +int Save_GetDirtyBit(struct SaveData *save); void Save_SetDirtyBit(void); -void sub_02022840(struct SaveData * save, int a1); -int sub_02022854(struct SaveData * save); -void sub_0202287C(struct SaveData * save); -void sub_0202288C(struct UnkStruct_0202288C * header); -u16 sub_02022898(struct SaveData * save, void * data, u32 size); -u32 GetChunkOffsetFromCurrentSaveSlot(u32 slot, struct SaveSlotSpec * header); -struct SaveChunkFooter * sub_020228B8(struct SaveData * save, u8 * offset, int idx); -BOOL sub_020228E0(struct SaveData * save, void * data, int idx); -void sub_0202293C(struct UnkStruct_0202288C * r5, struct SaveData * save, void * data, int idx); -void sub_02022968(struct SaveData * save, void * data, int idx); +void sub_02022840(struct SaveData *save, int a1); +int sub_02022854(struct SaveData *save); +void sub_0202287C(struct SaveData *save); +void sub_0202288C(struct UnkStruct_0202288C *header); +u16 sub_02022898(struct SaveData *save, void *data, u32 size); +u32 GetChunkOffsetFromCurrentSaveSlot(u32 slot, struct SaveSlotSpec *header); +struct SaveChunkFooter *sub_020228B8(struct SaveData *save, u8 *offset, int idx); +BOOL sub_020228E0(struct SaveData *save, void *data, int idx); +void sub_0202293C(struct UnkStruct_0202288C *r5, struct SaveData *save, void *data, int idx); +void sub_02022968(struct SaveData *save, void *data, int idx); int sub_020229B8(u32 x, u32 y); -int sub_020229F0(struct UnkStruct_0202288C * r7, struct UnkStruct_0202288C * r6, u32 * r5, u32 * r4); -void sub_02022AA0(struct SaveData * save, struct UnkStruct_0202288C * a1, struct UnkStruct_0202288C * a2, u32 a3, u32 a4); -int sub_02022AD8(struct SaveData * save); -BOOL FlashLoadChunkIntoDynamicRegionFromHeader(u32 slot, struct SaveSlotSpec * header, u8 * dest); -BOOL Save_LoadDynamicRegion(struct SaveData * save); -int sub_02022D54(struct SaveData * save, int chunk, u8 slot); -int sub_02022D94(struct SaveData * save, int chunk, u8 slot); -int sub_02022DC8(struct SaveData * save, int chunk, u8 slot); -void sub_02022DFC(struct SaveData * save, struct AsyncWriteManager * a1, int a2); -int sub_02022E78(struct SaveData * save, struct AsyncWriteManager * a1); -void sub_02022F80(struct SaveData * save, struct AsyncWriteManager * a1, int a2); -void sub_02022FF0(struct SaveData * save, struct AsyncWriteManager * a1); -int sub_02023044(struct SaveData * save); -int FlashClobberChunkFooter(struct SaveData * save, int x, u32 y); +int sub_020229F0(struct UnkStruct_0202288C *r7, struct UnkStruct_0202288C *r6, u32 *r5, u32 *r4); +void sub_02022AA0(struct SaveData *save, struct UnkStruct_0202288C *a1, struct UnkStruct_0202288C *a2, u32 a3, u32 a4); +int sub_02022AD8(struct SaveData *save); +BOOL FlashLoadChunkIntoDynamicRegionFromHeader(u32 slot, struct SaveSlotSpec *header, u8 *dest); +BOOL Save_LoadDynamicRegion(struct SaveData *save); +int sub_02022D54(struct SaveData *save, int chunk, u8 slot); +int sub_02022D94(struct SaveData *save, int chunk, u8 slot); +int sub_02022DC8(struct SaveData *save, int chunk, u8 slot); +void sub_02022DFC(struct SaveData *save, struct AsyncWriteManager *a1, int a2); +int sub_02022E78(struct SaveData *save, struct AsyncWriteManager *a1); +void sub_02022F80(struct SaveData *save, struct AsyncWriteManager *a1, int a2); +void sub_02022FF0(struct SaveData *save, struct AsyncWriteManager *a1); +int sub_02023044(struct SaveData *save); +int FlashClobberChunkFooter(struct SaveData *save, int x, u32 y); u32 SaveArray_sizeof(int idx); -void SaveData_InitSubstructs(struct SaveArrayHeader * headers); -void sub_02023160(struct SaveSlotSpec * spec, struct SaveArrayHeader * headers); -void Save_InitDynamicRegion_Internal(u8 * dynamic_region, struct SaveArrayHeader * headers); -void CreateChunkFooter(struct SaveData * save, u8 * data, int id, u32 size); -BOOL ValidateChunk(struct SaveData * save, u8 * data, int id, u32 size); -u32 sub_020232B4(u8 * data, u32 size); -int WriteSaveFileToFlash(struct SaveData * save, int idx, u8 * data); -u8 * ReadSaveFileFromFlash(struct SaveData * save, HeapID heapId, int idx, int * ret_p); +void SaveData_InitSubstructs(struct SaveArrayHeader *headers); +void sub_02023160(struct SaveSlotSpec *spec, struct SaveArrayHeader *headers); +void Save_InitDynamicRegion_Internal(u8 *dynamic_region, struct SaveArrayHeader *headers); +void CreateChunkFooter(struct SaveData *save, u8 *data, int id, u32 size); +BOOL ValidateChunk(struct SaveData *save, u8 *data, int id, u32 size); +u32 sub_020232B4(u8 *data, u32 size); +int WriteSaveFileToFlash(struct SaveData *save, int idx, u8 *data); +u8 *ReadSaveFileFromFlash(struct SaveData *save, HeapID heapId, int idx, int *ret_p); BOOL SaveDetectFlash(void); -int FlashWriteChunk(u32 offset, u8 * data, u32 size); -BOOL FlashLoadChunk(u32 src, void * dest, u32 size); -void FlashWriteCommandCallback(void * arg); -int FlashWriteChunkInternal(u32 dest, void * src, u32 size); -BOOL WaitFlashWrite(int lock, BOOL * res); +int FlashWriteChunk(u32 offset, u8 *data, u32 size); +BOOL FlashLoadChunk(u32 src, void *dest, u32 size); +void FlashWriteCommandCallback(void *arg); +int FlashWriteChunkInternal(u32 dest, void *src, u32 size); +BOOL WaitFlashWrite(int lock, BOOL *res); void SaveErrorHandling(int lock, u32 errno); -#endif //POKEDIAMOND_SAVE_H +#endif // POKEDIAMOND_SAVE_H diff --git a/include/save_data_read_error.h b/include/save_data_read_error.h index 12c8d149d..297ad7d45 100644 --- a/include/save_data_read_error.h +++ b/include/save_data_read_error.h @@ -1,6 +1,8 @@ #ifndef POKEDIAMOND_SAVE_DATA_READ_ERROR_H #define POKEDIAMOND_SAVE_DATA_READ_ERROR_H +#include "heap.h" + void ShowSaveDataReadError(HeapID heapId); void ShowGBACartRemovedError(HeapID heapId); diff --git a/include/save_data_write_error.h b/include/save_data_write_error.h index 4cc8ab2d8..63046009b 100644 --- a/include/save_data_write_error.h +++ b/include/save_data_write_error.h @@ -1,6 +1,10 @@ #ifndef POKEDIAMOND_SAVE_DATA_WRITE_ERROR_H #define POKEDIAMOND_SAVE_DATA_WRITE_ERROR_H +#include "nitro/types.h" + +#include "heap.h" + void ShowSaveDataWriteError(HeapID heapId, u32 err_no); #endif diff --git a/include/save_local_field_data.h b/include/save_local_field_data.h index 2199962e3..bb373c4ae 100644 --- a/include/save_local_field_data.h +++ b/include/save_local_field_data.h @@ -3,6 +3,6 @@ typedef struct LocalFieldData { -} LocalFieldData; //TODO: populate +} LocalFieldData; // TODO: populate -#endif //POKEDIAMOND_SAVE_LOCAL_FIELD_DATA_H +#endif // POKEDIAMOND_SAVE_LOCAL_FIELD_DATA_H diff --git a/include/save_system_info.h b/include/save_system_info.h index c6836311a..a8dbd85de 100644 --- a/include/save_system_info.h +++ b/include/save_system_info.h @@ -1,13 +1,13 @@ #ifndef POKEDIAMOND_SAVE_SYSTEM_INFO_H #define POKEDIAMOND_SAVE_SYSTEM_INFO_H -#include "RTC_api.h" #include "nitro/types.h" +#include "RTC_api.h" + struct SaveData; -typedef struct SysInfo_RTC -{ +typedef struct SysInfo_RTC { /* 0x00 */ u32 field_00; /* 0x04 */ RTCDate date; /* 0x14 */ RTCTime time; @@ -17,35 +17,34 @@ typedef struct SysInfo_RTC /* 0x34 */ u32 field_34; } SysInfo_RTC; -typedef struct SaveSysInfo -{ +typedef struct SaveSysInfo { /* 0x00 */ s64 rtcOffset; /* 0x08 */ u8 macAddr[6]; /* 0x0E */ u8 birthMonth; /* 0x0F */ u8 birthDay; /* 0x10 */ SysInfo_RTC rtcInfo; /* 0x48 */ u8 mysteryGiftActive; - u8 filler_49[3]; + u8 filler_49[3]; /* 0x4C */ u32 field_4C; - u8 padding_50[12]; + u8 padding_50[12]; } SaveSysInfo; u32 Save_SysInfo_sizeof(void); -void Save_SysInfo_Init(struct SaveSysInfo * unk); -struct SaveSysInfo * Save_SysInfo_Get(struct SaveData * save); -SysInfo_RTC * Save_SysInfo_RTC_Get(struct SaveData * save); -void Save_SysInfo_InitFromSystem(struct SaveSysInfo * unk); -BOOL Save_SysInfo_MacAddressIsMine(struct SaveSysInfo * unk); -BOOL Save_SysInfo_RTCOffsetIsMine(struct SaveSysInfo * unk); -u8 Save_SysInfo_GetBirthMonth(struct SaveSysInfo * unk); -u8 Save_SysInfo_GetBirthDay(struct SaveSysInfo * unk); -u8 Save_SysInfo_GetMysteryGiftActive(struct SaveSysInfo * unk); -void Save_SysInfo_SetMysteryGiftActive(struct SaveSysInfo * unk, u8 val); -u32 sub_02023830(struct SaveSysInfo * unk); -void sub_02023834(struct SaveSysInfo * unk, u32 val); -void Save_SysInfo_RTC_Init(SysInfo_RTC * sub); -BOOL sub_02023874(SysInfo_RTC * sub); -void sub_02023884(SysInfo_RTC * sub, u32 a1); -void sub_020238A4(SysInfo_RTC * sub); +void Save_SysInfo_Init(struct SaveSysInfo *unk); +struct SaveSysInfo *Save_SysInfo_Get(struct SaveData *save); +SysInfo_RTC *Save_SysInfo_RTC_Get(struct SaveData *save); +void Save_SysInfo_InitFromSystem(struct SaveSysInfo *unk); +BOOL Save_SysInfo_MacAddressIsMine(struct SaveSysInfo *unk); +BOOL Save_SysInfo_RTCOffsetIsMine(struct SaveSysInfo *unk); +u8 Save_SysInfo_GetBirthMonth(struct SaveSysInfo *unk); +u8 Save_SysInfo_GetBirthDay(struct SaveSysInfo *unk); +u8 Save_SysInfo_GetMysteryGiftActive(struct SaveSysInfo *unk); +void Save_SysInfo_SetMysteryGiftActive(struct SaveSysInfo *unk, u8 val); +u32 sub_02023830(struct SaveSysInfo *unk); +void sub_02023834(struct SaveSysInfo *unk, u32 val); +void Save_SysInfo_RTC_Init(SysInfo_RTC *sub); +BOOL sub_02023874(SysInfo_RTC *sub); +void sub_02023884(SysInfo_RTC *sub, u32 a1); +void sub_020238A4(SysInfo_RTC *sub); -#endif //POKEDIAMOND_SAVE_SYSTEM_INFO_H +#endif // POKEDIAMOND_SAVE_SYSTEM_INFO_H diff --git a/include/save_vars_flags.h b/include/save_vars_flags.h index 72843ea6b..86598cb63 100644 --- a/include/save_vars_flags.h +++ b/include/save_vars_flags.h @@ -1,10 +1,11 @@ #ifndef POKEDIAMOND_SAVE_VARS_FLAGS_H #define POKEDIAMOND_SAVE_VARS_FLAGS_H -#include "save.h" #include "constants/flags.h" #include "constants/vars.h" +#include "save.h" + typedef struct SaveVarsFlags { u16 vars[NUM_VARS]; u8 flags[NUM_FLAGS / 8]; @@ -19,4 +20,4 @@ void Save_VarsFlags_ClearFlagInArray(SaveVarsFlags *varsFlags, u16 flagId); u8 *Save_VarsFlags_GetFlagAddr(SaveVarsFlags *varsFlags, u16 flagId); u16 *Save_VarsFlags_GetVarAddr(SaveVarsFlags *varsFlags, u16 varId); -#endif //POKEDIAMOND_SAVE_VARS_FLAGS_H +#endif // POKEDIAMOND_SAVE_VARS_FLAGS_H diff --git a/include/scrcmd.h b/include/scrcmd.h index 9683119f9..c15ccbd91 100644 --- a/include/scrcmd.h +++ b/include/scrcmd.h @@ -2,20 +2,19 @@ #define POKEDIAMOND_SCRCMD_H #include "global.h" + #include "script.h" #include "unk_0200CA44.h" extern u16 FieldSystem_VarGet(FieldSystem *fieldSystem, u16); -extern u16* GetVarPointer(FieldSystem *fieldSystem, u16); -extern SaveData* FieldSystem_GetSaveData(FieldSystem *fieldSystem); +extern u16 *GetVarPointer(FieldSystem *fieldSystem, u16); +extern SaveData *FieldSystem_GetSaveData(FieldSystem *fieldSystem); -static inline u16 ScriptGetVar(ScriptContext *ctx) -{ +static inline u16 ScriptGetVar(ScriptContext *ctx) { return FieldSystem_VarGet(ctx->fieldSystem, ScriptReadHalfword(ctx)); } -static inline u16 *ScriptGetVarPointer(ScriptContext *ctx) -{ +static inline u16 *ScriptGetVarPointer(ScriptContext *ctx) { return GetVarPointer(ctx->fieldSystem, ScriptReadHalfword(ctx)); } @@ -26,15 +25,14 @@ typedef struct UnkStruct_0203A288 { u8 padding[1]; } UnkStruct_0203A288; -typedef struct UnkStruct_0203B174 -{ +typedef struct UnkStruct_0203B174 { SysTask *sysTask; u32 Unk04; void *Unk08; struct FieldSystem *fieldSystem; } UnkStruct_0203B174; -//scrcmd.c +// scrcmd.c BOOL ScrCmd_Nop(ScriptContext *ctx); BOOL ScrCmd_Dummy(ScriptContext *ctx); BOOL ScrCmd_End(ScriptContext *ctx); @@ -462,7 +460,7 @@ BOOL ScrCmd_GoodsMart(ScriptContext *ctx); BOOL ScrCmd_SealsMart(ScriptContext *ctx); BOOL ScrCmd_AccessoriesShop(ScriptContext *ctx); -//scrcmd_names.c +// scrcmd_names.c BOOL ScrCmd_GetPlayerName(ScriptContext *ctx); BOOL ScrCmd_GetRivalName(ScriptContext *ctx); BOOL ScrCmd_GetFriendName(ScriptContext *ctx); @@ -505,7 +503,7 @@ BOOL ScrCmd_Unk02CC(ScriptContext *ctx); BOOL ScrCmd_GetSealNamePlural(ScriptContext *ctx); BOOL ScrCmd_CapitalizeFirstChar(ScriptContext *ctx); -//scrcmd_sound.c +// scrcmd_sound.c BOOL ScrCmd_Unk02AE(struct ScriptContext *ctx); BOOL ScrCmd_PlayBgm(struct ScriptContext *ctx); BOOL ScrCmd_StopBgm(struct ScriptContext *ctx); @@ -513,208 +511,208 @@ BOOL ScrCmd_PlayDefaultBgm(struct ScriptContext *ctx); BOOL ScrCmd_Unk0053(struct ScriptContext *ctx); BOOL ScrCmd_FadeOutBgm(struct ScriptContext *ctx); BOOL sub_02041464(struct ScriptContext *ctx); -BOOL ScrCmd_FadeInBgm(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0056(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0057(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0058(struct ScriptContext* ctx); -BOOL ScrCmd_PlayFanfare(struct ScriptContext* ctx); -BOOL ScrCmd_StopFanfare(struct ScriptContext* ctx); -BOOL ScrCmd_PlayFanfareWait(struct ScriptContext* ctx); -BOOL sub_02041540(struct ScriptContext* ctx); -BOOL ScrCmd_PlayCry(struct ScriptContext* ctx); -BOOL ScrCmd_PlayCryWait(struct ScriptContext* ctx); -BOOL sub_02041598(struct ScriptContext* ctx); -BOOL ScrCmd_PlaySoundWait(struct ScriptContext* ctx); -BOOL sub_020415CC(struct ScriptContext* ctx); -BOOL ScrCmd_PlaySound(struct ScriptContext* ctx); -BOOL ScrCmd_CheckChatotCry(struct ScriptContext* ctx); -BOOL ScrCmd_StartChatotRecord(struct ScriptContext* ctx); -BOOL ScrCmd_StopChatotRecord(struct ScriptContext* ctx); -BOOL ScrCmd_SaveChatotCry(struct ScriptContext* ctx); -BOOL ScrCmd_Unk005D(struct ScriptContext* ctx); +BOOL ScrCmd_FadeInBgm(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0056(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0057(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0058(struct ScriptContext *ctx); +BOOL ScrCmd_PlayFanfare(struct ScriptContext *ctx); +BOOL ScrCmd_StopFanfare(struct ScriptContext *ctx); +BOOL ScrCmd_PlayFanfareWait(struct ScriptContext *ctx); +BOOL sub_02041540(struct ScriptContext *ctx); +BOOL ScrCmd_PlayCry(struct ScriptContext *ctx); +BOOL ScrCmd_PlayCryWait(struct ScriptContext *ctx); +BOOL sub_02041598(struct ScriptContext *ctx); +BOOL ScrCmd_PlaySoundWait(struct ScriptContext *ctx); +BOOL sub_020415CC(struct ScriptContext *ctx); +BOOL ScrCmd_PlaySound(struct ScriptContext *ctx); +BOOL ScrCmd_CheckChatotCry(struct ScriptContext *ctx); +BOOL ScrCmd_StartChatotRecord(struct ScriptContext *ctx); +BOOL ScrCmd_StopChatotRecord(struct ScriptContext *ctx); +BOOL ScrCmd_SaveChatotCry(struct ScriptContext *ctx); +BOOL ScrCmd_Unk005D(struct ScriptContext *ctx); BOOL ScrCmd_SetVolume(struct ScriptContext *ctx); -//scrcmd_union.c -BOOL ScrCmd_UnionGroup(struct ScriptContext* ctx); +// scrcmd_union.c +BOOL ScrCmd_UnionGroup(struct ScriptContext *ctx); -//scrcmd_berry_trees.c -BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext* ctx); -BOOL ScrCmd_GetBerryTreeType(struct ScriptContext* ctx); -BOOL ScrCmd_GetBerryTreeMulch(struct ScriptContext* ctx); -BOOL ScrCmd_GetBerryTreeWater(struct ScriptContext* ctx); -BOOL ScrCmd_GetBerryTreeAmount(struct ScriptContext* ctx); -BOOL ScrCmd_SetBerryTreeMulch(struct ScriptContext* ctx); -BOOL ScrCmd_SetBerryTreeType(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0184(struct ScriptContext* ctx); -BOOL ScrCmd_TakeBerryTreeBerries(struct ScriptContext* ctx); +// scrcmd_berry_trees.c +BOOL ScrCmd_GetBerryTreeGrowth(struct ScriptContext *ctx); +BOOL ScrCmd_GetBerryTreeType(struct ScriptContext *ctx); +BOOL ScrCmd_GetBerryTreeMulch(struct ScriptContext *ctx); +BOOL ScrCmd_GetBerryTreeWater(struct ScriptContext *ctx); +BOOL ScrCmd_GetBerryTreeAmount(struct ScriptContext *ctx); +BOOL ScrCmd_SetBerryTreeMulch(struct ScriptContext *ctx); +BOOL ScrCmd_SetBerryTreeType(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0184(struct ScriptContext *ctx); +BOOL ScrCmd_TakeBerryTreeBerries(struct ScriptContext *ctx); -//scrcmd_13.c -BOOL ScrCmd_Unk0253(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0254(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0255(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0256(struct ScriptContext* ctx); +// scrcmd_13.c +BOOL ScrCmd_Unk0253(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0254(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0255(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0256(struct ScriptContext *ctx); -//scrcmd_coins.c -BOOL ScrCmd_ShowCoinBox(struct ScriptContext* ctx); -BOOL ScrCmd_HideCoinBox(struct ScriptContext* ctx); -BOOL ScrCmd_UpdateCoinBox(struct ScriptContext* ctx); -BOOL ScrCmd_GetCoins(struct ScriptContext* ctx); -BOOL ScrCmd_GiveCoins(struct ScriptContext* ctx); -BOOL ScrCmd_TakeCoinsImmediate(struct ScriptContext* ctx); -BOOL ScrCmd_TakeCoinsAddress(struct ScriptContext* ctx); -BOOL ScrCmd_HasEnoughCoinsImmediate(struct ScriptContext* ctx); -BOOL ScrCmd_HasEnoughCoinsAddress(struct ScriptContext* ctx); -BOOL ScrCmd_CanGiveCoins(struct ScriptContext* ctx); +// scrcmd_coins.c +BOOL ScrCmd_ShowCoinBox(struct ScriptContext *ctx); +BOOL ScrCmd_HideCoinBox(struct ScriptContext *ctx); +BOOL ScrCmd_UpdateCoinBox(struct ScriptContext *ctx); +BOOL ScrCmd_GetCoins(struct ScriptContext *ctx); +BOOL ScrCmd_GiveCoins(struct ScriptContext *ctx); +BOOL ScrCmd_TakeCoinsImmediate(struct ScriptContext *ctx); +BOOL ScrCmd_TakeCoinsAddress(struct ScriptContext *ctx); +BOOL ScrCmd_HasEnoughCoinsImmediate(struct ScriptContext *ctx); +BOOL ScrCmd_HasEnoughCoinsAddress(struct ScriptContext *ctx); +BOOL ScrCmd_CanGiveCoins(struct ScriptContext *ctx); -//scrcmd_money.c -BOOL ScrCmd_GiveMoney(struct ScriptContext* ctx); -BOOL ScrCmd_TakeMoneyImmediate(struct ScriptContext* ctx); -BOOL ScrCmd_TakeMoneyAddress(struct ScriptContext* ctx); -BOOL ScrCmd_HasEnoughMoneyImmediate(struct ScriptContext* ctx); -BOOL ScrCmd_HasEnoughMoneyAddress(struct ScriptContext* ctx); -BOOL ScrCmd_ShowMoneyBox(struct ScriptContext* ctx); -BOOL ScrCmd_HideMoneyBox(struct ScriptContext* ctx); -BOOL ScrCmd_UpdateMoneyBox(struct ScriptContext* ctx); +// scrcmd_money.c +BOOL ScrCmd_GiveMoney(struct ScriptContext *ctx); +BOOL ScrCmd_TakeMoneyImmediate(struct ScriptContext *ctx); +BOOL ScrCmd_TakeMoneyAddress(struct ScriptContext *ctx); +BOOL ScrCmd_HasEnoughMoneyImmediate(struct ScriptContext *ctx); +BOOL ScrCmd_HasEnoughMoneyAddress(struct ScriptContext *ctx); +BOOL ScrCmd_ShowMoneyBox(struct ScriptContext *ctx); +BOOL ScrCmd_HideMoneyBox(struct ScriptContext *ctx); +BOOL ScrCmd_UpdateMoneyBox(struct ScriptContext *ctx); -//scrcmd_daycare.c -BOOL ScrCmd_GetDaycarePokemonNames(struct ScriptContext* ctx); -BOOL ScrCmd_GetDaycareStatus(struct ScriptContext* ctx); -BOOL ScrCmd_DeleteDaycareEgg(struct ScriptContext* ctx); -BOOL ScrCmd_GiveDaycareEgg(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01A4(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01AA(struct ScriptContext* ctx); -BOOL ScrCmd_GetDaycareLevel(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01AF(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01B0(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01BC(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01BE(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01BF(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01A5(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01A6(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01A7(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01AD(struct ScriptContext* ctx); +// scrcmd_daycare.c +BOOL ScrCmd_GetDaycarePokemonNames(struct ScriptContext *ctx); +BOOL ScrCmd_GetDaycareStatus(struct ScriptContext *ctx); +BOOL ScrCmd_DeleteDaycareEgg(struct ScriptContext *ctx); +BOOL ScrCmd_GiveDaycareEgg(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01A4(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01AA(struct ScriptContext *ctx); +BOOL ScrCmd_GetDaycareLevel(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01AF(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01B0(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01BC(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01BE(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01BF(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01A5(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01A6(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01A7(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01AD(struct ScriptContext *ctx); -//scrcmd_amity_square.c -BOOL ScrCmd_ClearAmitySquareSteps(struct ScriptContext* ctx); -BOOL ScrCmd_CheckAmitySquareSteps(struct ScriptContext* ctx); -BOOL ScrCmd_GetAmitySquareAccessory(struct ScriptContext* ctx); +// scrcmd_amity_square.c +BOOL ScrCmd_ClearAmitySquareSteps(struct ScriptContext *ctx); +BOOL ScrCmd_CheckAmitySquareSteps(struct ScriptContext *ctx); +BOOL ScrCmd_GetAmitySquareAccessory(struct ScriptContext *ctx); -//scrcmd_party.c -BOOL ScrCmd_GiveMon(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonSpecies(struct ScriptContext* ctx); -BOOL ScrCmd_CheckPartyMonOTID(struct ScriptContext* ctx); -BOOL ScrCmd_GiveEgg(struct ScriptContext* ctx); -BOOL ScrCmd_SetPartyMonMove(struct ScriptContext* ctx); -BOOL ScrCmd_PartyMonHasMove(struct ScriptContext* ctx); -BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext* ctx); -BOOL ScrCmd_SurvivePsn(struct ScriptContext* ctx); -BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonLevel(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonNature(struct ScriptContext* ctx); -BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonFriendship(struct ScriptContext* ctx); -BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext* ctx); -BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonContestCondition(struct ScriptContext* ctx); -BOOL ScrCmd_GetLeadingPartyMonSlot(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonTypes(struct ScriptContext* ctx); -BOOL ScrCmd_CountPartyMons(struct ScriptContext* ctx); -BOOL ScrCmd_CountPartyMons_OmitEggs(struct ScriptContext* ctx); -BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext* ctx); -BOOL ScrCmd_CountAvailablePartyAndPCMons(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyEggCount(struct ScriptContext* ctx); -BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonGender(struct ScriptContext* ctx); -BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext* ctx); -BOOL ScrCmd_ForgetPartyMonMove(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonMove(struct ScriptContext* ctx); -BOOL ScrCmd_GetPartyMonHeldItem(struct ScriptContext* ctx); -BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext* ctx); -BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext* ctx); -BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext* ctx); -BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext* ctx); -BOOL ScrCmd_PartyMonHasRibbon(struct ScriptContext* ctx); -BOOL ScrCmd_GivePartyMonRibbon(struct ScriptContext* ctx); -BOOL ScrCmd_CheckPartyForBadEgg(struct ScriptContext* ctx); -BOOL ScrCmd_Unk00A0(struct ScriptContext* ctx); +// scrcmd_party.c +BOOL ScrCmd_GiveMon(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonSpecies(struct ScriptContext *ctx); +BOOL ScrCmd_CheckPartyMonOTID(struct ScriptContext *ctx); +BOOL ScrCmd_GiveEgg(struct ScriptContext *ctx); +BOOL ScrCmd_SetPartyMonMove(struct ScriptContext *ctx); +BOOL ScrCmd_PartyMonHasMove(struct ScriptContext *ctx); +BOOL ScrCmd_FindPartyMonWithMove(struct ScriptContext *ctx); +BOOL ScrCmd_SurvivePsn(struct ScriptContext *ctx); +BOOL ScrCmd_CountPartyMonsAtOrBelowLevel(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonLevel(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonNature(struct ScriptContext *ctx); +BOOL ScrCmd_FindPartyMonWithNature(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonFriendship(struct ScriptContext *ctx); +BOOL ScrCmd_AddPartyMonFriendship(struct ScriptContext *ctx); +BOOL ScrCmd_SubtractPartyMonFriendship(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonContestCondition(struct ScriptContext *ctx); +BOOL ScrCmd_GetLeadingPartyMonSlot(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonTypes(struct ScriptContext *ctx); +BOOL ScrCmd_CountPartyMons(struct ScriptContext *ctx); +BOOL ScrCmd_CountPartyMons_OmitEggs(struct ScriptContext *ctx); +BOOL ScrCmd_CountAvailablePartyMons_IgnoreSlot(struct ScriptContext *ctx); +BOOL ScrCmd_CountAvailablePartyAndPCMons(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyEggCount(struct ScriptContext *ctx); +BOOL ScrCmd_CheckPartyForPokerus(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonGender(struct ScriptContext *ctx); +BOOL ScrCmd_CountPartyMonMoves(struct ScriptContext *ctx); +BOOL ScrCmd_ForgetPartyMonMove(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonMove(struct ScriptContext *ctx); +BOOL ScrCmd_GetPartyMonHeldItem(struct ScriptContext *ctx); +BOOL ScrCmd_ResetPartyMonHeldItem(struct ScriptContext *ctx); +BOOL ScrCmd_CheckPartyForSpecies(struct ScriptContext *ctx); +BOOL ScrCmd_CountPartyMonRibbons(struct ScriptContext *ctx); +BOOL ScrCmd_CountTotalPartyRibbons(struct ScriptContext *ctx); +BOOL ScrCmd_PartyMonHasRibbon(struct ScriptContext *ctx); +BOOL ScrCmd_GivePartyMonRibbon(struct ScriptContext *ctx); +BOOL ScrCmd_CheckPartyForBadEgg(struct ScriptContext *ctx); +BOOL ScrCmd_Unk00A0(struct ScriptContext *ctx); -//scrcmd_fossils.c -BOOL ScrCmd_CountFossils(struct ScriptContext* ctx); -BOOL ScrCmd_GetFossilPokemon(struct ScriptContext* ctx); -BOOL ScrCmd_GetFossilMinimumAmount(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01F2(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01F3(struct ScriptContext* ctx); +// scrcmd_fossils.c +BOOL ScrCmd_CountFossils(struct ScriptContext *ctx); +BOOL ScrCmd_GetFossilPokemon(struct ScriptContext *ctx); +BOOL ScrCmd_GetFossilMinimumAmount(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01F2(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01F3(struct ScriptContext *ctx); -//scrcmd_prizes.c -BOOL ScrCmd_GetPrizeItemIdAndCost(struct ScriptContext* ctx); +// scrcmd_prizes.c +BOOL ScrCmd_GetPrizeItemIdAndCost(struct ScriptContext *ctx); -//scrcmd_flags.c -BOOL ScrCmd_HasSinnohDex(struct ScriptContext* ctx); -BOOL ScrCmd_GiveSinnohDex(struct ScriptContext* ctx); -BOOL ScrCmd_HasRunningShoes(struct ScriptContext* ctx); -BOOL ScrCmd_GiveRunningShoes(struct ScriptContext* ctx); -BOOL ScrCmd_HasBadge(struct ScriptContext* ctx); -BOOL ScrCmd_GiveBadge(struct ScriptContext* ctx); -BOOL ScrCmd_HasBag(struct ScriptContext* ctx); -BOOL ScrCmd_GetTotalEarnedBadges(struct ScriptContext* ctx); -BOOL ScrCmd_GiveBag(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0160(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0161(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0162(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0163(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0164(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0165(struct ScriptContext* ctx); -BOOL ScrCmd_CheckGameCompleted(struct ScriptContext* ctx); -BOOL ScrCmd_SetGameCompleted(struct ScriptContext* ctx); -BOOL ScrCmd_GetSetStrength(struct ScriptContext* ctx); -BOOL ScrCmd_GetSetFlash(struct ScriptContext* ctx); -BOOL ScrCmd_GetSetDefog(struct ScriptContext* ctx); +// scrcmd_flags.c +BOOL ScrCmd_HasSinnohDex(struct ScriptContext *ctx); +BOOL ScrCmd_GiveSinnohDex(struct ScriptContext *ctx); +BOOL ScrCmd_HasRunningShoes(struct ScriptContext *ctx); +BOOL ScrCmd_GiveRunningShoes(struct ScriptContext *ctx); +BOOL ScrCmd_HasBadge(struct ScriptContext *ctx); +BOOL ScrCmd_GiveBadge(struct ScriptContext *ctx); +BOOL ScrCmd_HasBag(struct ScriptContext *ctx); +BOOL ScrCmd_GetTotalEarnedBadges(struct ScriptContext *ctx); +BOOL ScrCmd_GiveBag(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0160(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0161(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0162(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0163(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0164(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0165(struct ScriptContext *ctx); +BOOL ScrCmd_CheckGameCompleted(struct ScriptContext *ctx); +BOOL ScrCmd_SetGameCompleted(struct ScriptContext *ctx); +BOOL ScrCmd_GetSetStrength(struct ScriptContext *ctx); +BOOL ScrCmd_GetSetFlash(struct ScriptContext *ctx); +BOOL ScrCmd_GetSetDefog(struct ScriptContext *ctx); -//scrcmd_items.c -BOOL ScrCmd_GiveItem(struct ScriptContext* ctx); -BOOL ScrCmd_TakeItem(struct ScriptContext* ctx); -BOOL ScrCmd_HasSpaceForItem(struct ScriptContext* ctx); -BOOL ScrCmd_HasItem(struct ScriptContext* ctx); -BOOL ScrCmd_ItemIdIsTMOrHM(struct ScriptContext* ctx); -BOOL ScrCmd_GetItemPocketId(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0081(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0082(struct ScriptContext* ctx); +// scrcmd_items.c +BOOL ScrCmd_GiveItem(struct ScriptContext *ctx); +BOOL ScrCmd_TakeItem(struct ScriptContext *ctx); +BOOL ScrCmd_HasSpaceForItem(struct ScriptContext *ctx); +BOOL ScrCmd_HasItem(struct ScriptContext *ctx); +BOOL ScrCmd_ItemIdIsTMOrHM(struct ScriptContext *ctx); +BOOL ScrCmd_GetItemPocketId(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0081(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0082(struct ScriptContext *ctx); -//scrcmd_underground.c -BOOL ScrCmd_GiveSecretBaseDecoration(struct ScriptContext* ctx); -BOOL ScrCmd_TakeSecretBaseDecoration(struct ScriptContext* ctx); -BOOL ScrCmd_HasSpaceForDecoration(struct ScriptContext* ctx); -BOOL ScrCmd_GetDecorationCount(struct ScriptContext* ctx); -BOOL ScrCmd_GiveUndergroundTrap(struct ScriptContext* ctx); -BOOL ScrCmd_TakeUndergroundTrap(struct ScriptContext* ctx); -BOOL ScrCmd_HasSpaceForTrap(struct ScriptContext* ctx); -BOOL ScrCmd_GetTrapCount(struct ScriptContext* ctx); -BOOL ScrCmd_GiveTreasure(struct ScriptContext* ctx); -BOOL ScrCmd_TakeTreasure(struct ScriptContext* ctx); -BOOL ScrCmd_HasSpaceForTreasure(struct ScriptContext* ctx); -BOOL ScrCmd_GetTreasureCount(struct ScriptContext* ctx); -BOOL ScrCmd_GiveUndergroundSphere(struct ScriptContext* ctx); -BOOL ScrCmd_TakeUndergroundSphere(struct ScriptContext* ctx); -BOOL ScrCmd_HasSpaceForSphere(struct ScriptContext* ctx); -BOOL ScrCmd_GetSphereCount(struct ScriptContext* ctx); +// scrcmd_underground.c +BOOL ScrCmd_GiveSecretBaseDecoration(struct ScriptContext *ctx); +BOOL ScrCmd_TakeSecretBaseDecoration(struct ScriptContext *ctx); +BOOL ScrCmd_HasSpaceForDecoration(struct ScriptContext *ctx); +BOOL ScrCmd_GetDecorationCount(struct ScriptContext *ctx); +BOOL ScrCmd_GiveUndergroundTrap(struct ScriptContext *ctx); +BOOL ScrCmd_TakeUndergroundTrap(struct ScriptContext *ctx); +BOOL ScrCmd_HasSpaceForTrap(struct ScriptContext *ctx); +BOOL ScrCmd_GetTrapCount(struct ScriptContext *ctx); +BOOL ScrCmd_GiveTreasure(struct ScriptContext *ctx); +BOOL ScrCmd_TakeTreasure(struct ScriptContext *ctx); +BOOL ScrCmd_HasSpaceForTreasure(struct ScriptContext *ctx); +BOOL ScrCmd_GetTreasureCount(struct ScriptContext *ctx); +BOOL ScrCmd_GiveUndergroundSphere(struct ScriptContext *ctx); +BOOL ScrCmd_TakeUndergroundSphere(struct ScriptContext *ctx); +BOOL ScrCmd_HasSpaceForSphere(struct ScriptContext *ctx); +BOOL ScrCmd_GetSphereCount(struct ScriptContext *ctx); -//scrcmd_move_relearner.c -BOOL ScrCmd_Unk01C6(struct ScriptContext* ctx); -BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx); -BOOL ScrCmd_Unk021E(struct ScriptContext* ctx); -BOOL ScrCmd_Unk021F(struct ScriptContext* ctx); -void sub_02045E74(struct ScriptContext* ctx, u8 a1, struct Pokemon* pokemon, u16 *eligibleMoves); -BOOL ScrCmd_Unk0220(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0221(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0224(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0222(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0223(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0225(struct ScriptContext* ctx); +// scrcmd_move_relearner.c +BOOL ScrCmd_Unk01C6(struct ScriptContext *ctx); +BOOL ScrCmd_Unk01C7(struct ScriptContext *ctx); +BOOL ScrCmd_Unk021E(struct ScriptContext *ctx); +BOOL ScrCmd_Unk021F(struct ScriptContext *ctx); +void sub_02045E74(struct ScriptContext *ctx, u8 a1, struct Pokemon *pokemon, u16 *eligibleMoves); +BOOL ScrCmd_Unk0220(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0221(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0224(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0222(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0223(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0225(struct ScriptContext *ctx); -//scrcmd_25.c -BOOL ScrCmd_Unk023F(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0240(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0241(struct ScriptContext* ctx); -BOOL ScrCmd_Unk0242(struct ScriptContext* ctx); +// scrcmd_25.c +BOOL ScrCmd_Unk023F(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0240(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0241(struct ScriptContext *ctx); +BOOL ScrCmd_Unk0242(struct ScriptContext *ctx); -#endif //POKEDIAMOND_SCRCMD_H +#endif // POKEDIAMOND_SCRCMD_H diff --git a/include/script.h b/include/script.h index c22665e8f..fda0d9ba9 100644 --- a/include/script.h +++ b/include/script.h @@ -2,24 +2,25 @@ #define _SCRIPT_H_ #include "global.h" + #include "bg_window.h" #include "camera.h" #include "fashion_case.h" #include "field_player_avatar.h" -#include "save_local_field_data.h" +#include "field_system.h" +#include "map_object.h" #include "msgdata.h" #include "render_window.h" #include "save.h" +#include "save_local_field_data.h" #include "task.h" -#include "field_system.h" -#include "map_object.h" struct ScriptContext; typedef u8 (*ScrCmdFunc)(struct ScriptContext *); typedef u8 Script[]; -typedef struct PartyMenuAppData PartyMenuAppData; //todo move to own file +typedef struct PartyMenuAppData PartyMenuAppData; // todo move to own file enum PCBoxOperation { PC_BOX_OPERATION_DEPOSIT_MON, @@ -33,7 +34,7 @@ typedef struct PCBoxAppData { struct SaveData *save; enum PCBoxOperation operation; BOOL unk08; -} PCBoxAppData; //todo move to own file +} PCBoxAppData; // todo move to own file typedef struct FashionAppData { SaveFashionData *fashionData; @@ -41,57 +42,55 @@ typedef struct FashionAppData { BOOL isContest; } FashionAppData; -typedef struct TownMapAppData { //todo fill out +typedef struct TownMapAppData { // todo fill out u8 padding[0x140]; -} TownMapAppData; //todo move to own file +} TownMapAppData; // todo move to own file typedef struct ScrCmdUnkStruct01D9 { struct SaveData *save; u16 unk04; u16 unk06; -} ScrCmdUnkStruct01D9; //todo identify and move to own file +} ScrCmdUnkStruct01D9; // todo identify and move to own file typedef struct StarterSelectionData { s32 state; struct Options *options; -} StarterSelectionData; //todo move to own file +} StarterSelectionData; // todo move to own file typedef struct BagScreenAppData { -} BagScreenAppData; //todo fill out and move to own file +} BagScreenAppData; // todo fill out and move to own file typedef struct ScrCmdUnkStruct00F4 { u8 padding[0x2C]; void *unk2C; -} ScrCmdUnkStruct00F4; //todo identify and move to own file +} ScrCmdUnkStruct00F4; // todo identify and move to own file typedef struct RoamerSaveData { -} RoamerSaveData; //todo: fill out and move to own file +} RoamerSaveData; // todo: fill out and move to own file typedef struct PokedexAppData { - -} PokedexAppData; //todo: fill out and move to own file + +} PokedexAppData; // todo: fill out and move to own file typedef struct NPCTradeAppData { -} NPCTradeAppData; //todo: fill out and move to own file +} NPCTradeAppData; // todo: fill out and move to own file typedef struct Poffin { -} Poffin; //todo: fill out and move to own file +} Poffin; // todo: fill out and move to own file typedef struct SavePoffinData { -} SavePoffinData; //todo: fill out and move to own file +} SavePoffinData; // todo: fill out and move to own file typedef struct SaveStatsPrinter { -} SaveStatsPrinter; //todo: fill out and move to own file - +} SaveStatsPrinter; // todo: fill out and move to own file -typedef struct ScriptContext -{ +typedef struct ScriptContext { u8 stackDepth; u8 mode; u8 comparisonResult; @@ -122,7 +121,7 @@ typedef enum ScriptEnvField { SCRIPTENV_CAMERA_TARGET, SCRIPTENV_UNKNOWN_12, SCRIPTENV_SCRIPT_CONTEXT_0, - SCRIPTENV_SCRIPT_CONTEXT_1, //diamond does not appear to have SCRIPT_CONTEXT_2 like HG + SCRIPTENV_SCRIPT_CONTEXT_1, // diamond does not appear to have SCRIPT_CONTEXT_2 like HG SCRIPTENV_MESSAGE_FORMAT, SCRIPTENV_STRING_BUFFER_0, SCRIPTENV_STRING_BUFFER_1, @@ -146,7 +145,7 @@ typedef enum ScriptEnvField { SCRIPTENV_ENGAGED_TRAINER_1_ENCOUNTER_TYPE, SCRIPTENV_ENGAGED_TRAINER_1_EVENT, SCRIPTENV_ENGAGED_TRAINER_1_FIELD_18, - SCRIPTENV_COIN_BOX, //differs from heartgold due to athlete points + SCRIPTENV_COIN_BOX, // differs from heartgold due to athlete points SCRIPTENV_MONEY_BOX, SCRIPTENV_SAVE_STATS_PRINTER, SCRIPTENV_SPECIAL_VAR_8000, diff --git a/include/script_pokemon_util.h b/include/script_pokemon_util.h index d4ee42f59..b47844d9b 100644 --- a/include/script_pokemon_util.h +++ b/include/script_pokemon_util.h @@ -1,17 +1,19 @@ #ifndef POKEDIAMOND_SCRIPT_POKEMON_UTIL_H #define POKEDIAMOND_SCRIPT_POKEMON_UTIL_H -BOOL MonNotFaintedOrEgg(struct Pokemon * pokemon); -BOOL GiveMon(HeapID heapId, struct SaveData * save, u16 species, u8 level, u16 item, u32 mapSec, u32 encounterType); -BOOL GiveEgg(HeapID heapId, struct SaveData * save, u16 species, int level, int metLocIndex, int a3); -void PartyMonSetMoveInSlot(struct Party * party, int partySlot, int moveSlot, u16 move); -int GetIdxOfFirstPartyMonWithMove(struct Party * party, int move); -int CountAlivePokemon(struct Party * party); -struct Pokemon * GetFirstAliveMonInParty_CrashIfNone(struct Party * party); -struct Pokemon * GetFirstNonEggInParty(struct Party * party); -BOOL HasEnoughAlivePokemonForDoubleBattle(struct Party * party); -void GiveAllMonsTheSinnohChampRibbon(struct Party * party); -int ApplyPoisonStep(struct Party * party, int location); -BOOL SurvivePoisoning(struct Pokemon * mon); +#include "party.h" -#endif //POKEDIAMOND_SCRIPT_POKEMON_UTIL_H +BOOL MonNotFaintedOrEgg(struct Pokemon *pokemon); +BOOL GiveMon(HeapID heapId, struct SaveData *save, u16 species, u8 level, u16 item, u32 mapSec, u32 encounterType); +BOOL GiveEgg(HeapID heapId, struct SaveData *save, u16 species, int level, int metLocIndex, int a3); +void PartyMonSetMoveInSlot(struct Party *party, int partySlot, int moveSlot, u16 move); +int GetIdxOfFirstPartyMonWithMove(struct Party *party, int move); +int CountAlivePokemon(struct Party *party); +struct Pokemon *GetFirstAliveMonInParty_CrashIfNone(struct Party *party); +struct Pokemon *GetFirstNonEggInParty(struct Party *party); +BOOL HasEnoughAlivePokemonForDoubleBattle(struct Party *party); +void GiveAllMonsTheSinnohChampRibbon(struct Party *party); +int ApplyPoisonStep(struct Party *party, int location); +BOOL SurvivePoisoning(struct Pokemon *mon); + +#endif // POKEDIAMOND_SCRIPT_POKEMON_UTIL_H diff --git a/include/seal.h b/include/seal.h index ca2cb3706..1c1cf2800 100644 --- a/include/seal.h +++ b/include/seal.h @@ -4,21 +4,20 @@ typedef u8 Coords8[3]; typedef Coords8 CapsuleArray[8]; -typedef struct SealCase -{ +typedef struct SealCase { CapsuleArray coords[12]; u8 sealCounts[80]; } SealCase; u32 Save_SealCase_sizeof(void); -void Save_SealCase_Init(struct SealCase * sealCase); -void CapsuleArray_Copy(const CapsuleArray * a0, CapsuleArray * a1); -struct SealCase * Save_SealCase_Get(struct SaveData * save); -CapsuleArray * SealCase_GetCapsuleI(struct SealCase * sealCase, s32 idx); -void SealCase_SetCapsuleI(struct SealCase * sealCase, const CapsuleArray * src, s32 idx); -Coords8 * Capsule_GetSealI(CapsuleArray * a0, s32 a1); -s32 Seal_GetId(Coords8 * a0); -s32 Seal_GetXCoord(Coords8 * a0); -s32 Seal_GetYCoord(Coords8 * a0); +void Save_SealCase_Init(struct SealCase *sealCase); +void CapsuleArray_Copy(const CapsuleArray *a0, CapsuleArray *a1); +struct SealCase *Save_SealCase_Get(struct SaveData *save); +CapsuleArray *SealCase_GetCapsuleI(struct SealCase *sealCase, s32 idx); +void SealCase_SetCapsuleI(struct SealCase *sealCase, const CapsuleArray *src, s32 idx); +Coords8 *Capsule_GetSealI(CapsuleArray *a0, s32 a1); +s32 Seal_GetId(Coords8 *a0); +s32 Seal_GetXCoord(Coords8 *a0); +s32 Seal_GetYCoord(Coords8 *a0); -#endif //POKEDIAMOND_SEAL_H +#endif // POKEDIAMOND_SEAL_H diff --git a/include/sections.h b/include/sections.h index 39b0eb5a9..967a7749f 100644 --- a/include/sections.h +++ b/include/sections.h @@ -1,9 +1,11 @@ #ifndef GUARD_SECTIONS_H #define GUARD_SECTIONS_H -#pragma define_section ITCM ".itcm" ".itcm.bss" abs32 RWX -#pragma define_section DTCM ".dtcm" ".dtcm.bss" abs32 RWX +#pragma define_section ITCM ".itcm" \ + ".itcm.bss" abs32 RWX +#pragma define_section DTCM ".dtcm" \ + ".dtcm.bss" abs32 RWX #pragma define_section VERSION ".version" abs32 RWX #pragma define_section PARENT ".parent" abs32 RWX -#endif //GUARD_SECTIONS_H +#endif // GUARD_SECTIONS_H diff --git a/include/sinit.h b/include/sinit.h index 47fe4438e..f91a256b3 100644 --- a/include/sinit.h +++ b/include/sinit.h @@ -7,4 +7,4 @@ static void NitroStaticInit(void); SDK_FORCE_EXPORT static void (*NitroStaticInit_[])(void) = { NitroStaticInit }; #pragma section SINIT end -#endif //GUARD_SINIT_H +#endif // GUARD_SINIT_H diff --git a/include/sound.h b/include/sound.h index 378eb1bd7..b66837827 100644 --- a/include/sound.h +++ b/include/sound.h @@ -3,15 +3,14 @@ #include "FS_file.h" #include "NNS_SND_arc.h" -#include "NNS_SND_heap.h" #include "NNS_SND_arc_loader.h" +#include "NNS_SND_heap.h" #include "player_data.h" #include "sav_chatot.h" -struct SoundData -{ +struct SoundData { NNSSndArc header; - NNSSndHeapHandle * heap; // 0x00090 + NNSSndHeapHandle *heap; // 0x00090 u8 heapBuffer[0xBBC00]; u32 players[9]; u32 unk_BBCB8; @@ -45,26 +44,26 @@ struct SoundData u32 unk_BCD3C; u64 unk_BCD40; u32 unk_BCD48; - struct SaveChatotSoundClip * chatot; + struct SaveChatotSoundClip *chatot; u32 unk_BCD50; u32 unk_BCD54; u32 unk_BCD58; u32 unk_BCD5C; }; -struct SoundData * GetSoundDataPointer(void); -void InitSoundData(struct SaveChatotSoundClip * chatot, struct Options * options); -void * sub_02003D38(u32 a0); -int GF_Snd_SaveState(int * level_p); +struct SoundData *GetSoundDataPointer(void); +void InitSoundData(struct SaveChatotSoundClip *chatot, struct Options *options); +void *sub_02003D38(u32 a0); +int GF_Snd_SaveState(int *level_p); void GF_Snd_RestoreState(int level); BOOL GF_Snd_LoadGroup(int groupNo); BOOL GF_Snd_LoadSeq(int seqNo); BOOL GF_Snd_LoadSeqEx(int seqNo, u32 loadFlag); BOOL GF_Snd_LoadWaveArc(int waveArcNo); BOOL GF_Snd_LoadBank(int bankNo); -u32 * GetSoundPlayer(int playerNo); +u32 *GetSoundPlayer(int playerNo); int sub_02004018(u32 a0); void DoSoundUpdateFrame(void); void sub_02003CE8(int); -#endif //POKEDIAMOND_SOUND_H +#endif // POKEDIAMOND_SOUND_H diff --git a/include/sound_chatot.h b/include/sound_chatot.h index 9851c1cd9..5f84f20ff 100644 --- a/include/sound_chatot.h +++ b/include/sound_chatot.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_SOUND_CHATOT_H #include "global.h" + #include "sav_chatot.h" BOOL sub_02005CFC(void); diff --git a/include/string16.h b/include/string16.h index c03c39acf..7e6b70901 100644 --- a/include/string16.h +++ b/include/string16.h @@ -4,8 +4,7 @@ #include "string_util.h" #include "unk_02021590.h" -typedef struct String -{ +typedef struct String { u16 maxsize; u16 size; u32 magic; @@ -15,25 +14,25 @@ typedef struct String #define STR16_MAGIC 0xB6F8D2EC -struct String * String_New(u32 count, HeapID heapId); +struct String *String_New(u32 count, HeapID heapId); BOOL String_Compare(struct String *, struct String *); void CopyU16ArrayToStringN(struct String *, u16 *, u32); // copy -void String_SetEmpty(struct String *); // set empty -struct String * StringDup(struct String *, HeapID heapId); -void String_Delete(struct String * str); -void StringCopy(struct String * dest, struct String * src); -void String16_FormatInteger(struct String * str, int num, u32 ndigits, enum PrintingMode printingMode, BOOL whichCharset); -s64 String_atoi(struct String * str, BOOL * flag); -u16 StringGetLength(struct String * str); -int StringCountLines(volatile struct String * str); -void StringGetLineN(struct String * dest, volatile struct String * src, u32 n); -void CopyU16ArrayToString(struct String * str, u16 * buf); -void CopyStringToU16Array(struct String * str, u16 * buf, u32 length); -u16 * String_c_str(struct String * str); -void StrAddChar(struct String * str, u16 val); -void StringCat(struct String * dest, struct String * src); -void StrUpperFirstChar(struct String * str); -BOOL String_IsTrainerName(struct String * string); -void StringCat_HandleTrainerName(struct String * dest, struct String * src); +void String_SetEmpty(struct String *); // set empty +struct String *StringDup(struct String *, HeapID heapId); +void String_Delete(struct String *str); +void StringCopy(struct String *dest, struct String *src); +void String16_FormatInteger(struct String *str, int num, u32 ndigits, enum PrintingMode printingMode, BOOL whichCharset); +s64 String_atoi(struct String *str, BOOL *flag); +u16 StringGetLength(struct String *str); +int StringCountLines(volatile struct String *str); +void StringGetLineN(struct String *dest, volatile struct String *src, u32 n); +void CopyU16ArrayToString(struct String *str, u16 *buf); +void CopyStringToU16Array(struct String *str, u16 *buf, u32 length); +u16 *String_c_str(struct String *str); +void StrAddChar(struct String *str, u16 val); +void StringCat(struct String *dest, struct String *src); +void StrUpperFirstChar(struct String *str); +BOOL String_IsTrainerName(struct String *string); +void StringCat_HandleTrainerName(struct String *dest, struct String *src); -#endif //POKEDIAMOND_STRING16_H +#endif // POKEDIAMOND_STRING16_H diff --git a/include/string_control_code.h b/include/string_control_code.h index 79518a40b..06fe5851c 100644 --- a/include/string_control_code.h +++ b/include/string_control_code.h @@ -1,9 +1,11 @@ #ifndef POKEDIAMOND_STRING_CONTROL_CODE_H #define POKEDIAMOND_STRING_CONTROL_CODE_H -const u16 * MsgArray_SkipControlCode(const u16 *arr); +#include "nitro/types.h" + +const u16 *MsgArray_SkipControlCode(const u16 *arr); u32 MsgArray_GetControlCode(const u16 *arr); BOOL MsgArray_ControlCodeIsStrVar(const u16 *arr); u32 MsgArray_ControlCodeGetField(const u16 *arr, u32 fieldno); -#endif //POKEDIAMOND_STRING_CONTROL_CODE_H +#endif // POKEDIAMOND_STRING_CONTROL_CODE_H diff --git a/include/string_util.h b/include/string_util.h index b433e85eb..e35433cc3 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -22,4 +22,4 @@ u16 *StringFill(u16 *dest, u16 value, u32 num); u16 *StringFillEOS(u16 *dest, u32 num); u16 *ConvertUIntToDecimalString(u16 *dest, u32 value, enum PrintingMode mode, u32 n); -#endif //POKEDIAMOND_STRING_UTIL_H +#endif // POKEDIAMOND_STRING_UTIL_H diff --git a/include/task.h b/include/task.h index bb9143e34..727ed0cef 100644 --- a/include/task.h +++ b/include/task.h @@ -1,17 +1,16 @@ #ifndef POKEDIAMOND_TASK_H #define POKEDIAMOND_TASK_H -//#include "script.h" - dirty hack while FieldSystem is still in script.h +// #include "script.h" - dirty hack while FieldSystem is still in script.h #include "main.h" typedef struct TaskManager TaskManager; typedef BOOL (*TaskFunc)(TaskManager *taskManager); -struct FieldSystem; //FIXME: dirty hack +struct FieldSystem; // FIXME: dirty hack -struct TaskManager -{ +struct TaskManager { struct TaskManager *prev; TaskFunc func; u32 state; @@ -23,7 +22,7 @@ struct TaskManager }; extern void LoadOverlay_OVERLAY_05(void *); -extern void sub_020373D4(struct FieldSystem *, struct OverlayManagerTemplate *, void*); +extern void sub_020373D4(struct FieldSystem *, struct OverlayManagerTemplate *, void *); extern BOOL sub_020373AC(void *); extern BOOL sub_0203739C(struct FieldSystem *fieldSystem); extern BOOL sub_020373C4(struct FieldSystem *fieldSystem); @@ -35,13 +34,13 @@ void TaskManager_Call(struct TaskManager *taskManager, TaskFunc taskFunc, void * BOOL sub_02046420(struct TaskManager *taskManager); BOOL sub_0204646C(struct TaskManager *taskManager); BOOL FieldSystem_ApplicationIsRunning(struct FieldSystem *fieldSystem); -void sub_0204649C(void * r0); -BOOL sub_020464A4(void * r0); +void sub_0204649C(void *r0); +BOOL sub_020464A4(void *r0); BOOL sub_020464B8(struct TaskManager *taskManager); void sub_02046500(struct TaskManager *taskManager, u32 r5, u32 r4); -void * TaskManager_GetEnvironment(struct TaskManager *taskManager); -u32 * TaskManager_GetStatePtr(struct TaskManager *taskManager); +void *TaskManager_GetEnvironment(struct TaskManager *taskManager); +u32 *TaskManager_GetStatePtr(struct TaskManager *taskManager); u32 sub_02046534(struct TaskManager *taskManager); struct FieldSystem *TaskManager_GetFieldSystem(struct TaskManager *taskManager); -#endif //POKEDIAMOND_TASK_H +#endif // POKEDIAMOND_TASK_H diff --git a/include/text.h b/include/text.h index b8eafbe3e..0a982cbdc 100644 --- a/include/text.h +++ b/include/text.h @@ -2,62 +2,59 @@ #define POKEDIAMOND_TEXT_H #include "global.h" + #include "bg_window.h" #define MAKE_TEXT_COLOR(fg, sh, bg) ((((fg) & 0xFF) << 16) | (((sh) & 0xFF) << 8) | (((bg) & 0xFF) << 0)) -#define TEXT_SPEED_INSTANT 0 // Transfers to VRAM -#define TEXT_SPEED_NOTRANSFER 0xFF // Defers VRAM transfer +#define TEXT_SPEED_INSTANT 0 // Transfers to VRAM +#define TEXT_SPEED_NOTRANSFER 0xFF // Defers VRAM transfer -union StrbufForPrint -{ - struct String * wrapped; - const u16 * raw; +union StrbufForPrint { + struct String *wrapped; + const u16 *raw; }; -struct TextPrinterTemplate -{ +struct TextPrinterTemplate { union StrbufForPrint currentChar; // 0 - struct Window * window; // 4 - u8 padding[1]; // 8 - u8 fontId; // 9 - u8 x; // a - u8 y; // b - u8 currentX; // c - u8 currentY; // d - u8 letterSpacing; // e - u8 lineSpacing; // f - u8 unk; // 10 - u8 fgColor; // 11 - u8 bgColor; // 12 - u8 shadowColor; // 13 - u16 unk2; // 14 - u8 unk3; // 16 - u8 unk4; // 17 + struct Window *window; // 4 + u8 padding[1]; // 8 + u8 fontId; // 9 + u8 x; // a + u8 y; // b + u8 currentX; // c + u8 currentY; // d + u8 letterSpacing; // e + u8 lineSpacing; // f + u8 unk; // 10 + u8 fgColor; // 11 + u8 bgColor; // 12 + u8 shadowColor; // 13 + u16 unk2; // 14 + u8 unk3; // 16 + u8 unk4; // 17 }; -struct TextPrinter -{ +struct TextPrinter { struct TextPrinterTemplate printerTemplate; u8 (*callback)(struct TextPrinterTemplate *, u16); // 0x18 - u8 subStructFields[7]; // always cast to struct TextPrinterSubStruct... so why bother - // 1c - u8 active; // 23 - u8 state; // 0x24 - u8 textSpeedBottom:7; // 25 - u8 textSpeedTop:1; - u8 delayCounter; // 26 - u8 scrollDistance; // 27 - u8 minLetterSpacing; // 0x28 - u8 Unk29; // used to be japanese, not sure about that anymore + u8 subStructFields[7]; // always cast to struct TextPrinterSubStruct... so why bother + // 1c + u8 active; // 23 + u8 state; // 0x24 + u8 textSpeedBottom : 7; // 25 + u8 textSpeedTop : 1; + u8 delayCounter; // 26 + u8 scrollDistance; // 27 + u8 minLetterSpacing; // 0x28 + u8 Unk29; // used to be japanese, not sure about that anymore u16 Unk2A; u16 *Unk2C; }; -struct FontInfo -{ +struct FontInfo { u8 maxLetterWidth; u8 maxLetterHeight; u8 letterSpacing; @@ -75,9 +72,9 @@ BOOL sub_0201BD44(u8 textPrinterNumber); void ResetAllTextPrinters(void); u8 sub_0201BD70(u8 textPrinterNumber); void sub_0201BD7C(u8 textPrinterNumber); -u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)); -u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16)); -u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinterParameterized(struct Window *window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinterParameterized2(struct Window *window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16)); +u16 AddTextPrinterParameterized3(struct Window *window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16)); u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16)); void RunTextPrinter(u32 param0, struct TextPrinter *printer); u32 RenderFont(struct TextPrinter *printer); @@ -88,4 +85,4 @@ u16 *sub_0201C1B0(void); void sub_0201C1EC(struct TextPrinter *printer, u32 param1, u32 param2, u32 param3); void sub_0201C238(struct TextPrinter *printer); -#endif //POKEDIAMOND_TEXT_H +#endif // POKEDIAMOND_TEXT_H diff --git a/include/text_02054590.h b/include/text_02054590.h index cee9e61e0..3e2d4d4cd 100644 --- a/include/text_02054590.h +++ b/include/text_02054590.h @@ -2,17 +2,17 @@ #define POKEDIAMOND_UNK_02054590_H #include "global.h" -#include "options.h" + #include "bg_window.h" +#include "options.h" #include "string16.h" - void sub_02054590(enum GFPalLoadLocation location, u32 param1); void sub_020545B8(struct BgConfig *param0, struct Window *param1, u32 param2); void sub_02054608(struct Window *param0, struct Options *options); void sub_0205464C(struct Window *param0); -u16 sub_02054658(struct Window * window, struct String *str, struct Options *options, u8 param3); -u16 DrawFieldMessage(struct Window * window, struct String *str, u8 fontId, u32 speed, u8 a4, s32 a5); +u16 sub_02054658(struct Window *window, struct String *str, struct Options *options, u8 param3); +u16 DrawFieldMessage(struct Window *window, struct String *str, u8 fontId, u32 speed, u8 a4, s32 a5); u8 sub_020546C8(u8 textPrinterNumber); void sub_020546E0(struct BgConfig *param0, struct Window *param1, u32 param2, u32 param3); void sub_02054744(struct Window *param0, u32 param1, u16 param2); diff --git a/include/timer3.h b/include/timer3.h index a49cf3e60..67454bd82 100644 --- a/include/timer3.h +++ b/include/timer3.h @@ -1,7 +1,6 @@ #ifndef POKEDIAMOND_TIMER3_H #define POKEDIAMOND_TIMER3_H - #include "global.h" void Init_Timer3(); @@ -11,5 +10,4 @@ u64 GetTimer3Count(); u64 Timer3CountToMilliSeconds(u64 count); u64 Timer3CountToSeconds(u64 count); - -#endif //POKEDIAMOND_TIMER3_H +#endif // POKEDIAMOND_TIMER3_H diff --git a/include/trainer_data.h b/include/trainer_data.h index 70abab9d1..1ba141301 100644 --- a/include/trainer_data.h +++ b/include/trainer_data.h @@ -2,36 +2,34 @@ #define POKEDIAMOND_TRAINER_DATA_H #include "global.h" -#include "save.h" -#include "string16.h" + #include "constants/pokemon.h" + #include "heap.h" +#include "save.h" +#include "string16.h" -struct TrainerMonSpecies -{ +struct TrainerMonSpecies { u16 difficulty; u16 level; u16 species; }; -struct TrainerMonSpeciesMoves -{ +struct TrainerMonSpeciesMoves { u16 difficulty; u16 level; u16 species; u16 moves[MAX_MON_MOVES]; }; -struct TrainerMonSpeciesItem -{ +struct TrainerMonSpeciesItem { u16 difficulty; u16 level; u16 species; u16 item; }; -struct TrainerMonSpeciesItemMoves -{ +struct TrainerMonSpeciesItemMoves { u16 difficulty; u16 level; u16 species; @@ -39,21 +37,19 @@ struct TrainerMonSpeciesItemMoves u16 moves[MAX_MON_MOVES]; }; -union TrainerMon -{ +union TrainerMon { struct TrainerMonSpecies species; struct TrainerMonSpeciesMoves species_moves; struct TrainerMonSpeciesItem species_item; struct TrainerMonSpeciesItemMoves species_item_moves; }; -#define TRTYPE_MON 0 -#define TRTYPE_MON_MOVES 1 -#define TRTYPE_MON_ITEM 2 +#define TRTYPE_MON 0 +#define TRTYPE_MON_MOVES 1 +#define TRTYPE_MON_ITEM 2 #define TRTYPE_MON_ITEM_MOVES 3 -typedef struct TrainerData -{ +typedef struct TrainerData { u8 trainerType; u8 trainerClass; u8 unk_2; @@ -63,8 +59,7 @@ typedef struct TrainerData u32 doubleBattle; } TrainerData; -typedef struct Trainer -{ +typedef struct Trainer { struct TrainerData data; u16 name[PLAYER_NAME_LENGTH + 1]; u8 padding[16]; @@ -72,13 +67,13 @@ typedef struct Trainer typedef struct BattleSetup BattleSetup; -void EnemyTrainerSet_Init(BattleSetup *setup, struct SaveData * r4, HeapID heapId); +void EnemyTrainerSet_Init(BattleSetup *setup, struct SaveData *r4, HeapID heapId); s32 TrainerData_GetAttr(u32 tr_idx, u32 attr_no); BOOL TrainerMessageWithIdPairExists(u32 pos, u32 idx, HeapID heapId); -void GetTrainerMessageByIdPair(u32 pos, u32 idx, struct String * str, HeapID heapId); -void TrainerData_ReadTrData(u32 idx, struct TrainerData * dest); -void TrainerData_ReadTrPoke(u32 idx, union TrainerMon * dest); +void GetTrainerMessageByIdPair(u32 pos, u32 idx, struct String *str, HeapID heapId); +void TrainerData_ReadTrData(u32 idx, struct TrainerData *dest); +void TrainerData_ReadTrPoke(u32 idx, union TrainerMon *dest); int TrainerClass_GetGenderOrTrainerCount(int a0); void CreateNPCTrainerParty(BattleSetup *setup, s32 party_id, HeapID heapId); -#endif //POKEDIAMOND_TRAINER_DATA_H +#endif // POKEDIAMOND_TRAINER_DATA_H diff --git a/include/unk_020040F4.h b/include/unk_020040F4.h index 84bb02dc5..ed0b1b6d1 100644 --- a/include/unk_020040F4.h +++ b/include/unk_020040F4.h @@ -2,16 +2,15 @@ #define POKEDIAMOND_UNK_020040F4_H #include "global.h" + #include "SPI_mic.h" #include "heap.h" -struct WaveArcInfo -{ +struct WaveArcInfo { u32 unk00 : 24; }; -struct UnkStruct_020040F4_1 -{ +struct UnkStruct_020040F4_1 { void *unk00; u32 unk04; void *unk08; @@ -24,8 +23,7 @@ struct UnkStruct_020040F4_1 s32 unk24; }; -struct UnkStruct_020040F4_2 -{ +struct UnkStruct_020040F4_2 { u32 unk00; u32 unk04; u32 unk08; diff --git a/include/unk_020051F4.h b/include/unk_020051F4.h index e5cb21d9f..909e9bf7f 100644 --- a/include/unk_020051F4.h +++ b/include/unk_020051F4.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_020051F4_H #include "global.h" + #include "heap.h" #include "unk_0200CA44.h" @@ -43,4 +44,4 @@ void sub_02005CA0(u32 param0); BOOL sub_02005CBC(); void sub_02005CEC(u16 param0); -#endif //POKEDIAMOND_UNK_020051F4_H +#endif // POKEDIAMOND_UNK_020051F4_H diff --git a/include/unk_020061E8.h b/include/unk_020061E8.h index b0a988efd..9eda6b2c0 100644 --- a/include/unk_020061E8.h +++ b/include/unk_020061E8.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_020061E8_H #include "nitro/types.h" + #include "text.h" #include "unk_0200CA44.h" diff --git a/include/unk_02006D98.h b/include/unk_02006D98.h index 594944704..6b39b11ab 100644 --- a/include/unk_02006D98.h +++ b/include/unk_02006D98.h @@ -2,11 +2,11 @@ #define POKEDIAMOND_UNK_02006D98_H #include "global.h" + #include "NNS_g2d.h" #include "heap.h" -struct UnkStruct_02006D98_4 -{ +struct UnkStruct_02006D98_4 { u16 field_00; u16 field_02; u16 field_04; @@ -15,13 +15,11 @@ struct UnkStruct_02006D98_4 u32 field_0C; }; -struct UnkStruct_02006D98_sub -{ +struct UnkStruct_02006D98_sub { s8 unk0; u8 unk1; }; -struct UnkStruct_02006D98_sub2 -{ +struct UnkStruct_02006D98_sub2 { u16 unk0_0 : 2; u16 unk0_2 : 1; u16 unk0_3 : 1; @@ -35,8 +33,7 @@ struct UnkStruct_02006D98_sub2 s16 unka; }; -struct UnkStruct_02006D98_2 -{ +struct UnkStruct_02006D98_2 { u32 unk00_0 : 1; u32 unk00_1 : 6; u32 unk00_7 : 1; @@ -66,22 +63,22 @@ struct UnkStruct_02006D98_2 u8 unk4A; u8 unk4B; u32 unk4C; - u32 unk50_0 : 5; - u32 unk50_5 : 5; - u32 unk50_a : 5; - u32 unk50_f : 5; + u32 unk50_0 : 5; + u32 unk50_5 : 5; + u32 unk50_a : 5; + u32 unk50_f : 5; u32 unk50_14 : 5; u32 unk50_19 : 5; u32 unk50_1E : 2; - u32 unk54_0 : 1; - u32 unk54_1 : 1; - u32 unk54_2 : 5; - u32 unk54_7 : 2; - u32 unk54_9 : 1; - u32 unk54_A : 1; - u32 unk54_B : 1; - u32 unk54_C : 1; - u32 unk54_D : 4; + u32 unk54_0 : 1; + u32 unk54_1 : 1; + u32 unk54_2 : 5; + u32 unk54_7 : 2; + u32 unk54_9 : 1; + u32 unk54_A : 1; + u32 unk54_B : 1; + u32 unk54_C : 1; + u32 unk54_D : 4; u8 unk58; u8 unk59; u8 unk5A; @@ -93,8 +90,7 @@ struct UnkStruct_02006D98_2 struct UnkStruct_02006D98_sub unk84[10]; }; -struct UnkStruct_02006D98 -{ +struct UnkStruct_02006D98 { struct UnkStruct_02006D98_2 unk000[4]; NNSG2dImageProxy unk260; NNSG2dImagePaletteProxy unk284; @@ -115,15 +111,12 @@ struct UnkStruct_02006D98 u32 unk2E4; }; -struct UnkStruct_02006D98_3 -{ +struct UnkStruct_02006D98_3 { u8 unk0; u8 unk1; }; - -struct UnkStruct_02006D98_5 -{ +struct UnkStruct_02006D98_5 { u8 unk00; u8 unk01; u8 unk02; diff --git a/include/unk_02008AA4.h b/include/unk_02008AA4.h index eb4af2dcd..3176ed048 100644 --- a/include/unk_02008AA4.h +++ b/include/unk_02008AA4.h @@ -2,16 +2,15 @@ #define POKEDIAMOND_UNK_02008AA4_H #include "global.h" + #include "unk_0200BB14.h" -struct UnkStruct_02008AA4_1 -{ +struct UnkStruct_02008AA4_1 { struct UnkStruct_0200BB14_sub *unk00; s32 unk04; }; -struct UnkStruct_02008AA4_2 -{ +struct UnkStruct_02008AA4_2 { s32 unk00; s32 unk04; s32 unk08; diff --git a/include/unk_02008DEC.h b/include/unk_02008DEC.h index 73e7bbb8f..9a64cfbe2 100644 --- a/include/unk_02008DEC.h +++ b/include/unk_02008DEC.h @@ -2,18 +2,17 @@ #define POKEDIAMOND_UNK_02008DEC_H #include "global.h" + #include "NNS_g2d.h" #include "filesystem.h" -struct UnkStruct_02008DEC_sub -{ +struct UnkStruct_02008DEC_sub { u32 unk00; u32 unk04; void *unk08; }; -struct UnkStruct_02008DEC_1 -{ +struct UnkStruct_02008DEC_1 { u32 unk00; struct UnkStruct_02008DEC_sub *unk04; @@ -22,10 +21,8 @@ struct UnkStruct_02008DEC_1 s32 unk10; }; -struct UnkStruct_02008DEC_2 -{ - union - { +struct UnkStruct_02008DEC_2 { + union { struct UnkStruct_02008DEC_3 *unk00_3; struct UnkStruct_02008DEC_4 *unk00_4; }; @@ -34,16 +31,14 @@ struct UnkStruct_02008DEC_2 u8 unk0C; }; -struct UnkStruct_02008DEC_3 -{ +struct UnkStruct_02008DEC_3 { s32 unk00; u8 unk04[0x40]; u32 unk44; u32 unk48; }; -struct UnkStruct_02008DEC_4 -{ +struct UnkStruct_02008DEC_4 { NarcId unk00; s32 unk04; BOOL unk08; @@ -52,33 +47,28 @@ struct UnkStruct_02008DEC_4 u32 unk14; }; -struct UnkStruct_02008DEC_5 -{ +struct UnkStruct_02008DEC_5 { struct UnkStruct_02008DEC_sub **unk00; s32 unk04; s32 unk08; }; -struct CharacterData_02008DEC -{ +struct CharacterData_02008DEC { NNSG2dCharacterData *chData; u32 unk04; }; -struct PaletteData_02008DEC -{ +struct PaletteData_02008DEC { NNSG2dPaletteData *plttData; u32 unk04; u32 unk08; }; -struct CellDataBank_02008DEC -{ +struct CellDataBank_02008DEC { NNSG2dCellDataBank *cellBank; }; -struct AnimBank_02008DEC -{ +struct AnimBank_02008DEC { NNSG2dAnimBankData *bankData; }; diff --git a/include/unk_0200BA78.h b/include/unk_0200BA78.h index 0ffdd4644..ac4953088 100644 --- a/include/unk_0200BA78.h +++ b/include/unk_0200BA78.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_0200BA78_H #include "global.h" + #include "message_format.h" void sub_0200BA78(struct UnkStruct_0200B870 *param0, diff --git a/include/unk_0200BB14.h b/include/unk_0200BB14.h index 9e87f2570..3df663a68 100644 --- a/include/unk_0200BB14.h +++ b/include/unk_0200BB14.h @@ -2,10 +2,10 @@ #define POKEDIAMOND_UNK_0200BB14_H #include "global.h" + #include "unk_02008DEC.h" -struct UnkStruct_0200BB14_1 -{ +struct UnkStruct_0200BB14_1 { HeapID heapId; u32 unk004; u32 unk008; @@ -13,8 +13,7 @@ struct UnkStruct_0200BB14_1 u8 unk010[0x128]; }; -struct UnkStruct_0200BB14_2 -{ +struct UnkStruct_0200BB14_2 { u32 unk00; struct UnkStruct_02008AA4_1 *unk04; struct UnkStruct_02008DEC_2 *unk08; @@ -24,8 +23,7 @@ struct UnkStruct_0200BB14_2 s32 unk54; }; -struct UnkStruct_0200BB14_3 -{ +struct UnkStruct_0200BB14_3 { u32 unk00; s16 unk04; s16 unk06; @@ -40,8 +38,7 @@ struct UnkStruct_0200BB14_3 u32 unk24; }; -struct UnkStruct_0200BB14_sub -{ +struct UnkStruct_0200BB14_sub { u32 unk00; u32 unk04; u32 unk08; @@ -54,8 +51,7 @@ struct UnkStruct_0200BB14_sub u8 unk21[0x3]; }; -struct UnkStruct_0200BB14_4 -{ +struct UnkStruct_0200BB14_4 { u32 unk00; struct UnkStruct_0200BB14_sub *unk04; s32 unk08; @@ -70,13 +66,11 @@ struct UnkStruct_0200BB14_4 u32 unk2c; }; -struct UnkStruct_0200BB14_6 -{ +struct UnkStruct_0200BB14_6 { struct UnkStruct_0200BB14_sub *unk0; u32 unk4; }; -struct UnkStruct_0200BB14_5 -{ +struct UnkStruct_0200BB14_5 { u32 unk00; struct UnkStruct_0200BB14_sub *unk04; struct UnkStruct_0200BB14_6 *unk08; diff --git a/include/unk_0200CA44.h b/include/unk_0200CA44.h index 53a9e7efb..c887e244c 100644 --- a/include/unk_0200CA44.h +++ b/include/unk_0200CA44.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_UNK_0200CA44_H #define POKEDIAMOND_UNK_0200CA44_H -//TODO: sys_task_api.h +// TODO: sys_task_api.h #include "text.h" @@ -9,14 +9,14 @@ typedef struct SysTask SysTask; typedef void (*SysTaskFunc)(SysTask *task, void *data); -struct SysTask { //todo move to sys_task.h - u8 padding[0x1C]; //todo fill in +struct SysTask { // todo move to sys_task.h + u8 padding[0x1C]; // todo fill in }; SysTask *SysTask_CreateOnMainQueue(SysTaskFunc func, void *data, u32 priority); -BOOL sub_0200CA60(void (*r0)(u32, void *), void * r1, u32 r2); -BOOL sub_0200CA7C(void (*r0)(u32, void *), void * r1, u32 r2); -BOOL sub_0200CA98(void (*r0)(u32, void *), void * r1, u32 r2); +BOOL sub_0200CA60(void (*r0)(u32, void *), void *r1, u32 r2); +BOOL sub_0200CA7C(void (*r0)(u32, void *), void *r1, u32 r2); +BOOL sub_0200CA98(void (*r0)(u32, void *), void *r1, u32 r2); void sub_0200CAB4(s32 unk1); -#endif //POKEDIAMOND_UNK_0200CA44_H +#endif // POKEDIAMOND_UNK_0200CA44_H diff --git a/include/unk_02015CC0.h b/include/unk_02015CC0.h index abb1c7ca3..2fefe7d43 100644 --- a/include/unk_02015CC0.h +++ b/include/unk_02015CC0.h @@ -1,8 +1,10 @@ #ifndef POKEDIAMOND_UNK_02015CC0_H #define POKEDIAMOND_UNK_02015CC0_H +#include "nitro/types.h" + int sub_02015CC0(u16 a0); int sub_02015CE0(u16 a0); int sub_02015CF8(int a0, int a1); -#endif //POKEDIAMOND_UNK_02015CC0_H +#endif // POKEDIAMOND_UNK_02015CC0_H diff --git a/include/unk_0201B4E8.h b/include/unk_0201B4E8.h index 3520a2f00..fc41d6107 100644 --- a/include/unk_0201B4E8.h +++ b/include/unk_0201B4E8.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_UNK_0201B4E8_H #define POKEDIAMOND_UNK_0201B4E8_H -void * sub_0201B580(u32, void *); +void *sub_0201B580(u32, void *); u32 sub_0201B578(u32); -#endif //POKEDIAMOND_UNK_0201B4E8_H +#endif // POKEDIAMOND_UNK_0201B4E8_H diff --git a/include/unk_0201CBEC.h b/include/unk_0201CBEC.h index 1edd5f7b9..750caed6a 100644 --- a/include/unk_0201CBEC.h +++ b/include/unk_0201CBEC.h @@ -1,6 +1,8 @@ #ifndef POKEDIAMOND_UNK_0201CBEC_H #define POKEDIAMOND_UNK_0201CBEC_H +#include "nitro/types.h" + s32 sub_0201CBEC(s32 a0, s32 a1, s32 a2, s32 a3); -#endif //POKEDIAMOND_UNK_0201CBEC_H +#endif // POKEDIAMOND_UNK_0201CBEC_H diff --git a/include/unk_02021590.h b/include/unk_02021590.h index c89cbff4c..c037044a2 100644 --- a/include/unk_02021590.h +++ b/include/unk_02021590.h @@ -4,8 +4,7 @@ #include "filesystem.h" #include "font.h" -struct FontGraphicHeader -{ +struct FontGraphicHeader { u32 headerSize; u32 widthDataStart; u32 numGlyphs; @@ -15,40 +14,39 @@ struct FontGraphicHeader u8 glyphHeight; }; -struct FontData -{ +struct FontData { u32 glyphAccessMode; void (*uncompGlyphFunc)(struct FontData *, u16, struct UnkStruct_02002C14_sub *); u32 glyphShape; u32 glyphSize; - void * narcReadBuf; + void *narcReadBuf; u8 glyphReadBuf[0x40]; - NARC * narc; + NARC *narc; u32 fileId; struct FontGraphicHeader gfxHeader; BOOL isFixedWidthFont; int (*glyphWidthFunc)(struct FontData *, int); - u8 * glyphWidths; + u8 *glyphWidths; }; struct FontData *FontData_New(NarcId narcId, s32 fileId, u32 unk2, BOOL unk3, HeapID heapId); -void FontData_Delete(struct FontData * ptr); -void FontData_ModeSwitch(struct FontData * ptr, u32 a1, HeapID heapId); +void FontData_Delete(struct FontData *ptr); +void FontData_ModeSwitch(struct FontData *ptr, u32 a1, HeapID heapId); void FontData_Init(struct FontData *ptr, NarcId narcId, s32 fileId, BOOL unk, HeapID heapId); -void FontData_FreeWidthsAndNarc(struct FontData * ptr); -void InitFontResources(struct FontData * ptr, u32 a1, HeapID heapId); -void InitFontResources_FromPreloaded(struct FontData * ptr, HeapID heapId); -void InitFontResources_LazyFromNarc(struct FontData * ptr, HeapID heapId); -void FreeLoadedFontResources(struct FontData * ptr); -void FreeLoadedFontResources_FromPreloaded(struct FontData * ptr); -void FreeLoadedFontResources_LazyFromNarc(struct FontData * ptr); -void TryLoadGlyph(struct FontData * ptr, u32 param1, struct UnkStruct_02002C14_sub * ptr2); -void DecompressGlyphTiles_FromPreloaded(struct FontData * ptr, u16 param1, struct UnkStruct_02002C14_sub * param2); -void DecompressGlyphTiles_LazyFromNarc(struct FontData * ptr, u16 param1, struct UnkStruct_02002C14_sub * param2); -u32 GetStringWidth(struct FontData * ptr, const u16 * str, u32 letterSpacing); -int GetGlyphWidth_VariableWidth(struct FontData * ptr, int a1); -int GetGlyphWidth_FixedWidth(struct FontData * ptr, int a1); -s32 GetStringWidthMultiline(struct FontData * r7, const u16 * arr, u32 r6); -s32 StringGetWidth_SingleLine_HandleClearToControlCode(struct FontData * r6, const u16 * arr); +void FontData_FreeWidthsAndNarc(struct FontData *ptr); +void InitFontResources(struct FontData *ptr, u32 a1, HeapID heapId); +void InitFontResources_FromPreloaded(struct FontData *ptr, HeapID heapId); +void InitFontResources_LazyFromNarc(struct FontData *ptr, HeapID heapId); +void FreeLoadedFontResources(struct FontData *ptr); +void FreeLoadedFontResources_FromPreloaded(struct FontData *ptr); +void FreeLoadedFontResources_LazyFromNarc(struct FontData *ptr); +void TryLoadGlyph(struct FontData *ptr, u32 param1, struct UnkStruct_02002C14_sub *ptr2); +void DecompressGlyphTiles_FromPreloaded(struct FontData *ptr, u16 param1, struct UnkStruct_02002C14_sub *param2); +void DecompressGlyphTiles_LazyFromNarc(struct FontData *ptr, u16 param1, struct UnkStruct_02002C14_sub *param2); +u32 GetStringWidth(struct FontData *ptr, const u16 *str, u32 letterSpacing); +int GetGlyphWidth_VariableWidth(struct FontData *ptr, int a1); +int GetGlyphWidth_FixedWidth(struct FontData *ptr, int a1); +s32 GetStringWidthMultiline(struct FontData *r7, const u16 *arr, u32 r6); +s32 StringGetWidth_SingleLine_HandleClearToControlCode(struct FontData *r6, const u16 *arr); -#endif //POKEDIAMOND_UNK_02021590_H +#endif // POKEDIAMOND_UNK_02021590_H diff --git a/include/unk_02021FF8.h b/include/unk_02021FF8.h index 536009653..98af00e1c 100644 --- a/include/unk_02021FF8.h +++ b/include/unk_02021FF8.h @@ -1,28 +1,30 @@ #ifndef POKEDIAMOND_UNK_02021FF8_H #define POKEDIAMOND_UNK_02021FF8_H -struct UnkStruct_020220C4_sub -{ +#include "nitro/types.h" + +#include "heap.h" + +struct UnkStruct_020220C4_sub { u8 field_0; u8 field_1; u16 field_2; }; -struct UnkStruct_020220C4 -{ - u8 * field_0; +struct UnkStruct_020220C4 { + u8 *field_0; u32 field_4; void (*field_8)(s32, s32, u32); u32 field_C; - struct UnkStruct_020220C4_sub * field_10; + struct UnkStruct_020220C4_sub *field_10; }; -struct UnkStruct_020220C4 * sub_020220C4(u8 * a0, u32 a1, void (*a2)(s32, s32, u32), u32 a3, HeapID heapId); -void sub_02022120(struct UnkStruct_020220C4_sub * sub); -void sub_0202212C(struct UnkStruct_020220C4 * unk); -void sub_02022144(struct UnkStruct_020220C4 * unk); -s32 sub_020221EC(struct UnkStruct_020220C4_sub * a0, u32 a1, u32 a2); -s32 sub_02022208(struct UnkStruct_020220C4_sub * a0, u32 a1, u32 a2); -void sub_0202223C(struct UnkStruct_020220C4_sub * a0, u8 a1); +struct UnkStruct_020220C4 *sub_020220C4(u8 *a0, u32 a1, void (*a2)(s32, s32, u32), u32 a3, HeapID heapId); +void sub_02022120(struct UnkStruct_020220C4_sub *sub); +void sub_0202212C(struct UnkStruct_020220C4 *unk); +void sub_02022144(struct UnkStruct_020220C4 *unk); +s32 sub_020221EC(struct UnkStruct_020220C4_sub *a0, u32 a1, u32 a2); +s32 sub_02022208(struct UnkStruct_020220C4_sub *a0, u32 a1, u32 a2); +void sub_0202223C(struct UnkStruct_020220C4_sub *a0, u8 a1); -#endif //POKEDIAMOND_UNK_02021FF8_H +#endif // POKEDIAMOND_UNK_02021FF8_H diff --git a/include/unk_020222E8.h b/include/unk_020222E8.h index e781c9ea7..234cf4b9e 100644 --- a/include/unk_020222E8.h +++ b/include/unk_020222E8.h @@ -1,11 +1,13 @@ #ifndef POKEDIAMOND_UNK_020222E8_H #define POKEDIAMOND_UNK_020222E8_H -void * sub_020222E8(); +#include "nitro/types.h" + +void *sub_020222E8(); u32 sub_020222F0(); -void * sub_020222F8(); +void *sub_020222F8(); u32 sub_02022300(); -void * sub_02022308(); -void * sub_02022310(); +void *sub_02022308(); +void *sub_02022310(); #endif // POKEDIAMOND_UNK_020222E8_H diff --git a/include/unk_02022450.h b/include/unk_02022450.h index c68a42ec0..c0300f0f8 100644 --- a/include/unk_02022450.h +++ b/include/unk_02022450.h @@ -1,6 +1,8 @@ #ifndef POKEDIAMOND_UNK_02022450_H #define POKEDIAMOND_UNK_02022450_H +#include "nitro/types.h" + struct CARD_Header { u8 title[12]; u32 tid; @@ -13,6 +15,6 @@ struct CARD_Header { }; void sub_02022450(); -void Reset_To_File(const char* path); +void Reset_To_File(const char *path); -#endif //POKEDIAMOND_UNK_02022450_H +#endif // POKEDIAMOND_UNK_02022450_H diff --git a/include/unk_02022504.h b/include/unk_02022504.h index 4f6fa6cf6..78ea888ba 100644 --- a/include/unk_02022504.h +++ b/include/unk_02022504.h @@ -2,16 +2,16 @@ #define POKEDIAMOND_UNK_02022504_H #include "hall_of_fame.h" +#include "pokemon_storage_system.h" #include "safari_zone.h" #include "save.h" -#include "pokemon_storage_system.h" #include "unk_0202AC20.h" SafariZone *Save_SafariZone_Get(struct SaveData *save); struct PCStorage *SaveArray_PCStorage_Get(struct SaveData *save); -struct UnkStruct_0202AC20 * sub_0202251C(struct SaveData *save); +struct UnkStruct_0202AC20 *sub_0202251C(struct SaveData *save); void *sub_02022528(struct SaveData *save); HallOfFame *LoadHallOfFame(struct SaveData *save, HeapID heapId, int *ret_p); s32 SaveHallOfFame(struct SaveData *save, HallOfFame *data); -#endif //POKEDIAMOND_UNK_02022504_H +#endif // POKEDIAMOND_UNK_02022504_H diff --git a/include/unk_02024E64.h b/include/unk_02024E64.h index 1f84cd49d..be1c53b20 100644 --- a/include/unk_02024E64.h +++ b/include/unk_02024E64.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_02024E64_H #include "global.h" + #include "MI_memory.h" #include "save.h" #include "string16.h" diff --git a/include/unk_02025484.h b/include/unk_02025484.h index 517c39a2a..f937bdc22 100644 --- a/include/unk_02025484.h +++ b/include/unk_02025484.h @@ -1,8 +1,9 @@ #ifndef POKEDIAMOND_UNK_02025484_H #define POKEDIAMOND_UNK_02025484_H -struct unk_2025484 -{ +#include "nitro/types.h" + +struct unk_2025484 { // size: 0x24 u32 unk0; u32 unk4; @@ -15,4 +16,3 @@ u32 *sub_020254A0(struct unk_2025484 *r0, u32 r1); u32 sub_020254B4(struct unk_2025484 *r0); #endif POKEDIAMOND_UNK_02025484_H - diff --git a/include/unk_020254B8.h b/include/unk_020254B8.h index 4c7353b87..8dedc5dea 100644 --- a/include/unk_020254B8.h +++ b/include/unk_020254B8.h @@ -1,8 +1,12 @@ #ifndef POKEDIAMOND_UNK_020254B8_H #define POKEDIAMOND_UNK_020254B8_H -struct UnkStruct_020254B8 -{ +#include "nitro/types.h" + +#include "heap.h" +#include "save.h" + +struct UnkStruct_020254B8 { u16 field_00[8]; u32 field_10; u8 filler_14[4]; @@ -12,12 +16,12 @@ struct UnkStruct_020254B8 }; u32 sub_020254B8(void); -struct UnkStruct_020254B8 * sub_020254C0(struct SaveData * save); -void sub_020254CC(struct UnkStruct_020254B8 * arr); -u16 * sub_020254F0(struct UnkStruct_020254B8 * arr, s32 i); -u8 sub_020254F8(struct UnkStruct_020254B8 * unk, s32 i); -BOOL sub_02025500(struct UnkStruct_020254B8 * a, struct UnkStruct_020254B8 * b); -void sub_02025520(struct UnkStruct_020254B8 * sp0, struct UnkStruct_020254B8 * sp4, s32 n, HeapID heapId); -s32 sub_02025614(struct UnkStruct_020254B8 * a0, u32 a1); +struct UnkStruct_020254B8 *sub_020254C0(struct SaveData *save); +void sub_020254CC(struct UnkStruct_020254B8 *arr); +u16 *sub_020254F0(struct UnkStruct_020254B8 *arr, s32 i); +u8 sub_020254F8(struct UnkStruct_020254B8 *unk, s32 i); +BOOL sub_02025500(struct UnkStruct_020254B8 *a, struct UnkStruct_020254B8 *b); +void sub_02025520(struct UnkStruct_020254B8 *sp0, struct UnkStruct_020254B8 *sp4, s32 n, HeapID heapId); +s32 sub_02025614(struct UnkStruct_020254B8 *a0, u32 a1); -#endif //POKEDIAMOND_UNK_020254B8_H +#endif // POKEDIAMOND_UNK_020254B8_H diff --git a/include/unk_020286F8.h b/include/unk_020286F8.h index 7791d4f57..2f732bd59 100644 --- a/include/unk_020286F8.h +++ b/include/unk_020286F8.h @@ -1,8 +1,12 @@ #ifndef POKEDIAMOND_UNK_020286F8_H #define POKEDIAMOND_UNK_020286F8_H -struct UnkSaveStruct_020286F8 -{ +#include "nitro/types.h" + +#include "save.h" +#include "string16.h" + +struct UnkSaveStruct_020286F8 { u16 unk_0[8]; u16 unk_10[8]; u8 unk_20; @@ -13,23 +17,23 @@ struct UnkSaveStruct_020286F8 }; u32 sub_020286F8(void); -void sub_02028700(struct UnkSaveStruct_020286F8 * ptr, int a, int b); -void sub_02028724(struct UnkSaveStruct_020286F8 * ptr); -void sub_02028754(struct UnkSaveStruct_020286F8 * ptr, u32 n); -u32 sub_0202877C(struct UnkSaveStruct_020286F8 * ptr, u32 i); -void sub_02028788(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j); -u32 sub_020287A4(struct UnkSaveStruct_020286F8 * ptr); -u16 * sub_020287A8(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j); -void sub_020287C0(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j, struct String * k); -void sub_020287EC(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j); -u8 sub_020287F8(struct UnkSaveStruct_020286F8 * ptr, u32 i); -u8 sub_02028804(struct UnkSaveStruct_020286F8 * ptr, u32 i); -void sub_02028810(struct UnkSaveStruct_020286F8 * ptr, u32 i, u32 j); -struct UnkSaveStruct_020286F8 * sub_0202881C(struct SaveData * save); -BOOL sub_02028828(struct UnkSaveStruct_020286F8 * ptr, u32 i); -BOOL sub_02028840(struct UnkSaveStruct_020286F8 * ptr, int i); -BOOL sub_02028854(struct UnkSaveStruct_020286F8 * ptr, const u16 * str); -BOOL sub_0202888C(struct UnkSaveStruct_020286F8 * ptr); -BOOL sub_020288AC(struct UnkSaveStruct_020286F8 * ptr, struct UnkSaveStruct_020286F8 * ptr2); +void sub_02028700(struct UnkSaveStruct_020286F8 *ptr, int a, int b); +void sub_02028724(struct UnkSaveStruct_020286F8 *ptr); +void sub_02028754(struct UnkSaveStruct_020286F8 *ptr, u32 n); +u32 sub_0202877C(struct UnkSaveStruct_020286F8 *ptr, u32 i); +void sub_02028788(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j); +u32 sub_020287A4(struct UnkSaveStruct_020286F8 *ptr); +u16 *sub_020287A8(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j); +void sub_020287C0(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j, struct String *k); +void sub_020287EC(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j); +u8 sub_020287F8(struct UnkSaveStruct_020286F8 *ptr, u32 i); +u8 sub_02028804(struct UnkSaveStruct_020286F8 *ptr, u32 i); +void sub_02028810(struct UnkSaveStruct_020286F8 *ptr, u32 i, u32 j); +struct UnkSaveStruct_020286F8 *sub_0202881C(struct SaveData *save); +BOOL sub_02028828(struct UnkSaveStruct_020286F8 *ptr, u32 i); +BOOL sub_02028840(struct UnkSaveStruct_020286F8 *ptr, int i); +BOOL sub_02028854(struct UnkSaveStruct_020286F8 *ptr, const u16 *str); +BOOL sub_0202888C(struct UnkSaveStruct_020286F8 *ptr); +BOOL sub_020288AC(struct UnkSaveStruct_020286F8 *ptr, struct UnkSaveStruct_020286F8 *ptr2); -#endif //POKEDIAMOND_UNK_020286F8_H +#endif // POKEDIAMOND_UNK_020286F8_H diff --git a/include/unk_02029FB0.h b/include/unk_02029FB0.h index 7c18daa72..0d20c9bc6 100644 --- a/include/unk_02029FB0.h +++ b/include/unk_02029FB0.h @@ -1,28 +1,28 @@ #ifndef POKEDIAMOND_UNK_02029FB0_H #define POKEDIAMOND_UNK_02029FB0_H -struct Pokedex; +#include "pokedex.h" +#include "save.h" -typedef struct GameStats -{ +typedef struct GameStats { u32 unk_00[0x2C]; u16 unk_B0[0x4D]; } GameStats; u32 Save_GameStats_sizeof(void); -void Save_GameStats_Init(struct GameStats * ptr); -struct GameStats * Save_GameStats_Get(struct SaveData * save); -u32 GameStats_GetValue(struct GameStats * ptr, s32 a1); -u32 GameStats_SetValue(struct GameStats * ptr, s32 a1, u32 a2); +void Save_GameStats_Init(struct GameStats *ptr); +struct GameStats *Save_GameStats_Get(struct SaveData *save); +u32 GameStats_GetValue(struct GameStats *ptr, s32 a1); +u32 GameStats_SetValue(struct GameStats *ptr, s32 a1, u32 a2); u32 GameStats_GetMaxValue(s32 a0); u16 GameStats_GetStdInc(s32 a0); -u32 GameStats_SetCapped(struct GameStats * ptr, s32 a1, u32 a2); -u32 GameStats_UpdateBounded(struct GameStats * ptr, s32 a1, u32 a2); -u32 GameStats_Inc(struct GameStats * ptr, s32 a1); -u32 GameStats_Add(struct GameStats * ptr, s32 a1, u32 a2); -u32 GameStats_GetCapped(struct GameStats * ptr, s32 a1); -u32 GameStats_AddSpecial(struct GameStats * ptr, s32 a1); -u32 GameStats_GetStat0(struct GameStats * ptr); -void GameStats_IncSpeciesCaught(struct GameStats * ptr, struct Pokedex * pokedex, u16 species); +u32 GameStats_SetCapped(struct GameStats *ptr, s32 a1, u32 a2); +u32 GameStats_UpdateBounded(struct GameStats *ptr, s32 a1, u32 a2); +u32 GameStats_Inc(struct GameStats *ptr, s32 a1); +u32 GameStats_Add(struct GameStats *ptr, s32 a1, u32 a2); +u32 GameStats_GetCapped(struct GameStats *ptr, s32 a1); +u32 GameStats_AddSpecial(struct GameStats *ptr, s32 a1); +u32 GameStats_GetStat0(struct GameStats *ptr); +void GameStats_IncSpeciesCaught(struct GameStats *ptr, struct Pokedex *pokedex, u16 species); -#endif //POKEDIAMOND_UNK_02029FB0_H +#endif // POKEDIAMOND_UNK_02029FB0_H diff --git a/include/unk_0202A1E0.h b/include/unk_0202A1E0.h index 104170cf1..ec4858c13 100644 --- a/include/unk_0202A1E0.h +++ b/include/unk_0202A1E0.h @@ -4,8 +4,7 @@ #include "mail_message.h" #include "save.h" -typedef enum -{ +typedef enum { DATA_GET = 0, DATA_SET, DATA_RESET, @@ -13,11 +12,9 @@ typedef enum DATA_DECREMENT, DATA_ADD, DATA_SUBSTRACT -} -DataSetMode; +} DataSetMode; -typedef enum -{ +typedef enum { FIELD_0x0_2 = 0, FIELD_0x2, FIELD_0x3, @@ -28,16 +25,14 @@ typedef enum FIELD_flag0, FIELD_0xC, FIELD_0x0_5, - FIELD_0x28, -} -SaveStruct23_Substruct1_Field; + FIELD_0x28, +} SaveStruct23_Substruct1_Field; -struct SaveStruct23_Substruct1 -{ +struct SaveStruct23_Substruct1 { /* 0x000 */ u8 flag0 : 1; - u8 flag1 : 1; - u8 u_0_2 : 3; - u8 u_0_5 : 3; + u8 flag1 : 1; + u8 u_0_2 : 3; + u8 u_0_5 : 3; /* 0x001 */ u8 u_1; /* 0x002 */ u8 u_2; /* 0x003 */ u8 u_3; @@ -49,25 +44,23 @@ struct SaveStruct23_Substruct1 /* 0x02C */ s32 u_2C[4]; }; // total size = 0x3C (60) -struct FrontierData -{ +struct FrontierData { /* 0x000 */ u16 u_0; /* 0x002 */ u8 u_2; /* 0x003 */ u8 u_3; /* 0x004 */ u32 u_4; - union - { - struct + union { + struct { - /* 0x008 */ u16 flag0:1; - u16 flag1:1; - u16 flag2:1; - u16 flag3:1; - u16 flag4:1; - u16 filler_1:11; + /* 0x008 */ u16 flag0 : 1; + u16 flag1 : 1; + u16 flag2 : 1; + u16 flag3 : 1; + u16 flag4 : 1; + u16 filler_1 : 11; }; - /* 0x008 */ u16 flags; + /* 0x008 */ u16 flags; }; /* 0x00A */ u8 filler_2[2]; /* 0x00C */ u16 u_C[5]; @@ -76,19 +69,17 @@ struct FrontierData /* 0x0C0 */ u8 u_C0[168]; }; // total size 0x168 (360) -struct SaveStruct23_Messages -{ +struct SaveStruct23_Messages { /* 0x000 */ struct MailMessage messages[4]; }; // total size 0x020 (32) -struct SaveStruct23_Substruct4_Substruct1 -{ +struct SaveStruct23_Substruct4_Substruct1 { /* 0x000 */ u8 u_0[168]; /* 0x0A8 */ u8 u_A8[16]; /* 0x0B8 */ u8 filler_1[16]; - /* 0x0C8 */ u8 u_C8_0:1; - u8 u_C8_1:1; - u8 filler_2:6; + /* 0x0C8 */ u8 u_C8_0 : 1; + u8 u_C8_1 : 1; + u8 filler_2 : 6; /* 0x0C8 */ u8 u_C9; /* 0x0CA */ u16 u_CA[4]; /* 0x0D2 */ u16 u_D2[4]; @@ -96,13 +87,11 @@ struct SaveStruct23_Substruct4_Substruct1 /* 0x0E2 */ u8 filler_3[2]; }; // total size 0xE4 (228) -struct SaveStruct23_Substruct4_Substruct2 -{ +struct SaveStruct23_Substruct4_Substruct2 { /* 0x00 */ u8 u_0[1020]; }; -struct SaveStruct23_Substruct4 -{ +struct SaveStruct23_Substruct4 { /* 0x000 */ u32 u_0; /* 0x004 */ u8 flags[250]; /* 0x0FE */ u8 u_FE; @@ -123,8 +112,7 @@ struct SaveStruct23 // Struct fetched with SaveArray_Get(save, 23) /* 0x1C4 */ struct SaveStruct23_Substruct4 substruct4; }; // total size = 0xD00 (3328) -struct Unk0202A4B8 -{ +struct Unk0202A4B8 { /* 0x000 */ u8 filler_1[2]; /* 0x002 */ u8 u_2; /* 0x003 */ u8 u_3; @@ -132,23 +120,19 @@ struct Unk0202A4B8 /* 0x006 */ u16 u_6; }; -typedef struct Unk0202A68C -{ +typedef struct Unk0202A68C { /* 0x000 */ u32 u_0; /* 0x004 */ u32 u_4; /* 0x008 */ u32 u_8; /* 0x00C */ u32 u_C; -} -Unk0202A68C; // total size 0x10 (16) +} Unk0202A68C; // total size 0x10 (16) -struct Unk0202A784 -{ +struct Unk0202A784 { /* 0x000 */ u8 u_0; /* 0x001 */ u8 u_1; }; -struct Unk0202A798_substruct -{ +struct Unk0202A798_substruct { /* 0x000 */ u32 u_0; /* 0x004 */ u16 u_4; /* 0x006 */ u8 filler_1[2]; @@ -158,8 +142,7 @@ struct Unk0202A798_substruct /* 0x028 */ u16 u_28[4]; }; // total size 0x30 (48) -struct Unk0202A798 -{ +struct Unk0202A798 { /* 0x000 */ struct Unk0202A798_substruct u_0; /* 0x030 */ u8 u_30[168]; }; @@ -202,8 +185,8 @@ void sub_0202A864(struct SaveStruct23_Substruct4 *substruct4, struct Unk0202A784 struct SaveStruct23_Substruct4_Substruct2 *sub_0202A878(struct SaveStruct23_Substruct4 *substruct4, HeapID heapId); s32 SaveStruct23_sizeof(); void SaveStruct23_Init(struct SaveStruct23 *saveStruct23); -struct SaveStruct23_Substruct1 *SaveStruct23_GetSubstruct1(struct SaveData* save); -struct FrontierData *Save_FrontierData_Get(struct SaveData* save); -struct SaveStruct23_Substruct4 *SaveStruct23_GetSubstruct4(struct SaveData* save); +struct SaveStruct23_Substruct1 *SaveStruct23_GetSubstruct1(struct SaveData *save); +struct FrontierData *Save_FrontierData_Get(struct SaveData *save); +struct SaveStruct23_Substruct4 *SaveStruct23_GetSubstruct4(struct SaveData *save); -#endif //POKEDIAMOND_UNK_0202A1E0_H \ No newline at end of file +#endif // POKEDIAMOND_UNK_0202A1E0_H diff --git a/include/unk_0202A8F4.h b/include/unk_0202A8F4.h index 016c532a7..447b413bc 100644 --- a/include/unk_0202A8F4.h +++ b/include/unk_0202A8F4.h @@ -1,8 +1,9 @@ #ifndef POKEDIAMOND_UNK_0202A8F4_H #define POKEDIAMOND_UNK_0202A8F4_H -struct Unk0202A8F4 -{ +#include "save.h" + +struct Unk0202A8F4 { u8 u_0; u8 u_1; u8 u_2; @@ -23,4 +24,4 @@ u32 sub_0202A8F4(); void sub_0202A8F8(struct Unk0202A8F4 *unk); void *sub_0202A918(struct SaveData *save); -#endif //POKEDIAMOND_UNK_0202A8F4_H +#endif // POKEDIAMOND_UNK_0202A8F4_H diff --git a/include/unk_0202ABBC.h b/include/unk_0202ABBC.h index 3c798c01b..cae871338 100644 --- a/include/unk_0202ABBC.h +++ b/include/unk_0202ABBC.h @@ -1,23 +1,24 @@ #ifndef POKEDIAMOND_UNK_0202ABBC_H #define POKEDIAMOND_UNK_0202ABBC_H -struct Unk0202ABBC -{ - /* 0x000 */ u32 filler[59]; +#include "save.h" + +struct Unk0202ABBC { + /* 0x000 */ u32 filler[59]; /* 0x0ec */ u16 unk_EC; /* 0x0ee */ u16 unk_EE; /* 0x0f0 */ u32 unk_F0; }; // size: 0xF4 -void *sub_0202ABBC(struct SaveData* save); +void *sub_0202ABBC(struct SaveData *save); u32 sub_0202ABC8(); -void sub_0202ABCC(struct Unk0202ABBC* unk); -u16 sub_0202ABDC(struct Unk0202ABBC* unk); -void sub_0202ABE4(struct Unk0202ABBC* unk, u16 data); +void sub_0202ABCC(struct Unk0202ABBC *unk); +u16 sub_0202ABDC(struct Unk0202ABBC *unk); +void sub_0202ABE4(struct Unk0202ABBC *unk, u16 data); void sub_0202ABEC(void *srcp, void *destp); void sub_0202ABF8(void *destp, void *srcp); -u32 sub_0202AC08(struct Unk0202ABBC* unk); -void sub_0202AC10(struct Unk0202ABBC* unk, u32 data); -u16 sub_0202AC18(struct Unk0202ABBC* unk); +u32 sub_0202AC08(struct Unk0202ABBC *unk); +void sub_0202AC10(struct Unk0202ABBC *unk, u32 data); +u16 sub_0202AC18(struct Unk0202ABBC *unk); -#endif //POKEDIAMOND_UNK_0202ABBC_H +#endif // POKEDIAMOND_UNK_0202ABBC_H diff --git a/include/unk_0202AC20.h b/include/unk_0202AC20.h index 69b558dbd..41ab3724f 100644 --- a/include/unk_0202AC20.h +++ b/include/unk_0202AC20.h @@ -1,8 +1,7 @@ #ifndef POKEDIAMOND_UNK_0202AC20_H #define POKEDIAMOND_UNK_0202AC20_H -struct UnkStruct_0202AC20 -{ +struct UnkStruct_0202AC20 { u8 unk_0000[0x100]; u32 unk_0100[8]; u32 unk_0120[3]; @@ -10,4 +9,4 @@ struct UnkStruct_0202AC20 u8 unk_094C[3][0x358]; }; -#endif //POKEDIAMOND_UNK_0202AC20_H +#endif // POKEDIAMOND_UNK_0202AC20_H diff --git a/include/unk_0202C0E0.h b/include/unk_0202C0E0.h index 8ea6d59e9..8d0ad4ade 100644 --- a/include/unk_0202C0E0.h +++ b/include/unk_0202C0E0.h @@ -1,8 +1,9 @@ #ifndef POKEDIAMOND_UNK_0202C0E0_H #define POKEDIAMOND_UNK_0202C0E0_H -struct UnkSaveStruct0202C0E4 -{ +#include "save.h" + +struct UnkSaveStruct0202C0E4 { u16 data[5][4]; }; @@ -11,4 +12,4 @@ void sub_0202C0E4(struct UnkSaveStruct0202C0E4 *unkStruct); void sub_0202C108(struct SaveData *save, u32 a1, u32 a2); u16 sub_0202C12C(struct SaveData *save, u32 a1, u32 a2); -#endif //POKEDIAMOND_UNK_0202C0E0_H +#endif // POKEDIAMOND_UNK_0202C0E0_H diff --git a/include/unk_0202C144.h b/include/unk_0202C144.h index ff6f96b01..27d7a6514 100644 --- a/include/unk_0202C144.h +++ b/include/unk_0202C144.h @@ -1,9 +1,9 @@ #ifndef POKEDIAMOND_UNK_0202C144_H #define POKEDIAMOND_UNK_0202C144_H -#include "save.h" #include "pokemon.h" +#include "save.h" -void sub_0202C144(struct SaveData * save, struct Pokemon * mon); +void sub_0202C144(struct SaveData *save, struct Pokemon *mon); -#endif //POKEDIAMOND_UNK_0202C144_H +#endif // POKEDIAMOND_UNK_0202C144_H diff --git a/include/unk_0202E29C.h b/include/unk_0202E29C.h index c2b479f88..219831f21 100644 --- a/include/unk_0202E29C.h +++ b/include/unk_0202E29C.h @@ -2,11 +2,11 @@ #define POKEDIAMOND_UNK_0202E29C_H #include "global.h" + #include "mail_message.h" #include "player_data.h" -struct UnkStruct_0202E29C_sub4 -{ +struct UnkStruct_0202E29C_sub4 { u32 unk00; u8 unk04; u8 unk05; @@ -17,8 +17,7 @@ struct UnkStruct_0202E29C_sub4 u8 unk30[0x40]; }; -struct UnkStruct_0202E29C_sub -{ +struct UnkStruct_0202E29C_sub { u32 unk00; u8 unk04[6]; u8 unk0A[0x2C]; @@ -27,8 +26,7 @@ struct UnkStruct_0202E29C_sub struct UnkStruct_0202E29C_sub4 unk50; }; -struct UnkStruct_0202E29C_sub3 -{ +struct UnkStruct_0202E29C_sub3 { struct MailMessage unk00; PlayerProfile unk08; u8 unk28[0x20]; @@ -37,8 +35,7 @@ struct UnkStruct_0202E29C_sub3 u8 unk4D[7]; }; -struct UnkStruct_0202E29C_sub2 -{ +struct UnkStruct_0202E29C_sub2 { u32 unk00; u8 unk04; u8 unk05; @@ -46,8 +43,7 @@ struct UnkStruct_0202E29C_sub2 struct UnkStruct_0202E29C_sub3 unk08; }; -struct UnkStruct_0202E29C -{ +struct UnkStruct_0202E29C { struct UnkStruct_0202E29C_sub3 unk000; struct UnkStruct_0202E29C_sub unk054[16]; u8 unkC54[8][6]; @@ -68,12 +64,12 @@ struct UnkStruct_0202E29C u8 unkDAA; u8 unkDAB; u8 unkDAC; - u8 unkDAD_0:1; - u8 unkDAD_1:1; - u8 unkDAD_2:1; - u8 unkDAD_3:1; - u8 unkDAD_4:1; - u8 unkDAD_5:1; + u8 unkDAD_0 : 1; + u8 unkDAD_1 : 1; + u8 unkDAD_2 : 1; + u8 unkDAD_3 : 1; + u8 unkDAD_4 : 1; + u8 unkDAD_5 : 1; u8 unkDAE[0x2]; }; diff --git a/include/unk_0202F150.h b/include/unk_0202F150.h index 70496673e..844aab8db 100644 --- a/include/unk_0202F150.h +++ b/include/unk_0202F150.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_0202F150_H #include "global.h" + #include "MI_memory.h" #include "RTC_api.h" #include "heap.h" @@ -9,24 +10,21 @@ #include "unk_0202D858.h" #include "unk_02031480.h" -struct UnkStruct0202F150_sub1 -{ +struct UnkStruct0202F150_sub1 { u32 unk00; s16 unk04; s16 unk06; u32 unk08; }; -struct UnkStruct0202F150_sub2 -{ +struct UnkStruct0202F150_sub2 { u32 unk00; void *unk04; u16 unk08; u8 unk0a; }; -struct UnkStruct0202F150 -{ +struct UnkStruct0202F150 { u8 unk000[2][38]; u8 unk04c[264]; u8 unk154[2][192]; diff --git a/include/unk_02031480.h b/include/unk_02031480.h index 616e5a63f..b257556fc 100644 --- a/include/unk_02031480.h +++ b/include/unk_02031480.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_02031480_H #include "global.h" + #include "MI_memory.h" #include "heap.h" #include "unk_0202F150.h" diff --git a/include/unk_02031734.h b/include/unk_02031734.h index 2dded6970..fa47dc9e9 100644 --- a/include/unk_02031734.h +++ b/include/unk_02031734.h @@ -2,20 +2,18 @@ #define POKEDIAMOND_UNK_02031734_H #include "global.h" + #include "player_data.h" -struct UnkStruct_02031734_const1 -{ +struct UnkStruct_02031734_const1 { u32 unk00[3]; }; -struct UnkStruct_02031734_const2 -{ +struct UnkStruct_02031734_const2 { u32 unk00[2]; }; -struct UnkStruct_02031734 -{ +struct UnkStruct_02031734 { void *unk00; u8 unk04[6]; s64 unk0C[3]; @@ -48,8 +46,7 @@ struct UnkStruct_02031734 u8 unk4F; }; -inline u32 compute(s64 *param0, u32 param1) -{ +inline u32 compute(s64 *param0, u32 param1) { param0[0] = param0[1] * param0[0] + param0[2]; return (u32)(((s64)((u64)(param0[0]) >> 32) * param1) >> 32); diff --git a/include/unk_02033778.h b/include/unk_02033778.h index adc36b91f..093d05474 100644 --- a/include/unk_02033778.h +++ b/include/unk_02033778.h @@ -6,4 +6,4 @@ void sub_02033778(u32 param0); void sub_020337C8(u32 param0, u32 param1, u32 param2, u32 language); -#endif //POKEDIAMOND_UNK_02033778_H +#endif // POKEDIAMOND_UNK_02033778_H diff --git a/include/unk_020337E8.h b/include/unk_020337E8.h index 3d7fbca66..1ec5f90c9 100644 --- a/include/unk_020337E8.h +++ b/include/unk_020337E8.h @@ -2,16 +2,15 @@ #define POKEDIAMOND_UNK_020337E8_H #include "global.h" + #include "save.h" // Dummy struct until DWC_account -struct DWC_Struct -{ +struct DWC_Struct { s32 unk0; }; -struct DWC_token -{ +struct DWC_token { // size: 0xC u8 fill0[0xC]; }; @@ -21,5 +20,4 @@ void sub_0203380C(struct DWC_Struct *); s32 sub_02033830(struct DWC_Struct *); BOOL sub_0203384C(struct SaveData *); - #endif // POKEDIAMOND_UNK_020337E8_H diff --git a/include/unk_020377F0.h b/include/unk_020377F0.h index ddf4000bc..ff4016d5e 100644 --- a/include/unk_020377F0.h +++ b/include/unk_020377F0.h @@ -10,11 +10,10 @@ struct Party; // This struct gets created from a bunch of places, not just 0x02037CF0. This was // just the first place I (tgsm) found it being created. -struct UnkStruct_02037CF0 -{ - struct Party* party; - struct Options* options; - u16* name_buf; +struct UnkStruct_02037CF0 { + struct Party *party; + struct Options *options; + u16 *name_buf; u32 trainer_id; u8 gender; u8 unk11; @@ -36,7 +35,7 @@ enum NamingScreenType { NAMINGSCREEN_POKEMON, NAMINGSCREEN_BOX, NAMINGSCREEN_RIVAL, - NAMINGSCREEN_GROUP = 5, + NAMINGSCREEN_GROUP = 5, NAMINGSCREEN_SHAYMIN_ROCK = 6, }; diff --git a/include/unk_0204AF24.h b/include/unk_0204AF24.h index 4804e15b9..be72a546b 100644 --- a/include/unk_0204AF24.h +++ b/include/unk_0204AF24.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_0204AF24_H #include "nitro/types.h" + #include "task.h" BOOL sub_0204AF24(struct TaskManager *taskManager); diff --git a/include/unk_0204B0A0.h b/include/unk_0204B0A0.h index 807e1c405..1d813b50d 100644 --- a/include/unk_0204B0A0.h +++ b/include/unk_0204B0A0.h @@ -7,18 +7,18 @@ #include "script.h" void sub_0204B0F8(struct FieldSystem *fieldSystem); -void sub_0204B130(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate* date); -void sub_0204B158(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate* date, struct RTCTime* time); +void sub_0204B130(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate *date); +void sub_0204B158(struct FieldSystem *fieldSystem, SysInfo_RTC *rtc_info, struct RTCDate *date, struct RTCTime *time); void sub_0204B1DC(struct FieldSystem *fieldSystem, s32 a1); -void sub_0204B270(struct FieldSystem *fieldSystem, s32 a1, struct RTCTime* time); +void sub_0204B270(struct FieldSystem *fieldSystem, s32 a1, struct RTCTime *time); u32 Script_GetTimeOfDay(struct FieldSystem *fieldSystem); u32 Script_GetMonth(struct FieldSystem *fieldSystem); u32 Script_GetDay(struct FieldSystem *fieldSystem); RTCWeek Script_GetWeekday(struct FieldSystem *fieldSystem); u32 Script_GetHour(struct FieldSystem *fieldSystem); u32 Script_GetMinute(struct FieldSystem *fieldSystem); -void Script_SavRTC_x24toDateTime(struct FieldSystem *fieldSystem, struct RTCDate* date, struct RTCTime* time); -void Script_SavRTC_x2CtoDateTime(struct FieldSystem *fieldSystem, struct RTCDate* date, struct RTCTime* time); +void Script_SavRTC_x24toDateTime(struct FieldSystem *fieldSystem, struct RTCDate *date, struct RTCTime *time); +void Script_SavRTC_x2CtoDateTime(struct FieldSystem *fieldSystem, struct RTCDate *date, struct RTCTime *time); void Script_SavRTC_DateTimeTox2C(struct FieldSystem *fieldSystem); BOOL sub_0204B33C(struct FieldSystem *fieldSystem); diff --git a/include/unk_0205EC84.h b/include/unk_0205EC84.h index 02dbec397..8792a2c20 100644 --- a/include/unk_0205EC84.h +++ b/include/unk_0205EC84.h @@ -3,56 +3,56 @@ #include "save_vars_flags.h" -void sub_0205ECD4(struct SaveVarsFlags * state); -BOOL sub_0205ECE0(struct SaveVarsFlags * state); -BOOL sub_0205ECEC(struct SaveVarsFlags * state); -void sub_0205ECFC(struct SaveVarsFlags * state); -BOOL sub_0205ED0C(struct SaveVarsFlags * state); -void sub_0205ED1C(struct SaveVarsFlags * state); -void sub_0205ED2C(struct SaveVarsFlags * state); -BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags * state); -void sub_0205ED4C(struct SaveVarsFlags * state); -void sub_0205ED5C(struct SaveVarsFlags * state); -BOOL sub_0205ED6C(struct SaveVarsFlags * state); -void sub_0205ED7C(struct SaveVarsFlags * state); -void sub_0205ED8C(struct SaveVarsFlags * state); -BOOL sub_0205ED9C(struct SaveVarsFlags * state); -void sub_0205EDAC(struct SaveVarsFlags * state); -void sub_0205EDBC(struct SaveVarsFlags * state); -void sub_0205EDCC(struct SaveVarsFlags * state); -void sub_0205EDD8(struct SaveVarsFlags * state); -void sub_0205EDE8(struct SaveVarsFlags * state); -void sub_0205EDF8(struct SaveVarsFlags * state); -void sub_0205EE08(struct SaveVarsFlags * state, u32 a1); -BOOL sub_0205EE60(struct SaveVarsFlags * state, u32 a1); -BOOL sub_0205EEB8(struct SaveVarsFlags * state, u32 a1); -s32 sub_0205EF20(struct SaveVarsFlags * state, s32 a1); -void sub_0205F154(struct SaveVarsFlags * state); -void sub_0205F164(struct SaveVarsFlags * state); -BOOL sub_0205F174(struct SaveVarsFlags * state); -BOOL sub_0205F184(struct SaveVarsFlags * state); -BOOL sub_0205F194(struct SaveVarsFlags * state); -BOOL sub_0205F1A4(struct SaveVarsFlags * state); -BOOL sub_0205F1B4(struct SaveVarsFlags * state); -void sub_0205F1C4(struct SaveVarsFlags * state); -void sub_0205F1D4(struct SaveVarsFlags * state); -BOOL sub_0205F1E4(struct SaveVarsFlags * state); -void Save_VarsFlags_SetSafariSysFlag(struct SaveVarsFlags * state); -void Save_VarsFlags_ClearSafariSysFlag(struct SaveVarsFlags * state); -BOOL Save_VarsFlags_CheckSafariSysFlag(struct SaveVarsFlags * state); -void sub_0205F224(struct SaveVarsFlags * state); -void sub_0205F234(struct SaveVarsFlags * state); -BOOL sub_0205F244(struct SaveVarsFlags * state); -void sub_0205F254(struct SaveVarsFlags * state); -BOOL sub_0205F264(struct SaveVarsFlags * state, u32 op); -void sub_0205F274(struct SaveVarsFlags * state); -void sub_0205F284(struct SaveVarsFlags * state); -BOOL sub_0205F294(struct SaveVarsFlags * state); -void sub_0205F2A4(struct SaveVarsFlags * state); -void sub_0205F2B4(struct SaveVarsFlags * state); -BOOL sub_0205F2C4(struct SaveVarsFlags * state); -BOOL sub_0205F2D4(struct SaveVarsFlags * state, u32 op); -BOOL sub_0205F2E4(struct SaveVarsFlags * state, u32 op, u16 flag_id); -void sub_0205F304(struct SaveVarsFlags * state); +void sub_0205ECD4(struct SaveVarsFlags *state); +BOOL sub_0205ECE0(struct SaveVarsFlags *state); +BOOL sub_0205ECEC(struct SaveVarsFlags *state); +void sub_0205ECFC(struct SaveVarsFlags *state); +BOOL sub_0205ED0C(struct SaveVarsFlags *state); +void sub_0205ED1C(struct SaveVarsFlags *state); +void sub_0205ED2C(struct SaveVarsFlags *state); +BOOL Save_VarsFlags_CheckHaveFollower(struct SaveVarsFlags *state); +void sub_0205ED4C(struct SaveVarsFlags *state); +void sub_0205ED5C(struct SaveVarsFlags *state); +BOOL sub_0205ED6C(struct SaveVarsFlags *state); +void sub_0205ED7C(struct SaveVarsFlags *state); +void sub_0205ED8C(struct SaveVarsFlags *state); +BOOL sub_0205ED9C(struct SaveVarsFlags *state); +void sub_0205EDAC(struct SaveVarsFlags *state); +void sub_0205EDBC(struct SaveVarsFlags *state); +void sub_0205EDCC(struct SaveVarsFlags *state); +void sub_0205EDD8(struct SaveVarsFlags *state); +void sub_0205EDE8(struct SaveVarsFlags *state); +void sub_0205EDF8(struct SaveVarsFlags *state); +void sub_0205EE08(struct SaveVarsFlags *state, u32 a1); +BOOL sub_0205EE60(struct SaveVarsFlags *state, u32 a1); +BOOL sub_0205EEB8(struct SaveVarsFlags *state, u32 a1); +s32 sub_0205EF20(struct SaveVarsFlags *state, s32 a1); +void sub_0205F154(struct SaveVarsFlags *state); +void sub_0205F164(struct SaveVarsFlags *state); +BOOL sub_0205F174(struct SaveVarsFlags *state); +BOOL sub_0205F184(struct SaveVarsFlags *state); +BOOL sub_0205F194(struct SaveVarsFlags *state); +BOOL sub_0205F1A4(struct SaveVarsFlags *state); +BOOL sub_0205F1B4(struct SaveVarsFlags *state); +void sub_0205F1C4(struct SaveVarsFlags *state); +void sub_0205F1D4(struct SaveVarsFlags *state); +BOOL sub_0205F1E4(struct SaveVarsFlags *state); +void Save_VarsFlags_SetSafariSysFlag(struct SaveVarsFlags *state); +void Save_VarsFlags_ClearSafariSysFlag(struct SaveVarsFlags *state); +BOOL Save_VarsFlags_CheckSafariSysFlag(struct SaveVarsFlags *state); +void sub_0205F224(struct SaveVarsFlags *state); +void sub_0205F234(struct SaveVarsFlags *state); +BOOL sub_0205F244(struct SaveVarsFlags *state); +void sub_0205F254(struct SaveVarsFlags *state); +BOOL sub_0205F264(struct SaveVarsFlags *state, u32 op); +void sub_0205F274(struct SaveVarsFlags *state); +void sub_0205F284(struct SaveVarsFlags *state); +BOOL sub_0205F294(struct SaveVarsFlags *state); +void sub_0205F2A4(struct SaveVarsFlags *state); +void sub_0205F2B4(struct SaveVarsFlags *state); +BOOL sub_0205F2C4(struct SaveVarsFlags *state); +BOOL sub_0205F2D4(struct SaveVarsFlags *state, u32 op); +BOOL sub_0205F2E4(struct SaveVarsFlags *state, u32 op, u16 flag_id); +void sub_0205F304(struct SaveVarsFlags *state); -#endif //POKEDIAMOND_UNK_0205EC84_H +#endif // POKEDIAMOND_UNK_0205EC84_H diff --git a/include/unk_0205FA2C.h b/include/unk_0205FA2C.h index 0d3349960..c0cd8e915 100644 --- a/include/unk_0205FA2C.h +++ b/include/unk_0205FA2C.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_UNK_0205FA2C_H #include "global.h" + #include "MI_memory.h" #include "bag.h" #include "battle_setup.h" @@ -16,8 +17,7 @@ #include "unk_02031480.h" #include "unk_0206BB28.h" -struct UnkPlayerStruct1_0205FA2C -{ +struct UnkPlayerStruct1_0205FA2C { /* 0x00 */ struct Party *player_party; /* 0x04 */ struct Bag *bag; u32 unk08; @@ -29,14 +29,13 @@ struct UnkPlayerStruct1_0205FA2C u8 unk23; u32 unk24[2]; u8 unk2c[6]; - u8 unk32 : 4; + u8 unk32 : 4; u8 unk322 : 4; u8 unk33; u32 unk34[3]; }; -struct UnkPlayerStruct2_0205FA2C -{ +struct UnkPlayerStruct2_0205FA2C { /* 0x00 */ struct Party *player_party; /* 0x04 */ struct Options *options; u32 unk08; @@ -56,8 +55,7 @@ struct UnkPlayerStruct2_0205FA2C u32 unk2c; }; -struct UnkCallbackStruct1_0205FA2C -{ +struct UnkCallbackStruct1_0205FA2C { u32 unk00; u32 unk04; u8 unk08; @@ -70,8 +68,7 @@ struct UnkCallbackStruct1_0205FA2C void **unk14; }; -struct UnkCallbackStruct2_0205FA2C -{ +struct UnkCallbackStruct2_0205FA2C { u32 unk00; u32 unk04; u32 *unk08; diff --git a/include/unk_0206015C.h b/include/unk_0206015C.h index 3e44961a4..c79184ee7 100644 --- a/include/unk_0206015C.h +++ b/include/unk_0206015C.h @@ -2,29 +2,28 @@ #define UNK_0206015C_H_GUARD #include "global.h" + #include "script.h" #include "task.h" -struct UnkStruct_0206015C -{ - u32 unk0; - u32 unk4; - u32 unk8; - u8 unkC; - u8 unkD; +struct UnkStruct_0206015C { + u32 unk0; + u32 unk4; + u32 unk8; + u8 unkC; + u8 unkD; }; -struct UnkStruct_0204652C -{ - void* unk0; - u32 unk4; - u32 unk8; - u8 action; - u8 unkD; // some kind of counter? - u8 unkE; // some kind of counter? +struct UnkStruct_0204652C { + void *unk0; + u32 unk4; + u32 unk8; + u8 action; + u8 unkD; // some kind of counter? + u8 unkE; // some kind of counter? }; void CallTask_UseGreatMarshBinoculars(struct FieldSystem *fieldSystem); BOOL Task_UseGreatMarshBinoculars(struct TaskManager *taskManager); -#endif //UNK_0206015C_H_GUARD +#endif // UNK_0206015C_H_GUARD diff --git a/include/unk_0206439C.h b/include/unk_0206439C.h index a026cc146..a68c5053d 100644 --- a/include/unk_0206439C.h +++ b/include/unk_0206439C.h @@ -1,15 +1,15 @@ #ifndef POKEDIAMOND_UNK_0206439C_H #define POKEDIAMOND_UNK_0206439C_H -struct Pokemon; -struct SaveData; +#include "heap.h" +#include "pokemon.h" +#include "save.h" -struct UnkStruct_0206439C -{ - struct Pokemon* pokemon; - void* unk4; -}; +typedef struct UnkStruct_0206439C { + Pokemon *pokemon; + void *unk4; +} UnkStruct_0206439C; -struct UnkStruct_0206439C* sub_0206439C(HeapID heapId, u8 mon_idx, struct SaveData* save); +UnkStruct_0206439C *sub_0206439C(HeapID heapId, u8 mon_idx, SaveData *save); #endif diff --git a/include/unk_02064E20.h b/include/unk_02064E20.h index 00cf6f96e..1f0566131 100644 --- a/include/unk_02064E20.h +++ b/include/unk_02064E20.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_UNK_02064E20_H #define POKEDIAMOND_UNK_02064E20_H -#include "script.h" +#include "field_system.h" void KeepSafariTrain(struct FieldSystem *fieldSystem); diff --git a/include/unk_02064E4C.h b/include/unk_02064E4C.h index a6032a631..0798914f3 100644 --- a/include/unk_02064E4C.h +++ b/include/unk_02064E4C.h @@ -4,7 +4,7 @@ #include "msgdata.h" #include "string16.h" -void sub_02064E4C(struct MsgData * msgData, u16 map_sec, struct String * dest); -void sub_02064E60(u32 map_no, HeapID heapId, struct String * dest); +void sub_02064E4C(struct MsgData *msgData, u16 map_sec, struct String *dest); +void sub_02064E60(u32 map_no, HeapID heapId, struct String *dest); #endif diff --git a/include/unk_0206B688.h b/include/unk_0206B688.h index 8e36e5762..35165ed81 100644 --- a/include/unk_0206B688.h +++ b/include/unk_0206B688.h @@ -3,13 +3,13 @@ #include "pokemon.h" -u32 sub_0206B688(struct BoxPokemon * boxmon); -u32 sub_0206B6C8(struct Pokemon * pokemon); +u32 sub_0206B688(struct BoxPokemon *boxmon); +u32 sub_0206B6C8(struct Pokemon *pokemon); u32 sub_0206B6D4(u32 species, u32 is_egg, u32 form); -u16 BoxMon_GetAlternateForm(struct BoxPokemon * boxmon); +u16 BoxMon_GetAlternateForm(struct BoxPokemon *boxmon); u32 sub_0206B7BC(u32 species, u32 form, u32 is_egg); -u32 sub_0206B83C(struct BoxPokemon * boxmon); -u32 sub_0206B87C(struct Pokemon * pokemon); +u32 sub_0206B83C(struct BoxPokemon *boxmon); +u32 sub_0206B87C(struct Pokemon *pokemon); u32 sub_0206B888(void); u32 sub_0206B88C(void); u32 sub_0206B890(void); @@ -18,4 +18,4 @@ u32 sub_0206B898(void); u32 sub_0206B89C(void); u32 sub_0206B8A0(void); -#endif //POKEDIAMOND_UNK_0206B688_H +#endif // POKEDIAMOND_UNK_0206B688_H diff --git a/include/unk_0206BB28.h b/include/unk_0206BB28.h index 3a3c6bef0..e74e64de2 100644 --- a/include/unk_0206BB28.h +++ b/include/unk_0206BB28.h @@ -1,12 +1,12 @@ #ifndef POKEDIAMOND_UNK_0206BB28_H #define POKEDIAMOND_UNK_0206BB28_H -#include "save.h" #include "pokedex.h" #include "pokemon.h" +#include "save.h" -BOOL SaveArray_IsNatDexEnabled(struct SaveData * save); -BOOL Pokedex_IsNatDexEnabled(struct Pokedex * pokedex); +BOOL SaveArray_IsNatDexEnabled(struct SaveData *save); +BOOL Pokedex_IsNatDexEnabled(struct Pokedex *pokedex); u32 Pokedex_ConvertToCurrentDexNo(BOOL isNationalDex, u32 species); -#endif //POKEDIAMOND_UNK_0206BB28_H +#endif // POKEDIAMOND_UNK_0206BB28_H diff --git a/include/unk_0207FC5C.h b/include/unk_0207FC5C.h index e68721997..9f07f7eda 100644 --- a/include/unk_0207FC5C.h +++ b/include/unk_0207FC5C.h @@ -1,89 +1,12 @@ #ifndef POKEDIAMOND_UNK_0207FC5C_H #define POKEDIAMOND_UNK_0207FC5C_H -#define RIBBON_HOENN_CHAMPION 0 -#define RIBBON_HOENN_COOL 1 -#define RIBBON_HOENN_COOL_SUPER 2 -#define RIBBON_HOENN_COOL_HYPER 3 -#define RIBBON_HOENN_COOL_MASTER 4 -#define RIBBON_HOENN_BEAUTY 5 -#define RIBBON_HOENN_BEAUTY_SUPER 6 -#define RIBBON_HOENN_BEAUTY_HYPER 7 -#define RIBBON_HOENN_BEAUTY_MASTER 8 -#define RIBBON_HOENN_CUTE 9 -#define RIBBON_HOENN_CUTE_SUPER 10 -#define RIBBON_HOENN_CUTE_HYPER 11 -#define RIBBON_HOENN_CUTE_MASTER 12 -#define RIBBON_HOENN_SMART 13 -#define RIBBON_HOENN_SMART_SUPER 14 -#define RIBBON_HOENN_SMART_HYPER 15 -#define RIBBON_HOENN_SMART_MASTER 16 -#define RIBBON_HOENN_TOUGH 17 -#define RIBBON_HOENN_TOUGH_SUPER 18 -#define RIBBON_HOENN_TOUGH_HYPER 19 -#define RIBBON_HOENN_TOUGH_MASTER 20 -#define RIBBON_HOENN_WINNING 21 -#define RIBBON_HOENN_VICTORY 22 -#define RIBBON_HOENN_ARTIST 23 -#define RIBBON_HOENN_EFFORT 24 -#define RIBBON_HOENN_MARINE 25 -#define RIBBON_HOENN_LAND 26 -#define RIBBON_HOENN_SKY 27 -#define RIBBON_HOENN_COUNTRY 28 -#define RIBBON_HOENN_NATIONAL 29 -#define RIBBON_HOENN_EARTH 30 -#define RIBBON_HOENN_WORLD 31 -#define RIBBON_SINNOH_CHAMP 32 -#define RIBBON_COOL 33 -#define RIBBON_COOL_GREAT 34 -#define RIBBON_COOL_ULTRA 35 -#define RIBBON_COOL_MASTER 36 -#define RIBBON_BEAUTY 37 -#define RIBBON_BEAUTY_GREAT 38 -#define RIBBON_BEAUTY_ULTRA 39 -#define RIBBON_BEAUTY_MASTER 40 -#define RIBBON_CUTE 41 -#define RIBBON_CUTE_GREAT 42 -#define RIBBON_CUTE_ULTRA 43 -#define RIBBON_CUTE_MASTER 44 -#define RIBBON_SMART 45 -#define RIBBON_SMART_GREAT 46 -#define RIBBON_SMART_ULTRA 47 -#define RIBBON_SMART_MASTER 48 -#define RIBBON_TOUGH 49 -#define RIBBON_TOUGH_GREAT 50 -#define RIBBON_TOUGH_ULTRA 51 -#define RIBBON_TOUGH_MASTER 52 -#define RIBBON_ABILITY 53 -#define RIBBON_GREAT_ABILITY 54 -#define RIBBON_DOUBLE_ABILITY 55 -#define RIBBON_MULTI_ABILITY 56 -#define RIBBON_PAIR_ABILITY 57 -#define RIBBON_WORLD_ABILITY 58 -#define RIBBON_ALERT 59 -#define RIBBON_SHOCK 60 -#define RIBBON_DOWNCAST 61 -#define RIBBON_CARELESS 62 -#define RIBBON_RELAX 63 -#define RIBBON_SNOOZE 64 -#define RIBBON_SMILE 65 -#define RIBBON_GORGEOUS 66 -#define RIBBON_ROYAL 67 -#define RIBBON_GORGEOUS_ROYAL 68 -#define RIBBON_FOOTPRINT 69 -#define RIBBON_RECORD 70 -#define RIBBON_HISTORY 71 -#define RIBBON_LEGEND 72 -#define RIBBON_RED 73 -#define RIBBON_GREEN 74 -#define RIBBON_BLUE 75 -#define RIBBON_FESTIVAL 76 -#define RIBBON_CARNIVAL 77 -#define RIBBON_CLASSIC 78 -#define RIBBON_PREMIER 79 +#include "nitro/types.h" + +#include "constants/ribbons.h" u32 sub_0207FC5C(u8 a0, u32 a1); -int sub_0207FCC0(u8 * a0, u32 a1); +int sub_0207FCC0(u8 *a0, u32 a1); u8 sub_0207FCE0(u32 a0); -#endif //POKEDIAMOND_UNK_0207FC5C_H +#endif // POKEDIAMOND_UNK_0207FC5C_H diff --git a/include/unk_020851B8.h b/include/unk_020851B8.h index 961573a59..2cdeb55d6 100644 --- a/include/unk_020851B8.h +++ b/include/unk_020851B8.h @@ -1,6 +1,8 @@ #ifndef POKEDIAMOND_UNK_020851B8_H #define POKEDIAMOND_UNK_020851B8_H +#include "nitro/types.h" + struct UnkStruct_020851B8 { u32 flags[2]; u8 unk_8; diff --git a/include/unk_02085338.h b/include/unk_02085338.h index e7b491095..afe3134e5 100644 --- a/include/unk_02085338.h +++ b/include/unk_02085338.h @@ -1,12 +1,11 @@ #ifndef POKEDIAMOND_UNK_02085338_H #define POKEDIAMOND_UNK_02085338_H -#include "save.h" -#include "pokedex.h" #include "easy_chat.h" +#include "pokedex.h" +#include "save.h" -struct UnkStruct_02085338 -{ +struct UnkStruct_02085338 { u8 unk_00; u8 unk_01; u8 unk_02; @@ -14,34 +13,34 @@ struct UnkStruct_02085338 u8 unk_04; u8 unk_05; u32 unk_08; - struct Pokedex * unk_0c; - struct SaveEasyChat * unk_10; + struct Pokedex *unk_0c; + struct SaveEasyChat *unk_10; struct MailMessage unk_14; u16 unk_1c[2]; u8 padding_20[4]; }; -struct UnkStruct_02085338 * sub_02085338(u8 r5, u8 r7, struct SaveData * save, HeapID heapId); -void sub_020853A8(struct UnkStruct_02085338 * ptr); -void sub_020853B0(struct UnkStruct_02085338 * ptr, u16 a1); -void sub_020853B4(struct UnkStruct_02085338 * ptr, u16 a1, u16 a2); -void sub_020853BC(struct UnkStruct_02085338 * ptr, const struct MailMessage * a1); -void sub_020853D0(struct UnkStruct_02085338 * ptr); -void sub_020853DC(struct UnkStruct_02085338 * ptr); -u8 sub_020853E4(struct UnkStruct_02085338 * ptr); -u8 sub_020853E8(struct UnkStruct_02085338 * ptr); -u16 sub_020853EC(struct UnkStruct_02085338 * ptr); -void sub_020853F0(struct UnkStruct_02085338 * ptr, u16 * a1); -void sub_020853FC(struct UnkStruct_02085338 * ptr, struct MailMessage * a1); -u8 sub_0208540C(struct UnkStruct_02085338 * ptr); -u8 sub_02085410(struct UnkStruct_02085338 * ptr); -u32 sub_02085414(struct UnkStruct_02085338 * ptr); -struct Pokedex * sub_02085418(struct UnkStruct_02085338 * ptr); -struct SaveEasyChat * sub_0208541C(struct UnkStruct_02085338 * ptr); -u8 sub_02085420(struct UnkStruct_02085338 * ptr); -u8 sub_02085424(struct UnkStruct_02085338 * ptr); -void sub_02085428(struct UnkStruct_02085338 * ptr, u16 * a1, struct MailMessage * a2); -BOOL sub_0208545C(struct UnkStruct_02085338 * ptr, const u16 * a1, const struct MailMessage * a2); -void sub_020854A0(struct UnkStruct_02085338 * r5, u16 * r4, struct MailMessage * r6); +struct UnkStruct_02085338 *sub_02085338(u8 r5, u8 r7, struct SaveData *save, HeapID heapId); +void sub_020853A8(struct UnkStruct_02085338 *ptr); +void sub_020853B0(struct UnkStruct_02085338 *ptr, u16 a1); +void sub_020853B4(struct UnkStruct_02085338 *ptr, u16 a1, u16 a2); +void sub_020853BC(struct UnkStruct_02085338 *ptr, const struct MailMessage *a1); +void sub_020853D0(struct UnkStruct_02085338 *ptr); +void sub_020853DC(struct UnkStruct_02085338 *ptr); +u8 sub_020853E4(struct UnkStruct_02085338 *ptr); +u8 sub_020853E8(struct UnkStruct_02085338 *ptr); +u16 sub_020853EC(struct UnkStruct_02085338 *ptr); +void sub_020853F0(struct UnkStruct_02085338 *ptr, u16 *a1); +void sub_020853FC(struct UnkStruct_02085338 *ptr, struct MailMessage *a1); +u8 sub_0208540C(struct UnkStruct_02085338 *ptr); +u8 sub_02085410(struct UnkStruct_02085338 *ptr); +u32 sub_02085414(struct UnkStruct_02085338 *ptr); +struct Pokedex *sub_02085418(struct UnkStruct_02085338 *ptr); +struct SaveEasyChat *sub_0208541C(struct UnkStruct_02085338 *ptr); +u8 sub_02085420(struct UnkStruct_02085338 *ptr); +u8 sub_02085424(struct UnkStruct_02085338 *ptr); +void sub_02085428(struct UnkStruct_02085338 *ptr, u16 *a1, struct MailMessage *a2); +BOOL sub_0208545C(struct UnkStruct_02085338 *ptr, const u16 *a1, const struct MailMessage *a2); +void sub_020854A0(struct UnkStruct_02085338 *r5, u16 *r4, struct MailMessage *r6); -#endif //POKEDIAMOND_UNK_02085338_H +#endif // POKEDIAMOND_UNK_02085338_H diff --git a/include/unk_02087A1C.h b/include/unk_02087A1C.h index f19b3c939..f2c1d2eaf 100644 --- a/include/unk_02087A1C.h +++ b/include/unk_02087A1C.h @@ -1,8 +1,10 @@ #ifndef POKEDIAMOND_UNK_02087A1C_H #define POKEDIAMOND_UNK_02087A1C_H +#include "nitro/types.h" + s32 GetMeisterLanguageIdx(u32 language); u8 GetMeisterLanguage(s32 idx); s32 GetMeisterSpeciesIdx(u32 species); -#endif //POKEDIAMOND_UNK_02087A1C_H +#endif // POKEDIAMOND_UNK_02087A1C_H diff --git a/include/unk_0208890C.h b/include/unk_0208890C.h index 51ceb421e..35238f448 100644 --- a/include/unk_0208890C.h +++ b/include/unk_0208890C.h @@ -1,8 +1,8 @@ #ifndef POKEDIAMOND_UNK_0208890C_H #define POKEDIAMOND_UNK_0208890C_H -#include "script.h" #include "player_data.h" +#include "script.h" struct Bag; struct Options; @@ -12,15 +12,15 @@ typedef struct PoffinCaseAppData { u8 padding[0x4]; u32 unk4; SavePoffinData *savePoffinData; - struct SaveData* save; - PlayerProfile* player; - struct Bag* bag; - struct Options* options; + struct SaveData *save; + PlayerProfile *player; + struct Bag *bag; + struct Options *options; u32 *unk1C; } PoffinCaseAppData; -struct PoffinCaseAppData* sub_0208890C(u32, struct SaveData* save, HeapID heapId, u32 *); -void sub_02088950(struct FieldSystem *fieldSystem, struct PoffinCaseAppData*); -struct PoffinCaseAppData* sub_02088960(struct FieldSystem *fieldSystem, u32, HeapID heapId); +struct PoffinCaseAppData *sub_0208890C(u32, struct SaveData *save, HeapID heapId, u32 *); +void sub_02088950(struct FieldSystem *fieldSystem, struct PoffinCaseAppData *); +struct PoffinCaseAppData *sub_02088960(struct FieldSystem *fieldSystem, u32, HeapID heapId); #endif diff --git a/include/unk_02088AAC.h b/include/unk_02088AAC.h index 9d48d673b..68ebeb275 100644 --- a/include/unk_02088AAC.h +++ b/include/unk_02088AAC.h @@ -5,8 +5,7 @@ #include "main.h" #include "unk_0208890C.h" -struct UnkStruct_02088AAC -{ +struct UnkStruct_02088AAC { HeapID heapId; u16 unk04; u16 unk06; diff --git a/include/unk_0208A300.h b/include/unk_0208A300.h index f2e74f463..691735d4b 100644 --- a/include/unk_0208A300.h +++ b/include/unk_0208A300.h @@ -1,17 +1,20 @@ #ifndef POKEDIAMOND_UNK_0208A300_H #define POKEDIAMOND_UNK_0208A300_H -struct UnkStruct_0208A300 -{ +#include "nitro/types.h" + +#include "heap.h" + +struct UnkStruct_0208A300 { u32 unk0; u32 unk4; }; -struct UnkStruct_0208A300* sub_0208A300(HeapID heapId); -void sub_0208A320(struct UnkStruct_0208A300* unk); -u32 sub_0208A328(struct UnkStruct_0208A300* unk); -void sub_0208A32C(struct UnkStruct_0208A300* unk, u32 a1); -u32 sub_0208A330(struct UnkStruct_0208A300* unk); -void sub_0208A334(struct UnkStruct_0208A300* unk, u32 a1); +struct UnkStruct_0208A300 *sub_0208A300(HeapID heapId); +void sub_0208A320(struct UnkStruct_0208A300 *unk); +u32 sub_0208A328(struct UnkStruct_0208A300 *unk); +void sub_0208A32C(struct UnkStruct_0208A300 *unk, u32 a1); +u32 sub_0208A330(struct UnkStruct_0208A300 *unk); +void sub_0208A334(struct UnkStruct_0208A300 *unk, u32 a1); #endif diff --git a/include/use_item_on_mon.h b/include/use_item_on_mon.h index df59bac91..68c3917d5 100644 --- a/include/use_item_on_mon.h +++ b/include/use_item_on_mon.h @@ -1,19 +1,22 @@ #ifndef POKEDIAMOND_USE_ITEM_ON_MON_H #define POKEDIAMOND_USE_ITEM_ON_MON_H +#include "heap.h" #include "itemtool.h" +#include "party.h" +#include "pokemon.h" -BOOL CanUseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveId, HeapID heapId); -BOOL CanUseItemOnMonInParty(struct Party * party, u16 itemId, s32 partyIdx, s32 moveIdx, HeapID heapId); -BOOL UseItemOnPokemon(struct Pokemon * pokemon, u16 itemId, s32 moveIdx, u16 location, HeapID heapId); -BOOL UseItemOnMonInParty(struct Party * party, u16 itemId, s32 partyIdx, s32 moveIdx, u16 location, HeapID heapId); -u8 MonMoveCanRestorePP(struct Pokemon * pokemon, s32 moveIdx); -BOOL MonMoveRestorePP(struct Pokemon * pokemon, s32 moveIdx, s32 ppRestore); -BOOL BoostMonMovePpUpBy(struct Pokemon * pokemon, s32 moveIdx, u32 nPpUp); -void RestoreMonHPBy(struct Pokemon * pokemon, u32 hp, u32 maxHp, u32 restoration); +BOOL CanUseItemOnPokemon(struct Pokemon *pokemon, u16 itemId, s32 moveId, HeapID heapId); +BOOL CanUseItemOnMonInParty(struct Party *party, u16 itemId, s32 partyIdx, s32 moveIdx, HeapID heapId); +BOOL UseItemOnPokemon(struct Pokemon *pokemon, u16 itemId, s32 moveIdx, u16 location, HeapID heapId); +BOOL UseItemOnMonInParty(struct Party *party, u16 itemId, s32 partyIdx, s32 moveIdx, u16 location, HeapID heapId); +u8 MonMoveCanRestorePP(struct Pokemon *pokemon, s32 moveIdx); +BOOL MonMoveRestorePP(struct Pokemon *pokemon, s32 moveIdx, s32 ppRestore); +BOOL BoostMonMovePpUpBy(struct Pokemon *pokemon, s32 moveIdx, u32 nPpUp); +void RestoreMonHPBy(struct Pokemon *pokemon, u32 hp, u32 maxHp, u32 restoration); s32 TryModEV(s32 ev, s32 evSum, s32 by); -BOOL CanItemModFriendship(struct Pokemon * pokemon, struct ItemData * itemData); -BOOL DoItemFriendshipMod(struct Pokemon * pokemon, s32 friendship, s32 mod, u16 location, HeapID heapId); -void HealParty(struct Party * party); +BOOL CanItemModFriendship(struct Pokemon *pokemon, struct ItemData *itemData); +BOOL DoItemFriendshipMod(struct Pokemon *pokemon, s32 friendship, s32 mod, u16 location, HeapID heapId); +void HealParty(struct Party *party); -#endif //POKEDIAMOND_USE_ITEM_ON_MON_H +#endif // POKEDIAMOND_USE_ITEM_ON_MON_H diff --git a/include/wfc_user_info_warning.h b/include/wfc_user_info_warning.h index 5563e1b4a..9dd2372d8 100644 --- a/include/wfc_user_info_warning.h +++ b/include/wfc_user_info_warning.h @@ -1,6 +1,8 @@ #ifndef POKEDIAMOND_WFC_USER_INFO_WARNING_H #define POKEDIAMOND_WFC_USER_INFO_WARNING_H +#include "heap.h" + void ShowWFCUserInfoWarning(HeapID heapId, u32 a1); #endif