small changes

This commit is contained in:
Nicolas Kruse 2025-10-09 22:46:06 +02:00
parent 6af960bd46
commit 60aa550ec7
2 changed files with 5 additions and 2 deletions

View File

@ -356,6 +356,9 @@ def compile_to_instruction_list(node_list: Iterable[Node], sdb: stencil_database
object_list, data_section_lengths = variable_mem_layout(variable_list)
# Deallocate old allocated memory (if existing)
dw.write_com(binw.Command.FREE_MEMORY)
# Write data
dw.write_com(binw.Command.ALLOCATE_DATA)
dw.write_int(data_section_lengths)

View File

@ -100,8 +100,8 @@ int parse_commands(uint8_t *bytes) {
offs = *(uint32_t*)bytes; bytes += 4;
reloc_type = *(uint32_t*)bytes; bytes += 4;
value = *(int32_t*)bytes; bytes += 4;
printf("PATCH_OBJECT patch_offs=%i reloc_type=%i value=%i data_offs=%i\n",
offs, reloc_type, value, data_offs);
printf("PATCH_OBJECT patch_offs=%i reloc_type=%i value=%i\n",
offs, reloc_type, value);
patch(executable_memory + offs, reloc_type, value + data_offs);
break;