Commodore PET ROM1 Disk ROM Replacement
I decided to also make a ROM 1 Patch as it only requires a single ROM replacement at H4.
V1.5: Fixed LOAD corruption of program on initialization of variables.
V1.4: Now compatible with bitfixer's PETdisk MAX v2. The load operation is now closer to the STATUS implementation provided by ROM 2&4. This allows for both SD2PET and PETdisk MAX including Network LOAD/SAVE/VERIFY operations.
V1.4: VERIFY operation now fully supported!
To verify a file, the file must be loaded in memory. The contents are then verified against the file you specify on disk.
EXAMPLE:
VERIFY "TESTFILE",8
This is a ROM 1 patch to support disk (IEEE-488) compatibility with only burning and changing the ROM ($F000-$F7FF) H4 in an original ROM 1 Commodore PET.
To use, with computer off and proper grounding, replace ROM in slot H4 with ROM1DiskROM.bin. This product is excellent for doing so:
#^https://www.tindie.com/products/nivagswedna/replacement-pet-rom-6540-pre-programmed/ you must select custom provide the ROM as well as location $F000-F7FF (H4)
This code's concept was derived from the original IEEE-488 ROM 1 patch written by André Fachat and ROM 1 disassembly. Vossi then created a single ROM replacement for $F000-F7FF and this is an enhancement of that concept with added support of VERIFY and better implementation of STATUS.
Changes and Improvements: Only 5 error messages shortened rather than 7. Patch code simplified due to larger continuous space availability.
My shortened error messages are:
# = too many files (never called by any ROM code, as far as I can see)
OPEN = file open
NOPN = file not open
NOF = not output file
DEVNP = device not present
Vossi's original shortened error message reduction were:
TMF = too many files (never called by any ROM, as far as I can see)
OPEN = file open
FNF = file not found
DEVNP = device not present
NIF = not input file
NOF = not output file
T = on tape #
Of the five error messages reduced, I can't find where the ROM calls "Too many files", so there are only four shortened error messages that an end user would see.
While operations will mostly just work, programmers should review the ST (status) BASIC variable to get the result or read location $20c. Bit 6 set indicates end of file reached, which is a good indicator. You may also want to any of the bits 4, 5, 7 set, as any would indicate error.
Quick test BASIC:
IF ((ST) AND 64)>0 THEN REM SUCCESS CODE HERE
Quick test Assembler:
LDA $20C
AND # $40 ;(bit 6) indicates end of file reached, NON ZERO means success.
Assembler used: ca65
#^https://cc65.github.io/doc/cl65.html :
cl65 -o THISFILENAME.bin -t none -l THISFILENAME.lst THISFILENAME.s