Sorry! I wrote a new documentation because this one is shit! But
the new one is only in German. If you have questions - just Email
me!
Is there anyone, who wants to translate the new german documentation
into English? Contact me!


DOCUMENTATION OF ESCAPE PAINT MODULE PORT (IN BROKEN ENGLISH)
=============================================================

An EscAPE PAINT Module consists of an object file and a script file.
The object file includes the assembler routine, assembled with pure
assembler (ASH). Rules for module-programming are:
-only use pc-relative adressing
-the routine ends with rts
-there are 3 different module types
 1. The routine will be started directly after activating
 2. EscAPE PAINT switches first to the screen and then start the routine
 3. The rout. will be started after pressing the left mousebutton
    in the screen (esp.for drawing modules)
-EscAPE PAINT hands over an adress of a parameter structure in a0
 (description follows..)
-In the case 3. EscAPE PAINT hands over the x-mousepos. in d0, the
 y-mousepos. in d1 and the mousebutton status in d2 in addition. So
 you can program small routs. more effective.
 
The structure, which adress you may find in a0 consists of a table
of adresses. These adresses give you the possibility to use the most
of the EP-routines, by calling by jsr or to get important informations
about colors, screens ...
You are in Supervisormode. (Nearly) All values are longwords.

THE STRUCTURE
-------------

offset  |   function
----------------------------------------------------------------
  0     | screenadresse (editscreen)
  4     | pointer to x-resolutions
  8     | pointer to y-resolutions
 12     | pointer to current picture number
 16     | pointer to picture adresses
 20     | adress of a buffer (you can use it! (ca.300000 bytes))
 24     | pointer to palette data (every palette 512 bytes))
 28     | adress of a memcopy routine 
        | d0: number of longwords to copy
        | a0: sourceadress
        | a1: destinationadress
 32     | adress of a memclear rout.
        | d0: number of longwords to clear
        | a0: adress
 36     | adress of a memflip rout. (exchanges memory)
        | d0: number of longwords
        | a0: adress of one memory block
        | a1: adress of another memory block
 40     | adress of a pixelset rout.
        | d0: x
        | d1: y
        | d2: horiz. resolution
        | 4(sp): color
        | a0: screenadress
 44     | adress of a pixel locate rout.
        | d0: x
        | d1: y
        | d2: horiz. resolution
        | a0: screenadr.
        | result:
        | d0: color of the pixel
 48     | adress of a lineroutine
        | d0: x1
        | d1: y1
        | d2: x2
        | 4(sp): y2
        | 8(sp): color (if color=-1 -> neg. line)
        | a0: screenadress
        | this rout.only works in a horiz.res. of 320 and is very slow.
 52     | adress of a rubberbox rout.
        | d0: x1
        | d1: y1
        | d2: x2
        | 4(sp): y2
        | a0: screenadr.
        | only in 320 horiz.-resolution!
 56     | adress of a circle routine
        | d0: mx
        | d1: my
        | d2: radius
        | 4(sp): color
        | 8(sp): draw mode (0..normal,
        |                   1..negative,
        |                   2..transparent,
        |                   3..and,
        |                   4..or,
        |                   5..coloraddition
        |                   6..colorsub.)
        | a0: screenadress
 60     | adress of a fillrout.
        | d0: x of the startpoint
        | d1: y
        | d2: color
        | a0: scradr.
        | uses draw effect (set in draw options)
        | only in 320 hor.res.
 64     | adress of a filled box rout.
        | d0: color
        | d1: x1
        | d2: y1
        | 4(sp): x2
        | 8(sp): y2
        | a0: screenadr.
        | only in 320 hor.res.
 68     | adress of a block cut rout.
        | d0: x1
        | d1: y1
        | d2: x2
        | 4(sp): y2
        | a0: source picture
        | a1: destination block buffer
        |     (blockbuffer: 1.word:  x-size,
        |                   2.word:  y-size,
        |                   ..words: blockdata)
 72     | adress of a block put rout.
        | d0: x
        | d1: y
        | a0: block buffer
        | a1: screen
        | uses paste-effect (block-paste-options)
 76     | adress of a get-block-width rout.
        | a0: block bufferadr.
        | result:
        | d0: width
 80     | adress of a get-block-height rout.
        | a0: block adr.
        | result:
        | d0: height
 84     | adress of a block-restore rout.
        | d0: x
        | d1: y
        | a0: blockadr.
        | a1: scradr.
        | 4(sp): picture adr.
 88     | pointer to blockflag (0..no block, 1..block exists)
 92     | adress of a "fadenkreuz" routine
        | d0: x
        | d1: y
        | a0: scradr.
 96     | adress of the show_mouse_cursor rout.
100     | adress of the hide_mouse_cursor rout.
104     | adress of the set_mouse_position rout.
        | d0: x (new position)
        | d1: y
108     | adress of the cursor_set rout.
        | a0: Adress of the new mouse cursor (16x16 16bit)
112     | adress of the get_mouse_pos_x rout.
        | result:
        | d0: x-position of the mousecusor
116     | adress of the get_mouse_pos_y rout.
        | result:
        | d0: y-pos.
120     | adress of the get_mouse_button routine
        | result:
        | d0: mousebutton (bit1: left mb.,
        |                  bit2: right mb.)
124     | adress of the ice decrunch rout.
        | a0: adress of packed data
128     | pointer to actual color
132     | pointer to act. toolnumber (toolbox)
136     | pointer to act. style (draw style)
140     | pointer to act. mon_type (->XBIOS)
144     | pointer to act. palette-color-number



The scriptfile is the file with the extension "EPM" and you can
create it using a normal texteditor. EscAPE PAINT only looks at
the letters at the beginning of a line.

letter  | parameter
----------------------------------------------------------------
  V     | version of the module
  N     | modulename
  A     | name of the coder
  D     | releasedate of the module
  P     | path of the object file
  T     | moduletype (1..calling after activating
  		|             2..calling after switching to screen
  		|             3..calling after pressed m.b. in the screen
  		
You can use all other letters to write comments or module informations.
Example:

###############################################################
#             EscAPE PAINT MODULE - SCRIPTFILE                #
###############################################################

##################
# Moduleversion
V=1.02

##################
# Modulename
N=Testmodule

##################
# Author
A=The best

##################
# Date
D=11.11.99

##################
# Objectfile
P=TESTROUT.O

##################
# Type
T=3



Easy. Isn't it?
Have fun while programing! If you programed a nice module, send me!

adress:    Norman Feske
        Cmmerswalder Str.19
          01189 Dresden
             Germany  
            
email:  htw824@rob.rz.htw-dresden.de
        norman@iee.et.tu-dresden.de
