home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
GEOSApps
/
GEOSTECHREF2.ARC
/
PAGE54-65
< prev
Wrap
Text File
|
2019-04-13
|
26KB
|
793 lines
╟┼╧╙ ╦ERNAL ╥OUTINES 1-51
╞UNCTION ╬AME: ╙┴╓┼
╨URPOSE: ╙AVE MEMORY TO A FILE.
├ALL ADDRESS: $├1┼─
╔NPUT REQUIREMENTS:
$14-$15 ╨OINTER TO INFORMATION SECTOR DATA.
$16 # DIRECTORY SECTORS TO SKIP FIRST.
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╘HIS ROUTINE WILL SAVE MEMORY TO A FILE; EACH SECTOR
IS VERIFIED AFTER THE WRITE IS FINISHED. ╘HE INFO SECTOR HAS ALL
THE NECESSARY INFORMATION. IE. START AND STOP ADDRESSES, FILE
TYPE AND STRUCTURE. ╔T MUST ALSO CONTAIN THE ADDRESS OF THE
FILENAME STRING SOMEWHERE IN MEMORY, IN THE FIRST TWO BYTES. ╔F
THE FILE IS A ╓╠╔╥ FILE, THE MEMORY IS SAVED TO CHAIN 0. ╠OCATION
$16 SPECIFIES THE NUMBER OF DIRECTORY SECTORS TO SKIP FOR ─╔╥─╙╦
AND ╚╧╠┼.
╞UNCTION ╬AME: ╙┴╓┼2
╨URPOSE: ╙AVE MEMORY TO SPECIFIED SECTORS ON THE DISK.
├ALL ADDRESS: $├1╞9
╔NPUT REQUIREMENTS:
$0┼-$0╞ ╨OINTER TO LIST OF TRACKS AND SECTORS TO USE.
$10-$11 ╙TART ADDRESS OF MEMORY TO BE SAVED.
╨REPARATORY ROUTINES: ╞┴╠╠╧├
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╘HIS ROUTINE IS CALLED BY ╙┴╓┼ TO ACTUALLY SAVE THE
MEMORY. ┴LL OF THE SECTORS SHOULD HAVE ALREADY BEEN ALLOCATED.
╘HIS ROUTINE STOPS SAVING MEMORY WHEN TRACK 0 IS FOUND IN THE
LIST OF TRACKS AND SECTORS.
╞UNCTION ╬AME: ╙─1616
╨URPOSE: ╙IGNED 16 BIT BY 16 BIT DIVISION.
├ALL ADDRESS: $├16├
╔NPUT REQUIREMENTS:
┘ ╘HE ADDRESS OF THE 16 BIT DIVISOR.
╪ ╘HE ADDRESS OF THE 16 BIT DIVIDEND.
╧UTPUT:
╪ ╘HE ADDRESS OF THE 16 BIT QUOTIENT.
$12-$13 ╘HE 16 BIT REMAINDER.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪ AND
┘ EACH HAVE THE ADDRESS OF A TERM IN THE DIVISION. ┬OTH TERMS ARE
MADE POSITIVE WITH ┴┬╙16. ╒─1616 IS THEN CALLED; IF THE RESULT OF
THE DIVISION SHOULD BE NEGATIVE, ╬┼╟16 IS CALLED. ╘HE QUOTIENT IS
STORED IN PLACE OF THE ORIGINAL DIVIDEND THAT ╪ POINTED TO. ╘HE
DIVIDEND IS LEFT UNTOUCHED. ╘HE REMAINDER IS ALWAYS A POSITIVE
INTEGER.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-52
╞UNCTION ╬AME: ╙┼╠┬╙╫
╨URPOSE: ╙ELECTS THE ┬ERKELEY ╙OFTWORKS FONT.
├ALL ADDRESS: $├14┬
╧UTPUT:
$26 # PIXELS ABOVE LINE OF PRINT.
$27-$28 ╘HE NUMBER OF BYTES IN THE BIT STREAM.
$29 ╘HE POINT SIZE.
$2┴-$2┬ ╘HE POINTER TO THE TABLE OF INDICES INTO THE BIT
STREAM.
$2├-$2─ ╘HE POINTER TO THE BIT STREAM.
─ESCRIPTION: ╘HIS ROUTINE SIMPLY COPIES THE FONT HEADER DATA FOR
THE ┬╙╫ FONT TO ZERO PAGE FOR USE BY ─╙╨├╚╥ AND ─╙╨╘╪╘.
╞UNCTION ╬AME: ╙┼╘╨┴╘
╨URPOSE: ╙ETS THE CURRENT FILL PATTERN.
├ALL ADDRESS: $├139
╔NPUT REQUIREMENTS:
┴ ╘HE PATTERN NUMBER (0-31).
─ESCRIPTION: ╘HIS ROUTINE SETS THE FILL PATTERN USED BY ╨╞╔╠╠,
╨╞╔╠╠2, ╨┬╧╪ AND ╨┬╧╪2.
╞UNCTION ╬AME: ╙╨╥╧╞╞
╨URPOSE: ╘URNS OFF A SPRITE.
├ALL ADDRESS: $├1─5
╔NPUT REQUIREMENTS:
$08 ╙PRITE NUMBER (0-7).
╨REPARATORY ROUTINES: ├╧╨┘╙╨, ╨╧╙╙╨╥, ╙╨╥╧╬
─ESCRIPTION: ╘HIS ROUTINE TURNS THE SPRITE OFF, SO THAT IT IS NO
LONGER VISIBLE.
╞UNCTION ╬AME: ╙╨╥╧╬
╨URPOSE: ╘URNS ON A SPRITE.
├ALL ADDRESS: $├1─2
╔NPUT REQUIREMENTS:
$08 ╙PRITE NUMBER (0-7).
╨REPARATORY ROUTINES: ├╧╨┘╙╨, ╨╧╙╙╨╥
─ESCRIPTION: ╘HIS ROUTINE TURNS THE SPRITE ON, SO THAT IT IS
VISIBLE.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-53
╞UNCTION ╬AME: ╙╘┴╥╘
╨URPOSE: ╥ESTARTS THE TIMER ON A TIMED EVENT.
├ALL ADDRESS: $├115
╔NPUT REQUIREMENTS:
╪ ╘HE INDEX INTO THE COMMAND TABLE AT $8719.
╨REPARATORY ROUTINES: ├═─╘┬╠
─ESCRIPTION: ╘HIS ROUTINE RESETS BIT 5 OF A SPECIFIC COMMAND BYTE
IN THE TABLE AT $8719. ╘HIS ENABLES THE ASSOCIATED COUNTER. ╘HIS
ROUTINE IS THE COMPLEMENT TO ╙╘╧╨. ╘HIS ROUTINE IS ╬╧╘ A
REPLACEMENT FOR ┼╬┴┬╠┼. ╘HIS ROUTINE DOES NOT COPY THE TIMER'S
INITIAL VALUE AS DOES ┼╬┴┬╠┼.
╞UNCTION ╬AME: ╙╘╧╨
╨URPOSE: ╙TOPS THE TIMER ON A TIMED EVENT.
├ALL ADDRESS: $├112
╔NPUT REQUIREMENTS:
╪ ╘HE INDEX INTO THE COMMAND TABLE AT $8719.
╨REPARATORY ROUTINES: ├═─╘┬╠
─ESCRIPTION: ╘HIS ROUTINE SETS BIT 5 OF A SPECIFIC COMMAND BYTE
IN THE TABLE AT $8719. ╘HIS PREVENTS THE ASSOCIATED TIMER FROM
RUNNING. ╘HIS ROUTINE IS THE COMPLEMENT TO ╙╘┴╥╘.
╞UNCTION ╬AME: ╙╘╥├═╨
╨URPOSE: ├OMPARE TWO STRINGS FOR EQUALITY.
├ALL ADDRESS: $├26┬
╔NPUT REQUIREMENTS:
╪ ┴DDRESS OF A ZERO PAGE POINTER.
┘ ┴DDRESS OF A ZERO PAGE POINTER.
╧UTPUT:
┌ FLAG ╙ET ACCORDINGLY.
─ESCRIPTION: ╘HE ╪ AND ┘ REGISTERS POINT TO ZERO PAGE POINTERS.
╘HE TWO STRINGS ARE COMPARED UP TO A ZERO BYTE. ╘HE ┌ FLAG IS SET
ACCORDINGLY.
╞UNCTION ╬AME: ╙╘╥├╨┘
╨URPOSE: ├OPY A STRING.
├ALL ADDRESS: $├265
╔NPUT REQUIREMENTS:
╪ ┴DDRESS OF ZERO PAGE SOURCE POINTER.
┘ ┴DDRESS OF ZERO PAGE DESTINATION POINTER.
─ESCRIPTION: ╘HE ╪ AND ┘ REGISTERS POINT TO ZERO PAGE POINTERS.
─ATA IS COPIED UP TO AND INCLUDING A ZERO BYTE. ╘HIS ROUTINE IS
USED TO COPY STRINGS BY SETTING ┴ TO ZERO AND CALLING ┬╠╦═╧╓.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-54
╞UNCTION ╬AME: ╙┘╙┼╥╥
╨URPOSE: ─RAW A SYSTEM ERROR WINDOW, AND HALT SYSTEM.
├ALL ADDRESS: $├2├2
─ESCRIPTION: ┴ WINDOW IS DRAWN WITH THE MESSAGE '╙YSTEM ERROR
NEAR $XXXX', WHERE XXXX IS THE HEX ADDRESS OF THE ╩╙╥ ╙┘╙┼╥╥
INSTRUCTION. ╙INCE THE SYSTEM ERROR WINDOW HAS NO WAY OF BEING
CLOSED, ╟┼╧╙ SIMPLY SITS IN ITS MAIN LOOP FOREVER. ╘HE ┬╥╦ VECTOR
AT $84┴╞-$84┬0 IS INITIALLY SET TO THIS ROUTINE.
╞UNCTION ╬AME: ╘┴┬╠┼
╨URPOSE: ├REATE A LIST OF FILENAMES.
├ALL ADDRESS: $├23┬
╔NPUT REQUIREMENTS:
$0┼-$0╞ ╨OINTER TO BUFFER AREA FOR FILE NAMES.
$10 ╟┼╧╙ FILE TYPE.
$11 ═AXIMUM NUMBER OF FILE NAMES.
$16-$17 ╨OINTER TO CLASS.
╧UTPUT:
$11 ╬UMBER OF FILES NOT FOUND.
╘HE TABLE IS FILLED WITH FILENAMES.
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS IS A VERY USEFUL ROUTINE. ╟IVEN A ╟┼╧╙ FILE
TYPE, A LIST OF FILES WITH THAT TYPE IS CREATED. ╔F THE CLASS
POINTER IS NON-ZERO THEN EACH FILE'S INFO SECTOR IS CHECKED FOR
PROPER CLASS. ╘HIS IS HOW ╟┼╧PAINT AND ╟┼╧WRITE CAN BOTH CREATE
┴PPLICATION ─ATA FILES AND NOT SEE EACH OTHERS FILES. ╘HE
FILENAMES ARE TEXT STRINGS WITH ZERO BYTE TERMINATORS. ┼ACH ENTRY
IS INDEXED WITH A MULTIPLE OF 17 (16 BYTE FILENAME MAX. PLUS ZERO
BYTE). ╠OCATION $11 HAS THE NUMBER OF TABLE ENTRIES NOT FILLED.
╘O GET THE NUMBER OF FILES ACTUALLY FOUND, THIS VALUE MUST BE
SUBTRACTED FROM THE ORIGINAL MAXIMUM BUFFER LENGTH.
╞UNCTION ╬AME: ╘┬╠╩═╨
╨URPOSE: ╩UMP THROUGH A TABLE.
├ALL ADDRESS: $├2┴4
╔NPUT REQUIREMENTS:
┴ ╧FFSET INTO TABLE.
$3─-$3┼ ╘ABLE ADDRESS.
─ESCRIPTION: ╘HIS ROUTINE IS CALLED BY ALL OF THE ROUTINES THAT
HAVE INLINE DATA. ╘HEY ALL SET $3─-$3┼ TO THE RETURN ADDRESS OF
THE CALLER, INDEX OFF OF THIS POINTER TO GET THEIR DATA, THEN
CALL THE APPROPRIATE ROUTINE. ╫HEN THE ROUTINE FINISHES, ┴ IS
LOADED WITH THE DATA TABLE'S LENGTH AND THIS ROUTINE IS CALLED TO
RETURN CONTROL TO THE CALLER AFTER THE DATA TABLE.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-55
╞UNCTION ╬AME: ╘┼╙╘
╨URPOSE: ╘ESTS THE VALUE OF A POINT ON THE HIRES SCREEN.
├ALL ADDRESS: $├13╞
╔NPUT REQUIREMENTS:
$08-$09 ╘HE COLUMN NUMBER.
$18 ╘HE ROW NUMBER.
╧UTPUT:
├ FLAG IS SET TO THE VALUE OF THE PIXEL.
─ESCRIPTION: ╘ESTS WHETHER OR NOT A GIVEN PIXEL IS ON OR NOT. ╘HE
CARRY FLAG IS SET TO THE VALUE OF THE PIXEL.
╞UNCTION ╬AME: ╘╥┴├┼
╨URPOSE: ├REATE A TABLE OF TRACKS AND SECTORS.
├ALL ADDRESS: $├205
╔NPUT REQUIREMENTS:
$04 ╔NITIAL TRACK NUMBER.
$05 ╔NITIAL SECTOR NUMBER.
$08-$09 ┴DDRESS OF TABLE TO BE CREATED.
╧UTPUT:
╘ABLE POINTED TO BY $08-$09 IS FILLED WITH ALL THE TRACKS
AND SECTORS LINKED TO THE INITIAL SECTOR.
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╟IVEN AN INITIAL TRACK AND SECTOR, THIS ROUTINE
TRACES A CHAIN AND RETURNS A LIST OF ALL THE TRACKS AND SECTORS
ENCOUNTERED. ╘HIS ROUTINE USES THE BUFFER AT $8000-$80╞╞ TO READ
THE SECTORS.
╞UNCTION ╬AME: ╒─1616
╨URPOSE: ╒NSIGNED 16 BIT BY 16 BIT DIVISION.
├ALL ADDRESS: $├169
╔NPUT REQUIREMENTS:
┘ ╘HE ADDRESS OF THE 16 BIT DIVISOR.
╪ ╘HE ADDRESS OF THE 16 BIT DIVIDEND.
╧UTPUT:
╪ ╘HE ADDRESS OF THE 16 BIT QUOTIENT.
$12-$13 ╘HE 16 BIT REMAINDER.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪ AND
┘ EACH HAVE THE ADDRESS OF A TERM IN THE DIVISION. ╘HE QUOTIENT
IS STORED IN PLACE OF THE ORIGINAL DIVIDEND THAT ╪ POINTED TO.
╘HE DIVIDEND IS LEFT UNTOUCHED.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-56
╞UNCTION ╬AME: ╒═1616
╨URPOSE: ╒NSIGNED 16 BIT BY 16 BIT MULTIPLY.
├ALL ADDRESS: $├166
╔NPUT REQUIREMENTS:
┘ ╘HE ADDRESS OF THE 16 BIT MULTIPLIER.
╪ ╘HE ADDRESS OF THE 16 BIT MULTIPLICAND.
╧UTPUT:
╪ ╘HE ADDRESS OF THE 16 BIT RESULT.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪ AND
┘ EACH HAVE THE ADDRESS OF A TERM IN THE MULTIPLICATION. ╘HE
RESULT IS STORED IN PLACE OF THE ORIGINAL MULTIPLICAND THAT ╪
POINTED TO. ╘HE MULTIPLIER POINTED TO BY ┘ IS UNTOUCHED.
╞UNCTION ╬AME: ╒═168
╨URPOSE: ╒NSIGNED 8 BIT BY 16 BIT MULTIPLY.
├ALL ADDRESS: $├163
╔NPUT REQUIREMENTS:
┘ ╘HE ADDRESS OF THE 8 BIT MULTIPLIER.
╪ ╘HE ADDRESS OF THE 16 BIT MULTIPLICAND.
╧UTPUT:
╪ ╘HE ADDRESS OF THE 16 BIT PRODUCT.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪ AND
┘ EACH HAVE THE ADDRESS OF A TERM IN THE MULTIPLICATION. ╘HE
RESULT IS STORED IN PLACE OF THE ORIGINAL MULTIPLICAND THAT ╪
POINTED TO. ╘HE BYTE FOLLOWING THE MULTIPLIER IS SET TO ZERO,
THEN CONTROL PASSES TO ╒═1616.
╞UNCTION ╬AME: ╒═╒╠88
╨URPOSE: ╒NSIGNED 8 BIT BY 8 BIT MULTIPLY.
├ALL ADDRESS: $├160
╔NPUT REQUIREMENTS:
┘ ╘HE ADDRESS OF THE MULTIPLIER.
╪ ╘HE ADDRESS OF THE MULTIPLICAND.
╧UTPUT:
╪ ╘HE ADDRESS OF THE 16 BIT PRODUCT.
─ESCRIPTION: ╘HIS ROUTINE IS ONE OF THE ╟┼╧╙ MATH ROUTINES. ╪ AND
┘ EACH HAVE THE ADDRESS OF A TERM IN THE MULTIPLICATION. ╘HE
RESULT IS STORED IN PLACE OF THE ORIGINAL MULTIPLICAND THAT ╪
POINTED TO. ╘HE VALUE THAT ┘ POINTS TO IS LEFT UNTOUCHED.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-57
╞UNCTION ╬AME: ╒╨─┴╘┼
╨URPOSE: ╒PDATE A ╓╠╔╥ FILE.
├ALL ADDRESS: $├295
╧UTPUT:
$8498 ├LEARED TO $00.
╨REPARATORY ROUTINES: ╓╧╨┼╬
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE WRITES THE OPEN ╓╠╔╥ FILE'S ╓╠╔╥ SECTOR
TO DISK AND UPDATES THE FILE'S DIRECTORY ENTRY ON DISK (╘IME,
DATE AND FILE SIZE). ╘HIS OPERATION IS NOT PERFORMED IF LOCATION
$8498 IS ZERO TO START WITH. ╘HAT LOCATION IS A FLAG THAT TELLS
WHETHER THE FILE HAS BEEN ALTERED OR NOT. ╘HIS ROUTINE IS CALLED
BY ╓├╠╧╙┼.
╞UNCTION ╬AME: ╓├╠╧╙┼
╨URPOSE: ├LOSE A ╓╠╔╥ FILE.
├ALL ADDRESS: $├277
╧UTPUT:
$8873 ├LEARED TO $00.
╨REPARATORY ROUTINES: ╓╧╨┼╬
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HE ╓╠╔╥ SECTOR IS REWRITTEN TO THE DISK AND THE
DIRECTORY IS UPDATED WITH A NEW TIME, DATE AND FILE SIZE BY
CALLING ╒╨─┴╘┼. ╠OCATION $8873 IS THE TRACK NUMBER OF THE ╓╠╔╥
SECTOR. ┬Y CLEARING IT, ╟┼╧╙ SAYS THAT THE FILE IS NO LONGER IN
MEMORY.
╞UNCTION ╬AME: ╓╠╔╬┼
╨URPOSE: ─RAWS A VERTICAL LINE ON THE SCREEN.
├ALL ADDRESS: $├121
╔NPUT REQUIREMENTS:
┴ ╘HE ACTUAL BIT PATTERN FOR THE LINE.
$08 ╘HE TOP MARGIN.
$09 ╘HE BOTTOM MARGIN.
$0┴-$0┬ ╘HE RIGHT MARGIN.
─ESCRIPTION: ╘HIS ROUTINE DRAWS A VERTICAL LINE ON THE HIRES
SCREEN IN A GIVEN PATTERN. ╙EE ALSO ╥╧╫┴─╥.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-58
╞UNCTION ╬AME: ╓╠╧┴─
╨URPOSE: ╠OAD A ╓╠╔╥ CHAIN.
├ALL ADDRESS: $├28├
╔NPUT REQUIREMENTS:
$06-$07 ═AXIMUM BYTE COUNT OF LOAD.
$10-$11 ╠OAD ADDRESS.
$8496 ├URRENT CHAIN NUMBER.
╧UTPUT:
$8302-$83╞╞ ╘ABLE OF TRACKS AND SECTORS THAT WERE LOADED.
╨REPARATORY ROUTINES: ╓╧╨┼╬
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE LOADS THE CURRENT CHAIN BY CALLING
╠├╚┴╔╬.
╞UNCTION ╬AME: ╓╧╨┼╬
╨URPOSE: ╧PENS A ╓╠╔╥ FILE.
├ALL ADDRESS: $├274
╔NPUT REQUIREMENTS:
$02-$03 ╨OINTER TO FILE NAME.
╧UTPUT:
$04 ╘RACK OF ╓╠╔╥ SECTOR.
$05 ╙ECTOR OF ╓╠╔╥ SECTOR.
$0├-$0─ ╨OINTER TO FILE'S DIRECTORY ENTRY.
$8100-$81╞╞ ╞ILE'S ╓╠╔╥ SECTOR.
$8496 ╔NITIAL CHAIN # (╙HOULD BE 0).
$8497 ╬UMBER OF CHAINS.
$8498 ├LEARED TO $00. (╓╠╔╥ FILE MODIFIED).
$8499-$849┴ ╞ILE SIZE.
$886╞ ╘RACK OF FILE'S DIRECTORY ENTRY.
$8870 ╙ECTOR OF FILE'S DIRECTORY ENTRY.
$8871-$8872 ╨OINTER TO DIRECTORY ENTRY.
$8873 ╘RACK FOR ╓╠╔╥ SECTOR.
$8874 ╙ECTOR FOR ╓╠╔╥ SECTOR.
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE OPENS A ╓╠╔╥ FILE, AND SETS UP ALL THE
VARIABLES ASSOCIATED WITH IT. ╧NLY ONE ╓╠╔╥ FILE CAN BE OPEN AT A
TIME DUE TO THE FACT THAT THESE VARIABLES ARE GLOBAL.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-59
╞UNCTION ╬AME: ╓╙┴╓┼
╨URPOSE: ╙AVE MEMORY TO A ╓╠╔╥ CHAIN.
├ALL ADDRESS: $├28╞
╔NPUT REQUIREMENTS:
$06-$07 ╠ENGTH OF SAVE.
$10-$11 ┴DDRESS OF MEMORY TO BE SAVED.
$8496 ╓╠╔╥ CHAIN NUMBER.
╧UTPUT:
$8300-$83╞╞ ╘ABLE OF TRACKS AND SECTORS THAT WERE SAVED TO.
╨REPARATORY ROUTINES: ╓╧╨┼╬
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE SAVES A BLOCK OF MEMORY TO A ╓╠╔╥
CHAIN. ╔F THE CHAIN ALREADY EXISTED, THEN IT IS DELETED FIRST. ╔F
THE LENGTH OF THE SAVE IS 0, THEN NO SAVE IS PERFORMED. ╘HIS
WOULD ALLOW THIS ROUTINE TO BE USED AS A DELETE CHAIN FUNCTION.
╞UNCTION ╬AME: ╫╚┴╘╔╙
╨URPOSE: ╫HO KNOWS?
├ALL ADDRESS: $├196
╧UTPUT:
$02-$03 ╓ALUE FROM $9╞27-$9╞28 ($3┼66).
─ESCRIPTION: ╘HIS ROUTINE SEEMS TO HAVE ABSOLUTELY NO PURPOSE. ╔T
COPIES A VECTOR FROM $9╞27-$9╞28 ($3┼66) TO $02-$03. ╠OCATIONS
$9╞27 AND $9╞28 ARE CHECKED BY ANOTHER ROUTINE AT BOOTUP. ╔F IT
IS ZERO THEN THE FIRST ╓╠╔╥ CHAIN OF THE KERNAL ($9000-$9╞╞╞) IS
REWRITTEN TO THE DISK. ╘HIS MAY BE A REMNANT OF THE ╟┼╧╙
DEVELOPMENT ENVIRONMENT OR IT MAY BE SOME KIND OF KERNAL VERSION
NUMBER. ╘HE CODE LOOKS LIKE THIS:
╠─┴ $9╞28
╙╘┴ $03
╠─┴ $9╞27
╙╘┴ $02
╥╘╙
╟┼╧╙ ╦ERNAL ╥OUTINES 1-60
╞UNCTION ╬AME: ╫╔╬─╧╫
╨URPOSE: ╨ROCESS A WINDOW DESCRIPTOR.
├ALL ADDRESS: $├256
╔NPUT REQUIREMENTS:
$02-$03 ╨OINTER TO WINDOW DESCRIPTOR.
╧UTPUT:
$02 ╫INDOW COMMAND THAT CLOSED THE WINDOW.
$851─ ╫INDOW COMMAND THAT CLOSED THE WINDOW.
─ESCRIPTION: ╠IKE ═┼╬╒, THIS IS ANOTHER VERY POWERFUL ROUTINE.
╟IVEN A DESCRIPTION OF THE WINDOW'S COMMANDS, EVERYTHING GETS
HANDLED. ╘HE FORMAT OF THE WINDOW DESCRIPTOR IS AS FOLLOWS:
.┬┘╘┼ ╫INDOW TYPE.
┬IT 7 ╫INDOW SIZE FOLLOWS; OTHERWISE, USE
STANDARD WINDOW SIZE ROWS 40 TO 135,
COLUMNS 72 TO 263.
┬ITS 0-4 ╞ILL PATTERN FOR SHADOW. ╔F ZERO, THEN
NO SHADOW IS DRAWN.
╘HE FOLLOWING SIX BYTES ARE ONLY PRESENT IF BIT 7 OF THE
WINDOW TYPE IS SET.
.┬┘╘┼ ╘OP MARGIN.
.┬┘╘┼ ┬OTTOM MARGIN.
.╫╧╥─ ╠EFT MARGIN.
.╫╧╥─ ╥IGHT MARGIN.
.┬┘╘┼ ├OMMAND BYTES FOLLOWED BY WHATEVER DATA IS NEEDED.
┴LL THE CLICK BOX DESCRIPTORS ARE STORED IN A TABLE AT $880├, FOR
╟┼╧╙ TO PROCESS THEM. ╘HIS LIMITS THE NUMBER OF CLICK BOXES IN A
WINDOW TO 8. ╙EVERAL MEMORY LOCATIONS ARE SAVED PRIOR TO
PROCESSING THE WINDOW; ALSO THE STACK POINTER AND RETURN ADDRESS
ARE SAVED. ┴FTER THE WINDOW IS DRAWN, CONTROL PASSES BACK TO
═┴╔╬. ├╠╙╫╔╬ MUST BE CALLED TO RETURN TO THE CALLER. ╘HEREFORE IT
IS ESSENTIAL THAT SOME MEANS OF CLOSING A WINDOW EXISTS,
OTHERWISE A SITUATION LIKE ╙┘╙┼╥╥ WILL OCCUR (╙EE THE ╙┘╙┼╥╥
ROUTINE FOR MORE INFO).
╘HE COMMAND THAT CLOSES THE WINDOW IS THE VALUE RETURNED TO
THE USER. IE. IF A CLICK BOX CLOSES THE WINDOW THEN THE COMMAND
NUMBER THAT DREW THE CLICK BOX IS RETURNED. ╚OWEVER IT IS THE
USER'S ROUTINE'S RESPONSIBILITY TO SET THE VALUE OF LOCATION
$851─ IF A USER CLICK BOX IS TO CLOSE THE WINDOW. ├OMMAND #13 IS
ANOTHER ONE THAT CAN CLOSE THE WINDOW. ╒SER ROUTINES DO NOT HAVE
TO CLOSE THE WINDOW BUT THEY MAY IF THEY SO DESIRE.
╘HE FOLLOWING IS A LIST OF THE MEMORY ADDRESSES STORED BY
THE WINDOW PROCESSOR:
$22-$38 $849┬-$84├0 $86├0-$87─3 $8╞╞8-$8╞╞╞
$3╞-$40 $─000-$─010 $─01┬-$─01─ $─025-$─026
$─015 $─028-$─02┼
╟┼╧╙ ╦ERNAL ╥OUTINES 1-61
╫INDOW ╨ROCESSOR ├OMMANDS
0 ╬O DATA. ╘HIS COMMAND ENDS THE WINDOW DESCRIPTOR.
1 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN BYTES AND
THE ROW OFFSET IN PIXELS. ─RAW AN '╧╦' CLICK BOX.
2 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN BYTES AND
THE ROW OFFSET IN PIXELS. ─RAW A '├ANCEL' CLICK BOX.
3 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN BYTES AND
THE ROW OFFSET IN PIXELS. ─RAW A '┘ES' CLICK BOX.
4 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN BYTES AND
THE ROW OFFSET IN PIXELS. ─RAW A '╬O' CLICK BOX.
5 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN BYTES AND
THE ROW OFFSET IN PIXELS. ─RAW AN '╧PEN' CLICK BOX.
6 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN BYTES AND
THE ROW OFFSET IN PIXELS. ─RAW A '─ISK' CLICK BOX.
7-10 ┴RE UNDEFINED COMMANDS.
11 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN PIXELS,
THE ROW OFFSET IN PIXELS, AND THE ADDRESS OF A TEXT STRING.
╘HIS COMMAND DISPLAYS THE TEXT STRING AT THE SPECIFIED
OFFSET IN THE WINDOW.
12 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN PIXELS,
THE ROW OFFSET IN PIXELS AND ZERO PAGE ADDRESS OF THE
ADDRESS OF A TEXT STRING. ╘HIS COMMAND IS SIMILAR TO COMMAND
11, EXCEPT FOR ITS METHOD OF ADDRESSING THE STRING.
13 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN PIXELS,
THE ROW OFFSET IN PIXELS, ZERO PAGE ADDRESS OF THE ADDRESS
OF THE TEXT BUFFER TO BE USED BY ╔╬╨╒╘ AND THE MAXIMUM
LENGTH OF THE INPUT BUFFER. ╙EE ╔╬╨╒╘ FOR MORE INFORMATION.
14 ╙ET THE VECTOR AT $84┴9-$84┴┴ TO CLOSE THE WINDOW. ╟ENERALLY
USED WITH COMMAND 13.
15 ╘HE DATA FOR THIS COMMAND IS THE ADDRESS OF A ╟╥╨╚╔├ COMMAND
TABLE. ╙EE ╟╥╨╚╔├ FOR FURTHER INFORMATION.
16 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN PIXELS AND
THE ROW OFFSET IN PIXELS. ╘HIS COMMAND OPENS A SCROLLING
WINDOW OF FILENAMES. ╠OCATIONS $10 AND $16-$17 MUST BE SET
PRIOR TO CALLING ╫╔╬─╧╫ (╙EE ╘┴┬╠┼ FOR MORE INFORMATION).
╘HE FILENAMES ARE STORED AT $8300-$83╞╞, TO A MAXIMUM OF 15
FILENAMES. ╠OCATION $885├ WILL RETURN THE INDEX OF THE
SELECTED FILE NAME. ╔F MORE THAN 6 FILES ARE FOUND, THE
SUBWINDOW WILL HAVE A CLICK BOX FOR SCROLLING THE LIST.
17 ╘HE DATA FOR THIS COMMAND IS THE ADDRESS OF THE ROUTINE FOR
BUTTON PRESSED. ╘HIS COMMAND SETS THE VECTOR AT $84┴9-$84┴┴
TO A USER SPECIFIED ROUTINE.
18 ╘HE DATA FOR THIS COMMAND IS THE COLUMN OFFSET IN BYTES, THE
ROW OFFSET IN PIXELS AND THE ADDRESS OF A USER'S 8 BYTE
CLICK BOX DESCRIPTION, IN THE FOLLOWING FORMAT:
#BYTES ─ESCRIPTION
2 ┴DDRESS OF GRAPHIC DATA.
2 ╬OT USED.
1 ╫IDTH OF BOX IN BYTES.
1 ╚EIGHT OF BOX IN PIXELS.
2 ┴DDRESS OF ROUTINE TO PROCESS THIS BOX.
19 ╘HE DATA FOR THIS COMMAND IS THE ADDRESS OF A USER
SUBROUTINE. ╘HIS COMMAND CALLS THE USER'S SUBROUTINE.
╟┼╧╙ ╦ERNAL ╥OUTINES 1-62
╞UNCTION ╬AME: ╫╥180
╨URPOSE: ╫RITE TRACK 18 SECTOR 0 BACK TO DISK.
├ALL ADDRESS: $├24┴
╔NPUT REQUIREMENTS:
$8200-$82╞╞ ─ATA FOR TRACK 18 SECTOR 0.
╧UTPUT:
$04 $12, TRACK NUMBER.
$05 $00, SECTOR NUMBER.
$0┴-$0┬ $8200, ADDRESS OF BUFFER AREA.
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE SETS UP THE POINTERS FOR ╫╥╔╘┼, THEN
CALLS IT TO WRITE THE SECTOR. ╘HIS IS GENERALLY USED TO UPDATE
THE ┬┴═ ON THE DISK.
╞UNCTION ╬AME: ╫╥╔╘┼
╨URPOSE: ╫RITE A GIVEN TRACK AND SECTOR.
├ALL ADDRESS: $├1┼7
╔NPUT REQUIREMENTS:
$04 ╘RACK OF SECTOR TO BE WRITTEN.
$05 ╙ECTOR NUMBER TO BE WRITTEN.
$0┴-$0┬ ╨OINTER TO BUFFER.
┼RRORS: ╙EE ┴PPENDIX
─ESCRIPTION: ╠OADS TURBODOS IF IT IS NOT ALREADY THERE BY CALLING
─╙┼╘╒╨. ╘HE DESIRED BLOCK IS THEN WRITTEN TO THE DISK BY CALLING
╫╥╔╘┼2. ╞INALLY ├╫╥╔╘┼ IS CALLED TO VERIFY THE SECTOR.
╞UNCTION ╬AME: ╫╥╔╘┼2
╨URPOSE: ╫RITE A SECTOR TO THE DISK.
├ALL ADDRESS: $├220
╔NPUT REQUIREMENTS:
$04 ╘RACK NUMBER.
$05 ╙ECTOR NUMBER.
$0┴-$0┬ ╨OINTER TO DATA BUFFER.
╨REPARATORY ROUTINES: ─╙┼╘╒╨
┼RRORS: ╙EE ┴PPENDIX ╔.
─ESCRIPTION: ╘HIS ROUTINE IS TO ╫╥╔╘┼, AS ╥┼┴─2 IS TO ╥┼┴─.
─╙┼╘╒╨ MUST HAVE BEEN CALLED PRIOR TO USING THIS ROUTINE.
╞UNCTION ╬AME: ┌╞╔╠╠
╨URPOSE: ╞ILLS A MEMORY REGION WITH ZEROES.
├ALL ADDRESS: $├178
╔NPUT REQUIREMENTS:
$02-$03 ╘HE LENGTH OF THE REGION.
$04-$05 ╘HE ADDRESS OF THE REGION.
─ESCRIPTION: ═EMORY IS FILLED WITH ZEROES BY STORING A $00 AT
LOCATION $06 AND CALLING ┬╠╦╞╔╠.