fred@cbmvax.cbm.UUCP (Fred Bowen) (12/13/86)
C/128 SYSTEM ROM RELEASE NOTES
Commodore Electronics, LTD. 7 November 1986
C128 ROM RELEASE NOTES: 318018-04, 318019-04, 318020-05
318022-02, 318023-02
THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE 318018-02, 318019-02, AND
318020-03 CODE TO CREATE A NEW ROM SET RELEASED ON 11/07/86. THIS RELEASE
IS MADE TO CREATE MASKED ROMS FOR PRODUCTION. THESE ROMS ARE TO BE USED AS
A SET, REPLACING THE PREVIOUS ROM SET ENTIRELY. THEY ARE NOT TO BE MIXED.
THIS RELEASE IS MADE SIMULTANEOUSLY IN THE FORM OF 16KB AND 32KB ROMS, FOR
USE IN THE FOLLOWING SYSTEMS: C128, C128D, C128CR, C128DCR, AS APPROPRIATE.
PLEASE NOTE: AN 11/18/85 ENGINEERING RELEASE OF A C128 ROM SET WAS NEVER
RELEASED TO PRODUCTION, AND ACCOUNTS FOR THE APPARENT JUMP IN ROM REVISION
NUMBERS. THE FOLLOWING INFORMATION INCLUDES THOSE DIFFERENCES AS WELL.
The following information represents a filtered condensation of
all known problems, complaints, and suggestions that pertain to
the C/128 system software to date (exclusive of CP/M). The
current ("original" ROMs) system software consists of:
1. Part No. 318018-02 --> BASIC LOW ($4000-$7FFF)
2. Part No. 318019-02 --> BASIC HIGH, MONITOR ($8000-$BFFF)
3. Part No. 318020-03 --> EDITOR, KERNEL, CP/M ($C000-$FFFF)
4. Part No. 315078-02 --> DIN ED, KERNEL, CP/M ($C000-$FFFF)
5. Part No. 318022-01 --> BASIC, MONITOR ($4000-$BFFF)
(includes 1+2 above)
6. Part No. 318023-01 --> ED, KERN, CP/M, C64 ($C000-$FFFF)
(includes 3+4 above)
The updated C/128 16KB ROM set bears the following part numbers. (The
PCB socket number is valid only for original PCBs).
1. # 318018-04 --> BASIC LOW ($4000-$7FFF, U33) cksum= 9A40
2. # 318019-04 --> BASIC HIGH, MONITOR ($8000-$BFFF, U34) cksum= 6F80
3. # 318020-05 --> EDITOR, KERNEL, CP/M ($C000-$FFFF, U35) cksum= EEC4
4. # 315078-03 --> DIN ED, KERNEL, CP/M ($C000-$FFFF, U35) cksum= E4C4
5. # 318022-02 --> BASIC, MONITOR ($4000-$BFFF, U34) cksum= 09C0
6. # 318023-02 --> EDITOR, KERNEL, CP/M ($C000-$FFFF, U32) cksum= F324
(Note that #6 above also contains the C/64 ROM code.)
Each 16KB ROM block contains a small patch area for changes, and
all patches described below have been accomplished such that any
particular change will never affect more than one ROM. Similarly
each ROM contains a revision status byte (at $7FFE, $BFFE, and
$CFFE) which software can test to determine the version of the
host system. The "original" ROMs contain $00 in these locations
and the "update" ROMs described herein contain $01. Each ROM
has had several changes, as summarized on the following pages.
Part Number 318018-04 --> BASIC LOW ($4000-$7FFF)
1. LIST and DELETE commands. Previously they did not report as
errors certain non-numeric characters passed as arguments,
such as 'LIST A'. This has been corrected totally in-line
by adjusting an erroneous relative branch in the 'RANGE'
subroutine.
2. CIRCLE command. Previously an unspecified Y-radius
defaulted to the X-radius (as it should), but the X-radius
value had already been scaled for the X-axis and not the
Y-axis. This has been corrected totally in-line by scaling
the radii after the defaults have been established.
3. RS-232 STatus. Previously accessing ST after RS-232 I/O
resulted in an incorrect status being returned from, and a
zero written to, location $10A14, possibly corrupting the
BASIC variable area. This was a result of BASIC calling the
Kernel routine 'READSS' with the incorrect RAM bank in
context. This has been corrected totally in-line by
substituting the correct BASIC subroutine call.
4. CHAR command. Previously using CHAR with the 80-column text
screen (GRAPHIC mode 5) resulted in RAM corruption at
locations $D600 and $D601 of RAM bank 0 (the BASIC text
bank) due to BASIC calling the Editor PLOT routine without
the I/O block in context. This has been corrected utilizing
two patch subroutines.
5. RENUMBER command. Previously the pass 2 routine, which was
to pre-scan BASIC text and report 'out of memory' errors
prior to actually changing anything, was seriously flawed.
This has been corrected utilizing a patch subroutine.
6. DELETE command. Previously did not limit-check itself when
moving down BASIC text, therefore it was possible to crash
when DELETEing lines at or near the top of memory (near the
MMU configuration registers). This has been corrected
utilizing a patch subroutine. Also, DELETE previously
exited to MAIN via 'JMP', effectively ending the evaluation
of the current command string. This has been corrected by
substituting an 'RTS', allowing direct commands like
'DELETE 10: PRINT"DELETED LINE 10"' to work correctly.
7. PLAY command. Previously the SID frequency tables were not
exactly NTSC concert pitch. Also, there was no provision for
adjusting the frequency for PAL systems. This has been
corrected by changing the (NTSC) frequency tables, creating
new PAL tables, and utilizing patch code to select from the
appropriate table as determined by the Kernel PAL_NTSC flag.
8. The BASIC ERROR handler previously failed to clear pending
string temporaries when an error was TRAPed. This has been
corrected via patch code to reset TEMPT to TEMPST.
9. The powerup copyright notice has been updated to 1986, which
will serve as an immediate visual indication of the ROM
update status. Also, a new notice has been placed at $7FC0.
10. The ROM signature at location $7FFC and $7FFD (lo/hi) is
$8DEF. (new since last release).
11. The ROM revision byte at location $7FFE, has incremented
from $00 to $01.
12. The ROM checksum byte at location $7FFF, has changed from
$4C to $61.
Part Number 318019-04 --> BASIC HIGH, MONITOR ($8000-$BFFF)
13. RSPRITE and RSPPOS functions. Previously they accepted as
parameters sprite numbers in the range 1-16, which is
incorrect. This has been corrected totally in-line by
limiting the range check to 1-8, and reporting an illegal
quantity error for sprite numbers outside this range.
14. PRINT USING command. Previously there was an anomaly
involving the use of floating money symbols ('$') and
commas. The command 'PRINT USING "#,##$.##"; 123.45', for
example, resulted in the output '$,123.45', which is
incorrect. This has been fixed utilizing a patch subroutine
which checks specifically for the '$,' occurrence and
substitutes a '_$' ('_' = fill character) whenever found.
15. Relative Coordinates for all graphic commands (except
MOVSPR) were incorrectly processed. The problem was
apparent when negative relative coordinates were used, which
resulted in an illegal quantity error. This has been
corrected totally in-line by substituting a different
subroutine call to pre-existing code. This change affects
the BASIC commands LOCATE, DRAW, PAINT, BOX, CIRCLE, GSHAPE,
and SSHAPE. This change also allows negative absolute
coordinates to be accepted (previously they resulted in an
illegal quantity error), although the legal range remains a
16-bit value: 0-65535 (unsigned) or -32768 to 32767
(signed: i.e., -1 is equivalent to 65535).
16. DOPEN and APPEND commands. Previously it was possible to
open two or more disk channels with the same logical file
number without incurring an error report. This has been
corrected totally in-line.
17. MATH package. An original bug fix (ref: double zero bug)
to the (F)MULT routine has been found to result in small
errors (such as 2^15 = 32768.0001). This has been corrected
totally in line by fixing the original (dbl-0) problem in a
different way.
18. A copyright notice has been placed, starting at $BFC0.
19. The ROM signature at location $BFFC and $BFFD (lo/hi) is
$CDC8. (new since last release).
20. The ROM revision byte at location $BFFE, has incremented
from $00 to $01.
21. The ROM checksum byte at location $BFFF, has changed from
$3A to $C5.
Part number 318020-05 --> EDITOR, KERNEL, CP/M ($C000-$FFFF)
22. CAPS LOCK Q. Previously an error in a key matrix decode
table caused a lower-case 'Q' to be passed when the keyboard
is in CAPS LOCK mode. The table has been corrected by
substituting the correct value for upper-case 'Q'.
23. FUNCTION KEYs. Previously the funcion key handler, part of
the SCNKEY routine at CKIT2, failed to detect a funtion key
string pending. This has been corrected via patch routine,
which will ignore new function key depressions until the
string in progress has been output (i.e., KYNDX = 0). Also,
DOPFKY now exits via SCNRTS, instead of simply RTSing.
24. IOINIT system initialization. Previously the RS-232
pseudo-6551 registers were not initialized because these
values are expected to be given by the user whenever RS-232
channels are OPENed. Apparently many C64 users have taken
advantage of the fact the C64 'happened' to clear these
locations and fail to specify critical parameters. These
RS-232 registers are now initialized to default to: no
parity, full duplex, 3-line, 1-stop bit, 8-bit words and 300
baud, via a patch subroutine.
25. IOINIT PAL system initialization. Adjustments have been
made to the 8563 initialization values for PAL systems. The
PAL horizontal total (register 0) changes from $7E to $7F.
The PAL vertical total (register 4) changes from $27 to $26.
These changes shift the cycle time from 20.320us to
20.032us. The patch required a patch subroutine, as well as
a change to VDCTBL.
26. BASIN system call. Previously attempting input from a
logical channel to the screen (e.g., via INPUT#) resulted in
line too long errors. This has been corrected utilizing a
subroutine patch to preserve bit-7 of CRSW, which serves as
a flag to the Editor that a (pseudo) end-of-line has been
reached. Also, TBLX is copied to LINTMP to correctly locate
the current cursor line for the Editor. Please note that
switching between the 40 and 80-column text screens, opening
and closing windows, or clearing text screens can confuse
logical screen channels. The Editor variable LINTMP ($A30)
is a global, not local, variable as it should have been.
Users can POKE LINTMP with the logical screen line number
before INPUT#'s as a work-around.
27. OPEN RS-232 system call. Previously it was possible to
receive a carry-set status, normally indicating a error,
when no error existed after OPENing an RS-232 channel. This
has been corrected totally in-line by a modification to the
code which checks for the proper X-line hardware states.
28. LOAD system call. Previously the normal (a.k.a. SLOW) load
mechanism did not preserve the starting address of any
LOADs, which made the BASIC 'BOOT "file"' command form
malfunction unpredictably. This is apparent only when used
with 1541 drives. This has been corrected via a patch
subroutine, which saves the starting address of all LOADed
files at SAL and SAH, the same place the fast (a.k.a.
BURST) load mechanism does.
29. DMA system call. Previously the Kernel forced the I/O block
into the user's memory configuration at all times, which is
no longer necessary and, in fact, seriously limits the
functionality of the RAM expansion cartridge. This has been
corrected by a ROM patch routine, which affects all Kernel
DMA system calls as well as the BASIC FETCH, STASH, and SWAP
commands. Also, previously it was possible for an IRQ to
occur between the 'arm DMA' and 'trigger DMA' sequences,
resulting in a DMA operation with the system configuration
in context regardless of desired configuration. This has
been corrected by adding 'PHP/SEI...PLP' instructions around
the JSR to DMA RAM code at $3F0. Applications using the DMA
RAM code at $3F0 should do likewise. Finally, in this patch
changes were made to enable DMA operations to all RAM banks
by correctly using the VIC bank pointer found in the MMU RAM
configuration register ($D506, VA16=bit-6 and VA17=bit-7).
Applications using the Kernel routine at $FF50 will inherit
these changes automatically. Please note that NMI interrupts
can screw-up DMA operations, as they cannot be masked.
30. A copyright notice has been placed, starting at $CFC0.
31. The ROM location $CFF8 is reserved for national character
ROM checksums. This does not apply to US ROMs, which contain
$FF here. (new since last release).
32. The ROM location $CFF9 is now reserved for country codes.
The US ROMs contain $FF here. (new since last release).
33. The ROM location $CFFA and $CFFB (lo/hi) contain the
national character set signature. This does not apply to US
ROMs, which contain $FFFF here. (new since last release).
34. The ROM signature at location $CFFC and $CFFD (lo/hi) is
$8F76. (new since last release).
35. The ROM revision byte at location $CFFE, has incremented
from $00 to $01.
36. The ROM checksum byte at location $CFFF, has changed from
$C3 to $3C.
37. The Kernel revision byte at location $FF80 has incremented
from $00 to $01.
Part number 315078-03 --> DIN ED, KERNEL, CP/M ($C000-$FFFF)
There have been no revisions to the national portions of the
many national Kernel/Editor ROMs. All revisions described above
for the US version have also been made to the national versions.
38. A copyright notice has been placed, starting at $CFC0.
39. The ROM location $CFF8 is reserved for national character
ROM checksums. The German/Austrian (DIN) ROMs contain a $FF
here (that really is the checksum!).
40. The ROM location $CFF9 is now reserved for country codes.
The German/Austrian (DIN) ROMs contain $00 here. US ROMs
contain $FF here.
41. The ROM location $CFFA and $CFFB (lo/hi) contain the
national character set signature. The DIN ROMs contain
$91F3 here. This is unused ($FFFF) for US ROMs.
42. The ROM signature at location $CFFC and $CFFD (lo/hi) is
$EA3B.
43. The ROM revision byte at location $CFFE, has incremented
from $00 to $01.
44. The ROM checksum byte at location $CFFF, has changed from
$C3 to $4C.
45. The Kernel revision byte at location $FF80 has incremented
from $00 to $01.
C/128 developer and documentation notes
There were quite a few items that, for one reason or another, I
categorized as un-fixable as the fix would compromise
compatibility or be too radical given the work-around or
relative severity of the problem. They are included here to
document them along with any implications, work-arounds, etc.
1. DMA interface. It should also be noted that DMA hardware is
unreliable at 2MHz clock speeds and consequently the user
must insure 1MHz (SLOW) mode is used before any DMA
operations are performed. NMI interrupts will also cause
problems, and should be disabled or somehow avoided. RS-232
operations use NMIs; the remote should be XOFFed or the
channel disabled before DMA operations are performed.
2. IRQ handler. It is possible for the Kernel IRQ handler to
perform a keyscan when the IRQ was not the Kernel's. While
the fix is trivial, I did not include it because it might
cause problems with existing software which may be taking
advantage of the unintentional keyscans.
3. IRQ and NMI handlers. The Kernel forces the system bank
into context before taking the RAM indirect vectors to the
actual interrupt handler. Much flexibility can be added to
the mechanism if the memory bank to be brought into context
at interrupt time could be read from a variable instead of a
ROM constant. I am reluctant to include this change because
the RAM variable would have to be located in a previously
'free' location, which may be used by existing applications.
4. SAVE-to-disk. It is not possible to SAVE the last byte of
any memory bank (e.g., RAM at $FFFF), because the SAVE
routine requires you to specify the end of the area to be
SAVEd as the ending address PLUS ONE ($FFFF+1 -> $0000).
This is a problem found on all CBM 65xx systems.
5. SAVE-to-cassette. It is not possible to save the last page
of any memory bank (e.g., RAM at $FF00-$FFFF) to tape. The
tape handler hangs with the motor running until the user
STOPs it. This is a problem found on all CBM 65xx systems
except the Plus-4.
6. SAVE and LOAD. While program SAVEs correctly save the
16-bit starting address for future LOADs, the existing
formats do not save the memory bank. This cannot be
accommodated without the creation of special C128 program
headers for disk and tape, which is undesirable and
non-trivial.
7. STOP/RESET monitor entry. It is not possible to enter the
Monitor directly via the STOP/RESET sequence from BASIC and
then eXit back to BASIC without incurring a 'cold' BASIC
initialization. The alternative, taking the BASIC 'warm'
start route, would result in a system crash if BASIC had not
been properly initialized and is therefore not a recommended
fix. The work-around, assuming BASIC was running before
STOP/RESET, is for the user to place the value $C1 into
location $A04 (INITSTATUS) and then eXit.
8. Monitor 'H' (hunt) command. Because the editor performs
various translations on data read from the screen, it is not
possible to Hunt for certain CBM characters, such as pi and
all reverse-field characters.
9. BOX command. BOX, because of the particular algorithm
utilized, has a restricted range of -16384 to +16383
(unscaled). The algorithm uses parameters that are twice
those given for calculations and divides down the result
before plotting. Thus it is possible for very large
(unscaled) positive coordinates to result in large negative
plots. The work-around is to use SCALEing, user
range-checking, or avoid BOX and use either DRAW or CIRCLE
commands instead.
10. RDOT, PEN, and RSPPOS functions. These BASIC functions
return the current pixel cursor, lightpen and sprite
positions, respectively, but the values they return are
unSCALEd. Correcting this is trivial, but would result in
problems for existing applications as well as being
incompatible with C64 VSP and the PLUS-4.
11. FNDEF and GRAPHIC modes. After defining a user function,
anything that results in program relocation must be avoided,
such as GRAPHIC 'n' or GRAPHIC CLR. There is no fix
planned. The work-around is a general rule: define GRAPHIC
screens first (then SCALE), then define functions.
12. HELP command. HELP does not completely identify two type of
syntax errors: 'RUN n' where 'n' is an undefined statement,
and 'XXXX n' where 'XXXX' is any BASIC command which expects
no argument. In the RUN case, TXTPTR had already been
reset, but not OLDLIN, thus the correct line is displayed
but without any highlighting. In the other case, because
XEQCM exits via CHRGET, TXTPTR is incremented before the
error is caught, resulting in part of the error not being
highlighted. The fix would be too complex, especially
considering the fact that the line containing the error is
reported, albeit without highlighting.
13. GETKEY function. In the form 'GETKEY A', this BASIC
function should wait until a numeric key is pressed, but
certain non-numeric keys are accepted, such as 'E', colon,
comma, period, '+', and '-'. The same anomaly occurs with
'GET A' for the same reason, as is a known CBM quirk.
14. PUDEF and PRINT USING commands. There is poor documentation
of the fact that USING format fields such as "$,###.##", the
leading '$' or commas are not interpreted per the PUDEFs as
they are considered not part of the numeric field. This is
found to occur in all versions of CBM BASIC 3.5 or higher.
15. RENUMBER command. Because of the routine's use of LINNUM to
fetch from BASIC text the statement number of an object, it
is possible to get a 'syntax error' when none existed within
the RENUMBER command line itself. LINNUM itself reports any
line numbers it reads that are out of range (>63999).
Actually, you could use this to 'protect' a program from
RENUMBERing. Also note that RENUMBER can not renumber line
ranges. Therefore, LIST and DELETE statements within a
program are NOT changed nor will they generate any errors.
16. OUT of MEMORY ERROR. It is possible to hang the system with
this error from a running program when there is insufficient
memory to contain the string representation of the original
line number where the error occurred. One must STOP/RESTORE
the system and type CLR to recover. This problem is found
on most CBM 65xx systems.
17. BASIN ($FFCF) calls return <space><return> to <return> input
(i.e., null input line). The culprit is an unnecessary BEQ
test in LOOP4, which was left in for compatibility with the
C64 and PLUS-4 editors, which behave in a similar manner.
18. MATH package. The binding of operators is such that unary
minuses are evaluated after powers. This results in NO error
when equations of the form (-4^.5) are evaluated (square
root of a negative number). Of course, the error is given if
the sign of the number is known when the power is applied
(eg., X=-4 :PRINT X^.5). This is a known CBM quirk.
19. BASIC DOS commands, such as DOPEN and APPEND, limit
filenames to 16 characters maximum. However, when the name
string includes the filetype, such as "LONGLONGLONGLONG,P",
BASIC reports a FILENAME TOO LONG error when, in fact, it is
valid. This is a problem on all CBM systems > DOS 3.0.
20. DCLOSE accepts both LFN and UNIT parameters simultaneously,
which it should not (they should be mutually exclusive). The
LFN is always used, and the UNIT ignored, if both are given.
21. AUTO command puts next line number into the KEY buffer. It
should probably just print it. This only causes a problem
when used with function key strings containing <return>s.
22. INSERT Editor mode is not canceled by specific ESCAPE
sequences which move the cursor. For example,
<INS><INS><INS> <ESC>K <CRSR><CRSR><CRSR> illustrates that
staying in INSERT mode after moving the cursor to the EOL is
undesirable.
23. CIRCLE command in multicolor mode calculates default
Y-radius based upon twice the X-radius. This is
undesirable, but maintained to preserve compatibility among
C64 VSP, PLUS-4, and C128.
24. TAPEs written in FAST mode are occasionally hard to read in
SLOW mode. While I would not be surprised by this, I could
not repeat the problem. The complaint comes from PAL/50Hz
environments, but that may be the only place tapes are used!
Users should take care to use tapes only in SLOW (1MHz) mode
so that the tapes can be read on PETs, 8032s, C64s, etc.
25. VERIFY and DVERIFY will report 'verify error' when, in fact,
the programs are identical. This occurs when the LOADed
version of the BASIC program has been relocated since it was
SAVEd, usually the result of the GRAPHIC command. In such
cases, the MSB of line links differ, and (D)VERIFY fails.
Try GRAPHIC <n|CLR> as appropriate and try again.
--
Fred Bowen uucp: {ihnp4|seismo|caip}!cbmvax!fred
arpa: cbmvax!fred@seismo.css.GOV
tele: 215 431-9100
Commodore Electronics, Ltd., 1200 Wilson Drive, West Chester, PA, 19380