Skip to content
Differences from the original

Differences from the original

The BB2 C port is Blitz Basic 2.10, not a new version of it, and its goal is Blitz Basic 2.10 without the bugs of the original. The translation is complete: a program compiled with the port gives the same results as with the original compiler, the libraries do what the original libraries do, and the editor behaves like the original editor. The executables themselves may differ, where the compiler makes faster code, such as four functions it compiles inline. On that base the bugs of the original are fixed one at a time, area by area. A program that never ran into one of them behaves as it did with the original.

The port has no mode that keeps the original’s bugs. If you need the original behaviour, bug for bug, use the original compiler and libraries.

Every difference is written down, and every known bug of the original that is not fixed yet has an issue and, in most cases, a test. This chapter tells you what the differences are and how to check the port against the original yourself.

What differs

  • Fixed bugs. Bugs of the original are fixed deliberately, each one on its own, with its own issue and a test of the correct behaviour. A program that ran into such a bug behaves differently with the port, usually in the way it was always meant to. Most fixes concern rare cases: an error without the debugger, a value at the edge of its range, a resource that is missing.
  • Sources that compile differently. A few of the fixes concern the compiler. A small number of sources that the original compiled, mostly with a wrong or random result, give an error with the port or compile to something else.
  • Extensions. The compiler understands a little more than the original, but only where the original refused the source. A source that the original compiled is never given a new meaning. It also compiles Int, Frac, Len and Asc faster where it can, with the same results. LoadShape loads animations that the original stopped with an error.
  • Inside the port. The C code differs from the original assembler code in many details that no program can see. These are listed for developers and are not part of this chapter.
  • Registers for assembler code. A library command keeps the registers Mark Sibly’s library documentation promises: a4, a5, a6 and a7, and a function also a3. Other registers, such as d0, d1, a0 and a1, may be changed even where the original happened to keep them. A Basic program cannot see this; inline assembler around a command and assembler libraries that call a command can. The commands that known libraries and programs rely on keep their registers as before (EventWindow, EMouseX, EMouseY, EventCode, RawStatus, InitSound, Rnd, WBWidth, WBHeight, WBDepth).

The editor

The port’s editor is TED 1.1, the editor of Blitz Basic 2, translated like the compiler. It is checked against a build of the original editor’s source: both are given the same key presses and their screens, requesters and saved files are compared. Apart from the fixed bugs of the original (Editor), the differences that exist are internal and cannot be seen from the outside.

The full lists

The pages of this chapter describe the differences a program can notice. The complete lists, including the internal ones, are kept for developers in the repository: the deviations of the compiler, the deviations of the libraries and the deviations of the editor. Every fixed bug has an issue on GitHub with the details and the test that shows the fix; the pages link them.