Match 3 functions in pre_met1.c

This commit is contained in:
nocato 2024-03-12 18:20:11 +01:00
parent b760f33ef3
commit 7381b1cd95
7 changed files with 280 additions and 623 deletions

View File

@ -1,36 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef pre_met1_800C4F58
pre_met1_800C4F58:
dw 0x000511C0 ; 800C4F58
dw 0x00451021 ; 800C4F5C
dw 0x00021080 ; 800C4F60
dw 0x34038000 ; 800C4F64
dw 0x00831821 ; 800C4F68
dw 0x94651584 ; 800C4F6C
dw 0x00822021 ; 800C4F70
dw 0xA4850658 ; 800C4F74
dw 0x94621588 ; 800C4F78
dw 0x00000000 ; 800C4F7C
dw 0xA482065A ; 800C4F80
dw 0x94621584 ; 800C4F84
dw 0x00000000 ; 800C4F88
dw 0x24420040 ; 800C4F8C
dw 0xA4820664 ; 800C4F90
dw 0x94621588 ; 800C4F94
dw 0x00000000 ; 800C4F98
dw 0xA4820666 ; 800C4F9C
dw 0x8C621588 ; 800C4FA0
dw 0x9465158C ; 800C4FA4
dw 0x24420015 ; 800C4FA8
dw 0xAC621588 ; 800C4FAC
dw 0xA485065C ; 800C4FB0
dw 0x94621590 ; 800C4FB4
dw 0x00000000 ; 800C4FB8
dw 0xA482065E ; 800C4FBC
dw 0x8C621590 ; 800C4FC0
dw 0x00000000 ; 800C4FC4
dw 0x24420015 ; 800C4FC8
dw 0x03E00008 ; 800C4FCC
dw 0xAC621590 ; 800C4FD0

View File

@ -1,69 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef pre_met1_800C4FD4
pre_met1_800C4FD4:
dw 0x27BDFFE0 ; 800C4FD4
dw 0xAFBF001C ; 800C4FD8
dw 0xAFB20018 ; 800C4FDC
dw 0xAFB10014 ; 800C4FE0
dw 0xAFB00010 ; 800C4FE4
dw 0x8C8202CC ; 800C4FE8
dw 0x00A09021 ; 800C4FEC
dw 0x2442FFFF ; 800C4FF0
dw 0x000210C0 ; 800C4FF4
dw 0x00521021 ; 800C4FF8
dw 0x000219C0 ; 800C4FFC
dw 0x00621821 ; 800C5000
dw 0x00031880 ; 800C5004
dw 0x00838821 ; 800C5008
dw 0x8E250644 ; 800C500C
dw 0x00000000 ; 800C5010
dw 0x10A00029 ; 800C5014
dw 0x00128040 ; 800C5018
dw 0x02128021 ; 800C501C
dw 0x00108080 ; 800C5020
dw 0x02128023 ; 800C5024
dw 0x00108080 ; 800C5028
dw 0x261002D0 ; 800C502C
dw 0x00908021 ; 800C5030
dw 0x0C011A69 ; 800C5034
dw 0x02002021 ; 800C5038
dw 0x0C011A57 ; 800C503C
dw 0x02002021 ; 800C5040
dw 0x0C011A60 ; 800C5044
dw 0x02002021 ; 800C5048
dw 0x24020100 ; 800C504C
dw 0xA6220654 ; 800C5050
dw 0x9602001E ; 800C5054
dw 0x001218C0 ; 800C5058
dw 0x2442FFFF ; 800C505C
dw 0xA6220656 ; 800C5060
dw 0x3C02800C ; 800C5064
dw 0x24423250 ; 800C5068
dw 0x00621821 ; 800C506C
dw 0x94620000 ; 800C5070
dw 0x00000000 ; 800C5074
dw 0xA622064C ; 800C5078
dw 0x94640002 ; 800C507C
dw 0x24020080 ; 800C5080
dw 0xA6220660 ; 800C5084
dw 0xA624064E ; 800C5088
dw 0x9602001E ; 800C508C
dw 0x00000000 ; 800C5090
dw 0x2442FFFF ; 800C5094
dw 0xA6220662 ; 800C5098
dw 0x94620000 ; 800C509C
dw 0x00000000 ; 800C50A0
dw 0x24420100 ; 800C50A4
dw 0xA6220650 ; 800C50A8
dw 0x94630002 ; 800C50AC
dw 0x24020001 ; 800C50B0
dw 0xA6220648 ; 800C50B4
dw 0xA6230652 ; 800C50B8
dw 0x8FBF001C ; 800C50BC
dw 0x8FB20018 ; 800C50C0
dw 0x8FB10014 ; 800C50C4
dw 0x8FB00010 ; 800C50C8
dw 0x03E00008 ; 800C50CC
dw 0x27BD0020 ; 800C50D0

View File

@ -1,414 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef pre_met1_800C50D4
pre_met1_800C50D4:
dw 0x27BDFFE0 ; 800C50D4
dw 0x0080C021 ; 800C50D8
dw 0x00A05021 ; 800C50DC
dw 0x00004821 ; 800C50E0
dw 0x24080080 ; 800C50E4
dw 0x34028000 ; 800C50E8
dw 0x03026021 ; 800C50EC
dw 0x3C0700FF ; 800C50F0
dw 0x34E7FFFF ; 800C50F4
dw 0xAFB60018 ; 800C50F8
dw 0xAFB50014 ; 800C50FC
dw 0xAFB40010 ; 800C5100
dw 0xAFB3000C ; 800C5104
dw 0xAFB20008 ; 800C5108
dw 0xAFB10004 ; 800C510C
dw 0xAFB00000 ; 800C5110
dw 0x8F0202CC ; 800C5114
dw 0x3C0BFF00 ; 800C5118
dw 0x2459FFFF ; 800C511C
dw 0x001930C0 ; 800C5120
dw 0x00191280 ; 800C5124
dw 0x00461021 ; 800C5128
dw 0x00021080 ; 800C512C
dw 0x24460464 ; 800C5130
dw 0x00582821 ; 800C5134
dw 0x84A20648 ; 800C5138
dw 0x240E0001 ; 800C513C
dw 0x144E0032 ; 800C5140
dw 0x3C02800B ; 800C5144
dw 0x8C43B920 ; 800C5148
dw 0x03062021 ; 800C514C
dw 0x00031080 ; 800C5150
dw 0x00431021 ; 800C5154
dw 0x00021080 ; 800C5158
dw 0x00822021 ; 800C515C
dw 0x24020064 ; 800C5160
dw 0xA0820007 ; 800C5164
dw 0x00401821 ; 800C5168
dw 0x24020004 ; 800C516C
dw 0x34630002 ; 800C5170
dw 0xA0820003 ; 800C5174
dw 0xA0880004 ; 800C5178
dw 0xA0880005 ; 800C517C
dw 0xA0880006 ; 800C5180
dw 0xA0830007 ; 800C5184
dw 0x8CA2064C ; 800C5188
dw 0x00000000 ; 800C518C
dw 0xAC820008 ; 800C5190
dw 0x8CA20654 ; 800C5194
dw 0xA080000C ; 800C5198
dw 0xAC820010 ; 800C519C
dw 0x90A2065A ; 800C51A0
dw 0x00000000 ; 800C51A4
dw 0xA082000D ; 800C51A8
dw 0x94A3065E ; 800C51AC
dw 0x94A2065C ; 800C51B0
dw 0x00031980 ; 800C51B4
dw 0x00021102 ; 800C51B8
dw 0x3042003F ; 800C51BC
dw 0x00621825 ; 800C51C0
dw 0x94820008 ; 800C51C4
dw 0xA483000E ; 800C51C8
dw 0x95831594 ; 800C51CC
dw 0x24C60204 ; 800C51D0
dw 0x00431021 ; 800C51D4
dw 0x8C830000 ; 800C51D8
dw 0x24A50204 ; 800C51DC
dw 0xA4820008 ; 800C51E0
dw 0x8D420000 ; 800C51E4
dw 0x006B1824 ; 800C51E8
dw 0x00471024 ; 800C51EC
dw 0x00621825 ; 800C51F0
dw 0xAC830000 ; 800C51F4
dw 0x8D430000 ; 800C51F8
dw 0x00871024 ; 800C51FC
dw 0x006B1824 ; 800C5200
dw 0x00621825 ; 800C5204
dw 0xAD430000 ; 800C5208
dw 0x25290001 ; 800C520C
dw 0x29220008 ; 800C5210
dw 0x1440FFC8 ; 800C5214
dw 0x3C03E100 ; 800C5218
dw 0x27080444 ; 800C521C
dw 0x3463043B ; 800C5220
dw 0x3C0500FF ; 800C5224
dw 0x34A5FFFF ; 800C5228
dw 0x001930C0 ; 800C522C
dw 0x00004821 ; 800C5230
dw 0x240D0080 ; 800C5234
dw 0x34028000 ; 800C5238
dw 0x03028821 ; 800C523C
dw 0x3C0C00FF ; 800C5240
dw 0x358CFFFF ; 800C5244
dw 0x3C0FFF00 ; 800C5248
dw 0x00192280 ; 800C524C
dw 0x00862021 ; 800C5250
dw 0x00042080 ; 800C5254
dw 0x248B0464 ; 800C5258
dw 0x01E03021 ; 800C525C
dw 0x00983821 ; 800C5260
dw 0xA10E0003 ; 800C5264
dw 0xAD030004 ; 800C5268
dw 0x8F030444 ; 800C526C
dw 0x8D420000 ; 800C5270
dw 0x00661824 ; 800C5274
dw 0x00451024 ; 800C5278
dw 0x00621825 ; 800C527C
dw 0xAF030444 ; 800C5280
dw 0x8D420000 ; 800C5284
dw 0x01052824 ; 800C5288
dw 0x00461024 ; 800C528C
dw 0x00451025 ; 800C5290
dw 0xAD420000 ; 800C5294
dw 0x84E20648 ; 800C5298
dw 0x24100001 ; 800C529C
dw 0x14500033 ; 800C52A0
dw 0x3C02800B ; 800C52A4
dw 0x8C43B920 ; 800C52A8
dw 0x030B2021 ; 800C52AC
dw 0x00031080 ; 800C52B0
dw 0x00431021 ; 800C52B4
dw 0x00021080 ; 800C52B8
dw 0x244200C8 ; 800C52BC
dw 0x00822021 ; 800C52C0
dw 0x24020064 ; 800C52C4
dw 0xA0820007 ; 800C52C8
dw 0x00401821 ; 800C52CC
dw 0x24020004 ; 800C52D0
dw 0x34630002 ; 800C52D4
dw 0xA0820003 ; 800C52D8
dw 0xA08D0004 ; 800C52DC
dw 0xA08D0005 ; 800C52E0
dw 0xA08D0006 ; 800C52E4
dw 0xA0830007 ; 800C52E8
dw 0x8CE20650 ; 800C52EC
dw 0x00000000 ; 800C52F0
dw 0xAC820008 ; 800C52F4
dw 0x8CE20660 ; 800C52F8
dw 0xA080000C ; 800C52FC
dw 0xAC820010 ; 800C5300
dw 0x90E20666 ; 800C5304
dw 0x00000000 ; 800C5308
dw 0xA082000D ; 800C530C
dw 0x94E3065E ; 800C5310
dw 0x94E2065C ; 800C5314
dw 0x00031980 ; 800C5318
dw 0x00021102 ; 800C531C
dw 0x3042003F ; 800C5320
dw 0x00621825 ; 800C5324
dw 0x94820008 ; 800C5328
dw 0xA483000E ; 800C532C
dw 0x96231594 ; 800C5330
dw 0x256B0204 ; 800C5334
dw 0x00431021 ; 800C5338
dw 0x8C830000 ; 800C533C
dw 0x24E70204 ; 800C5340
dw 0xA4820008 ; 800C5344
dw 0x8D420000 ; 800C5348
dw 0x006F1824 ; 800C534C
dw 0x004C1024 ; 800C5350
dw 0x00621825 ; 800C5354
dw 0xAC830000 ; 800C5358
dw 0x8D430000 ; 800C535C
dw 0x008C1024 ; 800C5360
dw 0x006F1824 ; 800C5364
dw 0x00621825 ; 800C5368
dw 0xAD430000 ; 800C536C
dw 0x25290001 ; 800C5370
dw 0x29220008 ; 800C5374
dw 0x1440FFC7 ; 800C5378
dw 0x2708044C ; 800C537C
dw 0x3C02E100 ; 800C5380
dw 0x3442043C ; 800C5384
dw 0x3C0500FF ; 800C5388
dw 0x34A5FFFF ; 800C538C
dw 0x001930C0 ; 800C5390
dw 0x00004821 ; 800C5394
dw 0x24120004 ; 800C5398
dw 0x24110064 ; 800C539C
dw 0x240E0080 ; 800C53A0
dw 0x00192280 ; 800C53A4
dw 0x00862021 ; 800C53A8
dw 0x00042080 ; 800C53AC
dw 0x248F0464 ; 800C53B0
dw 0x3C06FF00 ; 800C53B4
dw 0x00986821 ; 800C53B8
dw 0xA1100003 ; 800C53BC
dw 0xAD020004 ; 800C53C0
dw 0x8F03044C ; 800C53C4
dw 0x8D420000 ; 800C53C8
dw 0x00661824 ; 800C53CC
dw 0x00451024 ; 800C53D0
dw 0x00621825 ; 800C53D4
dw 0xAF03044C ; 800C53D8
dw 0x8D420000 ; 800C53DC
dw 0x01052824 ; 800C53E0
dw 0x00461024 ; 800C53E4
dw 0x00451025 ; 800C53E8
dw 0xAD420000 ; 800C53EC
dw 0x85A30648 ; 800C53F0
dw 0x24020001 ; 800C53F4
dw 0x14620045 ; 800C53F8
dw 0x3C02800C ; 800C53FC
dw 0x00003821 ; 800C5400
dw 0x244C3290 ; 800C5404
dw 0x3C0800FF ; 800C5408
dw 0x3508FFFF ; 800C540C
dw 0x3C0BFF00 ; 800C5410
dw 0x3C02800B ; 800C5414
dw 0x8C42B920 ; 800C5418
dw 0x030F2021 ; 800C541C
dw 0x00021880 ; 800C5420
dw 0x00621821 ; 800C5424
dw 0x00031100 ; 800C5428
dw 0x24420028 ; 800C542C
dw 0x00823021 ; 800C5430
dw 0x00031880 ; 800C5434
dw 0x00832021 ; 800C5438
dw 0x24C5000A ; 800C543C
dw 0x8C930000 ; 800C5440
dw 0x8C940004 ; 800C5444
dw 0x8C950008 ; 800C5448
dw 0x8C96000C ; 800C544C
dw 0xACD30000 ; 800C5450
dw 0xACD40004 ; 800C5454
dw 0xACD50008 ; 800C5458
dw 0xACD6000C ; 800C545C
dw 0x8C930010 ; 800C5460
dw 0x00000000 ; 800C5464
dw 0xACD30010 ; 800C5468
dw 0xA0B1FFFD ; 800C546C
dw 0x02201021 ; 800C5470
dw 0x34420002 ; 800C5474
dw 0xA0A2FFFD ; 800C5478
dw 0x00EC1021 ; 800C547C
dw 0xA0B2FFF9 ; 800C5480
dw 0xA0AEFFFA ; 800C5484
dw 0xA0AEFFFB ; 800C5488
dw 0xA0AEFFFC ; 800C548C
dw 0x90420000 ; 800C5490
dw 0x94A3FFFE ; 800C5494
dw 0x00021600 ; 800C5498
dw 0x00021603 ; 800C549C
dw 0x00621821 ; 800C54A0
dw 0x00EC1021 ; 800C54A4
dw 0x24E70002 ; 800C54A8
dw 0xA4A3FFFE ; 800C54AC
dw 0x90420001 ; 800C54B0
dw 0x94A30000 ; 800C54B4
dw 0x00021600 ; 800C54B8
dw 0x00021603 ; 800C54BC
dw 0x00621821 ; 800C54C0
dw 0xA4A30000 ; 800C54C4
dw 0x24A50014 ; 800C54C8
dw 0x8CC20000 ; 800C54CC
dw 0x8D430000 ; 800C54D0
dw 0x004B1024 ; 800C54D4
dw 0x00681824 ; 800C54D8
dw 0x00431025 ; 800C54DC
dw 0x00C81824 ; 800C54E0
dw 0xACC20000 ; 800C54E4
dw 0x8D420000 ; 800C54E8
dw 0x00000000 ; 800C54EC
dw 0x004B1024 ; 800C54F0
dw 0x00431025 ; 800C54F4
dw 0xAD420000 ; 800C54F8
dw 0x28E20008 ; 800C54FC
dw 0x1440FFCF ; 800C5500
dw 0x24C60014 ; 800C5504
dw 0x25EF0204 ; 800C5508
dw 0x25AD0204 ; 800C550C
dw 0x25290001 ; 800C5510
dw 0x29220008 ; 800C5514
dw 0x1440FFB5 ; 800C5518
dw 0x27080454 ; 800C551C
dw 0x3C03E100 ; 800C5520
dw 0x3463045B ; 800C5524
dw 0x3C0500FF ; 800C5528
dw 0x34A5FFFF ; 800C552C
dw 0x001930C0 ; 800C5530
dw 0x00004821 ; 800C5534
dw 0x24110004 ; 800C5538
dw 0x24100064 ; 800C553C
dw 0x240E0080 ; 800C5540
dw 0x00192280 ; 800C5544
dw 0x00862021 ; 800C5548
dw 0x00042080 ; 800C554C
dw 0x248F0464 ; 800C5550
dw 0x24020001 ; 800C5554
dw 0x3C06FF00 ; 800C5558
dw 0x00986821 ; 800C555C
dw 0xA1020003 ; 800C5560
dw 0xAD030004 ; 800C5564
dw 0x8F030454 ; 800C5568
dw 0x8D420000 ; 800C556C
dw 0x00661824 ; 800C5570
dw 0x00451024 ; 800C5574
dw 0x00621825 ; 800C5578
dw 0xAF030454 ; 800C557C
dw 0x8D420000 ; 800C5580
dw 0x01052824 ; 800C5584
dw 0x00461024 ; 800C5588
dw 0x00451025 ; 800C558C
dw 0xAD420000 ; 800C5590
dw 0x85A30648 ; 800C5594
dw 0x24020001 ; 800C5598
dw 0x14620046 ; 800C559C
dw 0x3C02800C ; 800C55A0
dw 0x00003821 ; 800C55A4
dw 0x244C3290 ; 800C55A8
dw 0x3C0800FF ; 800C55AC
dw 0x3508FFFF ; 800C55B0
dw 0x3C0BFF00 ; 800C55B4
dw 0x3C02800B ; 800C55B8
dw 0x8C42B920 ; 800C55BC
dw 0x030F2021 ; 800C55C0
dw 0x00021880 ; 800C55C4
dw 0x00621821 ; 800C55C8
dw 0x00031100 ; 800C55CC
dw 0x244200F0 ; 800C55D0
dw 0x00823021 ; 800C55D4
dw 0x00031880 ; 800C55D8
dw 0x246300C8 ; 800C55DC
dw 0x00832021 ; 800C55E0
dw 0x24C5000A ; 800C55E4
dw 0x8C930000 ; 800C55E8
dw 0x8C940004 ; 800C55EC
dw 0x8C950008 ; 800C55F0
dw 0x8C96000C ; 800C55F4
dw 0xACD30000 ; 800C55F8
dw 0xACD40004 ; 800C55FC
dw 0xACD50008 ; 800C5600
dw 0xACD6000C ; 800C5604
dw 0x8C930010 ; 800C5608
dw 0x00000000 ; 800C560C
dw 0xACD30010 ; 800C5610
dw 0xA0B0FFFD ; 800C5614
dw 0x02001021 ; 800C5618
dw 0x34420002 ; 800C561C
dw 0xA0A2FFFD ; 800C5620
dw 0x00EC1021 ; 800C5624
dw 0xA0B1FFF9 ; 800C5628
dw 0xA0AEFFFA ; 800C562C
dw 0xA0AEFFFB ; 800C5630
dw 0xA0AEFFFC ; 800C5634
dw 0x90420000 ; 800C5638
dw 0x94A3FFFE ; 800C563C
dw 0x00021600 ; 800C5640
dw 0x00021603 ; 800C5644
dw 0x00621821 ; 800C5648
dw 0x00EC1021 ; 800C564C
dw 0x24E70002 ; 800C5650
dw 0xA4A3FFFE ; 800C5654
dw 0x90420001 ; 800C5658
dw 0x94A30000 ; 800C565C
dw 0x00021600 ; 800C5660
dw 0x00021603 ; 800C5664
dw 0x00621821 ; 800C5668
dw 0xA4A30000 ; 800C566C
dw 0x24A50014 ; 800C5670
dw 0x8CC20000 ; 800C5674
dw 0x8D430000 ; 800C5678
dw 0x004B1024 ; 800C567C
dw 0x00681824 ; 800C5680
dw 0x00431025 ; 800C5684
dw 0x00C81824 ; 800C5688
dw 0xACC20000 ; 800C568C
dw 0x8D420000 ; 800C5690
dw 0x00000000 ; 800C5694
dw 0x004B1024 ; 800C5698
dw 0x00431025 ; 800C569C
dw 0xAD420000 ; 800C56A0
dw 0x28E20008 ; 800C56A4
dw 0x1440FFCF ; 800C56A8
dw 0x24C60014 ; 800C56AC
dw 0x25EF0204 ; 800C56B0
dw 0x25AD0204 ; 800C56B4
dw 0x25290001 ; 800C56B8
dw 0x29220008 ; 800C56BC
dw 0x1440FFB4 ; 800C56C0
dw 0x2708045C ; 800C56C4
dw 0x3C03E100 ; 800C56C8
dw 0x3463045C ; 800C56CC
dw 0x3C0400FF ; 800C56D0
dw 0x3484FFFF ; 800C56D4
dw 0x24020001 ; 800C56D8
dw 0x3C05FF00 ; 800C56DC
dw 0xA1020003 ; 800C56E0
dw 0xAD030004 ; 800C56E4
dw 0x8F03045C ; 800C56E8
dw 0x8D420000 ; 800C56EC
dw 0x00651824 ; 800C56F0
dw 0x00441024 ; 800C56F4
dw 0x00621825 ; 800C56F8
dw 0xAF03045C ; 800C56FC
dw 0x8D420000 ; 800C5700
dw 0x01042024 ; 800C5704
dw 0x00451024 ; 800C5708
dw 0x00441025 ; 800C570C
dw 0xAD420000 ; 800C5710
dw 0x8FB60018 ; 800C5714
dw 0x8FB50014 ; 800C5718
dw 0x8FB40010 ; 800C571C
dw 0x8FB3000C ; 800C5720
dw 0x8FB20008 ; 800C5724
dw 0x8FB10004 ; 800C5728
dw 0x8FB00000 ; 800C572C
dw 0x03E00008 ; 800C5730
dw 0x27BD0020 ; 800C5734

View File

@ -193,7 +193,7 @@ def main():
if rhs_only_matched:
disallowed_funcs = not_matched_functions()
rhs_funcnames = [f for f in rhs_funcnames if f not in allowed_funcs]
rhs_funcnames = [f for f in rhs_funcnames if f not in disallowed_funcs]
# Compare the functions, we love O(N^2):
results = {}

View File

@ -4,47 +4,77 @@
#include "Menu/menuman.h"
#include "Game/game.h"
typedef struct PreMet1SubWork_8000
typedef struct PreMet1Prims
{
// offsets relative to PreMet1Work start
char pad_8000[0x1584];
int field_9584;
int field_9588;
int field_958C;
int field_9590;
int field_9594;
int field_9598;
} PreMet1SubWork_8000;
SPRT field_0[2];
SPRT field_28[2][4];
SPRT field_C8[2];
SPRT field_F0[2][4];
char pad190[0x50];
char *field_1E0;
short field_1E4;
unsigned short field_1E6;
short field_1E8;
short field_1EA;
short field_1EC;
short field_1EE;
short field_1F0;
short field_1F2;
unsigned short field_1F4;
unsigned short field_1F6;
unsigned short field_1F8;
unsigned short field_1FA;
short field_1FC;
short field_1FE;
short field_200;
unsigned short field_202;
} PreMet1Prims;
typedef struct _PreMet1Work
{
GV_ACT actor;
DG_PRIM *field_20;
DG_PRIM *field_24;
int field_28[6];
int field_40[9];
int field_64;
POLY_FT4 field_68[6];
POLY_FT4 field_158[9];
short *field_2C0;
int *field_2C4;
int field_2C8;
int field_2CC;
KCB field_2D0[8];
char pad_430[0x7BD0];
PreMet1SubWork_8000 field_8000;
GV_ACT actor;
DG_PRIM *field_20;
DG_PRIM *field_24;
int field_28[6];
int field_40[9];
int field_64;
POLY_FT4 field_68[6];
POLY_FT4 field_158[9];
short *field_2C0;
int *field_2C4;
int field_2C8;
int field_2CC; // page?
KCB field_2D0[8];
char pad430[0x14];
DR_TPAGE field_444;
DR_TPAGE field_44C;
DR_TPAGE field_454;
DR_TPAGE field_45C;
PreMet1Prims field_464[9 * 8];
int field_9584;
int field_9588;
int field_958C;
int field_9590;
int field_9594;
int field_9598;
} PreMet1Work;
#define EXEC_LEVEL 5
// TODO: move data to pre_met1.c and format preope_dword_800C3250
typedef struct PreMet1Unk
{
int field_0;
int field_4;
short field_0;
short field_2;
int fore_color;
} PreMet1Unk;
extern PreMet1Unk preope_dword_800C3250[8];
PreMet1Unk premet1_800C3250[8] = {
{0x0010, 0x0023, 0x00000000}, {0x0010, 0x0036, 0x00000000}, {0x0010, 0x0049, 0x00000000},
{0x0010, 0x005C, 0x00000000}, {0x0010, 0x006F, 0x00000000}, {0x0010, 0x0082, 0x00000000},
{0x0010, 0x0095, 0x00000000}, {0x0010, 0x00A8, 0x00000000},
};
signed char premet1_800C3290[8] = {0xFF, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xFF};
extern int GV_Clock_800AB920;
@ -54,27 +84,194 @@ void PreMet1_800C4E40(PreMet1Work *work, int index)
KCB *kcb;
kcb = &work->field_2D0[index];
rect.x = work->field_8000.field_9584;
rect.y = work->field_8000.field_9588;
rect.x = work->field_9584;
rect.y = work->field_9588;
rect.w = 128;
rect.h = 21;
work->field_8000.field_9588 += 21;
font_init_kcb_80044BE0(kcb, &rect, work->field_8000.field_958C, work->field_8000.field_9590);
work->field_8000.field_9590 += 21;
work->field_9588 += 21;
font_init_kcb_80044BE0(kcb, &rect, work->field_958C, work->field_9590);
work->field_9590 += 21;
font_set_kcb_80044C90(kcb, -1, -1, 0, 6, 2, 0);
font_set_buffer_80044FD8(kcb, GV_AllocMemory_80015EB8(2, font_get_buffer_size_80044F38(kcb)));
font_set_color_80044DC4(kcb, 0, preope_dword_800C3250[index].field_4, 0);
font_set_color_80044DC4(kcb, 0, premet1_800C3250[index].fore_color, 0);
font_clut_update_80046980(kcb);
}
#pragma INCLUDE_ASM("asm/overlays/preope/pre_met1_800C4F58.s")
#pragma INCLUDE_ASM("asm/overlays/preope/pre_met1_800C4FD4.s")
void pre_met1_800C4FD4(PreMet1Work *work, int index);
void PreMet1_800C4F58(PreMet1Work *work, int index)
{
work->field_464[index].field_1F4 = work->field_9584;
work->field_464[index].field_1F6 = work->field_9588;
work->field_464[index].field_200 = work->field_9584 + 64;
work->field_464[index].field_202 = work->field_9588;
work->field_9588 += 21;
work->field_464[index].field_1F8 = work->field_958C;
work->field_464[index].field_1FA = work->field_9590;
work->field_9590 += 21;
}
#pragma INCLUDE_ASM("asm/overlays/preope/pre_met1_800C50D4.s")
void pre_met1_800C50D4(PreMet1Work *work, char *pOt);
void PreMet1_800C4FD4(PreMet1Work *work, int index)
{
KCB *kcb;
int i;
i = (work->field_2CC - 1) * 8 + index;
if (work->field_464[i].field_1E0 != NULL)
{
kcb = &work->field_2D0[index];
font_print_string_800469A4(kcb, work->field_464[i].field_1E0);
font_update_8004695C(kcb);
font_clut_update_80046980(kcb);
work->field_464[i].field_1F0 = 256;
work->field_464[i].field_1F2 = kcb->short3 - 1;
work->field_464[i].field_1E8 = premet1_800C3250[index].field_0;
work->field_464[i].field_1EA = premet1_800C3250[index].field_2;
work->field_464[i].field_1FC = 128;
work->field_464[i].field_1FE = kcb->short3 - 1;
work->field_464[i].field_1EC = premet1_800C3250[index].field_0 + 256;
work->field_464[i].field_1EE = premet1_800C3250[index].field_2;
work->field_464[i].field_1E4 = 1;
}
}
void PreMet1_800C50D4(PreMet1Work *work, char *pOt)
{
int i, j, k;
int j_start;
DR_TPAGE *tpage;
SPRT *sprt, *sprt2;
j_start = work->field_2CC - 1;
j = j_start * 8;
for (i = 0; i < 8; i++)
{
if (work->field_464[j].field_1E4 == 1)
{
sprt = &work->field_464[j].field_0[GV_Clock_800AB920];
setSprt(sprt);
setRGB0(sprt, 128, 128, 128);
setSemiTrans(sprt, 1);
LCOPY(&work->field_464[j].field_1E8, &sprt->x0);
LCOPY(&work->field_464[j].field_1F0, &sprt->w);
sprt->u0 = 0;
sprt->v0 = work->field_464[j].field_1F6;
sprt->clut = getClut(work->field_464[j].field_1F8, work->field_464[j].field_1FA);
sprt->x0 += work->field_9594;
addPrim(pOt, sprt);
j++;
}
}
tpage = &work->field_444;
setDrawTPage(tpage, 1, 0, getTPage(0, 1, 704, 256));
addPrim(pOt, tpage);
j = j_start * 8;
for (i = 0; i < 8; i++)
{
if (work->field_464[j].field_1E4 == 1)
{
sprt = &work->field_464[j].field_C8[GV_Clock_800AB920];
setSprt(sprt);
setRGB0(sprt, 128, 128, 128);
setSemiTrans(sprt, 1);
LCOPY(&work->field_464[j].field_1EC, &sprt->x0);
LCOPY(&work->field_464[j].field_1FC, &sprt->w);
sprt->u0 = 0;
sprt->v0 = work->field_464[j].field_202;
sprt->clut = getClut(work->field_464[j].field_1F8, work->field_464[j].field_1FA);
sprt->x0 += work->field_9594;
addPrim(pOt, sprt);
j++;
}
}
tpage = &work->field_44C;
setDrawTPage(tpage, 1, 0, getTPage(0, 1, 768, 256));
addPrim(pOt, tpage);
j = j_start * 8;
for (i = 0; i < 8; i++)
{
if (work->field_464[j].field_1E4 == 1)
{
sprt2 = work->field_464[j].field_28[GV_Clock_800AB920];
sprt = &work->field_464[j].field_0[GV_Clock_800AB920];
for (k = 0; k < 8; k += 2)
{
*sprt2 = *sprt;
// We just copied it anyways...
setSprt(sprt2);
setRGB0(sprt2, 128, 128, 128);
setSemiTrans(sprt2, 1);
sprt2->x0 += premet1_800C3290[k];
sprt2->y0 += premet1_800C3290[k + 1];
addPrim(pOt, sprt2);
sprt2++;
}
j++;
}
}
tpage = &work->field_454;
setDrawTPage(tpage, 1, 0, getTPage(0, 2, 704, 256));
addPrim(pOt, tpage);
j = j_start * 8;
for (i = 0; i < 8; i++)
{
if (work->field_464[j].field_1E4 == 1)
{
sprt2 = work->field_464[j].field_F0[GV_Clock_800AB920];
sprt = &work->field_464[j].field_C8[GV_Clock_800AB920];
for (k = 0; k < 8; k += 2)
{
*sprt2 = *sprt;
// We just copied it anyways...
setSprt(sprt2);
setRGB0(sprt2, 128, 128, 128);
setSemiTrans(sprt2, 1);
sprt2->x0 += premet1_800C3290[k];
sprt2->y0 += premet1_800C3290[k + 1];
addPrim(pOt, sprt2);
sprt2++;
}
j++;
}
}
tpage = &work->field_45C;
setDrawTPage(tpage, 1, 0, getTPage(0, 2, 768, 256));
addPrim(pOt, tpage);
}
void PreMet1SetColor_800C5738(PreMet1Work *work, int index, int fore)
{
@ -199,9 +396,8 @@ static inline int get_shade(PreMet1Work *work)
void PreMet1_800C5CE4(PreMet1Work *work)
{
int i;
unsigned short flags;
PreMet1SubWork_8000 *field_8000;
int i;
unsigned short flags;
flags = work->field_2C0[1];
@ -251,14 +447,13 @@ void PreMet1_800C5CE4(PreMet1Work *work)
{
if (flags & 0x100)
{
field_8000 = &work->field_8000;
if (field_8000->field_9598 == 0)
if (work->field_9598 == 0)
{
field_8000->field_9598 = 1;
work->field_9598 = 1;
}
else
{
field_8000->field_9598 = 0;
work->field_9598 = 0;
}
}
}
@ -288,14 +483,13 @@ void PreMet1_800C5CE4(PreMet1Work *work)
{
if (flags & 0x100)
{
field_8000 = &work->field_8000;
if (field_8000->field_9598 == 0)
if (work->field_9598 == 0)
{
field_8000->field_9598 = 1;
work->field_9598 = 1;
}
else
{
field_8000->field_9598 = 0;
work->field_9598 = 0;
}
}
}
@ -325,7 +519,7 @@ void PreMet1_800C5CE4(PreMet1Work *work)
case 4:
if (work->field_64 < 9)
{
work->field_8000.field_9594 = -(work->field_64 * 40);
work->field_9594 = -(work->field_64 * 40);
}
else if (work->field_64 == 9)
{
@ -340,9 +534,9 @@ void PreMet1_800C5CE4(PreMet1Work *work)
for (i = 0; i < 8; i++)
{
pre_met1_800C4FD4(work, i);
PreMet1_800C4FD4(work, i);
}
work->field_8000.field_9598 = 0;
work->field_9598 = 0;
}
else if (work->field_64 == 11)
{
@ -354,18 +548,18 @@ void PreMet1_800C5CE4(PreMet1Work *work)
}
else if (work->field_64 <= 19)
{
work->field_8000.field_9594 = (19 - work->field_64) * 40;
work->field_9594 = (19 - work->field_64) * 40;
}
else
{
work->field_8000.field_9594 = 0;
work->field_9594 = 0;
work->field_2C8 = 1;
}
break;
case 5:
if (work->field_64 < 9)
{
work->field_8000.field_9594 = work->field_64 * 40;
work->field_9594 = work->field_64 * 40;
}
else if (work->field_64 == 9)
{
@ -380,9 +574,9 @@ void PreMet1_800C5CE4(PreMet1Work *work)
for (i = 0; i < 8; i++)
{
pre_met1_800C4FD4(work, i);
PreMet1_800C4FD4(work, i);
}
work->field_8000.field_9598 = 0;
work->field_9598 = 0;
}
else if (work->field_64 == 11)
{
@ -393,11 +587,11 @@ void PreMet1_800C5CE4(PreMet1Work *work)
}
else if (work->field_64 <= 19)
{
work->field_8000.field_9594 = -((19 - work->field_64) * 40);
work->field_9594 = -((19 - work->field_64) * 40);
}
else
{
work->field_8000.field_9594 = 0;
work->field_9594 = 0;
work->field_2C8 = 2;
}
break;
@ -444,14 +638,13 @@ void PreMet1_800C5CE4(PreMet1Work *work)
}
else if (flags & 0x100)
{
field_8000 = &work->field_8000;
if (field_8000->field_9598 == 0)
if (work->field_9598 == 0)
{
field_8000->field_9598 = 1;
work->field_9598 = 1;
}
else
{
field_8000->field_9598 = 0;
work->field_9598 = 0;
}
}
break;
@ -482,7 +675,7 @@ void PreMet1_800C62B0(PreMet1Work *work)
color = get_color(shade);
}
if (work->field_8000.field_9598 == 1)
if (work->field_9598 == 1)
{
shade = 0;
color = get_color(shade);
@ -538,7 +731,7 @@ void PreMet1Act_800C65A8(PreMet1Work *work)
}
PreMet1_800C62B0(work);
PreMet1_800C63B4(work);
pre_met1_800C50D4(work, DG_ChanlOTag(1));
PreMet1_800C50D4(work, DG_ChanlOTag(1));
PreMet1ShadePacks_800C5A98(work);
work->field_64++;
}

View File

@ -3,6 +3,25 @@
// it looks like pre_met2 is identical to pre_met1
// except for different strings.
int preope_dword_800C3298 = 0x00230010;
int preope_dword_800C329C = 0x00000000;
int preope_dword_800C32A0 = 0x00360010;
int preope_dword_800C32A4 = 0x00000000;
int preope_dword_800C32A8 = 0x00490010;
int preope_dword_800C32AC = 0x00000000;
int preope_dword_800C32B0 = 0x005C0010;
int preope_dword_800C32B4 = 0x00000000;
int preope_dword_800C32B8 = 0x006F0010;
int preope_dword_800C32BC = 0x00000000;
int preope_dword_800C32C0 = 0x00820010;
int preope_dword_800C32C4 = 0x00000000;
int preope_dword_800C32C8 = 0x00950010;
int preope_dword_800C32CC = 0x00000000;
int preope_dword_800C32D0 = 0x00A80010;
int preope_dword_800C32D4 = 0x00000000;
int preope_dword_800C32D8 = 0x000100FF;
int preope_dword_800C32DC = 0xFF000100;
const int preope_dword_800C9298 = 0x800C7EB0;
const int preope_dword_800C929C = 0x800C7EEC;
const int preope_dword_800C92A0 = 0x800C8010;

View File

@ -20,42 +20,6 @@ int preope_dword_800C3240 = 0x00C300A0;
int preope_dword_800C3244 = 0x00006739;
int preope_dword_800C3248 = 0x000100FF;
int preope_dword_800C324C = 0xFF000100;
int preope_dword_800C3250 = 0x00230010;
int preope_dword_800C3254 = 0x00000000;
int preope_dword_800C3258 = 0x00360010;
int preope_dword_800C325C = 0x00000000;
int preope_dword_800C3260 = 0x00490010;
int preope_dword_800C3264 = 0x00000000;
int preope_dword_800C3268 = 0x005C0010;
int preope_dword_800C326C = 0x00000000;
int preope_dword_800C3270 = 0x006F0010;
int preope_dword_800C3274 = 0x00000000;
int preope_dword_800C3278 = 0x00820010;
int preope_dword_800C327C = 0x00000000;
int preope_dword_800C3280 = 0x00950010;
int preope_dword_800C3284 = 0x00000000;
int preope_dword_800C3288 = 0x00A80010;
int preope_dword_800C328C = 0x00000000;
int preope_dword_800C3290 = 0x000100FF;
int preope_dword_800C3294 = 0xFF000100;
int preope_dword_800C3298 = 0x00230010;
int preope_dword_800C329C = 0x00000000;
int preope_dword_800C32A0 = 0x00360010;
int preope_dword_800C32A4 = 0x00000000;
int preope_dword_800C32A8 = 0x00490010;
int preope_dword_800C32AC = 0x00000000;
int preope_dword_800C32B0 = 0x005C0010;
int preope_dword_800C32B4 = 0x00000000;
int preope_dword_800C32B8 = 0x006F0010;
int preope_dword_800C32BC = 0x00000000;
int preope_dword_800C32C0 = 0x00820010;
int preope_dword_800C32C4 = 0x00000000;
int preope_dword_800C32C8 = 0x00950010;
int preope_dword_800C32CC = 0x00000000;
int preope_dword_800C32D0 = 0x00A80010;
int preope_dword_800C32D4 = 0x00000000;
int preope_dword_800C32D8 = 0x000100FF;
int preope_dword_800C32DC = 0xFF000100;
const char preope_aPrebackl_800C9144[] = "pre_back_l";