--     Gameboy Tile Editor v0.1     -Ŀ
                           Code by Matt Currie.                            
       Copyright (c) 1996, by Duwie Productions, All rights reserved.      


1.0  What it does.
---

GBE is a simple tile editor designed for use in creating background or
sprite images to be used in GameBoy programs.  It allows you to store up to
256 sprites in a single file and the accompanying program will translate them
into assembler source code.


2.0  System requirements.
---

To run it you need a graphics card supporting VESA v1.2 (1.1?) and 640x480
mode with 256 colours, >286 and a mouse. note: if GBE seems slow try
installing a tsr vesa driver even if your graphics card has built in vesa
support as these can dramatically improve performance.


3.0  Installation.
---

Copy it to wherever you want it.  Also, for those of you running short of
hard disk space, note that there must be at least 8000 bytes free on the
drive you run it from or else it will not be able to write the .BGI (yuk)
driver to disk when it starts up.


4.0  Use.
--

To draw, you click in the grid. The current drawing mode will set how the
picture it changed. To select a colour, you click one of the four
colours with the left or right mouse button. To copy a tile you select copy.
To paste a tile you select page. To clear a tile to the colour in the right
mouse button you select clear. To open a tile you select open. To save a tile
you select save. To exit you select exit. To see the about box you select
about. It is recommended that you name your files with a .til extension.

The grayed out options are left over from an old editor which was modified to
become GBE and cannot be used.

Apart from all that above you can change from the normal 8x8 grid to an 8x16
and a 32x32 grid.  In these modes the tiles are re-arraged to fill in the
grid like this (numbers represent the tile numbers from 8x8 mode).

32x32:                           8x16

  0   1   2   3                   0

  4   5   6   7                   1

  8   9  10  11

 12  13  14  15

In these modes it is much easier to edit larger sprites and stuff.  To get
into these modes simply type:

  gbe /2    for 32x32 mode.
        and
  gbe /3    for 8x16 mode.


When you want to convert the .til files to assembler source ready for
inserting into your programs you must run them thru til2asm.  To use til2asm
you simply give the information on the command line:

e.g.        til2asm fish.til 0 15

        fish.til = name of .til file you wish to convert.
        0       = first tile to convert.
        255     = last tile to convert.
                  (tile numbers taken from 8x8 mode in GBE).

note:  these parameters must be in the order above.  

til2asm will then create a file called pok.asm (pok being the name of the
.til file specified) which looks something like the one below. The word sized
number after the label refers to the number of bytes that need to be read,
useful for a general tile reading function which is simply passed an offset
to the tiles.  If you don't wish you use that number then simply add two (+2)
to the pointer.

<snip here>
;This file was produced using TIL2ASM v0.1
;*****************************************

fish: .dw 255
.db 12,12,62,50,243,205,193,62,0,255,0,255,0,255,0,255
.db 12,12,31,19,243,236,224,31,0,255,0,255,0,255,0,255
.db 4,4,30,26,251,229,225,30,0,255,0,255,0,255,0,255
.db 24,24,60,36,231,219,195,60,0,255,0,255,0,255,0,255
.db 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255
.db 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255
.db 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255
.db 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255
.db 0,255,0,255,255,0,0,255,255,0,0,255,255,0,255,0
.db 0,255,0,255,255,0,0,255,255,0,0,255,255,0,255,0
.db 0,255,0,255,255,0,0,255,255,0,0,255,255,0,255,0
.db 0,255,0,255,255,0,0,255,255,0,0,255,255,0,255,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.db 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0
<snip here>


4.1  File format.
---

The format of the .til files is extremely complex :) .  The first 768 bytes
consist of a palette, red, green, blue (one byte each) x 256.  The rest of it
is 256 8x8 tiles.  To set up a record or something in pascal for it you could
do something like this:

type    bob = record              {  colour, (r,g,b)  }
                pal     :       array[0..255,1..3] of byte;
                tile    :       array[0..255,0..7,0..7] of byte;
        end;                        {  tiles,   y,  x   }

The palette is there because this program was adapted from another one i
wrote which supported palette changing (which isn't really needed on the
gameboy) but i left it in so it would still read the old files. 


5.0  Disclaimer.
---

If this program stuffs up you, your computer or anything related to you or
your existance I don't owe you anything. By using this program you agree to
these terms.


6.0  Registering.
---

Continued use of this product requires you to register it.  To do so you can
send me $US10 (or equivalent however you like, but, don't send coins) at:

Matt Currie
17 Willoughby Lane
Christchurch
New Zealand

Registering will help me buy stuff so it is highly encouraged. :)
