JuMP-Table - Direct Library Access
With version 11.1 it is possible to access the library directly by storing the necessary variable data into certain memory locations and calling the single routine via a jump table with fixed adresses that will be maintained also in future versions of the library. For jump table data of V12 and V11 see below!
The following table gives the calling adresses in hex and dec which can be used for calling the routines directly from assembly or via a CALL-statement from AppleSoft-Basic:
JuMP Table Data V12:
Function | HEX | DEC | Parameters |
---|---|---|---|
Init double LORES | $7013 | 28691 | none |
Exit double LORES | $7016 | 28694 | none |
Set drawing page | $7019 | 28697 | page number (1/2): $E9 (233) |
Move screen data from page to page | $701C | 28700 | from screen (1-3): $7083 (28803) to screen (1-3): $7084 (28804) |
Clear 4 bottom text lines | $701F | 28703 | none |
Set display page | $7022 | 28706 | page number (1/2): $E9 (233) |
Fast total screen fill | $7025 | 28709 | fill color (0-15): $E3 (227) |
Horizontal line (HLIN) | $7028 | 28712 | Xfrom (0-79): $E0 (224) |
Vertical line (VLIN) | $702B | 28715 | Yfrom (0-47): $E1 (225) |
SCRN-function | $702E | 28718 | X (0-79): $E0 (224) |
Plot pixel | $7031 | 28721 | X (0-79): $E0 (224) |
Fast line drawing | $7034 | 28724 | Xfrom (0-79): $E0 (224) |
Fast circle drawing | $7037 | 28727 | Midpoint X (0-79): $EC (236) |
Fast disk drawing | $703A | 28730 | Midpoint X (0-79): $EC (236) |
Rectangle drawing | $7046 | 28742 | X1 (0-79): $E0 (224) |
Box drawing | $703D | 28733 | X1 (0-79): $E0 (224) X2 (0-79): $E7 (231) Y1 (0-47): $E1 (225) Y2 (0-47): $E8 (232) Color (0-15): $E3 (227) |
Flood fill algorithm | $7040 | 28736 | Seedpoint X (0-79): $707E (28798) |
Toggle mixed mode | $7043 | 28739 | none |
Grab new SPRITE | $7049 | 28745 | SPRITE number (1..16): $7093 (28819) |
Set MASK COLOR | $704C | 28748 | MASK COLOR (0..15): $708B (28811) |
Draw SPRITE | $704F | 28751 | SPRITE number (1..16): $7093 (28819) XPOS (0..239): $7094 (28820) YPOS (0..143): $7095 (28821) |
Delete SPRITE | $7055 | 28757 | SPRITE number (1..16): $7093 (28819) |
Store new SPRITE | $7052 | 28754 | SPRITE number (1..16): $7093 (28819) |
Be careful: when using the direct jump adresses with parameter injection via the memory locations you have to make sure that the parameters are in the valid range!
JuMP Table Data V11:
Function | HEX | DEC | Parameters |
---|---|---|---|
Init double LORES | $8013 | 32787 | none |
Exit double LORES | $8016 | 32790 | none |
Set drawing page | $8109 | 32793 | page number (1/2): $E9 (233) |
Move screen data from page to page | $801C | 32796 | from screen (1-3): $8083 (32899) to screen (1-3): $8084 (32900) |
Clear 4 bottom text lines | $801F | 32799 | none |
Set display page | $8022 | 32802 | page number (1/2): $E9 (233) |
Fast total screen fill | $8025 | 32805 | fill color (0-15): $E3 (227) |
Horizontal line (HLIN) | $8028 | 32808 | Xfrom (0-79): $E0 (224) |
Vertical line (VLIN) | $802B | 32811 | Yfrom (0-47): $E1 (225) |
SCRN-function | $802E | 32814 | X (0-79): $E0 (224) |
Plot pixel | $8031 | 32817 | X (0-79): $E0 (224) |
Fast line drawing | $8034 | 32820 | Xfrom (0-79): $E0 (224) |
Fast circle drawing | $8037 | 32823 | Midpoint X (0-79): $EC (236) |
Fast disk drawing | $803A | 32826 | Midpoint X (0-79): $EC (236) |
Rectangle drawing | $8046 | 32838 | X1 (0-79): $E0 (224) |
Box drawing | $803D | 32829 | X1 (0-79): $E0 (224) X2 (0-79): $E7 (231) Y1 (0-47): $E1 (225) Y2 (0-47): $E8 (232) Color (0-15): $E3 (227) |
Flood fill algorithm | $8040 | 32832 | Seedpoint X (0-79): $807E (32894) |
Toggle mixed mode | $8043 | 32835 | none |
Be careful: when using the direct jump adresses with parameter injection via the memory locations you have to make sure that the parameters are in the valid range!
AppleSoft Demo Programm
The following AppleSoft program gives a short demonstration of the direct library access by initializing double lores and drawing a yellow circle:
10 REM INIT DOUBLE LORES
20 CALL 32787
30 REM DRAW A CIRCLE
40 POKE 236,39 : REM MIDPOINT X
50 POKE 237,23 : REM MIDPOINT Y
60 POKE 32890,15: REM RADIUS
70 POKE 227,13 : REM COLOR
80 CALL 32823 : REM CALL CIRCLE FUNCTION
90 GET A$
100 CALL 32790 : REM EXIT DOUBLE LORES
110 END
Using the Ampersand-format yields a much shorter formulation of the same drawing task, however, the direct library access is likely to be faster since the Ampersand-routines perform a parameter check throwing errors when parameters are missing or out of range:
10 REM INIT DOUBLE LORES
20 &GR
30 REM DRAW A CIRCLE
40 &COLOR= 13
50 &C 39, 23, 15
90 GET A$
100 &TEXT : REM EXIT DOUBLE LORES
110 END