MPIR.TXT This file contains various information reguarding the Multi-Purpose Internal Routines contained in CShell. These routines are defined in the CShell.H header file for the Table ASemMbler. ***ALL RAM ADDRESSES USED IN THIS FILE ARE DEFINED IN CSHELL.H!*** ---- Call Method: call APD_RESET Description: Resets $8009 to $A1, the number TI-OS puts here for APD delay. Input: None Output: hl -> $8009 Traps: hl is changed. ---- Call Method: MPIR_CALL(WAITKEY) Description: Waits for a keypress until WaitDelay = 0. Input: $8C45 = WAIT_DELAY = number of cycles to run before timeout Output: a = Key Scancode, zero if APD or loop timeout Traps: IY -> $8346 (where it usually points) ---- Call Method: MPIR_CALL(SET_HILITE) Description: Draws/erases a highlite across the screen at HILITE_POS, and enables correct use of CHK_HILITE (if DRAWN). Input: $8C44 = HILITE_POS = line highlite is on (See Screen Layout) Output: A highlited bar is drawn across the screen at HILITE_POS a = b = HIGHLITE_POS hl -> somewhere in VIDEO_MEM Traps: destroys bc, de and hl ---- Call Method: MPIR_CALL(CHK_HILITE) Description: Checks if the up or down arrow has been pressed and moves the existing highlite accordingly if necessary. Recommended for use in key loops. Input: $8C42 = BAR_MAX = lowest position highlite may be moved to before it wraps back to the bottom $8C43 = BAR_MIN = highest postion highlite may be moved to before it wraps $8C44 = HIGHLITE_POS = current postion of highlite bar Output: $8C44 = HIGHLITE_POS = new postion of highlite bar Traps: IF UP OR DOWN ARROWS NOT PRESSED: hl -> HIGHLITE_POS b = HIGHLITE_POS + 1 IF UP OR DOWN ARROW IS PRESSED: a = b = HIGHLITE_POS c and de and hl are destroyed ---- Call Method: MPIR_CALL(HIGHLITE_UP) / MPIR_CALL(HIGHLITE_DOWN) Description: Moves the existing highlite bar up or down (respectively) one line. Input: $8C42 = BAR_MAX = lowest position highlite may be moved to before it wraps back to the bottom $8C43 = BAR_MIN = highest postion highlite may be moved to before it wraps $8C44 = HIGHLITE_POS = current postion of highlite bar Output: $8C44 = HIGHLITE_POS = new postion of highlite bar Traps: a = b = HIGHLITE_POS c and de and hl are destroyed ---- Call Method: MPIR_CALL(UP_CONTRAST) / MPIR_CALL(DOWN_CONTRAST) Description: Increases or decreases (respectively) the contrast level. Input: None Output: a = 0 if contrast was changed (not at max/$1F or min/$0) Traps: destroys a ---- Call Method: MPIR_CALL(SHUTDOWN) Description: sets word at $8008 to $0101, then halts and waits for TI ROM to turn off the calc (usually within 1 sec). Input: None Output: b = $834E hl -> $834E Traps: destroys a, b and hl ---- Call Method: MPIR_CALL(BLOCKER) Description: Turns off or inverts a block of pixels, as specified by bc. Used by all routines that create/move/erase highlites. *Please see the Screen Layout diagram below for information on how the screen is divided into rows. Input: b = row, bit 7 set = invert, else clear c = number of rows to invert/clear (below b) Output: None Traps: a, bc, de, hl are destroyed ---- Call Method: MPIR_CALL(VERT_LINE) Description: Used to draw a vertical line from the top to the bottom of the screen. Input: b = bitmap 'or'ed with address c = offset from $FC00 (value in here is added to $FC00) Output: a = 'or'ed bitmap with last byte of video mem accessed c = bitmap de = $10 hl = $FFF0 + c Traps: Many... ======== TI-85 Screen layout for BLOCKER and all Highlite Routines: BLOCKER: HIGHLITES: Row 0 (top line) +---------------------+ | | (unused) | | Line 0 (top) | | Line 1 | | Line 2 | | Line 3 | | Line 4 | | Line 5 | | Line 6 | | Line 7 (bottom) Row 63 (bottom line) +---------------------+