Fix zone_names block size

This commit is contained in:
Luke Hubmayer-Werner 2023-08-25 18:29:15 +09:30
parent ed5c0f20b9
commit a6181cb776
2 changed files with 7 additions and 2 deletions

View File

@ -10,4 +10,4 @@ job_and_ability_descs 133 0x117140 2 0x110000 0x110000 True
magics 87 0x111C80 6
magics2 73 0x111E8A 9
menu_strings 139 0x00F987 2 0x270000 0x000000 True
zone_names 0x100 0x107000 2 0x270000 0x107200 True
zone_names 164 0x107000 2 0x270000 0x107200 True
1 name num_entries address snes_address bytes snes_bytes rpge_ptr_offset snes_ptr_offset dialog null_terminated
10 magics 87 0x111C80 6
11 magics2 73 0x111E8A 9
12 menu_strings 139 0x00F987 2 0x270000 0x000000 True
13 zone_names 0x100 164 0x107000 2 0x270000 0x107200 True

View File

@ -71,7 +71,12 @@ func load_snes_rom(buffer: StreamPeerBuffer, is_RPGe: bool = false) -> void:
else:
for i in num_entries-1:
buffer.seek(ptrs[i])
raw_strings.append(buffer.get_data(ptrs[i+1] - ptrs[i])[0])
var size: int = ptrs[i+1] - ptrs[i]
if size > 0:
raw_strings.append(buffer.get_data(size)[0])
else:
print_debug('String pointer mismatch: "%s" index %d: 0x%06X:0x%06X, effective size of %d bytes' % [block_name, i, ptrs[i], ptrs[i+1], size])
raw_strings.append(PoolByteArray())
else:
# Get first level of data
for i in num_entries: