PATCHROM(1)
π PATCHROM(1) β patchrom: patch jump table into a ROM dump π
πΈ NAME πΈ
patchrom β Patch jump table into a ROM dump
β¨ SYNOPSIS β¨
patchrom CONFIG ROM PAGE
π¦ DESCRIPTION π¦
okay so bestie, patchrom is literally the tool that patches a ROM file with a jump table and generates the necessary jump table index definitions. slay.
The symbols for ROM are read from stdin, and those listed in the CONFIG file are used to generate a jump table. the generated jump table is written to the end of PAGE in the ROM file, and an include file for use in assemblers is written to stdout. periodt.
lowkey important vibe check:stdinsupplies the symbols,stdoutreceives the include file, and the ROM file gets patched at the end ofPAGE.
π SYMBOL FORMAT π
The symbols must be in a rather basic format, namely the format supported by the sass assembler. It looks like this:
.equ sym1 0x8
.equ sym2 0x10
.equ sym3 0x77
.equ sym4 0x7A
Comments are supported by a single line starting with ; and extending to the end of the line. cute.
π₯ ROM PATCH FORMAT π₯
The ROM file is patched with a jump table at the end of the specified page. The first entry in the config file is written to the end of the page. The table consists of the z80 JP instruction repeated for each symbol. For the symbol file above, that would look something like this:
C3 7A 00
C3 77 00
C3 10 00
C3 08 00 # This is the end of the Flash page
π GENERATED INCLUDE FORMAT π
An include file will be written to stdout. Each exported symbol will have one entry in the include file, taking the form of:
.equ symbol_name 0xIIPP
Where II is the Index of the function (where 0 is the end of the page), and PP is the Flash Page it appears on. iykyk.
π CONFIG FILE FORMAT π
The config file provided must simply be a list of symbols to export. It supports arbitrary whitespace at the start of each line and you may include comments starting with # and extending to the end of the line. An example may look like this:
# This is a comment
sym1
sym2
sym3
sym4
Empty lines are ignored. no cap.
π EXAMPLES π
patchrom 00.config example.rom 0x00 < 00.sym > 00.inc
Patches example.rom with a jump table containing symbols listed in 00.config and output the jump table index definitions to 00.inc. iconic.
π AUTHORS π
Maintained by Drew DeVault <sir@cmpwn.com>, who is assisted by other open source contributors. For more information about patchrom development, see https://github.com/KnightOS/patchrom. π«Ά
That's the whole page, bestie β PATCHROM(1) Β· 01/01/1980 Β· signing off π
π¦ where this page comes from
- nixos 26.05: patchrom 1.1.3
- nixpkgs unstable: patchrom 1.1.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms