Skip to content

Commit b864843

Browse files
Migrate from asciidoc to scdoc (#7)
1 parent 641d994 commit b864843

File tree

5 files changed

+44
-51
lines changed

5 files changed

+44
-51
lines changed

.build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image: archlinux
22
packages:
3-
- asciidoc
3+
- scdoc
44
sources:
55
- https://github.com/KnightOS/patchrom
66
environment:

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
CMakeCache.txt
2-
CMakeFiles
3-
cmake_install.cmake
4-
install_manifest.txt
51
*.swp
62
*.o
73
bin/

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ bin/patchrom:main.o
66
mkdir -p bin/
77
$(CC) $(CFLAGS) $^ -o $@
88

9-
bin/patchrom.1:patchrom.1.txt
10-
a2x --no-xmllint --doctype manpage --format manpage patchrom.1.txt -v -D bin/
9+
bin/patchrom.1:patchrom.1.scdoc
10+
scdoc < patchrom.1.scdoc > bin/patchrom.1
1111

1212
DESTDIR=/usr/local
1313
BINDIR=$(DESTDIR)/bin/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ index definitions.
77

88
## Installation
99

10-
For Linux/Mac/etc, install make, asciidoc, and a C compiler,
10+
For Linux/Mac/etc, install make, scdoc, and a C compiler,
1111
then:
1212

1313
$ make
Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
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+
95
patchrom - Patch jump table into a ROM dump
106

11-
Synopsis
12-
--------
13-
'patchrom' _CONFIG_ _ROM_ _PAGE_
7+
# SYNOPSIS
8+
9+
*patchrom* _CONFIG_ _ROM_ _PAGE_
1410

15-
Description
16-
-----------
11+
# DESCRIPTION
1712

1813
Patches a ROM file with a jump table and generates the necessary jump table
1914
index definitions.
@@ -23,70 +18,72 @@ are used to generate a jump table. the generated jump table is written to the en
2318
of _PAGE_ in the ROM file, and an include file for use in assemblers is written to
2419
stdout.
2520

26-
Symbol Format
27-
-------------
21+
# SYMBOL FORMAT
2822

2923
The symbols must be in a rather basic format, namely the format supported by the
3024
sass assembler. It looks like this:
3125

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+
```
3632

3733
Comments are supported by a single line starting with ; and extending to the end
3834
of the line.
3935

40-
ROM Patch Format
41-
----------------
36+
# ROM PATCH FORMAT
4237

4338
The ROM file is patched with a jump table at the end of the specified page. The
4439
first entry in the config file is written to the end of the page. The table
4540
consists of the z80 JP instruction repeated for each symbol. For the symbol file
4641
above, that would look something like this:
4742

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+
```
5249

53-
Generated Include Format
54-
------------------------
50+
# GENERATED INCLUDE FORMAT
5551

5652
An include file will be written to stdout. Each exported symbol will have one
5753
entry in the include file, taking the form of:
5854

59-
.equ symbol_name 0xIIPP
55+
```
56+
.equ symbol_name 0xIIPP
57+
```
6058

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.
6361

64-
Config File Format
65-
------------------
62+
# CONFIG FILE FORMAT
6663

6764
The config file provided must simply be a list of symbols to export. It supports
6865
arbituary whitespace at the start of each line and you may include comments
6966
starting with # and extending to the end of the line. An example may look like
7067
this:
7168

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+
```
7776

7877
Empty lines are ignored.
7978

80-
Examples
81-
--------
79+
# EXAMPLES
8280

83-
patchrom 00.config example.rom 0x00 < 00.sym > 00.inc::
81+
*patchrom 00.config example.rom 0x00 < 00.sym > 00.inc*
8482
Patches example.rom with a jump table containing symbols listed in 00.config
8583
and output the jump table index definitions to 00.inc
8684

87-
Authors
88-
-------
85+
# AUTHORS
8986

9087
Maintained by Drew DeVault <sir@cmpwn.com>, who is assisted by other open
9188
source contributors. For more information about patchrom development, see
92-
<https://github.com/KnightOS/patchrom>.
89+
https://github.com/KnightOS/patchrom.

0 commit comments

Comments
 (0)