Libraries
These bugs are in the libraries that provide the commands of Blitz Basic 2 (Libraries). A fix in a library changes only that library, and a program behaves differently only where it ran into the bug. The first sections show the ones an ordinary program can run into, each with a short program; the other fixes follow as a list, one sentence each with a link to its issue. The table on Important Fixes & Breaking Changes lists all fixed bugs by what they can change in a program.
The outputs shown were recorded in an emulator: the original is the program compiled with the libraries of the Blitz Basic 2 CD, the port the same program compiled with the port’s libraries. The programs run without runtime error checking unless the text says otherwise.
Changes for existing programs
The fixes in this part change the result of a program that ran correctly with the original: what it computes, draws or sends, or which way it takes. Check your sources for the commands they name.
In the command libraries:
RenderToBitmapwith a dither bitmap andBoxdraw on the right bitmap at the right place. Only a program written to make up for the bug changes; no known example program, demo or game does that.CustomSpritestakes its offset in the documented unit: every program that gives it an offset other than 0 changes.LoadShapestops with a runtime error on pictures too large to blit, which it loaded before.ReplyRexxMsggives the result string to other ARexx replies than before.WriteSerialStringandReadSerialtake the flags their help text names.GetMedVolumeno longer silences the channel it reads, so the next read no longer gives 0.Translate$returns its phonemes without an extra 0 byte.- Blitz code with runtime error checking that
runs in supervisor mode outside a
SetIntroutine hangs at its first trap. - A simulated event no longer ends a running recording or playback of a tape.
^with a negative base and a whole odd exponent gives a negative result:(-2)^3is -8 instead of 8.
In the RWE userlibs:
BlockToShapecopies the whole of a shape wider than 16 pixels.RTEZGetLongwithout a default value no longer offers and returns the number of the call before.BankLimit nandFindVolumereturn the numbers their manual gives instead of an address, andD_FindVolumeof rilesdebuglib returns -1 or 0 asFindVolumedoes.PutIconObjectreports an icon it could not write and keeps it open.SetToolValueno longer replaces a tool type whose name only begins with the name given.StoreNVDatareturns True for a stored item instead of 0.RXRunCommandandAddAppMenureturn -1 for success instead of a value the system left or an address.AppEventIDreturns -1 instead of 0 when there is no App event.- A second
DataTypeCreateorMakeCommodityis refused while the first object or commodity exists. ILBMPalettewith an offset makes a palette that is too small larger instead of replacing it.FillPalettewith an end colour of 0 fills up to the last colour.Derez,DoColSplitandCopperAGAColreturn -1 or 0.GetCCOffsetreturns its offset afterCopperResetAdr.OpenDiskof the floppy library ritrackdisklib without a device name always opens trackdisk.device instead of the device of an earlierOpenDisk.SetIOSize nof the serial link library rifastseriallib makesDoSerialIOtransfer n bytes instead of n + 1.SerialGotof riseriallib returns the number of bytes received instead of -1.
The fixes that leave a program doing its job, but change something you may notice, such as its sound or the events on a tape, follow in Changes you may notice.
RenderToBitmap with a dither bitmap drew on the wrong bitmap
RenderToBitmap BitMap#,DitherBitMap# makes RenderPoly draw on
BitMap#, filled with the pattern of DitherBitMap#, as BitMapPoly
does with a dither bitmap.
What happened. The original took the two bitmaps the other way round: after
RenderToBitmap 0,1
RenderPoly 3,&pts(0),2it drew the polygon on bitmap 1, with bitmap 0 as the pattern, and left
bitmap 0 unchanged. A program that wanted to draw on bitmap 0 had to write
RenderToBitmap 1,0.
With the port. RenderPoly draws on the first bitmap with the second
as the pattern, as the command is documented: the lines above draw on
bitmap 0. RenderToBitmap with one bitmap is not affected.
What to change. A program that swapped the two arguments to get the polygon on the right bitmap now draws on the dither bitmap. Write the bitmap to draw on first and the dither bitmap second.
Issue: RenderToBitmap b,d and RenderPoly drew on the dither bitmap (#421).
Box added the bitmap origin twice
BitMapOrigin moves the point 0,0 of a bitmap for the drawing commands.
Line, Boxf and Plot add the origin to their coordinates once;
Box added it twice, so after BitMapOrigin 0,50,50 the line
Box 0,0,10,10,1 drew its corner at 100,100.
With the port. Box adds the origin once, like the others: the corner
is at 50,50. Without BitMapOrigin, or with the origin 0,0, nothing
changes.
What to change. A program that gave Box coordinates reduced by the
origin to make up for the doubling now draws the box displaced. Give
Box the same coordinates as Line and Boxf.
Issue: Box added the bitmap origin twice (#391).
CustomSprites took its offset 16 times too large
A copper list of the display library can hold custom copper
instructions, reserved with the numcustoms of InitCopList.
CustomColors, CustomString, CustomSprites and CustomChunky fill
them at a line of the display, CCOffset instructions into that space;
an instruction is four bytes. CustomSprites CopList#,CCOffset,YPos,NumSprites
sets up the further sprites, the channels 8 to 15 of a list with 8.
What happened. The original took the CCOffset of CustomSprites
as a number of 16 instructions: CustomSprites 0,2,14,2 put its
instructions 32 instructions into the custom space instead of 2, over
those of other custom commands or behind the space. With runtime error
checking, an offset above the sprite maximum of the compiler options
was the error “Value out of Maximum Range”.
With the port. CCOffset counts instructions, as for the other
custom commands and as the command is documented: the line above starts
the sprite instructions 2 instructions into the custom space. An offset
of 0 is not affected, and the offset is not checked against the sprite
maximum.
What to change. A program that gives CustomSprites a CCOffset
other than 0 now puts the sprite instructions at another place. Give
the offset in instructions, counted like those of CustomColors and
CustomString. To keep the place the original used, multiply the old
offset by 16.
Issue: CustomSprites misused CCOffset as a sprite object number (#324).
LoadShape refuses pictures too large to blit
The blitter draws a shape in one go, with its size given as one word: 10 bits for the height and 6 for the width in 16 pixel words. A shape keeps that word, so it can be at most 1023 rows high and 62 words, 992 pixels, wide.
What happened. LoadShape loaded a taller or wider picture all the
same. The size word wrapped, and every blit of the shape drew a wrong
part of it: a picture 1100 rows high was blitted 76 rows high.
With the port. LoadShape of a picture taller than 1023 rows or
wider than 992 pixels is the runtime error “Can’t Read/Write Shapes
File”, also without runtime error checking, and the shape stays empty.
This can stop a program that ran with the original: one that loaded
such a picture as a shape only to read its size with ShapeWidth and
ShapeHeight, and never blitted it.
What to change. Load such a picture as a bitmap, with LoadBitMap,
or cut it into shapes of at most 1023 rows and 992 pixels
(LoadShape of a picture too large to blit).
A plane just under 64 KB. A shape also keeps the size of one plane
with an extra word per row in 16 bits: BBlit saves that many bytes of
the background per plane. The original kept only the lower 16 bits of it
for a picture whose plane alone is just under 64 KB, so BBlit saved and
restored the wrong amount. LoadShape refuses such a picture with the
same runtime error, as InitShape and GetaShape refuse a shape of its
size with runtime error checking.
The rule for a shape is that the size of one plane with its extra word per row, (⌈width / 16⌉ × 2 + 2) × height bytes, must stay below 65536 (64 KB). A picture of 992 by 520 pixels loads; one of 992 by 528 is refused.
Only pictures 512 to 992 pixels wide and 521 to 1023 rows high can fall
into this band. A program that loaded one and only blitted it with Blit
stops here too
(LoadShape of a picture with very large planes).
Issues:
- The blit size word of a shape taller than 1023 rows overflows (#1046)
- LoadShape and the shape creation checks use different 64 KB plane limits (#1055)
ReplyRexxMsg gave the result string to the wrong messages
A program that sends an ARexx message can ask for a result string: it
sets the flag RXFF_RESULT ($00020000) in the action it gives
SendRexxCommand, as an ARexx script does with OPTIONS RESULTS. The
program that gets the message answers with
ReplyRexxMsg msg,Result1,Result2,ResultString. If Result1 is 0 and
the sender asked for a result, ResultString goes back as the result
string, in place of the number Result2, and the sender reads it with
GetResultString.
What happened. The original tested another bit of the action, the one
that marks a function call (RXFUNC, $02000000). A command that asked for
a result got none, only the number Result2, and a function call that
had not asked for one got the string in place of its number. In this
program rp is the program’s own reply port and rx a port at which it
gets its own messages, so that it plays both sides:
SendRexxCommand r,"cmd",$01020000 ; a command (RXCOMM) with RXFF_RESULT
q.l=RexxEvent(rx)
ReplyRexxMsg q,0,7,"sent"
q=RexxEvent(rp)
NPrint "comm [",GetResultString(q),"]"
SendRexxCommand r,"func",$02000000 ; a function call without RXFF_RESULT
q=RexxEvent(rx)
ReplyRexxMsg q,0,7,"not sent"
q=RexxEvent(rp)
NPrint "func ",GetRexxResult(q,2)=7With the original
comm []
func 0With the port
comm [sent]
func -1The command gets its result string, and the function call keeps the
number 7. Nothing changes for a function call that sets RXFF_RESULT,
which gets the string from the original and the port alike, nor for a
reply with a Result1 other than 0, which carries the number in both.
What to change. A program that answers ARexx scripts needs no change:
a script that asks for a result gets ResultString. A program that sends
commands with RXFF_RESULT and read the number Result2 of the reply with
GetRexxResult now finds the address of the result string there; read
the string with GetResultString. A program that sends function calls
without RXFF_RESULT and read their answer with GetResultString now gets
the empty string; set RXFF_RESULT, or read the number with
GetRexxResult(msg,2).
Issue: ReplyRexxMsg made the result string for the wrong messages (#48).
The flags of WriteSerialString and ReadSerial
WriteSerialString unit#,string,Flags sends a string to a serial unit
opened with OpenSerial. Its help text names two flags: 1 makes the
command wait until the string is sent, and 2 sends the whole string,
zero bytes included, where without it the string ends at its first zero
byte. ReadSerial(unit#,flags) returns the next byte that came in, or
-1 if none is waiting; its help text says that the flag 1 makes it wait
for a byte instead.
What happened. The original took both meanings of
WriteSerialString from the flag 2 and never looked at the flag 1. A
program that passed 2 got the whole string and a command that waited; a
program that passed 1 got neither. ReadSerial waited only with the
flag 2, and with the flag 1 returned -1 at once when nothing had come.
With the port. Both commands take the flags of their help text:
WriteSerialString 0,a$,2 ; original: the whole string, waits until it is sent
; port: the whole string, goes on at once
WriteSerialString 0,a$,3 ; both: the whole string, waits until it is sent
WriteSerialString 0,a$,1 ; original: up to the first zero byte, goes on at once
; port: up to the first zero byte, waits
c.w=ReadSerial(0,1) ; original: -1 if no byte is waiting
; port: waits for the next byte
c.w=ReadSerial(0,2) ; both: waits for the next byteWhat to change. A program that passes 2 to WriteSerialString and
counts on the command waiting passes 3; that works with the original and
the port alike. A write that does not wait is still going on when the
command returns: wait for it, with Wait and SerialEvent, before the
next command that writes to the same unit. A program that calls
ReadSerial with the flag 1 to look for a byte without waiting passes 0,
or leaves the flag out.
Issues:
- WriteSerialString took TrueString and DoIO both from the flag 2 (#254)
- ReadSerial waited with the flag 2, not 1 (#255)
GetMedVolume silenced the channel it read
GetMedNote, GetMedInstr and GetMedVolume tell what a channel of a
MED module plays, for example for graphics that follow the music.
GetMedNote and GetMedInstr give 0 once they have been read, until the
channel plays its next note, so that a program can see when a new note
starts.
What happened. The original’s GetMedVolume also set its value to 0
after reading it. But that value is the volume the player gives the
channel in every step of the music: after the first GetMedVolume the
channel was silent until a note with an instrument number or a volume
command set the volume again. A program that shows the volume in every
frame silenced its own music:
LoadMedModule 0,"song.med"
StartMedModule 0
Repeat
VWait
PlayMed
NPrint GetMedVolume(0)
Until Joyb(0)
StopMed
EndWith the original, every note on channel 0 sounded only until the next
call of PlayMed, and the program printed its volume
once and then 0. With the port, the channel plays as it does without
GetMedVolume, and the program prints the volume of the note in every
frame.
What to change. A program that used the 0 after the first read to see
that a new note has started reads GetMedNote instead, which still gives
0 once it has been read. A program that reads the volume only to show it
needs no change.
Issue: GetMedVolume clears the volume, the channel goes silent (#212).
Translate$ added a 0 byte to its result
Translate$ turns a text into phonemes, the form PhoneticSpeak speaks.
What happened. The original’s result was one character too long: it
ended in the 0 byte that ends the phonemes in memory, and text added
after it came after that 0. This program prints the length and the last
character of the result, and of the result with an x added:
t$=Translate$("hello")
NPrint "len ",Len(t$)," last ",Asc(Right$(t$,1))
u$=Translate$("hello")+"x"
NPrint "len ",Len(u$)," 9th ",Asc(Mid$(u$,9,1))," 10th ",Asc(Mid$(u$,10,1))
EndWith the original
len 10 last 0
len 11 9th 32 10th 0With the port
len 9 last 32
len 10 9th 32 10th 120The phonemes are /HEH4LOW with a blank at the end, and the x
follows them.
What to change. A program that removed the last character of the
result itself, for example with Left$(t$,Len(t$)-1), now removes a
real one: drop that step.
Issue: Translate$ returns the length including the terminating 0 (#277).
Runtime error checking in supervisor mode outside SetInt
A program compiled with runtime error checking, or one that uses
SetErr, handles its own runtime errors. Each program takes only its
own traps, through the trap handler of its task, so two such programs can
run at the same time without taking away each other’s error handling.
The original put its handlers into the trap vectors of the whole
machine, and the program that ended first removed those of the other.
What changes. AmigaOS calls the trap handler of a task only while
the task runs in user mode. A SetInt routine runs in supervisor mode,
and its traps are handled as before. Other Blitz code compiled with
runtime error checking that runs in supervisor mode, such as a routine
called through exec’s Supervisor() or an interrupt server installed by
hand, hangs the machine at its first trap; the original’s handlers took
such a trap. AmiBlitz3 behaves like the port.
What to change. Compile the code that runs in supervisor mode
without runtime error checking, between RunErrsOff and RunErrsOn, or
make it a SetInt routine.
Issue: Runtime error checking takes the global trap vectors: two programs break each other (#1069).
A simulated event ended a running Record or PlayBack
A tape holds mouse and keyboard events: Record records what the user
does onto it, and PlayBack plays it back. The commands Type,
AbsMouse, RelMouse, MouseButton and ClickButton make such events
themselves, as if the user typed or moved the mouse; they can be used
while a tape records or plays, for example to type a text into the
program that a tape drives.
What happened. Each of these commands ended a running recording or
playback, whether its event was executed or went onto a tape with
TapeTrap. XStatus was 0 from then on, and the rest of a tape that was
playing was lost. This program moves the pointer while it records:
Record 0
VWait 10
AbsMouse 40,30
VWait 10
NPrint "status ",XStatus
Record
NPrint "stopped ",XStatus
EndWith the original
status 0
stopped 0With the port
status 1
stopped 0The recording goes on after AbsMouse, with the same time base, and the
pointer move is on the tape; Record without a tape ends it.
What to change. A program that used one of these commands to stop a
recording or a playback ends it with Record or PlayBack without a
tape number.
Issue: Appending to a tape clears the mode, Record and PlayBack stop (#96).
^ lost the sign of a negative base
The operator ^ raises its left operand to the power of its right one.
It always computes in Float, whatever the types of its operands, and the
compiler hands that calculation to the first entry of mathtranslib.
What happened. The original gave the power of the base’s absolute
value, also when the exponent is a whole odd number, where the result
must be negative: (-2)^3 was 8 instead of -8. This program shows it
with variables of different types:
vm.w=-2 : vf.f=-2.5 : vn.w=-3 : nw.w=3
rf.f=0 : rl.l=0
rf=vm^3 : NPrint rf
rf=vm^-1 : NPrint rf
rf=vf^nw : NPrint rf
rl=vf^nw : NPrint rl
rf=vm^2 : NPrint rf
rf=vn^1.5 : NPrint rf
EndWith the original
8
.5
15.62499
15
4
5.196152With the port
-8
-.5
-15.62499
-15
4
5.196152A negative base with a whole odd exponent, also a negative one such as
-1, gives a negative result, and a whole even exponent a positive one.
The exponent may be a whole number, a Quick or a Float: what counts is
its value, so a Float 3 is odd as well. With a fraction in the exponent
a negative base has no real power, and the port gives the power of the
absolute value as the original did: (-3)^1.5 is 5.196152, the same as
3^1.5. The minus sign binds more tightly than ^, so -3^nw is the
power of -3 as well: -27 with the port, 27 with the original. Only
-(3^nw), the negated power of 3, was -27 in both.
The fix is in the port’s mathtranslib, so a program compiled with the libraries of the Blitz Basic 2 CD keeps the original result. AB3 mode uses AmiBlitz3’s libraries and gives AmiBlitz3’s result, which drops the sign as the original did.
What to change. A program that relied on the positive result, for
example to avoid Abs, writes Abs(x)^n.
Issue: ^ with a negative base drops the sign: (-2.5)^3 gives 15.625 (#1189).
BlockToShape copied only part of a wide shape
bb_blitlib holds
the blitter routines of the game Blitz Bombers. Its BlockToShape
copies the data of one shape into another shape of the same size.
What happened. The command copied one word, 16 pixels, of every line of the shape, whatever the shape’s width. The planes of a shape lie one after another, so of a wider shape only the first part of its data reached the other shape: of a shape 32 pixels wide the first half, its first planes. This program copies a box of colour 15, 32 by 16 pixels in four planes, and draws the copy:
BitMap 0,320,64,4
Boxf 0,0,31,15,15
GetaShape 0,0,0,32,16
GetaShape 1,0,20,32,16
OwnBlitter_
BlockToShape 0,1
WaitBlit_
DisownBlitter_
Cls
Block 1,0,0
WaitBlit_
NPrint Point(8,8)," ",Point(24,8)
EndWith the original
3 3With the port
15 15The original copied two of the four planes, so the copy came out in
colour 3. The port copies the whole shape, whatever its width; shapes
16 pixels wide are copied as before. With runtime error
checking, a shape that one blit cannot copy, one whose height times its
depth is more than 1024 or one wider than 1024 pixels, is the error
“Shape too large for BlockToShape!”
(BlockToShape with a shape too large for one blit).
What to change. A program that copies shapes wider than 16 pixels
with BlockToShape now gets the whole shape. One that relied on the
part the original copied has to copy that part itself.
Issue: BlockToShape copies one word per line: shapes wider than 16 pixels are copied only in part (#425).
RTEZGetLong offered the number of the call before
neilsreqtoolslib
makes the requesters of reqtools.library usable from Blitz Basic 2.
RTEZGetLong(Title$,BodyText$ [,DefaultValue]) asks the user for a
number; DefaultValue is the number the input field starts with.
What happened. The library kept the number of one call for the
next. A call without DefaultValue started with the number of the call
before, entered or given as its default, and when the user cancelled it
returned that number as if it had been entered. This program asks
twice; the user enters 42 in the first requester and cancels the
second:
n=RTEZGetLong("Age","How old are you?",30)
NPrint n
m=RTEZGetLong("Count","How many?")
NPrint mThe outputs are worked out from the library’s code, not recorded from a run of this program; the library’s test checks the same with a stand-in for reqtools.library.
| With the original | With the port | |
|---|---|---|
| The second requester starts with | 42 | 0 |
| The program prints | 42 and 42 | 42 and 0 |
With the port. A call without DefaultValue starts with 0 and
returns 0 when the user cancels. A call with DefaultValue returns the
default when the user cancels, as before. RTReturnValue is 0 after a
cancel and tells it from a number that was entered.
RTEZGetLongRange also starts with 0 without DefaultValue, even when
0 lies outside Min and Max; reqtools then asks for a number in the
range when the user confirms. It returned 0 on a cancel already.
What to change. A program that wants the requester to offer the
number entered last gives it as DefaultValue:
m=RTEZGetLong("Count","How many?",m).
Issues:
- RTEZGetLong returns the value also when the requester is cancelled (#457)
- RTEZGetLongRange without a default shows the previous call’s number (#1078)
BankLimit n returned an address
riamosfunclib
holds AMOS-style helpers by Red When Excited, among them memory banks:
blocks of memory with a number, from 0 to 49 at the start. BankLimit
without an argument gives the number of banks, and BankLimit n sets a
new number and frees every bank in use. The manual gives its syntax as
[numbanks=]BankLimit[(maxbanks)]: used as a function, the form with an
argument returns the number of banks as well.
What happened. The form with an argument returned the address of the library’s new table of banks instead of the number. This program sets 60 banks and tests the result:
DEFTYPE .l
s=BankLimit(60)
If s=60 Then NPrint "result 60" Else NPrint "result not the limit"
NPrint BankLimit
EndWith the original
result not the limit
60With the port
result 60
60What to change. Nothing, unless a program used the result of
BankLimit n as an address: it gets the number of banks now. The banks
themselves are reached with Start and Length, as before.
Issue: BankLimit n returns the address of the new start table (#483).
FindVolume returned an address instead of -1
FindVolume(name) of
riamosfunclib
tells whether a device, volume or assign of that name is there; the
argument is the address of the name without the colon, for example
&v$. The manual says that it returns -1 if the name is there and 0 if
it is not.
What happened. For a name that is there, the original returned the
address of its entry in the system’s list of devices, volumes and
assigns instead of -1. As a truth value, in If FindVolume(&v$), that
worked; a program that compared the result with -1 never found the
volume. This program asks for RAM, which is always there, and for a
name that is not:
DEFTYPE .l
v$="RAM"
r=FindVolume(&v$)
If r=-1 Then NPrint "RAM: -1" Else If r=0 Then NPrint "RAM: 0" Else NPrint "RAM: other"
v$="RWENOSUCHVOLUME"
NPrint "missing: ",FindVolume(&v$)
EndWith the original
RAM: other
missing: 0With the port
RAM: -1
missing: 0What to change. A program that tests the result as a truth value or compares it with -1 or 0 works as it is. One that used the address of the entry gets -1 now; the original gave that address out after it had released the list, so the entry could change or go away at any time.
Issue: FindVolume returns the DosList entry instead of -1 (#1082).
D_FindVolume returned an address instead of -1
D_FindVolume(name) of
rilesdebuglib
tells, as FindVolume of riamosfunclib does, whether a device, volume or
assign of that name is there; the argument is the address of the name
without the colon. It returns -1 if the name is there and 0 if it is not.
What happened. For a name that is there, the original returned the
address of its entry in the system’s list of devices, volumes and
assigns instead of -1, after it had released the list again. This
program asks for RAM, which is always there, and for a name that is
not:
DEFTYPE .l
v$="RAM"
r=D_FindVolume(&v$)
If r=-1 Then NPrint "RAM: -1"
If r=0 Then NPrint "RAM: 0"
If r<>0 AND r<>-1 Then NPrint "RAM: an address"
v$="RWENOSUCHVOLUME"
NPrint "missing: ",D_FindVolume(&v$)
EndWith the original
RAM: an address
missing: 0With the port, on Kickstart 1.x as on later ones:
RAM: -1
missing: 0What to change. A program that tests the result as a truth value, as
in If D_FindVolume(&v$), works as it is. One that compared it with -1
now finds the volume. One that used the address of the entry gets -1; the
entry belonged to a list the program no longer held, so it could change
or go away at any time.
Issue: D_FindVolume returns the DosList entry after the list is unlocked (#1167).
PutIconObject reported a failed write as success
ritooltypeslib
reads and changes the icons of files. It works on one icon at a time:
GetIconObject loads it, the other commands change it, and
PutIconObject writes it to the icon of a file and drops it.
FreeIconObject drops it without writing it. While an icon is loaded,
GetIconObject returns 0.
What happened. PutIconObject returned -1, success, also when the
icon could not be written, for example into a directory that does not
exist, and dropped the icon all the same. The program could not tell
that the icon was lost. This program loads the icon of SYS:Prefs,
writes it where no directory is and then drops it:
If GetIconObject("SYS:Prefs")
NPrint "icon"
NPrint PutIconObject("RAM:bug-orig-no-such-dir/test")
NPrint FreeIconObject
Else
NPrint "no icon"
EndIf
EndWith the original
icon
-1
0With the port
icon
0
-1With the original, PutIconObject reported success and FreeIconObject
found no icon. With the port, PutIconObject returns 0 and the icon
stays loaded, so FreeIconObject drops it and returns -1. A successful
write is as before.
What to change. Test the result of PutIconObject. After a failed
write, write the icon again, for example to another file, or drop it
with FreeIconObject: until then, GetIconObject returns 0 because an
icon is still loaded.
Issue: PutIconObject returns -1 even when PutDiskObject fails (#851).
SetToolValue replaced a tool type whose name only began with the name given
Tool types are the lines NAME=value or NAME in the information
window of an icon. SetToolValue tooltype$,value$ of
ritooltypeslib
replaces the tool type tooltype$ of the loaded icon.
What happened. The original replaced the first tool type that only
began with tooltype$: SetToolValue "FL","x" replaced FLAG by
FL=x when FLAG came before FL. This program makes the two tool
types FLAG and FL=1 and sets FL:
If GetIconObject("SYS:Prefs")
ClearToolTypes
r=NewToolType("FLAG","")
r=NewToolType("FL","1")
NPrint SetToolValue("FL","x")
NPrint FindToolNumber(0)
NPrint FindToolNumber(1)
Else
NPrint "no icon"
EndIf
EndWith the original
-1
FL=x
FL=1With the port
-1
FLAG
FL=xThe port replaces only the tool type of that name, switched off in
brackets or not, and FLAG stays.
What to change. A program that gave SetToolValue an abbreviation
of a name on purpose has to give the whole name; with an abbreviation,
SetToolValue returns 0 now.
Issue: SetToolValue replaces the first entry that only begins with the name (“FL” replaces “FLAG”) (#853).
StoreNVData returned 0 for a stored item
StoreNVData of
rinonvolatilelib
stores an item, such as a saved game, in the nonvolatile memory of a
CD32 or in its replacement on disk. Its guide documents the result as
True or False, whether the item was stored.
What happened. The original returned the result of the system’s nonvolatile.library instead: 0 when the item was stored, and an error code when it was not. A program that tested the result as documented reported every successful save as a failure, and every failed one as a success. This program stores a long on a system where the item cannot be stored, as in the emulator, which has no nonvolatile memory and only a read-only system disk:
d.l=$12345678
NPrint "open ",IsNonvolatile
r.w=StoreNVData("RWETest","Item",&d,4)
If r Then NPrint "stored" Else NPrint "not stored"
NPrint "result ",r
EndWith the original
open -1
stored
result 3With the port
open -1
not stored
result 0With the port, StoreNVData returns -1 when the item was stored and 0
when it was not, also without nonvolatile.library.
What to change. A program that tested for 0 to find a successful
save has to test for a value other than 0, as the guide says:
If StoreNVData(...) is true when the item was stored.
Issue: StoreNVData returns StoreNV’s result (0 = stored) instead of the documented TRUE/FALSE (#1085).
RXRunCommand returned a value the system left
riarexxlib
gives a program an ARexx port. RXRunCommand sends a command to the
port of another program, or to ARexx, and goes on without waiting for
the reply; its result tells whether the command was sent.
RXRunScript and RXExecuteScript, which send a script to ARexx, give
the same result.
What happened. When the command was sent, the original returned whatever the system’s call that sends a message had left in a register, not a defined value. Two runs of the same program gave 0 and 256, so a program that tested the result could take a command that was sent for one that was not. This program sends a command to its own port and prints whether the result is -1:
DEFTYPE .l
p=RXCreatePort("BUGORIG")
r=RXRunCommand("BUGORIG","hello")
NPrint "result -1: ",r=-1
m=RXReadPort
If m Then RXReplyMsg 0
EndWith the original
result -1: 0With the port
result -1: -1With the port, RXRunCommand returns -1 when the command was sent and
0 when it was not: when the port is not found, when rexxsyslib.library
is missing, when there is no memory for the message, or when 31
commands sent this way still wait for their replies.
What to change. A program that ignored the result works as before.
One that tested it now finds it true whenever the command was sent;
test it as a truth value, If RXRunCommand(...), or compare it with
0.
Issue: RXRunCommand returns whatever d0 PutMsg leaves (#543).
A second DataTypeCreate lost the object before
ridatatypeslib
loads files through the datatypes of Workbench 3. It works on one file
and one object at a time: DataTypeOpen opens the file,
DataTypeCreate loads it into a datatype object, and DataTypeClose
frees the object and closes the file. DataTypeOpen and
AttachDataType already refuse a second file or window while the first
is in use.
What happened. A second DataTypeCreate made a new object and
stored it over the first, which nothing freed any more: the memory of
the first object, for a picture its whole bitmap, was lost until the
system was reset. This program loads a picture of 320 x 200 pixels with
16 colours, calls DataTypeCreate twice and then tests whether more
than 16000 bytes of memory are missing after DataTypeClose. A first
round loads the system’s classes, so that they do not count:
DEFTYPE .l
If DataTypeOpen("CORPUS:p.ilbm")
o=DataTypeCreate
DataTypeClose
EndIf
m0=AvailMem_(0)
If DataTypeOpen("CORPUS:p.ilbm")
o=DataTypeCreate
NPrint "first ",o<>0
o=DataTypeCreate
NPrint "second ",o<>0
DataTypeClose
EndIf
m1=AvailMem_(0)
NPrint "lost ",m0-m1>16000
EndWith the original
first -1
second -1
lost -1With the port
first -1
second 0
lost 0With the port, DataTypeCreate returns 0 while an object exists, and
the first object stays in use until DataTypeClose.
What to change. A program that called DataTypeCreate once per
DataTypeOpen works as before. One that called it again to load the
file anew, for example with another tag list, gets 0 and keeps the
first object: call DataTypeClose and DataTypeOpen before the next
DataTypeCreate.
Issue: A second DataTypeCreate loses the object made before (#600).
A second MakeCommodity left a commodity behind
ricommoditieslib
turns a program into a commodity: MakeCommodity registers it with the
system, which lists it in the Exchange program, and SetHotKey gives it
hotkeys. The messages of the commodity, from Exchange and from its
hotkeys, arrive at one message port of the program.
What happened. Every MakeCommodity made a new commodity with that
port, without removing the one made before. The first one stayed
registered and active, and at the end of the program only the last one
was removed. The first then kept the program’s message port, which was
deleted, and the system crashed as soon as it sent the commodity a
message, for example that the list of commodities had changed. This
program calls MakeCommodity twice with two names:
If MakeCommodity("BugOrigTwiceA","BugOrig","first")
NPrint MakeCommodity("BugOrigTwiceB","BugOrig","second")
Else
NPrint "no commodity"
EndIf
EndWith the original
-1With the port
0With the port, MakeCommodity returns 0 while the program has a
commodity, and the first one stays in use with its name, its texts and
its hotkeys.
What to change. A program that calls MakeCommodity once works as
before. One that called it again, for example to change the texts that
Exchange shows, gets 0 and keeps its first commodity; there is no
command to remove a commodity before the program ends, but SetCxStatus Off deactivates it.
AddAppMenu returned an address
riapplib makes a
program part of Workbench with App windows, App icons and App menu
items. AddAppMenu id,text$ adds an item to the Tools menu of
Workbench. Like AddAppWindow and AddAppIcon, it returns -1 when the
item was added and 0 when not.
What happened. The original returned the address of the menu item in the system instead of -1. A program that tested the result as a truth value worked, but one that compared it with -1, as with the other two commands, took every added item for a failure:
If AddAppMenu(0,"My tool")=-1
NPrint "added"
Else
NPrint "not added"
EndIfWith the original this printed not added although the item was in
the Tools menu; with the port it prints added.
What to change. A program that tested the result with <>0 or as a
truth value works as before. One that kept the address to pass it to
workbench.library itself gets -1 now; the library removes the item with
DelAppMenu and at the end of the program.
Issue: AddAppMenu returns the AppMenuItem address instead of -1 (#518).
AppEventID returned 0 without an App event
riapplib numbers
its App windows, App icons and App menu items from 0 to 15. After
AppEvent has fetched a message, AppEventID gives the id of the
object that sent it. Without a current message, before the first
AppEvent or after one that found no message, it returns -1, as the
library’s guide says: “-1 means that no AppEvent occurred”.
What happened. The original returned 0 without a message, which is
also the id of the first object of each kind. A program that read
AppEventID without testing the result of AppEvent could not tell
“no message” from “a message of object 0”. This program has one App
icon with the id 0 and asks AppEventID in every frame:
If AddAppIcon(0,"Drop here","SYS:System/Format")=0 Then End
Repeat
VWait
r=AppEvent
If AppEventID=0 Then NPrint "icon 0"
Until Joyb(0)
DelAppIcon 0With the original it printed icon 0 in every frame, whether files
were dropped on the icon or not. With the port it prints icon 0 only
for a message of the icon.
What to change. A program that tests the result of AppEvent
before it reads AppEventID works as before. One that took 0 for “no
message” tests for -1, or tests AppEvent first.
Issue: AppEventID returns 0 without an event; the manual says -1 (#1102).
ILBMPalette with an offset replaced a palette that was too small
ripacklib
unpacks IFF ILBM pictures that a program holds in memory.
ILBMPalette source,palette#,offset takes the colours of the picture’s
CMAP chunk into palette object palette# from colour number offset
on, so that a program can put the colours of several pictures into one
palette.
What happened. When the palette had fewer colours than offset
plus the colours of the CMAP, the original threw the palette’s colours
away, made a new palette of only the CMAP’s colours and put them from
colour 0 on; it still returned -1. A palette of 8 colours and a CMAP of
4 colours loaded at offset 6 gave a palette of 4 colours, the CMAP’s,
at 0 to 3.
With the port. The palette grows to offset plus the colours of
the CMAP and keeps its own colours; colours between its old end and
offset are black. In the example the palette has 10 colours: 0 to 5
as they were, 6 to 9 from the CMAP. Without offset, the palette is
replaced by the CMAP’s colours, as before.
What to change. A program that gave an offset to a palette that was too small and used the colours from 0 on leaves the offset out.
FillPalette with an end colour of 0 filled nothing
FillPalette palette#,r,g,b,start_col,end_col of
rigfxlib sets the
colours start_col to end_col of a palette object to one colour, and
AGAFillPalette does the same with 8 bit values. An end_col of 0
means “up to the last colour of the palette”, as the library’s guide
says.
What happened. With an end colour of 0 given as the constant 0 or
as a word variable, the original took colour 0 as the end colour and
filled nothing, or only colour 0 for a start_col of 0. Only a long
variable gave the documented result. The reason: the end colour is a
word, but the original tested the whole register it came in for 0.
What the upper half of that register held depended on the code the
compiler had made before the command, and with the constant 0 or a word
variable it was not empty. In this program the first FillPalette
sets the colours 2 to 7 of an 8-colour palette to 1, and the second
should set them to 2:
DEFTYPE .l
InitPalette 0,8
PaletteInfo 0
FillPalette 0,1,1,1,2,7
FillPalette 0,2,2,2,2,0
NPrint PalRed(1)," ",PalRed(2)," ",PalRed(7)With the original it printed 0 1 1: the second FillPalette did
nothing. With the port it prints 0 2 2.
What to change. Nothing in a program that uses the documented form. A program that wrote the number of the last colour instead of 0, to get around the bug, works as before.
Issue: FillPalette/AGAFillPalette test the whole register of end for 0, but compare only its word (#683).
Derez, DoColSplit and CopperAGACol returned no useful value
Three commands of the RWE userlibs can be used as functions. Each of them returns -1 when it did its work and 0 when it did nothing:
| Command | Library | What it does | Returns 0 |
|---|---|---|---|
Derez | rifxlib | makes a picture blocky | with a derez_value of 0 |
DoColSplit | ricopperfxlib | writes a colour split into a copper list | when no custom space for the copper instructions was chosen with CopperReset or CopperResetAdr |
CopperAGACol | ricopperfxlib | writes one AGA colour into a copper list | as DoColSplit |
What happened. The original set no result for Derez and
DoColSplit: the program got whatever the command had left in the
register, an address, a colour step or a word of the picture.
CopperAGACol returned 1234 without a custom space and its colour
number with one. This program asks Derez for its result four times:
DEFTYPE .l
BitMap 1,320,16,1
BitMap 2,320,16,1
r=Derez(1,2,0,0,0,8) : NPrint "0: ",r
r=Derez(1,2,0,0,1,8) : NPrint "1: ",r
r=Derez(1,2,0,0,2,8) : NPrint "2: ",r
r=Derez(1,2,0,0,3,8) : NPrint "3: ",rWith the original it printed 64, 65535, 0 and 0; with the port
it prints 0, -1, -1 and -1.
What to change. A program that uses the commands as statements
works as before. One that used the original’s values, such as the
colour number CopperAGACol returned, takes them from its own
variables.
Issues:
- Derez is declared with a long result but returns no defined value (#672)
- DoColSplit is declared with a word result but returns no defined value (#592)
- CopperAGACol is declared with a long result but returns 1234 or its col# argument (#590)
GetCCOffset returned -1 after CopperResetAdr
GetCCOffset of
ricopperfxlib
returns the place in the custom space where the library writes its next
copper instruction, counted in instructions; RedoColSplit needs it to
find a colour split again. CopperResetAdr points the library at a
space in a copper list of the program’s own, instead of the custom space
of a coplist.
What happened. The original’s GetCCOffset tested whether a
coplist had been chosen, not whether there was a custom space, so after
CopperResetAdr it returned -1, “no custom space”, although the other
commands wrote their instructions. With a block of memory at m:
CopperResetAdr m,44
CopperMove $180,$fff
NPrint GetCCOffsetWith the original this printed -1; with the port it prints 1, the
place after the CopperMove.
What to change. A program that used RedoColSplit with
CopperResetAdr and counted the offsets itself can take them from
GetCCOffset.
Issue: GetCCOffset returns -1 after CopperResetAdr although the commands work (#593).
OpenDisk without a name opened the device of an earlier OpenDisk
OpenDisk unit# of
ritrackdisklib
opens a floppy drive, unit 0 to 3 (DF0: to DF3:), through
trackdisk.device for the sector commands. OpenDisk unit#,devicename$
opens the unit of another device of the same kind.
What happened. The original copied the device name over its own
“trackdisk.device” and kept it there. Every later OpenDisk without a
name opened that device again, even when the OpenDisk with the name
had failed. This program tries a device that does not exist and then
opens DF0: as usual:
NPrint OpenDisk(0,"nosuch.device")
NPrint OpenDisk(0)
NPrint CloseDisk(0)
EndWith the original
0
0
0With the port
0
-1
-1With the port, OpenDisk unit# always opens trackdisk.device, as the
library’s guide documents, and a device name counts only for the
OpenDisk it is given to.
What to change. A program that opened another device once and then
used OpenDisk unit# to open it again has to give the device name each
time.
SetIOSize gave DoSerialIO one byte more
rifastseriallib
links two Amigas through the serial port. InitSerialIO sets the
number of bytes that DoSerialIO without an argument exchanges with the
other machine, and SetIOSize changes it.
What happened. The original stored the count of InitSerialIO as
it is meant, but that of SetIOSize one too high: after
Dim inb.b(15),outb.b(15)
InitSerialIO 19200,4,&inb(0),&outb(0)
SetIOSize 16
DoSerialIODoSerialIO exchanged 17 bytes, one more than the buffers hold: it
waited for a 17th byte from the other machine, stored it behind inb
and sent the byte behind outb.
With the port. SetIOSize n makes DoSerialIO exchange n bytes,
as InitSerialIO with a count of n does.
What to change. A program that wrote SetIOSize n-1 to get cycles
of n bytes now writes SetIOSize n. Both machines of a link must run
programs built with the same library: a machine that exchanges one byte
more than the other waits for a byte that never comes.
SerialGot returned -1 instead of the number of bytes
riseriallib
drives the serial port with interrupts of its own and keeps the bytes
received in a buffer. Its help text says that SerialGot “returns num
chars in serial buffer”.
What happened. The original’s SerialGot returned -1 when at least
one byte was waiting and 0 when none was. After the other machine had
sent the 16 bytes “0123456789ABCDEF”,
SerialOpen 19200
; ... the other machine sends 16 bytes
NPrint SerialGotprinted -1.
With the port. SerialGot returns the number of bytes waiting in
the buffer, 0 to 255; the lines above print 16.
What to change. A program that tested If SerialGot or SerialGot<>0
works as before. One that compared the result with -1, such as
If SerialGot=-1, tests for a value other than 0 instead.
Issue: SerialGot returns -1/0, not the number of bytes in the buffer its help text promises (#802).
Changes you may notice
With the fixes in this part, a program that ran correctly with the original still does its job, but something differs that you may notice and may want to adapt.
In the command libraries:
CustomColorswith athru256flagof 0 makes the next colour change below line 255 of the display at its own line.Filter OnandFilter Offswitch the audio filter the other way round.- A tracker module with a pattern break in its last song position loops at its song length.
- A MED module with more than 8 tracks no longer runs the commands of tracks 8 to 11, as a MED player does (Music players).
- Four smaller changes concern tapes of mouse and keyboard events and the keyboard in Blitz mode.
- Ctrl-C ends an executable compiled with
runtime error checking at its next
Print,NPrint,Edit$orEditon the console.
In the RWE userlibs:
- The file requester of
ReqFileRequestopens with the default flags its library means. LoadIFFworks withoutBankLimitand returns 0 for a picture it could not unpack.UnpackIFFreads pictures whose width is no multiple of 16 pixels.RXDeletePortand the end of a program wait up to 5 seconds for the replies to ARexx commands sent without waiting (Fixes in riarexxlib).FNSLengthreturns the whole width of a text, and the FNS fonts print a character they have no glyph for as a space instead of ending the text there.- In the zones of rizonejoylib,
NewZoneTableleaves the zones of the current table alone, circular zones on a 68020 hit only the points inside them, andSetZonerefuses a radius above 255 and a rectangle whose bottom edge is -1. - The Workbench sprites of riwbspritelib give
clear results:
GetWBSpritereturns -1 whenever it gets no sprite, andMoveWBSpritereturns -1 when it moved one. DiskMotorof ritrackdisklib reports whether the library has switched the motor of a drive on, instead of -1 at all times.- In the CD library ricompactdisclib,
CDTrackLength 1no longer counts the gap before the first track,CDVolumeno longer swaps the volume and the fade time, andOpenCDno longer keeps the SCSI flag, device and unit of an earlierOpenCD(Track lengths, volume and the SCSI flag). InitSerialIOandGetSerial address,bytesof rifastseriallib return -1 or 0 instead of their arguments.- The block commands of riseriallib open the
serial port when it is closed, and
SerialReceiveBlockkeeps the bytes that arrived before it. - In the debugger helpers of rilesdebuglib,
ExtractLabel,GetCustomRegAdrandFInverseend a label at a space, find a register only by its whole name, and invert the text ofFPrintDetoketoo. DisAssemble$of ridisasmlib returns a long instruction whole instead of cutting it after 34 columns.
Five more are in the lists of the RWE userlibs below:
FNSLoadworks withoutBankLimit(Fixes in rifnslib).ClearBitmapclears the last word of its area (Fixes in rifxlib).- A colour split from line 0 starts at line 0 (Fixes in ricopperfxlib).
- A Workbench sprite made of a shape whose width is no multiple of 16 shows the shape’s left 16 pixels unsheared (Fixes in riwbspritelib).
PauseModuleof ciatrklib pauses only a module that plays, andStartTracker,StopTracker,ChangeTrackerVBlankand freeing the module end a pause: twoPauseModuleno longer continue a module thatStopTrackeror the effectF00stopped (Other fixes).
CustomColors with a thru256flag of 0 acted as 1
A copper wait holds only the lower 8 bits of a line, so a custom
command at line 256 of the display or below first adds a wait for the
end of line 255. The last argument of
CustomColors CopList#,CCOffset,YPos,Palette,startcol,numcols,thru256flag
tells the display library that the colour change itself runs on past
line 255, as a large AGA palette change can: the custom commands after it
then add no second wait for line 255.
What happened. The original did not read the value of the flag: a
thru256flag of 0 acted as 1. After
InitCopList 0,44,256,3,8,8,20
CustomColors 0,0,20,0,0,1,0
CustomColors 0,4,220,0,0,1the second colour change, at line 264 of the display, had no wait for line 255, and the copper made it about 256 lines too early.
With the port. A thru256flag of 0 is the same as leaving the flag
out; any other value sets it. The second colour change above gets its
wait for line 255 and comes at its line.
What to change. A program that gives a thru256flag of 0 and needs
the flag set has to give 1.
Issue: CustomColors ignored the value of thru256flag (#951).
Filter On switched the audio filter off
The Amiga has a low-pass filter on its audio output that softens the
sound, and Filter On and Filter Off are meant to switch it on and
off. The filter is controlled by bit 1 of port A of the CIA-A chip, the
same bit that sets the power light: a 0 switches the filter on and makes
the light bright, a 1 switches the filter off and dims the light.
What happened. The original had the two the wrong way round: Filter On set the bit and so switched the filter off, and Filter Off switched
it on. This program reads the bit after each command:
Filter 1 : f1=Peek.b($BFE001) AND 2
Filter 0 : f0=Peek.b($BFE001) AND 2
NPrint "filter ",f1," ",f0With the original
filter 2 0With the port
filter 0 2Filter On clears the bit, so the filter is on and the power light
bright, as the manual says; Filter Off sets it.
What to change. Every program that uses Filter now gets the other
filter state. A program that was written for the sound of the original,
with Filter Off for a soft sound or Filter On for a bright one, swaps
the two. A program that followed the manual needs no change: it now gets
the filter it asked for.
A pattern break in the last song position played on behind the end
A tracker module plays its patterns in the order of its song positions. The song length says how many positions the song uses, and after the last one the song starts again at its restart position. A pattern break (effect D) or a position jump (effect B) ends a pattern early and goes on at the next position.
What happened. After a D or B in the last song position, the
original’s PlayModule compared the next position with a byte of the
pattern data instead of the song length, and took the restart position
from the byte after it. So it could miss the end of the song and play
on into the unused positions behind it, with whatever patterns they
name. A module with two song
positions, patterns 0 and 1, a break D00 in row 16 of pattern 1 and
pattern 2 in the unused position 2 behind them, plays like this:
| Positions played | |
|---|---|
| With the original | 0, 1 (to row 16), 2, and on behind the end |
| With the port | 0, 1 (to row 16), 0, 1, … |
What to change. Nothing for a module that is to loop as it does in the tracker: it now loops at its song length, as at the end of a pattern without a break. A module that relied on playing on behind its end needs a song length that covers all the positions it is to play.
Issue: After a pattern break or position jump the song end is compared with the wrong byte (#292).
More changes of tapes and the keyboard
These four fixes change what a program sees in a smaller way. Each is described in the lists of the other fixes below.
XStatusgives only 0, 1 or 2; the original added 32768 right afterRecord,PlayBackor a simulated event. A program that compared the value withAnd 255sees no difference (Tapes and simulated input).ClickButtonreleases the button it pressed, also after an executedClickButton 1, where the original released the left button (Tapes and simulated input).RelMousemakes a relative mouse event, so a tape records it as such; the pointer moves as before (Tapes and simulated input).BlitzKeys Offgives the keyboard input back to the input used beforeBlitzKeys On(Input).
Ctrl-C did not stop a program with runtime error checking
On the Amiga, Ctrl-C in a Shell window (or the Shell command Break)
sends the program that runs there a break signal. A C program reacts to
it at its next input or output on the console: it prints ***Break and
ends with the return code 20.
What happened. An executable compiled with runtime error checking
was meant to end at Ctrl-C, but its check never saw the signal: the
program ran on to its end. This program sends itself the break signal
with SetSignal_, as Ctrl-C does, and clears it again after the next
NPrint:
NPrint "start"
SetSignal_ $1000,$1000
NPrint "signalled"
SetSignal_ 0,$1000
NPrint "not stopped"
EndWith the original
start
signalled
not stoppedWith the port
start
signalled
***BreakThe program ends with the return code 20, which the Shell reports as
failed returncode 20. It ends as at End, with the same clean-up of
the libraries.
The check comes once at the end of each Print, NPrint, Edit$ and
Edit, so the text of the Print is still written, and Edit$ ends the
program after it has read its line. It applies only where a C program
would react too:
- only in an executable compiled with runtime error checking, and not
between
RunErrsOffandRunErrsOn; an executable without runtime error checking is not changed; - only on the program’s standard input and output, the console window
it was started from or what the Shell redirected them to; after
WindowOutput,BitMapOutput,FileOutputor one of the matching input commands, the program goes on; - a loop that does no input or output on the console still runs on, as it does in a C program.
What to change. A program that tests for Ctrl-C itself, for example
with SetSignal_ to clean up in its own way, is ended at a Print on
the console that comes between the signal and its test. Test for the
signal before such output, or put the output between RunErrsOff and
RunErrsOn.
Issue: Ctrl-C check in the TRAP #1 handler never effective (#43).
The file requester of ReqFileRequest opened with other flags
ReqFileRequest of
rireqlib opens the
file requester of req.library, a requester library that is not part of
AmigaOS. Flags decide what the requester offers, such as the selection
of several files or a gadget that hides .info files. ReqFlags sets
them; until a program does, the library uses its own default flags.
What happened. The library is written to start with three flags:
directory caching, the gadget that hides .info files, and the purge of
the cache when a directory changes. The original combined the numbers
of these flag bits instead of their values and so started with three
other flags: show .info files, extended select of several files, and
directory caching.
With the port. A program that does not call ReqFlags gets the
requester the library means: with the gadget for .info files, a cache
that is purged when a directory changes, and without extended select.
What to change. A program that relies on the requester of the
original sets its flags itself, with ReqFlags %111 or the flags
argument of ReqFileRequest.
Issue: The default requester flags OR bit numbers (2|4|7 = 7) instead of bit masks (#787).
LoadIFF needed BankLimit and reported pictures it had not unpacked
LoadIFF filename$,bitmap[,palette] of
ripacklib loads
an IFF ILBM picture file into a free memory bank of
riamosfunclib,
unpacks it into the bitmap object, and into the palette object if one is
given, and frees the bank again.
What happened. The original asked for a free bank from bank 51 on.
riamosfunclib has 50 banks, 0 to 49, unless the program raises the
number with BankLimit, so without that LoadIFF found no bank, loaded
nothing and returned 0. Once it had loaded the file, it returned -1
without looking at the unpacking: a file that is no ILBM picture, or a
picture too wide or too deep for the bitmap, left the bitmap as it was
and still counted as loaded. With a picture file of one plane:
BitMap 0,320,16,1
r=LoadIFF("picture.iff",0)
NPrint r," ",Point(0,0)With the original this printed 0 0: nothing loaded. With the port it
prints -1 1, and the picture is in the bitmap.
With the port. LoadIFF takes the first free bank from bank 0 on,
so it works with the 50 banks riamosfunclib starts with; the banks the
program uses are not touched. It returns -1 when the picture was
unpacked into the bitmap and, with a palette, its colours were taken,
and 0 otherwise.
What to change. BankLimit is no longer needed for LoadIFF, but
does no harm. A picture without colours (no CMAP chunk) loaded with a
palette is unpacked into the bitmap, but LoadIFF returns 0; load such
a picture without the palette.
Issues:
- LoadIFF needs a bank from 51 on, but RIAmosFuncLib has only 50 banks by default (#770)
- LoadIFF returns -1 even if UnpackIFF failed (#771)
UnpackIFF read pictures whose width is no multiple of 16 out of step
An ILBM picture stores every row of a plane padded to whole words of 16
pixels: a picture 40 pixels wide has 6 bytes per row, not 5.
UnpackIFF of
ripacklib, and
ILBMGrab and LoadIFF, which use it, unpack such a picture into a
bitmap object.
What happened. The original took the width divided by 8 as the bytes of a row and so read the padding of each row as the start of the next one: from the second row on the picture came out shifted and garbled, and for a width that is no multiple of 8 the last pixels of every row were missing. Pictures 16, 32, 320 or 640 pixels wide, a multiple of 16, were not affected.
With the port. The rows are read as the file stores them, and such
a picture comes out as it was saved. The bitmap must be as wide as the
padded row; a bitmap made with BitMap is, when it is at least as wide
as the picture.
What to change. Nothing, unless a program made up for the garbled rows, for example by saving brushes only in widths that are a multiple of 16; such brushes load as before.
Issue: UnpackIFF takes the row width as width/8 instead of the word-aligned ILBM row (#775).
FNSLength measured a text 2 pixels short
FNSLength(fontnum,a$[,prefs]) of
rifnslib returns
the width in pixels that a$ has when FNSPrint prints it in the font
of slot fontnum, for example to centre a text or to print another one
behind it. The style prefs counts because bold adds one pixel per
character; without it, the style set with FNSPrefs counts, as for
FNSPrint without one.
What happened. The original subtracted 2 from the width, and gave
0 for a text narrower than that. Without prefs it took the style of
the last FNSPrint instead of the one of FNSPrefs, so after a bold
print it counted one pixel more per character. In the font built into
the library, the five characters of Hello are 30 pixels wide:
NPrint FNSLength(0,"Hello",0)With the original this printed 28; with the port it prints 30.
What to change. A program that added 2 to the result takes the
result as it is. One that relied on the style of the last print gives
FNSLength the style itself.
Issues:
- FNSLength returns the text width minus 2 (#662)
- FNSLength without prefs uses the prefs of the last FNSPrint instead of those of FNSPrefs (#661)
Characters an FNS font has no glyph for
A font of
rifnslib holds a
glyph for each character from the space, code 32, up to its last one.
The font built into the library and every known FNS font end at z,
code 122, so they have no accented letters, no braces and no tilde.
What happened. The original took every character from code 160 on,
such as the accented letters, for the end of the text: FNSPrint
printed nothing from there on, and FNSLength stopped counting. The
characters from code 123 to 159 it drew from the memory behind the
font, for the built-in font from the library’s own code. So
FNSPrint 0,10,10,"Grüße" printed only Gr.
With the port. FNSPrint, FNSShadowPrint and FNSLength take a
character the font has no glyph for as a space, with the width of the
space; the control characters below 32 keep their meaning. How many
glyphs a font has, FNSLoad takes from the size of the file. A font in
memory does not say it, so InstallFNS(fontnum,address) takes the 91
glyphs of the known fonts, up to z, and the form
InstallFNS(fontnum,address,characters) takes the number given.
What to change. A text with such characters goes on behind them.
A font of your own with glyphs behind z that a program puts into a
slot with InstallFNS needs the form with the number of its
characters; loaded with FNSLoad, it works as it is.
Issue: Character codes from 160 on end the text (sign test after CMPI.b #32) (#657).
NewZoneTable cleared the zones of the current table
The zones of
rizonejoylib
are kept in zone tables. A program starts with table 0, and
NewZoneTable(table#,num_zones) creates one of the tables 1 to 15. The
library’s guide says that the zones of the new table are cleared and
that the new table does not become the current one.
What happened. The original cleared the zones of the current table instead, and left in the new table whatever its memory held. A program that had set up the zones of table 0 lost them when it created a second table:
SetZone 0,10,10,20,20
r=NewZoneTable(3,300)
NPrint Zone(15,15)With the original this printed -1; with the port it prints 0, the
zone the point lies in.
With the port. NewZoneTable clears the zones of the new table and
leaves the current table alone. When it replaces the current table, the
new one stays the current table.
What to change. A program that set its zones again after
NewZoneTable, or cleared the new table with UseZoneTable and
ZoneInit, works as before. One that relied on the current table being
cleared clears it with ZoneInit itself.
Issue: NewZoneTable initialises the current table instead of the new one (#875).
Circular zones of rizonejoylib
SetZone num,x,y,radius of
rizonejoylib
defines a circular zone around x,y. On a 68020 or later processor,
such as the one of an A1200, the library tests the zones with its 68020
mode unless SetZoneMode 0 switches it off.
What happened. The 68020 mode compared the squared distance of a
point from the centre with the squared radius in 16 bits only. A point
far outside the circle could hit it, and a circle with a radius of 182
or more missed points inside it. In both modes, SetZone kept the
squared radius in 16 bits, so a radius of 256 or more gave a smaller
circle: 256 one of radius 0, 300 one of radius 156. Two examples, the
first in the 68020 mode:
SetZoneMode -1
ZoneInit
SetZone 1,0,0,10
NPrint Zone(256,3)The original printed 1, the point 256 pixels to the side lying in the
circle of radius 10; the port prints -1.
ZoneInit
NPrint SetZone(1,1000,1000,256)
NPrint Zone(1000,1000)The original printed -1 and 1; the port prints 0 and -1.
With the port. The two modes give the same results for every zone
that SetZone makes, and circles with a radius up to 255 work in both.
SetZone refuses a radius outside 0 to 255: it returns 0 (False) and
stores nothing. A point more than 32767 pixels from the centre of a
circle can still hit it, as in the original
(Bugs not fixed yet).
What to change. Keep the radius at 255 or below; cover a larger area with several zones.
Issues:
- 68020 zone test compares radius² and distance² of circles as signed words (#880)
- SetZone num,x,y,radius stores radius² as a word: radius 256 and above wraps (#867)
Zones above the top of the screen
In a zone table of
rizonejoylib,
a circular zone is marked with -1 in place of the bottom edge y2 of a
rectangle. Zones may lie partly or wholly above the top of the screen,
at negative y.
What happened. The 68020 mode took every zone with a negative y2
for a circle, so a rectangle above the top of the screen was tested as
a circle around its corner. SetZone stored a rectangle whose bottom
edge is -1 as it is, so it counted as a circle in both modes. In the
68020 mode:
SetZoneMode -1
ZoneInit
SetZone 7,0,-200,10,-100
NPrint Zone(5,-150)
NPrint SetZone(5,-100,-50,50,-1)The original printed -1 and -1: it did not find the point in
rectangle 7 and stored rectangle 5. The port prints 7 and 0.
With the port. Only a y2 of -1 marks a circle, in both modes.
SetZone num,x1,y1,x2,y2 refuses a rectangle whose bottom edge is
exactly -1: it returns 0 (False) and stores nothing. Rectangles with a
bottom edge of -2 or less are rectangles in both modes.
What to change. A rectangle that ends at row -1 ends at row -2 or row 0 instead.
Issue: A rectangle with y2 = -1 (68020 mode: any negative y2) is tested as a circle (#866).
The results of GetWBSprite and MoveWBSprite
GetWBSprite(x,y,shape,spritechannel) of
riwbspritelib
makes a hardware sprite of a shape on the Workbench screen and returns
its sprite channel, 0 to 7. MoveWBSprite(viewport,x,y,sprite_channel)
moves it.
What happened. The original’s GetWBSprite returned 0 when it
failed for some reasons and -1 for others, and 0 is also the first
channel, so a program could not tell a failure from a sprite on
channel 0. Asked for a channel the library already held, it failed but
returned the channel, as if it had got a second sprite there:
BitMap 0,320,64,2
Boxf 0,0,15,15,3
GetaShape 0,0,0,16,16
GetaShape 1,0,0,8,8
s.l=GetWBSprite(10,20,0,2)
NPrint s
t.l=GetWBSprite(50,60,0,2)
NPrint t
u.l=GetWBSprite(10,20,1,5)
NPrint uThe original printed 2, 2 and 0: the second call on channel 2
seemed to work, and the shape narrower than 16 pixels gave 0. The port
prints 2, -1 and -1. As a function, MoveWBSprite returned 0
without a sprite on the channel, and otherwise whatever value the
system had left behind, such as 8.
With the port. GetWBSprite returns the channel it got, 0 to 7,
and -1 whenever it gets no sprite. MoveWBSprite returns -1 when it
moved the sprite and 0 when the channel has no sprite of the library.
What to change. Test the result of GetWBSprite for -1, or for 0
or more, as in If ch>=0, instead of for 0. A program that took 0 for
a failure works as before, except that a sprite on channel 0 now counts
as success.
Issues:
- GetWBSprite reports success (the channel) when GetExtSpriteA fails on a channel the library already holds (#920)
- MoveWBSprite returns whatever MoveSprite leaves in d0 (#921)
DiskMotor reported the motor as always on
DiskMotor of
ritrackdisklib
tells whether the motor of a floppy drive is on; its help text says that
it returns -1 when the motor is on.
What happened. The original read the motor line of the drives from
the hardware. trackdisk.device leaves that line in the same state after
every request, whether the motor is on or off, so DiskMotor returned -1
at all times. This program follows the motor of DF1: through the
library’s commands:
DEFTYPE .l
rb=AllocMem_(512,$10002)
r=OpenDisk(1)
NPrint "opened: ",DiskMotor
r=MotorOn(1)
NPrint "after MotorOn: ",DiskMotor
r=MotorOff(1)
NPrint "after MotorOff: ",DiskMotor
r=ReadSector(1,0,rb)
NPrint "after ReadSector: ",DiskMotor
CloseDisk 1
NPrint "after CloseDisk: ",DiskMotor
FreeMem_ rb,512
EndThe original printed -1 in every line. The port prints 0, -1, 0, -1 and 0.
With the port. DiskMotor returns -1 when the motor of a unit that
the library has open is on, and 0 otherwise. The library knows the state
from its own commands: the motor is on after MotorOn and after a
ReadSector, WriteSector, FormatTrack, WriteBoot or BootProg
that worked, since trackdisk.device leaves it running after them, and
off after MotorOff and CloseDisk. What other programs do with the
drives, it does not see.
What to change. Nothing, unless a program relied on the -1: it now gets the state the help text describes.
Issue: DiskMotor returns -1 when the motor line is off, 0 when it is on (#857).
Track lengths, volume and the SCSI flag of ricompactdisclib
ricompactdisclib plays audio CDs through cd.device, the CD drive of the CD32, or through another device. Three of its fixes change values that a working program may see.
CDTrackLength 1. CDTrackLength gives the length of a track in
seconds, from the start of that track to the start of the next one. For
track 1 the original returned the start of track 2, so the gap at the
beginning of the CD before track 1, normally 2 seconds, was counted in.
With the port, track 1 is measured like every other track and comes out
that much shorter.
CDVolume. CDVolume volume,lengthoffade lets the drive fade to
volume over lengthoffade frames of 1/75 second. The original gave
the device the two values the other way round: CDVolume 32767,0, full
volume at once, asked for a fade to silence that took 32767 frames,
more than 7 minutes. The port passes them as they are named.
OpenCD. OpenCD devicename$,unit,scsiflag opens another device,
and with a SCSI flag other than 0 the library reads the table of
contents and plays tracks with SCSI commands. The original kept the
flag, the name and the unit for every later OpenCD: OpenCD devicename$,unit after one with the flag still used SCSI commands, and
OpenCD without arguments opened the device of the call before instead
of unit 0 of cd.device, as the guide describes. This program opens the
emulator’s SCSI device first with and then without the flag, then
cd.device:
DEFTYPE .l
r=OpenCD("uaescsi.device",0,-1)
NPrint "open scsi ",r
If r
t=CDReadTOC
NPrint "tracks scsi ",CDNumTracks
CloseCD
EndIf
r=OpenCD("uaescsi.device",0)
NPrint "open ",r
If r
t=CDReadTOC
NPrint "tracks ",CDNumTracks
CloseCD
EndIf
r=OpenCD
NPrint "open default ",r
If r
CloseCD
EndIf
EndWith the original
open scsi -1
tracks scsi 2
open -1
tracks 2
open default -1With the port
open scsi -1
tracks scsi 2
open -1
tracks 0
open default 0The emulator’s SCSI device answers SCSI commands only, and there is no
cd.device. With the port, the second OpenCD uses cd.device’s commands,
which this device does not answer, so no table of contents is read, and
OpenCD without arguments tries cd.device and fails.
What to change. Give the SCSI flag to every OpenCD that needs it,
and the device name to every OpenCD for another device. A program that
took the 2 seconds off CDTrackLength 1 itself, or swapped the arguments
of CDVolume to make it work, drops that.
Issues:
- CDTrackLength 1 returns the start of track 2, not its distance to the start of track 1 (#584)
- CDVolume puts the volume into io_Length and the fade time into io_Offset, the reverse of cd.device’s CD_ATTENUATE (#982)
- OpenCD devicename$,unit keeps the scsiflag of an earlier OpenCD (#577)
The results of InitSerialIO and GetSerial
InitSerialIO of
rifastseriallib
sets up the serial port for the library and does nothing when it is
already set up; GetSerial address,bytes waits for a block of bytes
from the other machine.
What happened. As functions, both returned one of their arguments:
InitSerialIO its baud rate, also when it did nothing, and GetSerial address,bytes the low byte of its address. A program could not tell
from them whether anything had happened:
DEFTYPE .l
r1=InitSerialIO(19200,16,?inbuf,?outbuf)
r2=InitSerialIO(9600,16,?inbuf,?outbuf)
FinitSerialIO
NPrint r1," ",r2
End
Even
inbuf: Dcb.b 64,0
outbuf: Dcb.b 64,0The original printed 19200 9600, the port prints -1 0: the second
call does nothing, since the port is set up already.
With the port. InitSerialIO returns -1 when it set the port up and
0 when it did nothing, because the library is set up already or the
baud rate is outside 109 to 3546895. GetSerial address,bytes returns -1
when it received the block and 0 when it did nothing, before
InitSerialIO or for 0 bytes.
What to change. A program that used the result of InitSerialIO as
the baud rate keeps the rate in a variable of its own. Test the results
for -1 and 0.
Issues:
- InitSerialIO returns its baud argument, also when it does nothing (#650)
- GetSerial address,bytes returns the low byte of its address argument (#649)
The block commands of riseriallib
SerialSendBlock address,length of
riseriallib
sends a block of bytes through the serial port, SerialReceiveBlock address,length waits for one, and SerialFlush empties the buffer of
bytes received.
What happened. The three commands were meant to open the port when
it was closed, as the string and long commands do, but a wrong test
kept them from it. SerialSendBlock before SerialOpen sent nothing,
and SerialReceiveBlock waited for bytes the closed port never
received. SerialReceiveBlock also first threw away the bytes already
in the buffer, so bytes the other machine had sent before the call were
lost, and the call waited for them for ever.
With the port. SerialSendBlock, SerialReceiveBlock and
SerialFlush open the port when it is closed, and it stays open
afterwards, also after SerialFlush. SerialReceiveBlock keeps the
bytes waiting in the buffer: they are the first bytes of the block.
What to change. A program that wants a block of only the bytes
that arrive after the call calls SerialFlush before
SerialReceiveBlock. A program that called SerialFlush with the port
closed and needs it closed afterwards calls SerialClose.
Issues:
- The word open flag is tested as a long: SerialSendBlock, SerialReceiveBlock and SerialFlush never open the port (#792)
- SerialReceiveBlock throws away the bytes already received (#798)
Labels, register names and inverse text of rilesdebuglib
rilesdebuglib is the helper library of the REDDebugger program by Leading Edge Software. Three of its fixes change a result that a program may have relied on.
ExtractLabel ends a label at a space. ExtractLabel(address)
returns the name of a label in a line of text: from the tenth character
on, it searches the first ., and the name runs from behind it to a
space, a : or the end of the line, as the library’s source says. In
the original library a fault of the compiler that built it had turned
the test for a space into a second test for the end of the line, so the
name ran on over spaces:
DEFTYPE .l
b=AllocMem_(64,$10001)
If b=0 Then NPrint "no memory" : End
Poke$ b,"012345678.a b"
a$=ExtractLabel(b)
FreeMem_ b,64
NPrint "<",a$,">"
EndThe original printed <a b>, the port prints <a>.
GetCustomRegAdr finds a register only by its whole name.
GetCustomRegAdr(name$) returns the offset of the custom chip register
of that name, or -1 if there is none. The original took a register
whose name was only the start of the string: DMACONXYZ gave the
offset of DMACON. And it never found a register whose name has 8
characters, such as DENISEID or SPR7DATB:
DEFTYPE .l
n$="DMACONXYZ" : NPrint GetCustomRegAdr(n$)
n$="DENISEID" : NPrint GetCustomRegAdr(n$)
n$="SPR7DATB" : NPrint GetCustomRegAdr(n$)
n$="DMACON" : NPrint GetCustomRegAdr(n$)
EndThe original printed 150, -1, -1 and 150; the port prints -1,
124, 382 and 150.
FInverse inverts FPrintDetoke too. FInverse switches inverse
printing of the font printer on with any value but 0. The original’s
FPrintDetoke looked only at the upper byte of the value, so
FInverse 1 inverted the text of FPrint and FNPrint, but not that
of FPrintDetoke. And the inverse space that FPrintDetoke draws as
its marker cleared that byte, so after a marker FInverse $100 was off
for everything printed. With the port, every value but 0 inverts the
text of all three commands, and the marker leaves the setting as it
was.
What to change. A program that needs the text up to the : takes
it from the line itself. Give GetCustomRegAdr the register’s name
alone. Before an FPrintDetoke that should not be inverted, switch
inverse printing off with FInverse 0.
Issues:
- ExtractLabel does not end the label at a space: every binary has CMPI.b #0 for the source’s CMPI.b #" " (compiler bug #343) (#704)
- GetCustomRegAdr matches a prefix of the name and never finds a register with an 8-character name (#713)
- FInverse sets a word that FPrint tests as a word but FPrintDetoke as its high byte; the cursor marker resets it (#706)
DisAssemble$ cut long lines after 34 columns
DisAssemble$(address) of
ridisasmlib
returns the instruction at an address as a line of assembler text: the
name of the instruction in the first 9 columns, its operands behind
them, and spaces up to a length of 34 characters.
What happened. The original cut every line after 34 columns. Most
lines fit, but the operands of long 68020 instructions were cut in the
middle. The longest of them also ran over the end of the library’s line
buffer and overwrote its own variables. This program disassembles a
MOVE.l with two memory indirect operands, and then an RTS:
DEFTYPE .l
Dim c.w(12)
c(0)=$21B0 : c(1)=$0133 : c(2)=$8000 : c(3)=$0000 : c(4)=$8000 : c(5)=$0000
c(6)=$0133 : c(7)=$8000 : c(8)=$0000 : c(9)=$8000 : c(10)=$0000
a$=DisAssemble$(&c(0))
NPrint Len(a$)," [",a$,"] ",InstrSize
c(0)=$4E75
a$=DisAssemble$(&c(0))
NPrint Len(a$)," [",a$,"] ",InstrSize
EndWith the original
34 [move.l ([-2147483648,a0,d0.w],-2] 22
34 [rts ] 2With the port
80 [move.l ([-2147483648,a0,d0.w],-2147483648),([-2147483648,a0,d0.w],-2147483648)] 22
34 [rts ] 2What to change. A line is at least 34 characters long, and a longer
one comes back whole. A program that shows the lines in a column of 34
characters takes Left$(a$,34).
Issue: Long lines are cut after 34 columns, and a line can run over the end of the 80-byte LineBuff (#616).
Dates
Date$ showed 1 January after a leap year as 32 December
Date$ turns a day number, the days since 1 January 1978 that
SystemDate returns, into a date string. For one day in every four years
it gave a date that does not exist: the 1 January after each leap year,
such as 1 January 1981 or 1 January 2025, came out as the 32nd of
December of the leap year. A program that shows today’s date showed it
wrong on that day.
What happened
NPrint Date$(1095)
NPrint Date$(1096)
NPrint Date$(1097)
EndDay 1096 is 1 January 1981. The original prints
31/12/1980
32/12/1980
02/01/1981Days, Months and Years after that Date$ return 32, 12 and 1980
as well. Day 17167, 1 January 2025, comes out as 32/12/2024.
With the port
31/12/1980
01/01/1981
02/01/1981Days, Months and Years return 1, 1 and 1981, and day 17167 is
01/01/2025.
Issue: Date$ showed the 1st of January after a leap year as “32/12” (#120).
Printing numbers
Quicks were printed with a stray point or one too low
A Quick has 16 bits after the point, so its fraction is a multiple of
1/65536. Print, NPrint and Str$ show it rounded to four decimals
and leave out the trailing zeros. When the fraction rounded to .0000,
the original removed the zeros but kept the point, and when it rounded up
to a whole number, it lost the carry into the part before the point. A
Quick that is the result of a calculation often lies just above or below
a whole number, so a program printed 2. where it should print 3.
What happened
The program sets the 32 bits of a Quick directly, to get these values exactly: 1.00002, 0.00002, 2.99998 and 32767.99998.
Statement pq{x.l}
q.q=0 : Poke.l &q,x
NPrint "quick ",Hex$(x)," <",q,"> <",Str$(q),">"
End Statement
pq{$00010001} : pq{$00000001} : pq{$0002FFFF} : pq{$7FFFFFFF}
EndThe original prints
quick 00010001 <1.> <1.>
quick 00000001 <.> <.>
quick 0002FFFF <2.> <2.>
quick 7FFFFFFF <32767.> <32767.>With the port
quick 00010001 <1> <1>
quick 00000001 <0> <0>
quick 0002FFFF <3> <3>
quick 7FFFFFFF <32768> <32768>A negative value that rounds to 0, such as -0.00002, prints 0 as well,
without a minus sign.
Issues:
- A Quick whose fraction rounds to 0 kept the point (#234)
- A Quick whose fraction rounds up lost the carry (#233)
Format rounded wrongly and lost the minus sign
Format sets a format string, such as "###.##", for the numbers that
Print, NPrint and Str$ write. The original had four faults there.
A carry that rounded out of the first digit was lost, so 999.96 with
"####.#" became 000.0. A number below 1 was cut instead of
rounded. A negative number lost its minus sign when the format string
had no - or +. And a number with more digits before the point than
the format has places gave a ? followed only by spaces.
What happened
f.f=999.96 : Format "####.#" : NPrint "a <",f,">"
f=0.567 : Format ".##" : NPrint "b <",f,">"
Format "###" : NPrint "c <",-7,">"
Format "##" : NPrint "d <",1234,">"
Format ""
EndThe original prints
a < 000.0>
b <.56>
c < 7>
d <? >With the port
a <1000.0>
b <.57>
c < -7>
d <?34>The carry makes a new first digit, and if that digit does not fit, the
number gives a ? like any other number that is too large. The minus
sign takes the place in front of the number, also in front of the zeros
of 0 places: -7 with "000" prints -07. A number that is too large
prints the ? and then its lowest digits.
Issues:
- Format lost a carry out of the first digit (#235)
- Format did not round numbers below 1 (#236)
- Format without “-” or “+” lost the sign (#237)
- Format with too many digits printed “?” and only spaces (#238)
Text
Umlauts were not drawn
The text commands draw a character only when it lies in the range of the font. The original compared the character with the font’s first character as a signed byte, so every character 128 or more above it was taken as lying below the font. With the standard font, which starts at the space, that is every character from code 160 on: the umlauts and the other accented letters were not drawn, and the cursor did not move.
What happened
BitMap 0,320,16,1
BitMapOutput 0
Print "A"
a.l=CursX
Print Chr$(196)
b.l=CursX
DefaultOutput
NPrint "after A: ",a
NPrint "after umlaut: ",b
EndThe program prints “A” and the umlaut Ä (code 196) on a bitmap, and after each the column of the cursor. The original prints
after A: 1
after umlaut: 1The Ä is not drawn, and the cursor stays where it was.
With the port
after A: 1
after umlaut: 2Issue: Characters far above the font’s first character were not drawn (#148).
LoadFont lost the style
LoadFont takes a style as its last argument: 1 underlined, 2 bold, 4
italic, 8 extended, or a sum of them. The original wrote this value
one byte too far into the font object, the one that describes the font
to the system. The style itself stayed 0, and the value went into the
flags of the font, which tell the system where to look for it. A font
loaded with a style came out without it.
What happened
DEFTYPE .l
LoadFont 1,"topaz.font",9,1
a=Addr IntuiFont(1)
NPrint "style ",Peek.b(a+6)," flags ",Peek.b(a+7)
EndThe program loads topaz 9 underlined and reads the style and flags bytes of the font object. The original prints
style 0 flags 1With the port
The style is set and the flags are 0:
style 1 flags 0A style above 255 counts only with its low byte.
Issue: LoadFont wrote the style into the font flags (#197).
Strings
Text after a string function lost its last character
A string expression such as FileRequest$(...)+".bak" or
ProgDir$+"/data" is built in a work area, one part behind the other. A
function that returns a string writes its result there and leaves the
place where the next part goes. Several library functions left that place
one byte too far, behind the 0 byte that ends their result. The joined
string had the right length, but it held a 0 byte between the result and
the next part, and the last character of the next part was missing. A
program that adds an extension to a chosen file name, or a directory to
the program’s own one, got a name that no file has.
What happened
Screen 0,0,0,320,256,2,0,"freqlib",1,2
Use Screen 0
MaxLen p$=160
MaxLen f$=64
p$="RAM:"
f$="x"
r$=FileRequest$("FQ",p$,f$)+".bak"
NPrint Len(r$)," ",Asc(Mid$(r$,6))," ",Asc(Mid$(r$,9))
EndThe file requester starts with the path RAM: and the file x, and
the user clicks OK. The program prints the length of the result and the
codes of its 6th and 9th characters. The original prints
9 0 97The 6th character is a 0 byte instead of the dot, and the 9th is an a:
the result is RAM:x, a 0 byte and .ba.
With the port
9 46 107The result is RAM:x.bak.
Issue: FileRequest$ followed by more text lost its last character (#161).
The same fault was in GetRexxCommand and GetResultString
(#52), and in several
functions of the RWE userlibs.
Translate$ also counted the 0 byte as part of its result
(Translate$ added a 0 byte to its result). Two
more functions left the place of the next part wrong in other ways:
Replace$with an empty search string left it behind its arguments, so a byte of the arguments took the place of the text that followed:Replace$("ab","","c")+"x"gaveaband a 0 byte instead ofabx(#424).GTGetAttrsandGTSetAttrs, used as functions in a string expression, left it on a tag list inside the library: the joined string came out wrong, and the rest of the expression was written over that list and the memory behind it (#328).
Files
Loc and Lof were one too high after Eof
Eof tells whether the position in a file is at its end. To find out,
the original tried to move one byte further, and when that failed at the
end of the file it kept the new position all the same. Once Eof had
been true, Loc and Lof were one too high: a file of 3 bytes had the
length 4. A program that adds to a file with FileSeek f,Lof(f), as the
manual shows, then asked for a position behind the end of the file.
What happened
f$="RAM:abc.dat"
KillFile f$
If WriteFile(0,f$)
e=Eof(0)
NPrint "new eof ",e
FileOutput 0 : Print "abc" : DefaultOutput
l1.l=Loc(0) : l2.l=Lof(0)
NPrint "written loc ",l1," lof ",l2
CloseFile 0
EndIf
NPrint "exists ",Exists(f$)
If ReadFile(1,f$)
FileInput 1 : a$=Inkey$(3) : DefaultInput
e=Eof(1)
l1.l=Loc(1) : l2.l=Lof(1)
NPrint "read [",a$,"] eof ",e," loc ",l1," lof ",l2
CloseFile 1
EndIf
KillFile f$
EndThe program asks Eof of a new, empty file and writes the 3 bytes abc
into it, then reads them back and asks Eof again. The original prints
new eof -1
written loc 4 lof 4
exists 3
read [abc] eof -1 loc 4 lof 4The file has 3 bytes, as Exists shows, but Loc and Lof say 4.
With the port
new eof -1
written loc 3 lof 3
exists 3
read [abc] eof -1 loc 3 lof 3Positions count from 0, and at the end of the file Loc and Lof are
both its length, so FileSeek f,Lof(f) goes to the end.
Issue: Loc and Lof were one too high after Eof at the end of a file (#144).
File requesters
FileRequest$ left the old lengths in the path and the file name
FileRequest$ takes two string variables, the path and the file name to
start with, and after OK writes the ones the user chose back into them,
so that the next call starts there again. The original wrote the new
characters but left the lengths of both variables as they were. Len,
Print and every string expression with these variables then saw the
old length: a path that was empty before stayed empty for them, and a
name that was longer before kept characters of the old one at its end.
The result of FileRequest$ itself was right.
What happened
Screen 0,0,0,320,256,2,0,"freqlib",1,2
Use Screen 0
MaxLen p$=160
MaxLen f$=64
p$=""
f$="x"+Chr$(0)+"yz"
r$=FileRequest$("FQ",p$,f$)
NPrint "ok ",Len(r$)," [",r$,"]"
NPrint "path ",Len(p$)," [",p$,"]"
NPrint "file ",Len(f$)
EndThe path starts empty, and the file name is x, a 0 byte and yz, 4
characters, of which the requester shows the x. The program runs in the
drawer a of the volume CORPUS:, and the user clicks PARENT, which
with an empty path goes to the parent of the current directory, and then
OK. The original prints
ok 8 [CORPUS:x]
path 0 []
file 4The path holds CORPUS: but has the length 0, and the file name x
still has the length 4.
With the port
ok 8 [CORPUS:x]
path 7 [CORPUS:]
file 1After OK both variables have the lengths of their new contents. Cancel and the close gadget leave them as they were.
Issue: FileRequest$ changed the path and file name without setting their lengths (#153).
Long file names overwrote memory
The file requester keeps the path in a field of 160 bytes and the file name in one of 64 bytes, so it has room for a path of 159 and a name of 63 characters. The original copied names and paths into these fields without looking at their length. On the classic Amiga file system a name has at most 30 characters, but the newer file systems (FFS with long names, PFS, SFS) and the host directories of an emulator allow much longer ones. A click on a file name of 64 or more characters in the list wrote it behind the file name field, and OK then copied on through memory until the program crashed. A long path, or a path the program’s string variable had no room for, overwrote memory the same way.
The port refuses a name or a path that does not fit. It also respects
the room the program gives: a name longer than the MaxLen of the
file name variable, or a path longer than the MaxLen of the path
variable, is refused too. The requester then stays open, keeps what its
fields held, and shows “Name too long” or “Path too long” in the title
bar of the screen until the user clicks the next button, field or line.
What happened
Screen 0,0,0,320,256,2,0,"freqlib",1,2
Use Screen 0
d$="CORPUS:fqname/"
If WriteFile(0,d$+"a123456789b123456789c123456789d123456789e123456789f123456789g123456789") Then CloseFile 0
MaxLen p$=160
MaxLen f$=64
p$="CORPUS:fqname"
f$="x"
r$=FileRequest$("FQ",p$,f$)
NPrint Len(r$)," [",r$,"] file ",Len(f$)," [",f$,"]"
EndThe program creates a file with a name of 70 characters and opens the requester in its drawer. The user clicks the name in the list and then OK. The original copies all 70 characters into the 64-byte field, and OK crashes the program.
With the port
The click is refused, and the screen’s title bar says so:

OK then returns the file the requester held before:
15 [CORPUS:fqname/x] file 1 [x]A program that wants names of up to 63 characters gives its file name
variable a MaxLen of 64 and its path variable one of 160, as the
page of freqlib
shows. A program whose screen has no visible
title bar does not see the message, but the name is refused all the
same. The editor’s file requester is the same code and has the same
limits.
Issue: The file requester copied names longer than 63 characters without a limit (#1042).
GadTools gadgets
A gadget took over the values of the one before
Several GadTools gadget commands take optional values: the active entry
of GTCycle and GTMX, the start text of GTString, the position of
GTScroller and GTSlider, the selected entry of GTListView. The
original kept these values from one gadget to the next, so a gadget
created without the value got the one of the gadget created before it.
What happened
DEFTYPE .l
WbToScreen 0
GTCycle 0,1,10,10,100,14,"A",0,"x|y|z",2
GTCycle 0,2,10,30,100,14,"B",0,"p|q|r"
a1=GTGetAttrs(0,1,$8008000F)
a2=GTGetAttrs(0,2,$8008000F)
NPrint "cycle ",a1," ",a2
Free GTList 0
EndThe first cycle gadget starts at its entry 2, the second has no start
value. GTGetAttrs with the tag $8008000F reads the active entry of
each. The original prints
cycle 2 2so the second gadget starts at “r” instead of “p”.
With the port
A gadget without the value starts with the default:
cycle 2 0Issue: GadTools gadgets took over optional values of an earlier gadget (#169).
Windows
Closing a window lost the events of the others
All windows of a program share one message port for their events. When the original closed a window, it threw away every event waiting at that port, also those of the other windows. A program with two windows that closed one of them lost, for example, a click in the other one that it had not read yet.
What happened
An event cannot be clicked in a recorded test, so the test program puts an event for window 1 into the shared port itself, the way Intuition delivers one. Then it closes window 0 and reads the next event of window 1:
The test program
DEFTYPE .l
WbToScreen 0
DefaultIDCMP $400|$100|8|$40|$20
Window 0,20,30,200,100,$000E,"Close 0",1,2
Window 1,240,30,200,100,$000E,"Close 1",1,2
DefaultOutput
w1=Peek.l(Addr Window(1))
port=Peek.l(w1+86)
rport=CreateMsgPort("")
Dim mb.l(16)
pm=&mb(0)
Poke.l pm+14,rport : Poke.w pm+18,52
Poke.l pm+20,4 : Poke.w pm+24,7 : Poke.l pm+44,w1
GetReg d0,pm : MOVE.l d0,a1 : GetReg d0,port : MOVE.l d0,a0
MOVE.l 4,a6 : JSR -366(a6)
CloseWindow 0
Use Window 1 : DefaultOutput
e=Event : c=EventCode : NPrint "event ",Hex$(e)," code ",c
CloseWindow 1
EndThe original prints
event 00000000 code 0The event is gone.
With the port
Only the closed window’s events are thrown away:
event 00000004 code 7Issue: Closing one window discarded the events of all other windows (#322).
WSize and WMove hung at a limit
WSize and WMove ask Intuition to change a window and then wait until
the window has the new size or position. Intuition does not go beyond
the size limits of a window or the edge of the screen, and the original
then waited forever.
What happened
DEFTYPE .l
WbToScreen 0
SizeLimits 50,50,250,150
Window 0,0,20,200,100,$000F,"Limits",1,2
DefaultOutput
WSize 300,100
NPrint "size ",WindowWidth," ",WindowHeight
WMove 2000,20
NPrint "moved ",WindowX>0 AND WindowX<2000," ",WindowY
CloseWindow 0
EndThe window may be at most 250 pixels wide, and WSize asks for 300.
The original hangs in WSize and prints nothing.
With the port
Both commands return, and the window has the size and position Intuition gave it:
size 250 100
moved -1 20With runtime error checking, a size outside the limits of a window with a
sizing gadget, as here, is the error “Can’t Size Window”, and the program
above stops at WSize
(Sources that compile differently).
Issue: WMove and WSize hung when Intuition limited the new position or size (#320).
Window titles were never freed
Window, WindowTags and WTitle copy the titles they get into new
memory. The original never freed these copies, so every window opened
and every new title cost memory until the program ended. A program that
shows changing information in a title bar lost memory all the time.
What happened
DEFTYPE .l
WbToScreen 0
Window 0,20,30,200,100,$000E,"Leak",1,2
DefaultOutput
t$=String$("t",1000)
m1=AvailMem_(0)
For i=1 To 100
WTitle t$,t$
Next
m2=AvailMem_(0)
NPrint "lost over 100000: ",m1-m2>100000
CloseWindow 0
EndThe program sets a window title and a screen title of 1000 characters a hundred times. The original prints
lost over 100000: -1With the port
The copies are freed with the window or the next title:
lost over 100000: 0Issue: Window titles were copied and never freed (#318).
WCls left the top line of the window
WCls clears the used window with colour 0 or the colour given. The
original cleared it from its second pixel line on, so the top line kept
what was drawn there. This shows most in a window without a border,
where that line is the first line of the contents.
What happened
The program opens a window without a border on a screen of its own, clears it with colour 2 and reads the colours of the pixels 5,0 and 5,1 through the graphics library:
The test program
DEFTYPE .l
Screen 0,0,0,320,200,3,0,"wcls",1,2
Dim nm.l(8) : Poke.s &nm(0),"graphics.library"
GetReg d0,&nm(0) : MOVE.l d0,a1 : MOVE.l 4,a6 : JSR -408(a6) : PutReg d0,gfx
Window 0,20,30,100,50,$0800,"",0,1
DefaultOutput
rp=RastPort(0)
x=5 : y=0 : Gosub pix : a=v : y=1 : Gosub pix : b=v
NPrint "before ",a," ",b
WCls 2
x=5 : y=0 : Gosub pix : a=v : y=1 : Gosub pix : b=v
NPrint "after ",a," ",b
CloseWindow 0
CloseScreen 0
End
; colour of the pixel x,y of rp -> v
pix:
GetReg d0,gfx : MOVE.l d0,a6
GetReg d0,rp : MOVE.l d0,a1
GetReg d1,y
GetReg d0,x
JSR -318(a6)
PutReg d0,v
Return
<div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
The original prints
before 0 0
after 0 2The top line is still colour 0.
With the port
The whole window is cleared:
before 0 0
after 2 2Issue: WCls only cleared from the second line (#314).
Screens and palettes
Decoded palettes were black on Kickstart before 3.0
Before Kickstart 3.0 the palette library sets colours with 4 bits per
component, and it took these from the wrong byte of the 32-bit colour
values that DecodePalette and the fades produce. Such colours came out
black on an Amiga with Kickstart 1.3 or 2.0.
What happened
On Kickstart 1.3:
DEFTYPE .l
Screen 0,0,0,320,200,3,0,"pal",1,2
Dim mm.l(20) : a=&mm(0)
Poke.l a,$464F524D : Poke.l a+4,24 : Poke.l a+8,$494C424D
Poke.l a+12,$434D4150 : Poke.l a+16,12
For i=0 To 11 : Poke.b a+20+i,i*21+5 : Next
DecodePalette 0,a : ShowPalette 0
DefaultOutput
For i=1 To 3 : NPrint Red(i)," ",Green(i)," ",Blue(i) : Next
CloseScreen 0
EndThe program builds a small IFF colour map in memory, decodes it into a palette, shows it, and prints the red, green and blue of colours 1 to 3. The original prints
0 0 0
0 0 0
0 0 0With the port
4 5 6
8 9 10
12 13 14Issue: Faded and decoded palettes were wrong or black on Kickstart before 3.0 (#224).
Other fixes in the command libraries
In the lists of this part, each point says first what the original did and then what the port does, unless the introduction of a list says otherwise.
Files and banks
OpenFile,ReadFileorWriteFileon a file number whose file was still open withFieldscut the new file name short, so a long name was not found; the name stays whole (#138).CloseFilefreed the record fields but kept the record length and a pointer to the freed fields, so aFieldsbefore the next open added to the old record; closing clears both (#140).Existsreturned -1 only for a drawer: the root of a volume, on file systems that report it as a root, gave its size, normally 0, and a file that could not be examined gave the size of an earlier file; every kind of directory gives -1, and a file that cannot be examined gives 0 (#1026).LoadBankof a drawer could turn the bank into one of size -1 at another address; a drawer leaves the bank as it is, like a missing file (#72).
Decrunchers
CrMDecrunch and PPDecrunch unpack data packed with Crunch-Mania and
PowerPacker. They trust the data they are given; these fixes stop the
cases in which a wrong value in the data made them run away.
CrMDecrunchin place, or with buffers that overlap, of data whose header gave a packed length below 4 overwrote the whole memory; it copies the few bytes there are (#115).CrMDecrunchof Crunch-Mania data with corrupt tables (CrM2) wrote behind its tables, into the library; it stops unpacking at such a table (#117).PPDecrunchof PowerPacker data with an efficiency value of 0 or above 15 in the header unpacked garbage around the destination; it unpacks nothing, as for data that are not PowerPacker data (#118).
File requesters
FileRequest$ opens the file requester of Blitz Basic 2; the editor’s
file requester is the same code and has the same fixes, except for the
lengths of the path and the file name, which only
FileRequest$ sets. ASLFileRequest$, ASLPathRequest$ and
ASLScreenRequest open the requesters of the system’s asl.library.
- A file name of 64 or more characters, or a path of 160 or more, was copied into the requester’s fields without a limit and overwrote memory; the requester refuses it and says “Name too long” or “Path too long” in the screen’s title bar (Long file names overwrote memory, #1042).
FileRequest$on a screen of 645 lines or more, such as a 1280×1024 RTG Workbench, wrote far behind its data and could crash the program after the requester closed; the list shows at most 64 lines and the window is at most 597 lines high (#160).- Every list entry of the requester had room for a name of 34 characters, so a longer name, on a file system with long names, was written behind it, and an entry for which no memory was left was written from address 0 on and crashed the system; each entry gets the room its name needs, and an entry without memory is left out of the list (#159).
- The CD button made the drawer shown the program’s current directory and released the directory the program had been started in, which belongs to the shell that started it, and the program ended in the new drawer. CD still changes the current directory while the program runs, but the start directory is kept and is current again when the program ends, unless the program has changed the current directory itself since (#157).
- After CD, every later click into the path gadget, the field with the path, made the system copy the path into the first 64 KB of memory, in that requester and in all later ones, because CD damaged the gadget’s data instead of resetting its cursor; CD resets the cursor and the scroll position of the path (#345).
- PARENT with an empty path and CD, which find the path of the current directory, left every parent directory in use until the next reboot, so that such a disk could not be renamed or ejected cleanly; the directories are released (#158).
- DRIVES read the system’s list of volumes, assigns and devices without locking it, so a disk change, an assign or a mount at that moment could make the requester read freed memory; it locks the list while it reads it, and shows the same entries (#156).
- Every call opened the DOS, Intuition and graphics libraries of the system and never closed them, so their use counts rose with every requester; they are closed at the end of each call (#154).
ASLFileRequest$andASLPathRequest$withoutasl.library, such as on Kickstart 1.3, returned a string whose length was the address of the title, so an assignment copied that many bytes; they return the empty string, as Cancel does (#62).ASLFileRequest$andASLPathRequest$askedasl.libraryto free a requester at address 0 when the requester could not be allocated; they free only one that was allocated (#403).- Every
ASLFileRequest$andASLPathRequest$kept a copy of its title and pattern in memory until the program ended; the copies are freed after each request (#63). ASLPathRequest$wrote the file name of the requester, after OK, to an address it had not been given: in the form with a position, the value ofx, sox=20overwrote two exception vectors of the processor; it writes nothing there, and the result is the same (#61).ASLPathRequest$without a position and size, after anASLFileRequest$with a pattern, showed a pattern gadget with that pattern; it shows none (#64).ASLScreenRequestfreed the requester and then returned its address, so the program read the chosen mode from freed memory; it returns the address of a copy of the requester’s fields, which stays valid until the nextASLScreenRequest(#60).
Strings
Right$andUnRight$took their characters from before the string when the part they leave out was 32768 characters or longer, soRight$(a$,3)of a string of 40003 characters did not give its last three; they take the right end of any string (#285).Mid$with a length so large that the start plus the length passed $7FFFFFFF returned a string of that length, far beyond the string and the string buffer:Len(Mid$("Hello",2,$7FFFFFFF))gave 2147483647; the result stops at the end of the string, and that length is 4 (#286).Instrwith a start position of 0 or less compared the bytes before the string, so an empty search string was found at position 0 or at the negative start:Instr(a$,"",-5)gave -5. A start position below 1 searches from the first character, asInstrwithout a start position does. With runtime error checking it is the error “Instr Startpos MUST be greater than zero” (#287).Instrwith a start position near $7FFFFFFF went on searching in memory far from the string, until it found the text there or hung; it returns 0 (#1030).Cvialways read two bytes of its string andCvlandCvqfour, so a shorter string gave whatever an earlier string expression had left behind it; the missing bytes count as 0, soCvl("ab")is $61620000 andCvi("")is 0. With runtime error checking a string that is too short is the error “Cvi needs a String of at least 2 Characters”, or the same forCvlandCvqwith 4 (#288).Peeks$with a negative length copied up to 4 GB into the string buffer and crashed the program; it returns the empty string, as a length of 0 does, and with runtime error checking it is the error “Can’t Peeks$ a negative number of Characters!” (#214).
Input
Inkey$(0)returned a string of a random length; it returns the empty string (#128).Editwith a default value in a window overwrote the last character of the default with a space, soEdit(9.5,5)offered9.and gave 9 when the user just pressed Return, andEdit(25,4)gave 2; the whole default is shown, and Return gives 9.5 and 25 (#129).Edit$at the end of its input, such as a file given to the program with<in the shell, returned a string of the length -1; it returns the empty string, andEditthere returns 0 (#132).- The runtime error of
Inkey$from the default input read “Can’t Input Character from Defualt Input”; it reads “Default” (#193). - For the raw key codes above 104, such as the reset warning and the
extra keys of some keyboards,
BlitzKeyread a character of another key or a byte of the library’s own code; it gives no character for them (#245). BlitzKeys Offleft the input with the keyboard reading of Blitz mode, and after a secondBlitzKeys Onreading a line, such as withEdit$, hung for ever. It gives the keyboard input back to the input used beforeBlitzKeys On, unless the program chose another input in between, such as withFileInput, which stays (#408).Inkey$with a negative count tried about 4 billion times to read a character and added every character it got behind the end of the string buffer; with runtime error checking a negative count is the error “Can’t Inkey$ a negative number of Characters!” (#1031).- With runtime error checking, the first
PopInputorPopOutputwith no switch of the channel left to undo, such as one at the start of the program, passed the check and left the program without a channel; the error came only at the pop after it. It is reported at the first such pop (#1032). Mouse Ontook the start values of the two mouse counters from each other’s place, so the mouse jumped once, by the difference of the counters, at the first reading; it starts where it is (#223).Gameb(0)left the control lines of the game pad as if it had read port 1: it changed a line of port 1 and left that line of port 0 low. It sets back the lines of port 0 only (#415).
Tapes and simulated input
Record, PlayBack, PlayWait and LoadTape record mouse and
keyboard events onto tapes and play them back. Type, AbsMouse,
RelMouse, MouseButton and ClickButton make such events
themselves. One more fix of them changes what an existing program sees:
a simulated event ended a running Record or PlayBack.
In this list, each point says first what the port does and then what the original did.
TapeTrapwithout a tape number ends the redirection of the simulated events to a tape; the original went on trapping them and chained the next events into the program’s string memory instead of executing them (#95).ClickButtonreleases the button it pressed. The original released the left button after an executedClickButton 1, and underTapeTrapwithQuietTrap Onit recordedClickButton 0as the left button pressed and the right one released (#97).RelMousemakes a relative mouse event (RAWMOUSE), as a real mouse does; the original made a pointer position event (POINTERPOS), which moved the pointer the same way but gave tapes, saved tapes and programs that look at the events another kind of event (#98).PlayWaitwithout a tape number waits until the running playback has finished, as its help says; the original refused this form with “Syntax Error”.PlayWait Tape#works as in the original, which playsTape#in place of a running playback and waits for its end, but returns at once for an empty tape, where the original waited for ever (#99;PlayWaitwithout a tape number).PlayBackplays a recorded event in front of the first input event that came after its time; the original compared the times only with the first of the input events that arrived together, so it could play a tape event behind input that came after it (#100).LoadTapeof a file shorter than the 8 bytes of the start time leaves the tape empty; the original took the bytes of the file as the start time (#101).Typeskips a character that has no key; the original typed the key code $FFFF with the Shift key (#102).XStatusreturns 0, 1 or 2; right afterRecord,PlayBackor an executed simulated event the original returned 32768 more, until the system had handled the next input event (#103).- Without a free signal,
PlayWaitreturns at once instead of waiting for ever, and the end of the program frees no signal that the library did not get (#104).
Arrays and sorting
- A
Dimof an array of 4 GB or more, such asDim a.l(32767,32767), computed a wrong, tiny size and gave an array of a few bytes; it stops with the error “Out of Memory!”, and with runtime error checking with “Array Size out of Range” (#58). - A dimension of an array or list has at most 65535 elements, the indexes
0 to 65534.
Dim a(65535)andDim List a(65535)gave an array or list of no elements, and every access to it lay outside its memory, but runtime error checking refused only an index of 65536 and more; it refuses 65535 too, with the error “Array Dimension out of Range” (#1037). - A program that caught “Out of Memory!”, for example of a
Dim, withSetErrand went on lost the list of its memory blocks, so its next allocation overwrote the pointer to exec at address 4, which the whole system uses; the error frees the memory but keeps the list, so later allocations work (#1071). Sorton a string array read the length of an element that was never given a value from address -4 and its characters from address 0, so such elements sorted to places that depended on that memory; they count as empty strings and come first, or last afterSortDown(#276).Sorton a word array took the word after the middle element as the value it compares with, so for an array of one element it read the word behind the array and searched the memory behind and possibly before it; it takes the middle element. The sorted array is the same (#275).
Lists
Dim Listwith size 0 wrote behind its memory block; nothing is written there (#59).SortListput keys more than 2^31 apart in the wrong order, so 2000000000 came before -2000000000; it sorts every key in ascending order (#201).
Statements and Functions
- A Statement or Function with three or more parameters and a local NewType variable got a wrong third parameter, and with five parameters a wrong fifth one too: the library routine that sets up the local variables at the start of the procedure overwrote them; every parameter keeps its value (#1063).
GadTools
- All
GTShapegadgets showed the images of the last one, and GadTools' own image was overwritten; each gadget keeps its own images (#173). GTShapewrote to low memory when the gadget could not be created; a failed gadget is left alone (#327).GTPalettewith a colour ignored the colour and broke a following tag list; the colour is set (#168).- Cycle and MX gadgets had room for a limited number of labels without a check, and their memory was never freed; the labels are counted and the memory is freed with the gadget (#174).
- A toggle
GTButtonwhose gadget could not be made wrote to address 14; only a gadget that was made is changed (#171). - The flags 64 (disabled) and 128 (immediate) of
GTShapehad no effect; they work (#990). - A
GTShapegadget got the label of the gadget made before it; it has none (#172). - After
GTFreeGadgetof the last gadget of a GadTools list, the next gadget was linked to the freed one and was neither shown nor freed; it becomes part of the list (#962).
Gadgets
SelectModehad no effect, soSelectMode 1did not give new gadgets a box as their highlight; it does (#952).Free GadgetListdid not free the text buffers of string gadgets and the data of prop gadgets, which stayed allocated until the program ended; they are freed with the list (#163).StringGadgetafterBorders Offwrote to the addresses 0, 2, 36 and 38; it writes nothing there (#164).StringGadgetwith aMaxlenof 0 cleared 65536 bytes of memory and crashed the program; with runtime error checking it is the error “Maxlen MUST be greater than zero” (#165).- A
ShapeGadgetof a shape of depth 0 got a broken image; with runtime error checking such a shape cannot be made, asInitShaperefuses a depth of 0 (#167).
Menus
- A menu, item or subitem with an empty text read its text from address 0, and the item got the width of whatever was there; the text is empty, and an empty item is as wide as its gaps (#981).
MenuStateof a single menu changed the wrong bit, so a menu could not be disabled or enabled on its own; it can (#216).MenuCheckedof any entry but the first item and subitem of a menu walked the menu lists again and gave the state of another entry, or read unrelated memory; it gives the state of the entry asked for (#217).ShapeItemandShapeSubignored small flag values such as toggle, exclude and checked; they take their flags asMenuItemdoes (#218).- Item flags such as $10000 were taken as 4, a checked toggle item that excludes all others; they are taken as given (#219).
- Replacing a subitem moved the subitems behind it by a wrong amount, so they covered it or left a gap; they move by the change of its height (#220).
Blitz mode boxes
The Blitz OS commands give a Blitz mode program pages of boxes as its user interface (Blitz OS).
AddBoxof a string box 8 to 15 pixels wide, whose text has room for one byte, wrote 65536 spaces behind that byte; it writes none (#84).- On a page of more than 1024 boxes, the box numbers from 1024 on reached
the memory before the box table or, from 2048 on, the boxes from 0 on,
and
BoxSelectedreturned a wrong number; every box number reaches its own box, andBoxSelectedreturns it (#81). BoxStringof an answer of spaces only, such as that of a string box never typed into, removed the spaces beyond the start of the answer and could copy up to 65535 bytes into the string buffer; it returns the empty string (#85).- A box added again with
AddBoxwithout a text printed the memory from address 0 on when it was drawn; it prints nothing (#89). - Cursor up or down in
BlitzEventwith no box selected, such as right afterInitPage, read low memory as a box and could write to it; it does nothing (#90). - In a string box, Backspace at the start of the text and control keys such as Return, Esc and Tab turned the cursor off and left it off; it is drawn again (#91).
DeSelectBoxleft the box selected, so it was still drawn as selected andBoxSelectedstill returned it; the selection is cleared, andBoxSelectedreturns -1 (#94).BoxPrint Box#,Bank#,Linereplaced the line feed at the end of the printed line by a 0 in the bank itself; the bank stays as it is (#87).- A list box made with
AddBoxand a text, or given a text withSetBoxTitle, got no entries: it showed nothing, andSetBoxon it always failed with “Value Out of Range”; it gets one entry for each part of the text (#989). SpotBoxon a page that was not made withInitPage, was freed or has no boxes searched 65536 boxes in the memory behind the page and could return one found there; with runtime error checking it is the error “UnInitialised Page” (#83).SelectBox Box#with a number the page does not have selected and drew whatever lay behind the box table; with runtime error checking it is the error “Illegal Box# For Page” (#82).InitPagewith 32768 boxes or more took the number as a negative one and asked for a box table of a wrong size, which stopped the program with “Out of Memory!”; with runtime error checking it is the error “Illegal Number of Boxes” (#1043;InitPagewith 32768 boxes or more).
Windows and screens
WindowTagswith a long tag list overwrote code of the library; a long list is copied only in part and the rest is linked (#317).- A screen mode with a monitor part, such as PAL or NTSC, opened on the default monitor; the whole mode is used (#250).
Screen,ScreenTags,WbToScreenandFindScreenon a screen object that had usedShowBitMap, on Kickstart 3.0 or later, crashed the program when they freed the old screen; it is freed properly (#247).FindScreen,WbToScreenandCloseScreenon an object that had only found a screen another object had opened closed that screen, and the other object was left with a closed screen; a found screen is only forgotten (#248).ScreenTagswith the address of a tag list of more than 15 tags overwrote code behind the library; up to 15 tags are copied and the rest of the list is linked, as forWindowTags(#249).ScreenTagswith 16 or more tag and data pairs as arguments wrote behind its tag buffer, over code of the libraries; with runtime error checking more than 15 pairs are the error “Too Many Tags”, as forWindowTags(#1039). A longer list can be given as the address of a tag list.Menus,MenusOnandMenusOffreached only the windows in the lower half of the window numbers, soMenusOffleft the menus of the others on; they reach every window (#310).WindowTagswithout tags opened the window with the extra tags of the previousWindowTags, such as its position and size; it uses none (#316).WindowTagswith 16 or more tag and data pairs as arguments wrote behind its tag buffer, over data and code of the library; with runtime error checking more than 15 pairs are the error “Too Many Tags” (#961). A longer list can be given as the address of a tag list.- A
Windowwith the super bitmap flag$80but without aBitMap#got the bitmap of the lastWindowthat named one; only the form withBitMap#gives a super bitmap window (#319). WScrollandWPrintScrollset the drawing colour of the window to 0; it stays as it was (#315).Edit$in a window with a proportional font took the normal width of the font for every character from code 160 on, such as the umlauts, so the cursor and the typed text were in the wrong place; every character has its own width (#321).- After a gadget down of a string gadget,
Eventreports a gadget up at once, which programs rely on. When another event came in between, the real gadget up of that gadget was reported as well, two for one entry; it is reported once (#311). - The extra menu event of a menu choice with several items picked had
its qualifier from memory that was never set, so
EventQualifierof it was random; it has the qualifier of the menu choice (#312). Qualifierset only the lower half of its long result, so the upper half held whatever was there before; the whole result is set (#313).
Fonts
- Every
LoadFonton the same IntuiFont object lost the memory of the copy of the previous font name; the old copy is freed. See alsoLoadFontlost the style (#198). LoadBlitzFontof a font that is not 8 by 8 pixels stopped with the error “Can’t Open Font” and left the font open after the program; it closes the font before the error (#150).
Dates and numbers
Date$andNumDaysmade every hundredth year a leap year, so dates before 1 March 1900 and from 1 March 2100 on were a day off per century; they follow the Gregorian calendar, in which 1900, 2100, 2200 and 2300 are not leap years (#1001).WeekDaywas two days off for a few dates, such as 15 and 16 September 1973; it is right for every date (#121).NumDays("31/12/1977")gave 65535 instead of -1, and the day 65535, in the year 2157, came back fromNumDays(Date$(65535))as 131071; both are right (#122).NumDaysof a date with an empty field, such as"/5/1990", took the empty field as 47; it returns 0, as for other dates it cannot read (#123).NumDaysof a month outside 1 to 12 returned a number taken from unrelated memory; it returns 0 (#124).NumDaysof a year with fewer than four digits at the end of the string, such as"1/1/78", read past the end of the string, and the result depended on the memory behind it; the year ends with the string, so"1/1/78"is the year 78, and an empty year gives 0 (#125).NumDaysof a string too short for its day or month, such as"", read on into the bytes behind the string and could return a date made of them; such a string gives 0 (#1029).QAnglegave a wrong angle for points 32768 or more apart in x or y; it gives the right one (#1003).Sgnof a float was always 1; it is -1, 0 or 1 by the value (#301).Fracof a Quick with an integer part of 256 or more lost the low bits of the fraction, because the Quick was turned into a float first, so the Quick 30000 + 10/65536 gave 0;Fractakes a value of any numeric type and gives the exact fraction of a Quick, 0 for an integer type, and the same as before for a float (#1064; seeFracof a string).Valof a string longer than 32768 characters gave 0 or read only a part of it; it reads the whole string (#303).Valof a number with 10 or more decimal places gave a wrong fraction, and from 32 places on dropped it, soVal("1.5000…")with 32 places gave 1; the first 9 places count and the others are skipped (#304).Valof a hexadecimal, binary or negative number read one character behind the string and took a digit there as part of the number; it reads only the string (#302).- A Quick 0 assigned to a float gave a negative zero instead of 0; it gives 0 (#146).
- The Quick -32768 assigned to a float gave +32768; it keeps its minus sign (#147).
- A division of longs or quicks by 0 gave the largest positive number for every dividend, so -5/0 was 2147483647; it gives the largest number with the sign of the dividend, so -5/0 is -2147483647, and it is still no error without runtime error checking. With runtime error checking, it stops with “GURU! - Division by Zero”, as a Word division by 0 does (#200; see A Long or Quick division by 0).
- A multiplication of longs or quicks whose product does not fit added
part of the lost high bits back into the result. So
196608*30000gave 1603272705 instead of 1603272704, and the quick300*300came out 1/65536 too large; a long was off by at most 65534, a quick by at most 0.25. The port gives the product with the bits that do not fit cut off, and a product that fits is the same as before (#199); see Getting the old products. Str$andUStr$of a string gave a number made from the string’s address; they give the string (#242).- A float below 1E-17 printed in fixed point form, with
FloatMode -1or a format string set byFormat, overwrote a table of the library, so numbers of 1E18 and more printed wrong digits afterwards (5E+18 as9.5E+19); they print right (#241).
Getting the old products
A program that lets a long or quick product overflow on purpose and needs
the same numbers as with the original, for example a random number
generator, can compute them with these two functions. Each multiplication
inside them has factors below 65536, which the original and the port both
compute exactly, so they give the original’s products with either
library. A call is much slower than the * operator.
; a*b as the original gave it, for longs
Function.l OldMul{a.l,b.l}
n.l=0
If a<0 Then a=-a : n=1-n
If b<0 Then b=-b : n=1-n
ah.l=(a LSR 16) AND $FFFF : al.l=a AND $FFFF
bh.l=(b LSR 16) AND $FFFF : bl.l=b AND $FFFF
c1.l=ah*bl : c2.l=al*bh
p.l=al*bl+(((c1+c2) AND $FFFF) LSL 16)+((c1 LSR 16) AND $FFFF)+((c2 LSR 16) AND $FFFF)
If n Then p=-p
Function Return p
End Function
; the same for quicks
Function.q OldQMul{a.q,b.q}
ra.l=Peek.l(&a) : rb.l=Peek.l(&b) : n.l=0
If ra<0 Then ra=-ra : n=1-n
If rb<0 Then rb=-rb : n=1-n
ah.l=(ra LSR 16) AND $FFFF : al.l=ra AND $FFFF
bh.l=(rb LSR 16) AND $FFFF : bl.l=rb AND $FFFF
hh.l=ah*bh
p.l=(((al*bl) LSR 16) AND $FFFF)+ah*bl+al*bh+(hh LSL 16)+((hh LSR 16) AND $FFFF)
If n Then p=-p
r.q=0 : Poke.l &r,p
Function Return r
End Function
NPrint OldMul{196608,30000} ; 1603272705, as with the originalPalettes
These are the palette objects, their colour cycles and the commands that read colours from IFF pictures.
DecodePaletteandLoadPalettecycled a colour range that the picture marks as disabled, and ran ranges backwards without their reverse flag; a range cycles only when enabled, backwards only when marked so (#1002).DecodePalettedid not skip the pad byte behind a chunk of odd length, such as a name or a short text in the picture, so it missed the colours or the colour cycles behind it; it finds them (#225).DecodePalettewith an offset into a palette too small for the colours cleared the palette first, so its colours below the offset were lost; the palette grows and keeps them, as withPalRGB(#226).- The list of colour cycles of a palette object that was never used has
no end mark.
InitPalette, andPalRGBorAGAPalRGBon such a palette, left it so, andCyclePaletteandCycleread on into the next palette object; they end the list (#229). PaletteRangewith the same start and end colour divided by zero; it sets that colour to the start colour of the gradient (#227).- After
StopCycle, a newCycledid not start the colour cycling again; it does (#228).
Animations
These are the anim objects, which play IFF ANIM files on bitmaps.
NextFrameof an anim with a single change read its next change from address 0, and so did the firstNextFrameof an anim without any; such an anim plays once and stays on its last frame (#401).LoadAnimof a file without a first picture (BODY) took the value for “not found” as the length of the picture, andInitAnimthen unpacked whatever lay in memory; such an anim has no first picture, andInitAnimdraws nothing (#400).- An anim whose file gives a width, height or depth of 0 made
InitAnimandNextFramerun their loops 65536 times and write over memory; such an anim is loaded without picture data, and they draw nothing (#402). InitAnimunpacked every first picture as packed data, also one the file stores unpacked, and a packed run longer than the rest of its row was written behind the row; an unpacked first picture is copied, and every run ends with its row (#397).- Freeing an anim read the link to its next change from memory it had just freed; the link is read first (#399).
Blitz mode displays
These are the slices and their copper list, the copper lists of the
display library and the fades. Two more fixes of them change what an
existing program shows:
CustomSprites with an offset and
CustomColors with a thru256flag of 0.
CustomCopwith an empty string, or one of 1 to 3 bytes, copied about four thousand million instructions from the string over all memory behind the new copper list; such a string inserts only the wait for its line (#404).CustomCopin a program whose Slice maximum in the compiler options is 0 changed memory in 64-byte steps over 4 MB from the place of the slice objects on; it changes nothing there (#406).CustomCoptook the copper instruction$01FE1234in its string for the markSliceuses inside the copper list for a wait at line 256, and changed it and the instruction after it; the string goes into the copper list as given (#405).Show,ShowFandShowBon a slice made without the BPLCON1 instruction (bit 14 of its flags) wrote to a random address; they change nothing outside the slice (#407).- The sprite channels of a copper list that show no sprite, also those of
CustomSprites, had no sprite data address, so the hardware fetched their sprites from chip memory address 0 and showed garbage where that memory was not 0; they show an empty sprite (#413). DisplayBitMap CopList#,BitMap#without a position set the start position ofDisplayScrollto values the program had left over from earlier calculations; it starts at 0,0 (#411).CustomChunkywith a split position reset the sprite resolution of the copper list, so thatDisplaySpritethen put a high or super high resolution sprite with an x handle too far to the left; such sprites keep their place (#949).DisplaySpriteof a sprite on a channel ofCustomSpritesmoved completely above or below the display wrote the empty sprite over other instructions of the copper list, and the sprite stayed visible; the sprite is switched off on its own channel (#1051).DisplaySpriteof a sprite whose channels run from the last channels of the copper list into those ofCustomSpriteswrote over other instructions of the list; it is the runtime error “Not Enough Sprite Channels”, also without runtime error checking (#414;DisplaySpriteacross the two sprite banks).FadeInandFadeOutof palette 2 or a higher one made the red or the green of the first colour run ahead of the others in the steps of the fade; all colours fade evenly (#134).- With runtime error checking,
FadeInandFadeOuttook a palette whose colours lie in the lowest 64 KB of memory as uninitialised, and gave two errors the wrong message: a palette that was never made was “Not enough colours in Slice”, a colour beyond the colours of the slice “Uninitialized Slice”. The palette is accepted, and the messages are “Uninitialized Palette” and “Not enough colours in Slice” (#135, #330, #331; The checks ofFadeInandFadeOut).
Shapes and sprites
These are the commands of shapes, their changes such as Scale and
Rotate, sprites, stencils and the collisions of sprites. One more fix
of them can stop an existing program:
LoadShape refuses pictures too large to blit.
LoadShapes,DecodeShapesandLoadSpriteswith a raised object maximum (1025 shapes or 2049 sprites and more) loaded only the first object; they load the whole range (#999).LoadShapeof a picture with planes of 32 KB or more wrote the planes from the second one on in front of the shape’s memory; they are in place (#263).SaveShapes,LoadShapes,DecodeShapesandCopyShapehandled only part of a shape of 64 KB or more, so a file the original saved from such a shape holds only part of it; the whole shape is saved, loaded and copied (#263).- A single plane of 64 KB or more does not fit the shapes format, which
keeps the size of a plane in 16 bits.
LoadShapeof such a picture wrote it over the memory behind a far too small shape; such a picture is the runtime error “Can’t Read/Write Shapes File”, also without runtime error checking (#263; LoadShape of a picture with very large planes). LoadShapeof an IFF ANIM put the frames that come after the last shape object into the memory behind the table of shapes; it stops at the last shape object (#265).LoadShapeof an IFF ANIM took the XOR mode of the first frame for every frame, so an animation that mixes XOR frames and others came out wrong; each frame has its own mode (#266).DecodeShapesuses shape data that lies in chip memory where it is, and marks the shape so that this memory, which the library did not allocate, is not freed. The mark stayed when the shape was freed or replaced, so the next shape in that object was never freed before the program ended; the mark goes with the shape (#269).CopyShapeof such a shape copied the mark, so the memory of the copy was never freed before the program ended; the copy has no mark (#268).- A file that
SaveShapeswrote from such a shape held the mark, andLoadShapesof the file, orDecodeShapesof it outside chip memory, took it over, so the loaded shapes were never freed before the program ended; the mark is not taken from the file (#267). Rotatemade a rotated shape one pixel too large and lost its edge pixels, so a quarter turn of a 21×9 shape gave 10×21; it rounds to the nearest pixel and gives 9×21 (#1004).XFlip,YFlip,RotateandScalewent wrong on shapes with planes of 32 KB or more, or with more than 65535 rows in all planes together:YFlipflipped nothing, andXFlipof a 16×8200 shape of 8 planes flipped only 64 rows; they work on the whole shape (#274).XFlipof a shape whose width is not a multiple of 16 lets the blitter shift the rows and then mirrors them with the processor, which started before the blitter had finished, so the result depended on the timing; the processor waits for the blitter (#271).Scaleto a width or height of less than one pixel made that one pixel from more pixels than the shape has, from the next rows and the memory behind the shape, and could give it the wrong colour; it is made from the pixels of the shape only (#273).GetaSpritewith runtime error checking had the width limits of 4 and 16 colour shapes the wrong way round. InSpriteMode 0it refused a 4 colour shape of 65 to 128 pixels, which the 8 sprite channels can show. It accepted a 16 colour one of that width, which then failed at everyShowSpritewith “Sprite Channel Unavailable”. The port’s limits are 8 sprites (128 pixels inSpriteMode 0) for a 4 colour shape and 4 sprites (64 pixels) for a 16 colour shape; a wider one is the error “Sprite too Wide” (#988).GetaSpriteinSpriteMode 1or2of a shape whose width is not a multiple of the sprite width took bytes of the next row of the shape into the right edge of its last sprite; that part of the sprite is empty (#282).SpriteModewith a mode above 2 took the sprite width from the memory behind its table of widths; with runtime error checking it is the error “Illegal SpriteMode” (#281).SaveSprites,LoadSpritesand the freeing of a sprite took the size of its image from the currentSpriteMode, so after a change of the modeSaveSpriteswrote too many or too few bytes andLoadSpritesread them so; a sprite keeps the size of the mode it was made in (#280).ShowSpriteof a sprite cut off at the top of the slice showed the wrong lines inSpriteMode 1and2, and with some values ofYread the image from anywhere in memory; it skips the lines that are cut off (#283).SCollwith channel 0 or 1 as the second channel, such asSColl(4,0), tested the collision of other channels; the order of the channels does not matter. Two channels of the same pair, such asSColl(0,1), have no collision of their own: with runtime error checking they are the error “Sprite channels must be of different pairs” (#110).Stencilof a bitmap of more than 1024 lines, or wider than 1024 pixels, filled the stencil only in part; it fills the whole stencil (#284).LoadShapeof a picture whose header gives 0 bitplanes made a shape without memory and wrote the picture data behind it; such a picture is the runtime error “Illegal Shape Depth”, also without runtime error checking (#1052;LoadShapeof a picture of 0 bitplanes).InitShape,GetaShape,RotateandScalemade shapes too large for the size fields of a shape without a check, so the shape’s memory was overwritten or blitted wrongly. With runtime error checking, a shape with a plane of 64 KB or more, taller than 1023 rows or wider than 992 pixels is the error “Shape too Big”, andInitShapewith a width or height of 0 the error “Illegal Shape Size” (#1047, #1046; Shapes too large for their size fields).BBlit,UnBufferandShowStencilstepped from plane to plane in the buffer by the shape’s plane size as a signed number, so with a shape of 32 KB or more per plane they stepped backwards and wrote and read outside the buffer; they step forwards (#1045).LoadShapeof a picture whose header gives a width or a height of 0 made a shape without memory and ran its loops 65536 times, writing the picture data behind it; such a picture is the runtime error “Illegal Shape Size”, also without runtime error checking (#1054;LoadShapeof a picture of width or height 0).
Drawing and polygons
These are the drawing commands on bitmaps and the polygon commands for 3D
graphics. Two more fixes of them change what an existing program draws:
RenderToBitmap with a dither bitmap and
Box with BitMapOrigin.
CircleandCirclefwrote the points of a circle that reaches above the top edge of the bitmap far behind its planes or into the memory behind the fill buffer; such points are clipped, like those below the bottom edge (#392).AllocFillas a statement took the size of the fill buffer from two words of the string buffer instead of the used bitmap, so it made a buffer of the wrong size or none; it makes the buffer for the used bitmap (#390).Polywith fewer than 2 points drew 65535 lines from the memory behind the coordinates; with runtime error checking it is the error “Poly needs at least 2 Points” (#396).Polyf,BitMapPoly,ChunkyPolyandRenderPolydrew a polygon of up to 16 points wrongly when one of its sides had 11 to 15 edges; it is drawn right. More than 16 points overwrote the code of the library and crashed the program; with runtime error checking they are the error “Too Many Points” (#395).Polyfdrew polygons whose corners lie far outside the bitmap (from about 8000 pixels away) wrongly or not at all; they are drawn (#1000).Polyf,BitMapPoly,ChunkyPolyandRenderPolystopped with a “Division by Zero” guru for some degenerate polygons with a side that starts outside the bitmap on a vertical edge; such a polygon is not drawn (#1033).FloodFillwith a border colour filled wrongly on a bitmap wider than 1024 pixels or taller than 1024 lines; it fills these bitmaps as it fills smaller ones (#986).ChunkyVlinwithCLIPdrew a line at an x at or beyond the width of the chunky area into other rows or behind the area; such a line is clipped away, asChunkyPlotwithCLIPdoes (#987).ChunkyVlinwithoutCLIPand ay1greater thany2wrote about 65536 words, one per chunky line; with runtime error checking it is the error “ChunkyVlin y1 MUST NOT be greater than y2” (#417).RenderPolybefore anyRenderToBitmaporRenderToChunkydrew the polygon into memory it took for a bitmap; it draws nothing (#420).RenderPolyafterRenderToChunkytook a colour above 14 from the memory behind its table of 15 colours; with runtime error checking it is the error “Illegal Colour” (#422).- The dither form of
BitMapPolyandRenderPolytook the planes from the second one on from behind the dither bitmap when its planes were smaller than those of the bitmap drawn on; every plane comes from the dither bitmap (#1035).
Bitmaps
BitMapwith a depth of 0 or more than 8 stopped, with runtime error checking, with the error text “No currently used object!”, or an empty text in an executable; the text is “Illegal BitMap Depth”, as forCludgeBitMap(#1040).- A
BitMaporCludgeBitMapof width or height 0 was accepted, andCopyBitMapof it copied about four thousand million words through the memory; with runtime error checking a width or height below 1 is the error “Illegal BitMap Size” (#78). - A bitmap whose height times depth is 65536 or more, such as
BitMap 0,16,8192,8, got too little memory, and its planes pointed behind it into memory of others; it gets all of its memory (#76). ShapesBitMapof a shape with planes of 32 KB or more put each further plane of the bitmap in front of the previous one, so drawing on it wrote in front of the shape; the planes follow each other as in the shape (#79).BitMapset only the plane pointers up to its depth and left the others of the object as they were, pointing into the freed memory of an earlier bitmap of more planes; they are cleared (#80).SaveBitmapof a bitmap whose flags are set (not one made withBitMap, which sets none) read the depth together with the flags and wrote hundreds of planes per line, from memory behind the bitmap, into an invalid file; it writes the planes the bitmap has (#180).LoadBitMapandLoadScreenof a picture with more planes than a bitmap whose flags are set wrote the extra planes through the memory behind the bitmap; they load only the planes the bitmap has (#188).CludgeBitMapwith a depth of 0 wrote 65536 plane pointers behind the bitmap object, andInitShapemade a shape of depth 0. The drawing and blitting commands, such asPlot,Polyf,BBlitandQBlit, then ran up to 65536 times over memory behind the object. With runtime error checking,CludgeBitMaprefuses a depth of 0 or more than 8 with “Illegal BitMap Depth”, asBitMapdoes, andInitShapea depth of 0 with “Illegal Shape Depth” (#393, #74, #243).
IFF files
These are the commands that load and save IFF files, the Amiga’s standard
format for pictures (ILBM), colours, sounds and animations. The first two
fixes change the files that SaveBitmap, SaveScreen, SaveShape and
SavePalette write, so such a file is not always the same byte for byte
as the one the original writes. Loaded again, it gives the same picture
and the same colours.
- With a palette of an odd number of colours, the colour chunk (CMAP)
has an odd length and got no pad byte, which IFF requires after such a
chunk. The picture data behind it then started at an odd place in the
file, and strict IFF readers, such as programs that use
iffparse.library, could not read the file. The chunk gets its pad byte, so these files are one byte longer; the port’s load commands still read the files without it (#184). - The packer of
SaveBitmap,SaveScreenandSaveShapelooked at the byte behind the end of each row, and when that byte equalled the row’s last two bytes, it packed them differently. Both packings give the same picture, but one depended on the next row or on the memory behind the bitmap. Every row is packed from its own bytes, so a saved row can differ from the original’s (#183). SaveBitmapandSaveShapewith a palette of 0 colours wrote 65536 colours into a buffer of 4096 bytes and over the memory behind it; with runtime error checking, a palette without colours is the error “Uninitialized Palette” (#182; A palette of 0 colours forSaveBitmapandSaveShape).SaveShapeof a shape of depth 0 or of more than 14 planes, such as one thatLoadShapemade from a 24-bit picture, wrote the addresses of its planes over the memory of the library; it is the runtime error “Illegal Shape Depth”, also without runtime error checking (#326;SaveShapeof a shape of depth 0 or more than 14).LoadBitMapandLoadScreenof a file that could not be opened, or of one without a picture header (BMHD), went on with what an earlier load had left in the read buffer: they showed the old picture again or garbage, or stopped with a message that did not fit. They stop with “Can’t Open File” or “Can’t Find IFF ‘BMHD’” (#187;LoadBitMapandLoadScreenof a missing file).- A read error of the disk or device during an IFF load counted as 65535
bytes read, and the old contents of the read buffer were taken as the
file’s data:
LoadShapeof a device that cannot be read loaded the previous picture again, and the search for a chunk could hang. A read error is the end of the file, and the load command stops with its runtime error (#177). - A chunk of length 0 was read or skipped as one of 4 GB:
LoadSoundof a sound file with an empty BODY copied the rest of the file over the memory behind the sound. A chunk of length 0 reads nothing (#179). ILBMInfoof a file that could not be opened closed it all the same, which crashes older versions of AmigaOS; only an open file is closed (#186).DecodeILBMdid not skip the pad byte behind a chunk of odd length, such as a short text (ANNO) that paint programs write into the file, so it read the next chunk one byte too early and stopped with “Can’t Find IFF ‘BODY’” or took wrong data; the pad byte is skipped (#189).DecodeILBMwrote all planes, rows and bytes of the picture into the bitmap, also into a smaller one: through plane addresses behind the bitmap’s depth and past the end of its planes. A packed run across the end of a row went on in the next row. Only the part of the picture that fits the bitmap is stored, and every run ends with its row (#190, #191).LoadBitMapandLoadScreenof a file without picture data stopped with “Can’t Find IFF ‘BODY’” and left the file open, so it stayed locked until the next reboot, also when the program went on withSetErr; the file is closed before the error (#1053).LoadBitMap,LoadScreenandLoadShapeof a file that ends inside its picture data stopped with “Can’t Read File” and left the file open and locked until the next reboot; the file is closed before the error (#1065).LoadShapeof an animation that stopped after its first frame with “ANIM format not supported” left the file open and locked until the next reboot, also when the program went on withSetErr; the file is closed before the error, and the shape keeps the first frame (#1072).
Sounds
Two more fixes of them change what an existing program does:
Filter On switched the audio filter off and
Translate$ added a 0 byte to its result.
DecodeSounduses sound data that lies in chip memory where it is, and marks the sound so that this memory is not freed. The mark stayed when the next sample was put into the same sound object, byDecodeSoundof other memory,LoadSoundorInitSound, so that sample was never freed before the program ended; it is freed when the object is reused or freed (#68).DiskPlayof a file whose sample length is a multiple of theDiskBufferlength, or 0, never returned and played its last buffer again and again; it returns after the sample, as for any other length (#69).LoadSoundandDiskPlayleft the file open when they stopped with “Can’t Find VHDR”, “Error Reading File” or “Sound too long”, so it stayed locked until the next reboot; the file is closed before the error (#67).DiskPlayof a file that cannot be opened or read kept its buffer of twice theDiskBufferlength in chip memory, so a program that caught the error withSetErrlost that memory each time; the buffer is freed (#950).- With runtime error checking,
SetPeriodtested the period as a channel mask, so every period above 15, which is every useful one, was the error “Illegal Chanel Mask”; it tests only that the sound is set up (#66; The check ofSetPeriod). SetVoicelimited its values with a compare that overflowed, so a large negative rate, pitch or sample frequency became the highest value, for example a rate of -32768 the rate 400; such a value now becomes the lowest one (#279).- When translator.library or narrator.device could not be opened, the end of the program still closed the device that was never opened and freed signal 0, which belongs to the system; it closes and frees only what was opened (#278).
Music players (MED and tracker modules)
Two more fixes of them change what an existing program does:
GetMedVolume silenced the channel it read and
A pattern break in the last song position played on behind the end.
StartMedModuleof a module with MIDI dumps read the address of a further module from a wrong place and could change foreign memory as if it were one; it reads the right address (#207).SetMedMaskwith bits above 3 set let the notes of tracks 4 to 15 through to the player, which wrote them behind its data and to addresses read from that data as audio registers; it keeps only the channels 0 to 3 (#209).- A channel switched off with
SetMedMaskdid not skip its notes, so every later channel played the notes of the channel before it; the notes of a switched-off channel are skipped (#334). - With a channel mask with gaps, such as
SetMedMask %0101, the higher channels did not get the repeat part of their samples; every playing channel gets it (#208). - With runtime error checking,
JumpMedwithout a playing module is the error “No Module Playing”; the original wrote the position into an exception vector of the processor (#210;JumpMedwithout a playing module). - A finetune outside -8 to 7, from the instrument or the command 15xx, made the MED player read a period table from outside its table; 15xx ignores such a value, and the instrument’s is taken as 0 (#211).
- The MED position jump Bxx could take a byte of another track of the same line as part of the position, and jumped to position 0 or read before the play sequence; it jumps to position xx (#203).
- The MED pattern break 1Dxx could likewise take a byte of another track as part of the line number, and then played the memory behind the block; it goes to line xx of the next block (#1066).
- In a MED module with more than 8 tracks, the player let the commands of tracks 8 to 11 run, and the commands 03 and FFD there wrote into its data of other tracks; tracks 8 to 11 are ignored like the other tracks behind track 3, as a MED player does (#1067).
- The MED tremolo 7xy with a speed of 0 ran the vibrato code in the first step of its line; it stays a tremolo (#204).
- The MED note delay and retrigger 1Fxy took the retrigger interval from a value the delayed note had left, so the note could sound twice; it uses its own y (#205).
- MED synth and hybrid sounds with a period below 113 went to the audio hardware unlimited, because the limit was set in the wrong place; the period is limited to 113 (#206).
GetMedVolume,GetMedNoteandGetMedInstrchanged the pointer at which a string expression builds its parts, so a line such asa$="V"+Str$(GetMedVolume(0))gave a cut string or crashed the program; they leave the pointer alone (#1061).LoadModuleof a drawer or a missing file kept a block of memory, and for a drawer a lock on it, after its runtime error, which mattered to programs that catch the error withSetErr; both are freed before the error (#296).PlayModulenever read the last song position, and a new highest pattern number at position 126 made it search 64 KB further and clear memory behind the module; it finds the highest pattern from all 128 positions (#289).- A module with sample numbers above 31 made the tracker player play
memory behind its table of samples;
PlayModuleclears such numbers in the patterns once (#295). - The tracker player took the finetune of a sample as part of its volume, so a volume slide on it jumped to full volume; the sample keeps its real volume (#290).
- A sample whose repeat starts at 64 KB or later looped from the wrong place, because the offset wrapped at 64 KB; it loops from the right one (#291).
- The tracker effect C (set volume) set only the audio hardware, so a following volume slide started from the sample’s volume again; it also sets the volume the player keeps for the channel (#293).
- The tracker effects C and F did not limit parameters of $80 and above,
so
F80made the song play a new row in every frame andC80gave full volume; they limit them as all others (#294).
Tasks and message ports
TaskName$of a task without a name copied the text at address 0; it is the empty string (#297).CreateMsgPortdid not notice when the program had no free signal left and made a port whose messages never wake the program; this is the runtime error “Failed to allocate signal for Port” (#298).DeleteMsgPortfreed a port with the messages still waiting at it, so their senders never got them back; they are replied first (#299).DeleteMsgPorttook any address as a port, so a port thatCreateMsgPorthad not made was freed as if it had, which corrupts memory, and runtime error checking reported only a memory error after the damage; with runtime error checking such a port is the error “Port Not Created By CreateMsgPort”, before anything is changed (#1041).TaskName$andWaitchanged the register that holds the base of the library a command calls, so a later function of the same line, such as the secondSystemDateina=SystemDate+Len(TaskName$(0))+SystemDate, was called with the wrong base and could crash the program; they keep the register (#1060).
ARexx
These are the commands that send, answer and take apart ARexx messages.
One more fix of them changes what an existing program sees:
ReplyRexxMsg with the result string.
ClearRexxMsgandFillRexxMsgwent on past the 16 argument slots of a message into the fields behind them, soClearRexxMsgof a message with all slots used deleted its host and extension strings, and a 17th value ofFillRexxMsgoverwrote the field after the slots; they stop after the 16 slots (#49).FillRexxMsgended the list at any value of 0, also at a number 0, so the arguments behind it were lost; only a string address of 0 ends it, andClearRexxMsgclears all 16 slots (#50).GetRexxResultandGetRexxCommandread the fields next to the results or the argument slots for a number out of range; with runtime error checking,GetRexxResultwith a number other than 1 or 2 is the error “Illegal Result Number”, andGetRexxCommandwith one outside 1 to 16 the error “Illegal Argument Number” (#51;GetRexxResultandGetRexxCommandwith a number out of range).GetResultStringfreed the result string of a message but left the message pointing to the freed memory, so a second call read and freed it again. The port clears the result, and a second call gives the empty string (#53).SendRexxCommandwith no ARexx running (no port “REXX”) showed its alert and went on with the interrupts disabled, so the Amiga stopped responding; it enables them again before the alert (#55).- Without
rexxsyslib.library,DeleteRexxMsg,ClearRexxMsg,FillRexxMsg,SendRexxCommand,GetRexxResult,GetRexxCommandandGetResultStringshowed their alert and then worked on a message at address 0, reading and writing low memory; after the alert they take the message as no ARexx message and do nothing (#56). - An ArgString that
CreateArgString,CreateRexxMsg,FillRexxMsgorSendRexxCommandmade of a string of 65536 characters or more took memory for the whole string, but held only its length modulo 65536 characters; it holds the first 65535 characters, the most an ArgString can describe (#57).
Serial port
These are the commands of the serial port library, which open units of
serial.device and read and write through them. Two more fixes of them
change what an existing program does:
the flags of WriteSerialString and ReadSerial.
CloseSerial,SetSerialBuffer,SetSerialLens,SetSerialParamsandSerialEventlooked for a unit other than 0 at half its place, in the data of another unit, soCloseSerial 1with unit 0 open closed unit 0; every command finds each unit at its own place (#252).ReadSerialMemread through the request the unit uses for writing, so the read settings ofSetSerialParams, such as the end of file mode, did not apply to it; it reads through the unit’s read request (#253).ReadSerialStringread every byte waiting, also more than its string buffer holds, and overwrote the memory behind the buffer; it reads at most what fits, and the rest stays waiting for the next read (#256).CloseSerialclosed the device while a write that does not wait was still going on, and left that write pending; it stops and collects the write and the read before it closes the device (#258).- When
OpenSerialgot no free signal for writing, it returned 0 but leftserial.deviceopen, so the unit could not be opened again until a reboot; it closes the device again (#259). - A second
OpenSerialof a unit that was open set the unit up again; when the device then refused the second open, the unit counted as closed and the device was never closed. A secondOpenSerialof an open unit returns 0 and leaves the unit as it is, also with shared access (the flag 32), where the original opened the unit again over the first one (#260).
Program start
- A program started from the CLI with an argument line longer than 255 characters copied the whole line into a buffer of 256 bytes and overwrote the memory behind it; the program gets the first 255 characters (#308).
- A program started from the Workbench makes its drawer the current directory, and did not make the old current directory current again at its end; it does (#307).
- A program started from the Workbench opened
dos.libraryand never closed it, so every start raised its use count for good; it is closed at the end (#306).
Debugger and runtime error checking
One more fix of this area changes what an existing program does:
Runtime error checking in supervisor mode outside SetInt.
- When the debugger evaluated an expression such as a short string, it showed the memory behind the string up to 256 characters; it shows only the characters of the string (#126).
- When the current position in a line lay right after a token, for
example right after
Print, the debugger marked the end of the line; it marks the right column in the source (#127). - RUN with the debugger started the debugger process without flushing the CPU caches, so on a 68020 to 68060 the process could run stale code; the caches are flushed before it starts (#409).
- A runtime error in an interrupt routine of an executable with runtime
error checking lost its message on the way to the trap handler that
was there before the program started, and closed
intuition.libraryinside the interrupt. The message is kept, andintuition.libraryis closed only when the program ends. The program shows the message in its own requester, as the next point says; a trap handler that a program put into the vector table itself is not called (#246). - A runtime error inside a
SetIntroutine of an executable compiled with runtime error checking is reported with the usual requester at the program’s next statement, as the debugger does, and the routine is not called again. A program that waits, for example inWait_, reports it when it goes on. The original hung the machine (#1073). VWait 0waited for 65536 frames, more than 20 minutes; with runtime error checking it is the error “Can’t VWait 0 Frames!” (#1201).
Runtime errors in executables
An executable built with runtime error checking stops with a requester
when it meets an error. For three errors the original showed the
requester with no text at all: a command that needs a used object when
none is used (for example RGB without a screen), an offset out of range,
and the end of a program that has no End.
What happened
NPrint "hello"Compiled with runtime error checking and saved with Create Executable,
the program prints hello and then stops with an empty requester.
With the port
The requester says End of Program. The other two errors say
No currently used object! and Offset out of range, the texts the
debugger shows. The program still stops at its end without End, as
before.
Issue: Runtime errors with a numeric code show an empty requester in executables (#6).
Runtime errors without the debugger
Every library has an area of error checks that is left out when a program is compiled without runtime error checking. Several libraries had error handling that jumped into that area, or kept the text of an error message there. Without runtime error checking, such an error jumped to memory behind the library, or reported a message that pointed into nowhere. The port puts this code and these messages where they belong, so the error is reported with its proper text in both cases. With runtime error checking on, nothing changes.
The fixes concern:
- memory errors, “Out of Memory!” (#956)
- fonts, “Can’t Open Font” and others (#955)
- screens, “Can’t open Screen” and others (#251)
- displays and copper lists (#412)
- shapes,
DecodeShapesof address 0 (#270) and the shape error messages (#953) - sprite files (#954)
SetPeriodwithout a sound, and the sound error messages (#70)- animations, “Can’t Open Anim File” (#398)
- music modules, “Error Accessing Module File” (#957)
- IFF pictures (#192) and saving IFF files, “Can’t open File” (#185)
- Workbench arguments without memory at the start of a program (#305)
AmigaOS calls
These fixes concern the calls of AmigaOS functions (AmigaOS libraries).
A missing AmigaOS library hung the program at its start
A program opens every AmigaOS library it calls when it starts. When a
library could not be opened, the original tried again, without end. A
program that calls a function of a library the system does not have, such
as gadtools.library on Kickstart 1.3, hung before its first line, even
if it checks the system version and never makes that call.
What happened
On Kickstart 1.3, which has no gadtools.library:
DEFTYPE .l
NPrint "start"
Goto skip
x=CreateContext_(&x)
skip:
NPrint "end"
EndThe original hangs at its start and prints nothing.
With the port
The program starts. The call of the missing library is never made, and the program prints
start
endA call of a function of the missing library would still crash.
Issue: A program hung at its start if an AmigaOS library it calls was missing (#44).
Other fixes
Each point says first what the original did and then what the port does.
- A program that calls a resource, such as the battery clock or the CIA resources, hung at its start; the resource is opened (#45).
CachePreDMA_andCachePostDMA_passed their flags in the wrong register; the flags reach the system (#959).- A program that uses a transcendental function, such as
Sin,Sqror^on floats, hung at its start whenmathtrans.librarycould not be opened, like the missing AmigaOS libraries above; the program starts, and only a call of such a function crashes (#202).
RWE userlibs
These fixes concern the RWE userlibs. In the lists of fixes below, each point says first what the port does and then what the original did, unless the introduction of a list says otherwise.
NextArg$ did not end a quoted word after ""
InitArgParse takes a line of text, such as the arguments a program got
from the CLI, and NextArg$ returns its words one by one. Spaces
separate the words, quotes group a word that contains spaces, and ""
inside a quoted word stands for one quote character. After such a ""
the original took the closing quote for text: the word did not end
there but went on, spaces included, up to the next quote or the end of
the line. "a""b" c gave the one word a"b c instead of a"b and then
c, so a program lost an argument.
What happened
The program puts the line "a""b" c into memory and reads three words:
DEFTYPE .l
b=AllocMem_(64,$10001)
If b=0 Then NPrint "no memory" : End
s$=Chr$(34)+"a"+Chr$(34)+Chr$(34)+"b"+Chr$(34)+" c"
For i=1 To Len(s$) : Poke.b b+i-1,Asc(Mid$(s$,i,1)) : Next
InitArgParse b
For k=1 To 3
a$=NextArg$
NPrint "<"+a$+"> "+Str$(Len(a$))
Next
FreeMem_ b,64
EndThe original prints
<a"b c> 5
<> 0
<> 0With the port
The closing quote ends the word, and the port prints
<a"b> 3
<c> 1
<> 0Issue: NextArg$ took the closing quote after "" inside quotes as text (#755).
Text after a string function
These functions had the fault described under
Text after a string function lost its last character:
followed by more text in a string expression, such as
ProgDir$+"/data", the result held a 0 byte and the last character of
the text was missing. In the port the text follows the result.
ProgPath$,ProgDir$,ProgName$andDefaultFontName(#743)GetPathNameandNextDevice(#618)NextAppFileandAppFile(#519)RTEZLoadFileandRTFileRequest(#461)GetLibraryValue$,GetRegistryStringVariable,ParseItemName$andParseItemValue$(#783)ReqFileRequest(#784)SerialReadString(#795)
More functions left the place of the next part wrong in other ways. Each point says first what the original did and then what the port does:
- Text after
RTEZSaveFilewas written over the end of the chosen path, or behind bytes of its arguments; it follows the path (#465). EZRequestandEZRequestArgs, used as functions in a string expression, left the place at address 0 or on their argument list inside the library, so the rest of the expression was written over the start of memory or over that list: a line such asa$="Answer "+Str$(EZRequest("T","Body","Yes|No"))came out wrong or crashed the program. The rest of the expression follows the result (#1027).ChangeWBSprite, used as a function in a string expression, left the place on a tag list inside the library, so the rest of the expression was written over that list; the place stays where it was (#1028).
The tracker library did not play in CIA mode
The CIA Protracker library
plays Protracker modules in two ways. By default, in CIA mode, it sets up
a timer interrupt of a CIA chip when the program starts, and that
interrupt plays the module at the right tempo by itself. After
ChangeTrackerVBlank the program calls PlayTracker 50 times a second
itself instead.
What happened. When the original set up the interrupt, it did not pass the system the number of the timer’s interrupt bit, but the values it found in memory at the addresses 1 and 2. On a 68000, as in the A500, reading a long from an odd address is an address error, so a program that used the library crashed at its start. On other machines the result depended on what lay at those addresses. With the system’s base above 16 MB, as on an A1200 with Zorro III fast memory, the system took the value, but the interrupt never played the module, and the program stayed silent.
This program loads a module whose first row holds the tracker event
805, lets it play in CIA mode for one second and reads the event:
DEFTYPE .l
r=LoadTrackerModule(0,"mod.tune")
NPrint "loaded ",r
If r<>-1 Then End
r=StartTracker(0)
For i=1 To 50 : VWait : Next
e=GetTrackerEvent
StopTracker
NPrint "event ",e
EndWith the original (in the emulator, an A1200 with Zorro III fast memory), the module never played its first row:
loaded -1
event 0With the port
loaded -1
event 5The library passes the bit of its timer, and in CIA mode the module plays on every Amiga.
What to change. Nothing. A program that used ChangeTrackerVBlank
and PlayTracker only to get any sound at all can go back to CIA mode,
where tempo commands of a module take effect.
Issue: SetCIAInt passes the longs at the addresses 1 and 2 as the ICR bit to AddICRVector (#450).
Samples without a loop ended in a buzz
A sample of a Protracker module either loops, or it is played once and then ends. The Amiga’s sound hardware cannot simply stop a sample: it always plays on from the loop start. For a sample without a loop, Protracker therefore clears the first two words of the sample when it starts a module, and the voice goes on playing those zero bytes, which is silence.
What happened. StartTracker in the original was meant to clear
those words for every sample inside the module, but compared the
module’s length with the samples’ addresses, and so practically never
cleared them. After a sample without a loop, the voice went on playing
its first two bytes again and again: a buzz, or a click where the sound
stopped. This program loads a module with one sample of eight bytes,
$11 to $88, without a loop, starts it and reads the sample’s first
two longs:
DEFTYPE .l
r=LoadTrackerModule(0,"mod.tune")
If r<>-1 Then End
ChangeTrackerVBlank
r=StartTracker(0)
StopTracker
a=GetTrackerLocation(0)+2108
NPrint "first long ",Hex$(Peek.l(a))
NPrint "second long ",Hex$(Peek.l(a+4))
FreeTrackerModule 0
EndThe number 2108 is the size of the module’s header and of its one
pattern, so a is the address of the sample.
With the original
first long 11223344
second long 55667788With the port
first long 00000000
second long 55667788What to change. Nothing: samples without a loop end in silence, as in Protracker. A program that reads a sample of a started module from memory finds its first four bytes cleared.
Voices left out by TrackerChannels played the wrong notes
ritrackerlib
plays a Protracker module on the four voices of the Amiga.
TrackerChannels leaves voices out, so that the program can play its
own sound effects on them while the module goes on with the others. Bit
3 of its value stands for voice 1 and bit 0 for voice 4, so
TrackerChannels %0111 leaves out voice 1.
What happened. A row of a pattern holds one note for each voice, side by side, and the player read them from left to right. It moved on to the next note only after it had played one, so it did not move on for a voice that was left out. Each voice after that one played the notes of the voice before it, with their samples and effect commands, and the notes of the last voice were not played at all. This program plays a module with voice 1 left out:
LoadBank 0,"mod.tune",2
TrackInit Bank(0)
TrackerChannels %0111
SetInt 5
TrackPlay
End SetInt
MouseWait
TrackStopThe table shows whose notes each voice plays. It is worked out from the play routines of the original and of the port, not recorded from a run of this program; the library’s test compares the sound registers of all four voices with voice 2 left out and with voices 1 and 4 left out.
| Voice | With the original | With the port |
|---|---|---|
| 1 | silent | silent |
| 2 | the notes of voice 1 | its own notes |
| 3 | the notes of voice 2 | its own notes |
| 4 | the notes of voice 3 | its own notes |
The notes of voice 4 were lost, and so were its speed, jump and break commands, which change how the whole module plays.
With the port every voice that plays reads its own notes. A voice that is left out reads its notes too, without a sound, so its speed, jump and break commands take effect as if all four voices played.
What to change. Nothing. The voices that play sound as the module was written.
Fixes in the Protracker play routine
The CIA Protracker library and ritrackerlib play modules with the same Protracker 2.3A play routine, which had the same faults in both libraries. Each of the following fixes applies to both. Each point says first what the original did and then what the port does.
- The first portamento up or down (
1xx,2xx) that a program played before any fine portamento (E1x,E2x) did not slide on its first tick; it slides by its whole value from the start (#478). - A tremolo (
7xy) with the ramp-down waveform (E71) took its shape from the position of the voice’s vibrato; it follows the position of the tremolo itself (#482). - A note with a sample offset (
9xx) gave the sound hardware the offset once, but moved the voice’s own start twice, so a retrigger (E9x), a note delay (EDx) or a following note without a sample number started at double the offset; the offset counts once (#473). - A sample offset (
9xx) on a sample of 64 KB or more played only 2 bytes of the sample; it plays the sample from the offset (#472). - A sample whose loop starts at 64 KB or later looped from a place 64 KB too early; it loops from its loop start (#479).
- An arpeggio (
0xy) on one of the highest notes could play a much lower note, or a value from the player’s own data; it plays at most the highest note of the period table (#474). - After a stop (
F00) on voice 1, 2 or 3, the voices after it in the same row read their notes from the Amiga’s custom chip registers and went on playing random samples; they read the notes of the row (#475). - A note period below the lowest note of the table (1 to 112, which Protracker does not write) played a low note or a value from the player’s own data; it plays the highest note (#481).
StartTracker,DecodeModuleandTrackInitlook for the module’s highest pattern in its song positions. The original never read the last of the 128 positions, so a pattern used only there was not counted and the samples were taken from the wrong place. A new highest pattern at the position before it made the search read on through 64 KB behind the module, so that the samples were looked for far behind it and memory there was cleared or copied. All 128 positions are read (#477).- A module with sample numbers above 31 in its patterns made the sound
hardware play memory behind the sample table;
StartTrackerandTrackInitset such numbers to 0 in the module, once (#480). - A sample with a finetune value above 15 played periods read from far
behind the period table;
StartTrackerandTrackInitkeep only the low four bits of the value, once (#476).
Other fixes in ritrackerlib
These fixes concern ritrackerlib alone.
- A voice left out by
TrackerChannelsstays silent and free for the program’s own sounds, since the module no longer writes to it; the original still wrote the module’s effects and sample loops to it, so it could become audible again (#567). - The commands
F80toFFFare tempo commands, as in Protracker; the original took them as speeds of 128 to 255 ticks per row, so the module nearly stopped (#569). - A tempo command (
F20toFFF) no longer writes to a timer of a CIA chip that the library never reserved and that another program may use. It does not change the speed: the library plays one tick each time the program callsTrackPlay, so the program sets the speed, and that is how the library works (#571). TrackInitno longer clears up to 4 bytes of memory behind a module whose last samples are empty (#570).Tracker OnafterTracker Offcontinues the module; the original left it stopped untilTrackInitorTrackerPause 0. A module that was stopped or paused beforeTracker Offstays so (#572).TrackInitwhile the player is switched off prepares the module, so thatTracker Onplays it; the original played the module of before, or memory from address 0 if there was none (#573).
Fixes in bb_blitlib
These fixes concern
bb_blitlib, the
blitter routines of the game Blitz Bombers; the fix of BlockToShape is
described above.
BTBlockImagetakes image 147 and the ones after it from their place in the block of images; the original took images 147 to 292 from the memory 64 KB beforeimage_addr, and the ones from 293 on from inside the first images (#427).BPredatorBlitfinds the line below with the line width of the bitmap it draws on; the original used the width set withSetupMapTwo, so on a bitmap of another width the effect showed another part of the background, on a bitmap 640 pixels wide the same line 320 pixels further right (#426).- With runtime error checking,
CreateShapewith a count of 0 is the error “CreateShape count must be at least 1!”; the original made 65536 shapes and wrote 2 MB over the memory behind the shape table (CreateShapewith a count of 0 or past the last shape, #428). - With runtime error checking,
CreateShapewhose shapes would run past the last shape that the Object Maximums of the compiler options allow is the error “CreateShape start+count above Maximum Shapes!”; the original wrote those shapes over the memory behind the shape table (CreateShapewith a count of 0 or past the last shape, #1077). - With runtime error checking, the commands that blit a shape,
SpecialBlock,SpecialBlockBitmap,TBlock,PredatorBlit,BPredatorBlit,BColourBlitandSpecialBlockToShape, refuse a shape that was never defined with “Uninitialized Shape”; with the original such a shape, of depth 0, made them blit 65536 planes over memory all over the system (A shape that was never defined for the Blitz Bombers blits, #429).
Fixes in neilsreqtoolslib
These fixes concern
neilsreqtoolslib,
the requesters of reqtools.library; the fix of RTEZGetLong and
RTEZGetLongRange is described above.
- Without reqtools.library, or when the library could not prepare its
requesters at the start, the commands return what they return when
the user cancels: 0, an empty string, -1 for
RTEZPaletteRequest, and 0 forRTVersionandRTRevision; the original crashed the machine at the first requester.IsReqToolsActivestill tells whether the requesters are there (#463). - When the library cannot prepare its requesters at the start for lack of memory, it closes reqtools.library and frees the requesters it has; the original kept both after the program ended (#460).
RTEZMultiLoadFilereturns -1 whenever files were chosen; the original returned the address of the list of files instead when that address happened to end in the byte $00 (#462).RTReturnValuegives the result ofRTEZPaletteRequestandRTASyncPaletteRequesttoo; after these the original still gave that of the requester before (#464).RTEZFlagsRequestshows the titleTitle$, and an empty title gives reqtools’ default title; the original always showed the default title (#455).RTEZFreePattern 3removes the pattern gadget thatRTEZSetPattern 3added to the multi-load requester, andRTEZFreePattern 2does nothing, asRTEZSetPattern 2; the original removed the gadget for 2 and did nothing for 3. A program that used 2 for the multi-load requester has to give 3 (#456).- A cancelled
RTEZGetStringfrees the memory of its input; the original keptMaxCharsbytes for every cancelled call until the program ended (#458). RTEZScreenModeRequestopens the screen mode requester through the function of reqtools.library that is meant for it. The original called the function of the font requester instead; reqtools.library 38 opens the screen mode requester for that call all the same, so with it nothing visible changes (#466).RTASyncRequestandRTASyncPaletteRequestno longer read a value through the window object that they never used, andRTCheckASyncRequest,RTEndASyncRequestand the palette commands of the same names give reqtools the signals of the requester. The requesters worked with the original as well: reqtools.library 38 does not use these signals, so with it nothing visible changes (#454).
Fixes in popupwinlib
These fixes concern popupwinlib, the popup menus of Reflective Images.
- Programs that use the library run on Kickstart 1.x, and the menus work there. The library builds its message port and the memory of a menu level with functions that every Kickstart has, and below Kickstart 2.0 it opens the menu windows in the way Kickstart 1.x knows. On Kickstart 1.x a sub menu whose window does not fit on the screen, at its right or bottom edge, does not open, and the whole menu closes. The original called functions of Kickstart 2.0, and every program with the library crashed at its start (#1140).
PopUpWindowcan be used as a function,r=PopUpWindow(Screen#,*items), and returns the address of the item chosen, or 0 if no item was highlighted when the mouse button was pressed; the original was a statement only and never told the program which item was chosen. As a statement it is the same as before (#471).- A mouse button pressed while a sub menu of
PopUpWindowcloses is no longer lost; the original threw away the waiting messages of all menu levels when it closed one, and the menu stayed open until the next click (#469). - When there is no memory for a menu level,
PopUpWindowcloses the menu and returns; the original went on with the level’s data at address 0, wrote over the start of memory and could crash (#467). PopUpInitkeeps the message port the library already has; the original made a new one at each call and lost the old one with its signal, and once the program’s signals were used up, the nextPopUpWindowhung with the menu open (#470).PopUpWindowleaves the audio filter and the power LED as they are; the original switched both over for every menu with sub menus it showed (#468).
Fixes in riamosfunclib
These fixes concern
riamosfunclib,
the AMOS-style helpers of Red When Excited; the fixes of
BankLimit n and FindVolume
are described above.
The memory banks:
- A bank number is a number from 0 to one below the bank limit.
Start,Length,EraseandSwapBanktreat any other number as a bank not in use,Reserve(bank,length)returns 0 for it,NextBankreturns -1 for a start outside, andFillMem,BLoadandBSavetake a negative number as an address. The original also took negative numbers and numbers above the limit as banks and read and wrote before or behind its tables of banks:Start(-1)gave the length of the last bank, andReserveof a bank above the limit wrote over the address of another bank (#484). Reserve(length)returns -1 when every bank is in use; the original reserved a bank before the first one and damaged the library’s tables (#498).Reserve(length)with a negative length returns -1, as for its other failures; the original returned 0, the number of the first bank (#500).NextBankwithout an argument searches from bank 0, as the manual says (“the first available bank”); the original started at whatever number a register of the processor held, and could return a later bank or -1 (#497).EraseAll,BankLimitand the end of the program free every bank, also with more than 65536 banks; the original freed only those from the highest multiple of 65536 on, and afterBankLimit 0it went through 65536 bank numbers below 0, outside its tables (#495).CopyByte,CopyWord,CopyLongandFillMemwith a count of 0 copy or fill nothing, andFillMemwith a negative length does nothing, as the copies do for a negative count; the original copied or filled 2^32 bytes, words or longs over all memory (#492).
Loading and saving:
BLoadinto a bank opens the file before it touches the bank, so a file that cannot be opened leaves the bank as it was; the original erased the bank and reserved it anew first: a bank in use lost its contents, a free one stayed reserved (#487).BLoadreturns 0 when reading the file fails; the original returned -1, success. A file shorter than the length asked for is still loaded with success (#488).BLoad(name$)returns -1 for every failure, as the manual says: an empty or missing file, no free bank, not enough memory, or a failed read, after which the bank is freed again. The original returned 0, the number of the first bank, when no bank could be reserved, and the number of a bank with undefined contents when the read failed (#486).BSavewith a bank writes at most the bank’s length, as the manual says; the original wrotelengthbytes also when the bank was shorter, and saved the memory behind it (#489).SaveExecreturns 0 when the file cannot be created, and for a list without code hunks it writes no file and returns 0; the original returned an address in both cases, and for an empty list wrote the end of the list as a hunk or left the file open (#501).SaveExecnumbers only the code hunks it writes; the original also counted the other items of the list that it leaves out, so with such an item before a code hunk the file could not be loaded (#502).SaveExecwrites a loadable executable for any number of code hunks; the original’s file with two or more code hunks could not be loaded. A list with one code hunk gives the same file as before (#503).
Directories and devices:
MakeDirgives back the lock of the directory it created; the original gave back whatever dos.library left in a register, so with some versions of dos.library the new directory stayed locked and could not be deleted or renamed, or something else was released (#496).ChangeDirreturns -1 and remembers the new directory also when the current directory before was the root of the boot volume; the original returned 0 then, although it had changed the directory, and never released the new one (#490).- A program that uses
ChangeDirends in the directory it was started in, unless it changed the directory itself since, andBankLimitno longer touches the current directory. The original released the directory chosen last while it was still the current one, also atBankLimit, and left the Shell that started the program with a directory that was released (#491). DeviceName$("")leaves the string expression in front of it alone; the original cleared a “:” at the end of that part, so"X:"+DeviceName$("")lost its colon (#493).DeviceName$returns "" for a device or volume without a running handler; the original read from near address 0 and returned nonsense (#494).
Kickstart 1.x:
FindVolume,DeviceName$,CachesOn,CachesOffandRebootwork on Kickstart 1.x.FindVolumeandDeviceName$read the list of devices, volumes and assigns in the way Kickstart 1.x knows,CachesOnandCachesOffswitch nothing there and return 0, andRebootuses the reset routine that Commodore published for the Kickstarts before 2.0. The original called functions of Kickstart 2.0 in all five commands and crashed there (#1145).
Fixes in rianimlib
These fixes concern
rianimlib, the
library by Reflective Images that plays IFF animations (ANIM files) of
the delta formats ANIM5 and ANIM7 from memory into bitmaps.
RIAnimInit unpacks the first frame and starts the animation, and each
RINextAnimFrame draws the next frame. The fix of
data that is not a FORM ANIM is listed under
Other fixes.
RIAnimInittakes the bitmap header (BMHD) from the first frame only and fails when that frame has none. The original searched the whole animation and could take a header from a later part (#511).- A failed
RIAnimInitleaves no animation:RIAnimFrameCountandRINextAnimFramereturn 0. The original went on playing the animation started before (#512). RIAnimInitreturns 0 when the bitmap cannot hold the first frame, because it is too narrow or not deep enough. The original reported success and played the frames into that bitmap (#1106).RIAnimInitrefuses an animation whose header gives a depth of 0 or more than 8 bitplanes. The original wrote through plane pointers from behind the bitmap’s (#509).- With runtime error checking,
RIAnimInitwith a positionx,youtside the bitmap stops with the runtime error “Animation position outside the bitmap”. The original drew the frames far outside the bitmap, as the port does without error checking (#514). RIAnimFrameCountcounts only the frames. The original counted every chunk of the animation, an annotation as well (#510).- The library finds the bitmap header, the frames, their colours and their delta data behind a chunk of odd length, such as an annotation (ANNO); it skips the pad byte that the IFF standard puts there. The original read one byte off and missed them (#505).
- A corrupt chunk length ends the walk through the animation instead of
sending it into memory that is not there;
RIAnimInitcould hang on it in the original (#506). RIAnimInitreturns 0 for an animation written without pad bytes, in which a chunk behind one of odd length starts at an odd address, andRIAnimDepth,RIAnimWidthandRIAnimHeightreturn 0 when this happens before the bitmap header. On a 68000 the original crashed with a Software Failure on such a file; a 68020 or later read it (#1119).RINextAnimFrameplays a frame that has another chunk, such as a DPAN, before its delta data, and returns 0 for a frame without delta data. The original crashed there (#515).RINextAnimFrameplays ANIM7 animations stored with short (word) data. The original decoded every ANIM7 as long data and drew garbage (#504).RINextAnimFramedecodes the last column of ANIM5 animations whose width is no multiple of 16 pixels. The original left the right edge of such frames as it was, and for an animation narrower than 8 pixels wrote far beyond the bitmap (#507).RINextAnimFramedecodes ANIM7 animations with long data at every width. The original left the right edge of frames whose width is no multiple of 32 pixels as it was, and for an animation narrower than 32 pixels wrote far beyond the bitmap. Only the last 16 pixels of a row with an odd number of words, such as a width of 33 to 48, are still not updated by such frames, since the format does not say what the data holds there (#1115).RINextAnimFrameplays on past a chunk between two frames, such as an annotation. The original took it for the end of the animation and stopped there or started again (#1116).RINextAnimFramerefuses a frame whose header or colour chunk claims to be longer than the frame, and returns 0. The original read the next chunk from wherever that length pointed in memory (#1117).RINextAnimFramerefuses a frame whose delta data gives a plane’s data outside the delta chunk, and returns 0 without drawing. The original read the delta data of that plane from anywhere in memory and wrote it into the bitmap. The runs and copies inside a plane’s columns are still not checked, so that playing stays as fast as in the original (#1120).RINextAnimFramerefuses an ANIM7 frame whose delta data puts the data of a plane at an odd offset in the delta chunk, and returns 0 without drawing. On a 68000 the original crashed with a Software Failure on such a frame; the port refuses it on every processor (#1121).- With runtime error checking,
RINextAnimFramestops with the runtime error “Animation position on an odd byte for ANIM7” before an ANIM7 frame when the position given toRIAnimInitputs the frame at an odd byte: anxof 8 to 15, 24 to 31 and so on, or an odd byte offset. On a 68000 the original crashed with a Software Failure there. ANIM5 frames play at any position, and without error checking the port plays as the original (#1122). - A program run a second time from the editor starts with no animation
and with
AnimLoopon. The original’sRIAnimFrameCountandRINextAnimFrameworked on the animation of the run before, which may have been freed, and anAnimLoop Offstayed off (#1107).
Fixes in riapplib
These fixes concern
riapplib, the App
windows, App icons and App menu items of Workbench by Reflective
Images. Each of them sends the program a message when the user drops
files on it or chooses it; AppEvent fetches the message, and
NextAppFile, AppFile and AppLock tell which files it holds. The
fixes of the result of AddAppMenu, of
the result of AppEventID, of
the text that follows NextAppFile and AppFile
and of the local variables after AddAppIcon are
described elsewhere on this page.
- Programs that use the library run on Kickstart 1.x. The App commands need Workbench 2.0 and do nothing there, as on any system without the Workbench libraries they need. The original called a function of Kickstart 2.0 before it checked for them, and every program with the library crashed at its start (#1143).
NextAppFileandAppFileleave Workbench’s lock of the file’s drawer in the message. The original gave the lock back to the system, so reading the same file again withAppFilegave a wrong path, andAppLockreturned 0 (#521).AppFilewith a number of 0 or less returns an empty string. The original made a path of whatever lay in memory in front of the list of files (#520).AppLockreturns 0 for a message without files, such as the one of an App menu item chosen without icons selected. The original returned a value from memory that was no lock (#522).AppLockreturns the lock of the drawer of the file thatNextAppFileorAppFileread last, as the guide says, and the first file’s lock before either has read one. The original always returned the first file’s lock, so for the other files of a message it gave the wrong drawer (#1103).DelAppWindowof a window that is no App window returns 0, asDelAppMenuandDelAppIcondo for an id without an object. The original returned -1 and passed an empty App window to the system (#523).- An
AddAppIconthat fails on an id in use, after it has removed the old icon, frees the image it loaded for the new one, and nothing of the old icon is left. The original kept both, andDelAppIconor the end of the program removed the old icon a second time (#517). - At the end of the program the library answers the current message and
every message still waiting, so Workbench gets them back. The original
answered the waiting ones only if
AppEventhad fetched a message last (#525). - An App window, icon or menu item with an odd id that is still there at the end of the program is removed normally. On a 68000 the original crashed the machine there (#524).
- When workbench.library, dos.library or icon.library cannot be opened,
the library closes the others again, and
AppMsgPortreturns 0. The original left them open and returned the address of a port it had deleted (#526). - A program run a second time from the editor starts without an App
message. The original started with the last message of the run
before:
AppMessage,AppEventTypeand the other functions read it, and the firstAppEventanswered it a second time (#1099). - With runtime error checking, an id of
AddAppMenu,DelAppMenu,AddAppIconorDelAppIconoutside 0 to 15 stops with the runtime error “App id must be 0 to 15”, and a window number ofAddAppWindoworDelAppWindowoutside 0 to 15 with “App window number must be 0 to 15”. Without it, such a number overwrites memory, as in the original (#1097).
Fixes in riarexxlib
These fixes concern
riarexxlib, the
ARexx port by Red When Excited. RXCreatePort gives the program a
public message port; RXReadPort and RXWaitPort make a received
message the current one, and RXReplyMsg answers it. RXSendCommand
sends a command and waits for the reply, RXRunCommand sends one
without waiting, and both split the command into words, one argument
each, unless RXTokenise Off is given. The fix of
the result of RXRunCommand is described above.
The port and the library:
RXCreatePortworks on Kickstart 1.x: the library builds its port, its lists and its messages with functions that every Kickstart has. The original used functions of Kickstart 2.0 for them, and a program crashed at its firstRXCreatePorton Kickstart 1.x (#1144).RXCreatePortreturns 0 when a public port of that name exists, as the guide says. The original added a second port of the same name, so messages for it reached whichever of the two ports the system found first, and the program could not tell that its name was taken (#1096).RXCreatePortthat cannot set up its port completely frees it and returns 0. The original freed the port but left it in the system’s list of public ports (#528).RXDeletePort, and the end of the program, free the lists of messages and the copy of the port’s name; the original lost that memory at everyRXCreatePortandRXDeletePort(#530).RXDeletePort, and the end of the program, also reply the message that is current, with the return code 5 as the others. The original replied only the messages still waiting, so the sender of the current one waited for ever (#1101).RXDeletePort, and the end of the program, wait up to 5 seconds for the replies to commands sent withRXRunCommandorRXRunScriptthat are still with their receivers, and reply the messages that arrive meanwhile with the return code 5. A reply that is still out after 5 seconds finds the port taken off the public list but kept in memory for it. The original deleted the port at once, so a late reply was written into freed memory. A program whose receiver is slow, or never replies, takes up to 5 seconds longer to end (#1095).- A program that uses the library closes rexxsyslib.library at its end; the original left it open, once more with every run, so the system could never remove it from memory (#1093).
- Without rexxsyslib.library the library sends nothing:
RXRunCommand,RXRunScriptandRXExecuteScriptreturn 0 andRXSendCommandan empty string, andRXReplyMsgreplies without a result string. The original crashed at the first message (#1094). RXDefaultPorttakes a name of any length. The original copied it into 65 bytes without a limit, so a longer name overwrote the library’s other data and the next command crashed (#529).- A program run a second time from the editor sends to the default port
REXXagain. After anRXDefaultPort "RWERESP"in the run before, the original sent toREXXE, a port that does not exist (#532).
Sending commands:
RXExecuteScriptandRXRunScriptrun the ARexx script file they name.RXExecuteScriptwaits until the script has ended, and its return code isRXReturnCode;RXRunScriptdoes not wait. The original sent the name as a line of ARexx to execute, so no script file was ever loaded, and neither command waited (#544).- Replies to
RXRunCommandandRXRunScriptare freed with their arguments. The original lost memory with every such command and kept each in its list of sent messages, which ran over other memory after 32 commands. A program can have 31 such commands waiting for their replies; with more, nothing is sent and the result is 0 (#531). RXSendCommandreturns an empty string for a command that failed. The original read the error number of the reply as the address of a string: after a failing ARexx program it returned the bytes from address 6 on (#545).RXSendCommandfrees the result string of each reply; the original lost two strings with every call (#546).RXReturnCodegives the return code of the lastRXSendCommandalso while no received message is current. The original returned 0 then, so the code of a failed command was often lost (#542).- Without memory for a new message nothing is sent, and the result is 0 or an empty string. The original could go on with the message made before, write the new arguments into it and send it again (#533).
Splitting commands into words:
- The character right after a closing quote starts a new word:
"g"hgives the two wordsgandh. The original dropped that character, and when a command ended with a quoted word, it sent the rest of an earlier, longer command as further words:say "hi"afterone two three four five sixgavesay,hi,hree,four,fiveandsix(#538). - Inside a quoted word, a doubled quote stands for one quote and the
next single quote ends the word:
"e""f" c dgivese"f,candd. The original gave the one worde"f c d(#535). - An empty quoted word,
"", is sent as an empty argument:a "" cgivesa, an empty word andc. The original ended the command there and dropped the words behind it (#536). - Commands and words of any length are split whole. The original copied them into buffers of 256 bytes without a limit, so a command of more than 255 characters overwrote the library’s own code (#537).
- A command of more than 16 words is sent with 16 arguments, the most a message has; the 16th holds the rest of the command, as it is, for the receiver to split. The original wrote the 17th and further words over other fields of the message (#527).
RXTokenise Offalways switches the splitting off; the original could leave it on, depending on a part of a register that the program had left as it happened to be (#547).
Received messages:
- After
RXReplyMsgno message is current:RXGetArg,RXNextArg,RXNumArgsandRXSendersNamegive 0 or an empty string until the nextRXReadPortorRXWaitPort. The original went on reading the replied message, which its sender may already have freed. A program that reads a message before it replies, as the guide asks, sees no change (#541). RXReplyMsggives a result string only to a message that asked for one, and only with the return code 0. The original always gave one, so a sender that had not asked never freed it, and one that read the field as a second error code got an address (#539).RXReplyMsgto a message whose sender’s port is gone makes no result string. The original made the string first and then lost it, or freed a string at address 0 (#540).RXNextArgmoves on after an empty argument; the original returned the empty argument again and again (#534).- The list of received messages has room for 31. While it is full,
RXReadPortandRXWaitPortleave further messages in the port, in the order they came, and take them into the list as it gets room; replies to the program’s own commands are still taken at once. The original wrote the 32nd and later messages past the end of the list, over the list of sent messages and the memory behind it (#1100).
Fixes in riarrayslib
This fix concerns
riarrayslib,
the command FillArray by Reflective Images.
FillArrayon an array without elements, whose size is 0, writes nothing. The original stored a value first and compared with the end of the array only afterwards, so it missed the end and wrote on through all memory. The command, which is copied into the program at each place it is used, is 4 bytes longer (#882).
Fixes in ribbmaplib
These fixes concern
ribbmaplib, the
library by Reflective Images that reads the map and scenario files of
the game Blitz Bombers from memory. SetBBMapLoc and
SetBBScenarioLoc choose a file; the other commands look up its chunks.
- The search for a chunk skips the pad byte that the IFF standard puts behind a chunk of odd length; a file written without it stays readable. The original read the next chunk one byte early: on a 68000 this crashed the program, on other processors the chunks behind were not found (#552).
- The search ends at the end of the file. The original read one chunk name behind it, in the memory after the file, and took it for a chunk of the file if it matched (#553).
- A failed
SetBBMapLocleaves the map chosen before as it was. The original took the new address all the same, so the map functions mixed the rejected file with the old map (#554). BBMapScenarioID,BBMapWidth,BBMapHeightandBBMapInforeturn 0 for a map without an information chunk (MFRM). The original read them from behind the file (#551).BBScenarioLowColandBBScenarioHighColreturn the colours 128 to 255 as such. The original returned them as negative numbers (#550).BBGetPalettecounts all the colours of a palette it enlarges, so the scenario’s last colour is used and a second call keeps the palette. The original counted one colour less (#548).BBGetPalettewith a colour range whose first colour is above the last stores nothing. The original wrote one colour, possibly behind the palette’s memory (#549).BBGetPalettereads only the colours that the scenario’s COLR chunk really holds. The original took the rest from the bytes behind the chunk (#1113).- With runtime error checking,
BBShadowValuewith a shadow set that the scenario does not have stops with the runtime error “Shadow set must lie in the SHDW chunk”. The original returned bytes from behind the chunk, as the port does without error checking (#1114). - A program run a second time from the editor starts without the map and the scenario of the run before. The original’s commands found the files of the first run, which may have been freed (#1108).
Fixes in richunkylib
These fixes concern richunkylib, the chunky bitmaps of Reflective Images, with one byte per pixel, and their conversion into planar bitmaps.
ChunkyToPlanarconverts chunky bitmaps of other sizes, with a width that is a multiple of 16 pixels, into the top left of any bitmap of 8 bitplanes that is at least as big, also an interleaved one. A chunky bitmap the bitmap cannot take is not converted; with runtime error checking it is a runtime error. The original always converted 320 x 256 pixels into bitplanes 10240 bytes apart: it read behind a smaller chunky bitmap and wrote behind a smaller bitmap (Sources that compile differently, #884).ChunkyToPlanarreads the depth of the bitmap alone. The original read it together with the bitmap’s flags: depending on the flags it wrote 8 bitplanes into a bitmap with fewer, or refused a bitmap of depth 8 (#883).ChunkyBitmapfrees the data a chunky bitmap already holds also when it lies below address 65536. The original never freed such data, so a new chunky bitmap on that object lost it; when the new memory could not be allocated, the object kept the old address with a size of 0 (#885).RaycastSkywith a height of 0 or below copies nothing. The original copied 65536 rows, about 20 MB of memory (#887).- With runtime error checking,
RaycastSkystops with “RaycastSky outside the chunky bitmap” when the column it would write leaves the chunky bitmap, and with “RaycastSky column below 0” for a negative texture column. The original wrote or read outside (Sources that compile differently, #887). - Freeing a chunky bitmap, when
ChunkyBitmapmakes it again or at the end of the program, leaves the audio filter and the power LED as they are. The original switched them over (#886).
Fixes in ricommoditieslib
These fixes concern
ricommoditieslib,
the commodities by Reflective Images. MakeCommodity registers the
program as a commodity, SetHotKey adds hotkeys, CommodityEvent and
WaitCommodity fetch the next message, and HotKeyHit,
ExchangeMessage and the Exchange functions tell what it was. The fix
of a second MakeCommodity is described above.
- The library answers the messages of the commodity:
CommodityEventandWaitCommodityanswer the message fetched before, and the end of the program answers the last one and those still waiting. The original never answered a message, so commodities.library could not free it, and a running commodity lost about 100 bytes with every hotkey and every command of Exchange (#561). WaitCommoditytakes the next message from the port, or waits for one if none is waiting. The original lost one waiting message and returned the next, which it left at the port, so the nextCommodityEventreturned it a second time (#566).- The
Exchangefunctions return -1 only for a command of Exchange. The original compared the number of any message, so a press of hotkey 15 counted asExchangeDisable, the command 15 (#555). SetHotKeyfrees the hotkey it replaces, and one that fails halfway frees what it had made. The original lost the memory of every hotkey it replaced, and a hotkey that failed halfway stayed in the commodity (#563).SetHotKeyreturns 0 for a hotkey description that commodities.library cannot understand. The original returned -1, and the hotkey never worked (#565).- With runtime error checking,
SetHotKeywith a number outside 0 to 15 stops with the runtime error “Hotkey number must be 0 to 15”. Without it, such a number overwrites the library’s other data, as in the original, and -1 removes the commodity (#564). SetCxStatusdoes nothing whenMakeCommodityfailed. The original then called commodities.library without a commodity and returned -1 (#562).- Without commodities.library,
MakeCommodityreturns 0. The original did not check that the library had been opened and crashed (#559). - At the end of the program the library frees the hotkeys together with the commodity; the original left their memory allocated (#557).
- At the end of the program the library removes the commodity before it closes commodities.library. The original closed the library first and removed the commodity through it afterwards, which worked only while the library stayed in memory (#556).
Fixes in ricompactdisclib
These fixes concern
ricompactdisclib,
the audio CD commands of Red When Excited. CDTrackLength 1, CDVolume
and the SCSI flag of OpenCD are described in
Changes you may notice.
- Programs that use the library start on Kickstart 1.x. The library builds its message port and its requests itself, with functions that every Kickstart has; the original called functions of Kickstart 2.0 there, and every program with the library crashed before its first line (#1138).
OpenCDreturns 0 when the device cannot be opened. The original returned a number left over from freeing its request, 200 on Kickstart 3.1 (#575).OpenCD devicename$,unitrefuses a device name of 40 characters or more with 0, as the guide asks for a name of less than forty. The original copied it into a buffer of 40 bytes and overwrote the library’s data (#576).- With runtime error checking,
OpenCDwhile a device is open stops with “CD device already open: CloseCD first”. The original opened the new device and lost the one opened first, which stayed open (Sources that compile differently, #578). CDPlayTrackuses a request of its own while the music plays. In the original every other command, such asCDUpdateInfo,CDStatus,CDPauseorCDVolume, filled and sent the request of the track that was still playing (#1156).CDStop,CloseCD, the nextCDPlayTrackand the end of the program stop a play and wait until the device has taken it back. The original did not wait, and the device’s reply stayed behind (#574).CDPlayTrackreturns -1 when the play was sent and 0 without a device. The original returned whatever value the system had left (#1157).- With the SCSI flag,
CDPlayTrackplays the tracks it is asked for, taken from the table of contents thatCDReadTOCread, and returns -1 if the drive took the command, else 0. The original ignored its arguments and always played the same blocks, test values of the author (#580). - With the SCSI flag,
CDPlayTrackno longer crashes a 68000 with an address error (#579). CDReadTOCreturns 0 and keeps no table of contents when reading it fails or there is no memory for it. The original returned -1 and left the track functions reading whatever the table held (#581).CDNumTracks,CDFirstTrack,CDLastTrackandCDTrackLengthreturn 0 beforeCDReadTOC, and with the SCSI flag they read the SCSI table of contents. The original read memory at address 0 there, and with the flag onlyCDNumTracksworked (#582).CDTrackLengthof the last track ends at the end of the CD’s music, and with runtime error checking a track the CD does not hold stops with “Track number out of range”. The original read the last track’s end from memory the table of contents does not fill (Sources that compile differently, #583).CDTrackLengthis right for track 44 and the tracks after it (#585).- With runtime error checking,
CDTrackMinsandCDTrackSecswith an offset other than 0 or 1 stop with “Offset must be 0 or 1”. The original read other memory of the library (Sources that compile differently, #586). CDUpdateInforeturns 0 without an open device. The original returned a meaningless address (#587).CDStatusasks the device for its whole status record. The original asked for a shorter one, and a device that writes the whole record wrote 8 bytes behind the library; on Workbench 3.1 the program then ended with an alert (#948).
Fixes in ricopperfxlib
These fixes concern
ricopperfxlib,
the copper instructions by Reflective Images for the custom space of a
coplist. The fixes of
the results of DoColSplit and CopperAGACol
and of GetCCOffset after CopperResetAdr are
described above.
- A colour split of
DoColSplitthat starts at line 0 starts there. The original first wrote the wait for line 256 that the copper needs for the lines below 255, so the split appeared at line 256, or not at all on a display that ends before it (#588). - With runtime error checking,
DoColSplitandRedoColSplitwith fewer than one line stop with “Colour split needs at least one line”. The original divided by zero for 0 lines and wrote up to 65536 lines over the memory behind the custom space for a negative number (Sources that compile differently, #589). CopperWaitwith anxof 500 or more waits on the line given. The original waited one line later (#591).RedoColSplitwith accoffsetof 16384 instructions or more writes its colours at that place. The original wrote them 64 KB or a multiple of it away, into other memory.GetCCOffsetnever returns such a large offset; only a program that computes the offset itself meets it (#594).- A program run a second time from the editor starts with no custom
space chosen and with the
ColSplitBplcon3value 0. In the original, every command beforeCopperResetwrote into the copper list of the run before, which had been freed, and that run’sColSplitBplcon3value stayed in effect (#1126).
Fixes in ridatatypeslib
These fixes concern
ridatatypeslib,
the datatypes of Workbench 3 for Blitz programs, by Steve Matty for
Red When Excited.
DataTypeOpen opens a file, DataTypeCreate loads it into a datatype
object, DataTypeBitmap reads the size and depth of a picture, and
AttachDataType shows the object in a window. The fix of
a second DataTypeCreate is described above.
DataTypeOpenof a file for which no datatype is found returns 0 and unlocks the file again. The original read a nonsense datatype and kept the file locked, even afterDataTypeClose, so every laterDataTypeOpenof the program failed (#605).DataTypeOpentakes a file name of any length. The original copied it into a buffer of 384 bytes without a limit, so a longer name, even of a file that does not exist, overwrote the library’s data (#604).DataTypeCreatewithout a tag list returns 0 when no file is open, as the form with a tag list does. The original made an object of the file opened last, which was closed since (#601).DataTypeCloseremoves an object that is still attached from its window before it frees it. The original freed it in the window, which then used freed memory at its next refresh, click or close (#599).DataTypeBitmapof an object that is not a picture returns 0. The original returned a value that the command before had left in the library’s buffer, andDataTypeWidthand the other size functions read through it (#598).AttachDataType window,idwithoutDataTypeBitmapbefore reads the picture’s size itself, so the object gets the size of the picture; an object that is not a picture is not attached, and the result is 0. The original attached it at a size of 0 x 0 (#595).AttachDataType window,id,&taglistpasses the program’s tag list on to the object. The original ignored it and took the id for the address of a tag list (#596).AttachDataType window,id,x,y,width,heightpasses the position and the size as given, negative values too. The original could pass huge values made of what other code had left in the registers: a top of 3 reached the system as 1073938435 (#597).AttachDataTypewith a position or a tag list returns 0 when there is no object, as the form without them does. The original passed the object 0 to the system and returned -1, and then refused every furtherAttachDataTypeuntilDetachDataType(#1098).DataTypeModeIDwith a tag list uses the program’s tags after its own three, and leaves the program’s list unchanged. The original wrote its tags over the start of the program’s list and so ignored the program’s tags (#603).DataTypesPalettecopies the picture’s colours, at most as many as the palette object has. The original copied as many as the palette has: a palette larger than the picture’s got the bytes behind the picture’s colours as further colours, and a palette of 0 colours made it write 786432 bytes behind the palette’s data (#606).DataTypesPalettereturns 0, and copies nothing, for an object that has no colours. The original could report success then, and for an object that is not a picture it copied colours from an address left by the command before (#607).- Without datatypes.library, a program that uses the library still closes dos.library, intuition.library and graphics.library at its end; the original left them open, once more with every run (#602).
Fixes in ridebuglib
These fixes concern ridebuglib, the commands by Leading Edge Software that send instructions to the runtime debugger. They act only in a program compiled with runtime error checking.
AddVarTraceandDelVarTracecut a name to the 251 characters that the message to the debugger holds. The original copied a longer name over the library’s own code, and the next of its commands crashed (#613).AddVarTraceandDelVarTracewith an empty name send just the empty name. The original also copied the bytes behind it in memory into the message, up to the next 0 byte (#612).DelVarTraceputs the name where the debugger reads it. The original put it four bytes further on, so the debugger read four bytes left from the previous message as the start of the name and deleted the wrong trace or none (#610).
Fixes in ridisasmlib
These fixes concern ridisasmlib, the 680x0 disassembler by Leading Edge Software. The fix of long lines is described above.
DisAssemble$shows a displacement or offset of 0 as0. The original showed the bytes at memory address 8 instead, which are often nothing, so0(a0)came out as(a0)(#614).DisAssemble$shows aMOVEMwith an empty register list without a stray comma, asmovem.l -(a7); the original wrotemovem.l ,-(a7)(#615).DisAssemble$no longer stops a 68000 with an address error when it follows a string of odd length in an expression, as in"x"+DisAssemble$(a)(#617).InstrSizeis 0 before the firstDisAssemble$of a run, also in a second run from the editor. The original returned the size of the run before (#1170).
Fixes in ridisplaylib
These fixes concern
ridisplaylib,
the unfinished start of a display library by Reflective Images. Its
InitView allocates a copper list that is never shown.
InitViewwrites the moves of the display window and data fetch registers into its list. The original wrote words read from fixed addresses of low memory instead, and two of these addresses are odd, which crashed a 68000 (#889).InitViewsizes the list by the number of colours it is given, and computes the size as a long. The original used the height instead of the number of colours and computed a word, so large values gave a wrong or negative size (#890).- Without enough chip memory,
InitViewreturns 0 and writes nothing. The original wrote its list to address 0, over system memory, and freed address 0 at the end of the program (#888). - At the end of the program the library frees the lists of all
InitViewcalls, also when it could not open graphics.library 39. The original freed only the last list, and only with graphics.library 39 (#891).
Fixes in ridoslib
These fixes concern
ridoslib, the DOS
helpers of Red When Excited: file notification, the list of devices,
volumes and assigns, and splitting a path; the fix of
the text that follows GetPathName and NextDevice
is described above.
- Programs that use the library run on Kickstart 1.x. There
GetFileNameandGetPathNamework, and the commands of file notification and of the device list, which need Kickstart 2.0, do nothing:AddNotify,NotifyPort,CheckNotify,WaitNotifyandGetDeviceListreturn 0,NextDevicereturns "" andDeviceEntryType-1. The original called functions of Kickstart 2.0 at the start of the program, and every program with the library crashed at its start (#1142).
File notification:
AddNotifywith a slot that is in use ends the notification in it first, asRemNotifydoes; the original lost it, so its messages kept coming and it could no longer be ended (#620).AddNotifyreturns 0 when there is not enough memory; the original wrote the file name or the request to address 0 (#619).- A notification that DOS cannot start is freed at once, and the end of the program frees every notification; the original kept such a request in its slot, and at the end of the program could stop freeing before it (#621).
- With runtime error checking,
AddNotifyandRemNotifywith a slot outside 0 to 63 stop with the error “Notify number must be 0 to 63”; the original wrote, ended and freed the library’s data around its table of slots (A notification slot outside 0 to 63, #626).
The device list:
- The end of the program unlocks the device list if
FreeDeviceListwas not called, and a secondGetDeviceListunlocks the list before it locks it again. The original left the list locked in both cases, and every program that wanted to change it, such asAssign, a disk change or mounting a device, waited for ever (#1081). FreeDeviceListwithout a locked list does nothing; the original unlocked it all the same, which made the system raise an alert and left the program’s laterForbidcalls without effect (#623).NextDevicewithout a locked list returns “”; the original returned a string of an unpredictable length (#625).DeviceEntryTypeafterFreeDeviceListreturns the kind of the entryNextDevicereturned last; the original read that entry from the unlocked list, where it could already have been removed (#622).
Splitting a path:
GetPathNamelooks at the first character too, soGetPathName("/abc")andGetPathName(":x")return “/” and “:”; the original returned "" (#624).GetFileNameandGetPathNametake parts of any length; the original overwrote the code of the library with a part of 256 characters or more (#627).GetFileNameandGetPathNamework with paths of 65536 characters or more; the original read only the low 16 bits of their length, so it returned wrong characters andGetPathNamelooked at only part of the path (#628).
Fixes in riencryptlib
These fixes concern riencryptlib, the three-wheel cipher by Reflective Images.
Decryptwithmode1 restores the data for every start position and length. It works out where the wheels stopped from the length, and the original did so without the carry from one wheel to the next: for many start positions and lengths, a wheel came out one step off, and the data stayed scrambled (#629).EncryptandDecryptwith a length of 0 change nothing; the original changed one byte,Encryptthe one at the address andDecryptthe one in front of it (#630).
Fixes in rievallib
These fixes concern
rievallib, the
evaluation of integer expressions in strings by Reflective Images.
ConvToPostFix converts an expression such as 2+6*3 into postfix
form, 2 6 3 * +, and PFEvaluate evaluates that form.
Converting an expression:
ConvToPostFixlooks past spaces in front of a-: after an operator, after(or at the start, as in4* -2or-5, the-is a sign. The original looked only at the character just before it and took the-after a space for a subtraction without a first value, soPFEvaluatefailed with error 1 (#633).ConvToPostFixkeeps a character that cannot belong to an operand, soPFEvaluatereports it as error 4. The original dropped it without an error and split the operand:1,2became the two values1 2, and12x+3gave 15 (#632).- An expression that ends in
.ends there; the original went on converting the memory behind the string (#631).
Numbers and operators:
PFEvaluatechecks the digits of a number: a character that is no digit of its base is error 4. The original took every character for a digit, so12xgave 192,%22 and$g16 (#634).- Negative hexadecimal and binary numbers have their value:
-$10is -16 and-%1is -1. The original read$and%after a-as decimal digits and gave -24410 and -2451 (#643). <is “less than” with sign, as documented and like>. The original’s<meant “less than or equal” without sign, so2 2 <was true and-1 1 <false (#638).*gives the low 32 bits of a product that does not fit into a long; the original also got the low word wrong, so1000000 1000000 *gave -727379962 instead of -727379968 (#639).^is the integer power:3^0is 1,0^5is 0,2^-1is 0, and exponents of any size count. The original returned the base for the exponents 0 and below, 1 for the base 0, and counted only the low 16 bits of the exponent, so3^65538gave 9. 0 with a negative exponent is error 3 “Divide by 0 error!” (#641).PFEvaluateworks with any number of values pending; from 128 values on, the original failed every operator with error 1 “Need 2 arguments for expression!” (#645).
Registers and memory:
PFEvaluateaccepts onlyd0tod7,a0toa7andpcas registers, and any other name is error 4. The original took the character afteraordas the number of the register without a check, sod9ordxread other values of the register block, adat the end read on behind the string, andd01wasd0and the number 1 (#642).- A register inside
{}, such as{d0}, reads the memory at the register’s value; the original mostly failed with error 5 “No close bracket on indirect!” (#637). {address}.band{address}.wread only the byte or the word, also at an odd address on a 68000; the original always read a long, which crashed a 68000 at an odd address (#636).- A program run a second time from the editor starts without the register block, the error number and the indirect address of the first run. The original kept all three, so the registers were read from memory freed at the end of the first run (#1087).
Results and errors:
- An expression that leaves more than one value, such as
1 2or1 2 + 3, is error 4 “No result value!”; the original returned the last value without an error (#635). PFEvaluateof a string of spaces returns 0 with error 4; the original returned an address in the program (#644).PFErrorTextafter aPFEvaluatewithout an error returns “”; the original could return a string of 64 KB or more, depending on what a register held before the call (#640).
Fixes in rifastseriallib
These fixes concern
rifastseriallib,
the fast serial links of Red When Excited. SetIOSize is described in
Changes for existing programs, the results of
InitSerialIO and GetSerial in
Changes you may notice. One bug of SyncSerial
stays (Bugs not fixed yet).
InitSerialIOandSetIOSpeedwork on a 68000. The original used an instruction of the 68020 there and crashed (#647).- A block of 0 bytes in
PutSerial,GetSerial,SyncPutandSyncGettransfers nothing. The original took it for 4 GB (#646). SetIOSpeedtakes the baud rate from its argument alone. The original also used the unused upper half of the register, and could set a wrong rate (#654).FinitSerialIO, also at the end of the program, switches the serial interrupts that were on beforeInitSerialIOback on, so serial.device works again afterwards. The original never switched them on, and wrote to address $9A in low memory instead of the chip register (#651, #648).InitSerialIOsets the library up at every baud rate from 109 to 3546895, andInitSerialIOandSetIOSpeedrefuse another rate. With the original a rate of 1773448 or more left the library “not set up”, so the later commands did nothing, and a rate of 0 divided by zero (#653).DoSerialIO,GetSerial,SyncSerial,SyncPut,SyncGetandCheckSerialdo nothing beforeInitSerialIO. The original ran them on the port,DoSerialIOwith buffers at address 0 (#652).- After
InitSerialIOwith a count of 0 orSetIOSize 0,DoSerialIOwithout an argument transfers nothing. The original exchanged 65536 bytes afterInitSerialIOwith a count of 0, far past the buffers (#1164). - A program run again from the editor starts as the slave and with the
library not set up. The original kept the state of the run before, so
a program that never calls
SetSerialModecould be the master (#1159).
Fixes in rifnslib
These fixes concern
rifnslib, the
library by Reflective Images that prints text in its own FNS fonts into
a bitmap with the processor. The fixes of
the width FNSLength returns and of
characters a font has no glyph for are described
above.
FNSPrintandFNSShadowPrintbeforeFNSOutputhas chosen a bitmap print nothing. The original crashed the machine (#665).InstallFNSreturns 0 for a font of height 0, andFNSLoadreturns -1 for such a font and for a file that is no FNS font. The original took them, and a font of height 0 drew 65536 rows for every character, over the whole clip zone and below it (#663).FNSLoadloads the font into bank 55 plus the slot number of riamosfunclib only when the program has raised the number of banks withBankLimitso that this bank exists. Otherwise it takes the highest free bank below the limit, andFNSUnloadfrees the bank the font is in. The original always took bank 55 plus the slot: with the 50 banks riamosfunclib starts with, it wrote the file into memory at the address 55 plus the slot, over the system’s vectors, and returned -1 (#984).- Characters of 48 and 64 pixel fonts whose top rows lie above the clip zone are drawn as they should be. The original drew the rest of such a character garbled (#656).
- The bottom edge of the clip zone works like its right edge:
ymaxofFNSClipis the first row not drawn in, asxmaxis the first column, andFNSClipOutputsets the zone to match. The guide’s example for a bitmap of 320 x 256 pixels,FNSClip 0,0,320,256, is the whole bitmap. The original drew rows up toymaxitself, so with that example a text at the bottom wrote a row behind the bitmap. A program that gave the last row of the zone asymaxgives one more (#1128). - The underline is clipped at the left edge of the clip zone, like the characters. The original clipped it at the left edge of the bitmap, so it stuck out of a zone that starts further right (#667).
- An underline that lies wholly outside the clip zone draws nothing. The original set one pixel at the edge of the zone (#1130).
- An empty text, or an empty line in a text, is neither underlined, centred nor aligned. The original set one pixel for it when the style was underlined, and centred it moved the position far to the left (#659).
FNSLengthcounts only the low 4 bits of the font number, so 16 is slot 0 again, as with every other command of the library. The original read a font number from 16 on, or a negative one, from memory behind or before the slots and returned a meaningless width (#660).- With runtime error checking,
FNSClipwith anxminoryminbelow 0 stops with “FNSClip zone must not start below 0”, andFNSSetTabwith a size below 1 with “FNSSetTab size must be at least 1” (Sources that compile differently, #664, #666). - A program run a second time from the editor starts with no bitmap
chosen, the slots 1 to 15 empty, and the style, colour, tab size and
clip zone at their start values. The original kept those of the run
before, and
FNSPrintbeforeFNSOutputdrew into that run’s bitmap, which had been freed (#1124).
Fixes in rifxlib
These fixes concern
rifxlib, the bitmap
effects by Reflective Images. The fix of
the result of Derez is described above.
ClearBitmapclears the whole area. The original left the last word of each bitplane’s area as it was and cleared the word in front of the area instead, for anoffsetof 0 the word in front of the bitplane (#668).ClearBitmap,FadeInBitmapandZoomyZoomread the depth of the bitmap alone. The original read it together with the bitmap’s flags, so a bitmap whose flags are set counted as one with hundreds of bitplanes and the program crashed (#670).- With runtime error checking, every command that works through the
bitplanes of a bitmap stops with “Illegal BitMap Depth” for a bitmap
of depth 0 or more than 8,
ClearBitmapandFadeInBitmapwith “Delay must not be 0” for a delay of 0, andZoomyZoomwith “ZoomyZoom needs a bitmap of at least 640 x 32” for a smaller one (Sources that compile differently, #947, #674, #669, #676). - After a
DerezorZoomXYwith a bitmap of depth 0, the next calls count the bitplanes of their own bitmaps. In the original the count stayed wrong for every later call (#675). ZoomXYworks after aDerezwith a value of 3 or more. In the original, such aDerezwrote its table of masks over the first instructions ofZoomXY: after aDerezof 5,ZoomXYcleared a byte somewhere in memory and zoomed nothing (#671).- With runtime error checking,
ZoomXYbefore anyInitZoomXYstops with “ZoomXY needs InitZoomXY”. The original zoomed a bitmap at address 0 and crashed (Sources that compile differently, #1131). - A program run a second time from the editor starts without the
bitmaps and offsets of an
InitZoomXY. In the original, aZoomXYbefore the run’s ownInitZoomXYzoomed with the bitmaps of the run before, which may have been freed (#1127).
Fixes in rigfxlib
These fixes concern
rigfxlib, the
palette and bitmap helpers by Reflective Images. The fix of
FillPalette with an end colour of 0 is
described above.
CPUClson a bitmap without a first bitplane returns without doing anything. The original crashed (#680).CPUClson a bitmap of less than 40 bytes per bitplane, such as one of 16 x 16 pixels, clears only its bitplanes. The original cleared 2.6 MB of memory below each of them (#682).CPUClsclears the whole bitplane also when its size in bytes is odd. The original left its first byte, 8 pixels at the top left (#681).CPUClsreads the depth of the bitmap alone. The original read it together with the bitmap’s flags, so a bitmap whose flags are set counted as one with hundreds of bitplanes. With runtime error checking, a bitmap of depth 0 or more than 8 stops with “Illegal BitMap Depth” (Sources that compile differently, #679).CopyColourwith a negative colour number fails and returns 0, as for a colour beyond the palette. The original copied from or to memory up to 786 KB away from the palette and returned -1 (#678).- With runtime error checking, the functions that read a colour and
PalAdjuststop with a runtime error beforePaletteInfohas chosen a palette, for a colour number the palette does not have, andPalAdjustalso for an end colour before the start colour and for a target palette too small for the colours it writes (Sources that compile differently, #686, #677, #684, #685). SaveCMAPwrites the pad byte that the IFF standard puts behind a chunk of odd length, so a palette with an odd number of colours gives a correct IFF file. The original’s file was one byte short (#687).SaveCMAPof a palette of 0 colours writes a file with an empty colour chunk. The original wrote 192 KB over the memory behind its buffer (#688).- A program run a second time from the editor starts with no palette
chosen with
PaletteInfo. The original kept the one of the run before, and the colour functions andPalAdjustread that run’s freed palette (#1125).
Fixes in rigtmenulib
These fixes concern
rigtmenulib,
the GadTools menus by Reflective Images. A program builds its menus in
a list with GTMenuTitle, GTMenuItem and GTSubItem, removes entries
with GTFreeMenu, and CreateMenuStrip makes a menu strip of the list.
GTMenuItemin the form withUserDatagives the item themutualexcludemask of the call; the original gave it the mask of the item or sub item added before (#692).GTFreeMenuwith an item or sub item number removes that item or sub item. The original decided whether the number was given by the upper half of a register that the compiled program had left as it happened to be, so it could remove the whole item or the whole title instead (#691).GTFreeMenuof a title, and freeing aGTMenuListobject, free the title’s text too; the original kept the text until the end of the program, so a program that built its menus again and again lost memory (#695).- A program that uses the library closes gadtools.library at its end; the original left it open, once more with every run (#690).
CreateMenuStripon a list without titles frees the object’s old strip and returns 0, so a laterGTSetMenuattaches no menus. It also returns 0, with no strip, when GadTools cannot make or lay out the strip. The original read a title from address 0, made a strip of what it found there and returned -1, also when GadTools had failed (#689).GTMenuItemandGTSubItemkeep ashortcut$whose text lies at an address divisible by 65536; the original took it for no shortcut, and the item had no key (#694).- With runtime error checking,
GTFreeMenuwith a negative item number stops with “Illegal Menu Item number”; the original freed the title as if it were an item and damaged memory. A negative sub item number removes the whole item, as in the original (#1089).
Fixes in riintuilib
These fixes concern
riintuilib, the
text output on a bitmap by Reflective Images: IPOutput makes a Rast
object the output channel, so that Print and NPrint draw on its
bitmap.
- Text printed through
IPOutputstarts at the position thatIPLocateset, and the next text goes on after it. The original drew every text at the top left corner of the Rast, over the text before (#697). NPrintthroughIPOutputends the line: the next text starts at the left edge of the next line. The original drew a byte from low memory as a character instead (#699).- A text of 1024 characters or more is drawn whole. The original copied it into a buffer of 1024 bytes without a limit, so it wrote over the pens of the next text and, from 1028 characters on, over the library (#698).
IPColour -1,bgpen, which leaves the foreground pen as it is, sets the background pen of the Rast in use. The original left the Rast’s background pen unchanged and wrote the pen into memory of the program instead (#696).
Fixes in rilesdebuglib
These fixes concern
rilesdebuglib,
the helper library of the REDDebugger program by Leading Edge Software.
The fixes of D_FindVolume’s result and of
ExtractLabel, GetCustomRegAdr and FInverse
are described above.
Memory and registers as text:
- A count of 0 makes
D_HexWord,D_CheckNMove,D_CheckNMoveAandD_CheckNMoveWordwrite nothing, andGetDataItemreads a long for every size but 1 and 2, as its help text says. The original ran the copy 65536 times for a count of 0 and wrote over 300 KB, andGetDataItemwith a size of 0 read 64 KB (#701). - Addresses from $80000000 on are no longer taken for low memory:
D_HexWord,D_CheckNMoveAandD_CheckNMoveWordshow their bytes instead of*, andGetDataItemreads them instead of returning 0 (#717). GetHexAdr$reads a word or long byte by byte, so an odd address works on a 68000. The original stopped there with an address error (#1168).PeekMax$returns at most the number of characters asked for. The original wrote one more and broke the string expression behind it:PeekMax$(&t$,4)+"|"gaveabcde(#718).
The custom chip registers and the copper:
GetCustomRegandGetCustomRegAdrknow the last register, $1FENOOP; the original stopped at $1FC (#702).GetCustomRegof a register with a name of 8 characters returns just that name. The original added the first character of the next name and broke the string expression behind it:GetCustomReg($5A)+"|"gaveBLTCON0LB(#712).GetCustomRegof an offset whose low word is above $1FE gives an empty name. The original read a name from in front of its table of names (#714).GetCopIns$shows the high digit of a horizontal position or mask ofWAITandSKIPwhole:$2C31,$FFFEshows asWAIT (30,2C) MASK (FE,FF) [BFD], where the original showed(20,2C)and(EE,FF)(#711).
The font printer:
- The font printer prints nothing from column 80 on. The original
printed the columns 208 to 255 into the next rows, and drew the
character behind a marker of
FPrintDetokewithout the test. With runtime error checking,FPrint,FNPrintandFPrintDetokestop with an error on a bitmap narrower than 640 pixels or a cursor row outside the bitmap (Sources that compile differently, #707). FPrintprints a string of 32769 characters or more up to the right edge, as a shorter one; the original printed nothing (#710).- The
>marker ofFPrintDetokeis never followed by an inverse space; in the original it was when the column counter ran round to 0 (#708). - With inverse printing on and token names drawn in two bitplanes,
FPrintDetokedraws each character into the second bitplane with its own shape. The original drew another character there (#709).
The parser:
D_InitParsetakes at most 255 characters of its string. The original copied a longer one over the memory behind its buffer (#716).ExtractLabelreturns an empty string for a line without a.behind its first nine characters. The original searched on through the memory behind the line and took the label from there (#703).ProcessStringreturns an empty string beforeD_InitParseand after the last argument ofD_NextArg$. The original read the text at address 0. Its help text no longer names an argument: the command never took one (#719).- A
%at the end of the text ofProcessStringends it; the original read on behind the text (#720). AddProcessPtrkeeps at most 20 codes and ignores more; with runtime error checking a 21st stops with “AddProcessPtr table holds at most 20 entries”. The original wrote the 21st over the code behind its table (Sources that compile differently, #700).
The memory search:
SearchMemwith an empty search string finds nothing and returns 0. The original compared the bytes behind the string with memory (#721).- A word or long search of
SearchMemfinds a value only if it lies wholly in front of the end address. The original also found one that went on behind it (#722). - The string search of
SearchMemfindsabinaab. After a partial match, the original went on behind the mismatch and missed a match that began inside the partial one (#723).
Other fixes:
- A second run of a program from the editor starts the library with its
defaults: the cursor and the inverse printing of the font printer, the
result of
SearchMemFound, the token list ofSetupLESDebugand the codes ofAddProcessPtr. The original kept them from the run before, so a second run printed inverse text after a run that ended withFInverseon, andFPrintDetokebeforeSetupLESDebugread the token list of the run before (#1169). D_FindVolumeworks on Kickstart 1.x: there it reads the list of devices, volumes and assigns in the way Kickstart 1.x knows. The original called functions of Kickstart 2.0, and a program crashed atD_FindVolumeon Kickstart 1.x (#1148).
Fixes in rilinkedlistlib
These fixes concern rilinkedlistlib, the five linked lists of copied variables by Steven Matty. Each item of a list links to the item before and the item after it, and can hold a copy of a variable.
The links of a list:
AddFirstListItemlinks the old first item back to the new one. The original wrote the new item into the old first item’s link to the next one, so that item lost the rest of the list, andNextListItemfrom the first item went back and forth between the two (#724).AddListItemin the middle of a list links the item behind the new one back to it; the original left that link on the old current item, soPrevListItemfrom there skipped the new item (#727).DelListItemof the first item clears the backward link of the new first item; the original cleared its forward link instead, so the list ended at the new first item (#728).
New items and results:
AddFirstListItemreturns -1 on success, as documented; the original returned four times the list number, so 0, the result for a failure, on list 0 (#725).AddFirstListItemclears the new item; the original left whatever the memory held in it, so the item seemed to hold a copy, andPrevListItem,GetListItemandDelListItemused meaningless addresses (#726).- On a list that was never started with
InitList, the commands do nothing and return 0, as documented. OnlyDelListItemchecked this in the original: the others read and wrote memory from address 0 on, andFirstListItemandLastListItemreturned -1 (#733). - With runtime error checking, a list number outside 0 to 4 stops with the error “List number must be 0 to 4”; the original wrote into the other lists and the memory behind them (A list number outside 0 to 4, #732).
The copies of the items:
DelListItemfrees the item with its copy. The original read the copy’s address from the wrong place and freed a wrong address: the program stopped with “Unable to Free Memory”, or crashed without runtime error checking (#729).SetListItemfrees the copy the item held before; the original lost it until the program ended (#734).InitListon a list that is already there frees it first, with the copies of its items; the original lost the old list until the program ended (#731).GetListItemcopies no more bytes than the item’s copy has, and the rest of a larger variable stays as it is; the original filled it with the bytes behind the copy (#730).- The size an item keeps of its copy is right after
AddListItem,AddLastListItemandSetListItem; the original stored the size of the last variable any command had looked at, or kept the old size (#735).
Fixes in rilvcallhooklib
These fixes concern rilvcallhooklib, a render hook by Red When Excited that draws the items of a GadTools listview as columns of texts and bitmaps, with an optional indent drawn as dotted tree lines.
- The tree lines of an indented item depend on its indent alone. The original computed their number with the upper half of a register that the caller of the hook had left, so the lines could be missing, or 65536 lines were drawn for an indent below 16 pixels (#737).
- The last tree line of an item is short when the next item ends the list or has a smaller indent. The original read an unrelated word of the next node instead of its indent, so the line was short or long by chance, and with an odd width of the first field it crashed a 68000 (#739).
- A right-aligned bitmap is drawn at the right edge of its field. The original drew it too far to the right, by the field’s horizontal position, and filled the field with the background pen instead (#740).
- A text field whose pointer is 0 stays empty; the original showed the bytes at address 0 as text (#742).
- After drawing an indented item, the hook puts the line pattern of the RastPort back as it found it. The original set it to solid lines, or left it dotted after an indent of 1 to 15 pixels, which has no tree lines; later lines that the program drew on the same RastPort changed with it. In a GadTools listview the hook gets a RastPort of its own, and the tree lines look as before (#738).
Fixes in rimapeditorlib
These fixes concern rimapeditorlib, the block maps and helpers of Reflective Images’ map editor.
MapCanDrawrefuses negative positions and returns -1 for them. The original let them pass: it read a word far behind the map, compared it, and kept its address forMapCanDrawAddr(#892).- With runtime error checking,
MapDataAdr(x,y)with a position outside the map stops with “Map position outside the map”. The original returned an address in a later row or behind the map (Sources that compile differently, #892). - With runtime error checking,
MapCanDrawbefore anySetStencilstops with “MapCanDraw needs SetStencil”, a cell value of 32768 or more that it looks up in the stencil with “Map value above 32767 for the stencil”, andMapCanDrawandMapDataGrabon a map without data with “MapObject has no map data”. The original read the stencil at address 0 or up to 32 KB in front of it, and the map at address 0 (Sources that compile differently, #893). MapDataGrabfills nothing into a map without data, such as one whoseCreateMapgot no memory or a width or height of 0. The original took the size 0 for 65536 and wrote over all memory from address 0. With runtime error checking,FillBitplanewith a width below 16 or a height of 0 andShapeTo1616from a shape of height or depth 0 stop with a runtime error; the original wrote 65536 words, rows or planes over memory (Sources that compile differently, #895).- With runtime error checking,
ShapeTo1616into a destination that is not 16 by 16 pixels with at least the depth of the source stops with “ShapeTo1616 needs a 16 x 16 destination as deep as the source”. The original wrote 16 rows for every plane of the source into any destination and overran a smaller one (Sources that compile differently, #900). - With runtime error checking,
CreateMapwith a width above 32767 stops with “Map width above 32767”. The original gave such a map far too little memory, andMapDataGrabwrote behind it (Sources that compile differently, #1152). CreateMapfrees the map the object held wherever its data lie. The original did not free a map whose data began at an address that is a multiple of 65536, and that memory was lost (#894).MapDataGrabwith one byte per cell gives each cell its byte plusmapnull. In the original, a byte plusmapnullabove 255 added 256 to all following cells (#898).MapObjName$returns a name of 256 characters or more whole. The original returned only as many characters as the length modulo 256 (#899).M_InitParsetakes at most 255 characters and cuts a longer text. The original copied it whole into its buffer of 256 bytes, so a text of 256 characters or more overwrote the library’s data behind it, and one of 260 or more its code (#897).- A program run a second time from the editor starts without a stencil,
without the results of
ScanShapes, and withM_NextArg$giving an empty string beforeM_InitParse. The original kept them from the run before, and its stencil had been freed (#1133).
Fixes in rimapshapeslib
These fixes concern rimapshapeslib, the map shapes and groups of Reflective Images’ map editor.
- Programs with the library run on Kickstart 1.3. The original allocated its memory with a function of Kickstart 2.0, and every program with it crashed at its start (#1141).
BlitGroupcalls the graphics library itself. The original called whatever library the command before had left in the register for it, so it worked only after a command that left the graphics library there (#902).AddGroupMemberbefore the firstResetGroupadds to the empty group. The original wrote the member at address 0, over the pointer to exec at address 4 (#901).- Without memory for the group at the start of the program,
ResetGroupreturns 0 and does nothing, andAddGroupMemberandBlitGroupdo nothing. The original wrote the group at address 0 (#905). - A group holds at most 63 members, and
AddGroupMemberignores further ones; with runtime error checking a 64th member stops with “Group holds at most 63 members”. The original wrote them behind the memory of the group (Sources that compile differently, #904). - With runtime error checking,
ShapeToMapShapeof a shape of depth 0 or more than 8 stops with “Illegal Shape Depth”. The original wrote 65536 plane pointers over memory, or into the next map shape (Sources that compile differently, #903). - Without map shapes, before
SetNumMapShapesor after one that got no memory, the map shape commands do nothing andMapShapeAddrreturns 0. The original took the map shapes at address 0 and wrote over the memory there. With runtime error checking, a map shape number beyondSetNumMapShapesstops with “Map shape not allocated by SetNumMapShapes”, and aBlitMapShapeSizewider than the map shape with “BlitMapShapeSize wider than the map shape” (Sources that compile differently, #906). - A program run a second time from the editor starts with an empty
group. In the original,
AddGroupMemberbeforeResetGroupadded to the group of the run before, which had been freed, with that run’s block size (#1134).
Fixes in rimisclib
These fixes concern
rimisclib, the
miscellaneous commands of Reflective Images and Steve Matty; the fixes
of NextArg$ and of
the text that follows a string function
are described above.
WorkbenchHereworks: it returns -1 if the title of an open screen contains “Workbench”, and 0 if none does. The original had four faults:- It searched a list of screens at whatever address a register of the processor held (#759).
- It did not stop at the end of the list, so it never returned 0 and could hang (#761).
- It hung on a title that ends with the start of “Workbench”, such as “My Work” (#762).
- It missed “Workbench” behind another “W”, as in “A Window on Workbench” (#760).
- Negative Quick and Float arguments of
EZRequestandEZRequestArgsshow their whole part, -3.5 as -3, asIntgives it; the original showed -3.5 as 65532 (#750). - Float arguments of
EZRequestandEZRequestArgsare converted by the library itself; the original called the conversion of the maths library through whatever library base the program happened to hold, so the value shown depended on what the program had done before (#749). EZRequestArgswith a shorter text than the call before shows only its own; the original kept the end of the text before behind it (#747).- With runtime error checking,
EZRequestandEZRequestArgswith more arguments than fit into their 16 longs stop with the error “Too Many EZRequest Arguments”; the original wrote the rest over the code of the library (EZRequestandEZRequestArgswith too many arguments, #748). EZRequest,EZRequestArgs,ProgPath$,ProgDir$andProgName$work on Kickstart 1.x. The original called functions of Kickstart 2.0 in them and crashed there. On Kickstart 1.x:- The requester is the older system requester. It has one or two gadgets and no title; the results are the same as from Kickstart 2.0 on. With more than two gadgets no requester appears and the result is 0, and with runtime error checking the program stops with the error “More than two EZRequest gadgets need Kickstart 2.0”.
ProgDir$is the current directory, andProgName$is taken from the command the Shell started the program with, or is the name of its task without a Shell. A program started from another directory, with a path in front of its name, thus gets the current directory, not its own (#1150).
Flip$of an empty string or of one character returns it unchanged; the original exchanged 65536 pairs of bytes around the string and overwrote memory (#751).InitArgParsecopies at most 255 characters and cuts off the rest; the original copied a line of any length into its 256 byte buffer and overwrote the code of the library behind it (#752).NextArgChar$beforeInitArgParse, or after the end of the text, returns “”, asNextArg$does; the original read from memory address 0 on (#754).ProgPath$of a program whose directory has no name that can be found is the program’s name alone; the original put a “/” in front of it (#758).OpenFontPrefsreturns 0 when there is not enough memory for the file; the original read the file to address 0, over the first bytes of memory that the processor and the system need (#756).- A second
OpenFontPrefsfrees the memory of the first; the original lost 16 KB each time until the next reboot (#757). DefaultFontHeightandDefaultFontNamelook only at the font entries of the preferences file, and return 0 or "" for a font type the file does not set; the original also searched the memory behind the file and could return a value from leftover data there (#745).ASCRawof a code outside 0 to 113, such as the code of a key being released, gives the character 0, andRawASCof a character that no key types, or of “”, gives -1. The original read the bytes before or behind its table of keys and gave a meaningless character, andRawASCsearched on through memory until it found the character, or for ever (#744).
Fixes in rinonvolatilelib
These fixes concern
rinonvolatilelib,
the access to the system’s nonvolatile.library by Reflective Images; the
fix of the result of StoreNVData is described
above.
StoreNVDatastores an item of 655360 bytes or more with its whole length; the original passed a wrong, much smaller length to the system, and 655365 bytes were stored as 60 bytes without an error (#764).
Fixes in ripacklib
These fixes concern
ripacklib, the
library by Reflective Images that unpacks IFF ILBM pictures in memory
into bitmaps and palettes, packs and unpacks ByteRun1 data and unpacks
Pack-Ice files. The fixes of
ILBMPalette with an offset, of
LoadIFF’s bank and result and of
pictures whose width is no multiple of 16 are
described above.
UnpackIFFandILBMPalettefind the chunks of a picture by walking the IFF file from chunk to chunk, also behind large chunks such as a long annotation, and no longer take the name of a chunk inside other data for the chunk itself. The original searched the raw data, only within about 5 KB, and missed chunks further on (#766).UnpackIFFreads the compression byte of the picture: an uncompressed picture is copied as it is. The original unpacked every picture as ByteRun1, so an uncompressed one came out as garbage (#773).UnpackIFFunpacks pictures wider than 1024 pixels. The original counted the bytes of a row in a byte: such pictures were not unpacked, or read out of step, though the command reported success (#774).UnpackIFFcuts a ByteRun1 run at the end of the row. The original wrote the whole run, into the next row or, in the last row, behind the plane (#776).UnpackIFFrefuses a picture whose header gives 0 planes and returns 0. The original took it as 256 planes and overwrote its own code (#777).UnpackIFF,LoadIFFandILBMGrabunpack pictures saved with a mask, such as brushes of DPaint, correctly. The original took the mask row of every line for the next plane and shifted every line from the second on (#1112).ILBMPalettewith an offset on a palette that has no colours yet makes it as large as offset and CMAP together. The original made it as large as the CMAP and still wrote the colours at the offset, from an offset of 2 on behind the palette’s memory (#991).ILBMPaletterefuses a CMAP chunk without a whole colour and returns 0, and it sizes the palette from the whole CMAP. The original wrote 65536 colours for such a CMAP, and took the size of a CMAP of 64 KB or more from its lower 16 bits (#1105).PackPBMreturns -1 for data that does not pack smaller; the destination holds the bytes packed up to that point. The original then went on to unpack whatever lay at the start of memory into the destination (#772).UnPackPBMwrites no byte pastdestlengthand reads none past the end of the packed data. The original wrote one byte past the destination’s length and read one byte behind the data (#778).DeIcewith data packed with the picture option of Pack-Ice converts the number of groups of 8 bytes that the data give, at most the unpacked data. The original converted at least 15361 groups and so wrote over 120 KB of memory below the end of the unpacked data (#767).
Fixes in riregistrylib
These fixes concern
riregistrylib,
the interface of Red When Excited to registry.library, a settings
database that is not available any more; the fix of
the text that follows its string functions
is described above. LockRegistry locks a registry structure and makes
it the current one, on which the other commands work; locks can be
nested, and UnlockRegistry returns to the one before.
UnlockRegistrywithout a lock does nothing, and a 16th nestedLockRegistryreturns 0. The original had no limit in either direction:UnlockRegistryread and wrote below its list of locks, and a 16th lock was written over the library’s own data. As registry.library cannot be found,LockRegistrylocks nothing, so in the original everyLockRegistryandUnlockRegistrypair went one entry lower, and the program crashed after a few of them (#781).GetLibraryValue$andGetRegistryStringVariablewithout a locked structure return “”; the original read the type and the value near address 0, which it did for every call without registry.library (#780).- A program run again from the editor no longer works on the structure the run before had unlocked at its end (#779).
SetRegistryVariable name,value$passes the length of the string as the size,SetRegistryIntVariableandSetRegistryBoolVariablepass 4; the original passed whatever value the program had left in a register (#782).
Fixes in rireqlib
These fixes concern
rireqlib, the file
and colour requesters of req.library, a requester library that is not
part of AmigaOS, by Steven Matty; the fixes of
the text that follows ReqFileRequest
and of its default flags are described
above.
ReqFileRequestreturns the path of the file the user chose. The original never gave the requester the library’s buffers for the directory, the file and the path, so it returned only what the program itself had written to the path buffer atReqFileLoc, or an empty string (#785).- The library reserves req.library’s whole file requester structure. The original’s was too short, so the fields that the requester keeps there from call to call were written over the library’s data behind it, among them the addresses of its buffers and the colour requester (#1088).
- A title given to
ReqFileRequestis for that call only; a later call without a title passes the library’s empty title, as before the first call with one. In the original such a call showed whatever text had been put since in the memory where the earlier title had been. The flags ofReqFileRequest(title$,flags)stay set for later calls, as the guide documents (#789). - Without req.library,
ReqFileRequestreturns an empty string andReqColour65535, the same as when the user cancels; the original crashed the system (#788). ReqColouropens the colour requester on the colour it is given, together with the fix of the next point; the original ignored it and started on colour 0 (#786).ReqColourhands req.library the colour and the window ofReqOutputat the places where req.library reads them. The original’s colour requester structure had another layout, so with req.library the requester started on the wrong colour and, afterReqOutput, did not open at all and returned 16387 at once (#1091).- A program run a second time from the editor gives the file requester
no window until it calls
ReqOutputagain, the same as the colour requester. The original passed the window of the first run, which was closed when that run ended (#1090). - When a program ends, the library has req.library free the directory
that the file requester keeps cached between calls. The original left
that memory allocated after every run, as much as the last directory
shown needed (with req.library 2.8, for example, 1560 bytes for
SYS:C). About 40 KB that req.library itself allocates for its first file requester stay allocated until the system restarts; that is req.library’s own behaviour, with any program that uses its file requester (#1092).
Fixes in riseriallib
These fixes concern
riseriallib,
the serial port with interrupts of its own. SerialGot is described in
Changes for existing programs, the block commands
in Changes you may notice, and text after
SerialReadString in
Text after a string function.
SerialCloseswitches only the library’s two serial interrupts off and back to their state atSerialOpen. The original switched every interrupt off and then on those that were on atSerialOpen, so an interrupt switched on since was lost and one switched off since came back (#790).SerialReadandSerialWaitreturn the byte alone, 0 to 255, or -1 for none. The original left the upper bits of the result as they were before the call, so a byte could read as any large number or as -1 (#797).SerialSendBlockwith a length of 0 or less sends nothing. The original sent one byte (#800).SerialReceiveBlockwith a length of 1 receives one byte. The original never ended and wrote past the buffer (#799).SerialStopduringSerialReceiveBlockends the block after the next byte, and the program goes on after the command. The original returned to a wrong address (#803).- A
SerialStopwhile no block is sent or received no longer cuts the next block short. The original stopped the nextSerialSendBlockafter its first byte (#1162). SerialSendStringsends the characters of the string, without a 0 byte behind them; send one withSerialWrite 0if the other machine reads withSerialReadString. The original sent the low byte of the string’s address (#801).SerialSendStringandSerialReadStringopen the port when it is closed. The original did so only when it was open: with the port closed it sent nothing, or waited for ever (#793).SerialReadStringwith the port open returns to the program. The original returned to a wrong address (#796).SerialReadStringstops at the end of the string work area, 10240 bytes unless the compiler options set another size, and leaves the rest in the buffer. The original wrote on past it until a 0 byte came (#1161).SerialReadLongreads four bytes, the low byte first, and returns the long. The original never returned (#794).SerialWriteLongsends the four bytes of its argument, the low byte first. The original sent the low byte and then three times the byte 1 (#805).- When more than 255 bytes arrive unread, the first 255 stay in the buffer and the others are dropped. With the original the buffer then counted as empty, and all of them were lost (#1160).
SerialWrite, and soSerialSendBlock,SerialSendStringandSerialWriteLong, waits for room while the transmit buffer is full and the port is open, so a long block arrives complete. The original wrote over bytes not sent yet, and a block of more than about 128 bytes lost some of them (#983).SerialOpeninstalls its interrupts in the vector table the processor uses, also when a 68010 or later has it moved. The original wrote them at the fixed addresses in low memory, where they were then never called (#804).
Fixes in rishapeslib
These fixes concern
rishapeslib,
the shape helpers by Reflective Images with their own shapes file, the
LE shapes file: LESaveShapes writes it, LELoadShapes loads it from
disk and LECludgeShapes decodes one in memory; CludgeShapes makes
shapes from memory in the form SaveShapes writes. The fix of
shapes linked by an earlier LECludgeShapes is
listed under Other fixes.
CludgeShapestakes a shape in memory whose data size is 0 as an empty shape. The original copied 64 KB for it and overwrote memory (#808).CludgeShapesreads the shapes behind an empty shape in memory from the right place. The original skipped the empty shape by 32 bytes plus the data size of the shape before it (#809).LELoadShapes,LECludgeShapesandLEInitShapefree the cookie of the shape they replace, so loading shapes again does not use up chip memory (#810).LECludgeShapesfinds the shapes of LE files whose header chunk is longer than the library’s own, or whose palette chunk has a pad byte. The original took fixed sizes for both and missed the shape data (#811).LECludgeShapesdecodes LE files whose palette has an odd number of colours, asLESaveShapeswrites them, on a 68000 too; such shapes are copied into chip memory instead of being used where they are. The original crashed a 68000 with a Software Failure, and on a 68020 it used the shapes at an odd address, where the blitter cannot draw them (#1118).- Loading LE shapes with a palette leaves the palette as it is for a palette chunk shorter than one colour. The original wrote 65536 colours, 768 KB, over memory (#820).
LESaveShapeswrites the palette whenever one is given. The original wrote it or not depending on the flags the system’s write routine left behind (#814).LESaveShapeswith a palette of 0 colours writes no palette. The original copied 65536 colours and overwrote 192 KB of memory (#823).- Files written by
LESaveShapesgive the right length in their IFF header, so other IFF readers see the whole file. The original wrote a length 8 too large, and after a save with a palette also counted that palette in a later save without one (#816). LESaveShapesasks for 12 bytes for its shape header. The original could ask for up to 4 GB, depending on what a register held before (#817).LESaveShapestakes the number of shapes from the lower 16 bits of the shape numbers, as they are words. The original used all 32 bits:LESaveShapes 0,awith a long variableaof$50009, shape 9 in its lower 16 bits, wrote a file that claimed 327689 shapes (#815).- A program run a second time from the editor starts with
LEAutoCookieon and the values ofLEMaxShapeWidth,LEMaxShapeHeightandLEMaxShapeDepthat 0. The original kept those of the run before (#1109).
Fixes in risnowlib
These fixes concern risnowlib, the falling snow of Reflective Images.
- With runtime error checking, every snow command with a field number
outside 0 to 3 stops with “Snow list number must be 0 to 3”,
LDoSnow,LDoSnowActivateandKillPointon a field withoutInitSnowDropwith “Snow list needs InitSnowDrop”, andKillPointoutside the bitmap with “KillPoint outside the bitmap”. The original read and wrote outside the library’s table, at address 0 or around the bitmap (Sources that compile differently, #913). InitSnowDropwith 1024 points or more allocates enough memory for the field’s lists. The original computed the size in 16 bits, got a block far too small and wrote the lists behind it (#912).LDoSnowActivatebefore the firstLDoSnowof a field works on the field’s lists. The original wrote its entries to address 0 (#908).- A second
LDoSnowActivatebefore the nextLDoSnowkeeps the snow the first one let fall. In the original it overwrote those flakes, and they vanished without falling (#909). InitSnowDropof a field that is already set up frees the field’s old lists. The original lost their memory until the end of the program (#911).LDoSnowtakes the bit of a new flake from the random table modulo 8. In the original, a flake whose bit was above 7 looked up its moves in the wrong place and could jump through memory, up to 32 KB away, every frame again (#910).- The lists of a field take no more flakes than they have room for:
LDoSnowadds no new flake to a full list,LDoSnowActivateleaves settled snow where it is when the list of falling snow is full, andKillPointdoes nothing and returns 0 when its list is full. In the original, a field whose flakes piled up ran over into the next field’s lists, and the last field behind its memory (#914). - A program run a second time from the editor starts with no field set
up. In the original, a snow command before
InitSnowDropworked on the lists of the run before, which had been freed (#1135).
Fixes in risortlib
These fixes concern risortlib, the sorting of linked lists by a string field of their items by Reflective Images.
StringSortandStringSortItemwithSortPriorityOffsetsort the list by priority. After the original had exchanged two items because of their priority, it compared the following items with the wrong string and the old priority, so the list came out unsorted (#826).StringSortandStringSortItemwith asizeof.typeof 0 exchange nothing and return 0; the original exchanged 65536 bytes per exchange and overwrote the items behind and the memory behind the list (#827).- Without
SortPriorityOffset, the sorts no longer read a priority from an odd address, which stopped a plain 68000 with an address error (#825). - A program with risortlib no longer crashes at its end on Kickstart 1.x, which has no utility.library; the original closed the library without checking that it had opened it (#824).
Fixes in risoundlib
These fixes concern CludgeSound of
risoundlib,
which makes a sound object of an IFF 8SVX file in memory. The second
sound library,
risoundlib2,
has the same command with the same fixes. Two more fixes of
CludgeSound are in Other fixes.
- The sample rate comes from the rate field of the file’s header chunk, whatever the length of that chunk. The original read it at a place that is the rate only when the header chunk has the usual 20 bytes (#832).
- A file with a sample rate of 0 gives the result 0. The original hung (#830).
- The search for the sample data skips the pad byte that IFF puts behind a chunk of odd length, and stops at the end of the file’s FORM. The original went on one byte too early behind such a chunk: it missed the sample data of a correct file, or ran into the data of the file or past it. A file written without the pad bytes, which is no valid IFF file but loaded with the original, gives the result 0 (#828).
- A
CludgeSoundthat fails on the file leaves the sound as it was. The original freed the old sample first and left the sound pointing to the freed memory, so the nextCludgeSoundof that sound stopped with “Unable to Free Memory” (#831). - The whole sample is copied, up to 131071 bytes; an empty sample and
one of 131072 bytes or more give the result 0, since the length field
of a sound object cannot describe more;
LoadSoundrefuses such a sample too. The original copied only a part of a sample of more than 64 KB, and for an empty one wrote 64 KB into a block of 8 bytes (#829).
Fixes in risoundlib2
These fixes concern
risoundlib2,
the second sound library of Reflective Images, with its commands for
sound output through AHI. Its CludgeSound also has the fixes in the
list Fixes in risoundlib.
OpenAHIremembers the device it opened, soPlaySoundAHIandPlayRawAHIplay through AHI,CloseAHIand the end of the program close the device, and a secondOpenAHIreturns 0 while the device is open. In the original none of this happened: the two play commands returned at once and played nothing, the device was never closed, and a secondOpenAHIopened it again (#924).OpenAHIworks again afterCloseAHI:CloseAHIcloses the device and keeps the library’s request for the nextOpenAHI. The original’sCloseAHIfreed the request, and a laterOpenAHIwrote to memory address 48 and called the device without a request (#927).- A sound that
PlaySoundAHIsent and that still plays is stopped by the nextPlaySoundAHIorPlayRawAHI, byCloseAHIand at the end of the program, and the library takes its request back. The original sent its one request again while AHI still held it (#933). PlaySoundAHIplays the whole sample. The original gave AHI the length in words as the length in bytes, which would have played the first half (#932).CludgeSoundof this library writes nothing behind the sound object, andPlaySoundAHItakes the pitch from the sound’s period, the pitchSoundplays it at. The original stored the sample rate over the start of the next sound object, which damaged that sound’s sample address (#926).AHIOutputRequestgives the requester the position, size, audio mode and frequency it is called with. The original wrote width, height, mode and frequency into the wrong places of the requester’s settings, and a mode of 0 ended them early (#931).- The forms of
AHIOutputRequestwith 1, 2 and 4 arguments take the audio mode, the mode and the frequency, and the position and size. The original ran the code of another form for each, so their arguments were lost or taken as other values (#928). AHIOutputRequestopens the requester on the screen the program uses. The original never told AHI the screen (#929).AHIRequestedIDandAHIRequestedFreqreturn the audio mode and the frequency the user chose in the last requester confirmed. The original returned the values the requester started with (#934).AHIOutputRequestfrees its requester again after each call. The original made a new one for every call and never freed one (#930).- Programs with the library start on Kickstart 1.x, where the AHI
commands do nothing and
OpenAHIreturns 0. The original called functions of Kickstart 2.0 there and crashed at the start (#1139).
Fixes in ristonecrackerlib and ristcdecrunchlib
These fixes concern the two libraries by Reflective Images for data
files packed with StoneCracker 4.04:
ristonecrackerlib,
which tells the sizes of such a file and loads and unpacks one with
STCLoad, and
ristcdecrunchlib,
whose STCDecrunch unpacks one in memory. Both use the same unpacking
code.
STCDecrunchandSTCLoadwrite nothing below the destination for damaged StoneCracker data; such data give 0. The original wrote a piece of the data past the start of the destination, into the memory below, and could crash the machine (#833).STCLoadreturns 0 for a file that is not, or not wholly, a StoneCracker 4.04 file, and for one it cannot read. The original unpacked whatever it had read and could write anywhere in memory (#836).STCLoadreleases the lock of the file once. The original released it a second time after closing the file, on every load that worked (#835).STCLoadworks on Kickstart 1.x: it opens the file by its name, which works on every Kickstart. The original opened it with a function of Kickstart 2.0, and a program crashed atSTCLoadon Kickstart 1.x (#1147).- ristonecrackerlib closes dos.library at the end of the program. The original left it open, one more time after every run (#834).
Fixes in rithreadlib
These fixes concern rithreadlib, the threads of Reflective Images: parts of a program that run as DOS processes of their own.
- Two
CreateThreadin a row start each thread with its own code, registers and memory. The original handed them over in single variables, which a thread read only when it began to run, so a secondCreateThreadbefore that gave both threads the second one’s code and memory (#838). - At its end, the program waits until no thread runs any more. The original waited only once: after all threads had ended once and new ones were started, it could end while they still ran in its freed code (#837).
CreateThreaddoes not count a thread that could not be started for lack of memory, soActiveThreadsstays right; with the original, the program could hang at its end, waiting for that thread (#1086).- The end of the program frees the signal the library takes at its
start. The original kept it, so after 15 runs from the editor, or
from the same shell,
CreateThreaddid nothing (#839).
Fixes in ritooltypeslib
These fixes concern
ritooltypeslib,
the icon commands of Reflective Images; the fixes of
PutIconObject and
SetToolValue are described above.
GetIconObjectworks on Kickstart 1.x. There a file without an icon gives 0, since icon.library of Kickstart 1.x has no default icons. The original called a function of Kickstart 2.0 there and crashed, hung, or loaded a garbage icon that crashed later (#1149).- An icon can have any number of tool types:
GetIconObjectandNewToolTypemake room for them, and return 0 when there is no memory for it. The original had room for 100 entries, and an icon with more tool types, or a 100thNewToolType, wrote behind the list (#855). PutIconObjectfrees the memory of the icon it has written, asFreeIconObjectdoes; the original kept it until the next reboot (#850).FindToolType tooltype$with one argument never finds a switched-off(tooltype$); the original also found it, and returned 1, after an earlierFindToolTypewithbracket_checkhad ended before its search for the brackets (#843).FindToolTypewithbracket_checktakes a name of any length; the original wrote a name of more than 253 characters behind its buffer (#842).FindToolValuereturns the whole value, also when it holds a); the original cut it at the first), soPAREN=a)bgavea(#844).SetToolValueandNewToolTypewith an empty name make the tool type=value; the original copied the bytes behind the name into it, and the tool type read back as empty (#841).SetToolValue,NewToolTypeandIconDefToolfree their new string and return 0 when the icon’s list of memory to free cannot take it; the original freed memory at address 0 instead and lost the string (#840).SetIconTypewithout a loaded icon returns 0; the original returned its argument, which a program took for success (#852).IconToShapecopies only the data the shape has room for; with an image whose width is a multiple of 16, the original copied one word per line too many and wrote behind the shape’s data (#847).ShapeToIconwith two shapes makes the selected image show all bitplanes of the shape; the original set it up to show none of them (#854).ShapeToIconmakes the icon’s image show the bitplanes of the shape; the original kept those of the icon’s old image, so a shape of another depth was drawn with planes it does not have, read from the memory behind it, or without some of its planes (#1083).
Fixes in ritrackdisklib
These fixes concern
ritrackdisklib,
the sector access to floppy disks of Red When Excited. OpenDisk
without a device name is described in
Changes for existing programs, DiskMotor in
Changes you may notice.
- Programs that use the library start on Kickstart 1.x. The library builds its message port and its requests itself, with functions that every Kickstart has; the original called functions of Kickstart 2.0 there, and every program with the library crashed at its start (#941).
- On Kickstart 1.x,
ReadSector,WriteSector,FormatTrack,BootProgandWriteBoot unit,bootdatamove a buffer that is not in chip memory through a chip memory buffer of the library, one track at a time; without chip memory for it they send nothing and return 31. trackdisk.device of Kickstart 1.x reaches only chip memory: given another buffer, it wrote unrelated chip memory to the disk, or read the sectors into it, and reported success. The original never got so far, since it crashed at the start on Kickstart 1.x (#1163). BootProgstores the checksum that Kickstart checks, so a disk with the boot block boots. The original calculated it wrongly (#856).FormatTrackwithout a count formats one whole track, and both forms ofWriteBootwrite the boot block. The original gave trackdisk.device a length it refuses, so these wrote nothing. The count ofFormatTrackstays a number of sectors: only multiples of 11 work, 11 for each track, and the buffer holds 5632 bytes per track (#858).WriteBoot unit,bootdatawrites the 1024 bytes atbootdata. The original wrote from an address that happened to be in a register (#864).WriteBoot unitwrites a bootable standard boot block and keeps the file system type of the boot block on the disk. The original wrote 8 bytes of a boot block and 1016 bytes of whatever memory followed them (#865).MotorOfffirst writes the sectors that trackdisk.device still holds in its track buffer to the disk, andCloseDiskand the end of the program switch the motor off the same way. The device writes that buffer only when it moves to another track, so with the original the last track written, afterBootProgandWriteBootthe boot block itself, was lost when the disk was taken out. A program that keeps the motor running until the disk is changed still loses it (#1154).OpenDisk unit#,devicename$gives the name to the system as it is. The original copied it into a buffer of the library, and a name of 57 characters or more overwrote the library’s data (#860).OpenDiskwith a negative unit returns 0. The original opened the device and then lost the request, which stayed open (#861).OpenDiskof a unit that is already open returns 0 and leaves the unit as it is. The original opened it a second time and lost the first request, which stayed open (#862).- The end of a program closes unit 3 too, and a program run again from the editor starts with all four units closed. The original left unit 3 open (#863).
Fixes in riwbspritelib
These fixes concern
riwbspritelib,
the hardware sprites of Reflective Images on the Workbench screen. The
changed results of GetWBSprite and MoveWBSprite are described in
Changes you may notice.
- The Workbench sprite commands work on Kickstart 1.x and 2.x, with
sprites 16 pixels wide in up to 3 colours, made of a shape of 1 or 2
planes. As on Kickstart 3.0, the width of the shape is rounded down to
16: a shape 20 pixels wide makes a sprite, one of 32 pixels or more is
refused, and with runtime error checking it stops with “Shape too big
for a sprite below Kickstart 3.0”. The original called functions of
Kickstart 3.0 there and crashed at the first
GetWBSprite(#1151). ChangeWBSpritefrees the new sprite image when the system refuses the change. The original lost a block of chip memory each time, until the next reboot (#915).- A sprite made of a shape whose width is no multiple of 16 shows the left part of the shape, as wide as the sprite: the width of the shape rounded down to a multiple of 16, so 16 pixels of a shape 20 pixels wide. The original copied the rows of such a shape out of step, so its image was sheared and its colours were wrong (#918).
- With runtime error checking, every sprite command refuses a channel
outside 0 to 7 (-1 to 7 for
GetWBSprite) with “Sprite channel must be 0 to 7” or “Sprite channel must be -1 to 7”. The original read and freed the library’s own data as sprites (Sources that compile differently, #916). - With runtime error checking,
GetWBSpriteandChangeWBSpriterefuse a shape of height 0 with “Illegal Shape Height” and one of depth 0 or more than 8 with “Illegal Shape Depth”. The original would copy 65536 rows or planes (Sources that compile differently, #917). - With runtime error checking,
WBSpriteXandWBSpriteYof a channel without a sprite stop with “No sprite on this channel”. The original returned words from low memory (Sources that compile differently, #922).
Fixes in rizonejoylib
These fixes concern
rizonejoylib,
the zones and joystick commands by Reflective Images. The fixes of
NewZoneTable, of
circular zones and of
zones above the top of the screen are described
above.
NewZoneTable,UseZoneTableandFreeZoneTablerefuse a negative table number. The original took -1 for the entry in front of its list of tables:UseZoneTable -1chose a table that was none, andFreeZoneTable -1andNewZoneTable -1freed the current table and went on using it (#872).ZoneInitandSetZonerefuse a negative zone number. The original wrote such a zone in front of the zone table, over the number of zones the table holds and the memory before it (#873).SetZoneandZoneInitreach every zone of a table of more than 8192 zones. In the original, zone 8192 was zone 0 again, and every zone above it the one 8192 below (#878).ZoneTestfrom zone 256 on tests the zones it is asked for. The original took the number modulo 256 for the zone it tested and reported it under the number asked for:ZoneTest(260,5,5)tested zone 4 and returned 260. In a range, a negative start zone counts as one beyond the table, the last zone, and a negative end zone gives -1 (#881).- In the 68000 mode,
ZoneandZoneTestfind points in zones more than 32767 pixels wide or high. The original missed them: a zone from y -32768 to 32767 did not contain the point 5,-1 (#879). GetZoneX1,GetZoneY1,GetZoneX2andGetZoneY2return the values of a zone also in small tables, and -1 for a zone beyond the table or without a table. The original did not check the zone number, returned -1 for every zone fromGetZoneY1in a table of up to 4 zones, fromGetZoneX2in a table of 2 and fromGetZoneY2in a table of up to 6, and read address 0 without a table (#870).- When there is no memory for zone table 0 at the start of the program,
SetZonereturns 0 (False) andZoneTablereturns 0. The original returned -1 for both, as if the zone had been set and as if -1 were the address of a table (#876). FreeZoneTableremoves the table it frees from the library’s list. The original left it there:UseZoneTablestill chose the freed table, and the end of the program freed it a second time, in every program that usedFreeZoneTable(#868).- When
NewZoneTablereplaces a table and then gets no memory for the new one, the table of that number no longer exists: the result is 0, and if it was the current table, table 0 becomes the current one. The original kept the freed table in its list, whereUseZoneTablechose it and the end of the program freed it again (#874). NewZoneTableaccepts a table of one zone, as the guide allows. The original refused it and took 2 to 65535 zones (#1136).- A program run a second time from the editor starts with zone table 0
alone. The original found the tables of the run before, which had
been freed:
UseZoneTablechose them, and the end of the program freed them again (#871). - A program run a second time from the editor starts with the reading
of the four player adaptor switched on, as the guide says. After a
JAdaptorStatus Off, the original started the next run with it off (#1132).
Other fixes
Each point says first what the original did and then what the port does.
AddAppIconset the base of the local variables to 0: inside a Statement or Function the local variables used after the command were read and written in the wrong place, and the procedure crashed when it returned. Used as a function in a string expression, it also let the rest of the expression be written into the data of the icon. Local variables and string expressions work afterAddAppIcon(#516).RIAnimInit,RIAnimDepth,RIAnimWidthandRIAnimHeightcrashed on some data that is not aFORM ANIM, such as an IFFLISTof typeANIM; they return normally, and for such aLISTRIAnimDepthreturns 0 (#513).LELoadShapesandLECludgeShapesinto shapes that an earlierLECludgeShapeshad linked into memory read the shape from a wrong place and ended early without closing the file, and a second such shape crashed the program; such a shape is replaced like any other (#807).CludgeSound, in both sound libraries, on a sound thatDecodeSoundmade from data in chip memory stopped the program with “Unable to Free Memory”, because it freed memory that no library had allocated; that memory is left alone (#945).CludgeSoundof the second sound library kept the mark by whichDecodeSoundkeeps such data from being freed, so the copy of the sample it makes was never freed before the program ended; the mark is cleared (#925).- Removing the CIA interrupt of the tracker library, by
ChangeTrackerVBlank, byStartTrackerin CIA mode or at the end of the program, switched the audio filter, and with it the power LED, over; both stay as they are (#449). - Without runtime error checking,
StartTrackerof an empty slot returned the slot number, a true value, although nothing plays; it returns 0 (False) (#451). - Without runtime error checking,
GetModuleName$of an empty slot gave a string of ten undefined characters per slot number; it is the empty string (#437). CheckTrackerIDof a module without the mark “M.K.” or “M!K!”, or of an empty slot, returned the contents of memory address 0; it returns 0 (False) (#430).CheckTrackerEventwithout a new tracker event returned the value of the last event with undefined upper bytes, soIf CheckTrackerEventwas almost always true; it returns 0 (False) (#431).- The tracker event
8xxcame one tick after its row, and at speed 1 never, soWaitTrackerEventwaited for ever; it comes on its row’s first tick (#435). WaitTrackerEventcalled the graphics library’s wait through whatever library base the program happened to hold, which crashed it; the compiler sets up the graphics library for the call (#453).LoadTrackerModulecalled AmigaDOS through whatever library base the program happened to hold, which crashed it; the compiler sets up AmigaDOS for the call (#443).LoadTrackerModuleloaded a file whose size ends in the byte $FD, $FE or $FF 253 bytes short; it loads the whole file (#442).- After a read error
LoadTrackerModulereleased the file’s lock a second time; it releases it once (#444). LoadTrackerModuleopened the file with a function of Kickstart 2.0, so a program crashed at it on Kickstart 1.x, and on any Kickstart it went on reading when the file could not be opened, such as a directory. It opens the file by its name, which works on every Kickstart, and reports a file that cannot be opened: the slot stays empty, and the result is the AmigaDOS error code (#1146).DecodeModuletook a module at an address of $80000000 or above for one in chip memory and left it where the sound hardware cannot play it; it copies such a module into chip memory (#432).DecodeModulecopied a module whose size ends in $FFFD to $FFFF into chip memory 64 KB short; it copies the whole module (#434).ModulePatternsreturned the song length, the number of song positions; it returns the number of patterns of the module, as documented (#445).ModulePositionJump nwent on at song position n+1; it goes on at position n (#447).TrackerVolume 0andTrackerVolume 64changed only the volume of the notes that started afterwards, so a fade-out to 0 stayed audible; like every other volume they also change the notes that are playing (#452).- Removing the CIA interrupt of the tracker library always removed the interrupt of timer A: where the library used timer B, its own interrupt stayed installed, and another program’s interrupt on timer A was taken away; it removes the interrupt of its own timer (#448).
- The effect
E8x(Karplus-Strong) on a voice without a loop rewrote 64 KB of memory from the loop start, from address 0 on a voice that had not played a sample yet; it does nothing there (#439). - With runtime error checking,
FreeTrackerModuleof the module that plays is the runtime error “Tracker: Stop the module before freeing it.”; the original freed it and went on playing the freed memory (Sources that compile differently, #436). PauseModulekept its pause whatever the program did in between. After a pause, the nextPauseModuledid not pause a module started again, but played a module thatStopTrackerhad stopped, or the freed memory of a module thatFreeTrackerModulehad freed; twoPauseModuleafterStopTrackerplayed the stopped module again.PauseModulepauses only a module that plays and continues only the module it paused.StartTracker,StopTracker,ChangeTrackerVBlankand freeing the paused module, also by loading or decoding another module into its slot, end the pause. A program that used twoPauseModuleto continue a module afterStopTracker, or after the module stopped itself with the effectF00, finds it stopped;StartTrackerplays it again from the beginning (#1076).- After a run that called
ChangeTrackerVBlank, the original started the next run of the program from the editor without the CIA interrupt, so a program that does not callPlayTrackeritself stayed silent. Every run starts in CIA mode (#1165).