Reduce the amount of Overlays with rodata issues (#212)

* Player C file

* Fix rodata issue in player and remove some actors that doesn't have rodata issues from the list

* Check every asm with rodata issues

* Add fishing relocs and change clang-format version to a generic one

* undo clang-format version
This commit is contained in:
Anghelo Carvajal 2021-07-27 02:01:11 -04:00 committed by GitHub
parent b59d9a9935
commit df1fd4adc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1331 additions and 16 deletions

View File

@ -813,8 +813,10 @@ SECTIONS
_ovl_Player_ActorSegmentStart = SegmentStart;
ovl_Player_Actor : AT(RomLocation)
{
build/asm/overlays/ovl_Player_Actor_0x8082DA90.o(.text)
build/src/overlays/actors/ovl_Player_Actor/z_player.o(.text)
build/asm/overlays/ovl_Player_Actor_data.o(.data)
build/src/overlays/actors/ovl_Player_Actor/z_player.o(.rodata)
build/asm/overlays/ovl_Player_Actor_rodata.o(.rodata)
ovl_Player_Actor_bss_start = .;
}
. += 0x80;

View File

@ -0,0 +1,2 @@
ovl_Player_Actor
z_player.c

File diff suppressed because it is too large Load Diff

View File

@ -562,6 +562,7 @@
0x80816020:"ovl_daytelop_rodata",
0x8082AED0:"ovl_kaleido_scope_data",
0x8085B9F0:"ovl_Player_Actor_data",
0x8085E3B0:"ovl_Player_Actor_rodata",
0x808637B0:"ovl_En_Test_data",
0x808637D0:"ovl_En_Test_rodata",
0x80864A30:"ovl_En_GirlA_data",

View File

@ -8193,6 +8193,9 @@
0x8090DC1C:("D_8090DC1C","f32","",0x4),
0x8090DC20:("D_8090DC20","f32","",0x4),
0x8090DC24:("D_8090DC24","f32","",0x4),
0x8090DC30:("enFishingOverlayInfo","OverlayRelocationSection","",0x14),
0x8090DC44:("enFishingOverlayRelocations","u32","[2393]",0x2564),
0x809101AC:("enFishingOverlayInfoOffset","u32","",0x4),
0x80910000:("D_80910000","UNK_TYPE1","",0x1),
0x80910001:("D_80910001","UNK_TYPE1","",0x1),
0x809101B0:("D_809101B0","f32","",0x4),

View File

@ -63,8 +63,10 @@ def split_asm_and_rodata():
if current_file != None:
if len(relevant_rodata):
# Sort the rodata by it order of appearance in the original rodata file.
relevant_rodata.sort()
current_file.write("\n.section .late_rodata\n\n")
for entry in relevant_rodata:
for rodataIndex, entry in relevant_rodata:
writeLabel = True
for labelName in written_rodata:
if entry[0] == labelName:
@ -81,10 +83,10 @@ def split_asm_and_rodata():
deleteLine = False
for xline in rodata_lines:
if deleteLine:
for entry in relevant_rodata:
if xline.startswith('glabel') and not xline.startswith('glabel L80'):
deleteLine = False
break
for rodataIndex, entry in relevant_rodata:
if xline.startswith('glabel') and not xline.startswith('glabel L80'):
deleteLine = False
break
if xline.startswith('glabel') and not xline.startswith('glabel L80'):
for labelName in written_rodata:
if labelName in xline:
@ -111,26 +113,28 @@ def split_asm_and_rodata():
print(args.input)
entryLabel = ""
for existing_entry in relevant_rodata:
for rodataIndex, existing_entry in relevant_rodata:
if existing_entry[0] == entryLabel:
addRodata = False
break
if addRodata:
if entryLabel in line:
for xentries in rodata_entries:
for rodataIndex, xentries in enumerate(rodata_entries):
if entryLabel == xentries[0]:
# Is Used
xentries[2] = True
relevant_rodata.append(xentries)
relevant_rodata.append((rodataIndex, xentries))
break
if writing:
current_file.write(line)
if current_file != None:
if len(relevant_rodata):
# Sort the rodata by it order of appearance in the original rodata file.
relevant_rodata.sort()
current_file.write("\n.section .late_rodata\n\n")
for entry in relevant_rodata:
for rodataIndex, entry in relevant_rodata:
writeLabel = True
for labelName in written_rodata:
if entry[0] == labelName:
@ -147,10 +151,10 @@ def split_asm_and_rodata():
deleteLine = False
for xline in rodata_lines:
if deleteLine:
for entry in relevant_rodata:
if xline.startswith('glabel') and not xline.startswith('glabel L80'):
deleteLine = False
break
for rodataIndex, entry in relevant_rodata:
if xline.startswith('glabel') and not xline.startswith('glabel L80'):
deleteLine = False
break
if xline.startswith('glabel') and not xline.startswith('glabel L80'):
for labelName in written_rodata:
if labelName in xline:
@ -172,8 +176,17 @@ def split_asm_and_rodata():
for name in file_names:
f.write('\n#pragma GLOBAL_ASM("{}")\n'.format(name))
rodata_excluded = ["ovl_Bg_Dkjail_Ivy", "ovl_Bg_Ikana_Mirror", "ovl_Boss_02", "ovl_Boss_07", "ovl_Boss_Hakugin", "ovl_Elf_Msg", "ovl_Elf_Msg2", "ovl_Elf_Msg3", "ovl_Elf_Msg4", "ovl_Elf_Msg5", "ovl_En_Az", "ovl_En_Bigokuta", "ovl_En_Bigpamet", "ovl_En_Bigpo", "ovl_En_Bigslime", "ovl_En_Box", "ovl_En_Butte", "ovl_En_Col_Man", "ovl_En_Crow", "ovl_En_Death", "ovl_En_Elf", "ovl_En_Elforg", "ovl_En_Encount3", "ovl_En_Encount4", "ovl_En_Fish", "ovl_En_Fish2", "ovl_En_Fsn", "ovl_En_Honotrap", "ovl_En_Horse", "ovl_En_Horse_Game", "ovl_En_Invadepoh", "ovl_En_Ishi", "ovl_En_Kame", "ovl_En_Kanban", "ovl_En_Kusa2", "ovl_En_M_Thunder", "ovl_En_Maruta", "ovl_En_Mushi2", "ovl_En_Okuta", "ovl_En_Ossan", "ovl_En_Peehat", "ovl_En_Rg", "ovl_En_Ruppecrow", "ovl_En_Slime", "ovl_En_Sob1", "ovl_En_Syateki_Man", "ovl_En_Test7", "ovl_En_Trt", "ovl_En_Wiz_Fire", "ovl_Mir_Ray", "ovl_Obj_Bombiwa", "ovl_Obj_Driftice", "ovl_Obj_Hariko", "ovl_Obj_Iceblock", "ovl_Obj_Mure", "ovl_Obj_Snowball2", "ovl_Obj_Toudai", "ovl_select"]
rodata_included = ["z_en_item00"]
rodata_excluded = [
"ovl_Bg_Ikana_Mirror", "ovl_Boss_07", "ovl_Elf_Msg",
"ovl_En_Encount4", "ovl_En_Horse_Game", "ovl_En_Ossan",
"ovl_En_Slime", "ovl_En_Sob1", "ovl_En_Syateki_Man",
"ovl_En_Trt", "ovl_Mir_Ray", "ovl_Obj_Bombiwa",
"ovl_Obj_Hariko", "ovl_Obj_Mure", "ovl_Obj_Toudai",
"ovl_select",
]
rodata_included = [
"z_en_item00"
]
if __name__ == '__main__':
parser = argparse.ArgumentParser()