Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKotlyar authored Oct 22, 2022
1 parent 4f56232 commit c2cf9cf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
36 changes: 36 additions & 0 deletions AddJsonMaps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#@author Elias Kotlyar
#@category Tuning
#@keybinding
#@menupath
#@toolbar

import os
import json
pathname = os.path.dirname(__file__)
f = open(pathname+"/golf5.json", "r")
content = f.read()
print(content)
content = content.encode('utf-8')
contentJson = json.loads(content)
for map in contentJson["maps"]:
startAddr = map["Fieldvalues.StartAddr"]
startAddr = startAddr.replace("$","")
startAddr = int(startAddr, 16)
startAddr = startAddr + 0x400000
rows = int(map["Rows"])
columns = int(map["Columns"])
size = rows * columns
if map["DataOrg"] == "eHiLo":
size = size * 2
size = size - 2
pass
else:
size = size - 1;
name = map["IdName"]
endAddr = startAddr + size
print(hex(startAddr),hex(endAddr),size,name)
setPreComment(toAddr(startAddr),name + " START")
setPostComment(toAddr(endAddr),name + " END")
for i in range(startAddr,endAddr):
createByte(toAddr(i))
pass
16 changes: 16 additions & 0 deletions clearall.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#@author Elias Kotlyar
#@category Tuning
#@keybinding
#@menupath
#@toolbar

startAddr = 0x400000
endAddr = 0x600000
clearListing(toAddr(startAddr),toAddr(endAddr))
for i in range(startAddr,endAddr):
address = toAddr(i)
if(getPreComment(address)):
setPreComment(address,"")
if(getPostComment(address)):
setPostComment(toAddr(i),"")

2 changes: 1 addition & 1 deletion med9-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ramblock = memory.getBlock(toAddr(0x600000))
if(not ramblock):
ramblock = memory.createUninitializedBlock("ram1", toAddr(0x600000), 0x200000, False)
ramblock.

# Set Registers:
context = currentProgram.getProgramContext()
r13 = context.getRegister("r13")
Expand Down

0 comments on commit c2cf9cf

Please sign in to comment.