Closed oziphantom closed 4 years ago
For reference here a python script I wrote to "patch it"
with open(r"fileFromYourTool.map", "rb") as inputMap:
bytes = list(inputMap.read())
words = [bytes[i] + (bytes[i + 1]*256) for i in range(0, len(bytes), 2)] #convert hilo bytes to words
scalledbytes = []
for char in words:
tile = char & 0x3FFF # get tile number
flags = char & 0xFC00 # preserve flags
column = tile % 8 #get the X
row = int(tile / 8) # get the Y, this needs to be an int other wise you get 0.5 which gets you odd numbers
newValue = int((column*2)+(row*32)) | flags # scale x by 2 and Y by $20 and or in flags
scalledbytes.append(newValue & 255) # convert word back to lo hi format
scalledbytes.append(int(newValue / 256))
with open(r"FileToUse.map", "wb") as outputMap:
arr = bytearray(scalledbytes)
outputMap.write(arr)
Oh, I was sure I had some old test case for this (before I threw them out to do automated testing, which never got done 😄). Apparently not correctly, or a regression, I suppose.
I’ll fix ASAP.
@oziphantom ASAP is relative, but issue should be fixed now.
So the SNES still does 8x8 maths on tile locations when in 16x16 mode. so if you have 16x16 tiles mapped like so in VRAM
then in the map you need to do
as a tile of 1 will get you a tile that looks like
a tile of $10 will get you