diff options
| author | Pheenoh <pheenoh@gmail.com> | 2023-08-10 03:57:49 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-10 03:57:49 -0600 |
| commit | d24b09c2d9e303df68abd7f3417babfc00d83c78 (patch) | |
| tree | 52f020141957595ac866109832723941a8f7025f | |
| parent | 244892aeb849a9ad9801aa9828e6282d29df87f0 (diff) | |
d_file_select work + misc changes (#1873)
* setup TU
* JASResArcLoader OK
* d_a_obj_stoneMark work
* some funcs in d_a_obj_stoneMark
* many changes
* quat, d_a_obj_stone, d_a_alink, fix python script, tidy makefile
* d_file_select functions + pr cleanup
* match many dfile_select_c methods
* m_Do_main OK
* selFileWakuAnm & bookIconAnm
* selCopyFileWakuAnm & copyBookIconAnm
* dataDelEffAnm & dataCopyEffAnm
* selectDataBaseMoveAnmInitSet & selectDataBaseMoveAnm
* dataSelectIn
* _move & dataSelectInit
* match a few more
* comment
* J2DPicture::drawTexCoord
* draw_function
* dScnPly_Create + fix typing on request_of_phase_process_fn
* checkpoint
* checkpoint
* checkpoint
* checkpoint 2 (fixed)
* dFile_select_c::dataSelectAnmSet
* dFile_select_c::selectDataOpenMove
* dFile_select_c::copySelMoveAnmInitSet
* fix brightcheck issues
* rm comments, fix status update
* small mod to pr template
45 files changed, 1700 insertions, 1108 deletions
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 671241dfa7..c8d02f4ad4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,7 +9,7 @@ To the best of my knowledge and belief, my contribution is either originally cre I understand that this project and its maintainers are not responsible for enforcing the CC0 license, and I release them from any potential liability related to my contribution. --> -- [ ] I agree to the terms of the CC0 License. +- [] I agree to the terms of the CC0 License. <!-- Please check the checkbox above to indicate your agreement. diff --git a/.github/workflows/ok-check.yml b/.github/workflows/ok-check.yml index df816ddd3f..0e2267c775 100644 --- a/.github/workflows/ok-check.yml +++ b/.github/workflows/ok-check.yml @@ -51,14 +51,26 @@ jobs: FILENAMES="${{ steps.changed-files-specific.outputs.all_changed_files }}" CMD="./tp github-check-update-status --personal-access-token ${{ secrets.PAT_TOKEN }} --debug" - # If .inc files are found, assume it's for d_a_alink.cpp for now. - # We can come up something better here later if needed. - if echo "$FILENAMES" | grep -q ".inc"; then - CMD="$CMD --filename src/d/a/d_a_alink.cpp" - else - for FILE in $FILENAMES; do - CMD="$CMD --filename $FILE" - done + IFS=' ' read -ra FILE_ARRAY <<< "$FILENAMES" + INC_FOUND=false + + # Remove any .inc files from the array + for index in "${!FILE_ARRAY[@]}"; do + if [[ "${FILE_ARRAY[index]}" == *.inc ]]; then + unset 'FILE_ARRAY[index]' + INC_FOUND=true + fi + done + + # If any .inc files were found, + # We will add "src/d/a/d_a_alink.cpp" to the array once + # if it's not already there + if $INC_FOUND && ! [[ " ${FILE_ARRAY[@]} " =~ " src/d/a/d_a_alink.cpp " ]]; then + FILE_ARRAY+=("src/d/a/d_a_alink.cpp") fi + for FILE in "${FILE_ARRAY[@]}"; do + CMD="$CMD --filename $FILE" + done + $CMD diff --git a/Progress.md b/Progress.md index 4954c2c5bb..ba4640fbc5 100644 --- a/Progress.md +++ b/Progress.md @@ -7,22 +7,22 @@ Section | Percentage | Decompiled (bytes) | Total (bytes) .init | 97.972973% | 9280 | 9472 .extab | 100.000000% | 96 | 96 .extabindex | 100.000000% | 96 | 96 -.text | 30.410194% | 1093716 | 3596544 +.text | 30.684235% | 1103572 | 3596544 .ctors | 100.000000% | 448 | 448 .dtors | 100.000000% | 32 | 32 .rodata | 100.000000% | 193856 | 193856 .data | 100.000000% | 197632 | 197632 .sdata | 100.000000% | 1408 | 1408 .sdata2 | 100.000000% | 20832 | 20832 -Total | 37.746227% | 1517652 | 4020672 +Total | 37.991361% | 1527508 | 4020672 ## Total Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- -main.dol | 37.746227% | 1517652 | 4020672 +main.dol | 37.991361% | 1527508 | 4020672 RELs | 34.103178% | 3921976 | 11500324 -Total | 35.046900% | 5439628 | 15520996 +Total | 35.110401% | 5449484 | 15520996 ## RELs diff --git a/asm/d/file/d_file_select/ToErasePaneMove__14dFile_select_cFv.s b/asm/d/file/d_file_select/ToErasePaneMove__14dFile_select_cFv.s deleted file mode 100644 index 241041d211..0000000000 --- a/asm/d/file/d_file_select/ToErasePaneMove__14dFile_select_cFv.s +++ /dev/null @@ -1,28 +0,0 @@ -lbl_80187ADC: -/* 80187ADC 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80187AE0 7C 08 02 A6 */ mflr r0 -/* 80187AE4 90 01 00 14 */ stw r0, 0x14(r1) -/* 80187AE8 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80187AEC 93 C1 00 08 */ stw r30, 8(r1) -/* 80187AF0 7C 7E 1B 78 */ mr r30, r3 -/* 80187AF4 48 00 57 69 */ bl headerTxtChangeAnm__14dFile_select_cFv -/* 80187AF8 7C 7F 1B 78 */ mr r31, r3 -/* 80187AFC 7F C3 F3 78 */ mr r3, r30 -/* 80187B00 48 00 12 39 */ bl yesnoMenuMoveAnm__14dFile_select_cFv -/* 80187B04 57 E0 06 3E */ clrlwi r0, r31, 0x18 -/* 80187B08 28 00 00 01 */ cmplwi r0, 1 -/* 80187B0C 40 82 00 20 */ bne lbl_80187B2C -/* 80187B10 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 80187B14 28 00 00 01 */ cmplwi r0, 1 -/* 80187B18 40 82 00 14 */ bne lbl_80187B2C -/* 80187B1C 7F C3 F3 78 */ mr r3, r30 -/* 80187B20 48 00 16 0D */ bl yesnoCursorShow__14dFile_select_cFv -/* 80187B24 38 00 00 1A */ li r0, 0x1a -/* 80187B28 98 1E 02 6F */ stb r0, 0x26f(r30) -lbl_80187B2C: -/* 80187B2C 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80187B30 83 C1 00 08 */ lwz r30, 8(r1) -/* 80187B34 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80187B38 7C 08 03 A6 */ mtlr r0 -/* 80187B3C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80187B40 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/_move__14dFile_select_cFv.s b/asm/d/file/d_file_select/_move__14dFile_select_cFv.s deleted file mode 100644 index 9b3f1fb1c8..0000000000 --- a/asm/d/file/d_file_select/_move__14dFile_select_cFv.s +++ /dev/null @@ -1,96 +0,0 @@ -lbl_801844FC: -/* 801844FC 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80184500 7C 08 02 A6 */ mflr r0 -/* 80184504 90 01 00 14 */ stw r0, 0x14(r1) -/* 80184508 93 E1 00 0C */ stw r31, 0xc(r1) -/* 8018450C 93 C1 00 08 */ stw r30, 8(r1) -/* 80184510 7C 7F 1B 78 */ mr r31, r3 -/* 80184514 3C 60 80 43 */ lis r3, g_meter2_info@ha /* 0x80430188@ha */ -/* 80184518 38 63 01 88 */ addi r3, r3, g_meter2_info@l /* 0x80430188@l */ -/* 8018451C 48 09 7D 1D */ bl decMsgKeyWaitTimer__13dMeter2Info_cFv -/* 80184520 48 1C 6C A9 */ bl DVDGetDriveStatus -/* 80184524 2C 03 00 00 */ cmpwi r3, 0 -/* 80184528 41 82 00 20 */ beq lbl_80184548 -/* 8018452C 2C 03 00 01 */ cmpwi r3, 1 -/* 80184530 41 82 00 18 */ beq lbl_80184548 -/* 80184534 88 1F 03 B1 */ lbz r0, 0x3b1(r31) -/* 80184538 28 00 00 00 */ cmplwi r0, 0 -/* 8018453C 41 82 00 0C */ beq lbl_80184548 -/* 80184540 38 00 00 00 */ li r0, 0 -/* 80184544 98 1F 03 B1 */ stb r0, 0x3b1(r31) -lbl_80184548: -/* 80184548 3C 60 80 3F */ lis r3, g_mDoMemCd_control@ha /* 0x803EAF40@ha */ -/* 8018454C 3B C3 AF 40 */ addi r30, r3, g_mDoMemCd_control@l /* 0x803EAF40@l */ -/* 80184550 88 1E 1F BE */ lbz r0, 0x1fbe(r30) -/* 80184554 28 00 00 00 */ cmplwi r0, 0 -/* 80184558 41 82 00 0C */ beq lbl_80184564 -/* 8018455C 28 00 00 01 */ cmplwi r0, 1 -/* 80184560 40 82 00 50 */ bne lbl_801845B0 -lbl_80184564: -/* 80184564 80 6D 86 F8 */ lwz r3, mResetData__6mDoRst(r13) -/* 80184568 80 03 00 00 */ lwz r0, 0(r3) -/* 8018456C 2C 00 00 00 */ cmpwi r0, 0 -/* 80184570 40 82 00 40 */ bne lbl_801845B0 -/* 80184574 88 1F 03 B1 */ lbz r0, 0x3b1(r31) -/* 80184578 28 00 00 00 */ cmplwi r0, 0 -/* 8018457C 40 82 00 34 */ bne lbl_801845B0 -/* 80184580 80 7F 23 78 */ lwz r3, 0x2378(r31) -/* 80184584 88 03 00 B2 */ lbz r0, 0xb2(r3) -/* 80184588 28 00 00 00 */ cmplwi r0, 0 -/* 8018458C 41 82 00 18 */ beq lbl_801845A4 -/* 80184590 38 80 00 00 */ li r4, 0 -/* 80184594 81 83 00 00 */ lwz r12, 0(r3) -/* 80184598 81 8C 00 24 */ lwz r12, 0x24(r12) -/* 8018459C 7D 89 03 A6 */ mtctr r12 -/* 801845A0 4E 80 04 21 */ bctrl -lbl_801845A4: -/* 801845A4 38 00 00 00 */ li r0, 0 -/* 801845A8 98 1F 02 6F */ stb r0, 0x26f(r31) -/* 801845AC 98 1F 02 71 */ stb r0, 0x271(r31) -lbl_801845B0: -/* 801845B0 7F E3 FB 78 */ mr r3, r31 -/* 801845B4 88 1F 02 6F */ lbz r0, 0x26f(r31) -/* 801845B8 1C A0 00 0C */ mulli r5, r0, 0xc -/* 801845BC 3C 80 80 3C */ lis r4, DataSelProc@ha /* 0x803BAAEC@ha */ -/* 801845C0 38 04 AA EC */ addi r0, r4, DataSelProc@l /* 0x803BAAEC@l */ -/* 801845C4 7D 80 2A 14 */ add r12, r0, r5 -/* 801845C8 48 1D DA BD */ bl __ptmf_scall -/* 801845CC 60 00 00 00 */ nop -/* 801845D0 7F E3 FB 78 */ mr r3, r31 -/* 801845D4 48 00 00 91 */ bl selFileWakuAnm__14dFile_select_cFv -/* 801845D8 7F E3 FB 78 */ mr r3, r31 -/* 801845DC 48 00 02 C5 */ bl bookIconAnm__14dFile_select_cFv -/* 801845E0 7F E3 FB 78 */ mr r3, r31 -/* 801845E4 48 00 05 61 */ bl dataDelEffAnm__14dFile_select_cFv -/* 801845E8 7F E3 FB 78 */ mr r3, r31 -/* 801845EC 48 00 06 11 */ bl dataCopyEffAnm__14dFile_select_cFv -/* 801845F0 80 7F 00 14 */ lwz r3, 0x14(r31) -/* 801845F4 48 17 50 9D */ bl animation__9J2DScreenFv -/* 801845F8 80 7F 00 4C */ lwz r3, 0x4c(r31) -/* 801845FC 48 17 50 95 */ bl animation__9J2DScreenFv -/* 80184600 80 7F 00 58 */ lwz r3, 0x58(r31) -/* 80184604 48 17 50 8D */ bl animation__9J2DScreenFv -/* 80184608 80 7F 00 28 */ lwz r3, 0x28(r31) -/* 8018460C 48 17 50 85 */ bl animation__9J2DScreenFv -/* 80184610 88 1F 00 3C */ lbz r0, 0x3c(r31) -/* 80184614 28 00 00 00 */ cmplwi r0, 0 -/* 80184618 41 82 00 1C */ beq lbl_80184634 -/* 8018461C 7F E3 FB 78 */ mr r3, r31 -/* 80184620 48 00 03 7D */ bl selCopyFileWakuAnm__14dFile_select_cFv -/* 80184624 7F E3 FB 78 */ mr r3, r31 -/* 80184628 48 00 04 21 */ bl copyBookIconAnm__14dFile_select_cFv -/* 8018462C 80 7F 00 38 */ lwz r3, 0x38(r31) -/* 80184630 48 17 50 61 */ bl animation__9J2DScreenFv -lbl_80184634: -/* 80184634 80 7F 00 6C */ lwz r3, 0x6c(r31) -/* 80184638 48 00 D8 E1 */ bl _move__15dFile_warning_cFv -/* 8018463C 80 7F 00 0C */ lwz r3, 0xc(r31) -/* 80184640 48 00 BE A5 */ bl _move__16dFile_select3D_cFv -/* 80184644 38 00 00 02 */ li r0, 2 -/* 80184648 98 1E 1F BE */ stb r0, 0x1fbe(r30) -/* 8018464C 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80184650 83 C1 00 08 */ lwz r30, 8(r1) -/* 80184654 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80184658 7C 08 03 A6 */ mtlr r0 -/* 8018465C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80184660 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/animeEntry__16dFile_select3D_cFv.s b/asm/d/file/d_file_select/animeEntry__16dFile_select3D_cFv.s deleted file mode 100644 index 66384bac6d..0000000000 --- a/asm/d/file/d_file_select/animeEntry__16dFile_select3D_cFv.s +++ /dev/null @@ -1,28 +0,0 @@ -lbl_80190B44: -/* 80190B44 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80190B48 7C 08 02 A6 */ mflr r0 -/* 80190B4C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80190B50 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80190B54 7C 7F 1B 78 */ mr r31, r3 -/* 80190B58 80 63 00 10 */ lwz r3, 0x10(r3) -/* 80190B5C 28 03 00 00 */ cmplwi r3, 0 -/* 80190B60 41 82 00 18 */ beq lbl_80190B78 -/* 80190B64 80 9F 00 08 */ lwz r4, 8(r31) -/* 80190B68 80 84 00 04 */ lwz r4, 4(r4) -/* 80190B6C C0 23 00 10 */ lfs f1, 0x10(r3) -/* 80190B70 38 84 00 58 */ addi r4, r4, 0x58 -/* 80190B74 4B E7 CC 35 */ bl entry__13mDoExt_brkAnmFP16J3DMaterialTablef -lbl_80190B78: -/* 80190B78 80 7F 00 0C */ lwz r3, 0xc(r31) -/* 80190B7C 28 03 00 00 */ cmplwi r3, 0 -/* 80190B80 41 82 00 14 */ beq lbl_80190B94 -/* 80190B84 80 9F 00 08 */ lwz r4, 8(r31) -/* 80190B88 80 84 00 04 */ lwz r4, 4(r4) -/* 80190B8C C0 23 00 10 */ lfs f1, 0x10(r3) -/* 80190B90 4B E7 CE 3D */ bl entry__13mDoExt_bckAnmFP12J3DModelDataf -lbl_80190B94: -/* 80190B94 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80190B98 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80190B9C 7C 08 03 A6 */ mtlr r0 -/* 80190BA0 38 21 00 10 */ addi r1, r1, 0x10 -/* 80190BA4 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/backSelectMove__14dFile_select_cFv.s b/asm/d/file/d_file_select/backSelectMove__14dFile_select_cFv.s deleted file mode 100644 index 0dedfb3723..0000000000 --- a/asm/d/file/d_file_select/backSelectMove__14dFile_select_cFv.s +++ /dev/null @@ -1,43 +0,0 @@ -lbl_80187B44: -/* 80187B44 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80187B48 7C 08 02 A6 */ mflr r0 -/* 80187B4C 90 01 00 24 */ stw r0, 0x24(r1) -/* 80187B50 39 61 00 20 */ addi r11, r1, 0x20 -/* 80187B54 48 1D A6 85 */ bl _savegpr_28 -/* 80187B58 7C 7C 1B 78 */ mr r28, r3 -/* 80187B5C 48 00 57 01 */ bl headerTxtChangeAnm__14dFile_select_cFv -/* 80187B60 7C 7D 1B 78 */ mr r29, r3 -/* 80187B64 7F 83 E3 78 */ mr r3, r28 -/* 80187B68 4B FF DF 45 */ bl selectDataMoveAnm__14dFile_select_cFv -/* 80187B6C 7C 7E 1B 78 */ mr r30, r3 -/* 80187B70 7F 83 E3 78 */ mr r3, r28 -/* 80187B74 4B FF F1 39 */ bl menuMoveAnm__14dFile_select_cFv -/* 80187B78 7C 7F 1B 78 */ mr r31, r3 -/* 80187B7C 7F 83 E3 78 */ mr r3, r28 -/* 80187B80 48 00 58 9D */ bl modoruTxtDispAnm__14dFile_select_cFv -/* 80187B84 57 A0 06 3E */ clrlwi r0, r29, 0x18 -/* 80187B88 28 00 00 01 */ cmplwi r0, 1 -/* 80187B8C 40 82 00 44 */ bne lbl_80187BD0 -/* 80187B90 57 C0 06 3E */ clrlwi r0, r30, 0x18 -/* 80187B94 28 00 00 01 */ cmplwi r0, 1 -/* 80187B98 40 82 00 38 */ bne lbl_80187BD0 -/* 80187B9C 57 E0 06 3E */ clrlwi r0, r31, 0x18 -/* 80187BA0 28 00 00 01 */ cmplwi r0, 1 -/* 80187BA4 40 82 00 2C */ bne lbl_80187BD0 -/* 80187BA8 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 80187BAC 28 00 00 01 */ cmplwi r0, 1 -/* 80187BB0 40 82 00 20 */ bne lbl_80187BD0 -/* 80187BB4 7F 83 E3 78 */ mr r3, r28 -/* 80187BB8 48 00 5B AD */ bl selFileCursorShow__14dFile_select_cFv -/* 80187BBC 38 00 00 00 */ li r0, 0 -/* 80187BC0 80 7C 00 0C */ lwz r3, 0xc(r28) -/* 80187BC4 90 03 00 08 */ stw r0, 8(r3) -/* 80187BC8 38 00 00 03 */ li r0, 3 -/* 80187BCC 98 1C 02 6F */ stb r0, 0x26f(r28) -lbl_80187BD0: -/* 80187BD0 39 61 00 20 */ addi r11, r1, 0x20 -/* 80187BD4 48 1D A6 51 */ bl _restgpr_28 -/* 80187BD8 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80187BDC 7C 08 03 A6 */ mtlr r0 -/* 80187BE0 38 21 00 20 */ addi r1, r1, 0x20 -/* 80187BE4 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/dataSelectIn__14dFile_select_cFv.s b/asm/d/file/d_file_select/dataSelectIn__14dFile_select_cFv.s deleted file mode 100644 index 19359e0976..0000000000 --- a/asm/d/file/d_file_select/dataSelectIn__14dFile_select_cFv.s +++ /dev/null @@ -1,135 +0,0 @@ -lbl_80185040: -/* 80185040 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 80185044 7C 08 02 A6 */ mflr r0 -/* 80185048 90 01 00 34 */ stw r0, 0x34(r1) -/* 8018504C 39 61 00 30 */ addi r11, r1, 0x30 -/* 80185050 48 1D D1 7D */ bl _savegpr_25 -/* 80185054 7C 7F 1B 78 */ mr r31, r3 -/* 80185058 48 00 82 05 */ bl headerTxtChangeAnm__14dFile_select_cFv -/* 8018505C 7C 7D 1B 78 */ mr r29, r3 -/* 80185060 7F E3 FB 78 */ mr r3, r31 -/* 80185064 4B FF FC E9 */ bl selectDataBaseMoveAnm__14dFile_select_cFv -/* 80185068 7C 7E 1B 78 */ mr r30, r3 -/* 8018506C 3B 80 00 01 */ li r28, 1 -/* 80185070 88 1F 01 4A */ lbz r0, 0x14a(r31) -/* 80185074 28 00 00 00 */ cmplwi r0, 0 -/* 80185078 40 82 00 10 */ bne lbl_80185088 -/* 8018507C 88 1F 01 4B */ lbz r0, 0x14b(r31) -/* 80185080 28 00 00 00 */ cmplwi r0, 0 -/* 80185084 41 82 00 10 */ beq lbl_80185094 -lbl_80185088: -/* 80185088 7F E3 FB 78 */ mr r3, r31 -/* 8018508C 48 00 91 35 */ bl errorMoveAnm__14dFile_select_cFv -/* 80185090 7C 7C 1B 78 */ mr r28, r3 -lbl_80185094: -/* 80185094 3B 60 00 01 */ li r27, 1 -/* 80185098 88 1F 01 08 */ lbz r0, 0x108(r31) -/* 8018509C 28 00 00 00 */ cmplwi r0, 0 -/* 801850A0 40 82 00 10 */ bne lbl_801850B0 -/* 801850A4 88 1F 02 81 */ lbz r0, 0x281(r31) -/* 801850A8 28 00 00 00 */ cmplwi r0, 0 -/* 801850AC 41 82 00 10 */ beq lbl_801850BC -lbl_801850B0: -/* 801850B0 7F E3 FB 78 */ mr r3, r31 -/* 801850B4 48 00 3C 85 */ bl yesnoMenuMoveAnm__14dFile_select_cFv -/* 801850B8 7C 7B 1B 78 */ mr r27, r3 -lbl_801850BC: -/* 801850BC 3B 40 00 01 */ li r26, 1 -/* 801850C0 88 1F 01 28 */ lbz r0, 0x128(r31) -/* 801850C4 28 00 00 00 */ cmplwi r0, 0 -/* 801850C8 40 82 00 10 */ bne lbl_801850D8 -/* 801850CC 88 1F 00 3C */ lbz r0, 0x3c(r31) -/* 801850D0 28 00 00 00 */ cmplwi r0, 0 -/* 801850D4 41 82 00 10 */ beq lbl_801850E4 -lbl_801850D8: -/* 801850D8 7F E3 FB 78 */ mr r3, r31 -/* 801850DC 48 00 B0 49 */ bl nameMoveAnm__14dFile_select_cFv -/* 801850E0 7C 7A 1B 78 */ mr r26, r3 -lbl_801850E4: -/* 801850E4 3B 20 00 01 */ li r25, 1 -/* 801850E8 88 1F 03 60 */ lbz r0, 0x360(r31) -/* 801850EC 28 00 00 00 */ cmplwi r0, 0 -/* 801850F0 40 82 00 10 */ bne lbl_80185100 -/* 801850F4 88 1F 02 83 */ lbz r0, 0x283(r31) -/* 801850F8 28 00 00 00 */ cmplwi r0, 0 -/* 801850FC 41 82 00 10 */ beq lbl_8018510C -lbl_80185100: -/* 80185100 7F E3 FB 78 */ mr r3, r31 -/* 80185104 48 00 1B A9 */ bl menuMoveAnm__14dFile_select_cFv -/* 80185108 7C 79 1B 78 */ mr r25, r3 -lbl_8018510C: -/* 8018510C 7F E3 FB 78 */ mr r3, r31 -/* 80185110 48 00 83 0D */ bl modoruTxtDispAnm__14dFile_select_cFv -/* 80185114 57 A0 06 3E */ clrlwi r0, r29, 0x18 -/* 80185118 28 00 00 01 */ cmplwi r0, 1 -/* 8018511C 40 82 00 FC */ bne lbl_80185218 -/* 80185120 57 C0 06 3E */ clrlwi r0, r30, 0x18 -/* 80185124 28 00 00 01 */ cmplwi r0, 1 -/* 80185128 40 82 00 F0 */ bne lbl_80185218 -/* 8018512C 57 80 06 3E */ clrlwi r0, r28, 0x18 -/* 80185130 28 00 00 01 */ cmplwi r0, 1 -/* 80185134 40 82 00 E4 */ bne lbl_80185218 -/* 80185138 57 60 06 3E */ clrlwi r0, r27, 0x18 -/* 8018513C 28 00 00 01 */ cmplwi r0, 1 -/* 80185140 40 82 00 D8 */ bne lbl_80185218 -/* 80185144 57 40 06 3E */ clrlwi r0, r26, 0x18 -/* 80185148 28 00 00 01 */ cmplwi r0, 1 -/* 8018514C 40 82 00 CC */ bne lbl_80185218 -/* 80185150 57 20 06 3E */ clrlwi r0, r25, 0x18 -/* 80185154 28 00 00 01 */ cmplwi r0, 1 -/* 80185158 40 82 00 C0 */ bne lbl_80185218 -/* 8018515C 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 80185160 28 00 00 01 */ cmplwi r0, 1 -/* 80185164 40 82 00 B4 */ bne lbl_80185218 -/* 80185168 3B 20 00 00 */ li r25, 0 -/* 8018516C 3B C0 00 00 */ li r30, 0 -lbl_80185170: -/* 80185170 38 1E 00 BC */ addi r0, r30, 0xbc -/* 80185174 7C 7F 00 2E */ lwzx r3, r31, r0 -/* 80185178 48 0C E9 B5 */ bl reinit__8CPaneMgrFv -/* 8018517C 3B 39 00 01 */ addi r25, r25, 1 -/* 80185180 2C 19 00 03 */ cmpwi r25, 3 -/* 80185184 3B DE 00 04 */ addi r30, r30, 4 -/* 80185188 41 80 FF E8 */ blt lbl_80185170 -/* 8018518C 7F E3 FB 78 */ mr r3, r31 -/* 80185190 38 80 00 43 */ li r4, 0x43 -/* 80185194 38 A0 00 01 */ li r5, 1 -/* 80185198 38 C0 00 00 */ li r6, 0 -/* 8018519C 48 00 7F 49 */ bl headerTxtSet__14dFile_select_cFUsUcUc -/* 801851A0 88 1F 02 65 */ lbz r0, 0x265(r31) -/* 801851A4 98 1F 02 64 */ stb r0, 0x264(r31) -/* 801851A8 88 1F 02 65 */ lbz r0, 0x265(r31) -/* 801851AC 54 00 10 3A */ slwi r0, r0, 2 -/* 801851B0 7C 7F 02 14 */ add r3, r31, r0 -/* 801851B4 80 63 00 BC */ lwz r3, 0xbc(r3) -/* 801851B8 80 63 00 04 */ lwz r3, 4(r3) -/* 801851BC 80 9F 00 84 */ lwz r4, 0x84(r31) -/* 801851C0 81 83 00 00 */ lwz r12, 0(r3) -/* 801851C4 81 8C 00 60 */ lwz r12, 0x60(r12) -/* 801851C8 7D 89 03 A6 */ mtctr r12 -/* 801851CC 4E 80 04 21 */ bctrl -/* 801851D0 88 1F 02 65 */ lbz r0, 0x265(r31) -/* 801851D4 54 04 10 3A */ slwi r4, r0, 2 -/* 801851D8 3C 60 80 3C */ lis r3, SelStartFrameTbl@ha /* 0x803BA854@ha */ -/* 801851DC 38 63 A8 54 */ addi r3, r3, SelStartFrameTbl@l /* 0x803BA854@l */ -/* 801851E0 7C 03 20 2E */ lwzx r0, r3, r4 -/* 801851E4 7C 7F 22 14 */ add r3, r31, r4 -/* 801851E8 90 03 00 E0 */ stw r0, 0xe0(r3) -/* 801851EC 38 80 00 00 */ li r4, 0 -/* 801851F0 88 1F 02 65 */ lbz r0, 0x265(r31) -/* 801851F4 54 00 10 3A */ slwi r0, r0, 2 -/* 801851F8 7C 7F 02 14 */ add r3, r31, r0 -/* 801851FC 80 63 01 88 */ lwz r3, 0x188(r3) -/* 80185200 B0 83 00 16 */ sth r4, 0x16(r3) -/* 80185204 7F E3 FB 78 */ mr r3, r31 -/* 80185208 38 80 00 01 */ li r4, 1 -/* 8018520C 48 00 82 ED */ bl ketteiTxtDispAnmInit__14dFile_select_cFUc -/* 80185210 38 00 00 02 */ li r0, 2 -/* 80185214 98 1F 02 6F */ stb r0, 0x26f(r31) -lbl_80185218: -/* 80185218 39 61 00 30 */ addi r11, r1, 0x30 -/* 8018521C 48 1D CF FD */ bl _restgpr_25 -/* 80185220 80 01 00 34 */ lwz r0, 0x34(r1) -/* 80185224 7C 08 03 A6 */ mtlr r0 -/* 80185228 38 21 00 30 */ addi r1, r1, 0x30 -/* 8018522C 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/nameInputWait__14dFile_select_cFv.s b/asm/d/file/d_file_select/nameInputWait__14dFile_select_cFv.s deleted file mode 100644 index f8d36cca5e..0000000000 --- a/asm/d/file/d_file_select/nameInputWait__14dFile_select_cFv.s +++ /dev/null @@ -1,15 +0,0 @@ -lbl_80187384: -/* 80187384 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80187388 7C 08 02 A6 */ mflr r0 -/* 8018738C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80187390 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80187394 7C 7F 1B 78 */ mr r31, r3 -/* 80187398 80 63 00 68 */ lwz r3, 0x68(r3) -/* 8018739C 48 0C 74 51 */ bl showIcon__7dName_cFv -/* 801873A0 38 00 00 10 */ li r0, 0x10 -/* 801873A4 98 1F 02 6F */ stb r0, 0x26f(r31) -/* 801873A8 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 801873AC 80 01 00 14 */ lwz r0, 0x14(r1) -/* 801873B0 7C 08 03 A6 */ mtlr r0 -/* 801873B4 38 21 00 10 */ addi r1, r1, 0x10 -/* 801873B8 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/nameToDataSelectMove__14dFile_select_cFv.s b/asm/d/file/d_file_select/nameToDataSelectMove__14dFile_select_cFv.s deleted file mode 100644 index 10075f6399..0000000000 --- a/asm/d/file/d_file_select/nameToDataSelectMove__14dFile_select_cFv.s +++ /dev/null @@ -1,43 +0,0 @@ -lbl_801874F8: -/* 801874F8 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 801874FC 7C 08 02 A6 */ mflr r0 -/* 80187500 90 01 00 24 */ stw r0, 0x24(r1) -/* 80187504 39 61 00 20 */ addi r11, r1, 0x20 -/* 80187508 48 1D AC D1 */ bl _savegpr_28 -/* 8018750C 7C 7C 1B 78 */ mr r28, r3 -/* 80187510 48 00 5D 4D */ bl headerTxtChangeAnm__14dFile_select_cFv -/* 80187514 7C 7D 1B 78 */ mr r29, r3 -/* 80187518 7F 83 E3 78 */ mr r3, r28 -/* 8018751C 48 00 89 D9 */ bl fileRecScaleAnm2__14dFile_select_cFv -/* 80187520 7C 7E 1B 78 */ mr r30, r3 -/* 80187524 7F 83 E3 78 */ mr r3, r28 -/* 80187528 48 00 8B FD */ bl nameMoveAnm__14dFile_select_cFv -/* 8018752C 7C 7F 1B 78 */ mr r31, r3 -/* 80187530 7F 83 E3 78 */ mr r3, r28 -/* 80187534 48 00 5E E9 */ bl modoruTxtDispAnm__14dFile_select_cFv -/* 80187538 57 A0 06 3E */ clrlwi r0, r29, 0x18 -/* 8018753C 28 00 00 01 */ cmplwi r0, 1 -/* 80187540 40 82 00 44 */ bne lbl_80187584 -/* 80187544 57 C0 06 3E */ clrlwi r0, r30, 0x18 -/* 80187548 28 00 00 01 */ cmplwi r0, 1 -/* 8018754C 40 82 00 38 */ bne lbl_80187584 -/* 80187550 57 E0 06 3E */ clrlwi r0, r31, 0x18 -/* 80187554 28 00 00 01 */ cmplwi r0, 1 -/* 80187558 40 82 00 2C */ bne lbl_80187584 -/* 8018755C 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 80187560 28 00 00 01 */ cmplwi r0, 1 -/* 80187564 40 82 00 20 */ bne lbl_80187584 -/* 80187568 7F 83 E3 78 */ mr r3, r28 -/* 8018756C 38 80 00 00 */ li r4, 0 -/* 80187570 48 00 5D D5 */ bl modoruTxtChange__14dFile_select_cFUc -/* 80187574 7F 83 E3 78 */ mr r3, r28 -/* 80187578 48 00 61 ED */ bl selFileCursorShow__14dFile_select_cFv -/* 8018757C 38 00 00 03 */ li r0, 3 -/* 80187580 98 1C 02 6F */ stb r0, 0x26f(r28) -lbl_80187584: -/* 80187584 39 61 00 20 */ addi r11, r1, 0x20 -/* 80187588 48 1D AC 9D */ bl _restgpr_28 -/* 8018758C 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80187590 7C 08 03 A6 */ mtlr r0 -/* 80187594 38 21 00 20 */ addi r1, r1, 0x20 -/* 80187598 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/selectDataNameMove__14dFile_select_cFv.s b/asm/d/file/d_file_select/selectDataNameMove__14dFile_select_cFv.s deleted file mode 100644 index ec6567e130..0000000000 --- a/asm/d/file/d_file_select/selectDataNameMove__14dFile_select_cFv.s +++ /dev/null @@ -1,38 +0,0 @@ -lbl_80186638: -/* 80186638 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 8018663C 7C 08 02 A6 */ mflr r0 -/* 80186640 90 01 00 24 */ stw r0, 0x24(r1) -/* 80186644 39 61 00 20 */ addi r11, r1, 0x20 -/* 80186648 48 1D BB 91 */ bl _savegpr_28 -/* 8018664C 7C 7C 1B 78 */ mr r28, r3 -/* 80186650 48 00 6C 0D */ bl headerTxtChangeAnm__14dFile_select_cFv -/* 80186654 7C 7D 1B 78 */ mr r29, r3 -/* 80186658 7F 83 E3 78 */ mr r3, r28 -/* 8018665C 48 00 98 99 */ bl fileRecScaleAnm2__14dFile_select_cFv -/* 80186660 7C 7E 1B 78 */ mr r30, r3 -/* 80186664 7F 83 E3 78 */ mr r3, r28 -/* 80186668 48 00 9A BD */ bl nameMoveAnm__14dFile_select_cFv -/* 8018666C 7C 7F 1B 78 */ mr r31, r3 -/* 80186670 7F 83 E3 78 */ mr r3, r28 -/* 80186674 48 00 6D A9 */ bl modoruTxtDispAnm__14dFile_select_cFv -/* 80186678 57 A0 06 3E */ clrlwi r0, r29, 0x18 -/* 8018667C 28 00 00 01 */ cmplwi r0, 1 -/* 80186680 40 82 00 30 */ bne lbl_801866B0 -/* 80186684 57 C0 06 3E */ clrlwi r0, r30, 0x18 -/* 80186688 28 00 00 01 */ cmplwi r0, 1 -/* 8018668C 40 82 00 24 */ bne lbl_801866B0 -/* 80186690 57 E0 06 3E */ clrlwi r0, r31, 0x18 -/* 80186694 28 00 00 01 */ cmplwi r0, 1 -/* 80186698 40 82 00 18 */ bne lbl_801866B0 -/* 8018669C 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 801866A0 28 00 00 01 */ cmplwi r0, 1 -/* 801866A4 40 82 00 0C */ bne lbl_801866B0 -/* 801866A8 38 00 00 0F */ li r0, 0xf -/* 801866AC 98 1C 02 6F */ stb r0, 0x26f(r28) -lbl_801866B0: -/* 801866B0 39 61 00 20 */ addi r11, r1, 0x20 -/* 801866B4 48 1D BB 71 */ bl _restgpr_28 -/* 801866B8 80 01 00 24 */ lwz r0, 0x24(r1) -/* 801866BC 7C 08 03 A6 */ mtlr r0 -/* 801866C0 38 21 00 20 */ addi r1, r1, 0x20 -/* 801866C4 4E 80 00 20 */ blr diff --git a/asm/d/file/d_file_select/selectDataOpenEraseMove__14dFile_select_cFv.s b/asm/d/file/d_file_select/selectDataOpenEraseMove__14dFile_select_cFv.s deleted file mode 100644 index 5ae6db4f9c..0000000000 --- a/asm/d/file/d_file_select/selectDataOpenEraseMove__14dFile_select_cFv.s +++ /dev/null @@ -1,45 +0,0 @@ -lbl_801866C8: -/* 801866C8 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 801866CC 7C 08 02 A6 */ mflr r0 -/* 801866D0 90 01 00 24 */ stw r0, 0x24(r1) -/* 801866D4 39 61 00 20 */ addi r11, r1, 0x20 -/* 801866D8 48 1D BB 01 */ bl _savegpr_28 -/* 801866DC 7C 7C 1B 78 */ mr r28, r3 -/* 801866E0 48 00 6B 7D */ bl headerTxtChangeAnm__14dFile_select_cFv -/* 801866E4 7C 7D 1B 78 */ mr r29, r3 -/* 801866E8 7F 83 E3 78 */ mr r3, r28 -/* 801866EC 4B FF F3 C1 */ bl selectDataMoveAnm__14dFile_select_cFv -/* 801866F0 7C 7E 1B 78 */ mr r30, r3 -/* 801866F4 7F 83 E3 78 */ mr r3, r28 -/* 801866F8 48 00 26 41 */ bl yesnoMenuMoveAnm__14dFile_select_cFv -/* 801866FC 7F 83 E3 78 */ mr r3, r28 -/* 80186700 48 00 6D 1D */ bl modoruTxtDispAnm__14dFile_select_cFv -/* 80186704 7C 7F 1B 78 */ mr r31, r3 -/* 80186708 7F 83 E3 78 */ mr r3, r28 -/* 8018670C 88 9C 02 65 */ lbz r4, 0x265(r28) -/* 80186710 48 00 6F 7D */ bl selectWakuAlpahAnm__14dFile_select_cFUc -/* 80186714 57 A0 06 3E */ clrlwi r0, r29, 0x18 -/* 80186718 28 00 00 01 */ cmplwi r0, 1 -/* 8018671C 40 82 00 40 */ bne lbl_8018675C -/* 80186720 57 C0 06 3E */ clrlwi r0, r30, 0x18 -/* 80186724 28 00 00 01 */ cmplwi r0, 1 -/* 80186728 40 82 00 34 */ bne lbl_8018675C -/* 8018672C 57 E0 06 3E */ clrlwi r0, r31, 0x18 -/* 80186730 28 00 00 01 */ cmplwi r0, 1 -/* 80186734 40 82 00 28 */ bne lbl_8018675C -/* 80186738 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 8018673C 28 00 00 01 */ cmplwi r0, 1 -/* 80186740 40 82 00 1C */ bne lbl_8018675C -/* 80186744 38 00 00 02 */ li r0, 2 -/* 80186748 98 1C 02 6E */ stb r0, 0x26e(r28) -/* 8018674C 7F 83 E3 78 */ mr r3, r28 -/* 80186750 48 00 29 DD */ bl yesnoCursorShow__14dFile_select_cFv -/* 80186754 38 00 00 1A */ li r0, 0x1a -/* 80186758 98 1C 02 6F */ stb r0, 0x26f(r28) -lbl_8018675C: -/* 8018675C 39 61 00 20 */ addi r11, r1, 0x20 -/* 80186760 48 1D BA C5 */ bl _restgpr_28 -/* 80186764 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80186768 7C 08 03 A6 */ mtlr r0 -/* 8018676C 38 21 00 20 */ addi r1, r1, 0x20 -/* 80186770 4E 80 00 20 */ blr diff --git a/asm/d/s/d_s_play/dScnPly_Create__FP11scene_class.s b/asm/d/s/d_s_play/dScnPly_Create__FP11scene_class.s deleted file mode 100644 index 2bb0979e6d..0000000000 --- a/asm/d/s/d_s_play/dScnPly_Create__FP11scene_class.s +++ /dev/null @@ -1,13 +0,0 @@ -lbl_8025AB94: -/* 8025AB94 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8025AB98 7C 08 02 A6 */ mflr r0 -/* 8025AB9C 90 01 00 14 */ stw r0, 0x14(r1) -/* 8025ABA0 7C 65 1B 78 */ mr r5, r3 -/* 8025ABA4 38 65 01 C4 */ addi r3, r5, 0x1c4 -/* 8025ABA8 3C 80 80 3C */ lis r4, l_method@ha /* 0x803C3194@ha */ -/* 8025ABAC 38 84 31 94 */ addi r4, r4, l_method@l /* 0x803C3194@l */ -/* 8025ABB0 4B DD 4F 71 */ bl dComLbG_PhaseHandler__FP30request_of_phase_process_classPPFPv_iPv -/* 8025ABB4 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8025ABB8 7C 08 03 A6 */ mtlr r0 -/* 8025ABBC 38 21 00 10 */ addi r1, r1, 0x10 -/* 8025ABC0 4E 80 00 20 */ blr diff --git a/asm/m_Do/m_Do_main/__sinit_m_Do_main_cpp.s b/asm/m_Do/m_Do_main/__sinit_m_Do_main_cpp.s deleted file mode 100644 index b0b6dfcd9d..0000000000 --- a/asm/m_Do/m_Do_main/__sinit_m_Do_main_cpp.s +++ /dev/null @@ -1,111 +0,0 @@ -lbl_800065E0: -/* 800065E0 3C 60 80 3D */ lis r3, RootHeapCheck@ha /* 0x803D32E0@ha */ -/* 800065E4 38 C3 32 E0 */ addi r6, r3, RootHeapCheck@l /* 0x803D32E0@l */ -/* 800065E8 3C 60 80 37 */ lis r3, m_Do_m_Do_main__stringBase0@ha /* 0x803739A0@ha */ -/* 800065EC 38 A3 39 A0 */ addi r5, r3, m_Do_m_Do_main__stringBase0@l /* 0x803739A0@l */ -/* 800065F0 38 65 02 9F */ addi r3, r5, 0x29f -/* 800065F4 38 85 02 A4 */ addi r4, r5, 0x2a4 -/* 800065F8 90 66 00 00 */ stw r3, 0(r6) -/* 800065FC 38 66 00 00 */ addi r3, r6, 0 -/* 80006600 90 83 00 04 */ stw r4, 4(r3) -/* 80006604 38 80 00 00 */ li r4, 0 -/* 80006608 90 83 00 08 */ stw r4, 8(r3) -/* 8000660C 90 03 00 0C */ stw r0, 0xc(r3) -/* 80006610 90 03 00 10 */ stw r0, 0x10(r3) -/* 80006614 90 03 00 14 */ stw r0, 0x14(r3) -/* 80006618 90 03 00 18 */ stw r0, 0x18(r3) -/* 8000661C 90 03 00 1C */ stw r0, 0x1c(r3) -/* 80006620 90 03 00 20 */ stw r0, 0x20(r3) -/* 80006624 90 03 00 24 */ stw r0, 0x24(r3) -/* 80006628 38 65 02 AB */ addi r3, r5, 0x2ab -/* 8000662C 38 E5 02 B2 */ addi r7, r5, 0x2b2 -/* 80006630 90 66 00 28 */ stw r3, 0x28(r6) -/* 80006634 38 66 00 28 */ addi r3, r6, 0x28 -/* 80006638 90 E3 00 04 */ stw r7, 4(r3) -/* 8000663C 90 83 00 08 */ stw r4, 8(r3) -/* 80006640 90 03 00 0C */ stw r0, 0xc(r3) -/* 80006644 90 03 00 10 */ stw r0, 0x10(r3) -/* 80006648 90 03 00 14 */ stw r0, 0x14(r3) -/* 8000664C 90 03 00 18 */ stw r0, 0x18(r3) -/* 80006650 90 03 00 1C */ stw r0, 0x1c(r3) -/* 80006654 90 03 00 20 */ stw r0, 0x20(r3) -/* 80006658 90 03 00 24 */ stw r0, 0x24(r3) -/* 8000665C 38 65 02 BB */ addi r3, r5, 0x2bb -/* 80006660 38 E5 02 C1 */ addi r7, r5, 0x2c1 -/* 80006664 90 66 00 50 */ stw r3, 0x50(r6) -/* 80006668 38 66 00 50 */ addi r3, r6, 0x50 -/* 8000666C 90 E3 00 04 */ stw r7, 4(r3) -/* 80006670 90 83 00 08 */ stw r4, 8(r3) -/* 80006674 90 03 00 0C */ stw r0, 0xc(r3) -/* 80006678 90 03 00 10 */ stw r0, 0x10(r3) -/* 8000667C 90 03 00 14 */ stw r0, 0x14(r3) -/* 80006680 90 03 00 18 */ stw r0, 0x18(r3) -/* 80006684 90 03 00 1C */ stw r0, 0x1c(r3) -/* 80006688 90 03 00 20 */ stw r0, 0x20(r3) -/* 8000668C 90 03 00 24 */ stw r0, 0x24(r3) -/* 80006690 38 65 02 C8 */ addi r3, r5, 0x2c8 -/* 80006694 38 E5 02 CD */ addi r7, r5, 0x2cd -/* 80006698 90 66 00 78 */ stw r3, 0x78(r6) -/* 8000669C 38 66 00 78 */ addi r3, r6, 0x78 -/* 800066A0 90 E3 00 04 */ stw r7, 4(r3) -/* 800066A4 90 83 00 08 */ stw r4, 8(r3) -/* 800066A8 90 03 00 0C */ stw r0, 0xc(r3) -/* 800066AC 90 03 00 10 */ stw r0, 0x10(r3) -/* 800066B0 90 03 00 14 */ stw r0, 0x14(r3) -/* 800066B4 90 03 00 18 */ stw r0, 0x18(r3) -/* 800066B8 90 03 00 1C */ stw r0, 0x1c(r3) -/* 800066BC 90 03 00 20 */ stw r0, 0x20(r3) -/* 800066C0 90 03 00 24 */ stw r0, 0x24(r3) -/* 800066C4 38 65 02 D4 */ addi r3, r5, 0x2d4 -/* 800066C8 38 E5 02 DC */ addi r7, r5, 0x2dc -/* 800066CC 90 66 00 A0 */ stw r3, 0xa0(r6) -/* 800066D0 38 66 00 A0 */ addi r3, r6, 0xa0 -/* 800066D4 90 E3 00 04 */ stw r7, 4(r3) -/* 800066D8 90 83 00 08 */ stw r4, 8(r3) -/* 800066DC 90 03 00 0C */ stw r0, 0xc(r3) -/* 800066E0 90 03 00 10 */ stw r0, 0x10(r3) -/* 800066E4 90 03 00 14 */ stw r0, 0x14(r3) -/* 800066E8 90 03 00 18 */ stw r0, 0x18(r3) -/* 800066EC 90 03 00 1C */ stw r0, 0x1c(r3) -/* 800066F0 90 03 00 20 */ stw r0, 0x20(r3) -/* 800066F4 90 03 00 24 */ stw r0, 0x24(r3) -/* 800066F8 38 65 02 E7 */ addi r3, r5, 0x2e7 -/* 800066FC 38 E5 02 EB */ addi r7, r5, 0x2eb -/* 80006700 90 66 00 C8 */ stw r3, 0xc8(r6) -/* 80006704 38 66 00 C8 */ addi r3, r6, 0xc8 -/* 80006708 90 E3 00 04 */ stw r7, 4(r3) -/* 8000670C 90 83 00 08 */ stw r4, 8(r3) -/* 80006710 90 03 00 0C */ stw r0, 0xc(r3) -/* 80006714 90 03 00 10 */ stw r0, 0x10(r3) -/* 80006718 90 03 00 14 */ stw r0, 0x14(r3) -/* 8000671C 90 03 00 18 */ stw r0, 0x18(r3) -/* 80006720 90 03 00 1C */ stw r0, 0x1c(r3) -/* 80006724 90 03 00 20 */ stw r0, 0x20(r3) -/* 80006728 90 03 00 24 */ stw r0, 0x24(r3) -/* 8000672C 38 65 02 EF */ addi r3, r5, 0x2ef -/* 80006730 38 E5 02 F6 */ addi r7, r5, 0x2f6 -/* 80006734 90 66 00 F0 */ stw r3, 0xf0(r6) -/* 80006738 38 66 00 F0 */ addi r3, r6, 0xf0 -/* 8000673C 90 E3 00 04 */ stw r7, 4(r3) -/* 80006740 90 83 00 08 */ stw r4, 8(r3) -/* 80006744 90 03 00 0C */ stw r0, 0xc(r3) -/* 80006748 90 03 00 10 */ stw r0, 0x10(r3) -/* 8000674C 90 03 00 14 */ stw r0, 0x14(r3) -/* 80006750 90 03 00 18 */ stw r0, 0x18(r3) -/* 80006754 90 03 00 1C */ stw r0, 0x1c(r3) -/* 80006758 90 03 00 20 */ stw r0, 0x20(r3) -/* 8000675C 90 03 00 24 */ stw r0, 0x24(r3) -/* 80006760 38 65 02 FF */ addi r3, r5, 0x2ff -/* 80006764 38 A5 03 07 */ addi r5, r5, 0x307 -/* 80006768 90 66 01 18 */ stw r3, 0x118(r6) -/* 8000676C 38 66 01 18 */ addi r3, r6, 0x118 -/* 80006770 90 A3 00 04 */ stw r5, 4(r3) -/* 80006774 90 83 00 08 */ stw r4, 8(r3) -/* 80006778 90 03 00 0C */ stw r0, 0xc(r3) -/* 8000677C 90 03 00 10 */ stw r0, 0x10(r3) -/* 80006780 90 03 00 14 */ stw r0, 0x14(r3) -/* 80006784 90 03 00 18 */ stw r0, 0x18(r3) -/* 80006788 90 03 00 1C */ stw r0, 0x1c(r3) -/* 8000678C 90 03 00 20 */ stw r0, 0x20(r3) -/* 80006790 90 03 00 24 */ stw r0, 0x24(r3) -/* 80006794 4E 80 00 20 */ blr diff --git a/include/JSystem/JAudio2/JASResArcLoader.h b/include/JSystem/JAudio2/JASResArcLoader.h index baab677594..9f247a0f95 100644 --- a/include/JSystem/JAudio2/JASResArcLoader.h +++ b/include/JSystem/JAudio2/JASResArcLoader.h @@ -1,10 +1,7 @@ #ifndef JASRESARCLOADER_H #define JASRESARCLOADER_H -#include "dolphin/types.h" - -typedef struct OSMessageQueue OSMessageQueue; -class JKRArchive; +#include "JSystem/JKernel/JKRArchive.h" namespace JASResArcLoader { /* 80290BD0 */ size_t getResSize(JKRArchive const*, u16); @@ -13,7 +10,8 @@ namespace JASResArcLoader { /* 80290D18 */ int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, u32), u32); }; - +typedef struct OSMessageQueue OSMessageQueue; +class JKRArchive; // from pikmin2 typedef void (*LoadCallback)(u32, u32); diff --git a/include/MSL_C/MSL_Common/Src/alloc.h b/include/MSL_C/MSL_Common/Src/alloc.h index 67b7763feb..abf8359183 100644 --- a/include/MSL_C/MSL_Common/Src/alloc.h +++ b/include/MSL_C/MSL_Common/Src/alloc.h @@ -8,7 +8,7 @@ extern "C" { #endif void free(FILE* file); -void __pool_free(); +void __pool_free(int **param_1, unsigned int **param_2); #ifdef __cplusplus } diff --git a/include/SSystem/SComponent/c_phase.h b/include/SSystem/SComponent/c_phase.h index 32ed36683a..cd62edc0f2 100644 --- a/include/SSystem/SComponent/c_phase.h +++ b/include/SSystem/SComponent/c_phase.h @@ -20,7 +20,7 @@ typedef struct request_of_phase_process_class { int id; } request_of_phase_process_class; -typedef int (**request_of_phase_process_fn)(void*); +typedef int (*request_of_phase_process_fn)(void*); void cPhs_Reset(request_of_phase_process_class* pPhase); void cPhs_Set(request_of_phase_process_class* pPhase, cPhs__Handler* pHandlerTable); diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index 78d2775b0f..0178c53612 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -788,7 +788,7 @@ extern GXColor g_blackColor; extern GXColor g_clearColor; extern GXColor g_whiteColor; -int dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn, void*); +int dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn*, void*); BOOL dComIfG_resetToOpening(scene_class* scene); char* dComIfG_getRoomArcName(int roomNo); void* dComIfG_getStageRes(char const* resName); @@ -1497,6 +1497,10 @@ inline void dComIfGs_setNewFile(u8 i_fileNo) { return g_dComIfG_gameInfo.info.setNewFile(i_fileNo); } +inline void dComIfGs_i_setNewFile(u8 i_fileNo) { + return g_dComIfG_gameInfo.info.setNewFile(i_fileNo); +} + inline char* dComIfGs_getPlayerName() { return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getLinkName(); } @@ -1527,6 +1531,14 @@ inline void dComIfGs_setPlayerFieldLastStayInfo(const char* i_stage, cXyz& i_pos i_point, i_region); } +inline void dComIfGs_setPlayerName(const char* i_name) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().setPlayerName(i_name); +} + +inline void dComIfGs_setHorseName(const char* i_name) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().setHorseName(i_name); +} + inline void dComIfGs_setStartPoint(s16 i_point) { g_dComIfG_gameInfo.info.getRestart().setStartPoint(i_point); } @@ -1671,6 +1683,10 @@ inline u8 dComIfGs_getNewFile() { return g_dComIfG_gameInfo.info.getNewFile(); } +inline u8 dComIfGs_getNoFile() { + return g_dComIfG_gameInfo.info.getNoFile(); +} + inline void dComIfGs_setInitDataToCard(u8* i_saveData, int i_dataNum) { g_dComIfG_gameInfo.info.initdata_to_card((char*)i_saveData, i_dataNum); } diff --git a/include/d/d_bright_check.h b/include/d/d_bright_check.h index cb1278cb35..52dc8ba14a 100644 --- a/include/d/d_bright_check.h +++ b/include/d/d_bright_check.h @@ -2,5 +2,23 @@ #define D_D_BRIGHT_CHECK_H #include "dolphin/types.h" +#include "d/com/d_com_inf_game.h" + +// class dBrightCheck_c { +// public: +// /* 80192F10 */ dBrightCheck_c(JKRArchive*); +// /* 80192F98 */ ~dBrightCheck_c(); +// /* 80193030 */ void screenSet(); +// /* 801934D0 */ void _move(); +// /* 80193508 */ void modeWait(); +// /* 8019350C */ void modeMove(); +// /* 80193594 */ void _draw(); + +// bool isEnd() { return mEnd; } + +// void* vtable; +// /* 0x04 */ u8 field_0x4[0x15]; +// /* 0x19 */ bool mEnd; +// }; #endif /* D_D_BRIGHT_CHECK_H */ diff --git a/include/d/d_lib.h b/include/d/d_lib.h index dddaaa9c5c..0d183141c6 100644 --- a/include/d/d_lib.h +++ b/include/d/d_lib.h @@ -12,7 +12,8 @@ u32 dLib_getExpandSizeFromAramArchive(JKRAramArchive* arc, char const* resName); BOOL dLib_checkActorInRectangle(fopAc_ac_c* param_0, fopAc_ac_c* param_1, cXyz const* param_2, cXyz const* param_3); -struct STControl { +class STControl { +public: STControl() { setWaitParm(15, 15, 0, 0, 0.9f, 0.5f, 0, 0x2000); init(); diff --git a/include/d/d_name.h b/include/d/d_name.h index d2150301ec..a84c60e5d9 100644 --- a/include/d/d_name.h +++ b/include/d/d_name.h @@ -3,6 +3,8 @@ #include "d/d_drawlist.h" #include "dolphin/types.h" +#include "d/d_select_cursor.h" +#include "MSL_C/string.h" class CPaneMgr; class CPaneMgrAlpha; @@ -11,7 +13,6 @@ class J2DAnmTextureSRTKey; class J2DTextBox; class JUTFont; struct STControl; -class dSelect_cursor_c; class dNm_HIO_c { public: @@ -61,15 +62,15 @@ public: }; enum { - MOJI_HIRA, - MOJI_KATA, - MOJI_EIGO, + MOJI_HIRA, // hiragana characters + MOJI_KATA, // katakana characters + MOJI_EIGO, // english characters }; enum { - MENU_HIRA, - MENU_KATA, - MENU_EIGO, + MENU_HIRA, // hiragana menu + MENU_KATA, // katakana menu + MENU_EIGO, // english menu MENU_END, }; @@ -115,6 +116,13 @@ public: /* 8024E468 */ virtual ~dName_c(); + u8 getCurPos() { return mCurPos; } + u8 isInputEnd() { return mIsInputEnd; } + char* getInputStrPtr() { return mInputStr; } + void hideIcon() { mSelIcon->setAlphaRate(0.0f); } + void setNextNameStr(char* i_name) { strcpy(mNextNameStr,i_name); } + void draw() { _draw(); } + private: /* 0x004 */ STControl* stick; /* 0x008 */ JKRArchive* archive; diff --git a/include/d/file/d_file_sel_info.h b/include/d/file/d_file_sel_info.h index 060b90517f..babb6bbde4 100644 --- a/include/d/file/d_file_sel_info.h +++ b/include/d/file/d_file_sel_info.h @@ -24,6 +24,7 @@ public: void setBasePane(J2DPane* pane) { mFileInfo.mBasePane = pane; } CPaneMgrAlpha* getDatBase() { return mDatBase; } CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; } + void draw() { _draw(); } private: /* 0x04 */ JKRArchive* mArchive; diff --git a/include/d/file/d_file_sel_warning.h b/include/d/file/d_file_sel_warning.h index d347b7ee86..c1143545ef 100644 --- a/include/d/file/d_file_sel_warning.h +++ b/include/d/file/d_file_sel_warning.h @@ -24,6 +24,7 @@ public: /* 80191C18 */ virtual ~dFile_warning_c(); u8 getStatus() { return mStatus; } + void draw() { _draw(); } u8 field_0x4[0x3D - 0x4]; /* 0x3D */ u8 mStatus; diff --git a/include/d/file/d_file_select.h b/include/d/file/d_file_select.h index 5c274e7574..65fdb5b7ef 100644 --- a/include/d/file/d_file_select.h +++ b/include/d/file/d_file_select.h @@ -2,24 +2,13 @@ #define D_FILE_D_FILE_SELECT_H #include "dolphin/types.h" -#include "global.h" - -class CPaneMgr; -class CPaneMgrAlpha; -class J2DAnmBase; -class J2DAnmTransform; -class J2DPane; -class J2DPicture; -class J2DScreen; -class JKRArchive; -class JUTFont; -struct STControl; -struct cXyz; -class dFile_warning_c; -class dMsgString_c; -class dName_c; -class dSelect_cursor_c; -class dSv_save_c; +#include "d/com/d_com_inf_game.h" +#include "m_Do/m_Do_MemCard.h" +#include "d/file/d_file_sel_warning.h" +#include "d/d_name.h" +#include "d/msg/d_msg_string.h" +#include "JSystem/J3DGraphLoader/J3DModelLoader.h" +#include "JSystem/J3DGraphLoader/J3DAnmLoader.h" class dDlst_FileSel_c { public: @@ -30,7 +19,8 @@ public: /* 0x04 */ J2DScreen* mpScreen; }; -struct dFile_select3D_c { +class dFile_select3D_c { +public: /* 801902F0 */ dFile_select3D_c(); /* 80190380 */ ~dFile_select3D_c(); /* 801903DC */ void _create(u8, u8); @@ -46,9 +36,33 @@ struct dFile_select3D_c { /* 80190D68 */ void createMirrorModel(); /* 80190FE8 */ void toItem3Dpos(f32, f32, f32, cXyz*); /* 801910D4 */ void calcViewMtx(f32 (*)[4]); + + void drawOff() { mpModel = 0; } + + /* 0x0000 */ void* vtable; + /* 0x0004 */ JKRSolidHeap* mpHeap; + /* 0x0008 */ J3DModel* mpModel; + /* 0x000C */ mDoExt_bckAnm* mBckAnm; + /* 0x0010 */ mDoExt_brkAnm* mBrkAnm; + /* 0x0014 */ J3DLightInfo mLightInfo; + /* 0x0048 */ u8 field_0x0048[0x0088 - 0x0048]; + /* 0x0088 */ J3DLightObj mLightObjects[6]; + /* 0x0340 */ u8 field_0x0340[0x039C - 0x0340]; + /* 0x039C */ J2DPane* pane; + /* 0x03A0 */ u8 field_0x03A0[0x03A4 - 0x03A0]; + /* 0x03A4 */ cXyz field_0x03a4; + /* 0x03B0 */ csXyz field_0x03b0; + /* 0x03B6 */ u8 padding[2]; + /* 0x03B8 */ cXyz field_0x03b8; + /* 0x03C4 */ float field_0x03c4; + /* 0x03C8 */ float field_0x03c8; + /* 0x03CC */ u8 field_0x03CC[0x03CE - 0x03CC]; + /* 0x03CE */ u8 mMirrorIdx; + /* 0x03CF */ u8 mMaskIdx; }; -struct dDlst_FileSelYn_c { +class dDlst_FileSelYn_c { +public: /* 8018E0C0 */ void draw(); /* 801911F4 */ ~dDlst_FileSelYn_c(); @@ -57,7 +71,8 @@ struct dDlst_FileSelYn_c { /* 0x08 */ u8 field_0x08[4]; }; -struct dDlst_FileSelDt_c { +class dDlst_FileSelDt_c { +public: /* 8018DEF4 */ void draw(); /* 801912E4 */ ~dDlst_FileSelDt_c(); @@ -67,7 +82,8 @@ struct dDlst_FileSelDt_c { /* 0x0C */ u8 field_0x0c[4]; }; -struct dDlst_FileSelCp_c { +class dDlst_FileSelCp_c { +public: /* 8018DFFC */ void draw(); /* 8019126C */ ~dDlst_FileSelCp_c(); @@ -78,7 +94,8 @@ struct dDlst_FileSelCp_c { /* 0x10 */ J2DPane* mpPane2; }; -struct dDlst_FileSel3m_c { +class dDlst_FileSel3m_c { +public: /* 8018E0F8 */ void draw(); /* 8019117C */ ~dDlst_FileSel3m_c(); @@ -86,10 +103,13 @@ struct dDlst_FileSel3m_c { /* 0x04 */ J2DScreen* mpScreen; }; -struct dFile_info_c { +class dFile_info_c { +public: /* 80192434 */ dFile_info_c(JKRArchive*, u8); /* 80192954 */ void setSaveData(dSv_save_c*, int, u8); /* 80192D60 */ void _draw(); + + void draw() { _draw(); } }; // temp struct in order to get matches @@ -163,14 +183,14 @@ public: /* 80184B44 */ void dataDelEffAnm(); /* 80184BFC */ void dataCopyEffAnm(); /* 80184CB4 */ void selectDataBaseMoveAnmInitSet(int, int); - /* 80184D4C */ void selectDataBaseMoveAnm(); + /* 80184D4C */ bool selectDataBaseMoveAnm(); /* 80184E38 */ void dataSelectInAnmSet(); /* 80185040 */ void dataSelectIn(); /* 80185230 */ void dataSelectInit(); /* 801853C4 */ void dataSelect(); /* 80185508 */ void dataSelectStart(); /* 80185994 */ void selectDataMoveAnmInitSet(int, int); - /* 80185AAC */ void selectDataMoveAnm(); + /* 80185AAC */ bool selectDataMoveAnm(); /* 80185C2C */ void dataSelectAnmSet(); /* 80185DE0 */ void dataSelectMoveAnime(); /* 80186088 */ void makeRecInfo(u8); @@ -205,7 +225,7 @@ public: /* 8018832C */ void copyDataToSelectMoveAnmSet(); /* 801884D0 */ void copyDataToSelectMoveAnm(); /* 80188834 */ void copySelectWakuAlpahAnmInit(u8, u8, u8, u8); - /* 80188878 */ void copySelectWakuAlpahAnm(u8); + /* 80188878 */ bool copySelectWakuAlpahAnm(u8); /* 80188950 */ void getCptoNum(u8); /* 80188994 */ void copyToSelBack(); /* 80188B54 */ void copyToSelPaneMove(); @@ -252,10 +272,10 @@ public: /* 8018D4F8 */ void ketteiTxtDispAnmInit(u8); /* 8018D574 */ bool ketteiTxtDispAnm(); /* 8018D650 */ void selectWakuAlpahAnmInit(u8, u8, u8, u8); - /* 8018D68C */ void selectWakuAlpahAnm(u8); + /* 8018D68C */ bool selectWakuAlpahAnm(u8); /* 8018D764 */ void selFileCursorShow(); /* 8018D884 */ void menuWakuAlpahAnmInit(u8, u8, u8, u8); - /* 8018D8C8 */ void menuWakuAlpahAnm(u8); + /* 8018D8C8 */ bool menuWakuAlpahAnm(u8); /* 8018DA10 */ void menuCursorShow(); /* 8018DB80 */ void yesnoWakuAlpahAnmInit(u8, u8, u8, u8); /* 8018DBCC */ void yesnoWakuAlpahAnm(u8); @@ -302,7 +322,7 @@ public: /* 8018FD30 */ void errorTxtChangeAnm(); /* 8018FE18 */ bool fileRecScaleAnm(); /* 8018FE64 */ void fileRecScaleAnmInitSet2(f32, f32); - /* 8018FEF4 */ void fileRecScaleAnm2(); + /* 8018FEF4 */ bool fileRecScaleAnm2(); /* 8018FF9C */ bool fileInfoScaleAnm(); /* 80190074 */ void nameMoveAnmInitSet(int, int); /* 80190124 */ bool nameMoveAnm(); @@ -328,23 +348,33 @@ public: /* 0x0034 */ dDlst_FileSelCp_c mFileSelCopyDlst; /* 0x0048 */ dDlst_FileSelYn_c mFileSelYesNoDlst; /* 0x0054 */ dDlst_FileSel3m_c mFileSel3mDlst; - /* 0x005C */ u8 field_0x00[4]; + /* 0x005C */ u8 field_0x005c[4]; /* 0x0060 */ dSelect_cursor_c* mpCursor1; /* 0x0064 */ dSelect_cursor_c* mpCursor2; /* 0x0068 */ dName_c* mpName; /* 0x006C */ dFile_warning_c* mpFileWarning; /* 0x0070 */ u8 field_0x70[0xc]; /* 0x007C */ dFile_info_c* mpFileInfo[2]; - /* 0x0084 */ J2DAnmBase* mpAnmBase[7]; - /* 0x00A0 */ u8 field_0xa0[4]; - /* 0x00A4 */ CPaneMgr* mpPaneMgr1; - /* 0x00A8 */ u8 field_0xa8[0xbc-0xa8]; - /* 0x00BC */ CPaneMgr* mpPaneMgrs[4]; + /* 0x0084 */ J2DAnmTransform* mpAnmBase[7]; // this might be 7 individual pointers and not an array + /* 0x00A0 */ u8 field_0x00a0[4]; + /* 0x00A4 */ CPaneMgr* field_0x00a4; + /* 0x00A8 */ u8 field_0x00a8[0xb0-0xa8]; + /* 0x00B0 */ s32 field_0x00b0; + /* 0x00B4 */ s32 field_0x00b4; + /* 0x00B8 */ u8 field_0x00b8; + /* 0x00B9 */ u8 field_0x00b9; + /* 0x00BA */ u8 field_0x00ba; + /* 0x00BB */ u8 field_0x00bb; + /* 0x00BC */ CPaneMgr* field_0x00bc[3]; + /* 0x00C8 */ f32 field_0x00c8; /* 0x00CC */ u8 field_0x00cc[8]; /* 0x00D4 */ float field_0x00d4; - /* 0x00D8 */ u8 field_0xd8[0x108 - 0xd8]; - /* 0x0108 */ bool field_0x108; - /* 0x0109 */ bool field_0x109; + /* 0x00D8 */ u8 field_0x00d8[8]; + /* 0x00E0 */ s32 field_0x00e0[3]; + /* 0x00EC */ s32 field_0x00ec; + /* 0x00F0 */ u8 field_0x00f0[0x108 - 0xf0]; + /* 0x0108 */ bool field_0x0108; + /* 0x0109 */ bool field_0x0109; /* 0x010A */ u8 field_0x10a[2]; /* 0x010C */ J2DPane* mpPane; /* 0x0110 */ int field_0x0110; @@ -365,80 +395,98 @@ public: /* 0x0188 */ CPaneMgr* field_0x0188[3]; /* 0x0194 */ u8 field_0x0194[0x01C8 - 0x0194]; /* 0x01C8 */ J2DAnmBase* field_0x01c8; - /* 0x01CC */ u8 field_0x01CC[0x01D0 - 0x01CC]; + /* 0x01CC */ s32 field_0x01cc; /* 0x01D0 */ J2DAnmBase* field_0x01d0; - /* 0x01D4 */ u8 field_0x01D4[0x01D8 - 0x01D4]; + /* 0x01D4 */ s32 field_0x01d4; /* 0x01D8 */ J2DAnmBase* field_0x01d8; - /* 0x01DC */ u8 field_0x01DC[0x01E0 - 0x01DC]; + /* 0x01DC */ s32 field_0x01dc; /* 0x01E0 */ J2DAnmBase* field_0x01e0; - /* 0x01E4 */ u8 field_0x01E4[0x01E8 - 0x01E4]; + /* 0x01E4 */ s32 field_0x01e4; /* 0x01E8 */ J2DAnmBase* field_0x01e8; - /* 0x01EC */ u8 field_0x01EC[0x01F0 - 0x01EC]; + /* 0x01EC */ s32 field_0x01ec; /* 0x01F0 */ J2DAnmBase* field_0x01f0; - /* 0x01F4 */ u8 field_0x01F4[0x01F8 - 0x01F4]; + /* 0x01F4 */ s32 field_0x01f4; /* 0x01F8 */ J2DAnmBase* field_0x01f8; - /* 0x01FC */ u8 field_0x01FC[0x0200 - 0x01FC]; + /* 0x01FC */ s32 field_0x01fc; /* 0x0200 */ J2DAnmBase* field_0x0200; - /* 0x0204 */ u8 field_0x0204[8]; + /* 0x0204 */ s32 field_0x0204; + /* 0x0208 */ u8 field_0x0208; + /* 0x0209 */ u8 field_0x0209; + /* 0x020A */ u8 field_0x020a; + /* 0x020B */ u8 field_0x020b; /* 0x020C */ CPaneMgrAlpha* field_0x020c; /* 0x0210 */ u8 field_0x0210[0x021C - 0x0210]; /* 0x021C */ u8 field_0x021c; /* 0x021D */ u8 field_0x021d; - /* 0x021E */ u8 field_0x021e[0x0238 - 0x021E]; + /* 0x021E */ u8 field_0x021e; + /* 0x021F */ u8 field_0x021f; + /* 0x0220 */ CPaneMgrAlpha* field_0x0220[3]; + /* 0x022C */ CPaneMgrAlpha* field_0x022c[3]; /* 0x0238 */ CPaneMgrAlpha* field_0x0238; /* 0x023C */ CPaneMgrAlpha* field_0x023c; /* 0x0240 */ CPaneMgrAlpha* field_0x0240; /* 0x0244 */ CPaneMgrAlpha* field_0x0244; /* 0x0248 */ u8 field_0x0248[0x024A - 0x0248]; /* 0x024A */ bool field_0x024a; - /* 0x024B */ u8 field_0x024B[0x0250 - 0x024B]; + /* 0x024B */ u8 field_0x024b; + /* 0x024C */ u8 field_0x024c; + /* 0x024B */ u8 field_0x024d[3]; /* 0x0250 */ char* field_0x0250; /* 0x0254 */ STControl* mStick; /* 0x0258 */ u8 mDataNew[3]; /* 0x025B */ u8 field_0x025b[3]; - /* 0x025C */ u8 field_0x025e[0x0264 - 0x025E]; - /* 0x0264 */ u8 field_0x0264; - /* 0x0265 */ u8 mSelectNum; - /* 0x0266 */ u8 field_0x0266; - /* 0x0267 */ u8 field_0x0267; + /* 0x025C */ u8 field_0x025e[0x0264 - 0x025e]; + /* 0x0264 */ u8 mLastSelectNum; // previously selected quest log + /* 0x0265 */ u8 mSelectNum; // currently selected quest log + /* 0x0266 */ u8 mLastSelectMenuNum; // previously select menu number (for copy / start / delete) + /* 0x0267 */ u8 mSelectMenuNum; // currently selected menu number (for copy / start / delete) /* 0x0268 */ u8 field_0x0268[0x026A - 0x0268]; /* 0x026A */ u8 field_0x026a; /* 0x026B */ u8 field_0x026b[0x026e - 0x026b]; /* 0x026E */ u8 field_0x026e; /* 0x026F */ u8 field_0x026f; /* 0x0270 */ bool mSelectEnd; - /* 0x0271 */ u8 field_0x0271[0x0283 - 0x0271]; + /* 0x0271 */ u8 field_0x0271; + /* 0x0272 */ u8 field_0x0272[0x0281 - 0x0272]; + /* 0x0281 */ bool field_0x0281; + /* 0x0282 */ bool field_0x0282; /* 0x0283 */ bool field_0x0283; /* 0x0284 */ u8 field_0x0284[0x029C - 0x0284]; - /* 0x029C */ J2DAnmBase* field_0x029c; - /* 0x02A0 */ J2DAnmBase* field_0x02a0; - /* 0x02A4 */ u8 field_0x02A4[0x02E8 - 0x02A4]; + /* 0x029C */ J2DAnmTransform* field_0x029c; + /* 0x02A0 */ J2DAnmTransform* field_0x02a0; + /* 0x02A4 */ CPaneMgr* field_0x02a4[3]; + /* 0x02B0 */ u8 field_0x02b0[0x2c0-0x2b0]; + /* 0x02C0 */ CPaneMgr* field_0x02c0; + /* 0x02C4 */ CPaneMgr* field_0x02c4; + /* 0x02C8 */ CPaneMgr* field_0x02c8; + /* 0x02CC */ CPaneMgr* field_0x02cc; + /* 0x02D0 */ CPaneMgr* field_0x02d0; + /* 0x02D4 */ CPaneMgr* field_0x02d4; + /* 0x02D8 */ u8 field_0x02d8[0x2e8-0x2d8]; /* 0x02E8 */ J2DAnmBase* field_0x02e8; - /* 0x02EC */ u8 field_0x02EC[0x02F0 - 0x02EC]; + /* 0x02EC */ s32 field_0x02ec; /* 0x02F0 */ J2DAnmBase* field_0x02f0; - /* 0x02F4 */ u8 field_0x02F4[0x02F8 - 0x02F4]; + /* 0x02F4 */ s32 field_0x02f4; /* 0x02F8 */ J2DAnmBase* field_0x02f8; - /* 0x02FC */ u8 field_0x02FC[0x0300 - 0x02FC]; + /* 0x02FC */ s32 field_0x02fc; /* 0x0300 */ J2DAnmBase* field_0x0300; - /* 0x0304 */ u8 field_0x0304[0x0308 - 0x0304]; + /* 0x0304 */ s32 field_0x0304; /* 0x0308 */ J2DAnmBase* field_0x0308; - /* 0x030C */ u8 field_0x030C[0x0310 - 0x030C]; + /* 0x030C */ s32 field_0x030c; /* 0x0310 */ J2DAnmBase* field_0x0310; /* 0x0314 */ J2DAnmBase* field_0x0314; /* 0x0318 */ J2DAnmBase* field_0x0318; - /* 0x031C */ J2DAnmBase* field_0x031c; + /* 0x031C */ s32 field_0x031c; // J2DAnmTransform*? /* 0x0320 */ J2DAnmBase* field_0x0320; - /* 0x0324 */ u8 field_0x0324[0x0328 - 0x0324]; - /* 0x0328 */ J2DAnmTransform* field_0x0328; // actually J2DAnmVtxColor? + /* 0x0324 */ s32 field_0x0324; + /* 0x0328 */ J2DAnmTransform* field_0x0328; /* 0x032C */ J2DAnmTransform* field_0x032c; /* 0x0330 */ J2DAnmBase* field_0x0330; - /* 0x0334 */ u8 field_0x0334[0x0338 - 0x0334]; + /* 0x0334 */ s32 field_0x0334; /* 0x0338 */ J2DAnmBase* field_0x0338; - /* 0x033C */ u8 field_0x033c[4]; - /* 0x0340 */ CPaneMgrAlpha* field_0x0340; - /* 0x0344 */ u8 field_0x0344[8]; - /* 0x034C */ s32 field_0x034c; - /* 0x0350 */ u8 field_0x0350[8]; + /* 0x033C */ s32 field_0x033c; + /* 0x0340 */ CPaneMgr* field_0x0340[3]; + /* 0x034C */ s32 field_0x034c[3]; /* 0x0358 */ int field_0x0358; /* 0x035C */ int field_0x035c; /* 0x0360 */ bool field_0x0360; @@ -461,15 +509,19 @@ public: /* 0x0394 */ CPaneMgr* mpPaneMgr2; /* 0x0398 */ u8 field_0x0398[0x03A0 - 0x0398]; /* 0x03A0 */ J2DAnmBase* field_0x03a0; - /* 0x03A4 */ u8 field_0x03A4[0x03A8 - 0x03A4]; + /* 0x03A4 */ s32 field_0x03a4; /* 0x03A8 */ CPaneMgr* field_0x03a8; /* 0x03AC */ s16 field_0x03ac; /* 0x03AE */ u8 field_0x03AE[0x03B0 - 0x03AE]; /* 0x03B0 */ u8 mUseType; - /* 0x03B1 */ u8 field_0x03b1[7]; + /* 0x03B1 */ u8 field_0x03b1; + /* 0x03B2 */ u8 field_0x03b2[6]; /* 0x03B8 */ char mpMemCard; /* 0x03B9 */ u8 field_0x03b9[3]; - /* 0x03BC */ u8 field_0x03bc[0x2374 - 0x3BC]; + /* 0x03BC */ u8 field_0x03bc[0x3E0 - 0x3BC]; + /* 0x03E0 */ dSv_save_c* mpSave; + /* 0x03E4 */ u8 field_0x03e4[4]; + /* 0x03E8 */ u8 field_0x03e8[0x2374 - 0x3E8]; /* 0x2374 */ bool mFadeFlag; /* 0x2375 */ bool mHasDrawn; /* 0x2376 */ u8 field_0x2376[0x2378 - 0x2376]; diff --git a/include/d/meter/d_meter2_info.h b/include/d/meter/d_meter2_info.h index 9ad6a76758..8b414466d3 100644 --- a/include/d/meter/d_meter2_info.h +++ b/include/d/meter/d_meter2_info.h @@ -565,6 +565,11 @@ inline void dMeter2Info_setScopeZoomPointer(u8 param_0) { g_meter2_info.setScopeZoomPointer(param_0); } +inline void dMeter2Info_decMsgKeyWaitTimer() { + g_meter2_info.decMsgKeyWaitTimer(); +} + +const char* dMeter2Info_getNumberTextureName(int pIndex); inline bool dMeter2Info_isFloatingMessageVisible() { return g_meter2_info.isFloatingMessageVisible(); } diff --git a/include/d/s/d_s_name.h b/include/d/s/d_s_name.h index fd56c05701..0c7bb5a31d 100644 --- a/include/d/s/d_s_name.h +++ b/include/d/s/d_s_name.h @@ -5,9 +5,14 @@ #include "f_op/f_op_camera_mng.h" #include "f_op/f_op_scene.h" -class JKRExpHeap; -class dFile_select_c; -class dBrightCheck_c; +class dSn_HIO_c { +public: + /* 8025878C */ dSn_HIO_c(); + /* 802592DC */ virtual ~dSn_HIO_c() {} + + /* 0x4 */ s8 field_0x4; + /* 0x5 */ u8 mFileSelWaitTime; +}; class dScnName_camera_c : public camera_process_class { public: @@ -15,6 +20,49 @@ public: /* 80259294 */ virtual ~dScnName_camera_c() {} }; +// remove later and use header instead +class dFile_select_c { +public: + /* 8018366C */ dFile_select_c(JKRArchive*); + /* 8018375C */ virtual ~dFile_select_c(); + /* 801843CC */ void _create(); + /* 801844FC */ void _move(); + /* 8018DD38 */ void _draw(); + + bool getFadeFlag() { return mFadeFlag; } + int isDataNew(u8 i) { return mDataNew[i]; } + int isSelectEnd() { return mSelectEnd; } + u8 getSelectNum() { return mSelectNum; } + void setUseType(u8 type) { mUseType = type; } + +private: + u8 field_0x4[0x254]; + /* 0x0258 */ u8 mDataNew[3]; + /* 0x025B */ u8 field_0x25b[0x265 - 0x25b]; + /* 0x0265 */ u8 mSelectNum; + /* 0x0266 */ u8 field_0x266[0x270 - 0x266]; + /* 0x0270 */ bool mSelectEnd; + /* 0x0271 */ u8 field_0x271[0x3b0 - 0x271]; + /* 0x03B0 */ u8 mUseType; + /* 0x03B1 */ u8 field_0x3b1[0x2374 - 0x3b1]; + /* 0x2374 */ bool mFadeFlag; + /* 0x2375 */ u8 field_0x2375[0x237c - 0x2375]; +}; + +// remove later and use header instead +class dBrightCheck_c { +public: + /* 80192F10 */ dBrightCheck_c(JKRArchive*); + /* 80192F98 */ virtual ~dBrightCheck_c(); + /* 801934D0 */ void _move(); + /* 80193594 */ void _draw(); + + bool isEnd() { return mEnd; } + + u8 field_0x4[0x15]; + /* 0x19 */ bool mEnd; +}; + class dScnName_c : public scene_class { public: dScnName_c() {} diff --git a/include/d/save/d_save.h b/include/d/save/d_save.h index ded1227c7b..b45ca2ef92 100644 --- a/include/d/save/d_save.h +++ b/include/d/save/d_save.h @@ -1113,6 +1113,7 @@ public: u8 getDataNum() const { return mDataNum; } void setDataNum(u8 num) { mDataNum = num; } void removeZone(int zoneNo) { mZone[zoneNo].reset(); } + u8 getNoFile() const { return mNoFile; } void setNoFile(u8 file) { mNoFile = file; } u8 getNewFile() const { return mNewFile; } void setNewFile(u8 file) { mNewFile = file; } diff --git a/include/f_op/f_op_scene_tag.h b/include/f_op/f_op_scene_tag.h index dccd6c1d13..8308d9f391 100644 --- a/include/f_op/f_op_scene_tag.h +++ b/include/f_op/f_op_scene_tag.h @@ -3,9 +3,12 @@ #include "SSystem/SComponent/c_list.h" #include "dolphin/types.h" +#include "f_pc/f_pc_node.h" +#include "SSystem/SComponent/c_phase.h" class scene_tag_class { - u8 _0[0x14]; +public: + u8 field_0x00[0x14]; }; void fopScnTg_QueueTo(scene_tag_class* pSceneTag); diff --git a/include/m_Do/m_Do_MemCard.h b/include/m_Do/m_Do_MemCard.h index c6a12f0b55..84eed04598 100644 --- a/include/m_Do/m_Do_MemCard.h +++ b/include/m_Do/m_Do_MemCard.h @@ -39,6 +39,8 @@ public: /* 80017360 */ void setCardState(s32); bool isCardCommNone() { return mCardCommand == CARD_NO_COMMAND; } + u8 getProbeStat() { return mProbeStat; } + void clearProbeStat() { mProbeStat = 2; } /* 0x0000 */ u8 mData[0x1FBC]; /* 0x1FBC */ u8 mChannel; @@ -68,4 +70,23 @@ inline void mDoMemCd_ThdInit() { g_mDoMemCd_control.ThdInit(); } +inline u8 mDoMemCd_getProbeStat() { + return g_mDoMemCd_control.getProbeStat(); +} + +inline void mDoMemCd_clearProbeStat() { + g_mDoMemCd_control.clearProbeStat(); +} + +inline void mDoMemCd_save(void* i_data, u32 param_1, u32 param_2) { + g_mDoMemCd_control.save(i_data,param_1,param_2); +} + +// This is probably debug only +#if DEBUG +inline void mDoMemCd_saveNAND(void* i_data, u32 param_1, u32 param_2) { + g_mDoMemCd_control.saveNAND(i_data,param_1,param_2); +} +#endif + #endif /* M_DO_M_DO_MEMCARD_H */ diff --git a/include/m_Do/m_Do_machine_exception.h b/include/m_Do/m_Do_machine_exception.h index 1c98c7980e..6d81404a7c 100644 --- a/include/m_Do/m_Do_machine_exception.h +++ b/include/m_Do/m_Do_machine_exception.h @@ -2,6 +2,7 @@ #define M_DO_M_DO_MACHINE_EXCEPTION_H #include "dolphin/types.h" +#include "dolphin/gx/GX.h" struct JUTConsole; diff --git a/include/m_Do/m_Do_main.h b/include/m_Do/m_Do_main.h index 81b89b31bf..35947e091d 100644 --- a/include/m_Do/m_Do_main.h +++ b/include/m_Do/m_Do_main.h @@ -12,19 +12,11 @@ s32 LOAD_COPYDATE(void*); class HeapCheck { public: - // needed for sinit - /* HeapCheck(JKRExpHeap* heap, const char* name, const char* jName) { + HeapCheck(JKRExpHeap* heap, const char* name, const char* jName) { mName = name; mJName = jName; setHeap(heap); - mMaxTotalUsedSize = 0; - mMaxTotalFreeSize = 0; - field_0x14 = 0; - field_0x18 = 0; - mTargetHeapSize = 0; - mUsedCount = 0; - mTotalUsedSize = 0; - } */ + } void CheckHeap1(void); s32 getUsedCount(void) const; diff --git a/include/m_Do/m_Do_mtx.h b/include/m_Do/m_Do_mtx.h index 12c00c5921..c05e64d138 100644 --- a/include/m_Do/m_Do_mtx.h +++ b/include/m_Do/m_Do_mtx.h @@ -71,6 +71,10 @@ inline void cMtx_multVec(Mtx mtx, const Vec* src, Vec* dst) { mDoMtx_multVec(mtx, src, dst); } +inline void cMtx_lookAt(f32 (*param_0)[4],Vec const* param_1, Vec const* param_2,Vec const* param_3, s16 param_4) { + mDoMtx_lookAt(param_0,param_1,param_2,param_3,param_4); +} + inline void cMtx_copy(const Mtx src, Mtx dst) { mDoMtx_copy(src, dst); } diff --git a/libs/JSystem/J2DGraph/J2DPicture.cpp b/libs/JSystem/J2DGraph/J2DPicture.cpp index d0b1fd80e2..489c5506bb 100644 --- a/libs/JSystem/J2DGraph/J2DPicture.cpp +++ b/libs/JSystem/J2DGraph/J2DPicture.cpp @@ -711,16 +711,73 @@ asm void J2DPicture::drawOut(JGeometry::TBox2<f32> const& param_0, /* 802FE380-802FE5D0 2F8CC0 0250+00 1/0 0/0 0/0 .text * drawTexCoord__10J2DPictureFffffssssssssPA3_A4_f */ +#ifdef NONMATCHING +// matches with literals +void J2DPicture::drawTexCoord(f32 param_0, f32 param_1, f32 param_2, f32 param_3, s16 param_4, + s16 param_5, s16 param_6, s16 param_7, s16 param_8, s16 param_9, + s16 param_10, s16 param_11, Mtx* param_12) { + + if (mTextureCount != 0) { + for (u8 i = 0; i < mTextureCount; i++) { + load(i); + } + + f32 tmp1 = param_0 + param_2; + f32 tmp2 = param_1 + param_3; + + GXSetNumTexGens(mTextureCount); + + JUtility::TColor black[4]; + + Mtx outputMtx; + + getNewColor(black); + setTevMode(); + PSMTXConcat((MtxP)param_12,mGlobalMtx,outputMtx); + + GXLoadPosMtxImm(outputMtx,0); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS,GX_DIRECT); + GXSetVtxDesc(GX_VA_CLR0,GX_DIRECT); + GXSetVtxDesc(GX_VA_TEX0,GX_DIRECT); + GXSetVtxAttrFmt(GX_VTXFMT0,GX_VA_POS,GX_CLR_RGBA,GX_F32,0); + GXSetVtxAttrFmt(GX_VTXFMT0,GX_VA_TEX0,GX_CLR_RGBA,GX_RGBA4,8); + GXBegin(GX_QUADS,GX_VTXFMT0,4); + + GXPosition3f32(param_0,param_1,0.0f); + GXColor1u32(black[0]); + GXTexCoord2s16(param_4,param_5); + + GXPosition3f32(tmp1,param_1,0.0f); + GXColor1u32(black[1]); + GXTexCoord2s16(param_6,param_7); + + GXPosition3f32(tmp1,tmp2,0.0f); + GXColor1u32(black[3]); + GXTexCoord2s16(param_10,param_11); + + GXPosition3f32(param_0,tmp2,0.0f); + GXColor1u32(black[2]); + GXTexCoord2s16(param_8,param_9); + + i_GXEnd(); + + GXSetVtxAttrFmt(GX_VTXFMT0,GX_VA_TEX0,GX_CLR_RGBA,GX_RGBX8,0xf); + GXSetVtxAttrFmt(GX_VTXFMT0,GX_VA_POS,GX_CLR_RGBA,GX_RGBA4,0); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm void J2DPicture::drawTexCoord(f32 param_0, f32 param_1, f32 param_2, f32 param_3, s16 param_4, s16 param_5, s16 param_6, s16 param_7, s16 param_8, s16 param_9, - s16 param_10, s16 param_11, f32 (*param_12)[3][4]) { + s16 param_10, s16 param_11, Mtx* param_12) { nofralloc #include "asm/JSystem/J2DGraph/J2DPicture/drawTexCoord__10J2DPictureFffffssssssssPA3_A4_f.s" } #pragma pop +#endif /* 802FE5D0-802FEA60 2F8F10 0490+00 3/3 0/0 0/0 .text setTevMode__10J2DPictureFv */ #pragma push diff --git a/libs/MSL_C/MSL_Common/Src/alloc.c b/libs/MSL_C/MSL_Common/Src/alloc.c index 56c27b1f83..3937a44c16 100644 --- a/libs/MSL_C/MSL_Common/Src/alloc.c +++ b/libs/MSL_C/MSL_Common/Src/alloc.c @@ -1,16 +1,16 @@ #include "MSL_C/MSL_Common/Src/alloc.h" #include "MSL_C/MSL_Common/Src/string.h" -static void deallocate_from_fixed_pools(); -static void deallocate_from_var_pools(); +static void deallocate_from_fixed_pools(int**,unsigned int**, unsigned int); +static void deallocate_from_var_pools(int**,unsigned int**); // // External References: // void __sys_free(); -void __end_critical_region(); -void __begin_critical_region(); +void __end_critical_region(int); +void __begin_critical_region(int); extern unsigned char data_804519A0[8]; // @@ -22,6 +22,20 @@ extern unsigned char data_804519A0[8]; static unsigned char protopool[56]; /* 80362B58-80362BC8 35D498 0070+00 0/0 2/2 0/0 .text free */ +#ifdef NONMATCHING +// matches but causes reordering +void free(FILE* file) { + __begin_critical_region(1); + + if (data_804519A0[0] == 0) { + memset(protopool,0,0x34); + data_804519A0[0] = 1; + } + + __pool_free((int**)protopool, (unsigned int**)file); + __end_critical_region(1); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -30,16 +44,39 @@ asm void free(FILE* file) { #include "asm/MSL_C/MSL_Common/Src/alloc/free.s" } #pragma pop +#endif /* 80362BC8-80362C20 35D508 0058+00 1/1 0/0 0/0 .text __pool_free */ +#ifdef NONMATCHING +// matches but causes reordering +void __pool_free(int **param_1, unsigned int **param_2) { + unsigned int var; + + if (param_2) { + if (((unsigned int)param_2[-1] & 1) == 0) { + var = param_2[-1][2]; + } else { + var = (unsigned int)param_2[-2] & 0xfffffff8; + var -= 8; + } + + if (var <= 0x44) { + deallocate_from_fixed_pools(param_1,param_2, var); + } else { + deallocate_from_var_pools(param_1,param_2); + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void __pool_free() { +asm void __pool_free(int **param_1, unsigned int **param_2) { nofralloc #include "asm/MSL_C/MSL_Common/Src/alloc/__pool_free.s" } #pragma pop +#endif /* ############################################################################################## */ /* 803A2220-803A2238 02E880 0018+00 1/1 0/0 0/0 .rodata fix_pool_sizes */ @@ -52,7 +89,7 @@ static unsigned char const fix_pool_sizes[24] = { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void deallocate_from_fixed_pools() { +static asm void deallocate_from_fixed_pools(int** param_1,unsigned int** param_2, unsigned int param_3) { nofralloc #include "asm/MSL_C/MSL_Common/Src/alloc/deallocate_from_fixed_pools.s" } @@ -62,7 +99,7 @@ static asm void deallocate_from_fixed_pools() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void deallocate_from_var_pools() { +static asm void deallocate_from_var_pools(int** param_1,unsigned int** param_2) { nofralloc #include "asm/MSL_C/MSL_Common/Src/alloc/deallocate_from_var_pools.s" } diff --git a/libs/MSL_C/MSL_Common/Src/arith.c b/libs/MSL_C/MSL_Common/Src/arith.c index df7d40f114..176efcfbc9 100644 --- a/libs/MSL_C/MSL_Common/Src/arith.c +++ b/libs/MSL_C/MSL_Common/Src/arith.c @@ -2,6 +2,28 @@ #include "MSL_C/math.h" /* 80365078-803650D0 35F9B8 0058+00 0/0 1/1 0/0 .text div */ +#ifdef NONMATCHING +// matches but causes function reordering +div_t div(int numerator, int denominator) { + div_t ret; + int i = 1; + int j = 1; + + if (numerator < 0 ) { + numerator = -numerator; + i = -1; + } + + if (denominator < 0) { + denominator = -denominator; + j = -1; + } + + ret.quot = (numerator / denominator) * (i * j); + ret.rem = numerator * i - j * (ret.quot * denominator); + return ret; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -10,6 +32,7 @@ asm div_t div(int numerator, int denominator) { #include "asm/MSL_C/MSL_Common/Src/arith/div.s" } #pragma pop +#endif /* 803650D0-803650E0 35FA10 0010+00 0/0 66/66 225/225 .text abs */ int abs(int n) { diff --git a/libs/SSystem/SComponent/c_phase.cpp b/libs/SSystem/SComponent/c_phase.cpp index c4c30ecf4e..ce0be092db 100644 --- a/libs/SSystem/SComponent/c_phase.cpp +++ b/libs/SSystem/SComponent/c_phase.cpp @@ -64,18 +64,16 @@ int cPhs_Next(request_of_phase_process_class* pPhase) { /* 802666D8-802667AC 00D4+00 s=1 e=3 z=0 None .text cPhs_Do__FP30request_of_phase_process_classPv */ #ifdef NONMATCHING +// pUserData loading in too early int cPhs_Do(request_of_phase_process_class* pPhase, void* pUserData) { - if (const cPhs__Handler* pHandlerTable = pPhase->mpHandlerTable) { - // the load of pUserData seems to be slightly scrambled.. - const cPhs__Handler pHandler = pHandlerTable[pPhase->id]; - const int newStep = pHandler(pUserData); + if (pPhase->mpHandlerTable) { + int newStep = pPhase->mpHandlerTable[pPhase->id](pUserData); switch (newStep) { case cPhs_ONE_e: return cPhs_Next(pPhase); case cPhs_TWO_e: - const int step2 = cPhs_Next(pPhase); - return step2 == cPhs_ONE_e ? cPhs_TWO_e : cPhs_COMPLEATE_e; + return cPhs_Next(pPhase) == cPhs_ONE_e ? cPhs_TWO_e : cPhs_COMPLEATE_e; case cPhs_COMPLEATE_e: return cPhs_Compleate(pPhase); case cPhs_UNK3_e: @@ -84,9 +82,9 @@ int cPhs_Do(request_of_phase_process_class* pPhase, void* pUserData) { case cPhs_ERROR_e: cPhs_UnCompleate(pPhase); return cPhs_ERROR_e; + default: + return newStep; } - - return newStep; } return cPhs_Compleate(pPhase); diff --git a/src/c/c_dylink.cpp b/src/c/c_dylink.cpp index a04d07d782..7e7138226d 100644 --- a/src/c/c_dylink.cpp +++ b/src/c/c_dylink.cpp @@ -982,8 +982,11 @@ int cDylPhs::phase_03(void* param_0) { /* 8001884C-80018890 01318C 0044+00 0/0 2/2 0/0 .text * Link__7cDylPhsFP30request_of_phase_process_classs */ int cDylPhs::Link(request_of_phase_process_class* i_phase, s16 param_1) { - static int (*l_method[3])(void*) = {cDylPhs::phase_01, (int (*)(void*))cDylPhs::phase_02, - cDylPhs::phase_03}; + static request_of_phase_process_fn l_method[3] = { + (request_of_phase_process_fn)cDylPhs::phase_01, + (request_of_phase_process_fn)cDylPhs::phase_02, + (request_of_phase_process_fn)cDylPhs::phase_03 + }; if (i_phase->id == cPhs_TWO_e) { return cPhs_COMPLEATE_e; diff --git a/src/d/d_bright_check.cpp b/src/d/d_bright_check.cpp index aec69a7a85..0c0c463c7c 100644 --- a/src/d/d_bright_check.cpp +++ b/src/d/d_bright_check.cpp @@ -401,4 +401,4 @@ asm dDlst_BrightCheck_c::~dDlst_BrightCheck_c() { } #pragma pop -/* 803949D8-803949D8 021038 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 803949D8-803949D8 021038 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
\ No newline at end of file diff --git a/src/d/file/d_file_select.cpp b/src/d/file/d_file_select.cpp index 52707f9efd..199d746195 100644 --- a/src/d/file/d_file_select.cpp +++ b/src/d/file/d_file_select.cpp @@ -20,6 +20,7 @@ #include "m_Do/m_Do_MemCard.h" #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_graphic.h" +#include "m_Do/m_Do_Reset.h" // @@ -443,13 +444,17 @@ SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { }; /* 803BA854-803BA860 017974 000C+00 3/3 0/0 0/0 .data SelStartFrameTbl */ -SECTION_DATA static u8 SelStartFrameTbl[12] = { - 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x8B, +SECTION_DATA static u32 SelStartFrameTbl[3] = { + 0x0000003B, + 0x00000063, + 0x0000008B, }; /* 803BA860-803BA86C 017980 000C+00 3/3 0/0 0/0 .data SelEndFrameTbl */ -SECTION_DATA static u8 SelEndFrameTbl[12] = { - 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00, 0x95, +SECTION_DATA static s32 SelEndFrameTbl[3] = { + 0x00000045, + 0x0000006D, + 0x00000095, }; /* 803BA86C-803BA878 01798C 000C+00 7/7 0/0 0/0 .data SelOpenStartFrameTbl */ @@ -467,14 +472,14 @@ SECTION_DATA static u32 SelOpenEndFrameTbl[3] = { }; /* 803BA884-803BA890 0179A4 000C+00 5/5 0/0 0/0 .data MenuSelStartFrameTbl */ -SECTION_DATA static u32 MenuSelStartFrameTbl[3] = { +SECTION_DATA static s32 MenuSelStartFrameTbl[3] = { 0x000007CD, 0x00000382, 0x00000390, }; /* 803BA890-803BA8A0 0179B0 000C+04 3/3 0/0 0/0 .data MenuSelEndFrameTbl */ -SECTION_DATA static u32 MenuSelEndFrameTbl[4] = { +SECTION_DATA static s32 MenuSelEndFrameTbl[4] = { 0x000007DB, 0x0000038E, 0x00000382, @@ -960,44 +965,8 @@ SECTION_DATA static void* lit_4213[3] = { #pragma pop /* 803BAAEC-803BAD20 017C0C 0234+00 1/2 0/0 0/0 .data DataSelProc */ -SECTION_DATA static u8 DataSelProc[564] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, -}; +typedef void (dFile_select_c::*DataSelProcFunc)(void); +SECTION_DATA static DataSelProcFunc DataSelProc[47] = {}; /* 803BAD20-803BAD30 017E40 0010+00 1/1 0/0 0/0 .data l_tagName101$5620 */ SECTION_DATA static u8 l_tagName101[16] = { @@ -1893,6 +1862,7 @@ static u8 lit_3807[12]; /* 8042C9EC-8042CA10 05970C 0024+00 35/35 0/0 0/0 .bss g_fsHIO */ static dFs_HIO_c_tmp g_fsHIO; +// static dFs_HIO_c g_fsHIO; /* 8045392C-80453930 001F2C 0004+00 1/1 0/0 0/0 .sdata2 @4165 */ SECTION_SDATA2 static f32 lit_4165 = 9.0f / 10.0f; @@ -1905,22 +1875,26 @@ SECTION_SDATA2 static f32 lit_4166[1 + 1 /* padding */] = { }; /* 801843CC-801844FC 17ED0C 0130+00 0/0 1/1 0/0 .text _create__14dFile_select_cFv */ -// Matches with literals #ifdef NONMATCHING +// setFadeColor instruction reordering void dFile_select_c::_create() { mDoGph_gInf_c::setFadeColor(static_cast<JUtility::TColor&>(g_blackColor)); mStick = new STControl(2, 2, 1, 1, 0.9f, 0.5f, 0, 0x2000); g_fsHIO.field_0x0004 = -1; - for (int iVar2 = 0; iVar2 < 3; iVar2++) { - mDataNew[iVar2] = 0; - field_0x025b[iVar2] = 0; + + for (int i = 0; i < 3; i++) { + mDataNew[i] = 0; + field_0x025b[i] = 0; } mSelectNum = 0; + dComIfGs_init(); dComIfGp_itemDataInit(); dComIfGs_setNewFile(0); - mHasDrawn = 0; + + mHasDrawn = false; + screenSet(); screenSetCopySel(); screenSet3Menu(); @@ -1940,14 +1914,48 @@ asm void dFile_select_c::_create() { #endif /* 801844FC-80184664 17EE3C 0168+00 0/0 1/1 0/0 .text _move__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::_move() { - nofralloc -#include "asm/d/file/d_file_select/_move__14dFile_select_cFv.s" +void dFile_select_c::_move() { + dMeter2Info_decMsgKeyWaitTimer(); + + s32 drive_status = DVDGetDriveStatus(); + + if (drive_status != DVD_STATE_END && drive_status != DVD_STATE_BUSY && field_0x03b1 != 0) { + field_0x03b1 = 0; + } + + if ((mDoMemCd_getProbeStat() == 0 || mDoMemCd_getProbeStat() == 1) && (mDoRst::isReset() == 0 && field_0x03b1 == 0)) { + if (field_0x2378->getAlpha() != 0) { + field_0x2378->setAlpha(0); + } + + field_0x026f = 0; + field_0x0271 = 0; + + } + + (this->*DataSelProc[field_0x026f])(); + + selFileWakuAnm(); + bookIconAnm(); + dataDelEffAnm(); + dataCopyEffAnm(); + + mFileSelectDlst.mpScreen->animation(); + mFileSelYesNoDlst.mpScreen->animation(); + mFileSel3mDlst.mpScreen->animation(); + mFileSelDeleteDlst.mpScreen->animation(); + + if (mFileSelCopyDlst.field_0x08) { + selCopyFileWakuAnm(); + copyBookIconAnm(); + mFileSelCopyDlst.mpScreen->animation(); + } + + mpFileWarning->_move(); + mpFileSelect3d->_move(); + + mDoMemCd_clearProbeStat(); } -#pragma pop /* ############################################################################################## */ /* 80453938-80453940 001F38 0008+00 34/34 0/0 0/0 .sdata2 @4342 */ @@ -1955,6 +1963,53 @@ SECTION_SDATA2 static f64 lit_4342 = 4503601774854144.0 /* cast s32 to float */; /* 80184664-801848A0 17EFA4 023C+00 1/1 0/0 0/0 .text selFileWakuAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::selFileWakuAnm() { + field_0x01cc += 2; + + if (field_0x01cc >= field_0x01c8->getFrameMax()) + field_0x01cc -= field_0x01c8->getFrameMax(); + + field_0x01c8->setFrame(field_0x01cc); + field_0x01D4 += 2; + + if (field_0x01D4 >= field_0x01d0->getFrameMax()) + field_0x01D4 -= field_0x01d0->getFrameMax(); + + field_0x01d0->setFrame(field_0x01D4); + field_0x031c += 2; + + if (field_0x031c >= field_0x0318->getFrameMax()) + field_0x031c -= field_0x0318->getFrameMax(); + + field_0x0318->setFrame(field_0x031c); + field_0x0324 += 2; + + if (field_0x0324 >= field_0x0320->getFrameMax()) + field_0x0324 -= field_0x0320->getFrameMax(); + + field_0x0320->setFrame(field_0x0324); + field_0x0334 += 2; + + if (field_0x0334 >= field_0x0330->getFrameMax()) + field_0x0334 -= field_0x0330->getFrameMax(); + + field_0x0330->setFrame(field_0x0334); + field_0x033c += 2; + + if (field_0x033c >= field_0x0338->getFrameMax()) + field_0x033c -= field_0x0338->getFrameMax(); + + field_0x0338->setFrame(field_0x033c); + field_0x03a4 += 2; + + if (field_0x03a4 >= field_0x03a0->getFrameMax()) + field_0x03a4 -= field_0x03a0->getFrameMax(); + + field_0x03a0->setFrame(field_0x03a4); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1963,8 +2018,32 @@ asm void dFile_select_c::selFileWakuAnm() { #include "asm/d/file/d_file_select/selFileWakuAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 801848A0-8018499C 17F1E0 00FC+00 1/1 0/0 0/0 .text bookIconAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::bookIconAnm() { + field_0x01dc += 2; + + if (field_0x01dc >= field_0x01d8->getFrameMax()) + field_0x01dc -= field_0x01d8->getFrameMax(); + + field_0x01d8->setFrame(field_0x01dc); + field_0x01e4 += 2; + + if (field_0x01e4 >= field_0x01e0->getFrameMax()) + field_0x01e4 -= field_0x01e0->getFrameMax(); + + field_0x01e0->setFrame(field_0x01e4); + field_0x01ec += 2; + + if (field_0x01ec >= field_0x01e8->getFrameMax()) + field_0x01ec -= field_0x01e8->getFrameMax(); + + field_0x01e8->setFrame(field_0x01ec); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1973,8 +2052,26 @@ asm void dFile_select_c::bookIconAnm() { #include "asm/d/file/d_file_select/bookIconAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 8018499C-80184A48 17F2DC 00AC+00 1/1 0/0 0/0 .text selCopyFileWakuAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::selCopyFileWakuAnm() { + field_0x02ec += 2; + + if (field_0x02ec >= field_0x02e8->getFrameMax()) + field_0x02ec -= field_0x02e8->getFrameMax(); + + field_0x02e8->setFrame(field_0x02ec); + field_0x02f4 += 2; + + if (field_0x02f4 >= field_0x02f0->getFrameMax()) + field_0x02f4 -= field_0x02f0->getFrameMax(); + + field_0x02f0->setFrame(field_0x02f4); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1983,9 +2080,33 @@ asm void dFile_select_c::selCopyFileWakuAnm() { #include "asm/d/file/d_file_select/selCopyFileWakuAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 80184A48-80184B44 17F388 00FC+00 1/1 0/0 0/0 .text copyBookIconAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::copyBookIconAnm() { + field_0x02fc += 2; + + if (field_0x02fc >= field_0x02f8->getFrameMax()) + field_0x02fc -= field_0x02f8->getFrameMax(); + + field_0x02f8->setFrame(field_0x02fc); + field_0x0304 += 2; + + if (field_0x0304 >= field_0x0300->getFrameMax()) + field_0x0304 -= field_0x0300->getFrameMax(); + + field_0x0300->setFrame(field_0x0304); + field_0x030c += 2; + + if (field_0x030c >= field_0x0308->getFrameMax()) + field_0x030c -= field_0x0308->getFrameMax(); + + field_0x0308->setFrame(field_0x030c); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1994,9 +2115,29 @@ asm void dFile_select_c::copyBookIconAnm() { #include "asm/d/file/d_file_select/copyBookIconAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 80184B44-80184BFC 17F484 00B8+00 1/1 0/0 0/0 .text dataDelEffAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::dataDelEffAnm() { + if (field_0x0208 != 0) { + field_0x0204 += 2; + + if (field_0x0204 >= field_0x0200->getFrameMax()) + field_0x0204 -= field_0x0200->getFrameMax(); + + field_0x0200->setFrame(field_0x0204); + field_0x01f4 += 2; + + if (field_0x01f4 >= field_0x01f0->getFrameMax()) + field_0x01f4 -= field_0x01f0->getFrameMax(); + + field_0x01f0->setFrame(field_0x01f4); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2005,9 +2146,29 @@ asm void dFile_select_c::dataDelEffAnm() { #include "asm/d/file/d_file_select/dataDelEffAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 80184BFC-80184CB4 17F53C 00B8+00 1/1 0/0 0/0 .text dataCopyEffAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::dataCopyEffAnm() { + if (field_0x0209 != 0) { + field_0x0204 += 2; + + if (field_0x0204 >= field_0x0200->getFrameMax()) + field_0x0204 -= field_0x0200->getFrameMax(); + + field_0x0200->setFrame(field_0x0204); + field_0x01fc += 2; + + if (field_0x01fc >= field_0x01f8->getFrameMax()) + field_0x01fc -= field_0x01f8->getFrameMax(); + + field_0x01f8->setFrame(field_0x01fc); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2016,9 +2177,21 @@ asm void dFile_select_c::dataCopyEffAnm() { #include "asm/d/file/d_file_select/dataCopyEffAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 80184CB4-80184D4C 17F5F4 0098+00 2/2 0/0 0/0 .text * selectDataBaseMoveAnmInitSet__14dFile_select_cFii */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::selectDataBaseMoveAnmInitSet(int param_0, int param_1) { + field_0x00a4->getPanePtr()->setAnimation((J2DAnmTransform*)mpAnmBase[0]); + field_0x00b0 = param_0; + field_0x00b4 = param_1; + mpAnmBase[0]->setFrame(field_0x00b0); + field_0x00a4->getPanePtr()->animationTransform(); + field_0x00b9 = 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2027,16 +2200,48 @@ asm void dFile_select_c::selectDataBaseMoveAnmInitSet(int param_0, int param_1) #include "asm/d/file/d_file_select/selectDataBaseMoveAnmInitSet__14dFile_select_cFii.s" } #pragma pop +#endif /* 80184D4C-80184E38 17F68C 00EC+00 2/2 0/0 0/0 .text selectDataBaseMoveAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +bool dFile_select_c::selectDataBaseMoveAnm() { + if (field_0x00b0 != field_0x00b4) { + if (field_0x00b0 < field_0x00b4) { + field_0x00b0 += 2; + + if (field_0x00b0 > field_0x00b4) + field_0x00b0 = field_0x00b4; + + } else { + field_0x00b0 -= 2; + + if (field_0x00b0 < field_0x00b4) + field_0x00b0 = field_0x00b4; + + } + + mpAnmBase[0]->setFrame(field_0x00b0); + field_0x00a4->getPanePtr()->animationTransform(); + return false; + } else { + field_0x00b0 == 0x21 ? field_0x00b8 = 1 : field_0x00b8 = 0; + field_0x00b9 = 0; + + field_0x00a4->getPanePtr()->setAnimation((J2DAnmTransform*)0); + return true; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dFile_select_c::selectDataBaseMoveAnm() { +asm bool dFile_select_c::selectDataBaseMoveAnm() { nofralloc #include "asm/d/file/d_file_select/selectDataBaseMoveAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 80453940-80453944 001F40 0004+00 38/38 0/0 0/0 .sdata2 @4611 */ @@ -2046,6 +2251,58 @@ SECTION_SDATA2 static f32 lit_4611 = 1.0f; SECTION_SDATA2 static f32 lit_4612 = -1.0f; /* 80184E38-80185040 17F778 0208+00 1/1 0/0 0/0 .text dataSelectInAnmSet__14dFile_select_cFv */ +#ifdef NONMATCHING +void dFile_select_c::dataSelectInAnmSet() { + setSaveData(); + char* card_ptr = &mpMemCard; + OSTime date_ipl = mpSave->getPlayer().getPlayerStatusB().getDateIpl(); // guess + + // pdVar1 = (dSv_player_c *)dSv_save_c::getPlayer((dSv_save_c *)this_00); + // pdVar2 = (dSv_player_status_b_c *)dSv_player_c::getPlayerStatusB(pdVar1); + // uVar4 = dSv_player_status_b_c::getDateIpl(pdVar2); + mSelectNum = 0; + for (int i = 0; i < 3; i++) { + if (field_0x025b[i] == 0) { + // pdVar1 = (dSv_player_c *)dSv_save_c::getPlayer((dSv_save_c *)this_00); + // pdVar2 = (dSv_player_status_b_c *)dSv_player_c::getPlayerStatusB(pdVar1); + // uVar5 = dSv_player_status_b_c::getDateIpl(pdVar2); + + OSTime date_ipl2 = mpSave->getPlayer().getPlayerStatusB().getDateIpl(); + OSTime div_res = date_ipl2 / date_ipl; + + // wrong, fix + if (div_res < date_ipl) { + date_ipl = date_ipl2; + mSelectNum = i; + } + // uVar6 = Runtime.PPCEABI.H::__div2i + // ((int)((ulonglong)uVar5 >> 0x20),(int)uVar5,0,DAT_800000f8 >> 2); + // uVar7 = Runtime.PPCEABI.H::__div2i + // ((int)((ulonglong)uVar4 >> 0x20),(int)uVar4,0,DAT_800000f8 >> 2); + // if (((uint)((ulonglong)uVar7 >> 0x20) ^ 0x80000000) < + // (uint)((uint)uVar7 < (uint)uVar6) + ((uint)((ulonglong)uVar6 >> 0x20) ^ 0x80000000)) { + // mSelectNum = (byte)iVar3; + // uVar4 = uVar5; + // } + } + + card_ptr += 0xa94; + + if (field_0x025b[i] == 0 && mDataNew[i] != 0) { + field_0x0220[i]->setAlpha(0); + field_0x022c[i]->setAlpha(0xFF); + } else { + field_0x0220[i]->setAlpha(0xFF); + field_0x022c[i]->setAlpha(0); + } + + field_0x0188[i]->setAlpha(0); + } + mpFileWarning->init(); + selectDataBaseMoveAnmInitSet(1,0x21); + mDoAud_seStart(Z2SE_SY_FILE_MENU_SLIDE_IN,0,0,0); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2054,19 +2311,89 @@ asm void dFile_select_c::dataSelectInAnmSet() { #include "asm/d/file/d_file_select/dataSelectInAnmSet__14dFile_select_cFv.s" } #pragma pop +#endif /* 80185040-80185230 17F980 01F0+00 1/0 0/0 0/0 .text dataSelectIn__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::dataSelectIn() { - nofralloc -#include "asm/d/file/d_file_select/dataSelectIn__14dFile_select_cFv.s" +void dFile_select_c::dataSelectIn() { + bool headerTxtChange = headerTxtChangeAnm(); + bool selectDataBaseMove = selectDataBaseMoveAnm(); + + bool errorMove = true; + if (field_0x014a || field_0x014b) { + errorMove = errorMoveAnm(); + } + + bool yesnoMenuMove = true; + if (field_0x0108 || field_0x0281) { + yesnoMenuMove = yesnoMenuMoveAnm(); + } + + bool nameMove = true; + if (field_0x0128 || mFileSelCopyDlst.field_0x08) { + nameMove = nameMoveAnm(); + } + + bool menuMove = true; + if (field_0x0360 || field_0x0283) { + menuMove = menuMoveAnm(); + } + + bool modoruTxtDisp = modoruTxtDispAnm(); + + if (headerTxtChange == true && selectDataBaseMove == true && + errorMove == true && yesnoMenuMove == true && + nameMove == true && menuMove == true && + modoruTxtDisp == true) { + for (int i = 0; i < 3; i++) { + field_0x00bc[i]->reinit(); + } + + headerTxtSet(0x43,1,0); + mLastSelectNum = mSelectNum; + field_0x00bc[mSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)mpAnmBase[0]); + field_0x00e0[mSelectNum] = SelStartFrameTbl[mSelectNum]; + field_0x0188[mSelectNum]->alphaAnimeStart(0); + ketteiTxtDispAnmInit(1); + field_0x026f = 2; + } } -#pragma pop /* 80185230-801853C4 17FB70 0194+00 1/0 0/0 0/0 .text dataSelectInit__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::dataSelectInit() { + bool headerTxtChange = headerTxtChangeAnm(); + bool alphaAnime = true; + bool ketteiTxtDisp = true; + bool check = true; + + if (mSelectNum != 0xFF) { + alphaAnime = field_0x0188[mSelectNum]->alphaAnime(g_fsHIO.field_0x0006,0,0xFF,1); + ketteiTxtDisp = ketteiTxtDispAnm(); + + if (field_0x00e0[mSelectNum] != SelEndFrameTbl[mSelectNum]) { + field_0x00e0[mSelectNum] += 2; + + if (field_0x00e0[mSelectNum] > SelEndFrameTbl[mSelectNum]) + field_0x00e0[mSelectNum] = SelEndFrameTbl[mSelectNum]; + + mpAnmBase[0]->setFrame(field_0x00e0[mSelectNum]); + field_0x00bc[mSelectNum]->getPanePtr()->animationTransform(); + check = false; + } + } + + if (headerTxtChange == true && alphaAnime == true && ketteiTxtDisp == true && check == true) { + if (mSelectNum != 0xFF) { + field_0x00bc[mSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + selFileCursorShow(); + } + + field_0x026f = 3; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2075,8 +2402,41 @@ asm void dFile_select_c::dataSelectInit() { #include "asm/d/file/d_file_select/dataSelectInit__14dFile_select_cFv.s" } #pragma pop +#endif /* 801853C4-80185508 17FD04 0144+00 1/0 0/0 0/0 .text dataSelect__14dFile_select_cFv */ +// handles switching between quest logs +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::dataSelect() { + mStick->checkTrigger(); + + // If A or Start was pressed + if (mDoCPd_c::getTrigA(PAD_1) || mDoCPd_c::getTrigStart(PAD_1)) { + dataSelectStart(); // run the quest log open process + } else { + if (mStick->checkUpTrigger()) { + // if we're not on the top quest log + if (mSelectNum != 0) { + mDoAud_seStart(Z2SE_FILE_SELECT_CURSOR,0,0,0); + mLastSelectNum = mSelectNum; + mSelectNum--; + dataSelectAnmSet(); // run the quest log selection animation + field_0x026f = 4; + } + } else if (mStick->checkDownTrigger()) { + // if we're not on the bottom quest log + if (mSelectNum != 2) { + mDoAud_seStart(Z2SE_FILE_SELECT_CURSOR,0,0,0); + mLastSelectNum = mSelectNum; + mSelectNum++; + dataSelectAnmSet(); // run the quest log selection animation + field_0x026f = 4; + } + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2085,29 +2445,26 @@ asm void dFile_select_c::dataSelect() { #include "asm/d/file/d_file_select/dataSelect__14dFile_select_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 804506B0-804506B8 000130 0008+00 2/2 0/0 0/0 .sdata YnSelStartFrameTbl */ -SECTION_SDATA static u8 YnSelStartFrameTbl[8] = { - 0x00, 0x00, 0x04, 0xE3, 0x00, 0x00, 0x04, 0xD4, +SECTION_SDATA static u32 YnSelStartFrameTbl[2] = { + 0x000004E3, + 0x000004D4, }; /* 804506B8-804506C0 000138 0008+00 2/2 0/0 0/0 .sdata YnSelEndFrameTbl */ -SECTION_SDATA static u8 YnSelEndFrameTbl[8] = { - 0x00, 0x00, 0x04, 0xD4, 0x00, 0x00, 0x04, 0xE3, +SECTION_SDATA static u32 YnSelEndFrameTbl[2] = { + 0x000004D4, + 0x000004E3, }; /* 804506C0-804506C8 000140 0006+02 4/4 0/0 0/0 .sdata msgTbl */ -SECTION_SDATA static u8 msgTbl[6 + 2 /* padding */] = { - 0x00, - 0x40, - 0x00, - 0x41, - 0x00, - 0x42, - /* padding */ - 0x00, - 0x00, +SECTION_SDATA static u16 msgTbl[3] = { + 0x0040, + 0x0041, + 0x0042, }; /* 80453948-8045394C 001F48 0004+00 35/35 0/0 0/0 .sdata2 @4778 */ @@ -2120,6 +2477,11 @@ SECTION_SDATA2 static u8 lit_4778[4] = { /* 80185508-80185994 17FE48 048C+00 1/1 0/0 0/0 .text dataSelectStart__14dFile_select_cFv */ +#ifdef NONMATCHING +void dFile_select_c::dataSelectStart() { + +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2128,9 +2490,26 @@ asm void dFile_select_c::dataSelectStart() { #include "asm/d/file/d_file_select/dataSelectStart__14dFile_select_cFv.s" } #pragma pop +#endif /* 80185994-80185AAC 1802D4 0118+00 7/7 0/0 0/0 .text * selectDataMoveAnmInitSet__14dFile_select_cFii */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::selectDataMoveAnmInitSet(int param_0, int param_1) { + field_0x00bc[0]->getPanePtr()->setAnimation((J2DAnmTransform*)mpAnmBase[0]); + field_0x00bc[1]->getPanePtr()->setAnimation((J2DAnmTransform*)mpAnmBase[0]); + field_0x00bc[2]->getPanePtr()->setAnimation((J2DAnmTransform*)mpAnmBase[0]); + mpPane->setAnimation((J2DAnmTransform*)mpAnmBase[0]); + field_0x00e0[mSelectNum] = param_0; + field_0x00ec = (s32*)param_1; + mpAnmBase[0]->setFrame(field_0x00e0[mSelectNum]); + field_0x00bc[0]->getPanePtr()->animationTransform(); + field_0x00bc[1]->getPanePtr()->animationTransform(); + field_0x00bc[2]->getPanePtr()->animationTransform(); + mpPane->animationTransform(); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2139,18 +2518,78 @@ asm void dFile_select_c::selectDataMoveAnmInitSet(int param_0, int param_1) { #include "asm/d/file/d_file_select/selectDataMoveAnmInitSet__14dFile_select_cFii.s" } #pragma pop +#endif /* 80185AAC-80185C2C 1803EC 0180+00 8/8 0/0 0/0 .text selectDataMoveAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +bool dFile_select_c::selectDataMoveAnm() { + if (field_0x00e0[mSelectNum] != field_0x00ec) { + if (field_0x00e0[mSelectNum] < field_0x00ec) { + field_0x00e0[mSelectNum] += 2; + + if (field_0x00e0[mSelectNum] > field_0x00ec) + field_0x00e0[mSelectNum] = field_0x00ec; + + } else { + field_0x00e0[mSelectNum] -= 2; + + if (field_0x00e0[mSelectNum] < field_0x00ec) + field_0x00e0[mSelectNum] = field_0x00ec; + } + + mpAnmBase[0]->setFrame(field_0x00e0[mSelectNum]); + + for (int i = 0; i < 3; i++) { + field_0x00bc[i]->getPanePtr()->animationTransform(); + } + mpPane->animationTransform(); + } + + if (field_0x00e0[mSelectNum] == field_0x00ec) { + for (int i = 0; i < 3; i++) { + field_0x00bc[i]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + } + mpPane->setAnimation((J2DAnmTransform*)0); + return true; + } else { + return false; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dFile_select_c::selectDataMoveAnm() { +asm bool dFile_select_c::selectDataMoveAnm() { nofralloc #include "asm/d/file/d_file_select/selectDataMoveAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 80185C2C-80185DE0 18056C 01B4+00 1/1 0/0 0/0 .text dataSelectAnmSet__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::dataSelectAnmSet() { + if (mSelectNum != 0xff) { + field_0x00bc[mSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)mpAnmBase[0]); + field_0x00e0[mSelectNum] = SelStartFrameTbl[mSelectNum]; + mpAnmBase[0]->setFrame(field_0x00e0[mSelectNum]); + field_0x00bc[mSelectNum]->getPanePtr()->animationTransform(); + field_0x0188[mSelectNum]->alphaAnimeStart(0); + } + + if (mLastSelectNum != 0xff) { + selectWakuAlpahAnmInit(mLastSelectNum,0xff,0,g_fsHIO.field_0x0008); + field_0x00bc[mLastSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)mpAnmBase[1]); // wrong? + field_0x00e0[mLastSelectNum] = SelEndFrameTbl[mLastSelectNum]; + mpAnmBase[1]->setFrame(field_0x00e0[mLastSelectNum]); + field_0x00bc[mLastSelectNum]->getPanePtr()->animationTransform(); + field_0x0188[mLastSelectNum]->alphaAnimeStart(0); + mpCursor1->setAlphaRate(0.0f); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2159,8 +2598,63 @@ asm void dFile_select_c::dataSelectAnmSet() { #include "asm/d/file/d_file_select/dataSelectAnmSet__14dFile_select_cFv.s" } #pragma pop +#endif /* 80185DE0-80186088 180720 02A8+00 1/0 0/0 0/0 .text dataSelectMoveAnime__14dFile_select_cFv */ +#ifdef NONMATCHING +// still alot wrong +void dFile_select_c::dataSelectMoveAnime() { + int iVar7 = 1; + int iVar6 = 1; + bool bVar1 = true; + if (mLastSelectNum != 0xff) { + field_0x0188[mLastSelectNum]->alphaAnime(g_fsHIO.field_0x0006,0xff,0,1); + selectWakuAlpahAnm(mLastSelectNum); + + if (field_0x00e0[mLastSelectNum] != SelStartFrameTbl[mLastSelectNum]) { + field_0x00e0[mLastSelectNum] = field_0x00e0[mLastSelectNum] - 2; + + if (field_0x00e0[mLastSelectNum] < SelStartFrameTbl[mLastSelectNum]) + field_0x00e0[mLastSelectNum] = SelStartFrameTbl[mLastSelectNum]; + + mpAnmBase[1]->setFrame(field_0x00e0[mLastSelectNum]); + field_0x00bc[mLastSelectNum]->getPanePtr()->animationTransform(); + bVar1 = false; + } + } + + int iVar5 = 1; + bool bVar2 = true; + + if (mSelectNum != 0xff) { + field_0x0188[mSelectNum]->alphaAnime(g_fsHIO.field_0x0006,0,0xff,1); + + if (field_0x00e0[mSelectNum] != SelEndFrameTbl[mSelectNum]) { + field_0x00e0[mSelectNum] = field_0x00e0[mSelectNum] + 2; + + if (SelEndFrameTbl[mSelectNum] < field_0x00e0[mSelectNum]) + field_0x00e0[mSelectNum] = SelEndFrameTbl[mSelectNum]; + + mpAnmBase[0]->setFrame(field_0x00e0[mSelectNum]); + field_0x00bc[mSelectNum]->getPanePtr()->animationTransform(); + bVar2 = false; + } + } + + if (iVar7 == 1 && iVar6 == 1 && bVar1 && (iVar5 == 1 && !bVar2)) { + if (mSelectNum != 0xff) { + field_0x00bc[mSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + selFileCursorShow(); + } + + if (mLastSelectNum != 0xff) { + field_0x00bc[mLastSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + } + + field_0x026f = 3; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2169,6 +2663,7 @@ asm void dFile_select_c::dataSelectMoveAnime() { #include "asm/d/file/d_file_select/dataSelectMoveAnime__14dFile_select_cFv.s" } #pragma pop +#endif /* 80186088-801864DC 1809C8 0454+00 2/2 0/0 0/0 .text makeRecInfo__14dFile_select_cFUc */ #pragma push @@ -2181,6 +2676,27 @@ asm void dFile_select_c::makeRecInfo(u8 param_0) { #pragma pop /* 801864DC-80186638 180E1C 015C+00 1/0 0/0 0/0 .text selectDataOpenMove__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals (s32 -> float cast) +void dFile_select_c::selectDataOpenMove() { + bool headerTxtChange = headerTxtChangeAnm(); + bool selectDataMove = selectDataMoveAnm(); + bool menuMove = menuMoveAnm(); + bool modoruTxtDisp = modoruTxtDispAnm(); + bool selectWakuAlpah = selectWakuAlpahAnm(mSelectNum); + + if (headerTxtChange == true && selectDataMove == true && menuMove == true && + modoruTxtDisp == true && selectWakuAlpah == true) { + mSelectMenuNum = 1; + field_0x0340[mSelectMenuNum]->getPanePtr()->setAnimation(field_0x0328); + field_0x0328->setFrame(MenuSelStartFrameTbl[mSelectMenuNum]); + field_0x0340[mSelectMenuNum]->getPanePtr()->animationTransform(); + field_0x0340[mSelectMenuNum]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + menuCursorShow(); + field_0x026f = 8; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2189,55 +2705,68 @@ asm void dFile_select_c::selectDataOpenMove() { #include "asm/d/file/d_file_select/selectDataOpenMove__14dFile_select_cFv.s" } #pragma pop +#endif /* 80186638-801866C8 180F78 0090+00 1/0 0/0 0/0 .text selectDataNameMove__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::selectDataNameMove() { - nofralloc -#include "asm/d/file/d_file_select/selectDataNameMove__14dFile_select_cFv.s" +void dFile_select_c::selectDataNameMove() { + bool headerTxtChange = headerTxtChangeAnm(); + bool fileRecScale = fileRecScaleAnm2(); + bool nameMove = nameMoveAnm(); + bool modoruTxtDisp = modoruTxtDispAnm(); + + if (headerTxtChange == true && fileRecScale == true && nameMove == true && modoruTxtDisp == true) { + field_0x026f = 15; + } } -#pragma pop /* 801866C8-80186774 181008 00AC+00 1/0 0/0 0/0 .text selectDataOpenEraseMove__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::selectDataOpenEraseMove() { - nofralloc -#include "asm/d/file/d_file_select/selectDataOpenEraseMove__14dFile_select_cFv.s" +void dFile_select_c::selectDataOpenEraseMove() { + bool headerTxtChange = headerTxtChangeAnm(); + bool selectDataMove = selectDataMoveAnm(); + yesnoMenuMoveAnm(); + bool modoruTxtDisp = modoruTxtDispAnm(); + bool selectWakuAlpah = selectWakuAlpahAnm(mSelectNum); + + if (headerTxtChange == true && selectDataMove == true && modoruTxtDisp == true && selectWakuAlpah == true) { + field_0x026e = 2; + yesnoCursorShow(); + field_0x026f = 26; + } } -#pragma pop /* 80186774-801868EC 1810B4 0178+00 1/0 0/0 0/0 .text menuSelect__14dFile_select_cFv */ +// Handles selecting between copy / start / delete menus in quest log #ifdef NONMATCHING // matches with literals void dFile_select_c::menuSelect() { mStick->checkTrigger(); + // if a was pressed, do the menu selection process if (mDoCPd_c::getTrigA(PAD_1)) { menuSelectStart(); } else { + // if b was pressed, do the menu cancel process if (mDoCPd_c::getTrigB(PAD_1)) { menuSelectCansel(); } else { if (mStick->checkRightTrigger()) { - if (field_0x0258[mSelectNum] == 0 && field_0x0267 != 0) { + if (field_0x0258[mSelectNum] == 0 && mSelectMenuNum != 0) { mDoAud_seStart(Z2SE_SY_MENU_CURSOR_COMMON,0,0,0); - field_0x0266 = field_0x0267; - field_0x0267--; - menuSelectAnmSet(); + mLastSelectMenuNum = mSelectMenuNum; + mSelectMenuNum--; + menuSelectAnmSet(); // run the menu selection animation field_0x026f = 9; } - } else if (mStick->checkLeftTrigger() && field_0x0258[mSelectNum] == 0 && field_0x0267 != 2) { - mDoAud_seStart(Z2SE_SY_MENU_CURSOR_COMMON,0,0,0); - field_0x0266 = field_0x0267; - field_0x0267++; - menuSelectAnmSet(); - field_0x026f = 9; - } + } else if (mStick->checkLeftTrigger()) { + if (field_0x0258[mSelectNum] == 0 && mSelectMenuNum != 2) { + mDoAud_seStart(Z2SE_SY_MENU_CURSOR_COMMON,0,0,0); + mLastSelectMenuNum = mSelectMenuNum; + mSelectMenuNum++; + menuSelectAnmSet(); // run the menu selection animation + field_0x026f = 9; + } + } } } } @@ -2254,25 +2783,26 @@ asm void dFile_select_c::menuSelect() { /* 801868EC-80186A80 18122C 0194+00 1/1 0/0 0/0 .text menuSelectStart__14dFile_select_cFv */ +// Handles copy / start / delete actions depending on which menu is selected from menuSelect #ifdef NONMATCHING // matches with literals void dFile_select_c::menuSelectStart() { mDoAud_seStart(Z2SE_SY_CURSOR_OK,0,0,0); - if (field_0x0267 == 1) { + if (mSelectMenuNum == 1) { dComIfGs_setCardToMemory(&mpMemCard,mSelectNum); field_0x0270 = 1; - field_0x026f = 0x2e; + field_0x026f = 46; dComIfGs_setDataNum(mSelectNum); } - else if (field_0x0267 == 0) { + else if (mSelectMenuNum == 0) { mpCursor1->setAlphaRate(0.0f); yesnoMenuMoveAnmInitSet(0x473,0x47d); headerTxtSet(0x49, 0,0); field_0x026e = 1; field_0x026f = 12; } - else if (field_0x0267 == 2) { + else if (mSelectMenuNum == 2) { field_0x026a = mSelectNum; menuMoveAnmInitSet(0x329,799); headerTxtSet(0x44,0,0); @@ -2321,18 +2851,16 @@ asm void dFile_select_c::menuSelectCansel() { /* 80186B48-80186C84 181488 013C+00 8/8 0/0 0/0 .text menuMoveAnmInitSet__14dFile_select_cFii */ #ifdef NONMATCHING -// getPanePtr() calling function past end of vtable? +// matches with literals void dFile_select_c::menuMoveAnmInitSet(int param_0, int param_1) { if (param_0 == 799) { field_0x0283 = true; for (int i = 0; i < 3; i++) { - if (i == field_0x0267) { - JUtility::TColor black = JUtility::TColor(255,255,255,255); - (&mpPaneMgr2)[i]->getPanePtr()->setAnimation((J2DAnmVtxColor*)&black); + if (i == mSelectMenuNum) { + static_cast<J2DTextBox*>((&mpPaneMgr2)[i]->getPanePtr())->setWhite(JUtility::TColor(255,255,255,255)); } else { - JUtility::TColor darkGrey = JUtility::TColor(150,150,150,255); - (&mpPaneMgr2)[i]->getPanePtr()->setAnimation((J2DAnmVtxColor*)&darkGrey); + static_cast<J2DTextBox*>((&mpPaneMgr2)[i]->getPanePtr())->setWhite(JUtility::TColor(150,150,150,255)); } } } @@ -2354,6 +2882,7 @@ asm void dFile_select_c::menuMoveAnmInitSet(int param_0, int param_1) { #pragma pop #endif +// Auto generated from the above function. Delete later /* 80186C84-80186CAC 1815C4 0028+00 0/0 1/0 0/0 .text setWhite__10J2DTextBoxFQ28JUtility6TColor */ #pragma push #pragma optimization_level 0 @@ -2366,6 +2895,44 @@ extern "C" asm void setWhite__10J2DTextBoxFQ28JUtility6TColor() { #pragma pop /* 80186CAC-80186E14 1815EC 0168+00 9/9 0/0 0/0 .text menuMoveAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +bool dFile_select_c::menuMoveAnm() { + if (field_0x0358 != field_0x035c) { + if (field_0x0358 < field_0x035c){ + field_0x0358 += 2; + + if (field_0x0358 > field_0x035c) + field_0x0358 = field_0x035c; + } else { + field_0x0358 -= 2; + + if (field_0x0358 < field_0x035c) + field_0x0358 = field_0x035c; + } + + field_0x0328->setFrame(field_0x0358); + field_0x0118->animationTransform(); + return false; + } else { + field_0x0118->setAnimation((J2DAnmTransform*)0); + if (field_0x035c == 0x0329) { + field_0x0360 = true; + field_0x0283 = false; + } else { + field_0x0360 = false; + + if (mSelectMenuNum != 0xFF) { + (&mpPaneAlpha1)[mSelectMenuNum]->setAlpha(0); + (&mpPaneAlpha2)[mSelectMenuNum]->setAlpha(0); + (&mpPaneAlpha3)[mSelectMenuNum]->setAlpha(0); + } + } + + return true; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2374,24 +2941,25 @@ asm bool dFile_select_c::menuMoveAnm() { #include "asm/d/file/d_file_select/menuMoveAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 80186E14-80186F98 181754 0184+00 1/1 0/0 0/0 .text menuSelectAnmSet__14dFile_select_cFv */ #ifdef NONMATCHING // matches with literals void dFile_select_c::menuSelectAnmSet() { - if (field_0x0267 != 0xFF) { - (&field_0x0340)[field_0x0267]->getPanePtr()->setAnimation(field_0x0328); - (&field_0x034c)[field_0x0267] = MenuSelEndFrameTbl[field_0x0267]; - field_0x0328->setFrame((&field_0x034c)[field_0x0267]); - (&field_0x0340)[field_0x0267]->getPanePtr()->animationTransform(); + if (mSelectMenuNum != 0xFF) { + (&field_0x0340)[mSelectMenuNum]->getPanePtr()->setAnimation(field_0x0328); + field_0x034c[mSelectMenuNum] = MenuSelEndFrameTbl[mSelectMenuNum]; + field_0x0328->setFrame(field_0x034c[mSelectMenuNum]); + (&field_0x0340)[mSelectMenuNum]->getPanePtr()->animationTransform(); } - if (field_0x0266 != 0xFF) { - (&field_0x0340)[field_0x0266]->getPanePtr()->setAnimation(field_0x032c); - (&field_0x034c)[field_0x0266] = MenuSelStartFrameTbl[field_0x0266]; - field_0x032c->setFrame((&field_0x034c)[field_0x0266]); - (&field_0x0340)[field_0x0266]->getPanePtr()->animationTransform(); - menuWakuAlpahAnmInit(field_0x0266,0xFF,0,g_fsHIO.field_0x0008); + if (mLastSelectMenuNum != 0xFF) { + (&field_0x0340)[mLastSelectMenuNum]->getPanePtr()->setAnimation(field_0x032c); + field_0x034c[mLastSelectMenuNum] = MenuSelStartFrameTbl[mLastSelectMenuNum]; + field_0x032c->setFrame(field_0x034c[mLastSelectMenuNum]); + (&field_0x0340)[mLastSelectMenuNum]->getPanePtr()->animationTransform(); + menuWakuAlpahAnmInit(mLastSelectMenuNum,0xFF,0,g_fsHIO.field_0x0008); mpCursor1->setAlphaRate(0.0f); } } @@ -2404,9 +2972,70 @@ asm void dFile_select_c::menuSelectAnmSet() { #include "asm/d/file/d_file_select/menuSelectAnmSet__14dFile_select_cFv.s" } #pragma pop - #endif + /* 80186F98-8018721C 1818D8 0284+00 1/0 0/0 0/0 .text menuSelectMoveAnm__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::menuSelectMoveAnm() { + bool tmp1 = true; + if (mSelectMenuNum != 0xFF && field_0x034c[mSelectMenuNum] != MenuSelStartFrameTbl[mSelectMenuNum]) { + if (field_0x034c[mSelectMenuNum] > MenuSelStartFrameTbl[mSelectMenuNum]) { + field_0x034c[mSelectMenuNum] -= 2; + + if (field_0x034c[mSelectMenuNum] < MenuSelStartFrameTbl[mSelectMenuNum]) + field_0x034c[mSelectMenuNum] = MenuSelStartFrameTbl[mSelectMenuNum]; + } else { + field_0x034c[mSelectMenuNum] += 2; + + if (field_0x034c[mSelectMenuNum] > MenuSelStartFrameTbl[mSelectMenuNum]) + field_0x034c[mSelectMenuNum] = MenuSelStartFrameTbl[mSelectMenuNum]; + } + + field_0x0328->setFrame(field_0x034c[mSelectMenuNum]); + (&field_0x0340)[mSelectMenuNum]->getPanePtr()->animationTransform(); + tmp1 = false; + } + + bool tmp2 = true; + bool tmp3 = true; + + if (mLastSelectMenuNum != 0xFF) { + if (field_0x034c[mLastSelectMenuNum] != MenuSelEndFrameTbl[mLastSelectMenuNum]) { + if (field_0x034c[mLastSelectMenuNum] < MenuSelEndFrameTbl[mLastSelectMenuNum]) { + field_0x034c[mLastSelectMenuNum] += 2; + + if (field_0x034c[mLastSelectMenuNum] > MenuSelEndFrameTbl[mLastSelectMenuNum]) + field_0x034c[mLastSelectMenuNum] = MenuSelEndFrameTbl[mLastSelectMenuNum]; + + } else { + field_0x034c[mLastSelectMenuNum] -= 2; + + if (field_0x034c[mLastSelectMenuNum] < MenuSelEndFrameTbl[mLastSelectMenuNum]) + field_0x034c[mLastSelectMenuNum] = MenuSelEndFrameTbl[mLastSelectMenuNum]; + } + field_0x032c->setFrame(field_0x034c[mLastSelectMenuNum]); + (&field_0x0340)[mLastSelectMenuNum]->getPanePtr()->animationTransform(); + tmp2 = false; + } + + tmp3 = menuWakuAlpahAnm(mLastSelectMenuNum); + } + + if (tmp1 == true && tmp2 == true && tmp3 == true) { + if (mSelectMenuNum != 0xFF) { + (&field_0x0340)[mSelectMenuNum]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + menuCursorShow(); + } + + if (mLastSelectMenuNum != 0xFF) { + (&field_0x0340)[mLastSelectMenuNum]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + } + + field_0x026f = 8; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2415,6 +3044,7 @@ asm void dFile_select_c::menuSelectMoveAnm() { #include "asm/d/file/d_file_select/menuSelectMoveAnm__14dFile_select_cFv.s" } #pragma pop +#endif /* 8018721C-801872C4 181B5C 00A8+00 1/0 0/0 0/0 .text ToNameMove__14dFile_select_cFv */ void dFile_select_c::ToNameMove() { @@ -2447,16 +3077,50 @@ void dFile_select_c::ToNameMove2() { /* 80187384-801873BC 181CC4 0038+00 1/0 0/0 0/0 .text nameInputWait__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::nameInputWait() { - nofralloc -#include "asm/d/file/d_file_select/nameInputWait__14dFile_select_cFv.s" +void dFile_select_c::nameInputWait() { + mpName->showIcon(); + field_0x026f = 16; } -#pragma pop + /* 801873BC-801874F8 181CFC 013C+00 1/0 0/0 0/0 .text nameInput__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::nameInput() { + mpName->_move(); + if (mpName->getCurPos() == 0) { + if (field_0x024c != 0) { + modoruTxtChange(0); + } + } else if (field_0x024c == 0) { + modoruTxtChange(1); + } + + int inputEnd = mpName->isInputEnd(); + + switch(mpName->isInputEnd()) { + case 1: + if (dComIfGs_getNoFile() == 1) { + field_0x021e = 0; + field_0x026f = 0; + field_0x0271 = 0; + } else { + headerTxtSet(0x43,1,0); + fileRecScaleAnmInitSet2(0.0f,1.0f); + nameMoveAnmInitSet(0xd29,0xd1f); + modoruTxtDispAnmInit(0); + field_0x026f = 14; + } + break; + case 2: + dComIfGs_setPlayerName(mpName->getInputStrPtr()); + mpName->hideIcon(); + field_0x020a = 15; + field_0x026f = 17; + + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2465,16 +3129,21 @@ asm void dFile_select_c::nameInput() { #include "asm/d/file/d_file_select/nameInput__14dFile_select_cFv.s" } #pragma pop +#endif /* 801874F8-8018759C 181E38 00A4+00 1/0 0/0 0/0 .text nameToDataSelectMove__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::nameToDataSelectMove() { - nofralloc -#include "asm/d/file/d_file_select/nameToDataSelectMove__14dFile_select_cFv.s" +void dFile_select_c::nameToDataSelectMove() { + bool headerTxtChange = headerTxtChangeAnm(); + bool fileResScal = fileRecScaleAnm2(); + bool nameMove = nameMoveAnm(); + bool modoruTxtDisp = modoruTxtDispAnm(); + + if (headerTxtChange == true && fileResScal == true && nameMove == true && modoruTxtDisp == true) { + modoruTxtChange(0); + selFileCursorShow(); + field_0x026f = 3; + } } -#pragma pop /* ############################################################################################## */ /* 8045394C-80453950 001F4C 0004+00 4/4 0/0 0/0 .sdata2 @5472 */ @@ -2492,6 +3161,25 @@ SECTION_SDATA2 static f64 lit_5475 = 4503599627370496.0 /* cast u32 to float */; /* 8018759C-801876A0 181EDC 0104+00 1/0 0/0 0/0 .text nameInputFade__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::nameInputFade() { + char name[32]; + field_0x020a--; + u8 alpha = (1.0f - (field_0x020a / 15.0f)) * 255.0f; + field_0x2378->setAlpha(alpha); + + if (field_0x020a == 0) { + headerTxtSet(900,1,1); + dMeter2Info_getString(899,name,0); + dComIfGs_setHorseName(name); + mpName->setNextNameStr(dComIfGs_getHorseName()); + mpName->initial(); + field_0x020a = 15; + field_0x026f = 18; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2500,9 +3188,26 @@ asm void dFile_select_c::nameInputFade() { #include "asm/d/file/d_file_select/nameInputFade__14dFile_select_cFv.s" } #pragma pop +#endif /* 801876A0-8018774C 181FE0 00AC+00 1/0 0/0 0/0 .text nameInput2Move__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::nameInput2Move() { + if (mDoRst::isReset() == 0) { + field_0x020a--; + + u8 alpha = (field_0x020a / 15.0f) * 255.0f; + field_0x2378->setAlpha(alpha); + + if (field_0x020a == 0) { + mpName->showIcon(); + field_0x026f = 19; + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2511,8 +3216,34 @@ asm void dFile_select_c::nameInput2Move() { #include "asm/d/file/d_file_select/nameInput2Move__14dFile_select_cFv.s" } #pragma pop +#endif /* 8018774C-80187824 18208C 00D8+00 1/0 0/0 0/0 .text nameInput2__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::nameInput2() { + mpName->_move(); + if (mpName->getCurPos() == 0) { + if (field_0x024c != 0) { + modoruTxtChange(0); + } + } else if (field_0x024c == 0) { + modoruTxtChange(1); + } + + switch(mpName->isInputEnd()) { + case 1: + mpName->hideIcon(); + field_0x020a = 0xf; + field_0x026f = 20; + break; + case 2: + dComIfGs_setHorseName(mpName->getInputStrPtr()); + mSelectEnd = true; + field_0x026f = 46; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2521,8 +3252,26 @@ asm void dFile_select_c::nameInput2() { #include "asm/d/file/d_file_select/nameInput2__14dFile_select_cFv.s" } #pragma pop +#endif /* 80187824-80187908 182164 00E4+00 1/0 0/0 0/0 .text backNameInputMove0__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::backNameInputMove0() { + field_0x020a--; + u8 alpha = (1.0f - (field_0x020a / 15.0f)) * 255.0f; + field_0x2378->setAlpha(alpha); + + if (field_0x020a == 0) { + headerTxtSet(901,1,1); + mpName->setNextNameStr(dComIfGs_getPlayerName()); + mpName->initial(); + modoruTxtChange(1); + field_0x020a = 15; + field_0x026f = 21; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2531,8 +3280,25 @@ asm void dFile_select_c::backNameInputMove0() { #include "asm/d/file/d_file_select/backNameInputMove0__14dFile_select_cFv.s" } #pragma pop +#endif /* 80187908-801879B8 182248 00B0+00 1/0 0/0 0/0 .text backNameInputMove__14dFile_select_cFv */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::backNameInputMove() { + if (mDoRst::isReset() == 0) { + field_0x020a--; + + u8 alpha = (field_0x020a / 15.0f) * 255.0f; + field_0x2378->setAlpha(alpha); + + if (field_0x020a == 0) { + modoruTxtChange(1); + field_0x026f = 15; + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2541,9 +3307,28 @@ asm void dFile_select_c::backNameInputMove() { #include "asm/d/file/d_file_select/backNameInputMove__14dFile_select_cFv.s" } #pragma pop +#endif /* 801879B8-80187ADC 1822F8 0124+00 1/0 0/0 0/0 .text ToCopyPaneMove__14dFile_select_cFv */ +#ifdef NONMATCHING +// unfinished +void dFile_select_c::ToCopyPaneMove() { + cPaneMgr* pPane; + + bool headerTxtChange = headerTxtChangeAnm(); + bool menuMove = menuMoveAnm(); + bool selectDataMove = selectDataMoveAnm(); + bool selectWakuAlpha = selectWakuAlpahAnm(mSelectNum); + bool nameMove = nameMoveAnm(); + + if (headerTxtChange == true && menuMove == true && selectDataMove == true && selectWakuAlpha == true && nameMove == true) { + field_0x026b = 0; + Vec vec = pPane->getGlobalVtxCenter(); + + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2552,28 +3337,34 @@ asm void dFile_select_c::ToCopyPaneMove() { #include "asm/d/file/d_file_select/ToCopyPaneMove__14dFile_select_cFv.s" } #pragma pop +#endif /* 80187ADC-80187B44 18241C 0068+00 1/0 0/0 0/0 .text ToErasePaneMove__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::ToErasePaneMove() { - nofralloc -#include "asm/d/file/d_file_select/ToErasePaneMove__14dFile_select_cFv.s" +void dFile_select_c::ToErasePaneMove() { + bool headerTxtChange = headerTxtChangeAnm(); + bool yesnoMenuMove = yesnoMenuMoveAnm(); + + if (headerTxtChange == true && yesnoMenuMove == true) { + yesnoCursorShow(); + field_0x026f = 26; + } } -#pragma pop /* 80187B44-80187BE8 182484 00A4+00 1/0 0/0 0/0 .text backSelectMove__14dFile_select_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select_c::backSelectMove() { - nofralloc -#include "asm/d/file/d_file_select/backSelectMove__14dFile_select_cFv.s" +void dFile_select_c::backSelectMove() { + bool headerTxtChange = headerTxtChangeAnm(); + bool selectDataMove = selectDataMoveAnm(); + bool menuMove = menuMoveAnm(); + bool modoruTxtDisp = modoruTxtDispAnm(); + + if (headerTxtChange == true && selectDataMove == true && menuMove == true && modoruTxtDisp == true) { + selFileCursorShow(); + mpFileSelect3d->drawOff(); + field_0x026f = 3; + } } -#pragma pop /* ############################################################################################## */ /* 80453960-80453964 001F60 0004+00 1/1 0/0 0/0 .sdata2 @5614 */ @@ -2584,6 +3375,38 @@ SECTION_SDATA2 static f32 lit_5615 = 109.0f; /* 80187BE8-80187DB8 182528 01D0+00 6/6 0/0 0/0 .text copySelMoveAnmInitSet__14dFile_select_cFii */ +#ifdef NONMATCHING +// matches with literals +void dFile_select_c::copySelMoveAnmInitSet(int param_0, int param_1) { + if (param_0 == 0xd1f) { + field_0x02c0->setAlpha(0xff); + field_0x02c8->setAlpha(0xff); + field_0x02d0->setAlpha(0xff); + field_0x02c4->setAlpha(0); + field_0x02cc->setAlpha(0); + field_0x02d4->setAlpha(0); + + field_0x02a4[0]->getPanePtr()->setAnimation(field_0x029c); + field_0x029c->setFrame(99.0f); + field_0x02a4[0]->getPanePtr()->animationTransform(); + field_0x02a4[0]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + + field_0x02a4[1]->getPanePtr()->setAnimation(field_0x02a0); + field_0x02a0->setFrame(109.0f); + field_0x02a4[1]->getPanePtr()->animationTransform(); + field_0x02a4[1]->getPanePtr()->setAnimation((J2DAnmTransform*)0); + + setSaveDataForCopySel(); + mFileSelCopyDlst.field_0x08 = true; + } + + field_0x011c->setAnimation(mpAnmBase[4]); + field_0x0120 = param_0; + field_0x0124 = param_1; + mpAnmBase[4]->setFrame(field_0x0120); + field_0x011c->animationTransform(); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2592,6 +3415,7 @@ asm void dFile_select_c::copySelMoveAnmInitSet(int param_0, int param_1) { #include "asm/d/file/d_file_select/copySelMoveAnmInitSet__14dFile_select_cFii.s" } #pragma pop +#endif /* 80187DB8-80187ED4 1826F8 011C+00 1/1 0/0 0/0 .text setSaveDataForCopySel__14dFile_select_cFv */ #pragma push @@ -2673,7 +3497,7 @@ asm void dFile_select_c::copySelectWakuAlpahAnmInit(u8 param_0, u8 param_1, u8 p #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dFile_select_c::copySelectWakuAlpahAnm(u8 param_0) { +asm bool dFile_select_c::copySelectWakuAlpahAnm(u8 param_0) { nofralloc #include "asm/d/file/d_file_select/copySelectWakuAlpahAnm__14dFile_select_cFUc.s" } @@ -3170,18 +3994,21 @@ asm void dFile_select_c::setSaveData() { /* ############################################################################################## */ /* 804506D0-804506D8 000150 0008+00 1/1 0/0 0/0 .sdata fontsize$7230 */ -SECTION_SDATA static u8 fontsize[8] = { - 0x41, 0xA8, 0x00, 0x00, 0x41, 0xD8, 0x00, 0x00, +static f32 fontsize[2] = { + 21.0f, + 27.0f }; /* 804506D8-804506E0 000158 0008+00 1/1 0/0 0/0 .sdata linespace$7231 */ -SECTION_SDATA static u8 linespace[8] = { - 0x41, 0xA8, 0x00, 0x00, 0x41, 0xA0, 0x00, 0x00, +static f32 linespace[2] = { + 21.0f, + 20.0f }; /* 804506E0-804506E8 000160 0008+00 1/1 0/0 0/0 .sdata charspace$7232 */ -SECTION_SDATA static u8 charspace[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +static f32 charspace[2] = { + 0.0f, + 0.0f }; /* 8018D0E4-8018D25C 187A24 0178+00 20/20 0/0 0/0 .text headerTxtSet__14dFile_select_cFUsUcUc */ @@ -3282,7 +4109,7 @@ asm void dFile_select_c::selectWakuAlpahAnmInit(u8 param_0, u8 param_1, u8 param #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dFile_select_c::selectWakuAlpahAnm(u8 param_0) { +asm bool dFile_select_c::selectWakuAlpahAnm(u8 param_0) { nofralloc #include "asm/d/file/d_file_select/selectWakuAlpahAnm__14dFile_select_cFUc.s" } @@ -3314,7 +4141,7 @@ void dFile_select_c::menuWakuAlpahAnmInit(u8 i_idx, u8 param_1, u8 param_2, u8 p #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dFile_select_c::menuWakuAlpahAnm(u8 param_0) { +asm bool dFile_select_c::menuWakuAlpahAnm(u8 param_0) { nofralloc #include "asm/d/file/d_file_select/menuWakuAlpahAnm__14dFile_select_cFUc.s" } @@ -3353,15 +4180,48 @@ asm void dFile_select_c::yesnoWakuAlpahAnm(u8 param_0) { #pragma pop /* 8018DD38-8018DEBC 188678 0184+00 0/0 1/1 0/0 .text _draw__14dFile_select_cFv */ +#ifdef NONMATCHING +void dFile_select_c::_draw() { + if (!mHasDrawn) { + dComIfGd_set2DOpa(&mFileSelectDlst); + + for (int i = 0; i < 3; i++) { + mpFileInfo[i]->draw(); + } + + dComIfGd_set2DOpa(&mFileSelDeleteDlst); + mpFileSelect3d.draw(); + + if (mFileSelCopyDlst.field_0x08 != false) { + dComIfGd_set2DOpa(&mFileSelCopyDlst); + + for (int i = 0; i < 2; i++) { + mpFileInfo[i]->draw(); + } + } + + if (field137_0x128 != false) { + mpName.draw(); + } + + dComIfGd_set2DOpa(&mFileSel3mDlst); + dComIfGd_set2DOpa(&mFileSelYesNoDlst); + mpFileWarning.draw(); + dComIfGd_set2DOpa(mpCursor1); + dComIfGd_set2DOpa(mpCursor2); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -// asm void dFile_select_c::_draw() { -extern "C" asm void _draw__14dFile_select_cFv() { +asm void dFile_select_c::_draw() { +// extern "C" asm void _draw__14dFile_select_cFv() { nofralloc #include "asm/d/file/d_file_select/_draw__14dFile_select_cFv.s" } #pragma pop +#endif /* 8018DEBC-8018DEF4 1887FC 0038+00 1/0 0/0 0/0 .text draw__15dDlst_FileSel_cFv */ #pragma push @@ -3867,8 +4727,7 @@ asm void dFile_select_c::errorTxtChangeAnm() { /* 8018FE18-8018FE64 18A758 004C+00 1/1 0/0 0/0 .text fileRecScaleAnm__14dFile_select_cFv */ bool dFile_select_c::fileRecScaleAnm() { - // mpPaneMgrs might be typed wrong? - return mpPaneMgrs[mSelectNum]->scaleAnime(g_fsHIO.field_0x0005,*(f32*)&mpPaneMgrs[3],field_0x00d4,0); + return field_0x00bc[mSelectNum]->scaleAnime(g_fsHIO.field_0x0005,field_0x00c8,field_0x00d4,0); } /* 8018FE64-8018FEF4 18A7A4 0090+00 2/2 0/0 0/0 .text fileRecScaleAnmInitSet2__14dFile_select_cFff @@ -3886,7 +4745,7 @@ asm void dFile_select_c::fileRecScaleAnmInitSet2(f32 param_0, f32 param_1) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dFile_select_c::fileRecScaleAnm2() { +asm bool dFile_select_c::fileRecScaleAnm2() { nofralloc #include "asm/d/file/d_file_select/fileRecScaleAnm2__14dFile_select_cFv.s" } @@ -4008,6 +4867,15 @@ asm void dFile_select_c::setInitSaveData() { #pragma pop /* 801902B8-801902F0 18ABF8 0038+00 2/2 0/0 0/0 .text dataSave__14dFile_select_cFv */ +#ifndef NONMATCHING +void dFile_select_c::dataSave() { + #if DEBUG + mDoMemCd_saveNAND(&mpMemCard,0x1fbc,0); + #else + mDoMemCd_save(&mpMemCard,0x1fbc,0); + #endif +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -4016,8 +4884,14 @@ asm void dFile_select_c::dataSave() { #include "asm/d/file/d_file_select/dataSave__14dFile_select_cFv.s" } #pragma pop +#endif /* 801902F0-80190380 18AC30 0090+00 1/1 0/0 0/0 .text __ct__16dFile_select3D_cFv */ +#ifdef NONMATCHING +dFile_select3D_c::dFile_select3D_c() { + mLightInfo.dKy_tevstr_c(); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -4026,6 +4900,7 @@ asm dFile_select3D_c::dFile_select3D_c() { #include "asm/d/file/d_file_select/__ct__16dFile_select3D_cFv.s" } #pragma pop +#endif /* 80190380-801903DC 18ACC0 005C+00 1/0 0/0 0/0 .text __dt__16dFile_select3D_cFv */ #pragma push @@ -4038,6 +4913,33 @@ asm dFile_select3D_c::~dFile_select3D_c() { #pragma pop /* 801903DC-8019049C 18AD1C 00C0+00 1/1 0/0 0/0 .text _create__16dFile_select3D_cFUcUc */ +#ifdef NONMATCHING +// matches with literals +void dFile_select3D_c::_create(u8 i_mirrorIdx, u8 i_maskIdx) { + JKRHeap* ppHeap[2]; + + mpHeap = mDoExt_createSolidHeapFromGameToCurrent(ppHeap,0x25800,32); + field_0x03c4 = 0.0f; + field_0x03c8 = 0.0f; + mMirrorIdx = i_mirrorIdx; + mMaskIdx = i_maskIdx; + if (mMirrorIdx != 0) { + createMirrorModel(); + } + + if (mMaskIdx != 0) { + createMaskModel(); + } + + mpHeap->adjustSize(); + mDoExt_setCurrentHeap(*ppHeap); + + if (mpModel) { + dKy_tevstr_init((dKy_tevstr_c *)&mLightInfo,0xFF,0xFF); + set_mtx(); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -4046,6 +4948,7 @@ asm void dFile_select3D_c::_create(u8 param_0, u8 param_1) { #include "asm/d/file/d_file_select/_create__16dFile_select3D_cFUcUc.s" } #pragma pop +#endif /* 8019049C-801904A0 18ADDC 0004+00 1/1 0/0 0/0 .text _delete__16dFile_select3D_cFv */ void dFile_select3D_c::_delete() { @@ -4121,29 +5024,36 @@ asm void dFile_select3D_c::animePlay() { #pragma pop /* 80190B44-80190BA8 18B484 0064+00 1/1 0/0 0/0 .text animeEntry__16dFile_select3D_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dFile_select3D_c::animeEntry() { - nofralloc -#include "asm/d/file/d_file_select/animeEntry__16dFile_select3D_cFv.s" +void dFile_select3D_c::animeEntry() { + if (mBrkAnm) { + mBrkAnm->entry(mpModel->getModelData()); + } + + if (mBckAnm) { + mBckAnm->entry(mpModel->getModelData()); + } } -#pragma pop /* ############################################################################################## */ /* 80394310-80394324 020970 0014+00 2/2 0/0 0/0 .rodata m_kamen_offset_x$8678 */ -SECTION_RODATA static u8 const m_kamen_offset_x[20] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +const static f32 m_kamen_offset_x[5] = { + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f }; COMPILER_STRIP_GATE(0x80394310, &m_kamen_offset_x); /* 80394324-80394338 020984 0014+00 0/1 0/0 0/0 .rodata m_kamen_offset_y$8679 */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const m_kamen_offset_y[20] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0xA0, 0x00, 0x00, 0x40, 0xA0, 0x00, 0x00, +const static f32 m_kamen_offset_y[5] = { + 0.0f, + 0.0f, + 0.0f, + 5.0f, + 5.0f }; COMPILER_STRIP_GATE(0x80394324, &m_kamen_offset_y); #pragma pop @@ -4151,9 +5061,12 @@ COMPILER_STRIP_GATE(0x80394324, &m_kamen_offset_y); /* 80394338-8039434C 020998 0014+00 0/1 0/0 0/0 .rodata m_kamen_scale$8680 */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const m_kamen_scale[20] = { - 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x3F, 0xCC, 0xCC, 0xCD, 0x3F, 0xCC, 0xCC, 0xCD, +const static f32 m_kamen_scale[5] = { + 2.0f, + 2.0f, + 2.0f, + 1.6f, + 1.6f }; COMPILER_STRIP_GATE(0x80394338, &m_kamen_scale); #pragma pop @@ -4172,9 +5085,12 @@ asm void dFile_select3D_c::createMaskModel() { /* 8039434C-80394360 0209AC 0014+00 0/1 0/0 0/0 .rodata m_mirror_offset_x$8781 */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const m_mirror_offset_x[20] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +const static f32 m_mirror_offset_x[5] = { + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f }; COMPILER_STRIP_GATE(0x8039434C, &m_mirror_offset_x); #pragma pop @@ -4182,9 +5098,12 @@ COMPILER_STRIP_GATE(0x8039434C, &m_mirror_offset_x); /* 80394360-80394374 0209C0 0014+00 0/1 0/0 0/0 .rodata m_mirror_offset_y$8782 */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const m_mirror_offset_y[20] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +const static f32 m_mirror_offset_y[5] = { + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f }; COMPILER_STRIP_GATE(0x80394360, &m_mirror_offset_y); #pragma pop @@ -4192,9 +5111,12 @@ COMPILER_STRIP_GATE(0x80394360, &m_mirror_offset_y); /* 80394374-80394388 0209D4 0014+00 0/1 0/0 0/0 .rodata m_mirror_scale$8783 */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const m_mirror_scale[20] = { - 0x3F, 0x19, 0x99, 0x9A, 0x3F, 0x19, 0x99, 0x9A, 0x3F, 0x19, - 0x99, 0x9A, 0x3F, 0x19, 0x99, 0x9A, 0x3F, 0x19, 0x99, 0x9A, +const static f32 m_mirror_scale[5] = { + 0.6f, + 0.6f, + 0.6f, + 0.6f, + 0.6f }; COMPILER_STRIP_GATE(0x80394374, &m_mirror_scale); #pragma pop @@ -4249,6 +5171,12 @@ asm void dFile_select3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cX SECTION_SDATA2 static f32 lit_8993 = -1000.0f; /* 801910D4-80191130 18BA14 005C+00 1/1 0/0 0/0 .text calcViewMtx__16dFile_select3D_cFPA4_f */ +#ifdef NONMATCHING +// matches with literals +void dFile_select3D_c::calcViewMtx(f32 (*param_0)[4]) { + cMtx_lookAt(param_0,&cXyz(0.0f,0.0f,-1000.0f),&cXyz::Zero,&cXyz(0.0f,1.0f,0.0f),0); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -4257,6 +5185,7 @@ asm void dFile_select3D_c::calcViewMtx(f32 (*param_0)[4]) { #include "asm/d/file/d_file_select/calcViewMtx__16dFile_select3D_cFPA4_f.s" } #pragma pop +#endif /* 80191130-80191134 18BA70 0004+00 1/0 0/0 0/0 .text * getTransform__15J2DAnmTransformCFUsP16J3DTransformInfo */ @@ -4362,6 +5291,4 @@ extern "C" asm void getString__12dMsgString_cFUlP10J2DTextBoxP10J2DTextBoxP7JUTF nofralloc #include "asm/d/file/d_file_select/getString__12dMsgString_cFUlP10J2DTextBoxP10J2DTextBoxP7JUTFontP10COutFont_cUc.s" } -#pragma pop - -/* 80394388-80394388 0209E8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +#pragma pop
\ No newline at end of file diff --git a/src/d/s/d_s_name.cpp b/src/d/s/d_s_name.cpp index 6ea7e9f269..4628c755a2 100644 --- a/src/d/s/d_s_name.cpp +++ b/src/d/s/d_s_name.cpp @@ -10,6 +10,7 @@ #include "d/meter/d_meter2_info.h" #include "dolphin/types.h" #include "f_op/f_op_overlap_mng.h" +#include "f_op/f_op_scene.h" #include "f_op/f_op_scene_mng.h" #include "f_pc/f_pc_manager.h" #include "global.h" @@ -18,69 +19,92 @@ #include "m_Do/m_Do_graphic.h" #include "m_Do/m_Do_machine.h" #include "m_Do/m_Do_mtx.h" +#include "f_op/f_op_overlap_mng.h" + // -// Types: +// Forward References: // -class dSn_HIO_c { -public: - /* 8025878C */ dSn_HIO_c(); - /* 802592DC */ virtual ~dSn_HIO_c() {} - - /* 0x4 */ s8 field_0x4; - /* 0x5 */ u8 mFileSelWaitTime; -}; - -// TODO: Remove when dFile_select_c virtual functions are properly defined in header -class dFile_select_c { -public: - /* 8018366C */ dFile_select_c(JKRArchive*); - /* 8018375C */ virtual ~dFile_select_c(); - /* 801843CC */ void _create(); - /* 801844FC */ void _move(); - /* 8018DD38 */ void _draw(); - - bool getFadeFlag() { return mFadeFlag; } - int isDataNew(u8 i) { return mDataNew[i]; } - int isSelectEnd() { return mSelectEnd; } - u8 getSelectNum() { return mSelectNum; } - void setUseType(u8 type) { mUseType = type; } - -private: - u8 field_0x4[0x254]; - /* 0x0258 */ u8 mDataNew[3]; - /* 0x025B */ u8 field_0x25b[0x265 - 0x25b]; - /* 0x0265 */ u8 mSelectNum; - /* 0x0266 */ u8 field_0x266[0x270 - 0x266]; - /* 0x0270 */ bool mSelectEnd; - /* 0x0271 */ u8 field_0x271[0x3b0 - 0x271]; - /* 0x03B0 */ u8 mUseType; - /* 0x03B1 */ u8 field_0x3b1[0x2374 - 0x3b1]; - /* 0x2374 */ bool mFadeFlag; - /* 0x2375 */ u8 field_0x2375[0x237c - 0x2375]; -}; - -// TODO: Remove when dBrightCheck_c virtual functions are properly defined in header -class dBrightCheck_c { -public: - /* 80192F10 */ dBrightCheck_c(JKRArchive*); - /* 80192F98 */ virtual ~dBrightCheck_c(); - /* 801934D0 */ void _move(); - /* 80193594 */ void _draw(); - - bool isEnd() { return mEnd; } - - u8 field_0x4[0x15]; - /* 0x19 */ bool mEnd; -}; - - +extern "C" void __ct__9dSn_HIO_cFv(); +extern "C" static void phase_1__FPc(); +extern "C" static void phase_2__FPc(); +extern "C" static void resLoad__FP30request_of_phase_process_classPc(); +extern "C" void create__10dScnName_cFv(); +extern "C" void setView__10dScnName_cFv(); +extern "C" void execute__10dScnName_cFv(); +extern "C" void draw__10dScnName_cFv(); +extern "C" void __dt__10dScnName_cFv(); +extern "C" void FileSelectOpen__10dScnName_cFv(); +extern "C" void FileSelectMain__10dScnName_cFv(); +extern "C" void FileSelectMainNormal__10dScnName_cFv(); +extern "C" void FileSelectClose__10dScnName_cFv(); +extern "C" void brightCheckOpen__10dScnName_cFv(); +extern "C" void brightCheck__10dScnName_cFv(); +extern "C" void changeGameScene__10dScnName_cFv(); +extern "C" static void dScnName_Draw__FP10dScnName_c(); +extern "C" static void dScnName_Execute__FP10dScnName_c(); +extern "C" static void dScnName_IsDelete__FP10dScnName_c(); +extern "C" static void dScnName_Delete__FP10dScnName_c(); +extern "C" static void dScnName_Create__FP11scene_class(); +extern "C" void __dt__17dScnName_camera_cFv(); +extern "C" void __dt__9dSn_HIO_cFv(); +extern "C" void __sinit_d_s_name_cpp(); +extern "C" extern char const* const d_s_d_s_name__stringBase0; // -// Forward References: +// External References: // +extern "C" void mDoMtx_lookAt__FPA4_fPC3VecPC3Vecs(); +extern "C" void mDoMtx_concatProjView__FPA4_CfPA4_CfPA4_f(); +extern "C" void mDoExt_getGameHeap__Fv(); +extern "C" void mDoExt_setCurrentHeap__FP7JKRHeap(); +extern "C" void fopOvlpM_IsPeek__Fv(); +extern "C" void fopScnM_ChangeReq__FP11scene_classssUs(); +extern "C" void dComIfG_resetToOpening__FP11scene_class(); +extern "C" void dComIfGp_setNextStage__FPCcsScSc(); +extern "C" void dComIfGs_gameStart__Fv(); +extern "C" void dComLbG_PhaseHandler__FP30request_of_phase_process_classPPFPv_iPv(); +extern "C" void offFirstBit__21dSv_player_get_item_cFUc(); +extern "C" void setRes__14dRes_control_cFPCcP11dRes_info_ciPCcUcP7JKRHeap(); +extern "C" void syncRes__14dRes_control_cFPCcP11dRes_info_ci(); +extern "C" void deleteRes__14dRes_control_cFPCcP11dRes_info_ci(); +extern "C" void getResInfo__14dRes_control_cFPCcP11dRes_info_ci(); +extern "C" void cleanup__13dPa_control_cFv(); +extern "C" void setViewPort__14dDlst_window_cFffffff(); +extern "C" void setScissor__14dDlst_window_cFffff(); +extern "C" void Run__12dVibration_cFv(); +extern "C" void Init__12dVibration_cFv(); +extern "C" void __ct__14dFile_select_cFP10JKRArchive(); +extern "C" void _create__14dFile_select_cFv(); +extern "C" void _move__14dFile_select_cFv(); +extern "C" void _draw__14dFile_select_cFv(); +extern "C" void __ct__14dBrightCheck_cFP10JKRArchive(); +extern "C" void _move__14dBrightCheck_cFv(); +extern "C" void _draw__14dBrightCheck_cFv(); +extern "C" void dKy_clear_game_init__Fv(); +extern "C" void dKy_setLight_init__Fv(); +extern "C" void changeWater__13dMeter2Info_cFUc(); +extern "C" void bgmStart__8Z2SeqMgrFUlUll(); +extern "C" void bgmStop__8Z2SeqMgrFUll(); +extern "C" void bgmStreamPrepare__8Z2SeqMgrFUl(); +extern "C" void bgmStreamPlay__8Z2SeqMgrFv(); +extern "C" void becomeCurrentHeap__7JKRHeapFv(); +extern "C" void destroy__7JKRHeapFv(); +extern "C" void* __nw__FUl(); +extern "C" void __dl__FPv(); +extern "C" void create__10JKRExpHeapFUlP7JKRHeapb(); +extern "C" void __register_global_object(); +extern "C" void __ptmf_scall(); +extern "C" void _savegpr_28(); +extern "C" void _restgpr_28(); +extern "C" void* mRenderModeObj__15mDoMch_render_c[1 + 1 /* padding */]; +extern "C" u8 mFader__13mDoGph_gInf_c[4]; +extern "C" u8 mResetData__6mDoRst[4 + 4 /* padding */]; +extern "C" u8 sManager__10JFWDisplay[4]; +extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; + // // Declarations: // @@ -130,9 +154,12 @@ static s32 phase_2(char* resName) { /* 80258878-802588A0 2531B8 0028+00 1/1 0/0 0/0 .text * resLoad__FP30request_of_phase_process_classPc */ static s32 resLoad(request_of_phase_process_class* i_phase, char* param_1) { - static s32 (*l_method[2])(char*) = {phase_1, phase_2}; + static request_of_phase_process_fn l_method[2] = { + (request_of_phase_process_fn)phase_1, + (request_of_phase_process_fn)phase_2 + }; - return dComLbG_PhaseHandler(i_phase, (request_of_phase_process_fn)l_method, param_1); + return dComLbG_PhaseHandler(i_phase, l_method, param_1); } /* ############################################################################################## */ @@ -313,10 +340,11 @@ void dScnName_c::brightCheck() { if (mBrightCheck->isEnd()) { dComIfGs_setSaveTotalTime(dComIfGs_getTotalTime()); dComIfGs_setSaveStartTime(OSGetTime()); - mDoAud_bgmStop(0x2D); + field_0x41f = 0; field_0x41d = 5; + dComIfGs_offItemFirstBit(GREEN_RUPEE); dComIfGs_offItemFirstBit(BLUE_RUPEE); dComIfGs_offItemFirstBit(YELLOW_RUPEE); @@ -339,6 +367,7 @@ void dScnName_c::changeGameScene() { if (dFs_c->isDataNew(dFs_c->getSelectNum())) { dComIfGp_setNextStage("F_SP108", 21, 1, 13); } + dKy_clear_game_init(); dComIfGs_resetDan(); dComIfGs_setRestartRoomParam(0); diff --git a/src/d/s/d_s_play.cpp b/src/d/s/d_s_play.cpp index a42e87d226..cdf06c78c7 100644 --- a/src/d/s/d_s_play.cpp +++ b/src/d/s/d_s_play.cpp @@ -984,20 +984,9 @@ static int phase_compleate(void* param_0) { } /* 8025AB94-8025ABC4 2554D4 0030+00 1/0 0/0 0/0 .text dScnPly_Create__FP11scene_class */ -#ifdef NONMATCHING -static void dScnPly_Create(scene_class* scn) { - dComLbG_PhaseHandler(&scn->field_0x1c4, l_method[0], scn); +static void dScnPly_Create(scene_class* i_this) { + dComLbG_PhaseHandler(&static_cast<dScnPly_c*>(i_this)->field_0x1c4, l_method, i_this); } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void dScnPly_Create(scene_class* param_0) { - nofralloc -#include "asm/d/s/d_s_play/dScnPly_Create__FP11scene_class.s" -} -#pragma pop -#endif /* 8025ABC4-8025AC0C 255504 0048+00 1/0 0/0 0/0 .text __dt__22dScnPly_env_debugHIO_cFv */ #pragma push diff --git a/src/f_op/f_op_msg_mng.cpp b/src/f_op/f_op_msg_mng.cpp index fc493bc542..e1ed7ec944 100644 --- a/src/f_op/f_op_msg_mng.cpp +++ b/src/f_op/f_op_msg_mng.cpp @@ -431,4 +431,4 @@ JKRExpHeap* fopMsgM_createExpHeap(u32 i_heapSize, JKRHeap* i_heap) { /* 800203E0-80020400 01AD20 0020+00 0/0 3/3 0/0 .text fopMsgM_destroyExpHeap__FP10JKRExpHeap */ void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap) { i_heap->destroy(); -} +}
\ No newline at end of file diff --git a/src/m_Do/m_Do_machine.cpp b/src/m_Do/m_Do_machine.cpp index d67e433c7c..0e260bc2e1 100644 --- a/src/m_Do/m_Do_machine.cpp +++ b/src/m_Do/m_Do_machine.cpp @@ -27,6 +27,7 @@ #include "m_Do/m_Do_machine_exception.h" #include "m_Do/m_Do_main.h" + // // Forward References: // diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 9c0a778ad0..42f1601859 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -32,23 +32,7 @@ #include "m_Do/m_Do_graphic.h" #include "m_Do/m_Do_machine.h" -// -// Forward References: -// - -extern "C" extern char const* const m_Do_m_Do_main__stringBase0; - -// -// External References: -// - -extern "C" void dump__14dRes_control_cFv(); -extern "C" void dump__24DynamicModuleControlBaseFv(); - -// -// Declarations: -// - +/* 800056C0-80005728 000000 0068+00 1/1 0/0 0/0 .text version_check__Fv */ void version_check() { if (!strcmp("20Apr2004", "20Apr2004") && !strcmp("Patch2", "Patch2")) { return; @@ -60,77 +44,60 @@ void version_check() { } while (true); } +/* 80005728-8000578C 000068 0064+00 1/1 0/0 0/0 .text CheckHeap1__9HeapCheckFv */ void HeapCheck::CheckHeap1() { s32 totalUsedSize = mHeap->getTotalUsedSize(); s32 freeSize = mHeap->getFreeSize(); - if (mMaxTotalUsedSize < totalUsedSize) { + if (mMaxTotalUsedSize < totalUsedSize) mMaxTotalUsedSize = totalUsedSize; - } - if (mMaxTotalFreeSize > freeSize) { + if (mMaxTotalFreeSize > freeSize) mMaxTotalFreeSize = freeSize; - } } +/* 803A2EE0-803A2EF4 000000 0012+02 2/2 1/1 0/0 .data COPYDATE_STRING__7mDoMain */ +char mDoMain::COPYDATE_STRING[18] = "??/??/?? ??:??:??"; + /* ############################################################################################## */ /* 803D32E0-803D3308 000000 0028+00 3/2 0/0 0/0 .bss RootHeapCheck */ -extern "C" HeapCheck RootHeapCheck; +// static HeapCheck RootHeapCheck; +static HeapCheck RootHeapCheck = HeapCheck(0,"Root","ルート"); /* 803D3308-803D3330 000028 0028+00 1/2 0/0 0/0 .bss SystemHeapCheck */ -extern "C" HeapCheck SystemHeapCheck; +// static HeapCheck SystemHeapCheck; +static HeapCheck SystemHeapCheck = HeapCheck(0,"System","システム"); /* 803D3330-803D3358 000050 0028+00 1/2 0/0 0/0 .bss ZeldaHeapCheck */ -extern "C" HeapCheck ZeldaHeapCheck; +// static HeapCheck ZeldaHeapCheck; +static HeapCheck ZeldaHeapCheck = HeapCheck(0,"Zelda","ゼルダ"); /* 803D3358-803D3380 000078 0028+00 1/2 0/0 0/0 .bss GameHeapCheck */ -extern "C" HeapCheck GameHeapCheck; +// static HeapCheck GameHeapCheck; +static HeapCheck GameHeapCheck = HeapCheck(0,"Game","ゲーム"); /* 803D3380-803D33A8 0000A0 0028+00 1/2 0/0 0/0 .bss ArchiveHeapCheck */ -extern "C" HeapCheck ArchiveHeapCheck; +// static HeapCheck ArchiveHeapCheck; +static HeapCheck ArchiveHeapCheck = HeapCheck(0,"Archive","アーカイブ"); /* 803D33A8-803D33D0 0000C8 0028+00 1/2 0/0 0/0 .bss J2dHeapCheck */ -extern "C" HeapCheck J2dHeapCheck; +// static HeapCheck J2dHeapCheck; +static HeapCheck J2dHeapCheck = HeapCheck(0,"J2d","J2D"); /* 803D33D0-803D33F8 0000F0 0028+00 1/2 0/0 0/0 .bss HostioHeapCheck */ -extern "C" HeapCheck HostioHeapCheck; +// static HeapCheck HostioHeapCheck; +static HeapCheck HostioHeapCheck = HeapCheck(0,"Hostio","ホストIO"); /* 803D33F8-803D3420 000118 0028+00 1/2 0/0 0/0 .bss CommandHeapCheck */ -extern "C" HeapCheck CommandHeapCheck; - -/* 803A2EE0-803A2EF4 000000 0012+02 2/2 1/1 0/0 .data COPYDATE_STRING__7mDoMain */ -SECTION_DATA char mDoMain::COPYDATE_STRING[18] = "??/??/?? ??:??:??"; +// static HeapCheck CommandHeapCheck; +static HeapCheck CommandHeapCheck = HeapCheck(0,"Command","コマンド"); /* 803A2EF4-803A2F14 -00001 0020+00 1/2 0/0 0/0 .data HeapCheckTable */ -SECTION_DATA static HeapCheck* HeapCheckTable[8] = { +static HeapCheck* HeapCheckTable[8] = { &RootHeapCheck, &SystemHeapCheck, &ZeldaHeapCheck, &GameHeapCheck, &ArchiveHeapCheck, &J2dHeapCheck, &HostioHeapCheck, &CommandHeapCheck, }; -/* 803D32E0-803D3308 000000 0028+00 3/2 0/0 0/0 .bss RootHeapCheck */ -static HeapCheck RootHeapCheck; - -/* 803D3308-803D3330 000028 0028+00 1/2 0/0 0/0 .bss SystemHeapCheck */ -static HeapCheck SystemHeapCheck; - -/* 803D3330-803D3358 000050 0028+00 1/2 0/0 0/0 .bss ZeldaHeapCheck */ -static HeapCheck ZeldaHeapCheck; - -/* 803D3358-803D3380 000078 0028+00 1/2 0/0 0/0 .bss GameHeapCheck */ -static HeapCheck GameHeapCheck; - -/* 803D3380-803D33A8 0000A0 0028+00 1/2 0/0 0/0 .bss ArchiveHeapCheck */ -static HeapCheck ArchiveHeapCheck; - -/* 803D33A8-803D33D0 0000C8 0028+00 1/2 0/0 0/0 .bss J2dHeapCheck */ -static HeapCheck J2dHeapCheck; - -/* 803D33D0-803D33F8 0000F0 0028+00 1/2 0/0 0/0 .bss HostioHeapCheck */ -static HeapCheck HostioHeapCheck; - -/* 803D33F8-803D3420 000118 0028+00 1/2 0/0 0/0 .bss CommandHeapCheck */ -static HeapCheck CommandHeapCheck; - /* 8000578C-80005848 0000CC 00BC+00 1/1 0/0 0/0 .text CheckHeap__FUl */ void CheckHeap(u32 i_padNo) { mDoMch_HeapCheckAll(); @@ -154,6 +121,7 @@ void CheckHeap(u32 i_padNo) { } } +/* 80005848-800058A0 000188 0058+00 2/2 0/0 0/0 .text countUsed__FP10JKRExpHeap */ static int countUsed(JKRExpHeap* heap) { OSDisableScheduler(); int counter = 0; @@ -168,10 +136,12 @@ static int countUsed(JKRExpHeap* heap) { return counter; } +/* 800058A0-800058C4 0001E0 0024+00 2/2 0/0 0/0 .text getUsedCount__9HeapCheckCFv */ s32 HeapCheck::getUsedCount() const { return countUsed(mHeap); } +/* 800058C4-80005AD8 000204 0214+00 1/1 0/0 0/0 .text heapDisplay__9HeapCheckCFv */ void HeapCheck::heapDisplay() const { s32 heap_size = mHeap->getSize(); s32 used_count = heap_size - mTargetHeapSize; @@ -199,13 +169,13 @@ void HeapCheck::heapDisplay() const { } /* 80450580-80450584 000000 0004+00 3/3 6/6 0/0 .sdata None */ -SECTION_SDATA s8 mDoMain::developmentMode = -1; +s8 mDoMain::developmentMode = -1; /* 80450584-80450588 000004 0004+00 0/0 1/1 0/0 .sdata memMargin__7mDoMain */ -SECTION_SDATA u32 mDoMain::memMargin = 0xFFFFFFFF; +u32 mDoMain::memMargin = 0xFFFFFFFF; /* 80450588-80450590 000008 0008+00 2/2 0/0 0/0 .sdata None */ -SECTION_SDATA u8 mDoMain::mHeapBriefType = 4; +u8 mDoMain::mHeapBriefType = 4; /* 80450B00-80450B08 000000 0008+00 1/1 0/0 0/0 .sbss None */ static u8 fillcheck_check_frame; @@ -218,10 +188,12 @@ OSTime mDoMain::sHungUpTime; /* 80450B18-80450B1C -00001 0004+00 3/3 0/0 0/0 .sbss None */ /* 80450B18 0001+00 data_80450B18 None */ -/* 80450B19 0001+00 data_80450B19 None */ -/* 80450B1A 0002+00 data_80450B1A None */ static bool mDisplayHeapSize; + +/* 80450B19 0001+00 data_80450B19 None */ static u8 mSelectHeapBar; + +/* 80450B1A 0002+00 data_80450B1A None */ static bool mCheckHeap; /* 80005AD8-80005D4C 000418 0274+00 1/1 0/0 0/0 .text debugDisplay__Fv */ @@ -377,7 +349,8 @@ bool Debug_console(u32 i_padNo) { JKRAram::getAramHeap()->dump(); } - dump__24DynamicModuleControlBaseFv(); + // dump__24DynamicModuleControlBaseFv(); + DynamicModuleControlBase::dump(); g_dComIfG_gameInfo.mResControl.dump(); } @@ -416,6 +389,7 @@ s32 LOAD_COPYDATE(void*) { return status; } +/* 800061C8-8000628C 000B08 00C4+00 1/1 0/0 0/0 .text debug__Fv */ static void debug() { if (mDoMain::developmentMode) { if (mCheckHeap) { @@ -447,8 +421,13 @@ static void debug() { void main01(void) { static u32 frame; + // Setup heaps, setup exception manager, set RNG seed, setup DVDError Thread, setup Memory card Thread mDoMch_Create(); + + // setup FrameBuffer and ZBuffer, init display lists mDoGph_Create(); + + // Setup control pad mDoCPd_c::create(); RootHeapCheck.setHeap((JKRExpHeap*)JKRHeap::getRootHeap()); @@ -497,10 +476,10 @@ void main01(void) { console->setPosition(32, 42); mDoDvdThd_callback_c::create((mDoDvdThd_callback_func)LOAD_COPYDATE, NULL); - fapGm_Create(); + fapGm_Create(); // init framework fopAcM_initManager(); mDisplayHeapSize = 0; - cDyl_InitAsync(); + cDyl_InitAsync(); // init RELs g_mDoAud_audioHeap = JKRSolidHeap::create(0x14D800, JKRHeap::getCurrentHeap(), false); @@ -514,10 +493,10 @@ void main01(void) { g_mDoMemCd_control.update(); } - mDoCPd_c::read(); - fapGm_Execute(); - mDoAud_Execute(); - debug(); + mDoCPd_c::read(); // read controller input + fapGm_Execute(); // handle game execution + mDoAud_Execute(); // handle audio execution + debug(); // run debugger } while (true); } @@ -572,8 +551,7 @@ void main() { } s32 priority = OSGetThreadPriority(current_thread); - OSCreateThread(&mainThread, main01, 0, stack + sizeof(mainThreadStack), sizeof(mainThreadStack), - priority, 0); + OSCreateThread(&mainThread, main01, 0, stack + sizeof(mainThreadStack), sizeof(mainThreadStack), priority, 0); OSResumeThread(&mainThread); OSSetThreadPriority(current_thread, 0x1F); OSSuspendThread(current_thread); @@ -585,42 +563,6 @@ bool JKRHeap::dump_sort() { } /* ############################################################################################## */ -/* 803739A0-803739A0 000000 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80373C3F = "Root"; -SECTION_DEAD static char const* const stringBase_80373C44 = "ルート"; -SECTION_DEAD static char const* const stringBase_80373C4B = "System"; -SECTION_DEAD static char const* const stringBase_80373C52 = "システム"; -SECTION_DEAD static char const* const stringBase_80373C5B = "Zelda"; -SECTION_DEAD static char const* const stringBase_80373C61 = "ゼルダ"; -SECTION_DEAD static char const* const stringBase_80373C68 = "Game"; -SECTION_DEAD static char const* const stringBase_80373C6D = "ゲーム"; -SECTION_DEAD static char const* const stringBase_80373C74 = "Archive"; -SECTION_DEAD static char const* const stringBase_80373C7C = "アーカイブ"; -SECTION_DEAD static char const* const stringBase_80373C87 = "J2d"; -SECTION_DEAD static char const* const stringBase_80373C8B = "J2D"; -SECTION_DEAD static char const* const stringBase_80373C8F = "Hostio"; -SECTION_DEAD static char const* const stringBase_80373C96 = "ホストIO"; -SECTION_DEAD static char const* const stringBase_80373C9F = "Command"; -SECTION_DEAD static char const* const stringBase_80373CA7 = "コマンド"; -#pragma pop - -/* 800065E0-80006798 000F20 01B8+00 0/0 1/0 0/0 .text __sinit_m_Do_main_cpp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void __sinit_m_Do_main_cpp(){nofralloc -#include "asm/m_Do/m_Do_main/__sinit_m_Do_main_cpp.s" -} -#pragma pop - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x800065E0, __sinit_m_Do_main_cpp); -#pragma pop - -/* ############################################################################################## */ /* 80450B38-80450B3C 000038 0004+00 0/0 2/2 0/0 .sbss * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ Z2WolfHowlMgr* JASGlobalInstance<Z2WolfHowlMgr>::sInstance; diff --git a/tools/libgithub/label.py b/tools/libgithub/label.py index fa777b9ccb..c4c64072e1 100644 --- a/tools/libgithub/label.py +++ b/tools/libgithub/label.py @@ -22,7 +22,6 @@ class Label: ret_label = Label(name=label) ret_labels.append(ret_label) - title_label = Label(data=d) ret_labels.append(title_label) |
