1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

code_80106550 / llcvt.c and code_80104450 / ortho.c OK (#163)

* llcvt.c OK, added script from mm decomp to set mips3

* ortho.c OK

* added entries to functions.h

* named guNormalize.s
This commit is contained in:
Lucas Shaw 2020-05-27 00:48:07 -07:00 committed by GitHub
parent c68d752813
commit 02fc5287cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 118 additions and 326 deletions

26
tools/set_o32abi_bit.py Normal file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env python3
import argparse, struct, sys
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('file', help='input file')
args = parser.parse_args()
with open(args.file, 'r+b') as f:
magic = struct.unpack('>I', f.read(4))[0]
if magic != 0x7F454C46:
print('Error: Not an ELF file')
sys.exit(1)
f.seek(36)
flags = struct.unpack('>I', f.read(4))[0]
if flags & 0xF0000000 != 0x20000000: # test for mips3
print('Error: Architecture not mips3')
sys.exit(1)
flags |= 0x00001000 # set EF_MIPS_ABI_O32
f.seek(36)
f.write(struct.pack('>I', flags))