]> git.sur5r.net Git - cc65/blob - doc/sp65.sgml
Working on the sp65 documentation.
[cc65] / doc / sp65.sgml
1 <!doctype linuxdoc system>      <!-- -*- text-mode -*- -->
2
3 <article>
4 <title>sp65 Users Guide
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
6 <date>2012-03-11
7
8 <abstract>
9 sp65 is a sprite and bitmap utility that is part of the cc65 development suite.
10 It is used to convert graphics and bitmaps into the target formats of the
11 supported machines.
12 </abstract>
13
14 <!-- Table of contents -->
15 <toc>
16
17 <!-- Begin the document -->
18
19 <sect>Overview<p>
20
21 sp65 is a tool that converts images from common formats into formats used
22 on the 6502 platforms that are the targets of the cc65 compiler suite. In
23 addition, it allows some very simple operation with loaded graphics data, like
24 using part of an image for further processing.
25
26 The utility has been designed in a way that adding additional source or target
27 formats is easy. The final output is either binary, or C/assembler source.
28
29
30
31 <sect>Usage<p>
32
33
34 <sect1>Command line option overview<p>
35
36 The sp65 utility accepts the following options:
37
38 <tscreen><verb>
39 ---------------------------------------------------------------------------
40 Usage: sp65 [options] file [options] [file]
41 Short options:
42   -V                            Print the version number and exit
43   -c fmt[,attrlist]             Convert into target format
44   -h                            Help (this text)
45   -lc                           List all possible conversions
46   -r file[,attrlist]            Read an input file
47   -v                            Increase verbosity
48   -w file[,attrlist]            Write the output to a file
49
50 Long options:
51   --convert-to fmt[,attrlist]   Convert into target format
52   --help                        Help (this text)
53   --list-conversions            List all possible conversions
54   --pop                         Restore the original loaded image
55   --read file[,attrlist]        Read an input file
56   --slice x,y,w,h               Generate a slice from the loaded bitmap
57   --verbose                     Increase verbosity
58   --version                     Print the version number and exit
59   --write file[,attrlist]       Write the output to a file
60 ---------------------------------------------------------------------------
61 </verb></tscreen>
62
63
64 <sect1>Command line options in detail<p>
65
66 Below is a description of all the command line options. For the concept of
67 attribute lists see <ref id="attr-lists" name="below">.
68
69 <descrip>
70
71   <label id="option--convert-to">
72   <tag><tt>-c, --convert-to format[,attrlist]</tt></tag>
73
74   Convert a bitmap into one of the supported target formats. The option
75   argument must at least contain the "format" attribute. For more attributes,
76   see section <ref id="conversions" name="Conversions">.
77
78
79   <label id="option--help">
80   <tag><tt>-h, --help</tt></tag>
81
82   Print the short option summary shown above.
83
84
85   <label id="option--list-conversions">
86   <tag><tt>-lc, --list-conversions</tt></tag>
87
88   Print a list of possible conversions.
89
90
91   <label id="option--pop">
92   <tag><tt>--pop</tt></tag>
93
94   Restore the working copy of the bitmap from the one originally loaded from
95   the file. This may for example be used when creating several output files
96   from one input file.
97
98
99   <label id="option--read">
100   <tag><tt>-r, --read filename[,attrlist]</tt></tag>
101
102   Read an input file. The option argument must at least contain the "name"
103   attribute. See <ref id="input-formats" name="input formats"> for more
104   information.
105
106
107   <label id="option-v">
108   <tag><tt>-v, --verbose</tt></tag>
109
110   Increase verbosity. Usually only needed for debugging purposes. You may use
111   this option more than one time for even more verbose output.
112
113
114   <label id="option-V">
115   <tag><tt>-V, --version</tt></tag>
116
117   Print the version number of the assembler. If you send any suggestions or
118   bugfixes, please include the version number.
119
120
121   <label id="option--write">
122   <tag><tt>-w, --write filename[,attrlist]</tt></tag>
123
124   Write an output file. The option argument must at least contain the "name"
125   attribute. See <ref id="output-formats" name="output formats"> for more
126   information.
127
128 </descrip>
129 <p>
130
131
132
133 <sect>Attribute lists<label id="attr-lists"><p>
134
135
136
137 <sect>Input formats<label id="input-formats"><p>
138
139 <sect1>PCX<p>
140
141
142
143 <sect>Conversions<label id="conversions"><p>
144
145
146 <sect1>VIC2 sprites<p>
147
148
149 <sect1>Koala images<p>
150
151
152
153
154 <sect>Output formats<label id="output-formats"><p>
155
156 Using <tt/<ref id="option--write" name="--write">/ it is possible to write
157 processed data to an output file. An attribute "name" is mandatory, it is used
158 as the file name for the output. The output format can be specified using an
159 attribute named "format". If this attribute doesn't exist, the output format
160 is determined by looking at the file name extension.
161
162
163 <sect1>Binary<p>
164
165 For this format, the processed data is written to the output file in raw
166 binary format. There are not attributes for this output format.
167
168
169 <sect1>Assembler code<p>
170
171 For this format, the processed data is written to the output file in ca65
172 assembler format. There are several attributes for this output format:
173
174 <descrip>
175
176   <tag/base/
177   The value for this attribute specifies the numeric base for the data
178   values. It may be either 2, 10 or 16. The default is 16. If the base is
179   2, the numbers are prefixed by '%', if the base is 16, the numbers are
180   prefixed by '&dollar;'. For base 10, there is no prefix.
181
182   <tag/bytesperline/
183   The value for this attribute specifies the number of bytes output in
184   one line of the assembler file. The default is 16.
185
186   <tag/label/
187   If specified, an assembler label is added in front of the data.
188
189   <tag/segment/
190   If specified, a <tt/.SEGMENT/ directive is used to place the data into
191   the given segment.
192
193 </descrip>
194
195
196
197
198 <sect1>C code<p>
199
200
201
202 <sect>Bugs/Feedback<p>
203
204 If you have problems using the assembler, if you find any bugs, or if
205 you're doing something interesting with the assembler, I would be glad to
206 hear from you. Feel free to contact me by email
207 (<htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">).
208
209
210
211 <sect>Copyright<p>
212
213 sp65 (and all cc65 binutils) are (C) Copyright 1998-2012 Ullrich von Bassewitz
214 and others. For usage of the binaries and/or sources the following conditions
215 do apply:
216
217 This software is provided 'as-is', without any expressed or implied
218 warranty.  In no event will the authors be held liable for any damages
219 arising from the use of this software.
220
221 Permission is granted to anyone to use this software for any purpose,
222 including commercial applications, and to alter it and redistribute it
223 freely, subject to the following restrictions:
224
225 <enum>
226 <item>  The origin of this software must not be misrepresented; you must not
227         claim that you wrote the original software. If you use this software
228         in a product, an acknowledgment in the product documentation would be
229         appreciated but is not required.
230 <item>  Altered source versions must be plainly marked as such, and must not
231         be misrepresented as being the original software.
232 <item>  This notice may not be removed or altered from any source
233         distribution.
234 </enum>
235
236
237
238 </article>
239
240
241