Description: This routine will clear the screen with the default background pattern as established by the command 'backpatt'. By using this routine, geoSHELL will take care of whatever screenmode is being used. This also takes care of the proper screen coloring if the user is in 80 column color mode. By adjusting the above mentioned variables (back40pattern, etc) you can change the pattern that is used.
Description: Calling this routine will clear any text that is displayed in the geoeSHELL window. The buffer that is holding the text internally is also cleared and the cursor position is reset to be at the top left of the window. This is what takes place when the user hits SHIFT CLR/HOME.
Description: Call this routine to clear out any keypresses that GEOS has detected. This might be needed when the user has pressed a key before your routine actually gets handled. After executing this routine, you can then get a valid keypress. This routine will also wait for the user to let go of the keyboard.
Example:
... ;the bulk of your command.
jsr ClrKeyData ;clear any existing keypresses
;and wait for the user to let
;go of the keyboard
... ;no chance for the next
... ;routine to get a wrong
... ;keypress.
See Also: NoKeypress, YesKeypress, Wait
@ClrTrnsName
Function: Clear a transient command's name from memory.
Pass: nothing
Return: curTransName - set to null.
@ClrTrnsName
Function: Clear a transient command's name from memory.
Pass: nothing
Return: curTransName - set to null.
Destroys: a, x
Description: When a transient command is loaded into memory and executed, it will remain in memory until either another command is loaded or if a resident command needs to use the area reserved for transient commands. In the latter case, the resident command will call ClrTrnsName to inform geoSHELL that no transient command is in memory. Then if the user enters that particular command again, geoSHELL will be forced to reload it from disk.
In most cases, a transient command will not need to call this routine, because it is advantageous to just let your command remain in memory should the user need to use it several times in a row. However, if your command is loaded from a VLIR file or does anything that would change itself to a state that can not be restarted properly, then call ClrTrnsName at any time before exiting your command. This way, your command will be loaded in fresh each time it is used.
Example:
... ;some of the code in your
... ;command might trash the
... ;basic state of your command.
jsr ClrTrnsName ;remove your command's name
;from memory.
jmp ExitCommand ;and finish.
@ColorScreen
Function: Color an area of the 80 column screen.
Pass: r0 - table of compressed locations.
r1 - table of various color combinations to use.
Retur
@ColorScreen
Function: Color an area of the 80 column screen.
Pass: r0 - table of compressed locations.
r1 - table of various color combinations to use.
Return: goodflag - always zero (not an error).
Destroys: a, x, y, r0, r1
Description: This routine will put colors on the 80 column screen of the 128. Your routine must test the current screenmode and videomode to be sure that a 64 is not being used or that a 128 is not in monochrome mode before calling this routine. ColorScreen does not check it for you.
Point r0 to a table of compressed bytes and r1 to a table of color combinations. This color table may contain as many as 256 different combinations of foreground and background colors. Each character area can contain it's own foreground and background color. You might say that the table that this routine uses could be called a 'Color Scrap' since it can color a portion of the screen.
It is not a good idea to put colors below the 176th scanline. geoSHELL does not normally use this lower area of the screen. This is so that 128s with only 16K of video memory may also use the color mode.
In the appendix, you will find an explanation of how to create the table of compressed bytes and the color tables for this routine.
Example: Refer to the appendix for a full explanation and example for using this routine. You will also find the complete source code for the command 'color80' included with this package. Naturally, this routine is used in that command, since it was originally developed specifically for color80.
See Also: FixColors
@ConvertK
Function: Convert a 16-bit number to an ascii string representing kilobytes.
@ConvertK
Function: Convert a 16-bit number to an ascii string representing kilobytes.
Pass: r4 - 16 bit number to convert.
Return: Asc_String - a five-character ascii decimal string with leading zeros converted to spaces and null-terminated.
Destroys: a, x, y, r4, r5, r8, r9
Description: This routine is used by the 'dir' command when it displays the 'K Bytes Free' message after displaying a directory. The routine will take the value in r4 and convert it to a decimal string after dividing it by 4 and rounding it down to the nearest whole number (4 blocks equals 1 Kbyte). If the value originally passed in r4 is less than four, then the decimal string will be rounded up to 1. In the case of the 'dir' command, it loads r4 with the number of blocks free on a disk and calls this routine to create the number of kilobytes free. The resulting null-terminated decimal string can be found at Asc_String.
Example:
;this example will display the kbytes free on the current drive.
ShowFree:
LoadW r5,#curDirHead ;get the number of blocks
jsr CalcBlksFree ;free on the current drive.
jsr ConvertK ;convert it to the nearest K.
LoadW r0,#Asc_String ;point r0 to the string.
lda #(IN_TWO|TR_ONE) ;indent two + trailing space.
jsr OtherMessage ;put the string on the screen.
LoadW r0,#kbyteText ;along with 'KBytes Free'.
lda #TR_CR ;and a carriage return.
jmp OtherMessage ;do it.
kbyteText:
.byte "KBytes Free",0
See Also: Asc_3_Byte, Asc_Byte, Asc_BCD, ByteNZ_Ascii, ByteWZ_Ascii
@ConvToAscii
Function: Convert PetASCII text to ASCII text.
Pass: r0 - start of text to convert.
endoftext - pointer to one byte past the last byte of
@ConvToAscii
Function: Convert PetASCII text to ASCII text.
Pass: r0 - start of text to convert.
endoftext - pointer to one byte past the last byte of text.
Return: r0 - (unchanged) points to converted text.
endoftext - adjusted to point to a null byte at the new end of text plus one.
r2 - pointing at same location as endoftext.
Destroys: a, x, y, r2
Description: This routine will take any length of PetASCII text and convert it to ASCII text. Just point r0 to the start of the buffer holding the text and point endoftext at the byte following the end of the text. Call this routine and that text will be converted to ASCII. Unrecognized bytes are removed from the buffer. Upon return, r0 will still be pointing at the same starting point, but endoftext might point to a different spot making the buffer smaller in size. The buffer will never grow, since characters will never be added, only removed. The bytes that may get removed are usually control codes such as might be created by various wordprocessors. The text after conversion will also have any null bytes removed and a null terminator will be added at the end.
Description: This routine merely displays the current date to the geoSHELL window just as if the user had typed it in without any parameters.
Example:
jsr DateDisplay ;display the date.
See Also:
Function: Display the directory of the current drive.
Function: Display the directory of the current drive.
Pass: ParamTable - parameters just as the user might enter.
kboardoff - (optional) set bit 7 to ignore the keyboard. Set bit 6 to ignore just the STOP key.
Return: nothing
Destroys: no guarantees
Description: This will display a directory of the currently active drive just as if the user typed in the 'dir' command. The format command accesses this routine after it finishes formatting a disk so that the user can see that the disk formatting is complete. You would want to load ParamTable with any parameters you wish Dir to work with just as if the user typed them in at the keyboard. If you place an ascii '6' at ParamTable+0 and a null byte at ParamTable+1 and call this routine, a directory of all the applications on the current drive will be displayed. If ParamTable+0 contains a null byte, then all of the files on the disk will be displayed just as if the user typed 'dir' without a parameter. If the user presses the STOP key while the directory is scrolling, your command will terminate and control will return to the user. You can turn off the keyboard by setting bit 7 of kboardoff. However, this will not allow the user to pause the display. So, instead, you can set bit 6 to just ignore the STOP key. This way, Dir will always return to your command. Just remember to reset kboardoff to zero when finished.
Example:
;this example will display all files ending with '.src'.
ShowFiles:
ldx #6
lda fileText,x
sta ParamTable,x
bpl 10$
jmp Dir
fileText:
.byte "*.src",0
See Also: CkForDisk, MissDisk, Status
@DispLetter
Function
@DispLetter
Function: Display the drive letter of the currently active drive.
Pass: nothing
Return: nothing
Destroys: a, x, y, r0-r15
Description: This is primarily an internal geoSHELL routine. It will simply display the letter (A,B,C or D) of the currently active drive at the left of the current line the cursor is on. The cursor will now be in the third character position on the current line.
Example:
See Also: DriveLetter
@DispText
Function:
Display ascii text to the geoSHELL window up to a maximum of the width of the window.
Pass: r0 - point to the start of ascii text.
endecho - ze
@DispText
Function:
Display ascii text to the geoSHELL window up to a maximum of the width of the window.
Pass: r0 - point to the start of ascii text.
endecho - zero if only one line of text is needed, or set bit 7 if you need to test for end of text.
typeset - bit 7 set will handle carriage returns and tabs and ignore up-arrow terminators, while if cleared, then carriage returns and tabs are ignored, and an up-arrow will clear endecho.
kboardoff - normally zero. Set to 128 to turn the keyboard off while displaying text. (reset it to zero when finished)
Return: goodflag - meaningless
r0 - unchanged
endecho - bit 7 cleared if end of text reached
textpointer - offset pointer to next word to display
Destroys: a, x, y, r1-r15
Description: Display any amount of text in the geoSHELL window. Both the echo and type commands use this routine. Just point r0 at the start of the text you wish to display and call this routine. If you wish to have carriage returns and tabs recognized, then set typeset to 128. Also, before calling this routine, set endecho to 128, because DispText will clear it to zero if the end of text is reached. End of text is a null byte. This allows you to repeatedly call DispText to put text in the window. Of course, you would have to keep updating r0 between calls to DispText since it does not change. There is a routine that will do this for you. Call AdjTxtPointer and r0 will point to the next word to display on the next line. DispText will automatically do a carriage return when it reaches the right side of the window, so that the next call will display text on the next line down. If the bottom line is reached, the text will be scrolled. While this is taking place, the keyboard is active so that the user may pause or halt the text displaying with the CONTROL or STOP keys.
Example:
;this example will display ascii text that is contained in
;a buffer of your choice. In this example we will call the
Description: You can use this routine if you desire to load and run any file that is capable of doing so. All you need to do is point a2 to a null terminated filename. You don't even have to know where the file is located, DoRun will find it for you. DoRun will take over and cause your command to cease it's function. If any errors are encoutered, control will return to the user. For this reason you might only want to call this routine if the geoSHELL window is displayed.
Example:
;this routine takes the filename that the user typed in and
;then passes control to DoRun. If the file is found on one of the
;available drives, it will be loaded and run.
jsr ParamName ;get the filename.
bit goodflag ;is it a valid filename?
bmi 10$ ;branch if so.
jmp DoError ;otherwise display an error.
jmp DoRun ;find it and run it.
See Also:
escription: This is primarily an internal geoSHELL routine. It will simply displs example will display the kb
UUUUUUUUUUUUUUUU
@DriveLetter
Function: Display the drive letter of the active drive and turn the cursor on.
Pass: nothing
Return: nothing
Destroys: a, x, y, r0-r15
Description: Most commands have no use for this routine. It is mostly an internal routine that is accessed just before control is returned to the user. However, since geoSHELL gives your command control of the system, you could use this to also return control to the user and interact with the user instead of geoSHELL's own main processor doing so. You would need some sort of routine to call for user input. This routine also gets the cursor blinking.
Example:
See Also: DispLetter
@DsplyLine
Function: Display a line of text to th
@DsplyLine
Function: Display a line of text to the geoSHELL window beginning at the left side of the current line.
Pass: a0 set to the null terminated string to be displayed.
Return: cur_line - updated to reflect the line the cursor is on. A carriage return is performed after the line is displayed.
Destroys: no guarantees.
Description: This routine should only be used by a command that might need a more direct approach for displaying text to the geoSHELL window. The 'type' command uses it and so does geoSHELL's main display routines. For general message displaying, use Message and OtherMessage. a0 is normally used by internal routines for keeping the cursor in sync with the internal memory buffers. A carriage return is always performed after the line of text is displayed and if the cursor is on the last line, the text will scroll up one line.
This routine also calls CkKeyboard to check for the CONTROL or STOP key. So, if you wish this feature turned off, set bit 7 of kboardoff. If you wish to allow the user to still be able to use the CONTROL key to pause text, then set bit 6 of kboardoff and the STOP key will be ignored.
Example:
lda PRESDRIVE ;get the real device number
jsr GetRealDriveNum ;of the currently active drive.
Function: Display a string at the current cursor position.
Pass: a0
@DsplyString
Function: Display a string at the current cursor position.
Pass: a0 - pointing to the null-terminated string to be displayed.
Return: cur_X_pos holds the new horizontal pixel location of the cursor.
cur_Y_pos holds the new vertical pixel location of the cursor.
Destroys: no guarantees.
Description: This routine is mostly an internal routine and normally need not be used. It will display a null-terminated string pointed to by a0 to the screen beginning at the current cursor position. The cursor will be left at the end of the string on the screen. This routine will check the bytes before they are printed and any bytes that cannot be printed on the screen by GEOS will be converted to '?'.
Description: This is called by ClearWindow and is usually not needed by most commands unless your command is not dealing entirely with text input and/or display. This routine does not clear the buffer that is holding the text that was displayed in the window. So, in some cases this routine could be used without losing what was in the buffer, and a subsequent call to ReDoWindow will therefore restore the text to the screen.
Function: Execute a string of commands located beginning at StUpBuffer.
@execStartup
Function: Execute a string of commands located beginning at StUpBuffer.
Pass: nothing (other than to load StUpBuffer with the commands).
Return: not applicable
Destroys: not applicable
Description: Fill the buffer at StUpBuffer with a group of commands and call this routine to execute them. This does not return to your command. When all commands in the buffer have been executed, control will return to the user.
Example:
See Also:
@ExitCommand
Function: Exit a transient command cleanly.
Pass: nothing
Return: not applicable
Destroys: not applicable
Description: When everything in your command goes as expe
@ExitCommand
Function: Exit a transient command cleanly.
Pass: nothing
Return: not applicable
Destroys: not applicable
Description: When everything in your command goes as expected and you are ready to terminate it and return control to geoSHELL, call this routine. If you simply perform an 'rts', then your command will put the GEOS mainloop in control without the user being able to have access to geoSHELL's keyboard input. ExitCommand puts things back like they were before your command was called.
In some cases, you may want to do an rts somewhere within your command if you wish to have it working with the GEOS main loop instead of geoSHELL doing so. In this case, your command really isn't finished yet, but perhaps you have set up your own user input routines for mainloop to handle. geoSHELL contains certain routines that can do many things for you, but some special situations may need new routines to do different things. But when your routine is finally finished, exit through ExitCommand and geoSHELL will process any further commands that the user may have entered.
Example:
... ;the bulk of your command.
jmp ExitCommand ;exit cleanly.
See Also: NoMoreCmds
@FileNotAvail
Function: Display a 'Filename Not Available!' message and return control to the user.
Pass: a2 - pointing to a null terminated filename.
Return: not applicable
Destroys: not applicabl
@FileNotAvail
Function: Display a 'Filename Not Available!' message and return control to the user.
Pass: a2 - pointing to a null terminated filename.
Return: not applicable
Destroys: not applicable
Description: If your command fails to find a file that the user requests, you could end your command by jumping through this routine. If a2 is still pointing at the null-terminated filename, this routine will display the filename on the screen, followed by 'Not Available!'. Control is then returned to the user instead of your command.
Example:
jsr ParamName ;get the filename.
bit goodflag ;is it valid?
bmi 10$ ;branch if so.
jmp MissgFilename ;display a geoSHELL error
;and exit.
jsr CkAllDrives ;find the file.
bit goodflag ;does it exist?
bmi 20$
jmp FileNotAvail ;display error and exit.
... ;continue on...
See Also: Message, NoMoreCmds, LoadProblem, OtherMessage, FileNotAvail, MissDisk, MissgFilename, NotFound
@FindCMDType
Function: Find the location of a CMD device.
Pass: a - an upper-case letter corresponding to the desired device to locate: F, H,
@FindCMDType
Function: Find the location of a CMD device.
Pass: a - an upper-case letter corresponding to the desired device to locate: F, H, or R.
F = FD Series
H = HD Series
R = RamLink or RamDrive
Return: goodflag - bit 7 set if the requested CMD device was found.
curDrive - desired CMD device is opened
REALDRIVE - real device number of the CMD device
Destroys: no guarantees
Description: To find out if a particular CMD device is being used, load the accumulator with an F, H, or R and call this routine. If goodflag is set upon return, then the device was found. This routine also calls GetCMDType, and so the variables that are set with that routine will also be in effect.
Example:
;this example will locate an FD Series drive if one is being used.
;this same routine can be modified to locate any CMD drive.
;If a RamLink or RamDrive is being searched for and found, then
;the variables are set by GetCMDType can be checked:
;cmdtype+0 will contain an 'R'
;and cmdtype+1 will have either an 'L' or a 'D'
;while cmdtype+2 will contain either a 3 or a 4.
FindFD:
lda #'F' ;let's find the FD Drive.
jsr FindCMDType
bit goodflag
bmi 10$
LoadB FDdrive,#0 ;set variable to zero to
;indicate no FD.
jmp NoFD ;do whatever, if not found.
MoveB REALDRIVE,FDdrive
rts ;goodflag is still set
;and FDdrive now contains
;the device number of the FD.
FDdrive:
.block 1
See Also: GetCMDType
@FindParName
Function: Search the current drive for a desired file from a parameter the user entered.
Pass: nothing
Return: If file not found, routine does not return.
If routine returns then file is found on the current drive.
a2 - now points to a null-terminated filename.
dirEntryBuf - contains the directory entry for the file.
Destroys: no guarantees
Description: You could use this routine when you wish to search the current drive for a file that the user desires your command to act on. This routine will take care of calling ParamName for you and call the necessary routines for searching the drive. If the file is not found, however, the routine will display an error that the file is not available and jump through NoMoreCmds, which will return control to the user. If the user did not enter a parameter that could possibly be a filename, this routine will also handle that error for you without returning. If the routine returns, then obviously the file is found, and your command may continue.
Example:
jsr FindParName ;find the desired file.
... ;file is found, so continue...
See Also: CkAllDrives, CkThisDrive, CkOtherDrives, CkPathOrder, CkPath, CkForDisk, CkPresdrive
@FindRamLink
Function: Find a RamLink or RamDrive if one is currently being used.
Pass: InitForIO must be called first!
Return: goodflag - set if an
@FindRamLink
Function: Find a RamLink or RamDrive if one is currently being used.
Pass: InitForIO must be called first!
Return: goodflag - set if an RL/RD is found on the system.
RAMLINK - holds the real device number of the RL or RD.
cmdtype - (two bytes) holds the characters 'RL' or 'RD'
cmdtype+2 - holds a 3 for RamDrive or a 4 for RamLink.
Destroys: no guarantees
Description: This routine will check to see if a RamLink or RamDrive is connected and enabled, even if it is not being used by GEOS. The only way this routine will not find the device is if the user has given it a device number of 14. geoSHELL always ignores device number 14 in order to prevent a possible crash should the user have a Xetec Super Graphics Gold printer interface connected. Don't forget to call InitForIO before calling this routine.
Example:
;this example routine will find a RamDrive. If a RamDrive is found
;then the variable RAMLINK will contain the device number of the
;RamDrive.
FindRD:
jsr InitForIO ;pop out of GEOS.
jsr FindRamLink ;look for an RL or RD.
jsr DoneWithIO ;pop back in.
bit goodflag ;did we find one or the other?
bpl 20$ ;branch if not.
lda cmdtype+2 ;check the device type.
cmp #3 ;is it an RD?
bne 10$ ;branch if not.(if it was an RL)
rts ;goodflag already set.
LoadB RAMLINK,#0 ;in case a RamLink was found,
;because we were looking for
;a RamDrive instead.
jmp nogood ;signal to calling routine
;that no RamDrive is found.
See Also: GetCMDType, FindCMDType, GetRealDriveNum
for you without returning. If the routine returns, then obviously the file is foestroys: no guarantees
Description: To find out if a particular CMD devi
@FixColors
Function: Restore the default colors to the 40 column screen.
Pass: nothing
Return: Colors on screen restored.
Destroys: a, y, r0, r1, r2L
Description: geoSHELL uses this routine to restore the colors on the 40 column screen whenever a desk accessory exits back to geoSHELL. Some DA's alter the screen colors without restoring them upon exit. This is actually allowed and is left up to the application to restore the colors as well as any other data displayed on the screen. If your command alters the colors for it's own purpose, use this routine to restore them, unless the intention is to alter the colors permanently. In this case, you would also want to change the GEOS variable, screencolors. The high nybble of screencolors is the foreground color (0-15) while the low nybble is the background color (0-15).
Example:
jsr FixColors ;restore 40 column color
See Also: ColorScreen
@GetCMDType
Function: Check if a device is a CMD device and if so, what type.
Pass: a - real device number of device to check. (remember that a RamLink or RamDrive can be 12 or higher if it is being used as a RAM_1581)
InitForIO must be called before calling this routine.
Return: goodflag - set if a CMD device.
cmdtype - (two bytes) contains 'FD', 'HD', 'RD', or 'RL'.
cmdtype+2 - contains 1, 2, 3, or 4.
1 = FD Series drive.
2 = HD Series hard drive.
3 = PP RamDrive.
4 = RamLink.
Destroys: a, x, y, r0
Description: After calling InitForIO, you can call this routine to find out if a particular drive is a CMD device and exactly what type it is. Upon return, if goodflag is set, then the device is a CMD device. Then you can proceed to check the bytes at cmdtype to see which CMD device it is.
Example:
;this particular example will check if drive A is a CMD HD.
CheckHD:
jsr InitForIO ;first, pop out of GEOS.
lda #8 ;drive A.
jsr GetCMDType ;is it a CMD device?
jsr DoneWithIO ;pop back into GEOS.
bit goodflag ;so was it a CMD?
bpl 90$ ;branch if not.
lda cmdtype+2 ;check the type byte.
cmp #2 ;is it an HD?
bne 90$ ;branch if not.
rts ;or exit with goodflag
;still set.
jmp nogood ;tell the calling routine
;that this is not an HD.
See Also: FindRamLink, FindCMDType, GetRealDriveNum
@GetHeader
Function: Load the header block of a file into fileHe
@GetHeader
Function: Load the header block of a file into fileHeader.
Pass: dirEntryBuf with a file's directory entry.
Return: fileHeader contains the file's header block.
r7 - start address of the file.
r1 - track and sector of first data block, or if VLIR file, then T/S of index block.
Description: This routine will not return if any errors are encountered. If an error such as file not found occurs, then an error message will be displayed and control will return to the user. If a header block is successfully loaded, then control returns to your command and you may continue.
Example:
jsr ParamName ;get the filename.
jsr CkAllDrives ;find the file.
bit goodflag ;did we find it?
bmi 10$ ;branch if so.
jmp FileNotAvail ;tell the user, no file.
jsr GetHeader ;no need to check for errors,
;routine returns if OK.
... ;so we can continue...
See Also:
@GetMess
Function: Set a pointer to a message.
Pass: r0 - pointing to the start of a group of null-terminated message strings.
x - desired message number (1-255)
Return: r0 - pointing to the desired message.
Destroys: a, x, y
Description: This is part of the routine that 'Message' uses to locate a particular message within a whole group of messages. You can set up a table of messages, with each message being null-terminated. Set x to the message you need and r0 to the start of the group of messages and then call this routine. Upon return, r0 will be pointing at the desired message. A maximum of 255 messages can be contained in a table.
Example:
;this example will display the error message corresponding to the
;value in x.
DoError:
LoadW r0,#errorMessages ;point to the start of
;message table.
;x is set before calling this.
jsr GetMess ;point to the desired message.
lda #(IN_TWO|TR_CR) ;indent two and trailing CR.
jmp OtherMessage ;display the message.
errorMessages:
.byte "This Would Be Error Number 1!",0
.byte "And Error Number 2!",0
.byte "Or Number 3!",0
.byte "This Can Be Error Number 4!",0
.byte "Number 5 Might Be Here!",0
See Also: GetMessage, Message, OtherMessage
@GetMessage
Function: Point at one of geoSHELL's built-in messages.
Pass: x - desired message number.
Return: r0 - pointing to the message
Destroys: a, x, y
Description: This ro
@GetMessage
Function: Point at one of geoSHELL's built-in messages.
Pass: x - desired message number.
Return: r0 - pointing to the message
Destroys: a, x, y
Description: This routine will simply point r0 to the desired message contained in the standard geoSHELL message table, depending on the value in x. There really isn't much use for this command, although it could be used to locate a particular message and then alter the message. The only problem with this is that the message must contain the exact same number of characters, since if any null bytes are added, then they are treated as blank messages and any following messages will be out of sync when geoSHELL tries to display one of them. In other words, the wrong message might get displayed, thereby creating confusion for the user.
Example:
See Also: GetMess, Message, OtherMessage
@GetRealDriveNum
Function: Get the 'real' device number of a drive.
Pass: a - device num
@GetRealDriveNum
Function: Get the 'real' device number of a drive.
Pass: a - device number 8-11 of drive.
Return: goodflag - set if device is a real drive or a device that uses some form of CBM DOS such as a RamLink.
REALDRIVE - device number of the device.
curdrvtype - drive type of device as GEOS sees it.
RAMLINK - 0 if device is not a RamLink or RamDrive or if so it will contain a copy of REALDRIVE.
Destroys: a, x, y, r0-r15
Description: If working with the built-in DOS in the drive is desired, you need to know the device number before using standard kernal routines to access the device. Normally this is not a problem. However, it is possible that a RamLink or RamDrive might be used with 1581 partitions being used to emulate a RAM_1581. In these cases, the GEOS disk driver is controlling the device as a RAM device and not a DOS device. So, the device number of the device in question might be 12 or higher instead of the usual 8-11 that GEOS uses. This routine will test the device and return the correct device number for you in REALDRIVE.
This routine will also call PurgeAllTurbos. So, if you call another routine after this one that needs the turbo code purged in the drives, it will not be necessary to call PurgeAllTurbos.
Example:
lda PRESDRIVE ;let's get the device number
;of the currently active
;drive.
jsr GetRealDriveNum
bit goodflag
bmi 10$
jmp NotRealDrive ;go do some sort of error.
... ;now we have the real
;drive number for sure
;just in case a RamLink
;is being used.
See Also:
The geoSHELL Programmer's Development Package 2-PAGE
sync when geoSHELL tries to displa
The geoSHELL Programmer's Development Package 2-PAGE