Skip to content

Commit

Permalink
align file address in dma table
Browse files Browse the repository at this point in the history
  • Loading branch information
mracsys committed Nov 17, 2024
1 parent 240ead1 commit 50309d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion FileDataRelocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,11 @@ def encode(self) -> bytearray:

def write(self, rom: Rom, start_address_adjustment: Optional[int] = 0) -> None:
raw_file = self.encode()
new_start = self.start + start_address_adjustment
new_start = align16(self.start + start_address_adjustment)
file_length = len(raw_file)
while file_length < align16(file_length):
raw_file.extend(int.to_bytes(0, 1, 'big'))
file_length += 1
rom.write_bytes(new_start, raw_file)
rom.update_dmadata_record_by_key(self.start, new_start, new_start + len(raw_file))

Expand Down

0 comments on commit 50309d9

Please sign in to comment.