Fixed original bugs
Before this page you should know what the chapter means by a difference (Differences from the original).
The BB2 C port fixes the bugs of Blitz Basic 2 one at a time, each with its own issue on GitHub and a test that checks the correct behaviour. A fix changes only the case that was wrong: a program that never ran into the bug behaves as before, and in most cases is compiled to exactly the same executable.
Most of the fixed bugs need unusual conditions to show: a name of more than 127 characters, a library file that cannot be read, a system with 256 MB of free memory. A few of them, though, strike in ordinary programs, with a wrong result or a crash and no error message. If one of your programs behaved strangely with Blitz Basic 2, look at these first. Each of them is shown with a short program, what the original made of it, and what the port does. Seven more are in the editor: they change the source you are writing, or crash the editor; they are shown in the same way.
Changes for existing programs
A few fixes change what an existing program does. These are the ones an ordinary program meets most easily. Check your own programs for them:
=<meant “not equal”:If a=<bwas true wheneveraandbdiffered. It is less-or-equal, as<=; a program that used=<for “not equal” has to write<>.RenderToBitmapwith a dither bitmap drew on the wrong bitmap:RenderToBitmap 0,1madeRenderPolydraw on bitmap 1. It draws on bitmap 0, with bitmap 1 as the pattern; a program that swapped the two numbers has to put them in this order. No known example program, demo or game uses the command this way.Boxadded the bitmap origin twice afterBitMapOrigin. It adds it once, asLineandBoxfdo; a program that gaveBoxreduced coordinates has to give the same ones as forLine. No known example program, demo or game uses the command this way.CustomSpritestook its offset 16 times too large: aCCOffsetof 1 meant 16 custom copper instructions. It counts single instructions, as forCustomColors; a program that gives an offset other than 0 has to give it in instructions, 16 times the old value for the old place.CustomColorswith athru256flagof 0 acted as 1. A flag of 0 is the same as leaving it out; a program that gives 0 and needs the flag set has to give 1.LoadShaperefuses pictures too large to blit: 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. A program that loads such a picture as a shape stops there; load it as a bitmap instead.
The same fixes are in the warning box of Important Fixes & Breaking Changes. The table on that page sorts every fix by what it can change in a program. Its levels 1 and 2 hold all fixes that can change a program that ran correctly, also the ones that only change something you may notice, such as its sound.
Bugs an ordinary program can meet
In the compiler (Compiling):
- Numbers like
1.and1.0e5were refused. - Arrays with 256-byte elements had their elements 64 KB apart.
- A List array indexed by another array,
as in
a(b(1)), read the wrong element. - A field of a NewType defined later got a wrong size.
End Statementcould close a Function, and a string Function ended that way crashed.- An AmigaOS function inside a calculation,
as in
a+(b+(c+Write_(…))), overwrote values of the calculation. - Object numbers above a raised maximum, such as Shape 1025, addressed memory before the object table.
- Text after
IncDir "…", such as: a=2, was never compiled. IncDirstayed for the next compile in the same editor session.- An include name with a device after
IncDircould not be opened. - A program with the Blitz OS commands hung at its end, even if it never called one of them.
- Data of odd length at the end of a program
crashed it at
End.
In the libraries (Libraries):
Date$showed 1 January after a leap year as 32 December: 1 January 2025 came out as32/12/2024.- Quicks were printed with a stray point or one too low:
2.99998 came out as
2.. Formatrounded wrongly and lost the minus sign: -7 with"###"came out as7.- Umlauts were not drawn by the text commands.
- Text after a string function lost its last character:
FileRequest$(...)+".bak"orProgDir$+"/data"held a 0 byte. LocandLofwere one too high afterEof: a file of 3 bytes had the length 4.- A GadTools gadget took over the values of the one before.
- Closing a window lost the events of the others.
WSizeandWMovehung at the size limits of a window or the edge of the screen.- Window titles were never freed.
- Decoded palettes were black on Kickstart before 3.0.
- A missing AmigaOS library hung the program at its start.
NextArg$did not end a quoted word after"":"a""b" cgave the one worda"b c.- The tracker library did not play in CIA mode: a program that played a Protracker module crashed on a 68000 at its start, or stayed silent.
- Samples without a loop ended in a buzz in Protracker modules.
- Voices left out by
TrackerChannelsplayed the wrong notes: each voice after a left-out one played the notes of the voice before it. BlockToShapecopied only part of a wide shape: of a shape 32 pixels wide, only the first half of its planes.RTEZGetLongoffered the number of the call before, and returned it when the user cancelled.BankLimit nreturned an address instead of the number of banks.FindVolumereturned an address instead of -1, so a comparison with -1 never found the volume.PutIconObjectreported a failed write as success and dropped the icon.SetToolValuereplaced a tool type whose name only began with the name given:SetToolValue "FL","x"replacedFLAG.StoreNVDatareturned 0 for a stored item, and an error code, a true value, when it could not store it.
In the editor (Editor):
- BLOCK UNTAB removed text, not only indentation: lines not indented by the tab stop lost their first characters.
- The last line of a text source was not tokenised when the file had no line feed at its end.
- Umlauts in a text source joined lines and were shown as keywords.
- JOIN of two long lines lost the end of the text when they were longer than 128 characters together.
- Accented letters broke saved blocks, copied blocks and printouts in the editor on its own.
- ß, é and other accented letters were lost: only the six umlauts could be typed into a string.
- A tab stop of 0 crashed the editor, and the options turned every value of 80 and more into 0.
- The editor did not start with the small font on a 512-row Workbench.
All fixed bugs, by area
Every fixed bug is on one of the following pages, either with an example or as one sentence with a link to its issue. The issue describes the bug in detail and names the test that checks the correct behaviour. Nearly all of these tests run with the normal emulator tests, so a fix that is undone later is noticed.
Some fixes make the compiler refuse a source that the original accepted, or compile it to something else. Those sources, and how to change them, are collected on their own page (Sources that compile differently). The bugs that are not fixed yet are on another page (Bugs not fixed yet).