Contact me | Login | Search | Sitemap | Site Notice

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.

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:

FunctionHEXDECParameters
Init double LORES$801332787none
Exit double LORES$801632790none
Set drawing page$810932793page number (1/2): $E9 (233)
Move screen data from page to page$801C32796from screen (1-3): $8083 (32899)
to screen (1-3): $8084 (32900)
Clear 4 bottom text lines$801F32799none
Set display page$802232802page number (1/2): $E9 (233)
Fast total screen fill$802532805fill color (0-15): $E3 (227)
Horizontal line (HLIN)$802832808

Xfrom (0-79): $E0 (224)
Xto (0-79): $E7 (231)
Y (0-47): $E1 (225)
Color (0-15): $E3 (227)

Vertical line (VLIN)$802B32811

Yfrom (0-47): $E1 (225)
Yto (0-47): $E8 (232)
X (0-79): $E0 (224)
Color (0-15): $E3 (227)

SCRN-function$802E32814

X (0-79): $E0 (224)
Y (0-47): $E1 (225)
Pixel color (0-15, return value): $E9 (233)

Plot pixel$803132817

X (0-79): $E0 (224)
Y (0-47): $E1 (225)
Color (0-15): $E3 (227)

Fast line drawing$803432820

Xfrom (0-79): $E0 (224)
Xto (0-79): $E7 (231)
Yfrom (0-47): $E1 (225)
Yto (0-47): $E8 (232)
Color (0-15): $E3 (227)

Fast circle drawing$803732823

Midpoint X (0-79): $EC (236)
Midpoint Y (0-47): $ED (237)
Radius (0-255): $807A (32890)
Color (0-15): $E3 (227)

Fast disk drawing$803A32826

Midpoint X (0-79): $EC (236)
Midpoint Y (0-47): $ED (237)
Radius (0-255): $807A (32890)
Fill Color (0-15): $E3 (227)

Rectangle drawing$804632838

X1 (0-79): $E0 (224)
X2 (0-79): $E7 (231)
Y1 (0-47): $09 (9)
Y2 (0-47): $1F (31)
Color (0-15): $E3 (227)

Box drawing$803D32829X1 (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$804032832

Seedpoint X (0-79): $807E (32894)
Seedpoint Y (0-47): $807F (32895)
New Color (0-15): $E3 (227)

Toggle mixed mode$804332835none

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