Skip to content

Commit

Permalink
Merge pull request #240 from stochaztic/fix-skip-naming
Browse files Browse the repository at this point in the history
Fix skip naming hex bug, #239
  • Loading branch information
stochaztic authored Mar 8, 2021
2 parents b0bbb6d + ca748eb commit d8b2922
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions coilsnake/modules/eb/SkipNamingModule.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from coilsnake.modules.eb.EbModule import EbModule
from coilsnake.util.common.yml import yml_load, yml_dump
from coilsnake.util.eb.pointer import to_snes_address
from coilsnake.util.eb.text import standard_text_to_byte_list


class SkipNamingModule(EbModule):
Expand All @@ -25,12 +26,9 @@ def read_from_project(self, resource_open):

def write_loader_asm(self, rom, offset, s, strlen, mem_offset, byte2):
i = 0
for ch in s[0:strlen]:
rom[offset:offset+5] = [0xa9, ord(ch) + 0x30, 0x8d, mem_offset + i, byte2]
i += 1
offset += 5
for j in range(i, strlen):
rom[offset:offset+5] = [0xa9, 0, 0x8d, mem_offset + i, byte2]
byte_list = standard_text_to_byte_list(s, strlen, False)
for byte in byte_list:
rom[offset:offset+5] = [0xa9, byte, 0x8d, mem_offset + i, byte2]
i += 1
offset += 5
return offset
Expand Down

0 comments on commit d8b2922

Please sign in to comment.