home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
GEOSApps
/
GEOSTECHREF2.ARC
/
PAGE39-53
< prev
next >
Wrap
Text File
|
2019-04-13
|
31KB
|
991 lines
╟┼╧╙ ╦ERNAL ╥OUTINES 1-36
╞UNCTION ╬AME: ╔╥╤╥╘╬
╨URPOSE: ╚ANDLES SEVERAL ITEMS THAT OCCUR AT REGULAR TIMED
INTERVALS.
├ALL ADDRESS: $├100
╧UTPUTS: ╙EE DESCRIPTION
─ESCRIPTION: ╟┼╧╙ SETS UP THE RASTER INTERRUPT ON THE ╓╔├ CHIP TO
CAUSE AN INTERRUPT EVERY SIXTIETH OF A SECOND. ╘HIS ROUTINE IS
CALLED BY ╟┼╧╙ AFTER EACH INTERRUPT. ╞IRST IT READS THE INPUT
DEVICE AND UPDATES THE MOUSE'S POSITION, TURNING IT ON IF
NECESSARY. ╔T THEN SCANS THE COMMAND TABLE AT $8719 TO SEE IF ANY
OF THE COMMAND BYTES HAVE BOTH BITS 4 AND 5 RESET. ╔F SO, IT THEN
DECREMENTS THE ASSOCIATED COUNTER AT $86╞1. ╔F THE COUNTER
REACHES ZERO, ITS VALUE IS RESET AND BIT 7 OF THE ASSOCIATED
COMMAND BYTE IS SET. ╘HIS WILL CAUSE THE APPROPRIATE SUBROUTINE
TO BE EXECUTED THE NEXT TIME THE TABLE IS POLLED. ╘HE NEXT PART
OF THIS ROUTINE IS TO DECREMENT ALL NONZERO COUNTERS IN THE STACK
AT $877╞. ╘HE ROUTINE TO BLINK THE TEXT CURSOR IS CALLED NEXT.
╞INALLY, THE RANDOM NUMBER GENERATOR AT $850┴ IS UPDATED.
╞UNCTION ╬AME: ╠├╚┴╔╬
╨URPOSE: ╠OAD MEMORY FROM DISK.
├ALL ADDRESS: $├1╞╞
╔NPUT REQUIREMENTS:
$04 ╔NITIAL TRACK NUMBER.
$05 ╔NITIAL SECTOR NUMBER.
$06-$07 ┬YTE COUNT OF LOAD.
$10-$11 ╠OAD ADDRESS.
╧UTPUT:
$0├ ╔NDEX TO LAST SECTOR LOADED.
$8300- ╠IST OF TRACKS AND SECTORS TRACK WERE LOADED.
╨REPARATORY ROUTINES: ╠╧┴─┴─
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE ASSUMES THAT THE FILE HAS BEEN LOCATED
IN THE DIRECTORY AND THAT THE INITIAL TRACK AND SECTOR ARE KNOWN.
╞UNCTION ╬AME: ╠─╙╫┴╨
╨URPOSE: ╥ELOAD THE ╙╫┴╨╞╔╠┼.
├ALL ADDRESS: $├23┼
╨REPARATORY ROUTINES: ╠╧┴─╙╫
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE RELOADS THE ╙╫┴╨╞╔╠┼, THEN DELETES IT.
╘HE LAST WINDOW DESCRIPTION IS REPROCESSED TO RESTORE THE SCREEN
AND CONTROL IS RETURNED TO THE ORIGINAL PROGRAM THAT CALLED
╠╧┴─╙╫.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-37
╞UNCTION ╬AME: ╠╔╬┼
╨URPOSE: ─RAWS, ERASES OR COPIES A LINE ON THE HIRES SCREEN.
├ALL ADDRESS: $├130
╔NPUT REQUIREMENTS:
╬ FLAG ├ ╞LAG ╧PERATION
1 ╪ ├OPY
0 1 ─RAW
0 0 ┼RASE
$08-$09 ╘HE COLUMN FOR THE FIRST ENDPOINT.
$0┴-$0┬ ╘HE COLUMN FOR THE SECOND ENDPOINT.
$18 ╘HE ROW FOR THE FIRST ENDPOINT.
$19 ╘HE ROW FOR THE SECOND ENDPOINT.
─ESCRIPTION: ╘HIS IS A VERY VERSATILE ROUTINE. ╔T CAN COPY AN
ARBITRARY LINE FROM ONE SCREEN TO ANOTHER, AS WELL AS DRAW OR
ERASE LINES. ╘HIS ROUTINE PLACES NO RESTRICTIONS ON THE RELATIVE
POSITIONS OF THE ENDPOINTS. ╘HIS ROUTINE CALLS ╨╠╧╘ TO PLOT THE
POINTS. ╙EE ALSO ╥╧╫┴─╥.
╞UNCTION ╬AME: ╠╧┴─
╨URPOSE: ╠OAD AND RUN A FILE.
├ALL ADDRESS: $├208
╔NPUT REQUIREMENTS:
$02 ╞LAG BYTE (╙EE DESCRIPTION).
$06-$07 ╧PTIONAL DATA POINTER.
$08-$09 ╧PTIONAL DATA POINTER.
$0┼-$0╞ ╨OINTER TO FILENAME.
$10-$11 ╠OAD ADDRESS (OPTIONAL).
╧UTPUT:
$8100-$81╞╞ ╔NFO SECTOR FOR FILE.
$8300-$83╞╞ ╘ABLE OF TRACKS AND SECTORS THAT WERE LOADED.
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╘HIS ROUTINE LOADS AND RUNS A GIVEN FILE. ╘HE FILE
MUST BE ONE OF THE FOLLOWING ╟┼╧╙ TYPES:
╙YSTEM ╞ILE ─ESK ┴CCESSORY
┴PPLICATION ┴PPLICATION ─ATA
╨RINTER ─RIVER ╔NPUT ─RIVER
╘HE EXECUTION ADDRESS IS TAKEN FROM THE INFORMATION SECTOR. ╔F IT
IS ZERO, THE FILE IS NOT EXECUTED, ONLY LOADED. ╓╠╔╥ FILES HAVE
ONLY THEIR FIRST CHAIN LOADED. ─ESK ┴CCESSORIES SWAP OUT THE
MEMORY THAT THEY USE TO THE ╙╫┴╨╞╔╠┼. ╒PON COMPLETION, THE
╙╫┴╨╞╔╠┼ IS RELOADED. ╘HE FLAG BYTE AT LOCATION $02 HAS TWO
PURPOSES. ╘HIS FIRST IS IF BIT 0 IS SET AND THE FILE WAS AN
APPLICATION, THEN IT IS NOT EXECUTED. ┴LSO IF BIT 0 IS SET, THEN
LOCATIONS $10-$11 HAVE THE LOAD ADDRESS; OTHERWISE, THE LOAD
ADDRESS IS TAKEN FROM THE INFORMATION SECTOR. ╘HIS BIT DOES NOT
APPLY TO ─ESK ┴CCESSORIES. ╔F EITHER BIT 6 OR 7 ARE SET, THEN
$06-$07 POINTS TO 16 BYTES WHICH ARE COPIED TO $8453 (─ISK NAME
FOR DRIVE 10), AND $07-$08 POINT TO 16 BYTES WHICH ARE COPIED TO
$8442 (─ISK NAME FOR DRIVE 11).
╟┼╧╙ ╦ERNAL ╥OUTINES 1-38
╞UNCTION ╬AME: ╠╧┴─2
╨URPOSE: ╠OAD A FILE.
├ALL ADDRESS: $├211
╔NPUT REQUIREMENTS:
$14-$15 ╨OINTER TO DIRECTORY ENTRY.
$886┬ ╞LAG BYTE.
$886├-$886─ ╠OAD ADDRESS.
╧UTPUT:
$8100-$81╞╞ ╔NFO SECTOR FOR FILE.
$8300-$83╞╞ ╘ABLE OF TRACKS AND SECTORS THAT WERE LOADED.
╨REPARATORY ROUTINES: ╠╧╧╦╒╨ (╨OINTER MUST BE COPIED)
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╘HIS ROUTINE IS CALLED BY ╠╧┴─ TO PERFORM THE LOAD.
╘HIS ROUTINE DOES NOT TRY TO EXECUTE THE FILE LOADED, NOR IS IT
LIMITED TO THE FILE TYPES THAT ╠╧┴─ IS. ╚OWEVER, THIS ROUTINE CAN
NOT BE USED TO LOAD ╬ON-╟┼╧╙ FILES BECAUSE THE INFO SECTOR MUST
BE PRESENT. ╔F BIT 0 OF LOCATION $886┬ IS SET, THEN THE LOAD
ADDRESS IS TAKEN FROM LOCATIONS $886├-$886─ INSTEAD OF THE INFO
SECTOR. ╘HE DIRECTORY ENTRY POINTER SHOULD POINT TO $8400 AND
NOT THE POINTER RETURNED BY ╠╧╧╦╒╨. ╘HIS IS DUE TO MEMORY
CONFLICTS THAT WILL ARISE.
╞UNCTION ╬AME: ╠╧┴─3
╨URPOSE: ╠OAD AND POSSIBLY RUN A FILE.
├ALL ADDRESS: $├21─
$02 ╞LAG BYTE (╙EE DESCRIPTION).
$06-$07 ╧PTIONAL DATA POINTER.
$08-$09 ╧PTIONAL DATA POINTER.
$0┼-$0╞ ╨OINTER TO FILENAME.
$10-$11 ╠OAD ADDRESS (OPTIONAL).
╧UTPUT:
$8100-$81╞╞ ╔NFO SECTOR FOR FILE.
$8300-$83╞╞ ╘ABLE OF TRACKS AND SECTORS THAT WERE LOADED.
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╘HIS ROUTINE IS CALLED BY ╠╧┴─ TO LOAD ┴PPLICATION
FILES. ╠IKE ╠╧┴─2, THIS ROUTINE IS NOT LIMITED TO ANY PARTICULAR
FILE TYPE, EXCEPT THAT IT ALSO CAN NOT LOAD A ╬ON-╟┼╧╙ FILE. ╙EE
╠╧┴─ FOR A DESCRIPTION OF THE FLAG BYTE, DATA POINTERS AND LOAD
ADDRESS.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-39
╞UNCTION ╬AME: ╠╧┴─┴─
╨URPOSE: ╟ET THE LOAD ADDRESS OF A FILE.
├ALL ADDRESS: $├229
╔NPUT REQUIREMENTS:
$14-$15 ╨OINTER TO DIRECTORY ENTRY.
╧UTPUT:
$04 ╘RACK OF FILE'S FIRST SECTOR.
$05 ╙ECTOR OF FILE'S FIRST SECTOR.
$10-$11 ╠OAD ADDRESS FOR FILE.
$8100-$81╞╞ ╔NFO SECTOR FOR FILE.
$8300-$8301 ╘RACK AND SECTOR OF INFO SECTOR.
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE LOADS THE INFO SECTOR FOR A FILE INTO
THE BUFFER AT $8100. ╘HE LOAD ADDRESS IS SET FROM $8147-$8148.
╘HIS ROUTINE IS CALLED BY ALL THE LOAD ROUTINES.
╞UNCTION ╬AME: ╠╧┴─╙╫
╨URPOSE: ╠OAD AND RUN A FILE USING THE ╙╫┴╨╞╔╠┼.
├ALL ADDRESS: $├217
╔NPUT REQUIREMENTS:
$14-$15 ╨OINTER TO DIRECTORY ENTRY.
╧UTPUT:
$8100-$81╞╞ ╔NFO SECTOR FOR FILE (═ODIFIED).
$8300-$83╞╞ ╠IST OF TRACKS AND SECTORS THAT WERE LOADED.
╨REPARATORY ROUTINES: ╠╧╧╦╒╨ (╨OINTER MUST BE COPIED).
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE IS USED TO LOAD ─ESK ┴CCESSORIES. ╘HE
INFO SECTOR IS LOADED TO DETERMINE THE NECESSARY MEMORY REGION.
╘HIS REGION IS SAVED TO A FILE CALLED '╙╫┴╨╞╔╠┼', WHOSE INFO
SECTOR IS THE SAME AS THE FILE TO BE LOADED. ╘HE DIFFERENCE IS
THAT THE TEXT FIELD IS CLEARED, AND THE FILE TYPE IS ╙YSTEM FILE
(╘YPE 4). ╠─╙╫┴╨ MUST BE EVENTUALLY CALLED TO RELOAD THE ╙╫┴╨╞╔╠┼
AND RETURN TO NORMAL OPERATION. ╘HE DIRECTORY ENTRY POINTER
SHOULD POINT TO $8400, AND THE POINTER RETURNED BY ╠╧╧╦╒╨. ╘HIS
IS DUE TO MEMORY CONFLICTS THAT WILL ARISE.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-40
╞UNCTION ╬AME: ╠╧╧╦╒╨
╨ROCEDURE: ╠OOKUP A FILENAME IN THE DIRECTORY.
├ALL ADDRESS: $├20┬
╔NPUT REQUIREMENTS:
$0┼-$0╞ ╨OINTER TO FILENAME.
$886┼ ╞LAG BYTE.
╧UTPUT:
$04 ╘RACK FOR DIRECTORY SECTOR.
$05 ╙ECTOR FOR DIRECTORY SECTOR.
$0├-$0─ ╨OINTER TO FILE NAME ENTRY.
$8000-$80╞╞ ─IRECTORY SECTOR.
$8400-$841─ ├OPY OF DIRECTORY ENTRY.
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╘HIS IS A VERY USEFUL ROUTINE. ╟IVEN A TEXT STRING
OF A FILENAME, THIS ROUTINE WILL FIND IT IN THE DIRECTORY. ╔F THE
FLAG BYTE AT $886┼ IS $00, THEN BOTH DRIVES 8 AND 9 WILL BE
SCANNED IF NECESSARY. ╔F THE FLAG IS $╞╞, THEN THE LOOKUP IS ONLY
TO THE CURRENT DRIVE. ╔F THERE IS ONLY ONE DRIVE, THEN THIS FLAG
HAS NO EFFECT. ╘HE DIRECTORY SECTOR IS LOADED INTO A BUFFER AT
$8000, AND THE TRACK AND SECTOR ARE IN LOCATIONS $04 AND $05. ╘HE
PARTICULAR DIRECTORY ENTRY IS COPIED TO $8400 AND THE POINTER TO
THE ENTRY IN THE BUFFER IS STORED AT $0├-$0─.
╞UNCTION ╬AME: ═┴╔╬
╨URPOSE: ┼NTERS ╟┼╧╙'S MAIN LOOP.
├ALL ADDRESS: $├1├3
╔NPUT REQUIREMENTS:
$849┬-$849C ┴DDRESS OF USER'S ADDITION TO ╟┼╧╙'S MAIN LOOP
(OPTIONAL).
─ESCRIPTION: ╘HIS LOOP DOES WHATEVER POLLING IS NEEDED. ╞IRST THE
BUTTON IS CHECKED, AS WELL AS THE KEYBOARD AND THE MOUSE'S
POSITION. ╘HE COMMAND TABLE AT $8719 (╙EE ├═─╘┬╠) IS SCANNED FOR
EXECUTABLE ROUTINES. ╘HEN THE COUNTERS AT $877╞ (╙EE ─┼╠┴┘) ARE
CHECKED; THOSE THAT HAVE REACHED ZERO HAVE THEIR ASSOCIATED
ROUTINES EXECUTED. ╘HE MEMORY IMAGE OF THE CLOCK IS UPDATED. ╘HEN
THE ALARM CLOCK IS CHECKED. ╞INALLY, THE USER'S ADDITION TO THE
MAIN LOOP, IF THERE IS ONE, IS EXECUTED. ╘HIS LOOP CONTINUES
FOREVER.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-41
╞UNCTION ╬AME: ═┴╦├╒╥
╨URPOSE: ═AKES A VERTICAL BAR CURSOR SPRITE.
├ALL ADDRESS: $├1├0
╔NPUT REQUIREMENTS:
┴ ╘HE HEIGHT OF THE CURSOR MINUS 1 (0-41)
╧UTPUT:
╙PRITE BLOCK #41 ($8┴40-$8┴7┼) IS MADE INTO A VERTICAL BAR
OF A GIVEN HEIGHT.
─ESCRIPTION: ╟IVEN THE DESIRED HEIGHT, A VERTICAL BAR IS CREATED
IN THE SPRITE BLOCK. ╔F THE HEIGHT IS GREATER THAN 21, THEN THE
HEIGHT IS HALVED AND THE SPRITE IS ┘-EXPANDED. ╬O CHECK IS
PERFORMED ON THE HEIGHT. ╔F A HEIGHT GREATER THAN 41 IS USED THEN
THE MEMORY FOR NEXT FEW SPRITES WILL BE AFFECTED.
╞UNCTION ╬AME: ═┴╙╠
╨URPOSE: 16 BIT MULTIPLE ARITHMETIC SHIFT LEFTS.
├ALL ADDRESS: $├15─
╔NPUT REQUIREMENTS:
┘ ╘HE SHIFT COUNT.
╪ ╘HE ADDRESS OF THE 16 BIT VALUE TO BE SHIFTED.
╧UTPUT:
╪ ╥ESULT OF SHIFTS.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪ HAS
THE ADDRESS OF A 16 BIT INTEGER IN ZERO PAGE, WHICH IS TO BE
SHIFTED LEFT BY THE COUNT IN ┘.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-42
╞UNCTION ╬AME: ═┼╬╒
╨URPOSE: ─RAWS AND SETS EVERYTHING UP FOR PULL DOWN MENUS AND
SUBMENUS.
├ALL ADDRESS: $├151
╔NPUT REQUIREMENTS:
┴ ═ENU OPTION TO POSITION MOUSE ON (0 TO #OPTIONS-1)
$02-$03 ╨OINTER TO THE MENU DESCRIPTOR.
─ESCRIPTION: ╘HIS IS AN ┼╪╘╥┼═┼╠┘ POWERFUL ROUTINE. ╔T DOES
┼╓┼╥┘╘╚╔╬╟ FOR MENU PROCESSING. ╧NCE CONTROL RETURNS TO THE
PROGRAM THAT CREATED THE MENU, THE PROGRAM CAN RETURN TO THE ╟┼╧╙
MAIN LINE, OR DO ANYTHING ELSE. ╔T IS IMPORTANT TO NOTE THAT
MENUS ONLY APPEAR ON SCREEN 1. ╠OCATION $2╞ IS SAVED AND RESTORED
DURING THE DRAWING PHASE. ╘HE LEFT AND RIGHT MARGINS ARE ALSO
LEFT UNALTERED. ╘HE FOLLOWING IS A DESCRIPTION OF A MENU
DESCRIPTOR:
#BYTES ─ESCRIPTION
1 ╘OP MARGIN OF ENTIRE MENU.
1 ┬OTTOM MARGIN OF ENTIRE MENU.
2 ╠EFT MARGIN OF ENTIRE MENU.
2 ╥IGHT MARGIN OF ENTIRE MENU.
1 ├ODE BYTE:
BIT 7 - VERTICAL MENU.
BIT 6 - SET SECONDARY BOX DESCRIPTOR TO FULL
SCREEN; THIS ALLOWS THE MOUSE TO BE MOVED
OUTSIDE OF A MENU WITHOUT CAUSING IT TO
BE CLOSED.
BITS 0-4 - # ENTRIES IN MENU.
╘HIS IS FOLLOWED BY SETS OF 5 BYTES; AS MANY AS THERE ARE
ENTRIES.
2 ┴DDRESS OF THE TEXT FOR THIS OPTION.
1 ├ODE BYTE WHICH DESCRIBES WHAT TO DO WITH THE
ADDRESS THAT FOLLOWS:
BIT 7 - OPERAND IS THE ADDRESS OF A SUBMENU
DESCRIPTOR.
BIT 6 - CALL SUBROUTINE, IT MUST RETURN A RESULT
IN $02-$03 WHICH IS EITHER 0 OR THE
ADDRESS OF THE NEXT SUBMENU.
╔F NEITHER BIT IS SET, THEN WHEN THIS OPTION IS
SELECTED IT WILL FLASH BEFORE THE ROUTINE IS
EXECUTED. ├ONTROL DOES NOT RETURN TO THE MENU
PROCESSOR.
2 ┴DDRESS OF EITHER A SUBMENU DESCRIPTOR OR A
ROUTINE TO BE EXECUTED.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-43
╞UNCTION ╬AME: ═╠╙╥
╨URPOSE: 16 BIT MULTIPLE LOGICAL SHIFT RIGHTS.
├ALL ADDRESS: $├262
╔NPUT REQUIREMENTS:
┘ ╘HE SHIFT COUNT.
╪ ╘HE ADDRESS OF THE 16 BIT VALUE TO BE SHIFTED.
╧UTPUT:
╪ ╥ESULT OF SHIFTS.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪ HAS
THE ADDRESS OF A 16 BIT INTEGER IN ZERO PAGE, WHICH IS TO BE
SHIFTED RIGHT BY THE COUNT IN ┘.
╞UNCTION ╬AME: ═╧╒╙╧╞
╨URPOSE: ╘URNS OFF THE MOUSE.
├ALL ADDRESS: $├18─
─ESCRIPTION: ╘HIS ROUTINE RESETS BIT 7 OF LOCATION $30, AND
ACTUALLY TURNS OFF THE MOUSE SPRITE.
╞UNCTION ╬AME: ═╧╒╙╧╬
╨URPOSE: ╘URNS ON THE MOUSE.
├ALL ADDRESS: $├18┴
─ESCRIPTION: ╘HIS ROUTINE SETS BIT 7 OF LOCATION $30. ╘HE
INTERRUPT ROUTINES WILL TURN ON THE MOUSE WHEN IT TRIES TO UPDATE
ITS POSITION.
╞UNCTION ╬AME: ╬┼╟16
╨URPOSE: ╬EGATES A 16 BIT VALUE.
├ALL ADDRESS: $├172
╔NPUT REQUIREMENTS:
╪ ╘HE ADDRESS OF THE 16 BIT INTEGER
╧UTPUT:
╪ ╘HE ADDRESS OF THE 16 BIT RESULT.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪
POINTS TO A 16 BIT VALUE WHICH IS NEGATED. ╘HE VALUE OF ╪ IS NOT
AFFECTED.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-44
╞UNCTION ╬AME: ╬┼╪╘
╨URPOSE: ═OVE TO NEXT ╓╠╔╥ CHAIN.
├ALL ADDRESS: $├27┴
╧UTPUT:
┘ ╘RACK OF ╓╠╔╥ CHAIN.
$04 ╘RACK OF ╓╠╔╥ CHAIN.
$05 ╙ECTOR OF ╓╠╔╥ CHAIN.
$8496 ╔NCREMENTED BY 1.
╨REPARATORY ROUTINES: ╓╧╨┼╬
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE GETS THE TRACK AND SECTOR OF THE NEXT
CHAIN IN THE OPEN ╓╠╔╥ FILE. ╔T DOES NOT CHECK TO SEE IF THE
CHAIN EXISTS (IE. TRACK IS ZERO). ╔T DOES CHECK IF THIS CHAIN IS
IN RANGE (AGAINST $8497).
╞UNCTION ╬AME: ╬╒═┬╠╦
╨URPOSE: ├OUNTS THE NUMBER OF FREE BLOCKS IN THE ┬┴═ THAT IS IN
╥┴═.
├ALL ADDRESS: $├1─┬
╔NPUT REQUIREMENTS:
$0├-$0─ ╨OINTER TO BUFFER WITH TRACK 18 SECTOR 0.
╧UTPUT:
$0┴-$0┬ ╘HE NUMBER OF FREE BLOCKS.
╨REPARATORY ROUTINES: ╥─180
─ESCRIPTION: ╘HIS ROUTINE EXPECTS THAT THE ┬┴═ HAS ALREADY BEEN
READ INTO MEMORY. ┴LL THAT IT DOES IS ADD UP THE NUMBER OF FREE
BLOCKS IN EACH TRACK.
╞UNCTION ╬AME: ╧╨╬─╙╦
╨URPOSE: ╧PENS A DISK TO ╟┼╧╙.
├ALL ADDRESS: $├2┴1
╔NPUT REQUIREMENTS:
$8489 ├URRENT DRIVE NUMBER.
╧UTPUT:
$848┬ $00/$╞╞ ╟EOS FORMAT OR NOT.
$841┼-$8465 ┴PPROPRIATE BUFFER WILL HAVE DISK'S NAME.
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HE CURRENT DRIVE IS INITIALIZED BY CALLING ╔╬╔╘─╓.
╟┼╧╙ FORMAT IS CHECKED FOR, AND THE DISK'S NAME IS COPIED INTO
THE APPROPRIATE BUFFER AT $841┼-$8465.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-45
╞UNCTION ╬AME: ╧╨╬╙┼╥
╨URPOSE: ╧PEN SERIAL COMMUNICATION.
├ALL ADDRESS: $├25├
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE SETS UP THE ╔/╧ PORTS FOR HIGH SPEED
SERIAL COMMUNICATION WITH THE DISK DRIVES. ╘HIS ROUTINE IS CALLED
PRIOR TO CALLING ╥┼┴─2, ╫╥╔╘┼2 OR ├╫╥╔╘┼.
╞UNCTION ╬AME: ╨┬╧╪
╨URPOSE: ─RAWS THE OUTLINE OF A RECTANGULAR BOX IN A GIVEN
PATTERN.
├ALL ADDRESS: $├127
╔NPUT REQUIREMENTS:
┴ ╘HE ACTUAL BIT PATTERN FOR THE BOX.
$06 ╘HE TOP MARGIN.
$07 ╘HE BOTTOM MARGIN.
$08-$09 ╘HE LEFT MARGIN.
$0┴-$0┬ ╘HE RIGHT MARGIN.
─ESCRIPTION: ╘HIS ROUTINE DRAWS THE OUTLINE OF A RECTANGULAR BOX
IN A GIVEN PATTERN. ╘HIS ROUTINE CALLS ╚╠╔╬┼ AND ╓╠╔╬┼ TO DRAW
THE OUTLINE. ╙EE ALSO ╥╧╫┴─╥.
╞UNCTION ╬AME: ╨┬╧╪2
╨URPOSE: ╔DENTICAL TO ╨┬╧╪, BUT WITH INLINE DATA.
├ALL ADDRESS: $├1┴2
─ESCRIPTION: ╘HIS ROUTINE DRAWS A SOLID OUTLINE OF A BOX, WHICH
IS DESCRIBED BY INLINE CODE. ╙EE ╨╞╔╠╠2 FOR AN EXAMPLE.
╞UNCTION ╬AME: ╨┼╥═╔╘
╨URPOSE: ┼NABLES THE EXECUTION OF A TIMED EVENT.
├ALL ADDRESS: $├10╞
╔NPUT REQUIREMENTS:
╪ ╘HE INDEX INTO THE COMMAND TABLE AT $8719.
╨REPARATORY ROUTINES: ├═─╘┬╠
─ESCRIPTION: ╘HIS ROUTINE RESETS BIT 6 OF A SPECIFIC COMMAND BYTE
IN THE TABLE AT $8719. ╘HIS ALLOWS THE ASSOCIATED ROUTINE TO BE
EXECUTED WHEN ITS TIMER RUNS OUT. ╔F THE TIMER HAD RUN OUT WHILE
THE ROUTINE WAS DISABLED, ╟┼╧╙ WILL EXECUTE THE ROUTINE WHEN IT
GETS TO IT. ╘HIS IS THE COMPLEMENT TO ╞╧╥┬╔─.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-46
╞UNCTION ╬AME: ╨╞╔╠╠
╨URPOSE: ╞ILLS A RECTANGULAR BOX WITH A SELECTED DESIGN.
├ALL ADDRESS: $├124
╔NPUT REQUIREMENTS:
$06 ╘HE TOP MARGIN.
$07 ╘HE BOTTOM MARGIN.
$08-$09 ╘HE LEFT MARGIN.
$0┴-$0┬ ╘HE RIGHT MARGIN.
╨REPARATORY ROUTINES: ╙┼╘╨┴╘
─ESCRIPTION: ╘HIS ROUTINE FILLS A RECTANGULAR BOX IN A GIVEN
DESIGN. ╘HIS ROUTINE CALLS ╚╠╔╬┼ REPEATEDLY. ╙EE ALSO ╥╧╫┴─╥.
╞UNCTION ╬AME: ╨╞╔╠╠2
╨URPOSE: ╔DENTICAL TO ╨╞╔╠╠, BUT WITH INLINE DATA.
├ALL ADDRESS: $├19╞
╨REPARATORY ROUTINES: ╙┼╘╨┴╘
─ESCRIPTION: ╘HIS ROUTINE IS IDENTICAL TO ╨╞╔╠╠ EXCEPT THAT DATA
THAT DESCRIBES THE BOX IS PART OF THE INLINE CODE. ╞OR EXAMPLE:
╩╙╥ ╨╞╔╠╠2
.┬┘╘┼ ╘OP MARGIN
.┬┘╘┼ ┬OTTOM MARGIN
.╫╧╥─ ╠EFT MARGIN
.╫╧╥─ ╥IGHT MARGIN
├ONTROL RETURNS HERE AFTER BOX IS FILLED.
╞UNCTION ╬AME: ╨╠╧╘
╨URPOSE: ─RAWS, ERASES OR COPIES A PIXEL ON THE HIRES SCREEN.
├ALL ADDRESS: $├133
╔NPUT REQUIREMENTS:
╬ FLAG ├ ╞LAG ╧PERATION
1 ╪ ├OPY
0 1 ─RAW
0 0 ┼RASE
$08-$09 ╘HE COLUMN NUMBER.
$18 ╘HE ROW NUMBER.
─ESCRIPTION: ╘HIS IS A VERY VERSATILE ROUTINE. ╔T CAN COPY A
POINT FROM ONE SCREEN TO ANOTHER, AS WELL AS DRAW OR ERASE IT.
╘HIS ROUTINE IS CALLED BY ╠╔╬┼ TO DRAW LINES. ╙EE ALSO ╥╧╫┴─╥.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-47
╞UNCTION ╬AME: ╨╧╙╙╨╥
╨URPOSE: ╙ETS THE POSITION OF A SPRITE.
├ALL ADDRESS: $├1├╞
╔NPUT REQUIREMENTS:
$08 ╙PRITE NUMBER (0-7).
$0┴-$0┬ ╙PRITE ╪ POSITION.
$0├ ╙PRITE ┘ POSITION.
╨REPARATORY ROUTINES: ├╧╨┘╙╨
─ESCRIPTION: ╘HIS ROUTINE COPIES THE SPRITE'S POSITION TO THE ╓╔├
CHIP, RELIEVING THE USER OF THE BURDEN OF HANDLING THE CROSSOVER
IN THE SCREEN FROM COLUMN 255 TO COLUMN 256.
╞UNCTION ╬AME: ╨╥┼╓
╨URPOSE: ═OVE TO PREVIOUS ╓╠╔╥ CHAIN.
├ALL ADDRESS: $├27─
╧UTPUT:
┘ ╘RACK OF ╓╠╔╥ CHAIN.
$04 ╘RACK OF ╓╠╔╥ CHAIN.
$05 ╙ECTOR OF ╓╠╔╥ CHAIN.
$8496 ─ECREMENTED BY 1.
╨REPARATORY ROUTINES: ╓╧╨┼╬
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE GETS THE TRACK AND SECTOR OF THE
PREVIOUS CHAIN IN THE OPEN ╓╠╔╥ FILE. ╔T DOES NOT CHECK TO SEE IF
THE CHAIN EXISTS (IE. TRACK IS ZERO). ╔T DOES CHECK IF THIS CHAIN
IS GREATER THAN ZERO.
╞UNCTION ╬AME: ╥┴╬─╧═
╨URPOSE: ═ODIFIES THE RANDOM NUMBER GENERATOR AT $850┴-$850┬.
├ALL ADDRESS: $├187
╧UTPUT:
$850┴-$850┬ ╬EW SEED VALUE.
─ESCRIPTION: ╘HIS ROUTINE CHANGES THE 16 BIT RANDOM NUMBER AT
$850┴-$850┬, USING A SIMPLE YET ELABORATE FORMULA.
╞UNCTION ╬AME: ╥─180
╨URPOSE: ╥EAD TRACK 18, SECTOR 0 FROM THE DISK.
├ALL ADDRESS: $├247
╧UTPUT:
$04 $12, TRACK NUMBER.
$05 $00, SECTOR NUMBER.
$0┴-$0┬ $8200, ADDRESS OF BUFFER AREA.
$8200-$82╞╞ ─ATA FROM TRACK 18 SECTOR 0.
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE SETS UP THE POINTERS FOR ╥┼┴─, THEN
CALLS IT TO READ THE SECTOR. ╘HIS IS GENERALLY USED TO GET THE
┬┴═ INTO MEMORY.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-48
╞UNCTION ╬AME: ╥┼┴─
╨URPOSE: ╥EAD A GIVEN TRACK AND SECTOR.
├ALL ADDRESS: $├1┼4
╔NPUT REQUIREMENTS:
$04 ╘RACK OF SECTOR TO BE READ.
$05 ╙ECTOR NUMBER TO BE READ.
$0┴-$0┬ ╨OINTER TO BUFFER.
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╠OADS AND RUNS TURBODOS IF IT IS NOT ALREADY THERE.
╘HEN READS THE DESIRED BLOCK FROM THE DISK INTO THE BUFFER.
╞UNCTION ╬AME: ╥┼┴─2
╨URPOSE: ╥EAD A SECTOR FROM THE DISK.
├ALL ADDRESS: $├21┴
╔NPUT REQUIREMENTS:
$04 ╘RACK TO BE READ.
$05 ╙ECTOR TO BE READ.
$0┴-$0┬ ╨OINTER TO BUFFER FOR DATA.
╧UTPUT:
─ATA IS READ INTO THE DESIRED BUFFER.
╨REPARATORY ROUTINES: ─╙┼╘╒╨
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE IS CALLED BY ╥┼┴─ TO READ A SECTOR. ╘HE
DIFFERENCE BETWEEN THIS ROUTINE AND ╥┼┴─ IS THAT ╥┼┴─ CALLS
─╙┼╘╒╨ BEFORE TRYING TO READ THE SECTOR. ╘HIS ROUTINE ASSUMES
THAT THE DRIVE IS READY WITH TURBODOS RUNNING.
╞UNCTION ╬AME: ╥┼┬╧╧╘
╨URPOSE: ╥EBOOT ╟┼╧╙.
├ALL ADDRESS: $├000
┼RRORS: ╔F LOAD FAILS, SYSTEM RESETS TO ┬┴╙╔├.
─ESCRIPTION: ╘HIS ROUTINE IS NOT PART OF THE NORMAL ╟┼╧╙ ╦┼╥╬┴╠
JUMP TABLE. ╘HIS IS THE ROUTINE THAT IS SET UP AS THE ╬═╔
INTERRUPT (╥┼╙╘╧╥┼ KEY) BY ╟┼╧╙ WHEN ╟┼╧╙ RETURNS TO ┬┴╙╔├. ╔T
LOADS '╟┼╧╙ ┬╧╧╘', AND EXECUTES IT.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-49
╞UNCTION ╬AME: ╥┼═╧╓┼
╨URPOSE: ╥EMOVE A ╓╠╔╥ CHAIN.
├ALL ADDRESS: $├283
╔NPUT REQUIREMENTS:
$8496 ╓╠╔╥ CHAIN NUMBER.
╧UTPUT:
$8496 ─ECREMENTED IF GREATER THAN OR EQUAL TO $8497.
$8497 ─ECREMENTED BY 1.
╨REPARATORY ROUTINES: ╓╧╨┼╬
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HE CURRENT ╓╠╔╥ CHAIN IS REMOVED FROM THE ╓╠╔╥
SECTOR, AND ALL THE FOLLOWING CHAINS ARE MOVED DOWN ONE. ╘HE
SECTORS ASSOCIATED WITH THAT CHAIN ARE FREED UP.
╞UNCTION ╬AME: ╥┼╬┴═┼
╨URPOSE: ╥ENAME A FILE.
├ALL ADDRESS: $├259
╔NPUT REQUIREMENTS:
$02-$03 ╨OINTER TO NEW FILE NAME.
$0┼-$0╞ ╨OINTER TO OLD FILE NAME.
╧UTPUT:
$04 ╘RACK OF DIRECTORY SECTOR.
$05 ╙ECTOR OF DIRECTORY SECTOR.
$0├-$0─ ╨OINTER TO FILE NAME IN DIRECTORY ENTRY.
$8400-$841─ ├OPY OF OLD DIRECTORY ENTRY.
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE RENAMES A FILE BY CALLING ╠╧╧╦╒╨, THEN
COPYING THE NEW NAME INTO THE ENTRY. ╞INALLY, THE SECTOR IS
REWRITTEN TO THE DISK.
╞UNCTION ╬AME: ╥┼╙┼╘═
╨URPOSE: ╥ESET THE MOUSE.
├ALL ADDRESS: $├19├
─ESCRIPTION: ╘HE FLAG AT LOCATION $30 IS SET TO $00, AND THE
MOUSE SPRITE IS TURNED OFF. ╚OWEVER, SINCE BIT 7 OF LOCATION $30
IS NOT SET, THE NEXT INTERRUPT WILL TURN IT BACK ON.
╞UNCTION ╬AME: ╥┼╙╘╥╘
╨URPOSE: ╥ESTART ─┼╙╦╘╧╨.
├ALL ADDRESS: $├22├
─ESCRIPTION: ╘HIS ROUTINE LOADS ─┼╙╦╘╧╨ AND RUNS IT. ╔T IS CALLED
AS THE LAST PART OF THE BOOTUP PROCEDURE. ╘HIS IS WHERE A PROGRAM
SHOULD TERMINATE.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-50
╞UNCTION ╬AME: ╥╧╫┴─╥
╨URPOSE: ├OMPUTES THE ADDRESS OF A GIVEN ROW ON THE HIRES
SCREENS.
├ALL ADDRESS: $├13├
╔NPUT REQUIREMENTS:
╪ ╘HE ROW NUMBER.
$2╞ ╙EE DESCRIPTION.
╧UTPUT:
$0├-$0─ ╨OINTER TO THE ROW ON THE DESTINATION SCREEN.
$0┼-$0╞ ╨OINTER TO THE ROW ON THE SOURCE SCREEN.
─ESCRIPTION: ╘HIS ROUTINE COMPUTES THE ADDRESS OF COLUMN 0 ON A
GIVEN ROW OF THE HIRES SCREENS. ┴LL OF THE GRAPHICS ROUTINES RELY
ON THIS ROUTINE TO GET THE ADDRESS OF THE HIRES SCREENS. ╘HEY ALL
TAKE THE DATA POINTED TO BY $0┼-$0╞ AND STORE THEIR DATA TO BOTH
$0├-$0─ AND $0┼-$0╞. ╠OCATION $2╞ DETERMINES WHICH SCREEN IS
POINTED TO BY WHICH POINTER. ╘HIS IS AS FOLLOWS:
┬IT 7 ┬IT 6 $0├-$0─ $0┼-$0╞
0 0 $┴╞00 $┴╞00 ┴PPROXIMATELY THE
MIDDLE OF SCREEN 1
0 1 ╙CREEN 2 ╙CREEN 2
1 0 ╙CREEN 1 ╙CREEN 1
1 1 ╙CREEN 1 ╙CREEN 2 (─EFAULT AT RESET)
╞UNCTION ╬AME: ╥╒╬
╨URPOSE: ┼XECUTE A PROGRAM ALREADY IN MEMORY.
├ALL ADDRESS: $├22╞
╔NPUT REQUIREMENTS:
$02 ╞LAG BYTE.
$06-$07 ─ATA POINTER (OPTIONAL).
$08-$09 ─ATA POINTER (OPTIONAL).
$10-$11 ╙TART ADDRESS.
╧UTPUT:
$06-$07 ╨OINTER TO DRIVE NAME 2.
$08-$09 ╨OINTER TO DRIVE NAME 3.
─ESCRIPTION: ╘HIS ROUTINE PERFORMS SOME INITIALIZATIONS BEFORE
EXECUTING A LOADED PROGRAM. ╔F EITHER BIT 6 OR BIT 7 OF THE FLAG
BYTE AT LOCATION $02 IS SET, THEN THE DATA POINTED TO BY $06-$07
AND $08-$09 ARE COPIED INTO THE BUFFERS FOR THE 3RD AND 4TH DRIVE
NAMES. ╘HESE DATA BLOCKS ARE LIMITED TO 16 BYTES EACH. ╘HE
INITIALIZATION PROCESS SELECTS THE ┬╙╫ FONT AND INITIALIZES ALL
OF ╟┼╧╙'S GLOBAL VARIABLES.