Mercurial > hg > dmlib
annotate README.txt @ 882:6c024a8f252e
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 04 Feb 2015 22:29:37 +0200 |
parents | 4cecc74e1b85 |
children | 6a2a286f3d70 |
rev | line source |
---|---|
425 | 1 ----------------------------------------------------------------------- |
2 | |
3 T N S P | |
4 - --==============-- - | |
5 | |
6 ###### ### ## ### ### ###### | |
7 # ### ## #### ### ### ### ### ## # | |
8 # # ### ## ######## ### ### ###### # # | |
9 # ### ## ### # ## ### ### ### ## # | |
10 ###### ### ## ###### ### ###### | |
11 | |
12 Demo engine / development and utility framework | |
13 | |
14 ----------------------------------------------------------------------- | |
862 | 15 |
470 | 16 Programmed and designed by Matti Hämäläinen (ccr/TNSP) |
869 | 17 (C) Copyright 2002-2015 Tecnic Software productions (TNSP) |
425 | 18 |
19 Contact | |
20 ======= | |
21 IRC : ccr @ IRCNet, sometimes also Freenode | |
22 e-mail : ccr@tnsp.org | |
23 | |
862 | 24 |
425 | 25 ----------------------------------------------------------------------- |
26 | |
862 | 27 |
425 | 28 Redistribution and use in source and binary forms, with or without |
29 modification, are permitted provided that the following conditions | |
30 are met: | |
31 | |
32 1. Redistributions of source code must retain the above copyright | |
33 notice, this list of conditions and the following disclaimer. | |
34 | |
35 2. Redistributions in binary form must reproduce the above copyright | |
36 notice, this list of conditions and the following disclaimer in | |
37 the documentation and/or other materials provided with the | |
38 distribution. | |
39 | |
40 3. The name of the author may not be used to endorse or promote | |
41 products derived from this software without specific prior written | |
42 permission. | |
43 | |
44 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR | |
45 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
46 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
47 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | |
48 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
49 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
50 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
51 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
52 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
53 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
54 POSSIBILITY OF SUCH DAMAGE. | |
55 | |
862 | 56 |
425 | 57 ----------------------------------------------------------------------- |
58 | |
862 | 59 |
425 | 60 So, what is this? |
61 ================= | |
62 Basically .. a bunch of more and/or less random stuff. dmlib in | |
63 itself is a library with various things useful in demo programming. | |
64 There is a resource management subsystem, functions for loading | |
65 PNG and JPEG images. Software blitted and scaled sprites, etc. | |
66 Bitmap font routines. A XM module replayer. | |
67 | |
68 And a work-in-progress timeline-supporting demo framework, with | |
69 a Qt based GUI editor. | |
70 | |
71 And graphics converter and displayer for various restricted formats, | |
72 such as C64/VIC-20 characters, bitmaps, sprites, etc. | |
73 | |
74 .. So, yeah. There are many things in here. It's a junkyard of various | |
882 | 75 demo- or such development related pieces of code and utilities. Many |
76 parts can be disabled during compile-time from config.mak | |
425 | 77 |
78 Most modules can be enabled or disabled, per project basis via | |
79 compile-time configuration in config.mak. | |
80 | |
862 | 81 |
425 | 82 ----------------------------------------------------------------------- |
83 | |
862 | 84 |
425 | 85 Requirements |
86 ============ | |
87 The compilation and usage of these utilities requires following | |
88 software packages or functional equivalents installed: | |
89 | |
90 - GCC 4.x or later (4.6.3 and 4.7.1 used in development.) | |
91 - GNU binutils | |
92 - GNU Make | |
93 - pkg-config | |
94 | |
862 | 95 You will also want these libraries: |
425 | 96 |
862 | 97 - libSDL 1.2, preferably the latest stable version. |
882 | 98 - zlib |
425 | 99 - libPNG 1.2 and development headers (more optional, |
100 only required for PNG write and read support by some | |
101 utilities.) | |
102 - SDL_ttf 2.0 and libfreetype2 | |
103 - Tremor (integer-based Ogg Vorbis decoder) + libogg | |
104 | |
862 | 105 And the demo editor framework requires (but it is not yet |
106 usable anyway, so you may as well skip these): | |
425 | 107 |
108 - Qt 4.x framework libraries (tested with 4.7 and 4.8.2) | |
109 - qmake, moc | |
110 | |
111 | |
112 For Linux -> Win32/64 cross-compilation I have used the standard | |
113 MinGW packages from Debian Testing (wheezy): | |
114 | |
115 gcc-mingw-w64 mingw-w64-i686-dev mingw-w64-x86-64-dev | |
116 | |
117 with the additions of self- cross-compiled libSDL, zlib, Tremor, | |
118 liboff and libPNG. Some of those require a bit of poking to get | |
119 working properly, YMMV. | |
120 | |
121 Please don't ask me for help to get cross-compilation working. | |
122 | |
862 | 123 |
425 | 124 ----------------------------------------------------------------------- |
125 | |
862 | 126 |
425 | 127 How to build |
128 ============ | |
129 1) $ cp config.mak.in config.mak | |
130 | |
131 2) Edit config.mak to enable/disable desired options. | |
132 Make sure you have the required depencies. | |
133 | |
134 3) $ gmake | |
135 or, if cross-compiling to Win32 via MinGW | |
136 $ gmake -f Makefile.w32 | |
137 | |
138 4) If it works -> Happy fun times \:D\ | |
139 | |
862 | 140 |
425 | 141 ----------------------------------------------------------------------- |
142 | |
882 | 143 |
425 | 144 Included utilities |
145 ================== | |
146 | |
147 xm2jss | |
148 ------ | |
149 Convert XM modules to internal JMOD format. You can optionally | |
150 even strip out various parts, such as complete instruments | |
151 (leaving only pattern data), sample data, sample instruments, | |
152 etc. | |
153 | |
154 | |
155 viewmod | |
156 ------- | |
157 Simple XM/JMOD viewer. Dumps selected parts into stdout | |
158 as text format data. | |
159 | |
160 | |
161 ppl | |
162 --- | |
163 A simple XM/JMOD player with SDL-based UI. | |
164 | |
165 testpl | |
166 ------ | |
167 Even simpler player, with no UI at all. Uses SDL for audio. | |
168 | |
169 mod2wav | |
170 ------- | |
171 Render XM/JMOD modules into WAV files. | |
172 | |
173 | |
174 packed | |
175 ------ | |
176 Manipulate DMPACK files. Basically a bit like ZIP archive, | |
177 for glueing resource files into a zlib-compressed blob. | |
178 The dmlib resource subsystem can utilize these files. | |
179 | |
180 fontconv | |
181 -------- | |
182 Convert bitmap fonts. | |
183 | |
184 | |
185 objlink | |
186 ------- | |
187 Simple, but versatile commandline utility for combining binary | |
188 files into one file. Understands 2-byte loading address PRG | |
189 style files, and raw data. "Loading addresses" can be specified | |
190 and overridden. The utility also checks for overlaps, etc. | |
191 | |
192 data2inc | |
193 -------- | |
194 Simple data file to C/ASM source converter. | |
195 | |
196 gfxconv | |
197 ------- | |
450
acea24b77bdc
Update documentation a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
425
diff
changeset
|
198 Utility for "dumping" and converting various graphics in plain |
acea24b77bdc
Update documentation a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
425
diff
changeset
|
199 ASCII, or ANSI colored output, or into various image formats |
458
096dae79ce2e
Add ILBM to supported list.
Matti Hamalainen <ccr@tnsp.org>
parents:
450
diff
changeset
|
200 (including PNG, PCX, PPM, IFF ILBM and ARAW files). |
425 | 201 |
202 Input can be interpreted as bitmap, sprite or character data, | |
203 in multicolor or single color. Colors can be mapped as desired. | |
204 Image file output can be either single image (with chars/sprites | |
205 placed vertically if input is char/sprite data), or in separate | |
206 files. | |
207 | |
208 (Note: PNG support is a compile-time option) | |
209 | |
210 view64 | |
211 ------ | |
212 Compiled only if libSDL support is enabled. Can be used to | |
213 display C64 bitmaps. | |
214 | |
862 | 215 |
425 | 216 ----------------------------------------------------------------------- |
217 | |
862 | 218 |
425 | 219 Examples |
220 ======== | |
221 | |
222 data2inc | |
223 -------- | |
224 To convert a data file to a C structure using 'uint8_t' as type: | |
225 | |
226 $ data2inc -C -n variable_name -t uint8_t input.bin output.h | |
227 | |
228 | |
229 objlink | |
230 ------- | |
231 $ objlink -o intro.tmp -pppp intro.o gfx/dkdlogo2.drp:0x3800 \ | |
232 muzak.prg gfx/chars_4.fnt:0x6800 | |
233 | |
234 - "-o intro.tmp" sets output file | |
235 - As you can see, short options can be combined, like "-pppp". | |
236 However, the next parameters must be the corresponding option | |
237 arguments, in correct order, if any. | |
238 - It is possible to specify a overriding loading address via | |
239 ":<addr>" syntax. See the help for more information. | |
240 | |
241 | |
242 gfxconv | |
243 ------- | |
491 | 244 |
245 Image input to C64 char font conversion: | |
246 | |
247 $ gfxconv font16x16.pcx -f chr -o font16x16.chr | |
248 | |
249 - Input file "font16x16.pcx" is a paletted PCX image (preferably 2-colors), | |
250 containing a 16x16 pixel font. | |
251 - "-f chr" specifies conversion to c64 char memory format, gfxconv | |
252 splits the input image to 8x8 blocks, outputting them in sequence. | |
253 | |
254 | |
255 Convert input image to IFFMaster ARAW + assembler include file, | |
256 while remapping some palette entries: | |
257 | |
258 $ gfxconv -R "#000000:0" -f araw -i image -B 3 input.png -o output.raw | |
259 | |
260 - "-R #000000:0" remaps all input image palette colors matching RGB | |
261 hex triplet #000000 to palette index 0. | |
262 - "-f araw" specifies output format to be IFFMaster ARAW. | |
263 - "-B 3" _clamps_ output to be 3 bitplanes. Any bits above those are | |
264 simply discarded. | |
265 | |
266 | |
267 C64 char font to PNG imge conversion: | |
268 | |
425 | 269 $ gfxconv chars1.fnt -i char -s 2 -S 10 -c 255:1 -f png -o chars1.png |
270 | |
271 - Input file "chars1.fnt" is interpreted as character data (-i char) | |
272 - "-s 2" skips first two bytes of the input file (loading address) | |
273 - "-S 10" scales output image to be 10 times larger | |
274 - "-c 255:1" defines background color (bit value 0) to be transparent | |
275 (255, only works for PNG) and foreground to be C64 color 1 (white) | |
276 - "-f png" sets output format to PNG | |
277 | |
278 | |
491 | 279 Extract sprites from a C64 memory dump, convert to PNG: |
280 | |
425 | 281 $ gfxconv bub_dump.raw -i s -s 0x5800 -n 20 -f png -o bub \ |
282 -q -S 3 -m -c 255:2:5:1 | |
283 | |
284 - Input file "bub_dump.raw" is a raw memory dump of Bubble Bobble | |
285 extracted via VICE in game running mode. | |
286 - "-i s" sets input to be interpreted as sprite data | |
287 - "-s 0x5800" skips 0x5800 bytes, basically the memory address as the | |
288 input is a straight memory dump file. | |
289 - "-n 20" sets max item count to 20, so 20 sprites will be dumped. | |
290 - "-o bub" sets filename prefix to "bub" | |
291 - "-q" selects sequential output (separate files) | |
292 - "-m" selects multicolor input | |
293 - "-c 255:2:5:1" sets the multicolor color mappings | |
294 (255 is the transparency color again) | |
295 | |
491 | 296 |
425 | 297 $ gfxconv chars3.fnt -i c -s 2 -n 3 |
298 | |
299 Dump as character data into stdout, skipping 2 bytes at start, and | |
300 limit output to 3 items (characters). | |
301 | |
302 ---- : -------------- #0 | |
303 0002 : ........ | |
304 0003 : ..####.. | |
305 0004 : .#....#. | |
306 0005 : #..##..# | |
307 0006 : #.#....# | |
308 0007 : #..##..# | |
309 0008 : .#....#. | |
310 0009 : ..####.. | |
311 ---- : -------------- #1 | |
312 000a : ........ | |
313 000b : ...##... | |
314 000c : ..#..#.. | |
315 000d : ..####.. | |
316 000e : .##..#.. | |
317 000f : .##..#.. | |
318 0010 : .##..#.. | |
319 0011 : ........ | |
320 ---- : -------------- #2 | |
321 0012 : ........ | |
322 0013 : ..###... | |
323 0014 : ..#..#.. | |
324 0015 : ..###... | |
325 0016 : .##..#.. | |
326 0017 : .##..#.. | |
327 0018 : .####... | |
328 0019 : ........ | |
329 | |
862 | 330 |
425 | 331 ----------------------------------------------------------------------- |