PATCHROM(1)

πŸ“¦ version 1.1.3, in nixos 26.05, nixpkgs unstable

πŸ’– 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: stdin supplies the symbols, stdout receives the include file, and the ROM file gets patched at the end of PAGE.

πŸŽ€ 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