Skip to content

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=<b was true whenever a and b differed. It is less-or-equal, as <=; a program that used =< for “not equal” has to write <>.
  • RenderToBitmap with a dither bitmap drew on the wrong bitmap: RenderToBitmap 0,1 made RenderPoly draw 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.
  • Box added the bitmap origin twice after BitMapOrigin. It adds it once, as Line and Boxf do; a program that gave Box reduced coordinates has to give the same ones as for Line. No known example program, demo or game uses the command this way.
  • CustomSprites took its offset 16 times too large: a CCOffset of 1 meant 16 custom copper instructions. It counts single instructions, as for CustomColors; a program that gives an offset other than 0 has to give it in instructions, 16 times the old value for the old place.
  • CustomColors with a thru256flag of 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.
  • LoadShape refuses 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):

In the libraries (Libraries):

In the editor (Editor):

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).