summaryrefslogtreecommitdiff
path: root/README
blob: a53c0897a7dbf3be2a2a0454909202fde27cb206 (plain)
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
USAGE
=====
This is a simple tool to generate data for a map as defined using ASCII art.

usage: ascii2map [-a|-b|-c] [-d directive] [input-file [output-file]]

SWITCHES
========

-a		The default.  Produce assembly output.
-b		Produce binary output.
-c		Produce C source output.
-d "x"		In assembly mode use "x" as the directive instead of the
		default "byte".
input-file	The input file.  If not supplied stdin is used.
output-file	The output file.  If not supplied stdout is used.


INPUT FILES
===========

Input files look like the following:

#:1
*:128
!63
0123456789ABCDEF:2
~
########
#      #
#ABCDEF#
#0#1# *#
########

The "#:1" line defines that when a '#' character appears in the map then code
'1' should be used.  By default the space character is defined as code zero.

The line starting with '!' defines the offset for any characters that aren't
explicitly defined.  e.g. in this example 63 will be deducted from the
character code.  In ASCII this would mean 'A' becomes 2, 'B' becomes 3, and so
on.  Any codes generated that fall outside the range 0 to 255 will be clamped
to that range.

A line with a long_string:number overrides a line starting with '!' and means
that each character in the string will be defined as the zero-based index in
the string added to the trailing number.  This is useful if your tile mappings
use characters in a non-standard order.

The line with a tilde (~) on its own indicates the end of the definitions.  

Following it is the map to produce the definition for, eg.

$ ascii2map example
	byte	1, 1, 1, 1, 1, 1, 1, 1
	byte	1, 0, 0, 0, 0, 0, 0, 1
	byte	1, 12, 13, 14, 15, 16, 17, 1
	byte	1, 2, 1, 3, 1, 0, 128, 1
	byte	1, 1, 1, 1, 1, 1, 1, 1