CFFA1 Firmware 1.2 -- Release Notes =================================== Version 1.2 of the firmware for the CFFA1 (CompactFlash for Apple 1) card. The menu title shows the version: "CFFA1 MENU (1.2)". Everything that worked in 1.1 still works the same way. Programs that use the CFFA1 API keep working unchanged. Installing ---------- The CF card image (CFFA1.po) has everything on it: AUTORUN.1 the example AUTORUN program, switched off (see below) HELLO the Woz BASIC program AUTORUN runs BASIC Woz BASIC, which AUTORUN loads at $E000 INSTALL1.2.BIN this firmware, with the flasher that installs it OLD/ INSTALL1.1.BIN firmware 1.1, with the same flasher, to go back GAMES/ LUNAR Lunar Lander: L LUNAR, Return, Q, then 300R STARTREK Star Trek, in Woz BASIC: L BASIC (Return) first, then L STARTREK, Q, E2B3R, and RUN To install 1.2 from the CFFA1 menu: L INSTALL1.2.BIN, and Return at "ADDR ($1000):" Q (to the monitor) 1000R The flasher shows the firmware it is about to write and the firmware in the EEPROM now, and tells you to flip switch S1-4 up. Press Space, wait a few seconds for COPY COMPLETE and VERIFY COMPLETE, then flip S1-4 back down. To go back to 1.1, do the same with OLD/INSTALL1.1.BIN: P OLD first, then L INSTALL1.1.BIN. To turn AUTORUN on, rename it: R AUTORUN.1, then AUTORUN. As shipped it loads Woz BASIC from the file BASIC (unless BASIC is already at $E000), then runs the BASIC program HELLO, and leaves you at BASIC's > prompt. Change HELLO to make it do something else. What's new ---------- AUTORUN The first time the CFFA1 is started after power-up -- 9000R from the monitor, CALL -24000 from BASIC, or the $9003 and $9012 entry points -- the firmware looks for a file named AUTORUN in the root directory of the CF card. If it finds one, it loads it and runs it before showing the menu. - AUTORUN is a binary (BIN) file. It is loaded at the address in its aux type, and the program starts at its first byte. For example, a program assembled for $0300 is saved with aux type $0300. - AUTORUN may call the CFFA1 API. If it ends with RTS, you are taken to the CFFA1 menu. - It runs only once per power-up. Starting the menu again with 9000R does not run AUTORUN again. - A)UTORUN AGAIN is a new menu key that runs AUTORUN on request. It is not listed in the menu. - If there is no card, no AUTORUN file, or the card is not ProDOS, start-up stays quiet and you get the menu as usual. A)UTORUN AGAIN reports these as errors, so you can see why nothing ran. - Calling the menu from your own program ($9006, or the CFFA1_Menu API call) never runs AUTORUN. Your program always gets control back. An example AUTORUN program comes with the firmware (Autorun.s). It loads Woz BASIC from the file BASIC to $E000 if BASIC isn't there already, then loads and runs the BASIC program HELLO. Configurable card timeout At start-up the firmware waits for the CF card to answer before trying AUTORUN. By default it waits up to 3 seconds. If no card answers in that time, it says nothing and shows the menu. The wait is set by the byte at $AFD9, in tenths of a second: $1E (30) is 3 seconds, $0A is 1 second, and $00 checks once without waiting. To change it on a board whose EEPROM is write-enabled (switch S1-4 up, and software data protection off), store a new value from the monitor, for example: AFD9: 0A Programs can find this byte as CFFA1_CardWaitTenths in CFFA1_API.s. Hidden memory test (Control-T) Control-T at the menu starts a RAM test: MEMORY TEST START: $4000 LENGTH: $3000 SEED: $1234 WRITING... V)ERIFY OR R)EPEAT? V PASS It fills the range with a pseudo-random pattern made from the seed. Then V checks it once, or R checks it over and over until you press Esc. To test with one byte value instead of a pattern, give a seed of 0 (or just press Return), and you'll be asked for the byte. Each wrong byte is shown as address, expected value, actual value, and the bits that differ, for example: 1234:42 46 ^04 Each pass ends with PASS or FAIL. Don't test memory the firmware is using ($8700-$8FFF), or memory holding a program you want to keep. Better memory dump M)EMORY DISPLAY and B)LOCK no longer print long runs of repeated data line by line. A line of 8 bytes that is the same as the line above it is shown once as ditto marks, and any further identical lines are skipped: 0300:00 00 00 00 00 00 00 00 ........ 0308:'' '' '' '' '' '' '' '' 0328:43 46 46 41 31 20 01 FF CFFA1 .. A mostly-empty block now fits on a screen or two. Hidden write-block command (Control-W) Control-W is the counterpart of B)LOCK. It writes the 512-byte block buffer (normally whatever B last read) back to any block you choose on the current drive. Together they let you read a block, change it with the monitor, and write it back. Be careful: there is no "ARE YOU SURE?" prompt, and nothing checks that the buffer holds anything sensible. That's why it isn't listed in the menu. Ability to use multiple 32MB drives on one card A CF card larger than 32MB can hold up to four ProDOS volumes, D0 to D3, each in its own 32MB slice of the card. D0 is the first 32MB, which is all that 1.0 and 1.1 normally use. - Control-S asks "DRIVE # (0-3)", selects that drive, and shows its size in blocks. If the drive isn't there, you stay on the drive you were on. - The prompt shows the drive when it isn't D0: CFFA1 D1> - Every menu command then works on the selected drive. A new drive has to be formatted with ! before use; until then it reports NOT PRODOS DISK. - Programs can use the new API calls CFFA1_GetDriveNumber ($06) and CFFA1_SetDriveNumber ($08). Important: 1.1 also had Control-S, but it was only for Status, not for switching drives. Firmware flasher (in INSTALL1.2.BIN, BootImage.bin, OLD/INSTALL1.1.BIN) The program that writes new firmware into the CFFA1's EEPROM has been improved. Its title line shows its own version: "CFFA1 FLASHER V2026-10-01". - It works reliably with the newer page-mode AT28C64B chips as well as the AT28C64E. It waits correctly for each page write to finish, including the last one. Earlier flashers could get bytes wrong on an AT28C64B, especially when reflashing a board that already had similar firmware. - It shows the version of the firmware it is about to write and the version already in the EEPROM, before you start. - It won't flash anything that isn't CFFA1 firmware. If you run it without loading CFFA1.BIN first, it stops instead of overwriting the EEPROM (including the $AF80 boot loader) with whatever was in memory. - V)ERIFY compares the EEPROM with the image without writing anything, and can keep checking after it finds a difference. - If the chip ignores writes, WRITE PROTECTED now reminds you to check switch S1-4 and mentions that the chip's software data protection might be active. - If a write never finishes, it reports the address ("EEPROM WRITE TIMED OUT AT $xxxx") instead of hanging. Fixes ----- - Writing a file over an existing one on a nearly full disk could lose the old file: it was deleted before checking whether the new one fitted, and then DISK FULL. Now the space is checked first and the old file is kept if the new one doesn't fit. Replacing a file with one the same size on a full disk now works too. This also applies to S)AVE. - A write that would exactly fill the disk is now refused before anything is written, instead of running out of room partway and leaving a half-written file. - A full disk is now reported as DISK FULL, not FILE NOT FOUND, when making a new directory, or when a directory needs another block for a new entry. - Saving and loading an empty BASIC program now works. - ! FORMAT now builds the free-block map correctly for every size of volume. Some sizes used to mark blocks past the end of the volume as free, or lose 2048 usable blocks. - Deleting an empty subdirectory of more than one block, stored above block 4096, no longer fails with BAKED BITMAP. - N)EW DIRECTORY now writes the ProDOS subdirectory-header signature byte, $75, that that very old versions of ProDOS require. - An error reading a directory while creating or deleting a file is now reported, instead of the firmware writing back stale data. - Some CF cards drop BUSY a moment before they are ready to transfer data. The firmware, the $AF80 boot loader and Bootstrap.s now wait for the card to be ready, so these cards no longer give 27 I/O ERROR or a failed boot. Other changes ------------- - New API calls: CFFA1_GetDriveNumber ($06), which returns the drive in X, and CFFA1_SetDriveNumber ($08). - CFFA1_FormatDrive now formats the drive given in A, as CFFA1_API.s has always said, and makes it the current drive. If the format fails, the drive that was current stays current. - CFFA1_ReadDir, called again after it has reported the end of the directory (46 FILE NOT FOUND), now reports the end again. It used to succeed and point EntryPtr at memory that isn't a directory entry. - The ID bytes at $AFDC-$AFDF are $CF $FA $01 $03: compatible back to version 1; current firmware version 3. Hidden menu keys ---------------- These work at the CFFA1> prompt but aren't listed in the menu: A Autorun again Control-S Select drive D0-D3, and show its size Control-T Memory test Control-W Write a block from the block buffer Control-D Debug: show every block read and written Control-A Switch console I/O to a 6551 serial card at $C300, or back * Exit to the monitor