home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / MRFiles / GS2DVPAK.ARC / GSDEVPAK5 (.txt) < prev   
Encoding:
GEOS ConVerT  |  2019-04-13  |  51.9 KB  |  855 lines

  1. gsdevpak5
  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. @ParamName
  13. Function:    Point r6 and a2 to the filename that the user entered.
  14. Pass:    nozero - set bit 7 of this variable if you do not want a zero placed at the end of the filename, otherwise simply ignore this variable (it is automatically reset to zero when the routine is finished), it is not necessary for your command to set it to zero.
  15. Return:        goodflag - set if what appears to be a valid filename was found.
  16.     r6 - points to a null terminated filename.
  17.     a2 - points to a null terminated filename.
  18.     WILDCARD - bit 7 set if any wildcard characters are found (* and/or ?).
  19.     r0 - if bit 5 of WILDCARD is set, this means that the user included an equals ( = ) sign somewhere in the parameter and r0 will be pointing at the first null-terminated filename while a2 and r6 will be pointing at the second one.
  20.     NUM_IN_NAME - contains the number of characters 1-16 that are in the filename.
  21. Description:    Call this routine when your command needs to have a filename follow as a parameter. If ParamName finds what appears to be a valid filename (up to a maximum of 16 characters), it will exit through yesgood. If you find that goodflag does not have bit 7 set, then the routine failed and you do not have any valid filename to process. Handle this accordingly.
  22.     When a command needs two filenames entered in a manner such as what the 'rename' command requires, then r0 will return pointing at the first filename and a2 will be pointing at the second.
  23.     Example: ren newname=oldname
  24.     In this case, both filenames will become null-terminated. You can tell that the user entered a parameter this way by checking bit 5 of WILDCARD. If it is set, then an equals sign was found.
  25.     If bit 7 of WILDCARD is set, then the user entered at least one wildcard in the filename. In the case of bit 5 being set, wildcards are only checked in the second filename, the one that a2 is pointing at.
  26. Example:
  27. ;this example requires that the user enters two filenames similar
  28. ;to the way that the rename command works.
  29.     jsr    ParamName
  30.     bit    goodflag
  31.     bmi    10$
  32.     jsr    MissgFilename
  33.     bbrf    5,WILDCARD,5$    ;use a macro to test bit 5.
  34.             ;did the user enter two names?
  35.             ;it will branch if not.
  36.     MoveW    r0,firstName    ;save r0 for now.
  37.     jsr    CkPresdrive    ;check the current drive
  38.             ;for the second filename.
  39.     bit    goodflag    ;does the file exist?
  40.     bmi    30$    ;branch if so.
  41.     jsr    NotFound    ;tell the user, not found.
  42.     jmp    NoMoreCmds    ;and exit.
  43.     MoveW    a2,secondName    ;save this name for now.
  44.     MoveW    firstName,a2    ;now let's
  45.     jsr    CkPresdrive    ;look for the first filename.
  46.     bit    goodflag    ;did we find it?
  47.     bpl    20$    ;branch if not.
  48.     ...        ;at this point we have
  49.     ...        ;determined that both
  50.     ...        ;filenames exist on the
  51.     ...        ;currently active drive
  52.     ...        ;and we may continue on...
  53.     inc    NUM_IN_NAME    ;get the length of the a2
  54.     lda    NUM_IN_NAME    ;filename plus on for a space.
  55.     jsr    IncCmdPointer    ;point at the next command.
  56.     jmp    ExitCommand    ;and exit cleanly.
  57. firstName:
  58.     .block    2
  59. secondName:
  60.     .block    2
  61. See Also:    FindParName
  62. @PopStuff
  63. Function:    Restore certain variables after a call to PushStuff.
  64. Pass:    nothing
  65. Return:    r0-r15, a0-a4 are restored to the values they held when PushStuff was called.
  66. Destroys:    nothing
  67. Description:    Refer to PushStuff for the basic purpose of these two routines. Do not call this routine except after you have already called PushStuff, but be sure to call it if you have called PushStuff. PopStuff restores various zero page locations from a special built-in stack that is maintained by geoSHELL. Treat it just like you would if you were to push a byte onto the processor's stack. One difference here though is that if you exit your command through NoMoreCmds, then this built-in stack is reset anyway and you would not need to call PopStuff.
  68. Example:
  69.     jsr    PushStuff    ;save some zero page registers.
  70.     ...        ;you might have some code
  71.     ...        ;in here that trashes the
  72.     ...        ;contents of r0-r6 or whatever.
  73.     jsr    PopStuff    ;restore the registers.
  74. See Also:    PushStuff, NoMoreCmds
  75. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
  76. @PurgeAllTurbos
  77. Function:    Purge the turbo code from all the drives that are being used in order to perform low-level DOS routines.
  78. Pass:    nothing
  79. Return:    goodflag - could be either set or cleared, but in the case of this routine, it is meaningless.
  80. Destroys:    a, x, y, r0-r3
  81. Description:    Before performing any low level functions with the drives such as direct memory accessing, it is necessary to purge the turbo code in the drive so that the disk driver will restore it completely when EnterTurbo is called. If not, then your routines could possibly corrupt the turbo code that is in the drive and the driver would think that it is still intact.
  82.     This routine purges the turbo code from 'all' the drives so that you might be able to do low level functions with more than one drive at a time as you wish. geoSHELL's normal disk accessing will tell the disk drivers to restore the needed turbo code before any GEOS disk accessing. For that reason, it is not necessary that your command call EnterTurbo unless it will also need some GEOS disk accesses.
  83.     If you are dealing with the DOS in just one drive, then you could just call PurgeTurbo for that one device. However some of the routines that you call in geoSHELL, especially the ones that deal with the CMD devices, might deal with more than one drive and therefore needs the turbo code in all the drives to be purged. This routine will do that for you.
  84. Example:
  85.     jsr    PurgeAllTurbos    ;kill all the turbo code.
  86.     jsr    InitForIO    ;pop out of GEOS.
  87.     ...        ;do some low-level stuff.
  88.     jsr    DoneWithIO    ;pop back into GEOS.
  89.     jmp    ExitCommand
  90. See Also:
  91. @PushStuff
  92. Function:    Save certain zero 
  93. @PushStuff
  94. Function:    Save certain zero page locations to a built-in stack.
  95. Pass:    nothing
  96. Return:    nothing
  97. Destroys:    nothing
  98. Description:    In some cases you might want to preserve the locations from r0-r15. Just call this routine and geoSHELL will save them on a special stack contained in memory. The locations from a0-a4 are also saved with this routine. Nothing gets trashed when calling this routine. a,x and y are not trashed. Use PopStuff to restore all of these locations. If you call PushStuff, be sure to call PopStuff, for the same reason you would do a pla after you do a pha instruction. If you exit your command through NoMoreCmds, this will be done for you.
  99.     Since the stack this routine uses is 256 bytes long, and 42 bytes are saved to it each time, you can safely call this routine 6 times before having to call PopStuff. The last set in is the first set out, just like pushing and pulling one byte on the processor's stack.
  100. Example:
  101. ;this example looks for a filename on the current drive, and
  102. ;whether the file is found or not, it will continue with whatever
  103. ;it is designed to do. But while it is displaying a message to the
  104. ;user, it will save some stuff and restore afterwards and then
  105. ;continue on.
  106.     jsr    ParamName    ;get the filename.
  107.     jsr    CkPresdrive    ;is it on the current drive?
  108.     bit    goodflag    ;well?
  109.     bmi    10$    ;branch if so.
  110.     jsr    PushStuff    ;save everything.
  111.     jsr    NotFound    ;tell the user 'not found'.
  112.     jsr    PopStuff    ;restore everything.
  113.     ...        ;and continue...
  114. See Also:    PopStuff
  115. @RdFnKeyDefs
  116. Function:    Load the default function key definitions from the current drive.
  117. Pass:    geoSHELL must be an open VLIR fi
  118. @RdFnKeyDefs
  119. Function:    Load the default function key definitions from the current drive.
  120. Pass:    geoSHELL must be an open VLIR file.
  121. Return:    goodflag - set if geoSHELL was found on the current drive and the function key definitions loaded successfully.
  122. Destroys:    a, y, r1-r4, r7
  123. Description:    This routine will load in the function key definitions from the currently open drive if there is a copy of geoSHELL on the drive. The user will now have access to those function key definitions. The 'defkey' command uses this routine. You must first open geoSHELL as a VLIR file before calling this routine. Close the file afterwards.
  124. Example:
  125. ;here is an example of a complete geoSHELL command that will
  126. ;load in the function key definitions from the drive that the
  127. ;user chooses. Let's call this command 'loadkeys'. The user is
  128. ;supposed to enter the command followed by a parameter that
  129. ;specifies the desired drive to load the keys from.
  130. ;Example:  loadkeys b
  131. ;This would load the function key definitions from drive B.
  132. ;You'll notice in this source code, that the idea is to keep
  133. ;checking for errors to keep the user from crashing his machine.
  134. ;Here's the complete source code for the command.
  135. LoadKey:
  136.     lda    ParamTable+1    ;check that only one
  137.     jsr    CkTerminators    ;character is entered.
  138.     bit    goodflag
  139.     bmi    10$    ;branch if so.
  140.     jmp    MissgFilename    ;(bad parameter)
  141.     lda    ParamTable+0
  142.     jsr    CkDrvLetter    ;convert this to the
  143.             ;desired device number (8-11).
  144.     bit    goodflag    ;is it legal?
  145.     bpl    5$    ;branch if not.
  146.     pha        ;save the device number.
  147.     LoadW    a2,#ShellText    ;point a2 at the geoSHELL
  148.             ;name.
  149.     jsr    CkThisDrive    ;see if geoSHELL is on this
  150.     bit    goodflag    ;drive.
  151.     bmi    20$    ;branch if so.
  152.     jsr    NotFound    ;tell the user, not found.
  153.     jmp    NoMoreCmds    ;and exit.
  154.     MoveW    a2,r0    ;point r0 at the name.
  155.     jsr    OpenWrFile    ;this opens a VLIR file.
  156.     bit    goodflag    ;was it successful?
  157.     bmi    30$    ;branch if so.
  158.     jmp    LoadProblem    ;tell about a loading problem.
  159.     jsr    RdFnKeyDefs    ;load in the function keys.
  160.     bit    goodflag    ;did it go OK?
  161.     bmi    40$    ;branch if so.
  162.     jsr    CloseRecordFile    ;close the file.
  163.     bra    25$    ;and do an error thing.
  164.     jsr    CloseRecordFile    ;close the file.
  165.     LoadW    r0,#successText    ;and tell the user
  166.     lda    #(IN_TWO|TR_CR)    ;that it went OK.
  167.     jsr    OtherMessage
  168.     lda    #2
  169.     jsr    IncCmdPointer    ;point at the next command.
  170.     jmp    ExitCommand    ;and exit cleanly.
  171. successText:
  172.     .byte    "Function Keys Loaded!",0
  173. ShellText:
  174.     .byte    "geoSHELL",0
  175. See Also:
  176. @ReadChannel
  177. Function:    Read a drive's error channel.
  178. Pass:    a - device number of desired drive.
  179.     InitForIO must be called first.
  180. @ReadChannel
  181. Function:    Read a drive's error channel.
  182. Pass:    a - device number of desired drive.
  183.     InitForIO must be called first.
  184. Return:    EnOfShell - up to 256 bytes of information from the drive's error channel.
  185.     goodflag - set if the read was successful.
  186. Destroys:    a, x, y
  187. Description:    This command will read a drive's error channel and return the information to a buffer at EnOfShell. This buffer is 256 bytes long in order to accomodate the number of bytes that may come from a CMD device's error channel as opposed to a CBM device. This routine handles the communication between the computer and the drive for you. If goodflag is set, then you will find some valid bytes in the buffer at EnOfShell, otherwise it may just contain null bytes. So check goodflag first upon return from this routine. Also, before calling this routine, be sure to call PurgeAllTubos and InitForIO.
  188. Example:
  189.     lda    PRESDRIVE    ;do this in case it's an
  190.     jsr    GetRealDriveNum    ;RD or RL as a RAM_1581.
  191.             ;this also calls PurgeAllTurbos.
  192.     jsr    InitForIO    ;pop out of GEOS.
  193.     ...        ;through here, you might
  194.     ...        ;have some code that
  195.     ...        ;accesses the drive's DOS
  196.     ...        ;for whatever reason.
  197.     lda    REALDRIVE    ;now let's check the
  198.     jsr    ReadChannel    ;error channel.
  199.     jsr    DoneWithIO    ;pop back into GEOS.
  200.     bit    goodflag    ;was the read successful?
  201.     bmi    20$    ;branch if so.
  202.     jmp    DoError    ;display some sort of error.
  203.     ...        ;now we can read the data
  204.     ...        ;located at EnOfShell.
  205. See Also:    PurgeAllTurbos, SendCmd, SendListen, SendTalk, GetRealDriveNum
  206. @ReDisplayWindow
  207. Function:    Clear each line in the geoSHELL window and redisplay the text contained in it fro
  208. @ReDisplayWindow
  209. Function:    Clear each line in the geoSHELL window and redisplay the text contained in it from the internal buffers.
  210. Pass:    nothing
  211. Return:    nothing
  212. Destroys:    no guarantees
  213. Description:    If your command does anything that might alter the state of what is being displayed in the geoSHELL window, you can use this routine to restore the text as it should be.
  214. Example:
  215.     ...        ;let's say that your command
  216.     ...        ;puts up a couple of icons
  217.     ...        ;in the middle of the geoSHELL
  218.     ...        ;window in this code here.
  219.     ...        ;that would wipe out the text
  220.     ...        ;that was there.
  221.     bit    goodflag    ;did the user do as he should?
  222.     bmi    50$    ;branch if so.
  223.     jsr    ReDisplayWindow    ;restore the text in the window.
  224.     jmp    NoMoreCmds    ;and exit.
  225.     ...        ;continue on...
  226. See Also:    ResetScreen, ClearRemainder, ClearWindow, EraseWindow, ReDoWindow, DispLetter, DriveLetter, DsplyLine, DsplyString, CarrReturn, set_XY_pos, save_XY_pos, ClearBoth, ClearLine, ClearScreen, DispText, unsetPrompt
  227. @ReDoWindow
  228. Function:    Redraw the geoSHELL window and any text that was already contained in it.
  229. Pass:    nothing
  230. Return:    nothing
  231. Destroys:    no guarant
  232. @ReDoWindow
  233. Function:    Redraw the geoSHELL window and any text that was already contained in it.
  234. Pass:    nothing
  235. Return:    nothing
  236. Destroys:    no guarantees
  237. Description:    When your command performs some sort of action that might disrupt the geoSHELL window, call this routine to restore it. The text that is contained in the memory buffer will be restored to the window after the window is redrawn.
  238. Example:
  239.     jsr    ClearScreen
  240.     ...        ;do something on the screen.
  241.     jsr    ReDoWindow    ;redraw the window as it was.
  242.     jmp    ExitCommand    ;and exit cleanly.
  243. See Also:    ResetScreen, ClearRemainder, ClearWindow, EraseWindow, ReDisplayWindow, DispLetter, DriveLetter, DsplyLine, DsplyString, CarrReturn, set_XY_pos, save_XY_pos, ClearBoth, ClearLine, ClearScreen, DispText, unsetPrompt
  244. @ResetFromPath
  245. Function:    Reset a CMD device back from the path partition to the current partition the user 
  246. @ResetFromPath
  247. Function:    Reset a CMD device back from the path partition to the current partition the user is operating in.
  248. Pass:    nothing
  249. Return:    nothing
  250. Destroys:    no guarantees
  251. Description:    After calling any routine that does a file search on a path partition, call this routine to put the drive back to it's proper partition. If you do not, then the drive will remain in the partition that is defined as the path partition if the desired file was found on the path partition. It is up to your command to do this. This way, the path partition can remain open until you are finished with it.
  252. Example:
  253.     jsr    ParamName    ;get the filename.
  254.     bit    goodflag    ;is it valid?
  255.     bmi    10$    ;branch if so.
  256.     jmp    MissgFilename    ;do an error message and exit.
  257.     jsr    CkPath    ;check the path partition
  258.     bit    goodflag    ;for the file.
  259.     bmi    20$    ;branch if found.
  260.     jmp    FileNotAvail    ;otherwise do a file not
  261.             ;available error and exit.
  262.     ...        ;do what your command intends
  263.     ...        ;at this point.
  264.     jsr    ResetFromPath    ;restore the original partition.
  265.     inc    NUM_IN_NAME    ;ParamName sets this variable.
  266.     lda    NUM_IN_NAME
  267.     jsr    IncCmdPointer    ;point to the next command.
  268.     jmp    ExitCommand    ;and exit cleanly.
  269. See Also:    CkPresdrive, CkThisDrive, CkOtherDrives, CkPathOrder, CkPath, CkForDisk, FindParName
  270. @ResetScreen
  271. Function:    Display a fresh geoSHELL screen in the correct mode.
  272. Pass:    nothing
  273. Return:    nothi
  274. @ResetScreen
  275. Function:    Display a fresh geoSHELL screen in the correct mode.
  276. Pass:    nothing
  277. Return:    nothing
  278. Destroys:    a, x, y, r0-r15
  279. Description:    This will completely clear the screen and redraw it fresh in the current mode (40 or 80 columns). The geoSHELL window will be redrawn and the cursor will be positioned to the left side of line one.
  280. Example:
  281.     jsr    ResetScreen    ;wipe the screen and start over.
  282. See Also:    ResetScreen, ClearRemainder, ClearWindow, EraseWindow, ReDisplayWindow, DispLetter, DriveLetter, DsplyLine, DsplyString, CarrReturn, set_XY_pos, save_XY_pos, ClearBoth, ClearLine, ClearScreen, DispText, unsetPrompt
  283. @R_Icons
  284. Function:    Restore the default geoSHELL icon.
  285. Pass:    nothing
  286. Return:    otherPressVector - set for mouse positioning of cursor.
  287.     Close icon - set to exit to Desktop or the calling interface that geoSHELL was entered from.
  288.     Mouse limits - set to default settings.
  289. Destoys:    a, x, y, r0-r11
  290. Description:    If your command does anything to change the icon status that the GEOS kernal is controlling, or otherPressVector, or the mouse position limits, call this routine to fix the problem. This will inform GEOS that the icon at the upper right of the geoSHELL window is there. Some actions might kill this icon, thereby making it necessary to call this routine before exiting your command. While testing your command, be sure to check the icon by clicking on it to see if it is still active after exiting your command. If not, then add the call to this routine before exiting. If you exit to NoMoreCmds, this will be done for you. It actually does no harm to call this routine before exiting your command even if your command does nothing to change these things.
  291. Example:
  292.     jsr    R_Icons    ;fix the close icon.
  293.     jmp    ExitCommand    ;all done with command.
  294. See Also:
  295. @SaveToREU
  296. Function:    Copies geoSHELL and Input driver info to REU.
  297. Pass:    nothing
  298. Return:    nothing
  299. Destroys:    a, x, y, r0-r3
  300. Description:    When geoSHELL is activated, it installs itself as the default user interface into the GEOS kernal in place of the Desktop. If the user were to exit to BASIC and then use RBOOT to get back into geoSHELL, the Desktop would then be the default interface. This routine fixes that problem. The same thing would happen if the user were to change input drivers. So, for that reason, the 'install' command calls this routine also. Only the portion of the kernal that contains the needed info for the user interface and the input driver is copied to the GEOS kernal area of the REU. There probably is no reason to use this routine unless your command should affect the input driver in some way, such as a patch would. Then you would want to call this routine to insure the patch would be used in an RBOOT situation.
  301.     Should there be no REU, no harm is done since the routine will simply rts if no REU is present.
  302. Example:
  303. See Also:
  304. @save_XY_pos
  305. Function:    Save the current values of r1H and r11 into two variab
  306. @save_XY_pos
  307. Function:    Save the current values of r1H and r11 into two variables.
  308. Pass:    r1H - the current desired pixel location of the cursor.
  309.     r11 - the desired horizontal pixel location of the cursor.
  310. Return:    cur_X_pos will hold the value that was in r11.
  311.     cur_Y_pos will hold the value that was in r1H.
  312. Destroys:    a
  313. Description:    This routine allows you to bypass geoSHELL's management routines and physically relocate the cursor on the screen, if only temporary. Once your command exits, geoSHELL might again take control and properly place it.
  314.     There is really no need to use this routine since most of your needs can be handled through other routines that let geoSHELL handle the text displaying and cursor positioning.
  315. Example:
  316. ;this example serves no real purpose other than to show
  317. ;how this routine could be used. First r1H and r11 are loaded
  318. ;with values that correspond to the upper area of the screen.
  319. ;This location is 10 pixels down from the top and 48 pixels
  320. ;over from the left side. Then save_XY_pos is used to save
  321. ;these values to their proper locations and OtherMessage will
  322. ;then print a message at the top of the screen instead of
  323. ;in the geoSHELL window.
  324.     LoadB    r1H,#10
  325.     LoadW    r11,#48
  326.     jsr    save_XY_pos
  327.     LoadW    r0,#upperText
  328.     lda    #0
  329.     jsr    OtherMessage
  330. See Also:    set_XY_pos
  331. @Searching
  332. Function:    Display the 'Searching For Filename' message.
  333. Pass:    nosearchm
  334. @Searching
  335. Function:    Display the 'Searching For Filename' message.
  336. Pass:    nosearchmessage - cleared to zero. (it is normally zero and also is always cleared by this routine)
  337.     a2 - null terminated filename to display in the message.
  338. Return:    message displayed on screen.
  339. Destroys:    no guarantees
  340. Description:    This routine merely needs a2 to be pointing at a null-terminated filename, and that filename will be included in a message that will be displayed to the screen, such as, 'Searching For Filename'. This is basically just another internal geoSHELL message that can also be called with the routine, Message. 'Searching For' is message number 2. Usually, the entire line the cursor is currently on will be cleared first before displaying this message. The message will always start on the third character location and perform a carriage return afterwards.
  341.     Whenever the routine CkAllDrives is being used to search for a file, this routine is automatically called. So, if you wish the 'Searching For ...' message to be displayed you need not do anything when CkAllDrives is being used. For any other searching function, such as CkThisDrive, you would have to call this routine. If you wish to have CkAllDrives 'not' call this routine, then set the variable nosearchmessage to 128. It is not necessary to reset this variable afterwards since it is automatically reset.
  342. Example:
  343.     jsr    ParamName    ;get the filename.
  344.     bit    goodflag    ;is there one?
  345.     bmi    10$    ;branch if so.
  346.     jmp    MissgFilename    ;display error and exit.
  347.     jsr    Searching    ;display searching message.
  348.     jsr    CkPresdrive    ;look on the current drive.
  349.     bit    goodflag    ;did we find the file?
  350.     bmi    20$    ;branch if so.
  351.     jmp    FileNotAvail    ;display an error and exit.
  352.     ...        ;continue on...
  353. See Also:
  354. @SendCmd
  355. Function:    Send a string of bytes to the drive's command channel.
  356. Pass:    a - real device number of desired drive.
  357.     r0 - points to the byt
  358. @SendCmd
  359. Function:    Send a string of bytes to the drive's command channel.
  360. Pass:    a - real device number of desired drive.
  361.     r0 - points to the bytes to send.
  362.     cmdlength - number of bytes (1-255) to send. A zero here will send 256 bytes.
  363.     Be sure to purge the turbo code from the drive that the command is being sent to, and call InitForIO also.
  364. Return:    goodflag - set if the drive responded and accepted the bytes.
  365.     r0 - unchanged.
  366. Destroys:    a, x, y
  367. Description:    This routine may be used to send any string of bytes to a drive that is connected to the computer. In fact, it does not have to be one of the drives that GEOS is working with. Just point r0 at the string of bytes, and set cmdlength to the number of bytes you wish to send, load the accumulator with the (real) device number of the desired drive and call this routine.
  368.     Don't forget to purge the turbo code in the drive and call InitForIO before calling this routine.
  369. Example:
  370. ;this example will send a string to the drive's command channel
  371. ;that will cause a drive to initialize the disk.
  372.     jsr    PurgeAllTurbos    ;let's kill all the turbos.
  373.     jsr    InitForIO    ;pop out of GEOS.
  374.     LoadW    r0,#iText    ;point r0 to bytes.
  375.     LoadB    cmdlength,#2    ;load cmdlength with # of bytes.
  376.     lda    driveNum    ;get the device number.
  377.     jsr    SendCmd    ;send the command.
  378.     bit    goodflag    ;did the drive take it?
  379.     bmi    20$    ;branch if so.
  380.     jsr    DoneWithIO    ;pop back into GEOS.
  381.     jmp    DoError    ;do an error of some sort.
  382.     ...        ;continue on...
  383. iText:
  384.     .byte    "I0"    ;initialize command.
  385. ne, then set the variable nosearchmessage to 128. It is not necessary to reset this variable afterwards since it is automatically reset.
  386. Example:
  387.     jsr    Param
  388. driveNum:
  389.     .byte    8    ;drive number stored here.
  390. See Also:    PurgeAllTurbos, ReadChannel, SendListen, SendTalk, GetRealDriveNum
  391. @SendList
  392. @SendListen
  393. Function:    Get a drive's attention and send it a command.
  394. Pass:    a - real device number of desired drive.
  395.     cmdtosend - the secondary command byte to send to the drive.
  396.     You must purge the turbo code in the drive and call InitForIO before calling this routine.
  397. Return:    goodflag - set if device is responding.
  398.     the device - still in the 'Listen' mode (if goodflag is set) and will accept more bytes on the serial bus.
  399. Destroys:    a
  400. Description:    This routine will prepare a drive to receive bytes on the serial bus. After setting up and calling this routine, if goodflag is set, then you may continue to send bytes on the serial bus using the kernal routine, Ciout, and the drive will continue receiving them. Just load cmdtosend with a byte to send as a secondary command and load the accumulator with the device number of the desired drive and call this routine. Then just keep sending bytes through Ciout. When finished, just call the kernal routine Unlsn, and it will tell the drive we are finished sending bytes.
  401. Example:
  402. ;this particular example will open a sequential file on the current
  403. ;drive so that it's contents may be read into the computer.
  404.     jsr    ParamName    ;get a filename.
  405.     bit    goodflag    ;is it valid?
  406.     bmi    10$    ;branch if so.
  407.     jmp    MissgFilename    ;display bad parameter.
  408.     lda    PRESDRIVE
  409.     jsr    GetRealDriveNum    ;get the real device number.
  410.             ;this will also purge all turbos.
  411.     bit    goodflag    ;is this a real drive?
  412.     bmi    20$    ;branch if so.
  413.     LoadW    r0,#notRealText    ;display an error message,
  414.     lda    #(IN_TWO|TR_CR)
  415.     jsr    OtherMessage
  416.     jmp    NoMoreCmds    ;and exit.
  417.     jsr    InitForIO    ;pop out of GEOS.
  418.     LoadB    cmdtosend,#(3|$f0)    ;open channel 3,
  419.     lda    REALDRIVE    ;in this particular device,
  420.     jsr    SendListen    ;attempt to open it.
  421.     bit    goodflag    ;was it successful?
  422.     bmi    30$    ;branch if so.
  423.     jsr    DoneWithIO    ;otherwise,
  424.     LoadW    r0,#notRespText    ;do an error message.
  425.     lda    #(IN_TWO|TR_CR)
  426.     jsr    OtherMessage
  427.     jmp    NoMoreCmds    ;
  428.     bit    goodflag    ;was it successful?
  429.     bmi    30$    ;branch if so.
  430.     jsr    DoneWithIO    ;otherwise,
  431.     LoadW    r0,#notRespText    ;do an error message.
  432.     lda    #(IN_TWO|TR_CR)
  433.     jsr    OtherMessage
  434.     jmp    NoMoreCmds    ;and exit.
  435.     ldy    #0
  436.     lda    (a2),y    ;open the channel with
  437.     jsr    Ciout    ;our filename.
  438.     cpy    NUM_IN_NAME    ;have we sent the whole
  439.             ;filename?
  440.     bne    40$    ;branch if not.
  441.     lda    #CR    ;send a carriage return
  442.     jsr    Ciout    ;to the drive.
  443.     jsr    Unlsn    ;make it do it's thing.
  444.     lda    REALDRIVE
  445.     jsr    ReadChannel    ;see if it did it's thing.
  446.     bit    goodflag    ;check goodflag first.
  447.     bpl    25$
  448.     lda    EnOfShell+0    ;did the error channel
  449.     cmp    #'0'    ;return '0' in the first byte?
  450.     bne    25$    ;branch if not.
  451.     cmp    EnOfShell+1    ;how about the second byte?
  452.     bne    25$    ;branch if not.
  453.     LoadB    cmdtosend,#(3|$60)    ;get the channel ready
  454.     lda    REALDRIVE    ;for reading.
  455.     jsr    SendTalk
  456.     bit    goodflag    ;is it ready?
  457.     bpl    25$    ;branch if not.
  458.     LoadW    r0,#buffer    ;point r0 at our buffer.
  459.     LoadB    STATUS,#0    ;be sure to clear STATUS.
  460.     ldy    #0
  461.     jsr    Acptr    ;read a byte from the drive.
  462.     sta    (r0),y    ;store it in our buffer.
  463.     iny        ;increment for the next byte.
  464.     bne    60$
  465.     inc    r0H
  466.     lda    r0H    ;have we reached the end
  467.     cmp    #$7f    ;of our buffer?
  468.     beq    70$    ;branch if so.
  469.     lda    STATUS    ;is this the end of file
  470.             ;or any other error?
  471.     beq    50$    ;branch if not.
  472.     jsr    Untalk    ;stop the drive.
  473.     LoadB    cmdtosend,#(3|$e0)    ;and close the channel.
  474.     lda    REALDRIVE
  475.     jsr    SendListen
  476.     jsr    Unlsn
  477.     jsr    DoneWithIO    ;pop back into GEOS.
  478.     ...        ;at this point, we have
  479.     ...        ;a buffer filled with the
  480.     ...        ;bytes from the file that
  481.     ...        ;the user desired and our
  482.     ...        ;command may continue to do
  483.     jsr    DoneWithIO    ;pop back into GEOS.
  484.     ...        ;at this point, we have
  485.     ...        ;a buffer filled with the
  486.     ...        ;bytes from the file that
  487.     ...        ;the user desired and our
  488.     ...        ;command may continue to do
  489.     ...        ;as it is designed to do.
  490. notRealText:
  491.     .byte    "This Is Not A REAL Drive!",0
  492. notRespText:
  493.     .byte    "The Drive Is Not Responding!",0
  494. See Also:    PurgeAllTurbos, ReadChannel, SendCmd, SendTalk, GetRealDriveNum
  495. @SendTalk
  496. Function:    Get a drive's attention and send it a command to prepare it for talking.
  497. Pass:    a - real device number of desired drive.
  498.     cmdtosend - the secondary command byte to send to the drive.
  499.     You must purge the turbo code in the drive and call InitForIO before calling this routine.
  500. Return:    goodflag - set if device is responding.
  501.     the device - is in the 'Talk' mode (if goodflag is set) and will send bytes to the computer by using the kernal routine 'Actpr'.
  502. Destroys:    a
  503. Description:    This routine will prepare a drive to send bytes on the serial bus. After setting up and calling this routine, if goodflag is set, then you may begin receiving bytes on the serial bus using the kernal routine Acptr. Just load cmdtosend with a byte to send as a secondary command and load the accumulator with the device number of the desired drive and call this routine. Then just keep receiving bytes through Acptr until STATUS is any non-zero value. When finished, use the kernal routine Untalk to tell the drive we are finished receiving bytes.
  504. Example:    Refer to the example in the description for the routine 'SendListen'. It includes an example of how to use SendTalk.
  505. See Also:    PurgeAllTurbos, ReadChannel, SendCmd, SendTalk, GetRealDriveNum
  506. @Send_GC_Byte
  507. Function:    Send a byte to a printer via a geoCable connected to the user port.
  508. Pass:    a - byte to send.
  509.     InitForIO must be called before accessing this routine.
  510. Return:    nothing - no er
  511. @Send_GC_Byte
  512. Function:    Send a byte to a printer via a geoCable connected to the user port.
  513. Pass:    a - byte to send.
  514.     InitForIO must be called before accessing this routine.
  515. Return:    nothing - no error checking is performed
  516. Destroys:    a
  517. Description:    This routine will send the byte contained in the accumulator to a parallel printer connected to the user port via a geoCable. No error checking is done. If the routine returns, the byte was sent, and you can send another one if desired. It is a good idea to call Open_GC_Channel before this one to verify the presence of a printer before using this routine. Otherwise, if the printer is not accepting the byte, the routine might just wait until it does so. That could be forever. As long as Open_GC_Channel returns with x=0 then it is OK to use this routine to send data to the printer.
  518. Example:
  519. ;this example will send the bytes contained in a buffer to the
  520. ;printer. r0 points to the start of the buffer and r2 points to
  521. ;the byte just past the end of the buffer. If this example returns
  522. ;with goodflag set, the buffer was sent to the printer.
  523. SendBuffer:
  524.     jsr    InitForIO    ;pop out of GEOS.
  525.     jsr    Open_GC_Channel    ;check for a printer.
  526.     txa        ;check if x = 0.
  527.     beq    10$    ;branch if so.
  528.     jsr    DoneWithIO    ;pop back into GEOS.
  529.     jmp    nogood    ;signal calling routine of error.
  530.     ldy    #0    ;y will stay at zero throughout
  531.             ;the sending of text.
  532.     lda    (r0),y    ;get a byte from the buffer.
  533.     jsr    Send_GC_Byte    ;send it to the printer.
  534.     inc    r0L    ;point at the next byte.
  535.     bne    30$
  536.     inc    r0H
  537.     sec        ;have we reached the end?
  538.     lda    r0L
  539.     sbc    r2L
  540.     lda    r0H
  541.     sbc    r2H
  542.     bcc    20$    ;branch if not.
  543.     jsr    DoneWithIO    ;pop back into GEOS.
  544.     jmp    yesgood    ;and te
  545.     jsr    DoneWithIO    ;pop back into GEOS.
  546.     jmp    yesgood    ;and tell the calling routine
  547.             ;everything went OK.
  548. See Also:    Open_GC_Channel
  549. @SetBrdrColor
  550. @SetBrdrColor
  551. Function:    Change the color of the 80 column screen's border.
  552. Pass:    brdrcolor - color (0-15).
  553. Return:    border color changed.
  554. Destroys:    a, x, temp_check
  555. Description:    This routine will change the color of the 80 column screen's border to the color that is stored in brdrcolor. Your routine must check to be sure that the machine is a 128 before calling this routine. It should also check the videomode to make sure that the computer is not in monochrome mode.
  556. Example:
  557. ;this example is a routine that will change the border to blue.
  558. BlueBorder:
  559.     bit    videomode    ;128 in RGB mode?
  560.     bmi    10$    ;branch if so.
  561.     LoadB    brdrcolor,#DK80BLUE
  562.     jmp    SetBrdrColor    ;change the border
  563.             ;to blue.
  564. See also:    ColorScreen, FixColors
  565. @SetDrName
  566. Function:    Display drive letter, drive type, and disk name.
  567. Pass:    a - desired drive number (8-11) representing drive A-D.
  568. Return:    goodflag - meaningless with this ro
  569. @SetDrName
  570. Function:    Display drive letter, drive type, and disk name.
  571. Pass:    a - desired drive number (8-11) representing drive A-D.
  572. Return:    goodflag - meaningless with this routine.
  573. Destroys:    no guarantees
  574. Description:    Load the accumulator with a device number (8-11) representing any of the available drives or ramdisks and call this routine to display the drive letter, the drive type, and the name of the disk that is in the drive. Both the 'status' and the 'dir' commands call this routine. The status command will call it once for each of the drives that are being used. The line the cursor is on will be cleared before the text is displayed.
  575. Example:
  576. ;suppose you wanted to create a command that would display various
  577. ;bits of information about a drive and the disk that it contains.
  578. ;You could call SetDrName to start with and then test the drive
  579. ;and disk to get other bits of info to display.
  580.     lda    ParamTable+1    ;make sure only one
  581.     jsr    CkTerminators    ;parameter was used for this.
  582.     bmi    10$    ;branch if so.
  583.     jmp    MissgFilename    ;display bad parameter.
  584.     lda    ParamTable+0    ;get the parameter.
  585.     jsr    CkDrvLetter    ;convert it to 8-11.
  586.     bit    goodflag    ;did it convert OK?
  587.     bpl    5$    ;branch if not.
  588.     jsr    SetDrName    ;display some stuff.
  589.     ...        ;now we can continue
  590.     ...        ;testing the drive...
  591. See Also:    Dir, MissDisk, Status, CkDrvLetter, CkForDisk
  592. @SetPartParams
  593. Function:    Set 
  594. @SetPartParams
  595. Function:    Set up some internal variables for the current partition.
  596. Pass:    curdrvtype - Set this variable by calling GetRealDriveNum first.
  597.     a - real device number from REALDRIVE after calling GetRealDriveNum.
  598. Return:    goodflag - set if a CMD device with partitions.
  599.     certain internal variables will contain information about the current partition on the desired device.
  600. Destroys:    a, x, y, r0
  601. Description:    The main purpose of this routine is to establish the information that geoSHELL needs for the current partition of a particular drive. If you were to open a different partition such as what happens when geoSHELL accesses commands on the path partition, then with this information, the original partition and drive is known so that it may be restored. Until the partition is restored, the routine should not be used again. Once the partition is restored, either through the required call to ResetFromPath, OpenCurPartition, or InitCurPartition, then SetPartParams may be used again in order to set up for another partition to be opened. Even when your command intends to open a partition through a call to OpenPartition, and leave that partition open with no intentions of returning to the original one, this routine still needs to be called. This is because OpenPartition checks to make sure that the desired partition to open is of the same type as the current one so that it is compatible with the disk driver that is being used with GEOS on that drive.
  602. Example:    Refer to OpenPartition for an example of how to use this routine.
  603. See Also:    InitCurPartition, OpenCurPartition, ResetFromPath, OpenPathPartition, SetPartParams
  604. @SetThisDevice
  605. Function:    A substitute for the GEOS rou
  606. @SetThisDevice
  607. Function:    A substitute for the GEOS routine 'SetDevice'.
  608. Pass:    a - drive number 8-11.
  609. Return:    goodflag - set if device is now ready.
  610.     x - contains zero or error number if any from GEOS.
  611. Destroys:    a, x, y
  612. Description:    This routine is a recommended substitute for the GEOS kernal routine 'SetDevice'. During it's execution, it still calls SetDevice, but also does some other checking. It also does a jump through yesgood or nogood for setting goodflag. During geoSHELL development, it was discovered that some disk drivers that are used in GEOS would mysteriously lock up under certain circumstances. This lock up occured while calling SetDevice. The lockup required just the right conditions for it to occur. By calling this routine instead of SetDevice, you will still accomplish the same function but with less chance of any problems occuring under these conditions.
  613. Example:
  614. ;this example expects a drive letter from the user following the
  615. ;command. After the usual checking of the parameter, SetThisDevice
  616. ;is called and the command proceeds to execute.
  617.     lda    ParamTable+1    ;only one parameter needed.
  618.     jsr    CkTerminators
  619.     bit    goodflag
  620.     bmi    10$    ;branch if one parameter.
  621.     jmp    MissgFilename    ;display bad parameter.
  622.     lda    ParamTable+0    ;get the parameter.
  623.     jsr    CkDrvLetter    ;set it to 8-11.
  624.     bmi    goodflag    ;is it 8-11?
  625.     bpl    5$    ;branch if not.
  626.     jsr    SetThisDevice    ;Set the Device.
  627.     bit    goodflag    ;everything OK?
  628.     bmi    20$    ;branch if so.
  629.     LoadW    r0,#noDriveText    ;do an error message.
  630.     lda    #(IN_TWO|TR_CR)
  631.     jsr    OtherMessage
  632.     jmp    NoMoreCmds    ;and exit.
  633.     ...        ;continue on...
  634. noDriveText:
  635.     .byte    "Drive Not Available!",0
  636.     .byte    "Drive Not Available!",0
  637. See Also:    CkForDisk
  638. @set_XY_pos
  639. Function:    Load r1H and r11 with the pixel values of the current cursor position.
  640. Pass:    nothin
  641. @set_XY_pos
  642. Function:    Load r1H and r11 with the pixel values of the current cursor position.
  643. Pass:    nothing
  644. Return:    r1H holds the vertical pixel location of the cursor.
  645.     r11 holds the horizontal pixel location of the cursor.
  646. Destroys:    a
  647. Description:    Used by internal geoSHELL routines or your routines if you need to do any manual displaying of text to the screen. Text displaying is normally handled nicely by geoSHELL with other routines, so you rarely would have a need to call this routine.
  648. Example:    See save_XY_pos for an example of how to use this routine.
  649. See Also:    save_XY_pos
  650. @Status
  651. Function:    Display information for each of the connected drives.
  652. Pass:    nothing
  653. Return:    inf
  654. @Status
  655. Function:    Display information for each of the connected drives.
  656. Pass:    nothing
  657. Return:    information on the screen.
  658.     goodflag is meaningless here.
  659. Destroys:    no guarantees.
  660. Description:    This is the routine that the 'status' command calls. In fact, this is the status command. You can use this if you need to show the drives that are currently online. The swap command calls this to display the arrangement of the drives after it performs the swap.
  661. Example:
  662.     jsr    Status
  663. See Also:    Dir, MissDisk, SetDrName, CkDrvLetter, CkForDisk
  664. Example:
  665.     jsr    ParamName    ;get the filename.
  666.     bit    goodflag    ;is there one?
  667.     bmi    10$    ;
  668. @StripRulers
  669. Function:    Strip the GeoWrite rulers, escapes and any other unwanted characters from a GeoWrite page loaded into memory.
  670. Pass:    r0 - start of null terminated buffer.
  671.     r2 - location to save converted buffer to.
  672. Return:    buffer stripped, null-terminated, and located where r2 was pointing when the routine was called.
  673.     goodflag - affected, but meaningless with this routine.
  674.     r2 - points at the zero byte that ends the buffer.
  675. Destroys:    a, x, y, r0, r2
  676. Description:    This routine will take a GeoWrite page that is loaded into memory and convert in such a way that you will be left with only ASCII text. Load r0 with start of the buffer and r2 with the start of the area to save the converted buffer to. r2 must be less than or equal to r0, or it can point past the end of the buffer that r0 is pointing at. Normally, you would set r2 equal to r0 so that the buffer will remain in the same location. This will strip the GeoWrite rulers, escapes and any other unwanted characters.
  677.     The only hitch to this routine is that it was designed for the startup and exec commands. This means that carriage returns and tabs are converted to a single space. In fact, any byte that is less than a 32 or greater than a 126 is converted to a space. For an exec file, this ends up making it basically one long command line. Remember that geoSHELL allows more than one command to be on a line, so it has no use for any carriage returns.
  678.     After this routine is called, the only byte in the buffer that will fall outside of 32-126 will be the last one and it will be a zero byte.
  679. Example:
  680.     lda    #[buffer
  681.     sta    r0L
  682.     sta    r2L
  683.     lda    #]buffer
  684.     sta    r0H
  685.     sta    r2H
  686.     jsr    StripRulers
  687. See Also:    AdjTxtPointer, Message, OtherMessage, DsplyLine, DsplyString, CarrReturn, ClearLine, ClearBoth, ClearRemainder, CkESC_RULER, set_XY_pos, save_XY_pos, MskCtrlCodes, ConvToAscii, DispText
  688. @Switch
  689. Function:    Switch 40/80 column modes on a 128.
  690. Pass:    nothing
  691. Return:    screenmode - reflects the switched mode.
  692.     if 64 mode - does not return.
  693. Destroys:    no guarantees
  694. Description:    This is the routine th
  695. @Switch
  696. Function:    Switch 40/80 column modes on a 128.
  697. Pass:    nothing
  698. Return:    screenmode - reflects the switched mode.
  699.     if 64 mode - does not return.
  700. Destroys:    no guarantees
  701. Description:    This is the routine that the 'switch' command jumps to. In fact, this is the switch command, and will act just as if the user entered the command. If this routine is accessed in 64 mode, the user will be presented with a message stating '128 Only Command' and will promptly jump through NoMoreCmds, thereby ending your command. So, you would want to check screenmode to make sure that the machine is a 128 before using this routine, unless you intend for this to happen.
  702. Example:
  703. ;this example is actually the source code for a possible command
  704. ;that could be called 'srun'. This will check the screenmode of a file
  705. ;before it is loaded, and it will give the user the option of
  706. ;switching screens or aborting. The routine CkModeFlag is called in
  707. ;this command to check if the file is compatible with the machine.
  708. ;The various values that can be returned in x by this routine can
  709. ;be found in the appendix.
  710. SRun:
  711.     jsr    ParamName    ;get the filename.
  712.     bit    goodflag    ;was there one?
  713.     bmi    20$    ;branch if so.
  714.     jmp    MissgFilename    ;display bad parameter.
  715.     jsr    CkAllDrives    ;look for the file.
  716.     bit    goodflag    ;did we find it?
  717.     bmi    20$    ;branch if so.
  718.     jmp    FileNotAvail    ;display not available.
  719.     jsr    GetHeader    ;get the file's header block.
  720.     bit    goodflag    ;is it a GEOS file?
  721.     bpl    80$    ;branch if not and then try
  722.             ;to run it.
  723.     jsr    CkModeFlag    ;see if it's compatible?
  724.     bit    goodflag    ;well?
  725.     bmi    80$    ;branch if so and run it.
  726.     bit    screenmode    ;check the mode we're in.
  727.     bvs    90$    ;branch if 64 mode (can't run).
  728. ;at this point we know that we are running on a 128. All we need
  729. ;to check for is if the file is for 64 only. The only other
  730. ;possibility would be if we need to switch from 40 to 80 or
  731. ;from 80 to 40. So, if not 64 mode, then we can switch screens
  732. ;from 80 to 40. So, if not 64 mode, then we can switch screens.
  733. ;if x = 36 " is for 40 columns!"
  734. ;if x = 37 " is for 128-40 columns!"
  735. ;if x = 38 " is for 128-80 columns!"
  736. ;if x = 39 " is for 128 mode!"
  737. ;if x = 40 " is for 64 mode!"
  738. ;if x = 41 " is not a GEOS file!"
  739.     cpx    #40    ;is the file for 64 only?
  740.     beq    90$    ;branch if so (can't run).
  741.     txa        ;save x for now.
  742.     MoveW    a2,r0    ;display the filename...
  743.     lda    #(IN_TWO|TR_ONE)    ;stay on the same line...
  744.     jsr    OtherMessage
  745.     txa        ;restore x and...
  746.     lda    #TR_CR
  747.     jsr    Message    ;display the mode the file
  748.             ;is designed for.
  749.     LoadW    r0,#switchText    ;display a requestor
  750.     lda    #(IN_TWO|TR_CR)    ;to switch screens.
  751.     jsr    OtherMessage
  752.     jsr    Wait    ;wait for user input.
  753.     lda    st_KeyData    ;get the key that was pressed.
  754.     cmp    #25    ;was it a 'y'.
  755.             ;(keycode, not ascii code)
  756.     beq    50$    ;branch if so.
  757.     jmp    NoMoreCmds    ;any other key will abort.
  758.     jsr    Switch    ;switch screens.
  759.     jmp    DoRun    ;hand the job over to
  760.             ;geoSHELL to run the file.
  761.     jmp    CantRun    ;tell the user, no go.
  762.             ;(this would be your own
  763.             ;error routine)
  764. switchText:
  765.     .byte    "Would You Like To Switch Screens?  y/n",0
  766. See Also:    CkModeFlag, DoRun
  767. @unsetPrompt
  768. @unsetPrompt
  769. Function:    Turn the blinking cursor off.
  770. Pass:    nothing
  771. Return:    cursor is turned off.
  772. Destroys:    nothing
  773. Description:    If you wish to turn the cursor on, it is a simple matter to do so. Just set bit 7 of cursorOn. But to turn it off requires more work. This routine will do it for you. It has to make sure that the cursor isn't currently in the visible stage with the character under it in reverse video. If so, it will erase the cursor and reverse the character and then it will make sure that it stays off by clearing bit 7 of cursorOn. Of course, you do not need to access this routine unless you have already turned the cursor on for user input of some sort and then wish it turned back off.
  774.     If your routine does an rts to have GEOS mainloop handle your input stuff, then you might want to turn the cursor off if you are not working with any text input. Otherwise, you might have a blinking cursor right in the middle of the graphic that you just displayed on the screen while waiting for the user to click on an icon. This would not look good.
  775. Example:
  776. See Also:
  777. g    ;is there one?
  778.     bmi    10$    ;
  779. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
  780. @Wait
  781. Function:    Wait for the user to press a key.
  782. Pass:    nothing
  783. Return:    st_keyData contains the keycode (not ascii value) of the key that was pressed.
  784.     goodflag - meaningless, it is always set by this routine.
  785. Destroys:    a, x, y, r3L
  786. Description:    This routine is similar to YesKeypress, except that it turns the mouse off while it is waiting for the user to press a key. This prevents the user from being able to click on geoSHELL's close icon, instead of pressing a key.
  787. Example:
  788.     jsr    Wait    ;wait for a keypress with the
  789.             ;mouse turned off.
  790.     ...        ;continue on...
  791. See Also:    NoKeypress, ClrKeyData, CkKeyboard, YesKeypress
  792. @yesgood
  793. Functi
  794. @yesgood
  795. Function:    Usually identifies a successful routine.
  796. Pass:    nothing
  797. Return:    goodflag - bit 7 set.
  798. Destroys:    nothing
  799. Description:    geoSHELL uses this routine extensively. It and nogood are the universal routines for identifying successes and failures. This routine actually does nothing more than set a flag (goodflag) to give an indication to a calling routine that a success occured. All the calling routine has to do is check goodflag with the bit instruction. It will be minus if yesgood set it. As an example, the routine 'CkForDisk' will jump through yesgood upon exit of the routine if it found a formatted disk in the drive.
  800.     It's true that the carry flag or some other form of error checking could have been used, but it's also possible that the x register or the carry flag could change before we are ready to check it. We have more control over how goodflag is affected, and can do some processing before checking it if needed.
  801. Example:
  802. ;this particular example will test an 80 character buffer for any
  803. ;non-space character. If a non-space character is found, then it
  804. ;will return with goodflag set by calling yesgood.
  805. CkNonSpace:
  806.     ldx    #0
  807.     lda    charBuffer,x    ;get a character from the buffer.
  808.     beq    20$    ;branch if null encountered.
  809.     cmp    #' '    ;is it a space?
  810.     bne    40$    ;branch if not.
  811.     inx        ;point at the next byte.
  812.     cpx    #80    ;have we reached the maximum?
  813.     bne    10$    ;branch if not.
  814.     jmp    nogood    ;signal no non-spaces found.
  815.     jmp    yesgood    ;signal at least one
  816.             ;non-space found.
  817. See Also:    nogood
  818. Example:
  819. See Also:
  820. g    ;is there one?
  821.     bmi    10$    ;
  822. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
  823. @YesKeypress
  824. Function:    Wait for the user to press a key.
  825. Pass:    nothing
  826. Return:    st_keyData contains the keycode (not ascii value) of the key being pressed.
  827.     goodflag - always cleared by this routine.
  828. Destroys:    a, x, y
  829. Description:    Call this routine when you need a keypress from the user. The Commodore keycode value as listed in the 64 or 128 Programmer's Reference Manual will be returned in st_KeyData. This routine will hold the computer indefinitely until a key is pressed. The value in goodflag is meaningless upon return, however be cautious that you pass the correct value to the next routine in your command because goodflag will always be reset to zero by this routine.
  830. Example:
  831. ;this example will check for the user to press the spacebar.
  832. ;Of course, any other key could also be checked for, or
  833. ;all of them.
  834. CkForSpace:
  835.     jsr    YesKeypress    ;wait for the user to
  836.             ;press a key.
  837.     lda    st_keyData    ;get the keycode of the key
  838.             ;the user is pressing.
  839.     cmp    #60    ;is it the spacebar?
  840.     beq    10$    ;branch if so.
  841.     jmp    nogood    ;inform the calling routine
  842.             ;that the spacebar was not
  843.             ;pressed.
  844.     jmp    yesgood    ;inform the calling routine
  845.             ;that the spacebar was
  846.             ;pressed.
  847. See Also:    NoKeypress, ClrKeyData, CkKeyboard, Wait
  848. @-- NOTES --
  849. The geoSHELL Programmer's Development Package    2-PAGE
  850. een used, but it's also possible that the x register or
  851. @-- NOTES --
  852. The geoSHELL Programmer's Development Package    2-PAGE
  853. een used, but it's also possible that the x register or the carry flag could change before we are ready to check it. 
  854. The geoSHELL Programmer's Development Package    2-PAGE
  855.