Skip to content

Commit 522b53b

Browse files
committed
main/main: match functions
- `.lit4` - SpHatChangeSub - urawazaKeyCheck
1 parent 9d3a680 commit 522b53b

File tree

8 files changed

+57
-61
lines changed

8 files changed

+57
-61
lines changed

config/p3.jul12.slinky.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ segments:
639639
- { path: src/main/etc.c.o }
640640
- { path: src/main/wipe.c.o }
641641
- { path: src/main/mcctrl.c.o }
642-
- { path: asm/data/main/main.lit4.s.o }
642+
- { path: src/main/main.c.o }
643643
- { path: src/main/cmnfile.c.o }
644644
- { path: src/main/p3str.c.o }
645645
- { path: src/main/commake.c.o }

config/p3.jul12.symbol_addrs.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,6 +2386,9 @@ sceMcDelete = 0x00164bd0; // type:func
23862386
// sce/ee/gcc/src/newlib/libm/math/sf_sin.c
23872387
sinf = 0x001654a0; // type:func
23882388

2389+
// sce/ee/gcc/src/newlib/libm/math/w_atan2.c
2390+
atan2 = 0x00165618; // type:func
2391+
23892392
// sce/ee/gcc/src/newlib/libm/math/wf_atan2.c
23902393
atan2f = 0x00165730; // type:func
23912394

@@ -2412,6 +2415,7 @@ __DTOR_LIST__ = 0x0017a950;
24122415
dpadd = 0x0016b0e8; // type:func
24132416
dpsub = 0x0016b140; // type:func
24142417
dpcmp = 0x0016b6d0; // type:func
2418+
litodp = 0x0016b720; // type:func
24152419
dptofp = 0x0016b978; // type:func
24162420

24172421
// sce/ee/gcc/src/gcc/build/gcc/fp-bit.c

config/p3.jul12.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ segments:
324324
- [0x298F14, lit4, main/drawctrl]
325325
- [0x298F38, lit4, main/effect]
326326
- [0x298F40, lit4, main/mbar]
327-
- [0x298F44, lit4, main/main]
327+
- [0x298F44, .lit4, main/main]
328328

329329
- [0x298F4C, .lit4, menu/menu_mdl]
330330
- [0x298F60, lit4, menu/menusub]

progress/main_progress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"schemaVersion": 1, "label": "main", "message": "81.5789%", "color": "lime"}
1+
{"schemaVersion": 1, "label": "main", "message": "87.7193%", "color": "lime"}

progress/report.json

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"measures": {
3-
"fuzzy_match_percent": 48.732925,
3+
"fuzzy_match_percent": 49.307766,
44
"total_code": "342284",
5-
"matched_code": "163616",
6-
"matched_code_percent": 47.801243,
7-
"total_data": "26082796",
5+
"matched_code": "165116",
6+
"matched_code_percent": 48.23947,
7+
"total_data": "26082804",
88
"matched_data": "26033144",
9-
"matched_data_percent": 99.80963,
9+
"matched_data_percent": 99.80961,
1010
"total_functions": 1429,
11-
"matched_functions": 1005,
12-
"matched_functions_percent": 70.3289,
11+
"matched_functions": 1008,
12+
"matched_functions_percent": 70.53883,
1313
"total_units": 70
1414
},
1515
"units": [
@@ -3966,14 +3966,14 @@
39663966
{
39673967
"name": "main/mbar",
39683968
"measures": {
3969-
"fuzzy_match_percent": 56.550625,
3969+
"fuzzy_match_percent": 63.43343,
39703970
"total_code": "15052",
3971-
"matched_code": "8512",
3972-
"matched_code_percent": 56.55062,
3971+
"matched_code": "9548",
3972+
"matched_code_percent": 63.433434,
39733973
"total_data": "224",
39743974
"total_functions": 82,
3975-
"matched_functions": 66,
3976-
"matched_functions_percent": 80.48781,
3975+
"matched_functions": 68,
3976+
"matched_functions_percent": 82.92683,
39773977
"total_units": 1
39783978
},
39793979
"sections": [
@@ -3995,7 +3995,7 @@
39953995
{
39963996
"name": ".text",
39973997
"size": "15208",
3998-
"fuzzy_match_percent": 56.550625,
3998+
"fuzzy_match_percent": 63.43343,
39993999
"metadata": {}
40004000
}
40014001
],
@@ -4492,12 +4492,14 @@
44924492
{
44934493
"name": "MbarDispScene",
44944494
"size": "600",
4495+
"fuzzy_match_percent": 100.0,
44954496
"metadata": {},
44964497
"address": "12208"
44974498
},
44984499
{
44994500
"name": "MbarDispSceneDraw",
45004501
"size": "436",
4502+
"fuzzy_match_percent": 100.0,
45014503
"metadata": {},
45024504
"address": "12808"
45034505
},
@@ -5446,14 +5448,14 @@
54465448
{
54475449
"name": "main/main",
54485450
"measures": {
5449-
"fuzzy_match_percent": 47.24473,
5451+
"fuzzy_match_percent": 56.681522,
54505452
"total_code": "9872",
5451-
"matched_code": "4664",
5452-
"matched_code_percent": 47.24473,
5453-
"total_data": "824",
5453+
"matched_code": "5128",
5454+
"matched_code_percent": 51.944893,
5455+
"total_data": "832",
54545456
"total_functions": 19,
5455-
"matched_functions": 13,
5456-
"matched_functions_percent": 68.42105,
5457+
"matched_functions": 14,
5458+
"matched_functions_percent": 73.68421,
54575459
"total_units": 1
54585460
},
54595461
"sections": [
@@ -5467,6 +5469,11 @@
54675469
"fuzzy_match_percent": 100.0,
54685470
"metadata": {}
54695471
},
5472+
{
5473+
"name": ".lit4",
5474+
"size": "8",
5475+
"metadata": {}
5476+
},
54705477
{
54715478
"name": ".rodata",
54725479
"size": "824",
@@ -5475,7 +5482,7 @@
54755482
{
54765483
"name": ".text",
54775484
"size": "9896",
5478-
"fuzzy_match_percent": 47.24473,
5485+
"fuzzy_match_percent": 56.681522,
54795486
"metadata": {}
54805487
}
54815488
],
@@ -5503,6 +5510,7 @@
55035510
{
55045511
"name": "SpHatChangeSub",
55055512
"size": "464",
5513+
"fuzzy_match_percent": 100.0,
55065514
"metadata": {},
55075515
"address": "3072"
55085516
},
@@ -5590,6 +5598,7 @@
55905598
{
55915599
"name": "urawazaKeyCheck",
55925600
"size": "468",
5601+
"fuzzy_match_percent": 99.91453,
55935602
"metadata": {},
55945603
"address": "8400"
55955604
},
@@ -13213,16 +13222,16 @@
1321313222
{
1321413223
"id": "main",
1321513224
"measures": {
13216-
"fuzzy_match_percent": 66.737885,
13225+
"fuzzy_match_percent": 68.324196,
1321713226
"total_code": "124036",
13218-
"matched_code": "81936",
13219-
"matched_code_percent": 66.05824,
13220-
"total_data": "66144",
13227+
"matched_code": "83436",
13228+
"matched_code_percent": 67.26757,
13229+
"total_data": "66152",
1322113230
"matched_data": "56300",
13222-
"matched_data_percent": 85.117325,
13231+
"matched_data_percent": 85.107025,
1322313232
"total_functions": 570,
13224-
"matched_functions": 497,
13225-
"matched_functions_percent": 87.192986,
13233+
"matched_functions": 500,
13234+
"matched_functions_percent": 87.7193,
1322613235
"total_units": 17
1322713236
}
1322813237
},

progress/total_progress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"schemaVersion": 1, "label": "Total percentage", "message": "68.0895%", "color": "yellow"}
1+
{"schemaVersion": 1, "label": "Total percentage", "message": "70.5388%", "color": "yellow"}

src/main/main.c

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,9 @@ int selPlayDisp(int sel_stage, int sel_disp, int firstf) {
520520
return ret;
521521
}
522522

523-
#ifndef NON_MATCHING
524-
INCLUDE_ASM("asm/nonmatchings/main/main", SpHatChangeSub);
525-
void SpHatChangeSub(void);
526-
#else // TODO: fix rodata
523+
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A00);
524+
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A18);
525+
527526
static void SpHatChangeSub(void) {
528527
PADD *pad_pp;
529528

@@ -548,7 +547,7 @@ static void SpHatChangeSub(void) {
548547
PR_SCOPE
549548
int rt2t_r1[3] = { 0xb6, 0xb7, 0xb8 };
550549
int rt2t_r2[3] = { 0xb9, 0xba, 0xbb };
551-
int rt2t_r3[3] = { 0xbc, 0xbc, 0xbe };
550+
int rt2t_r3[3] = { 0xbc, 0xbd, 0xbe };
552551
int rt2t_r4[3] = { 0xbf, 0xc0, 0xc1 };
553552
RT2TRANS_STR rt2trans_str[4] = {
554553
{ .num = 3, .data_pp = rt2t_r1},
@@ -566,7 +565,6 @@ static void SpHatChangeSub(void) {
566565
}
567566
PR_SCOPEEND
568567
}
569-
#endif
570568

571569
extern char D_003996C0[]; /* sdata - "DEBUG" */
572570

@@ -731,15 +729,6 @@ void logoDispOne(SPR_PRIM *sprm_pp, TIM2_DAT *tmd_pp) {
731729
}
732730
}
733731

734-
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A00);
735-
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A18);
736-
737-
// From SpHatChangeSub
738-
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A38);
739-
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A48);
740-
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A58);
741-
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393A68);
742-
743732
static void uramenFileSearchTask(void *x) {
744733
printf("file search in\n");
745734
stDatFirstFileSearch();
@@ -904,18 +893,13 @@ void titleDisp(int firstf) {
904893
}
905894
}
906895

907-
INCLUDE_RODATA("asm/nonmatchings/main/main", D_00393AD0);
908-
909-
#ifndef NON_MATCHING
910-
INCLUDE_ASM("asm/nonmatchings/main/main", urawazaKeyCheck);
911-
#else /* .sdata migration required */
912896
int urawazaKeyCheck(void) {
913897
PADD *pad_pp;
914898
int change_tbl[17] = {
915-
1, 3, 5, 7,
916-
0, 10, 12, 14,
899+
1, 3, 5, 7,
900+
0, 10, 12, 14,
917901
16, 15, 13, 11,
918-
9, 8, 6, 4, 2,
902+
9, 8, 6, 4, 2,
919903
};
920904
int ud_d, ret;
921905
float pos;
@@ -928,9 +912,9 @@ int urawazaKeyCheck(void) {
928912
} else {
929913
if (pad_pp->ana[PAD_ANA_RY] < (128 - 64) || pad_pp->ana[PAD_ANA_RX] >= (64 + 128) ||
930914
pad_pp->ana[PAD_ANA_RY] >= (64 + 128) || pad_pp->ana[PAD_ANA_RX] < (128 - 64)) {
931-
int a0 = pad_pp->ana[PAD_ANA_RX] - 128;
932-
int s0 = pad_pp->ana[PAD_ANA_RY] - 128;
933-
pos = atan2(-a0, s0);
915+
int rx = pad_pp->ana[PAD_ANA_RX] - 128;
916+
int ry = pad_pp->ana[PAD_ANA_RY] - 128;
917+
pos = atan2(-rx, ry);
934918
pos = (pos + 3.1415927f);
935919
pos = (pos * 17.0f) / 6.2831855f;
936920
ud_d = pos;
@@ -953,7 +937,6 @@ int urawazaKeyCheck(void) {
953937

954938
return ret;
955939
}
956-
#endif
957940

958941
extern char D_003996D0[]; /* sdata - "ura:%d" */
959942

src/menu/menufont.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/* data 18f598 */ extern MCODE_ASCII mcode_ascii_TmpMenuFont[]; /* static */
1212
/* data 18fe58 */ extern MCODE_ASCII mcode_HalfSpace; /* static */
1313
/* data 18fe68 */ extern MCODE_KANJI_ANIME PadSymbolFontA[]; /* static */
14-
/* data 18ff70 */ MCODE_DAT ArowPat[];
14+
/* data 18ff70 */ extern MCODE_DAT ArowPat[];
1515
/* data 18ffa8 */ extern MCODE_DAT TsFont[]; /* static */
1616
/* data 190360 */ extern char Tbl_ASC2EUC[193]; /* static */
1717
/* sdata 399890 */ extern int _PadFont_SW; /* static */
@@ -232,7 +232,7 @@ static void _PKFontPut(SPR_PKT pk, SPR_PRM *spr, SUBT_CODE *psubt, int line_num,
232232
break;
233233
}
234234

235-
ppMcode = &mcode_dat_pp_TmpMenuFont;
235+
ppMcode = mcode_dat_pp_TmpMenuFont;
236236
for (i = 0; i < line_num; i++) {
237237
int x;
238238
int y;
@@ -308,7 +308,7 @@ static void _PADArrow_Put(SPR_PKT pk, SPR_PRM *spr, MCODE_DAT *pfnt, int x, int
308308
aflg = pfnt->v;
309309
}
310310

311-
pat = &ArowPat;
311+
pat = ArowPat;
312312

313313
spr->px = x;
314314
spr->py = y;

0 commit comments

Comments
 (0)