1
- /////
2
- vim:set ts=4 sw=4 tw=82 noet:
3
- /////
4
- patchrom (1)
5
- ==========
6
-
7
- Name
8
- ----
1
+ PATCHROM(1)
2
+
3
+ # NAME
4
+
9
5
patchrom - Patch jump table into a ROM dump
10
6
11
- Synopsis
12
- --------
13
- ' patchrom' _CONFIG_ _ROM_ _PAGE_
7
+ # SYNOPSIS
8
+
9
+ * patchrom* _CONFIG_ _ROM_ _PAGE_
14
10
15
- Description
16
- -----------
11
+ # DESCRIPTION
17
12
18
13
Patches a ROM file with a jump table and generates the necessary jump table
19
14
index definitions.
@@ -23,70 +18,72 @@ are used to generate a jump table. the generated jump table is written to the en
23
18
of _PAGE_ in the ROM file, and an include file for use in assemblers is written to
24
19
stdout.
25
20
26
- Symbol Format
27
- -------------
21
+ # SYMBOL FORMAT
28
22
29
23
The symbols must be in a rather basic format, namely the format supported by the
30
24
sass assembler. It looks like this:
31
25
32
- .equ sym1 0x8
33
- .equ sym2 0x10
34
- .equ sym3 0x77
35
- .equ sym4 0x7A
26
+ ```
27
+ .equ sym1 0x8
28
+ .equ sym2 0x10
29
+ .equ sym3 0x77
30
+ .equ sym4 0x7A
31
+ ```
36
32
37
33
Comments are supported by a single line starting with ; and extending to the end
38
34
of the line.
39
35
40
- ROM Patch Format
41
- ----------------
36
+ # ROM PATCH FORMAT
42
37
43
38
The ROM file is patched with a jump table at the end of the specified page. The
44
39
first entry in the config file is written to the end of the page. The table
45
40
consists of the z80 JP instruction repeated for each symbol. For the symbol file
46
41
above, that would look something like this:
47
42
48
- C3 7A 00
49
- C3 77 00
50
- C3 10 00
51
- C3 08 00 # This is the end of the Flash page
43
+ ```
44
+ C3 7A 00
45
+ C3 77 00
46
+ C3 10 00
47
+ C3 08 00 # This is the end of the Flash page
48
+ ```
52
49
53
- Generated Include Format
54
- ------------------------
50
+ # GENERATED INCLUDE FORMAT
55
51
56
52
An include file will be written to stdout. Each exported symbol will have one
57
53
entry in the include file, taking the form of:
58
54
59
- .equ symbol_name 0xIIPP
55
+ ```
56
+ .equ symbol_name 0xIIPP
57
+ ```
60
58
61
- Where _II_ is the __I__ndex of the function (where 0 is the end of the page), and
62
- _PP_ is the Flash __P__age it appears on.
59
+ Where _II_ is the _Index_ of the function (where 0 is the end of the page), and
60
+ _PP_ is the Flash _Page_ it appears on.
63
61
64
- Config File Format
65
- ------------------
62
+ # CONFIG FILE FORMAT
66
63
67
64
The config file provided must simply be a list of symbols to export. It supports
68
65
arbituary whitespace at the start of each line and you may include comments
69
66
starting with # and extending to the end of the line. An example may look like
70
67
this:
71
68
72
- # This is a comment
73
- sym1
74
- sym2
75
- sym3
76
- sym4
69
+ ```
70
+ # This is a comment
71
+ sym1
72
+ sym2
73
+ sym3
74
+ sym4
75
+ ```
77
76
78
77
Empty lines are ignored.
79
78
80
- Examples
81
- --------
79
+ # EXAMPLES
82
80
83
- patchrom 00.config example.rom 0x00 < 00.sym > 00.inc::
81
+ * patchrom 00.config example.rom 0x00 < 00.sym > 00.inc*
84
82
Patches example.rom with a jump table containing symbols listed in 00.config
85
83
and output the jump table index definitions to 00.inc
86
84
87
- Authors
88
- -------
85
+ # AUTHORS
89
86
90
87
Maintained by Drew DeVault <sir@cmpwn.com>, who is assisted by other open
91
88
source contributors. For more information about patchrom development, see
92
- < https://github.com/KnightOS/patchrom> .
89
+ https://github.com/KnightOS/patchrom.
0 commit comments