-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.nfo
314 lines (253 loc) · 14.9 KB
/
README.nfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
__/¯\____ ___/\__ _/\__ _/\_ _/\__ _/\___ ___/\__ __/\_ _/\__
\_ ____/_> ____ \_/ _ \_ \ < /_ \_/ _>> ____ \_ > \_/ _ \_
_> ___/ ¯>__> <<__// __ _/ |> ></ _/> </ ¯ \\__> <<__// /\ // __ _/
_> \7 <__/:. \__/:. \> \_/ L/ _____/. 7> .\_/:. \__/ <_/ </:. \> \_
|:::::::::::::::::::::::/:::::::::::::>::::::::/::::::::::::::::::::::::/:::::|
|¯¯\::::/\:/¯\::::/¯¯¯¯<::::/\::/¯¯\:/¯¯¯¯¯¯\::\::/¯¯\::::/¯¯\::::/¯¯¯¯<::::/¯|
|__ |¯¯| T _ |¯¯¯| ___ |¯¯| |¯| _ T ______ |¯¯¯¯| _ |¯¯¯| _ |¯¯¯| ___ |¯¯| _|
\|__|/\|/ \|___|/ \|__|/\|_|/ \|/ \| |/ \|___|/ \|___|/dNo\|__|/
¯¯¯¯¯
_______________________________________________________________________________
| | | | | |
___________|____________|____________|____________|____________|___________|__
| | | | | |
_____|____________|____________|____________|____________|____________|_______
| | | | | |
___________|____________|____________|____________|____________|___________|__
| | | | | |
_____|____________|____________|____________|____________|____________|_______
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
E T R I P A T O R
-¤ a PC Engine disassembler ¤-
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
U S A G E
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
etripator [options] <cfg> <in>
The options are :
--irq-detect or -i : automatically detect and extract irq vectors when
disassembling a ROM, or extract opening code and gfx
from CDROM IPL data.
--cd or -c : cdrom image disassembly. Irq detection and rom header jump are
not performed.
--help or -h : displays help.
--out or -o <file> : main asm file containing includes for all sections as
long the irq vector table if the irq-detect option is
enabled.
--labels or -l <file> : labels definition filename.
--labels-out <file> : extracted labels output filename. Otherwise the
labels will be written to <in>.YYMMDDhhmmss.lbl.\n"
--comments <file> : comments description filename.
--address : print statement logical address and page in an inline comment.
cfg : configuration file. It is optional if irq detection is enabled.
in : binary to be disassembled (ROM or CDROM track).
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
C O N F I G U R A T I O N
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
The configuration file is a standard JSON file.
The supported fields are :
* filename (mandatory): name of the output file. If multiple sections have
the same output filename, their output will be
appended to that file. On the other hand, note that
the output file will be overwritten at each session.
* type (mandatory): values are code or data.
** code indicates that the section will be disassembled and output as
asm code.
** data means that the section contains data, but it will be output as
code directives (.db or .dw) or binary according to the data
configuration.
* page (mandatory): memory page of the current section. It will be used to
compute the file offset of the section if the offset
field is missing.
* logical (mandatory): logical address. Just like page', it will be used to
compute file offset if there's no offset field.
* offset: input file offset. This field is *mandatory* for CD-ROM
disassembly.
* size: section size. For code section, a zero (or missing size) means that
the disassembly will stop when a RTS or RTI instruction is found.
This field is *mandatory* for data sections. and CD-ROM disassembly.
* id: section id. If this option is set, all the label will be postfixed
with this value. Otherwise the section index will be used.
* mpr: an array containing the page value for each memory page register.
* data : an object with 2 entries :
** type : binary, hex, string or jumptable.
** element_size (default value: 1 or 2 for jumptable): element size in
bytes. The only supported values are 1 or 2.
** elements_per_line (default value: 16): number of elements per line.
* description (optional): description as a string or an array of strings
for multiline description.
There must be only one occurence of each field per section.
Example:
{
"cdbios_functions": {
"filename": "syscard.asm",
"type": "code",
"page": "0",
"logical" : "e000",
"size": "505",
"mpr": ["ff", "f8", 0, 0, 0, 0, 0, 0 ],
"description": "CDROM Bios functions"
},
"ex_colorcmd.impl": {
"filename": "syscard.asm",
"type": "code",
"page": "0",
"logical" : "e509",
"size": "ce",
"mpr": ["ff", "f8", 0, 0, 0, 0, 0, 0 ]
},
"irq_vectors": {
"filename": "syscard.asm",
"type": "data",
"page": "0",
"logical": "fff6",
"size": "a",
"mpr": ["ff", "f8", 0, 0, 0, 0, 0, 0 ],
"data": { "type": "hex", "element_size": 2, "elements_per_line": 1 }
}
}
* Labels definition file format
The labels definition file is a standard JSON file containing an array of
labels.
Each entry is an object containing the following fields:
* name: label name.
* logical : logical address of the label in hexadecimal.
* page : physical page, i.e. the value of the mpr of the logical address.
* description (optional) : description (as a string or as an array of
strings).
Example:
[
{ "name":"cd_reset", "logical":"e22a", "page":"00", "description": [
"Reset CD drive",
"input: none",
"output: A - $00: OK",
" sub error code"
]},
{ "name":"irq_2", "logical":"eaa3", "page":"00"},
{ "name":"irq_1", "logical":"eba5", "page":"00"},
{ "name":"irq_timer", "logical":"ea9c", "page":"00"},
{ "name":"irq_nmi", "logical":"ea9b", "page":"00"},
{ "name":"irq_reset", "logical":"eab3", "page":"00"},
{ "name":"main", "logical":"f8a4", "page":"00"}
]
* Comments file format
The comments file is very similar to the labels definition file. It is a
standard JSONx file containing an array of comments. Each entry is an object
containing the following fields:
* logical: logical address of the statement to comment in hexadecimal.
* page: physical page, i.e. the value of the mpr of the logical address.
* text: comment text (as a string or as an array of strings).
Example:
[
{ "logical": "eab3", "page":"00", "text": " switch CPU to high speed mode"},
{ "logical": "eab4", "page":"00", "text": " disable interrupts"},
{ "logical": "eab5", "page":"00", "text": " clear decimal flag"},
{ "logical": "eab6", "page":"00", "text": " map I/O to the 1st memory page"},
{ "logical": "eaba", "page":"00", "text": " map RAM to the 2nd memory page"},
{ "logical": "eabe", "page":"00", "text": " clear zero page"},
{ "logical": "eac7", "page":"00", "text": " clear bss"},
{ "logical": "ead1", "page":"00", "text": [
" disable interrupts",
" this looks like the soft reset entry point"
]
},
{ "logical": "ead2", "page":"00", "text": " disable CPU timer"},
{ "logical": "ead5", "page":"00", "text": " switch CPU to high speed mode"},
{ "logical": "ead6", "page":"00", "text": " reset stack pointer"}
]
This comments configuration file comes from the Games Express CD Card bank #0
example and produces the following assembly code.
irq_reset: ; bank: $000 logical: $eab3
csh ; switch CPU to high speed mode
sei ; disable interrupts
cld ; clear decimal flag
lda #$ff ; map I/O to the 1st memory page
tam #$00
lda #$f8 ; map RAM to the 2nd memory page
tam #$01
stz <$00 ; clear zero page
tii $2000, $2001, $00ff
stz irq1_jmp ; clear bss
tii irq1_jmp, $2201, $1dff
lead1_00: ; bank: $000 logical: $ead1
sei ; disable interrupts
; this looks like the soft reset entry point
stz $0c01 ; disable CPU timer
csh ; switch CPU to high speed mode
ldx #$ff ; reset stack pointer
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
B U I L D
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
Etripator uses CMake as its build system.
Theorically you can build Etripator for any platform supported by CMake.
Here are the build step:
* Configuration
If you cloned the repository, you first need to fetch submodules with
git submodule update --init --recursive
You will also need to have jansson (https://github.com/akheron/jansson)
installed on your system.
This can be acheived using a package manager (apt, brew, chocolate, pacman, ...)
or by building it from source.
wget https://github.com/akheron/jansson/archive/v2.12.zip
unzip v2.12.zip
cd jansson-2.12
mkdir -p build/cmake
mkdir -p build/install
cd build/cmake
cmake ../.. -DJANSSON_BUILD_DOCS=OFF \
-DJANSSON_WITHOUT_TESTS=ON \
-DCMAKE_INSTALL_PREFIX=../install
cmake --build . --target install
cd ../../..
Now on to building etripator.
cd etripator
mkdir -p build/cmake
cd build/cmake
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install
If you build jansson as shown earlier you may configure the project with
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install \
-DJANSSON_INCLUDE_DIR=../../jansson-2.12/build/install/include \
-DJANSSON_LIBRARY=../../jansson-2.12/build/install/lib/jansson.lib
* Build
If everything went right, you can now compile the project with:
cmake --build . --config Release --target install
¬°¤*,¸¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸
¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯¬°¤*,¸_¸,*¤°¬°¤*,¸,*¤°¬¯
[*] Coded by: MooZ / Up Rough [*]
[*] Ascii by: Dino / Divine Stylers [*]
_______________________________________________________________________________
| | | | | |
___________|____________|____________|____________|____________|___________|__
| | | | | |
_____|____________|____________|____________|____________|____________|_______
| | | | | |
___________|____________|____________|____________|____________|___________|__
| | | | | |
_____|____________|____________|____________|____________|____________|_______
T H I S F I L E P A S S E D
... _ _ _ _ ...
:::: \\\ --- UP ROUGH WORLD HEADQUARDERS --- /// ::::
:::_ .___. \ / _:::
:://-- | |-----\ 24/7 ssh/telnet: ty.cg - Daydream! /--------// ::
|. .___. _:____ _ ___ _:
_ _| |_ \_ // // /____ __ _ cONSOLES/aSCII/aMIGA/gRAFFiti \:
\\\_ _/__/ /___ _ /__||/// =C64/mACINTOSH/gAMES/aPPS____ |
|_ \_\ \ /____/ _ _____ _ _____ ./ _/ .
. /_ \________\________\\ ._) _ \\______\__ \____| \_ _ _: _
: \______\\t^/lp! ____ | _/ / / \ _| _////__\\
/ /___ \ \ __ \\ _/__\| \ :/
> t H E y A R D BBS! < _ / / __//__\______\\_\ /_____/ \ \ :
: _ //_____\\: \ /___| \_________\ _.
-.----\\-----------------------| |----- .-----------||-------- ----/:
| tHE iDEA oF sTYLE iS tHE kEYl___|tO aLL fORMs oF rOCKiNG - TY 9621 |_
-@----------------------------._____.---------------------------------@