The Aurora API -------------- The API is very limited in BASIC, for more control use ASM. Using the API in BASIC: 1) Drawing a window: V = 1 A = left X coord, must be divisable by 8 (8, 16, 24...) B = upper Y coord C = right X coord, must be divisable by 8 (8, 16, 24...) D = lower Y coord To draw a window form (8,15) to (80,40): 1->V 8->A 15->B 80->C 40->D prgmZAPI 2) Running the mouse: V = 2 To display "CLICK" where your mouse pointer is: 2->V prgmZAPI ClrDraw Text(B,A,"CLICK" 3) Erasing sections of the screen: V = 3 A = left X coord, automaticly multiplied (1 = 8, 2 = 16, 3 = 24...) B = upper Y coord C = width, automaticly multiplied (1 = 8, 2 = 16, 3 = 24...) D = lower Y coord To erase from (16,15) to (88,47): 3->V 2->A 15->B 9->C 47->D prgmZAPI 4) Drawing the pointer (XOR) V = 4 The first time this command is called the pointer is drawn. The second time the pointer will be erased 4->V prgmZAPI Using the API in ASM: ASM progs using the API should NOT use the STATVARS area of memory, this is where the API is storred! Also put this at the beginning of the program: set textwrite,(iy+SGRFLAGS) Note: these commands are stored in Aurora.inc 1) Drawing a window B = left X coord, must be divisable by 8 (8, 16, 24...) C = upper Y coord D = right X coord, must be divisable by 8 (8, 16, 24...) E = lower Y coord HL = pointer to title of window Note: "call drawpointer" should be executed before drawing a window To draw a window form (8,15) to (80,40): call drawpointer ld b,8 ld c,15 ld d,80 ld e,40 ld hl,str_window call openwindow str_window: .db "This is a test",0 2) Running the mouse: call drawpointer call runpointer call drawpointer 3) Erasing sections of the screen: b = left X coord, automaticly multiplied (1 = 8, 2 = 16, 3 = 24...) c = upper Y coord d = width, automaticly multiplied (1 = 8, 2 = 16, 3 = 24...) e = lower Y coord To erase from (16,15) to (88,47): ld b,2 ld c,15 ld d,9 ld e,47 call cleararea call _grbufcpy_v 4) Drawing the pointer (XOR): Sometimes, the pointer will appear when you don't want it. The first time this command is called the pointer is drawn. The second time the pointer will be erased call drawpointer 5) Displaying an image (XOR): hl = pointer to 8 by 8 image a = x coordinate e = y coordinate The first time this command is called the image is drawn. The second time the image will be erased To draw a square at (10,20): ld a,10 ld e,20 ld hl,gfx_square call drawimage gfx_square: .db %11111111 .db %10000001 .db %10000001 .db %10000001 .db %10000001 .db %10000001 .db %10000001 .db %11111111 Special thanks to Movax who wrote this routine! 6) Drawing a button: hl = pointer to string d = x coordinate e = y coordinate To draw a button called "Click Me" at (10,10): ld hl,str_clickme ld d,10 ld e,10 call drawbutton str_clickme: .db "Click Me",0 7) Check if the pointer is above a button: hl = pointer to string d = x coordinate of button e = y coordinate of button To check a button called "Click Me" at (10,10): ld hl,str_clickme ld d,10 ld e,10 call buttoncheck call Z,buttonwasclicked str_clickme: .db "Click Me",0 8) Read the pointer position: (pointerx) = x coordinate (pointery) = y coordinate You will probably crash your calculator a few times with the API, we are not responsible for ANY damages. Copyright (C) 1997 Bill Nagel & Jareth Software