PFN JUMP TABLE As has been mentioned many times, ProDOS File Navigator contains a jump table that your program may use to call PFN's routines. This table starts at $4000 and ends at $40FF. $40FF contains PFN's version number. It is not recommended to call the routines directly, since they will change in future versions; the jump table should be used whenever you call a PFN routine. Most of these are subroutines, and a few of these are reentry points in PFN's main event loop. Reentry points should not be JSR'd to; the return address should be popped off the stack, and the reentry points should be JMP'd to instead. Reentry points will be marked with an asterisk. ADDRESS NAME WHAT IT DOES $4000 * PFNSTART entry point for entire program $4003 * DISPDIR reload catalog and wait for next event $4006 * DISPDIRS reload catalog with same file selected and wait for next event $4009 * DISP redraw the screen and wait for next event $400C * DISP0 redraw starting with the prefix and wait for next event $400F * DISPCAT redraw the catalog and wait for next event $4012 * DISPCAT2 redraw the catalog over the existing one and wait for next event $4015 * KBDLOOP wait for next event $4018 * ISNTUPER execute command from keyboard input in A, already capitalized $401B READDIR read the current directory into the catalog $401E PRINTCAT print the catalog $4021 DISKSPC recalculate disk space $4024 * KRSTDISP completely reload the screen, 80-column mode and all $4027 A80COLON turn 80-columns on $402A A80COLOFF turn 80-columns off $402D TEXT text mode $4030 LOWRESGR lo-res mode $4033 DBLOWRES double lo-res mode $4036 HIRESGR hi-res mode $4039 DBLHIRES double hi-res mode $403C MAINMEM main memory access $403F AUXMEM auxiliary memory access $4042 NORMAL normal video $4045 INVERSE inverse video $4048 CLRSCRN clear screen $404B SETPOS set cursor position in X and Y $404E TXTUNWDW set text window to whole screen $4051 TXTWINDW set text window to inside lines $4054 TXTPRWDW set text window to bottom line (prompt line) $4057 PRINTSTR print a string with address in X,Y, high ascii $405A PRSTR6F print a string in $6F00, high ascii $405D PRHISTXY print a string with address in X,Y, high or low ascii $4060 PRHISTR print a string in $6F00, high or low ascii $4063 PRINTCR print carriage return $4066 BEEP beep $4069 SMILE display a smiley face at the bottom of the screen for two seconds $406C XPERIODS print periods; number in X $406F PRINTNUM print a number in X,Y $4072 PRNMDIV2 print a number in X,Y divided by 2; ".5" is printed if the number is odd $4075 MINIED24 print leftmost two decimal digits of X $4078 HEXSTRNG convert string of hex digits in $6F00 to 5-byte big-endian number in $EB-$EF $407B STREQU compare Pascal strings, case-sensitive; addresses of strings in $FA-$FD, zero flag set if strings are equal $407E STREQI compare Pascal strings, case-insensitive; addresses of strings in $FA-$FD, zero flag set if strings are equal $4081 PRINTYPE print ProDOS file type in X $4084 PRDATIME print date and time in ProDOS format in $FA-$FD $4087 PFNPRMPT ask for user input; address of prompt string in X,Y, number of dots in A, input at $6F00 $408A GETCHAR get a character; input in A $408D GETLINE get a line of keyboard input; input in $200 $4090 GETLN6F get a line of keyboard input; input in $6F00 $4093 GETFADDR get the address of a file's catalog entry; file number in X, address returned in $CE-$CF $4096 GETPRFX get current prefix in $6F00 $4099 SETPRFX set current prefix to $6F00 $409C CHEKPRFX check current prefix; if we're at the ONLINE level, carry is set; current prefix is in $6F00 $409F GETNAME get name of currently selected file in $6F00 $40A2 GETPATH get full path to currently selected file in $6F00 $40A5 FINDDEVN find a volume's device number; path to or name of volume in $6F00, device number returned in A and X $40A8 CLEARPGE clear page Y of memory $40AB CLEARBUF clear $2000-$3FFF $40AE CLRBUF2 clear $1900-$3FFF $40B1 XFERFREF transfer directory entry to catalog entry; address of dir entry at $06-$07, address of cat entry at $CE-$CF $40B4 XFERGR transfer lo-res graphics from $800 to $400 without touching screen holes $40B7 XFERGRA transfer lo-res graphics from main $800 to auxiliary $400 without touching screen holes $40BA XFERAUXH transfer main $2000-$3FFF to auxiliary $2000-$3FFF $40BD PROTDHR protect DHR auxiliary memory from being overwritten by files in RAM disk $40C0 DPROTDHR unprotect DHR auxiliary memory $40F0 DBGERR0 make "Blocks Available" display the current value of A $40F3 DBGERR1 make "Blocks Used" display the current value of A $40F6 DBGERR2 make "Blocks Total" display the current value of A $40F9 LAUNCHSYS transfer control to SYS file; path in $6F00 $40FC PFNQUIT quit ProDOS File Navigator PFN DATA TABLES The area from $6000-$67FF contains ProDOS File Navigator's data tables. These include all the strings PFN prints and the tables PFN uses for ProDOS file types, abbreviations for months, and types of peripheral cards. All of PFN's strings are stored as Pascal strings. These strings may be printed with the PRINTSTR or PRHISTXY routines, or used as prompts with the PFNPRMPT routine. Load the X register with the low byte of the address, and the Y register with the high byte of the address. For PFNPRMPT, load the accumulator with the number of periods you want to be printed after the prompt, or with zero if you don't want any periods. Here are some of the more useful strings: ADDR STRING $60F8 "K " $611D " - " $6121 "Available: " $612D "Used: " $6134 "Total: " $613C "New File Name: " $614C "Name of New Directory: " $6164 "Prefix: " $617D "Are you sure? (Y/N): " $6193 "Info for " $619D "Locked: " $61A6 "No" $61A9 "Yes" $61BE "Blocks: " $61C7 "Modified: " $61D2 "Created: " $61DC "Bytes: " $61E4 "Press any key to continue." $6205 "Copy to: " $620F "Slot: " $6216 "Drive: " $6247 " What peripheral cards are installed?" $626E "Card " $6274 ": " $6277 "Unknown" $627F "Printer" $6287 "X-Y Input" $6291 "Serial/Parallel" $62A1 "Modem" $62A7 "Sound" $62AD "Clock" $62B3 "Disk Drive" $62BE "80-Column" $62C8 "Network" $62D0 "Special" $6300 " (" $6303 ")" $63BB ".5" $63BE "Desktop" $63C6 "AM" $63C9 "PM" $6600 "" $660A "New File Type: $" $661B "New Aux Type: $" $662B "New Disk Name: " At $63CC is a string of 36 characters without a count byte, "JanFebMarAprMayJunJulAugSepOctNovDec". Its purpose is obvious. At $63F0 is a 16-byte table. In every peripheral card's ROM is a single byte containing some information about what type of card it is; one nybble of that byte tells us the general card type. This table gives the low byte of the address of the string to print for each value of that nybble. The high byte of the address is always $62. At $6500 is a 256-byte string containing all 137 ProDOS file type mnemonics. The file types are overlapped to save space and make the mnemonics fit; for example, the mnemonics AWP, WPF, PFS, FST, STN, TNJ, and JAP are stored as AWPFSTNJAP. At $6400 is a 256-byte table containing the offset to the mnemonic for each file type; an offset of $00 indicates a type without a mnemonic. To find the mnemonic for file type $EF, for example, look at address $64EF; it contains $9C. At $659C, you'll find $D0, the first character of the mnemonic; the following two bytes are $C1 and $D2, completing the mnemonic 'PAR'. Since $00 indicates no mnemonic, $6500 contains a $ character, which is the character to prefix to the hexadecimal number. When PFN is at the online level, it reports the file type of a volume as $0E. When PFN goes to print the mnemonic, it finds $01 at $640E and subsequently three spaces at $6501. There isn't any room to make the string at $6500 any bigger, but there are ways to add more mnemonics. First, you could use one of these possible mnemonics found in the string that aren't currently being used: Ofst Mneu Possible Description $05 VRA Virtual RAM? $06 RAW Raw data? $0F APT Apartment/virtual room? $17 RGS Registry? Registration? $1C SPC Space? Specifications? $2C ART Some graphics format? $44 RAN Past-tense of RUN? Random? $64 ALP Alphabet? $6E TBA To be announced? $84 NSC NTSC-related? New Screen? $8E VRB Verbs/language translation stuff? $B9 DFN Definitions? $BD MED Medium? Media? $BF DUN Dial-up networking? $C1 NKM Duke Nukem? $E3 PSN Position? Second, at the very end of the table, at $65F1, are the mnemonics UD2UD3UD4UD6UD7. You can change the first one, UD2, to UDF, then change all the offsets for file types $F2, $F3, $F4, $F6, and $F7 to $F1. Now where UD3UD4UD6UD7 was you have space for anywhere from 4 to 10 new types, depending on how tightly you can overlap them.