home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / MRFiles / GS1DVPAK.ARC / GSDEVPAK2 (.txt) < prev    next >
Encoding:
GEOS ConVerT  |  2019-04-13  |  39.3 KB  |  647 lines

  1. %gsdevpak2
  2. PRG formatted GEOS file V1.0
  3. CONVERTED WITH GEOSHELL V2.2
  4. Write Image V2.1
  5. geoWrite    V2.1
  6. TGrab128 Data2.2
  7. Please Select Option:
  8. new document
  9. existing document
  10. to deskTop
  11. File exists
  12. @SECTION 2
  13. This section of the manual contains information about each of the routines that are accessible in geoSHELL from it's jump table. It is laid out in a manner that should be familiar to those of you who have either the Official GEOS Programmer's Reference Manaul by Bantam Books or The Hitchhiker's Guide To GEOS by Berkeley Softworks.
  14. In some of the source code examples that are given, you might see references to a jump to another routine. Some of these might refer to other routines or error routines that you would create somewhere in your own source code. Hopefully, it is understandable which routines are geoSHELL routines and which are not.
  15. Whenever you access any of the geoSHELL routines, be sure that you are doing it from a mode that is allowed. For instance, if you have called the GEOS kernal routine InitForIO, you can't call a geoSHELL routine that also does so. Likewise, some geoSHELL routines require that you call InitForIO first. If you don't, this could be the source of a serious crash or lockup. Read the description about the routine thoroughly before using it. You might also want to refer to the index to find other parts of this manual that might have information about a particular routine.
  16. @AdjTxtPointer
  17. Function:    Used with DispText to advance r0 within a text buffer.
  18. Pass:    textpointer - any value 0-255 (normally set by DispText).
  19. Return:    r0 - holding n
  20. @AdjTxtPointer
  21. Function:    Used with DispText to advance r0 within a text buffer.
  22. Pass:    textpointer - any value 0-255 (normally set by DispText).
  23. Return:    r0 - holding new value.
  24. Destroys:    a
  25. Description:    When using DispText to display text to a line of the geoSHELL window, r0 will still be pointing at the text and the variable textpointer will hold a value that if added to r0 will then point r0 at the next segment of text that should be displayed. Calling this routine will add that value to r0.
  26. Example:    See the entry for DispText for an example on how to use this routine.
  27. See Also:    DispText, Message, OtherMessage, DsplyLine, DsplyString, CarrReturn, ClearLine, ClearBoth, ClearRemainder, StripRulers, set_XY_pos, save_XY_pos, MskCtrlCodes, ConvToAscii, CkESC_RULER
  28. @Asc_3_Byte
  29. Function:    Convert an ascii number (0-255) to a single byte.
  30. Pass:    r0 - pointer to a 1,2 or 3 digit ascii number.
  31. Return:    r5L - 
  32. @Asc_3_Byte
  33. Function:    Convert an ascii number (0-255) to a single byte.
  34. Pass:    r0 - pointer to a 1,2 or 3 digit ascii number.
  35. Return:    r5L - contains the byte.
  36.     a - contains the byte.
  37.     goodflag - set if value is allowed.
  38.     r0 - unchanged.
  39. Destroys:    a, x, y, r5L, r8L
  40. Description:    Point r0 at an ascii representation of a byte from 0-255 and call this routine to convert it to a single byte that will be placed in r5L. If r0 was pointing to something that did not represent a number between 0 and 255, then the routine will exit through nogood. Always check goodflag before proceeding any further. The number should also end with either a space or some sort of terminator such as an up-arrow, or a null byte. When the user types in a number such as a parameter after your command, ParamTable will be loaded with this number. You could then point r0 at ParamTable and call this routine.
  41. Example:
  42. ;this example will get the number the user types in and then
  43. ;locate a requested font file that was typed after the
  44. ;number on the current drive.
  45.     ...        ;some of your code.
  46.     LoadW    r0,#ParamTable    ;point at the first parameter.
  47.     jsr    Asc_3_Byte    ;convert it to a single byte.
  48.     bit    goodflag    ;was it a good value?
  49.     bmi    10$    ;branch if so.
  50.     jmp    DoError    ;jump to an error routine.
  51.     MoveB    r5L,pointSize    ;save the value for now.
  52.     ldx    #1    ;there was at least one digit.
  53.     lda    ParamTable,x
  54.     beq    5$    ;branch if no more data.
  55.     cmp    #' '    ;look for the first space.
  56.     beq    30$
  57.     bne    20$    ;branch always.
  58.     inx        ;point one past the space.
  59.     jsr    IncCmdPointer    ;aim the command pointer.
  60.     jsr    ParamName    ;and get a possible filename.
  61.     bit    goodflag
  62.     jsr    IncCmdPointer    ;aim the command pointer.
  63.     jsr    ParamName    ;and get a possible filename.
  64.     bit    goodflag
  65.     bpl    5$    ;branch if not valid.
  66.     jsr    CkPresdrive    ;look for the file on the
  67.             ;current drive.
  68.     bit    goodflag
  69.     bpl    5$    ;branch if not found.
  70.     ...        ;at this point we can
  71.     ...        ;continue to check if it
  72.     ...        ;is a font file.
  73. pointSize:
  74.     .block    1
  75. See Also:    Asc_Byte, Asc_BCD, ByteNZ_Ascii, ByteWZ_Ascii, ConvertK
  76. @Asc_BCD
  77. Function:    Convert a two digit ascii number to one byte in binary coded decimal (BCD) format.
  78. Pass:    r5L - first ascii digit of number '0'-'9'
  79.     r8L - second ascii digit of number '0'-'9'
  80. Return:    r5L - 
  81. @Asc_BCD
  82. Function:    Convert a two digit ascii number to one byte in binary coded decimal (BCD) format.
  83. Pass:    r5L - first ascii digit of number '0'-'9'
  84.     r8L - second ascii digit of number '0'-'9'
  85. Return:    r5L - BCD byte $00 - $99
  86.     goodflag - set if a valid number and within the allowable range.
  87. Destroys:    a
  88. Description:    This routine will take a two-character ascii decimal number from '00' - '99' and convert it to a one-byte binary coded decimal number from $00 - $99 and return it in r5L.
  89. Example:
  90. ;this example takes a one or two character number from the
  91. ;user (0-99) and converts it to a one-byte BCD number.
  92.     lda    ParamTable+1    ;did the user enter just
  93.     jsr    CkTerminators    ;one digit? (0-9)
  94.     bit    goodflag
  95.     bmi    10$    ;branch if so.
  96.     lda    ParamTable+2    ;how about two
  97.     jsr    CkTerminators    ;digits? (00-99)
  98.     bit    goodflag
  99.     bmi    20$    ;branch if so.
  100.     jmp    NotValid    ;do an error message.
  101.             ;a single digit number is
  102.             ;handled here.
  103.     MoveB    ParamTable+0,r8L    ;r8L gets the one (2nd) digit.
  104.     LoadB    r5L,#'0'    ;we create the first digit.
  105.     beq    30$    ;branch always.
  106.     MoveB    ParamTable+0,r5L    ;load r5L with first digit.
  107.     MoveB    ParamTable+1,r8L    ;load r8L with second digit.
  108.     jsr    Asc_BCD    ;convert to BCD byte.
  109.     bit    goodflag    ;was it a valid number?
  110.     bpl    5$    ;branch if not.
  111.     ...        ;continue on...
  112. See Also:    Asc_Byte, Asc_3_Byte, ByteNZ_Ascii, ByteWZ_Ascii, ConvertK
  113. @Asc_Byte
  114. Function:    
  115. @Asc_Byte
  116. Function:    Convert a two digit ascii number to a one byte value.
  117. Pass:    r5L - first ascii digit of number '0'-'9'
  118.     r8L - second ascii digit of number '0'-'9'
  119. Return:    r5L - value of 0-99.
  120.     goodflag - set if a valid number and within the allowable range.
  121. Destroys:    a
  122. Description:    This routine will take a two-character ascii decimal number from '00' - '99' and convert it to a one-byte value and return it in r5L.
  123. Example:
  124.     MoveB    asciiNum+0,r5L    ;load r5L with first digit.
  125.     MoveB    asciiNum+1,r8L    ;load r8L with second digit.
  126.     jsr    Asc_BCD    ;convert to one byte.
  127.     bit    goodflag    ;was it a valid number?
  128.     bmi    10$    ;branch if so.
  129.     jmp    DoError    ;display some sort of error.
  130.     ...        ;continue on...
  131. asciiNum:
  132.     .byte    "58"
  133. See Also:    Asc_3_Byte, Asc_BCD, ByteNZ_Ascii, ByteWZ_Ascii, ConvertK
  134. CD byte  is allow
  135. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
  136. @ByteNZ_Ascii
  137. Function:    Convert a 16 bit number to an ascii representation of the number with no leading zeros.
  138. Pass:    r8 - number to convert.
  139. Return:    Asc_String - ascii characters '0' to '65536'.
  140. Destroys:    a, x, y, r4, r8
  141. Description:    This routine will take the 16 bit value in r8 and convert it to it's ascii decimal representation and put the result of the conversion at Asc_String. Asc_String will also contain a null byte in the sixth character position. If the result is less than five digits, then any leading zeros are replaced by ascii spaces.
  142. Example:
  143. ;This example will take the value in r0 and display it to the
  144. ;screen at the current cursor position.
  145. ShowValue:
  146.     MoveW    r0,r8    ;copy r0 to r8.
  147.     jsr    ByteNZ_Ascii    ;convert to a string.
  148.     LoadW    r0,#Asc_String    ;point r0 to the string.
  149.     ldy    #0    ;point to the left-most digit.
  150.     lda    (r0),y    ;check a digit to see if
  151.     cmp    #' '    ;it is a space character.
  152.     bne    20$    ;branch on the first
  153.             ;non-space character.
  154.     iny        ;point to the next one
  155.     bne    10$    ;and branch always.
  156.     clc        ;add the value in y
  157.     tya        ;to r0.
  158.     adc    r0L
  159.     sta    r0L
  160.     lda    r0H
  161.     adc    #0
  162.     sta    r0H
  163.             ;r0 now points to the
  164.             ;first non-space character.
  165.     lda    #TR_CR    ;do a carriage return
  166.     jmp    OtherMessage    ;after displaying the string.
  167. See Also:    Asc_3_Byte, Asc_Byte, Asc_BCD, ByteWZ_Ascii, ConvertK
  168. @ByteWZ_Ascii
  169. Function:    Convert a 16 bit number to a 5 digit ascii representati
  170. @ByteWZ_Ascii
  171. Function:    Convert a 16 bit number to a 5 digit ascii representation of the number with leading zeros.
  172. Pass:    r8 - number to convert.
  173. Return:    Asc_String - five ascii characters containing 00000 to 65536.
  174. Destroys:    a, x, y, r4, r8
  175. Description:    This routine will take the 16 bit value in r8 and convert it to it's ascii decimal representation and put the result of the conversion at Asc_String. Asc_String will also contain a null byte in the sixth character position. The result will always have five digits, since leading zeros are left in.
  176. Example:
  177. ;This example will take the value in r0 and display it to the
  178. ;screen at the current cursor position with leading zeros
  179. ;remaining.
  180. ShowValue:
  181.     MoveW    r0,r8    ;copy r0 to r8.
  182.     jsr    ByteWZ_Ascii    ;convert to a string.
  183.     LoadW    r0,#Asc_String    ;point r0 to the string.
  184.     lda    #TR_CR    ;do a carriage return
  185.     jmp    OtherMessage    ;after displaying the string.
  186. See Also:    Asc_3_Byte, Asc_Byte, Asc_BCD, ByteNZ_Ascii, ConvertK
  187. @Byte_Time
  188. Function:    Convert the time as contained in directory entries to ascii format. (this routine should not be used)
  189. Pass:    not applicable
  190. Return:    not applicable
  191. @Byte_Time
  192. Function:    Convert the time as contained in directory entries to ascii format. (this routine should not be used)
  193. Pass:    not applicable
  194. Return:    not applicable
  195. Destroys:    not applicable
  196. Description:    This routine should not be used. The variables that need to be set are only accessible by internal routines. The routine was invariably left in the jump table and should have been removed, or the required variables should have been moved to where they could be accessed by outside routines. For these reasons, only internal geoSHELL routines have proper access to this routine.
  197. Example:    no example since this routine is not recommended.
  198. See Also:
  199. @CarrReturn
  200. Function:    Perform a
  201. @CarrReturn
  202. Function:    Perform a carriage return.
  203. Pass:    nothing
  204. Return:    cur_line - line that cursor is now on.
  205.     cur_X_pos - screen X coordinate of cursor.
  206.     cur_Y_pos - screen Y coordinate of cursor.
  207. Destroys:    no guarantees
  208. Description:    Simply perform a carriage return in the geoSHELL window and the cursor will then be on the next line down. If the cursor was already on the last line, then all the lines will scroll up and the cursor will still be on the last line.
  209. Example:
  210.     jsr    CarrReturn    ;move the cursor down
  211.     jsr    CarrReturn    ;two lines.
  212. See Also:    AdjTxtPointer, Message, OtherMessage, DsplyLine, DsplyString, DispText, ClearLine, ClearBoth, ClearRemainder, StripRulers, set_XY_pos, save_XY_pos, MskCtrlCodes, ConvToAscii, CkESC_RULER
  213. @CkAllDrives
  214. Function:    Check all drives for a file.
  215. Pass:    a2 - null terminated filename.
  216. Return:    goodflag - set if file is found.
  217. @CkAllDrives
  218. Function:    Check all drives for a file.
  219. Pass:    a2 - null terminated filename.
  220. Return:    goodflag - set if file is found.
  221.     DRVFOUNDON - device number of the drive where file is found.
  222.     curDrive - the drive where the file is located is now open.
  223.     PRESDRIVE - unchanged
  224.     a2 - points to the filename converted to the actual name, any wildcards are converted to the characters they represent.
  225.     dirEntryBuf - directory entry for this file.
  226. Destroys:    no guarantees
  227. Description:    This routine will search all available drives A, B, C, and D for the filename that a2 points at. Upon return, the first thing to test is goodflag. If goodflag is cleared, then the file was not found for whatever reason. If goodflag is set, then the file exists and the drive it is on will be the open drive. PRESDRIVE will still reflect the drive that the user thinks is currently active.
  228. Example:
  229.     jsr    ParamName    ;point a2 at a filename the
  230.             ;user typed in.
  231.     bit    goodflag    ;is there a filename?
  232.     bmi    10$    ;branch if so.
  233.     jmp    DoError    ;display an error.
  234.     jsr    CkAllDrives    ;look for the file.
  235.     bit    goodflag    ;does it exist somewhere?
  236.     bpl    5$    ;branch if not.
  237.     ...        ;continue on...
  238. See Also:    CkPresdrive, CkThisDrive, CkOtherDrives, CkPathOrder, CkPath, CkForDisk, FindParName
  239. @CkDrvLetter
  240. Function:    Tests if the accumulator is holding a value from 97 to 100 ('a', 'b', 'c', 'd') and conv
  241. @CkDrvLetter
  242. Function:    Tests if the accumulator is holding a value from 97 to 100 ('a', 'b', 'c', 'd') and converts it to a device number.
  243. Pass:    a - with value to test.
  244. Return:    goodflag - set if value falls within allowable range.
  245.     a - converted to device number 8-11
  246. Destroys:    nothing (a is altered however)
  247. Description:    This routine can be used by any routine that might work with the drives and gets an input from the user. This will test if a value falls within a range that would equal the ascii value that represents a, b, c, or d. If the accumulator holds a value less than 97 or greater than 100, then the routine will exit through nogood. Otherwise, the routine exits through yesgood and the accumulator will contain a new value from 8-11. 
  248. Example:
  249.     lda    ParamTable+0    ;get the first parameter.
  250.     jsr    CkDrvLetter    ;is this a, b, c, or d?
  251.     bit    goodflag    ;branch if so.
  252.     bmi    10$
  253.     jmp    NotDriveLetter    ;go do an error.
  254.     ...        ;accumulator now
  255.     ...        ;holds 8, 9, 10, or 11.
  256.     ...        ;continue processing.
  257. See Also:    CkForDisk, ParamName
  258. @CkESC_RULER
  259. Function:    Used for advancing a pointer past bytes used with ruler 
  260. @CkESC_RULER
  261. Function:    Used for advancing a pointer past bytes used with ruler escapes in a GeoWrite document.
  262. Pass:    a - value that r0 is pointing at.
  263. Return:    * If byte is a ruler escape:
  264.     r0 - incremented by the number of bytes used in the ruler.
  265.     goodflag - cleared if byte was a ruler escape.
  266.     * If byte is not a ruler escape:
  267.     a - unchanged.
  268.     r0 - unchanged.
  269.     goodflag - set if byte was not a ruler escape.
  270. Destroys:    If byte is a ruler escape:
  271.     a, x
  272.     If byte is not a ruler escape:
  273. Description:    Here is a routine that geoSHELL uses when processing a startup or exec file. Each byte of the GeoWrite page is sent through this routine to jump past any rulers that might be contained within the file. geoSHELL only needs the actual text that is contained in the file. The text is what makes up the commands. The user is allowed to use different fonts and graphics in a startup file, but geoSHELL doesn't need them. By loading the accumulator with each byte and accessing this routine, the rulers can be stripped from the buffer that the file is loaded into. The 'type' command also makes use of this routine when displaying a GeoWrite file to the screen.
  274. Example:
  275. ;this example will strip the rulers from a buffer that a 
  276. ;GeoWrite page was loaded into and then display it
  277. ;within the geoSHELL window. The example AdjustBuffer will work
  278. ;because the size of the bytes in the buffer will always
  279. ;decrease in size. Refer to DispText for an example on how
  280. ;to display this converted text to the screen.
  281. AdjustBuffer:
  282.     lda    #[ourBuffer    ;point r0 and r1
  283.     sta    r0L    ;to the buffer that a
  284.     sta    r1L    ;GeoWrite page is
  285.     lda    #]ourBuffer    ;loaded into.
  286.     sta    r0H
  287.     sta    r1H
  288.     ldy    #0    ;star
  289.     sta    r1H
  290.     ldy    #0    ;start y at zero.
  291.     lda    (r0),y    ;get a byte from the buffer.
  292.     beq    90$    ;branch if end of text.
  293.     jsr    CkESC_RULER    ;process this byte.
  294.     bit    goodflag    ;do we have a good byte?
  295.     bpl    10$    ;branch if not.
  296.     sta    (r1),y    ;store this byte.
  297.     iny        ;increment to point at the
  298.             ;next byte.
  299.     bne    10$    ;branch if y hasn't not zero.
  300.     inc    r0H    ;otherwise increment the
  301.     inc    r1H    ;high bytes of our pointers.
  302.     bne    10$    ;branch always.
  303.     rts        ;done with this routine.
  304. See Also:    AdjTxtPointer, Message, OtherMessage, DsplyLine, DsplyString, CarrReturn, ClearLine, ClearBoth, 
  305. ClearRemainder, StripRulers, set_XY_pos, save_XY_pos, MskCtrlCodes, ConvToAscii, DispText
  306. @CkForD
  307. @CkForDisk
  308. Function:    Check for a disk in any desired drive.
  309. Pass:    accumulator - device number from 8-11.
  310. Return:    goodflag set if the drive contains a formatted disk.
  311.     Refer to OpenDisk for other values that are set.
  312. Destroys:    no guarantees
  313. Description:    This routine performs a simple check to see if a particular drive contains a valid disk that can be read. You might call this routine before processing your command if it requires disk access. This would allow you to inform the user of a 'missing disk' if necessary. The routine jumps through yesgood if a valid disk is found.
  314. Example:
  315.     lda    ParamTable+0    ;get a parameter from the user.
  316.     jsr    CkDrvLetter    ;convert it to 8-11.
  317.     bit    goodflag    ;was it a, b, c, or d?
  318.     bmi    10$    ;branch if so.
  319.     jmp    DoError    ;display an error.
  320.     jsr    CkForDisk    ;does the desired drive have
  321.     bit    goodflag    ;a disk in it?
  322.     bmi    20$    ;branch if so.
  323.     jsr    MissDisk    ;do a geoSHELL error routine.
  324.     jmp    NoMoreCmds    ;and quit the command.
  325.     ...        ;otherwise,
  326.     ...        ;continue on...
  327. See Also:    CkPresdrive, CkThisDrive, CkOtherDrives, CkPathOrder, CkPath, CkAllDrives, MissDisk, FindParName
  328. @CkKeyboard
  329. @CkKeyboard
  330. Function:    Check for CONTROL, STOP and other keys and process accordingly.
  331. Pass:    kboardoff - (optional) ignore the keyboard if bit 7 is set, or if clear, continue with CkKeyboard. Set bit 6 to ignore only the STOP key.
  332. Return:    y - keycode of the key that is being pressed.
  333. Destroys:    a, x, y
  334. Description:    This routine is usually used to check for the user pressing the STOP key or the CONTROL key. If the STOP key is pressed when CkKeyboard is called, your command will end and CkKeyboard will exit through NoMoreCmds. If you call CkKeyboard, be sure that the geoSHELL window is still displayed on the screen, otherwise the user will have whatever your command has put on the screen with a blinking cursor somewhere in the middle. Also be sure that InitForIO is not in effect while calling this routine.
  335.     If the user presses the CONTROL key during this routine, the routine will simply pause and wait for the user to let go of the CONTROL key and then it will return. If any other key is pressed, the keycode of the key will be returned in the y register.
  336.     CkKeyboard should be called whenever your command does something such as displaying a series of scrolling text that the user might want to halt. Just put CkKeyboard somewhere in the loop of your routine. Think about how your command is working and try to imagine if the user might want a way out or a way to pause the output. In that case, use this routine. If your routine is using certain geoSHELL routines, CkKeyboard may already be in use. Test your command to see if the STOP key or CONTROL key is already functioning.
  337. Example:
  338.     ...        ;the bulk of your command.
  339.     jsr    CkKeyboard    ;allow the user a way out.
  340.     ...        ;continue with something here.
  341.     bit    goodflag    ;this might be another way out.
  342.     bmi    10$    ;loop back and do it again.
  343. See Also:    Wait, YesKeypress, NoKeypress, NoMoreCmds
  344. @CkModeFlag
  345. Function:    
  346. @CkModeFlag
  347. Function:    Test if a file is compatible with the current mode.
  348. Pass:    Load fileHeader with the file's header block.
  349. Return:    goodflag - set if file is compatible.
  350.     x - pointer to error message if file is not compatible.
  351. Destroys:    a, x
  352. Description:    geoSHELL uses this routine before it allows a file to be loaded and run. It will check the mode flag in the file's header block which is loaded in at fileHeader. It checks to make sure that the file is configured as being compatible with the mode that the computer is currently running in, whether it be 64, 128, 40 or 80 columns, etc. If the current mode is not compatible with the file, then the routine will exit through nogood and the value in x will be a pointer to a geoSHELL error message that you can display if desired. Otherwise, if goodflag is set, then the file is compatible. See the appendix for a listing of the correct byte to use in the header block for a particular mode.
  353. Example:
  354. ;this example will get a filename from the user and check the
  355. ;currently active drive for the file and if it is compatible,
  356. ;it will continue with whatever it is intending to do.
  357.     jsr    ParamName    ;get a filename.
  358.     bit    goodflag    ;is it valid?
  359.     bmi    10$    ;branch if so.
  360.     jmp    DoError    ;display an error.
  361.     jsr    CkPresdrive    ;this will load dirEntryBuf.
  362.     bit    goodflag    ;does the file exist?
  363.     bpl    5$    ;branch if not.
  364.     jsr    GetHeader    ;get the file's header block.
  365.             ;GetHeader doesn't return if
  366.             ;any error.
  367.     jsr    CkModeFlag    ;check the file's compatibility.
  368.     bit    goodflag    ;well?
  369.     bmi    20$    ;branch if OK.
  370.     lda    #(IN_TWO|TR_CR)    ;x points to the error message.
  371.     jsr    Message    ;display the message.
  372.     jmp    NoMoreCmds    ;and quit.
  373.     ...        ;otherwise, continue on...
  374. See Also:    GetHeader, Only128, Message, OtherMessage, DoRun
  375. @CkOtherDrives
  376. Function:    Search all drives for a file that have not yet been searched.
  377. See Also:    GetHeader, Only128, Message, OtherMessage, DoRun
  378. @CkOtherDrives
  379. Function:    Search all drives for a file that have not yet been searched.
  380. Pass:    a2 - 
  381. @CkOtherDrives
  382. Function:    Search all drives for a file that have not yet been searched.
  383. Pass:    a2 - pointer to a null-terminated filename.
  384.     drivesChecked - (4 bytes) identify the drives that should be searched. If zero, then search the drive, if bit 7 is set, then ignore the drive.
  385. Return:    goodflag - set if file found.
  386.     a2 - now points to the exact name of the file in case the user included wildcards in the filename.
  387.     DRVFOUNDON - set to device number of the drive the file was found on.
  388.     curDevice and curDrive - the drive the file was found on is now open.
  389.     PRESDRIVE - unchanged.
  390.     dirEntryBuf - directory entry for file if found.
  391. Destroy:    no guarantees
  392. Description:    When searching for a file, you can choose the order that you wish to search the drives in. Just load the accumulator with a device number and call CkThisDrive. You can check another drive if desired also. When you've checked the ones that you feel should have priority, and wish to check the remaining ones, just call CkOtherDrives and geoSHELL will proceed to do just that. CkOtherDrives will check four locations at drivesChecked before accessing a drive. If a corresponding byte at drivesChecked is zero, that drive will be searched. The ramdisks get priority here, and then the real drives are tested. By manipulating the bytes at drivesChecked, you can force CkOtherDrives to either check a drive or to ignore it. So, you might want to mark the drives that you have already checked. Otherwise, those drives will get searched again. If all the drives have already been checked, then the routine will return as though the file was not found anyway and goodflag will be cleared.
  393. Example:
  394. ;this example will search only drives A and B for a desired file.
  395.     jsr    ParamName    ;get a filename from the user.
  396.     bit    goodflag    ;is it valid?
  397.     bmi    10$    ;branch if so.
  398.     jmp    DoError    ;display an error message.
  399.     lda    #128
  400.     sta    drivesChecked+2    ;ignore drive C.
  401.     lda    #128
  402.     sta    drivesChecked+2    ;ignore drive C.
  403.     sta    drivesChecked+3    ignore drive D.
  404.     lda    #0
  405.     sta    drivesChecked+0    ;allow drive A.
  406.     sta    drivesChecked+1    ;allow drive B.
  407.     jsr    CkOtherDrives    ;and search them.
  408.     bit    goodflag
  409.     bmi    20$
  410.     jmp    FileNotAvail    ;do a geoSHELL error routine.
  411.     ...        ;file is found,
  412.     ...        ;so continue on...
  413. See Also:    CkPresdrive, CkThisDrive, CkAllDrives, CkPathOrder, 
  414. CkPath, CkForDisk, FindParName
  415. it 7 is se
  416. @CkPath
  417. Function:    Check to see if a file is on the path partition.
  418. Pass:    a2 - pointed to a null-terminated filename
  419. Return:    goodflag - set if successful.
  420.     DRVFOUNDON - contains the device number (8-11) of the path device if successful.
  421.     pathload - bit 7 set if successful.
  422.     a2 - will point to the null-terminated filename.
  423.     path partition - will be left open.
  424.     dirEntryBuf - will contain the directory entry for the file.
  425. Destroys:    no guarantees.
  426. Description:    Call this routine to check the path partition for a desired filename. Check goodflag first after calling this routine. If the file was found on the path partition, then goodflag will be set. Once you have finished with the file, be sure to call ResetFromPath to put the device back to the partition it was in prior to calling this routine. DRVFOUNDON will contain the device number (8-11) of the path device. If a path has not been defined with the path command, or if the defined path does not exist, the routine will exit through nogood.
  427. Example:
  428.     jsr    CkPath
  429.     bit    goodflag
  430.     bmi    10$
  431.     rts        ;goodflag will still be zero.
  432.     ...        ;do whatever you need to do
  433.     ...        ;with the file here.
  434.     jsr    ResetFromPath
  435.     jmp    yesgood    ;tell the calling routine
  436.             ;that this routine was
  437.             ;was successful.
  438. @CkPathOrder
  439. Function:    Search a path partition for a file, but first check all available ramdisks, then the path partition, and then all remaining drives.
  440. @CkPathOrder
  441. Function:    Search a path partition for a file, but first check all available ramdisks, then the path partition, and then all remaining drives.
  442. Pass:    a2 - pointer to a null-terminated filename.
  443. Return:    goodflag - set if file is found.
  444.     DRVFOUNDON - contains the device number (8-11) of the device the file is found on.
  445.     curDevice and curDrive - drive file is found on will be open.
  446.     PRESDRIVE - unchanged.
  447.     pathload - bit 7 set if file is found on the path partition.
  448.     a2 - will point to the null-terminated filename with any wildcards converted to the characters they represent.
  449.     dirEntryBuf - will contain the directory entry for the file.
  450. Destroys:    no guarantees.
  451. Description:    This routine will search all available drives for a file, including the path partition. The ramdisks get checked first, then the path partition gets the next priority, and then all remaining drives will be searched. As soon as the file is found, the search will end through yesgood and the drive the file is found on will be open. If the file is not found, then the routine will exit through nogood and the currently active drive as the user sees it will remain the open drive.
  452. Example:
  453.     ...        ;a2 already points to a filename.
  454.     jsr    CkPathOrder    ;search for the file, including
  455.             ;the path partition.
  456.     bit    goodflag    ;did we find the file?
  457.     bmi    10$    ;branch if so.
  458.     jmp    FileNotAvail    ;do a geoSHELL error routine.
  459.     ...        ;file is found,
  460.     ...            ;so continue on...
  461.     ...        ;before finishing, be sure to
  462.     ...        ;close the path partition.
  463.     jsr    ResetFromPath    ;in case the file was found
  464.             ;on the path partition.
  465.     ldx    NUM_IN_NAME    ;how big was the filename?
  466.     inx        ;add one for a space.
  467.             ;on the path partition.
  468.     ldx    NUM_IN_NAME    ;how big was the filename?
  469.     inx        ;add one for a space.
  470.     txa        ;put in in a.
  471.     jsr    IncCmdPointer    ;and point the command pointer
  472.             ;past our command.
  473.     jmp    ExitCommand    ;exit cleanly.
  474. See Also:    CkPresdrive, CkThisDrive, CkOtherDrives, CkAllDrives, CkPath, CkForDisk, FindParName
  475. @CkPresdrive
  476. Function:    Check the currently active drive for a file.
  477. Pass:    a2 - null terminat
  478. @CkPresdrive
  479. Function:    Check the currently active drive for a file.
  480. Pass:    a2 - null terminated filename.
  481. Return:    goodflag - set if file is found.
  482.     DRVFOUNDON - device number of the current drive where file is found.
  483.     curDrive - the current drive where the file is located is now open.
  484.     PRESDRIVE - unchanged (the current drive)
  485.     a2 - points to the filename converted to the actual name, any wildcards are converted to the characters they represent.
  486.     dirEntryBuf - directory entry for this file.
  487. Destroys:    no guarantees
  488. Description:    This routine will search the currently active drive for the filename that a2 points at. Upon return, the first thing to test is goodflag. If goodflag is cleared, then the file was not found for whatever reason. If goodflag is set, then the file exists on the drive.
  489. Example:
  490.     jsr    ParamName    ;point a2 at a filename the
  491.             ;user typed in.
  492.     bit    goodflag    ;is there a filename?
  493.     bmi    10$    ;branch if so.
  494.     jmp    DoError    ;display an error.
  495.     jsr    CkPredrive    ;look for the file.
  496.     bit    goodflag    ;does the file exist?
  497.     bpl    5$    ;branch if not.
  498.     ...        ;continue on...
  499. See Also:    CkAllDrives, CkThisDrive, CkOtherDrives, CkPathOrder, CkPath, CkForDisk, FindParName
  500. @CkTerminators
  501. Function:    Check if the value is one of the geoSHELL text terminators.
  502. Pass:    a - value to test.
  503. Return:    a - unchanged.
  504.     goodflag - set if a terminator
  505. Destroys:    not
  506. @CkTerminators
  507. Function:    Check if the value is one of the geoSHELL text terminators.
  508. Pass:    a - value to test.
  509. Return:    a - unchanged.
  510.     goodflag - set if a terminator
  511. Destroys:    nothing
  512. Description:    This will test the value in the accumulator and return through nogood or yesgood depending on the value. If the value is either a space, an up-arrow, a CMDR up-arrow or a null byte, then goodflag will be set because it will exit through yesgood. The catch here is that a space character will also be considered a valid terminator by this routine. geoSHELL uses this because a command with no parameters may be terminated by a space. If you wish to test for a terminator and ignore a space, then use CkTermNoSpace.
  513. Example:
  514.     LoadW    r0,#textBuffer    ;point at our buffer.
  515.     ldy    #0
  516.     lda    (a4),y    ;get a byte from input.
  517.     jsr    CkTerminators    ;find the first space
  518.     bit    goodflag    ;or end of parameter.
  519.     bmi    20$    ;branch if terminator.
  520.     sta    (r0),y    ;otherwise store byte.
  521.     iny        ;point y at next byte.
  522.     cpy    #80    ;let's limit to 80 bytes.
  523.     bne    10$    ;loop back for more.
  524.     iny        ;point at next byte
  525.     tya        ;transfer value to a.
  526.     jsr    IncCmdPointer    ;set for the next command
  527.             ;in line after ours.
  528.     ...        ;now do what we want with
  529.     ...        ;the text in our buffer.
  530. See Also:    CkTermNoSpace
  531. @CkTermNoSpace
  532. Function:    Check if the value is one of the geoSHELL text terminators except for a space.
  533. Pass:    a -
  534. @CkTermNoSpace
  535. Function:    Check if the value is one of the geoSHELL text terminators except for a space.
  536. Pass:    a - value to test.
  537. Return:    a - unchanged.
  538.     goodflag - set if a terminator.
  539. Destroys:    nothing
  540. Description:    This will test the value in the accumulator and return through nogood or yesgood depending on the value. If the value is either an up-arrow, a CMDR up-arrow or a null byte, then goodflag will be set because it will exit through yesgood.
  541. Example:
  542.     ldx    #0
  543.     lda    ParamTable,x    ;get a byte from ParamTable.
  544.     jsr    CkTermNoSpace    ;check if a terminator?
  545.     bit    goodflag    ;well?
  546.     bmi    20$    ;branch if end of parameter.
  547.     inx        ;point at the next byte.
  548.     cpx    #16    ;let's only allow 16 bytes.
  549.     bne    10$    ;loop back for more, maybe.
  550.     jmp    DoError    ;do an error of some sort.
  551.     inx        ;point just past our
  552.     txa        ;parameter,
  553.     jsr    IncCmdPointer    ;at the next command.
  554.     ...        ;and continue on...
  555. See Also:    CkTerminators
  556. @CkThisDrive
  557. Function:    Check a drive for a file.
  558. Pass:    a2 - null terminated filename.
  559.     a - device number (8-11) of drive to search.
  560. Return:    goodflag - set if file is found.
  561.     DRVFOUNDON - device number of th
  562. @CkThisDrive
  563. Function:    Check a drive for a file.
  564. Pass:    a2 - null terminated filename.
  565.     a - device number (8-11) of drive to search.
  566. Return:    goodflag - set if file is found.
  567.     DRVFOUNDON - device number of the drive if file is found.
  568.     curDrive - the drive if file is found, is now open.
  569.     PRESDRIVE - unchanged
  570.     a2 - points to the filename converted to the actual name, any wildcards are converted to the characters they represent.
  571.     dirEntryBuf - directory entry for this file.
  572. Destroys:    no guarantees
  573. Description:    This routine will search a specific drive for the filename that a2 points at. Upon return, the first thing to test is goodflag. If goodflag is cleared, then the file was not found for whatever reason. If goodflag is set, then the file exists and the desired drive will be the open drive. PRESDRIVE will still reflect the drive that the user thinks is currently active.
  574. Example:
  575. ;this example will use a drive specifier that the user types in,
  576. ;plus a filename also entered by the user and then check the
  577. ;desired drive for that file.
  578. ;the command might look like:  command b filename
  579.     lda    ParamTable+0    ;get the first parameter
  580.             ;from the user.
  581.     jsr    CkDriveLetter    ;convert it to a device number.
  582.     bit    goodflag    ;is it a device number?
  583.     bpl    5$    ;branch if not.
  584.     sta    devNum    ;save it for now.
  585.     lda    #2    ;point past the drive
  586.     jsr    IncCmdPointer    ;specifier.
  587.     jsr    ParamName    ;and get the filename the
  588.             ;user typed in.
  589.     bit    goodflag    ;is there a filename?
  590.     bmi    10$    ;branch if so.
  591.     jmp    DoError    ;display an error.
  592.     lda    devNum
  593.     jsr    CkThisDrive    ;look for the file.
  594.     bit    goodflag    ;does it exist?
  595.     bpl    5$    ;branch if not.
  596.     ...        ;continue on...
  597. devNum:
  598.     lda    devNum
  599.     jsr    CkThisDrive    ;look for the file.
  600.     bit    goodflag    ;does it exist?
  601.     bpl    5$    ;branch if not.
  602.     ...        ;continue on...
  603. devNum:
  604.     .block    1
  605. See Also:    CkPresdrive, CkAllDrives, CkOtherDrives, CkPathOrder, CkPath, CkForDisk, FindParName
  606. @ClearBoth
  607. Function:    Clear the current line on the screen and in the memory buffer.
  608. Pass:    nothing
  609. Return:    nothing
  610. Destroys:    a, x, r0, r1, r2L, r11
  611. Description
  612. @ClearBoth
  613. Function:    Clear the current line on the screen and in the memory buffer.
  614. Pass:    nothing
  615. Return:    nothing
  616. Destroys:    a, x, r0, r1, r2L, r11
  617. Description:    geoSHELL maintains an internal buffer that represents the characters that the user sees in the geoSHELL window. This is how geoSHELL is able to restore a window when switching screens, for instance, or returning from a Desk Accessory. If your command intends to work directly with the data that is on the screen as well as the data in the buffer, you can clear both the current line that the cursor is on as well as the internal memory buffer that corresponds to it by calling this routine. Normally, there is no need to work directly like this. geoSHELL does a pretty good job of maintaining the text and buffers while your command can do other things.
  618. Example:
  619.     jsr    ClearBoth    ;clear the data on the line
  620.             ;the cursor is on.
  621. See Also:    ResetScreen, ClearScreen, ClearWindow, EraseWindow, ReDoWindow, DispLetter, DriveLetter, DsplyLine, DsplyString, CarrReturn, set_XY_pos, save_XY_pos, ClearLine, ClearRemainder, ReDisplayWindow, DispText, unsetPrompt
  622. @ClearLine
  623. @ClearLine
  624. Function:    Clear the current line in the geoSHELL window.
  625. Pass:    r1H - vertical pixel location set by calling set_XY_pos.
  626. Return:    nothing
  627. Destroys:    nothing
  628. Description:    This is mostly an internal routine for clearing the current line in the geoSHELL window. It does not clear the corresponding memory buffer.
  629. Example:
  630.     jsr    set_XY_pos
  631.     jsr    ClearLine    ;clear the line
  632.             ;the cursor is on.
  633. See Also:    ResetScreen, ClearScreen, ClearWindow, EraseWindow, ReDoWindow, DispLetter, DriveLetter, DsplyLine, DsplyString, CarrReturn, set_XY_pos, save_XY_pos, ClearBoth, ClearRemainder, ReDisplayWindow, DispText, unsetPrompt
  634. @ClearRemainder
  635. Function:    Clear the window below the current cursor position.
  636. Pass:    nothing
  637. Return:    nothing
  638. Destroys:    a, r1H, r11
  639. Description:    If your command displays a series of text to the window, you may desire to clear all text below the current cursor position for a cleaner display. The 'type' command does this as well as some other commands. This makes it easier for the user to read what it being put on the screen. The internal buffers are not cleared, only the visible text on the screen. As new text is added (through the normal geoSHELL text displaying routines), it will show up on the screen and also replace what is in the memory buffers.
  640. Example:
  641.     jsr    ClearRemainder
  642. See Also:    ResetScreen, ClearScreen, ClearWindow, EraseWindow, ReDoWindow, DispLetter, DriveLetter, DsplyLine, DsplyString, CarrReturn, set_XY_pos, save_XY_pos, ClearBoth, ClearLine, ReDisplayWindow, DispText, unsetPrompt
  643. The geoSHELL Programmer's Development Package    2-PAGE
  644. the cursor is on.
  645. See Also:    ResetScreen, ClearScreen, ClearWindow, EraseWindow, ReDoWindow, DispLetter, DriveLetter, DsplyLine
  646. The geoSHELL Programmer's Development Package    2-PAGE
  647.