2020-08-12 22:01:57 -04:00
|
|
|
# TODO: make it either gen small files, or cheat with .data lol
|
|
|
|
import sys, os,binascii, struct
|
|
|
|
addrEnd = int(sys.argv[3], 16)
|
|
|
|
addrStart = int(sys.argv[2], 16)
|
|
|
|
|
2021-01-06 15:02:31 -05:00
|
|
|
specificOvl = "_ovl3"
|
2020-08-12 22:01:57 -04:00
|
|
|
|
|
|
|
|
|
|
|
bssLimit = 0
|
|
|
|
numFiles = 0
|
|
|
|
f = open(sys.argv[1]+"_bss.s", "w+")
|
|
|
|
f.write(".include \"macros.inc\"\n")
|
2020-08-13 09:28:07 -04:00
|
|
|
f.write(".section .bss\n")
|
2020-08-12 22:01:57 -04:00
|
|
|
# f.write("#include \"prevent_bss_reordering.h\"\n")
|
|
|
|
while addrStart < addrEnd:
|
|
|
|
f.write("glabel D_"+ str(hex(addrStart))[2:].upper()+ specificOvl+"\n.word 0x00000000\n\n")
|
|
|
|
addrStart+=4
|
|
|
|
bssLimit+=1
|
|
|
|
# if bssLimit > 125:
|
|
|
|
# numFiles+=1
|
|
|
|
# bssLimit = 0
|
|
|
|
# f.close()
|
|
|
|
# f = open(sys.argv[1]+"_bss"+str(numFiles)+".c", "w+")
|