ChangeLog for Matrix Brandy - as forked from Sourceforge after V1.20.1
======================================================================

NOTES FOR DISTRIBUTIONS AND PACKAGERS:
Version 1.23.1 required the -DBRANDY_RELEASE flag to be set for a release
build. As of version 1.23.2 this flag is automatically applied for builds
made from git in the master branch, and from tarballs with no git information.
Also, 1.23.2 introduced an automatic new version check. This may be considered
inappropriate by distribution packagers, so 1.23.3 adds build option
-DBRANDY_NOVERCHECK to disable this.

* 1.23.6 - 19 October 2025
- System: Fix bugs in scrolling up and down when a text window is active.
- System: Text-mode builds now handle VDU21 and VDU6.
- Graphics: Segment and sector drawing functions implemented - thank you
  Mike Fairbank!
- BASIC: Permit variables of the form name# for floating-point variables.
  BBCSDL uses this suffix to explicitly specify a FP variable, as it uses
  suffixless variables as "variants" which can change their nature.
- BASIC: Fixed a bug where RENUMBER on a program with a REM would make the
  program un-RUN-able.
- BASIC: MOD and DIV with floating-point arguments are now supported.
  (They are, of course, converted to ints before processing.)
- BASIC: Fixed a subtle bug in comparison functions where comparing large
  64-bit integers that can't be accurately stored in a float may give
  incorrect answers.
- BASIC: The vector dot product now works correctly. (Note this doesn't work
  in RISC OS ARM BBC BASIC, but now works the same as BBCSDL.)

* 1.23.5 - 06 April 2025
- General: Implement code fixes based on GCC 14.2's -fanalyze feature.
- System: Fix an intermittent hang on the version check due to network
  conditions, and a crash if unexpected data is received.
- System: Fix a recursion counter leak.
- Graphics: Can now zoom the window, use command line -zoom <factor> or config
  file entry zoom <factor> in the range 1-4.
- MOS: *LOAD and *SAVE display a warning if Hex64 mode is not enabled on 64-bit
  platforms.
- BASIC: Fix behaviour of RESTORE LOCAL with implied LOCAL of variables passed
  into a function or procedure.
- BASIC: Incore file name on first line of program MUST be after a REM.
- BASIC: If Strict mode is enabled, STR$~ now reports an error if Hex64 is not
  enabled and the value cannot be accurately displayed.
- BASIC: Implemented var1^=var2, array()^=var and array1()^=array2().
- BASIC: Fix bug where mixed case keywords were recognised when lower case
  keywords was not enabled.

* 1.23.4 - 18 October 2024
- General: Fix potential buffer overflow when detokenising code.
- General: Fix use of potentially uninitialised memory in SDL buffer.
- General: Fix crash and add warning if version check retrieval fails.
- Build: Add support for strlcpy() and friends for more platforms that
  include them, thanks to Brad Smith for this!
- Graphics: Work around a SDL1.2-compat issue where leaving fullscreen
  mode left the mouse restricted to the window.
- BASIC: SAVE no longer affected by LISTO.
- BASIC: Allow lowercase keywords if '-lck' command line option is used or
  'lowercase' config file option is present, or at runtime via the SYS
  "Brandy_AllowLowercase" call.
- BASIC: Fix behaviour of WIDTH and TAB(x,y), and behaviour of TAB(x) with
  an embedded CR in the string.
- BASIC: Brandy can now load text files with CR, CR/LF or LF line endings.

* 1.23.3 - 06 August 2024
- General: Implemented code tidy-ups recommended by OpenBSD. Thank you to Jag
  Talon for this!
- Build: Added build option -DBRANDY_NOVERCHECK to disable new version
  checking on startup.
- BASIC: Implemented EXIT FOR, EXIT REPEAT and EXIT WHILE, based on the
  extensions in Richard Russell's BB4W, BBCSDL, BBCTTY and BBCZ80v5.
- BASIC: Implement == to be synonymous with = in comparisons. Another
  compatility follow from Richard Russell's BASICs.
- BASIC: Allow DIM var LOCAL -1 outside of FN/PROC (as per BB4W, BBCSDL,
  BBCTTY and BBCZ80v5).
- BASIC: Implement BBCSDL's PLOT BY x,y (equivalent to PLOT 65,x,y), and
  equivalent to POINT BY x,y in ARM BASIC V.
- BASIC: WIDTH is now operational for GUI mode and the 'tbrandy' text-mode
  builds. Note that unlike RISC OS it affects almost ALL output (VDU excluded),
  including from built-in *-commands (but not external commands).

* 1.23.2 - 22 May 2024
- General: Much code clean-up (and some bugs fixed) after static analysis.
- Build: Autodetect whether it's a release build (master branch, or a tarball
  without any git information) or a development build (anything else).
- System: Added a new version check. Use option "-nocheck" to skip this
  should it cause slow starts.
- System: Added support for a configuration file, in $HOME/.brandyrc,
  %APPDATA%\brandyrc or <Brandy$Dir>.brandyrc depending on platform.
  See docs/Config.txt for full details.
- System: Tune stack and recursion depth to allow for a flood fill of crosshatch
  in a 640x512 screen mode as the minimum stack size.
- System: Implemented SYS"OS_SetColour", apart from ECF and read colour.
- System: Implemented SYS"Brandy_MemSet" to provide quick initialisation of
  arbitrary memory blocks.
- Graphics: Fixed some breakage in flood fill. Also, allow it to terminate
  early instead of crashing the interpreter if stack is exhausted.
- MOS: *Refresh Off is now the same as *Refresh OnError.
- BASIC: IF something THEN REM is no longer handled as the start of a
  multi-line IF statement.
- BASIC: Unary minus (and plus) on arrays are now implemented.
- BASIC: Slight adjustment to TRACE VDU - 'TRACE VDU ON' now also works,
  and is functionally identical to 'TRACE VDU'.
- BASIC: EXT#handle%=length%% is now supported.
- BASIC: PTR#handle% and EXT#handle% now accept and can return 64-bit values
  for working with large files.
- BASIC: PRINT was garbling numeric output when left-justified on some
  platforms (notably RISC OS).

* 1.23.1 - 13 April 2024
- System: Rework the threading model to use pthreads even under SDL, this allows
  a custom thread size to be set, so the recursion limit is now a factor
  of the stack and workspace size.
- Graphics: Fix VDU 19 where physical colour is 8 to 15. Thank you to Richard
  Russell for spotting this.
- Networking: BGET# was broken on x86-32 and x86-64 (but not ARM), returning
  negative numbers if bit 7 was set. Thank you to BeeBS.ddns.net for their
  help with tracking this down.
- BASIC: Fixed a bug importing Russell-format tokenised BASIC where tokens
  were incorrectly decoded. Again, thank you to Richard Russell for spotting
  this.
- BASIC: RUN recursion limit removed, it's now implemented with a
  setjmp/longjmp.
- BASIC: EVAL stops at unexpected input without error (like Acorn BASIC),
  unless Strict mode is set. This discrepancy was also identified by Richard
  Russell.
- BASIC: Implement BBCSDL's PLOT x,y syntax (assumes plot code 69).

* 1.23.0 - 06 February 2024
- System: Add '-tek' (or -t) option to enable Tek graphics for 'tbrandy'
  on compatible platforms. Equivalent to issuing SYS"Brandy_TekEnabled",1
- System: Strict mode can now be set programmatically with SYS"Brandy_Strict".
- System: Strip quotes from filenames in *LOAD and *SAVE
- System: Implemented OSWORDs 1 and 2
- System: Fix file name bug in OSFILE.
- System: Filename translation between RISC OS and Linux for OPENIN,
  OPENOUT and OPENUP.
- System: Added "-nofull" command line option, to disable switching into
  full-screen mode (for questionable hardware, e.g. Poulsbo chipsets)
- System: Do not hang on text build startup when console doesn't handle
  the ANSI sequence to report the cursor location (e.g. Minix3 console),
  instead time out after 0.5 seconds.
- MOS: *Refresh, *WinTitle and *FullScreen are now recognised on RISC OS
  builds, but do nothing. (Previously, they raised a "Not Found" error.)
  This is to allow programs written targeting other platforms a better
  chance to run correctly under RISC OS without further modification.
- MOS: OSBYTEs 42-44 deprecated, use 163,2-4 instead.
- BASIC: LOCAL with no parameters now does nothing (as per Acorn) instead
  of reporting an error. This new behaviour is in place on a DEFAULT_IGNORE
  build unless -strict is set, or if -ignore is set.  This can also be
  toggled at runtime with SYS"Brandy_Strict".
- BASIC: If Strict option is set, warnings are handled as fatal errors if
  a program is running.
- BASIC: Limit the recursion depth of RUN.
- BASIC: Don't choke if a numeric DATA element contains a comma (e.g.
  multi-dimensional array member or FN call)
- BASIC: Clear variable stubs if a DIM fails, and after CLEAR HIMEM.
- BASIC: Indirection with floats containing addresses > 32 bits now work.
- BASIC: Print a warning if a conversion from int64 to float loses precision.
- BASIC: Fix bugs in Exponent format number printing.
- Graphics: Fixed multiple problems with VDU24, RECTANGLE FILL, MOUSE
  and the plot_pixel() primitive, primarily to do with the oddball MODE 22.
  Thanks to Michael Fairbank for identifying and assisting with fixing this.
- Graphics: Fixed a cursor placement bug for VDU31 (PRINT TAB(x,y)) in VDU 5
  mode.

* V1.22.15 - 21 March 2023
- System: For SDL builds, move ESCAPE polling to its own thread.
- System: Added CTRL+PrtSc to force immediate exit in SDL build.
  Unfortunately the Pause/Break key doesn't register in SDL. This
  functionality can be disabled with build-time option
  BRANDY_NOBREAKONCTRLPRTSC.
- System: Added some fixes to handle issues with the sdl12-compat
  library.
- System: Implemented an internal *./*CAT handler, loosely styled on BBC
  Micro ADFS output.
- System: Exit code is now ERR MOD 256 (or 255 if that would result in 0),
  or 0 if exited with no error.
  A program can still set its own exit code as a parameter to QUIT.
- System: Fixed a regression in the way floats were handled by SYS.
- System: Corrected a flawed usage of fcntl().
- MOS: Implemented OSBYTE 210
- BASIC: Extended ATN to take two parameters in parentheses, this calls
  atan2().

* V1.22.14 - 31 December 2022
- System: Workaround for sdl12-compat library bug affecting keyboard input.
- System: RISC OS SharedCLibrary build now supports networking.
- System: Now compiles on Solaris 11 (tested x86_64). Use "gmake".
- System: Now compiles on illumos (an OpenSolaris fork). Use makefiles in
  build directory.
- System: Text mode build available for Minix 3 (no networking yet).
  Use gmake -f build/makefile.minix
- System: Fixed a bug that caused Brandy to throw an Xlib error in some
  cases when exiting.
- Graphics: Fixed GCOL action codes 5-7 for filled rectangles (this function
  does not use the plot_pixel prototype).
- Graphics: Fixed an error where VDU variables 138 and 139 were erroneously
  clamping to pixel boundaries based on the current screen mode scaling.
- Graphics: Fixed an integer division rounding error that crept in when
  drawing went partially off screen.
- Graphics: Can now plot arcs RISC OS-style (thank you Michael Fairbank)
- Graphics: Much faster full-screen blit for 1:1 pixel modes.
- Sound: Notes are now queued by default if no delay parameter is used.
- Sound: Block instead of discarding notes if the buffer is full.
- BASIC: Fix LVAR so it doesn't choke on stupidly long variable names.
- BASIC: Tidied up an earlier cheat - when interpreting @%, if the top byte
  is non-zero then STR$ obeys @% so we were masking against &FF - but we
  were setting all the top bits when using "+". This is fixed now the top
  byte is set to 1 instead. (We still check the byte is non-zero.)
- BASIC: Raising to the power has better bounds checking.
- BASIC: Fixed a bug in the parser where a variable could be erroneously
  combined with an indirection operator.
- BASIC: Fixed a bug where ENDPROC in a function or =expr in a procedure
  would cause a crash.
- BASIC: Be a bit more graceful if loading a program bigger than the
  workspace.
- Examples: Telstar client: Removed unnecessary code, TEEFAX server change,
  added new Teletext services and a custom address option.

* V1.22.13 - 26 January 2022
- System: Stricter handling of oversize variable and PROC/FN names.
- System: Improved handling of ESCAPE under RISC OS (notably, it no longer
  crashes the interpreter).
- System: Improve behaviour on Linux console framebuffer, particulary
  Raspberry Pi. Experience may vary across other hardware.
- System: Remove the old keyboard code, JGH's NEWKBD code is now the only
  version present.
- System: On non-RISC OS platforms, when using LOAD, CHAIN, OPENIN and
  OPENUP, if file isn't found, retry with a .bbc suffix before complaining.
  SAVE and OPENOUT will not use a .bbc suffix unless explicitly provided in
  the filename.
- System: Permit system memory to be up to 4194303K (4GB less 1K)
- System: Programs saved under RISC OS now get file type &FD1 (allocated by
  Acorn as BASIC stored as text). The file type is associated with Matrix
  Brandy for loading and running by double-clicking on the desktop.
- System: RISC OS: MODE in form xres,yres,depth was broken. Fixed.
- Graphics: Reworked line drawing, the earlier adaption of upstream was not
  right. This new version is based on PiTubeDirect's implementation.
- Graphics: Dot patterns, VDU23,6 and OSBYTE 163,242 now implemented
- Graphics: Fixed a crash bug due to SDL not being particularly thread-safe.
- BASIC: PRINT and STR$ now support displaying a decimal comma instead of a
  point.
- BASIC: PRINT and STR$ now show exponents in the style used by the BBC and
  RISC OS, rather than the C standard.
- BASIC: @% with precision 0 now uses &11 (except in fixed-precision mode),
  same as ARM BBC BASIC VI.
- BASIC: @% with width set to 0 now left-justifies, as per Acorn BASICs,
  RTR's assembly-language builds and (as of V0.40) BB4C.
- BASIC: @% precisions greater than &11xx are now capped at &11xx.
- BASIC: LVAR now includes @% in its output, displaying both in hex and its
  string form.
- BASIC: Extended TRACE with TRACE VDU [OFF], this redirects TRACE output to
  Brandy's controlling terminal, specifying OFF puts it back to normal.

* V1.22.12 - 05 December 2021
- System: Fix some floating-point data size mismatches
- System: Fix calculations of matrix dot products (thank you 
  mikefairbank@Github!)
- System: New RISC OS build process using GCCSDK under Linux (thank you
  Cameron Cawley!)
- Keyboard: Fixed keyboard from eating too much from event queue (thanks
  David Hawes!)
- Graphics: Implemented GCOL action codes 5-7
- Graphics: Hopefully fixed a triangle drawing bug.
- Graphics: Implement VDU23,16 (as far as already implemented) in VDU5 mode.
- Teletext: Implemented VDU23,18,4,pri,alt| to select character sets.
  This is much cleaner than using SAA505Xlib in the examples, but that will
  remain as an example for OSWORDs &8B and &8C.
- BASIC: Fix COLOUR(r,g,b) function to return correct values in 256-colour
  modes.
- BASIC: Fix behaviour of RND followed by a space before parentheses to match
  ARM and 6502 BBC BASIC.
- BASIC: Change the behaviour of cascaded IF calls to match the behaviour of
  BBCSDL and friends. This is switchable and can be switched back to Acorn's
  (strange) behaviour via a SYS call.
- INKEY(-256) now returns ASC("M") (&4D) on ALL platforms, including RISC OS.

* V1.22.11 - 11 July 2021
- System: Mouse position wasn't taking into account change of ORIGIN.
- System: Changes to dlopen, otherwise symbols weren't being recognised.
- System: SYS "Brandy_dlgetaddr" optionally takes a second parameter of a
  library handle returned by SYS "Brandy_dlopen".
- System: SYS now only operates in 64-bit mode on 64-bit hardware.
- System: Fixed a bug where the keyboard would stop responding after a while
  in full-screen mode.
- System: Bug fix on new-style MODE call where MODEs 3, 6 and 7 could be
  matched.  It now only matches existing graphics-capable modes, and will
  construct one (effectively doing *NewMode 126 x y bpp 1 1) if no matches
  to existing modes are found.
- System: Emulated syscall OS_ReadModeVariable was incorrectly also returning
  VDU variables. Now only Mode variables are returned, attempts to get any
  other variable return 0, as they do on RISC OS.
- System: Implemented OSWORDs 11 and 12, and SYS "OS_ReadPalette"
- System: Implemented VDU flags 148-152, so 0-12 and 128-161 are now supported.
- System: Reading VDU variables for TINT was giving incorrect values.
- System: VDU20 wasn't updating the display (unlike VDU19), fixed.
- BASIC: Fixed a bug whereby the OSCLI command might have its parameter
  trampled on.
- BASIC: On non-RISC OS platforms, increase SYS parameters to 16 to support
  "Brandy_dlcall" calling symbols which take a lot of parameters.
- BASIC: Power was broken in the upper echelons of 64-bit ints, also conversion
  to ints was a bit broken for edge cases.
- BASIC: Evaluations now carried out internally with 80-bit floats (where 
  available), cast to 64-bit when returning values to BASIC.

* V1.22.10 - 14 February 2021
- System: *Refresh OnError wasn't working correctly. Fixed.
- System: Added a fix reducing the likelihood of where a textfile BASIC
  program could be misinterpreted as a tokenised one.
- System: Implemented enough of SYS "OS_File" to hopefully be useful.
- System: SDL graphics in its own thread. MODE 7 now runs like a startled cat.
  As a bonus, we now have a flashing cursor too. The performance tweak call
  SYS "Brandy_RefreshInterval" has been removed.
- System: MODE 7 is now fast enough that VDU 23,18,1 is a no-op.
- Graphics: New ellipse drawing code. Based on RISC OS ARM implementation,
  translated to C by hoglet@Stardot for PiTubeDirect.
- Graphics: Fix a crash where somehow PLOT generates negative offset values.
- BASIC: CLEAR now deallocates arrays (not memory blocks) allocated using
  DIM HIMEM.
- BASIC: CLEAR extended to allow CLEAR HIMEM [<array()>], which frees arrays
  (not memory blocks), but otherwise leaves variables untouched. Specifying
  which array will de-allocate only that array.  The array variable can
  subsequently be re-dimensioned using DIM [HIMEM].
- BASIC: DIM HIMEM can no longer attempt to create string arrays.
- BASIC: SWAP now works correctly on off-heap arrays.
- BASIC: Fixed a bug in array arithmetic on uint8 arrays
- BASIC: Implemented PTR(string$) and PTR(array()).
- BASIC: PTR#0 now returns 0 (in line with BBC BASIC 2-5, 1 unknown) rather
  than throwing an error. Note ARM BBC BASIC VI returns the temporary file
  number as per OS_Args 0,0 with zero meaning none in use.
- BASIC: Brandy internally used separate tokens for TIME and TIME$ meaning
  TI.$ couldn't be used as an abbreviation (and it confused the parser). The
  TIME$ token has been removed, so TI.$ works as per Acorn BBC BASIC.

* V1.22.9 - 06 January 2021
- Code: Removed some pointless comparisons (e.g. unsigned < 0)
- System: Accept -- on the commmand line to indicate all further options
  to be passed into the BASIC program even if it's otherwise a Brandy option.
- System: Implemented BBC MOS calls OSRDCH, OSNEWL, OSASCI and OSCLI via the
  traditional CALL &FFxx route.
- System: Enabled generic plain-text printing under Linux (or other platform
  with CUPS, it uses 'lpr' to do the heavy lifting).
- System: Implemented OSBYTE 6 (Printer ignore character), default is 13.
  (Maybe it's a quirk of my printer, but ignoring 10 as default on the BBC
  doesn't print right. Could be CUPS though.)
- Platforms: Fixed a 64-bit regression in the NEW <size> command.
- BASIC: Fix regression on MODE command caused by uint8 data type introduction.
- BASIC: Implemented 64-bit unary indirection using ']' (as per BBCSDL).
- BASIC: Implemented DIM HIMEM (a Basalt extension), in Matrix Brandy this
  allocates memory outside the heap, using malloc() and friends. Memory
  blocks for indirection, and numeric arrays can be created in this.  String
  arrays control blocks will be off the heap, but the strings themselves will
  still be stored on the heap.

* V1.22.8 - 16 September 2020
- BASIC: Fix REM behaviour of DEF line.
- BASIC: Implemented SYS() function, somewhat in line with BBCSDL's version.
  In Matrix Brandy, this calls OS_SWINumberFromString, and also works under
  RISC OS.
- System: Implement two SYS calls for obtaining the address of a system call
  (Brandy_dlgetaddr) and to call it (Brandy_dlcalladdr).
- System: Implement OS_SWINumberToString.
- System: Fix bugs in string handling on OPENIN, OPENOUT and OPENUP
  (CVE-2019-14662 and CVE-2019-14663 reported on upstream Brandy)
- Display: Fix a subtle VDU23,16,1| bug. Thanks to Richard Russell for this.
- Examples: Telstar client updated with ANSItex BBS added.

* V1.22.7 - 01 August 2020
- Platforms: Native display builds for RISC OS available, including
  networking. 26-bit and 32-bit builds both possible.
- Platforms: SYS calls on RISC OS can call the Brandy_* calls from within
  the interpreter in addition to the RISC OS native calls.
  OS_SWINumberFromString is intercepted to also recognise the Brandy_* calls.
- Platforms: BrandyApp build mechanism changed, no longer relies on ld to
  build a .o file, instead uses a BASIC program to build a .c file with the
  program data embedded.
- System: pthreads used for timer thread on non-SDL (and non-RISC OS) builds.
- System: Timer uses monotomic clock instead of gettimeofday().
- System: *EXEC now interruptable with ESCAPE, and not aborted on other
  errors.
- BASIC: Unsigned 8-bit data type (var&) implemented.
- BASIC: Overflowing a 32-bit integer variable will now raise an error
  instead of silently wrapping. (uint8 variables will wrap.)
- BASIC: OLD keyword now reports Unsupported. It never worked properly and
  in Brandy it is rather pointless.
- BASIC: DELETE keyword now requires at least one parameter.
- BASIC: Lowercase immediate mode commands no longer allowed, unless compiled
  with -DBRANDY_ALLOW_LOWERCASE_COMMANDS
- BASIC: RENUMBER edge cases fixed.
- BASIC: GET(x,y) and GET$(x,y) are now relative to the current text viewport
  as set with VDU28.
- Examples: Teletext screen editor updated with mouse support, inspired by
  code written as examples for Pixelblip@Stardot's editor.

* V1.22.6 - 19 June 2020
- BASIC: Implemented BB4W/BBCSDL extension GET(x,y) and GET$(x,y)
- BASIC: Fixed TINT, both function and command as they were rather broken.
- System: Some subtle bugs fixed as a result of clang compiler warnings.
- System: Block attempts to free workspace memory that shouldn't be randomly
  freed.
- System: INKEY(-256) now returns &4D (M) for all builds except RISC OS.
  System specifics can be obtained from SYS "Brandy_Platform".
- System: OSBYTE &87 implemented for non-MODE7 screen modes. (MODE 7
  was previously implemented)
- System: Now builds on MacOS High Sierra and Catalina. Note, it requires
  the latest snapshot of SDL 1.2 from SDL's Mercurial repository.
- System: Bug fixes for *SAVE and *LOAD. Additionally, MODE 7 screens
  can now be *SAVEd and *LOADed.
- System/Display: Several bugs fixed, highlighted by Jan Vibe's graphical demos.
- Display: Some optimisations in the scaled blitting code.
- Display: Added a hugely optimised code path for scrolling, when no VDU28
  window is in place, and not MODE 7.
- Display: VDU23,7 implemented apart from movement option.
- Display: While 32K colour modes aren't directly implemented, instead of
  reporting an error when such a mode is requested, a 24bit colour mode is
  selected instead.
- Keyboard: Implemented OSBYTE 4, including function keys on cursor keys with
  *FX4,2. *FX4,1 makes cursor keys generate BBC Micro values.
- Keyboard: Try to fix some glitches around softkeys and the cursor keys.
- Keyboard: Rework INKEY delay as on Windows messages were sometimes just
  getting lost in the post.
- Keyboard/Mouse: *FX15 and *FX21 (x=0,9 only) implemented to flush buffers.
- Mouse: Mouse event queue implemented.
- Teletext: Don't mimic SAA5050 "hold bug" if Alpha and Graphics Black
  enabled (VDU23,18,3,1|)
- Teletext: Hold characer wasn't being cleared when switching between
  double height and normal size.
- Teletext: Fixed a bug where flash wasn't flashing while INKEY(delay).
- Teletext: Implemented the Alternative character set, toggled with &9B.
- Implemented an equivalent to OSWORD 10 for the Teletext font. Using
  OSWORD &8B as it appears to be undefined. Requires a 44 byte block.
- Teletext: Implemented OSWORD &8C to change a Teletext character definition.
  These two are specific to Matrix Brandy and Richard Russell's BBCSDL.
  Details on these calls are in docs/Mode7.txt
- Teletext: Added example library SAA505Xlib, which uses the new OSWORD calls
  to allow language changes as per the SAA505x family (0-7 supported).

* V1.22.5 - 08 May 2020
- Fixed a bug in CLS where it missed the bottom of the screen if the
  vertical resolution wasn't a multiple of the text height.
- Fixed various bugs in 64-bit variable handling.
- Fixed an omission - indirection offsets on 64-bit variables are now
  supported.
- Changed the appearance of the * character in MODE 7, as I never really
  liked the RISC OS 5 shape, it's now much closer to the SAA5050 shape
  while retaining the RISC OS 5 dimensions.
- Removed Teletext 12x20 and 14x20 displays, thus VDU23,18,255,x is no more.

* V1.22.4 - 10 March 2020
- Enable building on Cygwin 64-bit
- Some more 64-bit fixes
- Initial steps to allow SYS to call host library functions. Enabled for
  Linux and Windows (thank you Richard Russell for the code snippet!)
- SDL surface handle now available from Brandy_GetVideoDriver in R5.
- Raise function now handles invalid values gracefully. Range is slightly
  more permissive than BASIC I-V, but closely matches BASIC VI.
- Add option to use SW surface on command line, and allow brandy-apps to
  accept some command line options.
- Fix a setjmp crash in Win64.
- Correct a substitution error in MODE 7 high-bit graphics.
- Fix an incorrect stack pull, and add verification to the stack pull code.
- Bit shifts now 32-bit by default (as per old behaviour and BASIC VI),
  switchable to 64-bit with SYS "Brandy_BitShift64",1

* V1.22.3 - 29 November 2019
- Fix stack and array regressions caused by the 64-bit int work.
- Fix a flood filling crash when new colour is the same as the old colour.

* V1.22.2 - 25 November 2019
- Merge in 64-bit int capability
- Remove offset memory model, PAGE, HIMEM and indirection operators now
  use actual memory locations.
- Text-mode builds available for Windows with Cygwin build environment.
- Change to Escape handling (thanks Jonathan Harston), bringing it more in
  line with the way the Acorn MOS handles it.
- Many more keyboard fixes from Jonathan Harston.
- Separate out memory information from *HELP BASIC (in Debug mode) to
  *HELP MEMINFO (available on any build).
- Fixed VDU5 font painting in black. It now honours the graphics window and
  the GCOL action code.
- RECTANGLE FILL now honours the graphics window.
- GOTO and GOSUB no longer require parentheses around an expression.
- Tektronix graphics added to tbrandy (textonly.c), but not enabled by
  default.
- New graphics demos (converted from Teklib demos), and all non-Teklib
  graphics demos checked to work with both regular graphics and the newly
  Tek-enhanced text-mode build.
- RESTORE LOCAL (BB4W/BBCSDL extension) implemented.
- ON ERROR behaviour corrected, variables declared LOCAL shouldn't be
  restored to their global values when the stack is unwound.

* V1.22.1 - 20 September 2019
- Make the old BASIC I-IV compatible integer mathematics available via a
  run-time switchable setting.
- Integer addition and subtraction will now return integer if it fits, else a
  float. (Legacy mode: unchanged, will always return an int, with wraparound).
- Integer multiplication follows new code path at all times, old int-only
  implementation didn't match any Acorn BBC BASIC version and is thus a bug.
- Fixed stack pointer leak bug.
- Fixed behaviour setting HIMEM immediately after LOADing a file
- SYS "Brandy_GetVideoDriver" extended, returns MODE 7 framebuffer base in R4.
- RISC OS style sound working. MANY thanks to David Hawes.
- Separate out segfault memory error to its own error message.
- Fix pass-back of strings from SYS on 64-bit systems.
- Fix sound with volume = 0 (Thanks David Hawes)
- Sound updates in StringLib family (Thanks David Hawes)
- Bug fix for VAL - it should ONLY handle decimal numbers (not hex or binary)
- Fix flood fill (it just didn't work right), new implementation is however
  quite memory hungry and recursive.
- Signal handler updated, longjmps now use siglongjmp. check_read() and
  check_write() no longer required. Note this also allows a program to trample
  on the BASIC stack.
- Many keyboard updates (Thanks Jonathan Harston)

* V1.22.0 - 23 July 2019
- Change identifier to BASIC VI (which is BASIC V with 64-bit FP maths, which
  is what Brandy has always done)
- *SPOOL and *SPOOLON implemented.
- Fix integer overflows when converting from floats.
- Fix intermittent crash when execution hits a DEF statement.
- Added a run-time switchable setting for INT() whether it can process
  numbers out of range of a 32-bit int data type. Default is off.
- Implement the AUTO command.

* V1.21.21 - 08 July 2019
- Centisecond timer polling hived off to its own thread, as polling it every
  command iteration for ESCAPE checking was expensive.
- Program execution now much faster than before, and slightly faster again
  when ESCAPE is disabled via *FX200.
- Renamed some #DEFINEs as they were colliding on a new gcc on Cygwin.
- ESCAPE on VDU14 paged mode now works.
- INKEY no longer swallows a non-matching keypress.
- Some more OS SWIs implemented (the Snow demo from RISC OS Pico for RasPi
  now runs unmodified).
- Optionally allow an unselectable MODE to be substituted with another one
  instead of reporting "Screen mode is not available".
- Some more Raspberry Pi GPIO stuff, including recognising most RISC OS GPIO
  module SWI names, and implementing a few.
- Unsupported colour depths are mapped to 24-bit (previously was 8-bit), so
  a program asking for a 15-bit mode will be able to draw colours as largely
  intended.
- Extended OSBYTE 42 to allow an immediate refresh - SYS6,42,16 may be faster
  than parsing "*REFRESH" for anything time-critical (and obvious functionality
  that was missing from the interface)
- Quotes are stripped if appropriate from *ScreenSave and *ScreenLoad. They
  remain optional for filenames which include spaces.

* V1.21.20 - 12 June 2019
- Improved CIRCLE FILL and ELLIPSE FILL routines.
- Added -v CLI option - thanks TheBrokenRail @ Github.
- Reworked graphics window clipping, as it was completely broken.
- Fixed string return values from SWI calls, hopefully they will not break
  on 64-bit systems
- Added SWI "Brandy_GetVideoDriver" as a wrapper for SDL_VideoDriverName,
  additionally returns "no_sdl" for non-SDL builds
- Extended SWI "Brandy_Version" to also return host OS and whether or not it's
  an SDL build.

* V1.21.19 - 01 March 2019
- Hopefully fixed the spurious cursor remnants.
- Ellipses with shears now implemented, PLOT &C5 and PLOT &CD now work
  correctly (fill implementation could possibly be improved). Other variants
  to be tested.
- ELLIPSE [FILL] command with non-zero angle now supported.
- MODE 7: Update screen on WAIT-delay, and flash continues during WAIT.
- MODE 7: Increase display accuracy at the expense of performance, switchable
  via VDU23,18,1,x| - bit 0 is also now implemented.
- MODE 7: *REFRESH now does the right thing.
- WAIT can now be interrupted with ESCAPE.
- Invocation behaviour change: brandy <filename> now assumes -quit instead
  of -chain.
- Support for shrouded BASIC programs, examples/shroud will shroud a program
  hiding the source code. It is itself shrouded. A shrouded program cannot be
  LOADed or CHAINed, and can only be invoked from the command line.
- Makefile and code improvement contributions from ccawley2011 @ github.
- Corrected behaviour of EOF#0, BPUT#0, BGET#0 etc, thanks dhg2 @ Stardot.
- *EXEC implemented. Idea from Richard Russell.
- *-commands that call out to external commands from Windows no longer cause
  a CMD window to open, also fixing the "stuck key" problem associated with
  this. Thanks to Richard Russell for the guidance here.

* V1.21.18 - 15 Jan 2019
- *SHOW implemented (JGHarston)
- Bug fix for DEL in text-only builds (JGHarston)
- Limit *WinTitle to SDL and UNIX builds - it's a no-op otherwise.
- MODE 7 scrolling text fix
- MODE 135 now selects MODE 7.
- Fix VDU20 for text-mode UNIX build
- Top-level makefiles now read BRANDY_BUILD_FLAGS environment variable for
  additional build flags
- New keyboard handler (JGHarston) - add -DNEWKBD to makefile to CFLAGS or
  define BRANDY_BUILD_FLAGS=-DNEWKBD in your shell environment to use.

* V1.21.17 - 05 December 2018
- Fix memory leak in MODE change
- Fix Filled Rectangles and CLG with GCOL actions, previously implemented
  and rather promptly broken.
- Fixed Flash on Mode 7 on 64-bit machines.
- Fixed Escape on 32-bit machines.
- Improved INKEY(negative) handling and other keyboard bugs, thank you
  JGHarston.
- Fix reading strings from DATA with included quote marks.
- Fix LSL (<<), ASR (>>) and LSR (>>>) to replicate RISC OS behaviour.
- VDU19 palette changes now update the screen immediately. Also, now has
  no effect in MODE 7.
- Mouse display behaviour changed - if fullscreen mode enabled, mouse is off
  upon mode change or startup; if windowed, mouse is on.
- Telstar client now includes NXtel, and a new, more robust, mechanism of
  calculating high-bit escaped characters, as NXtel did it differently to
  Telstar or CCl4.

* V1.21.16 - 04 November 2018
- Added auto-sensing support for the Raspberry Pi's GPIO interface, with
  memory-mapped I/O and SYS calls. While the calls are recognised on all
  builds, it's only active on the Raspberry Pi.
- Bug fix (regression): LIST in text builds would error after one line.
- Adjust graphsdl.c:buff_convex_poly bounds checking to allow off-screen
  drawing (we limit this elsewhere). For example, triangles drawn offscreen.
  will now appear to be chopped off, rather than squashed into the screen.
- Bug fix for out-of-bounds array scribbling when off screen.
- Code refactor - SYS calls are now (with a few exceptions) in their own file.
- Performance improvements to Mode 7, and fix rendering bug when ESCAPE was
  disabled.
- Telstar client now includes Authentic mode, where a delay is added to each
  character rendering to simulate (approximately) a 1200baud modem.
- Implemented AND=, OR=, EOR=, MOD= and DIV= from BB4W/BBCSDL and JGH's
  ARM BBC BASIC Plus.

* V1.21.15 - 12 October 2018
- Bug fix: Setting *KEY15 scribbled outside array bounds.
- Bug fix: Erroneously trimming a string introduced in V1.21.8.
- Improvement: In networking code, move WSAStartup (MinGW) to init, if
  this fails, disable networking.
- Enabled VDU14/15 scroll paging. Note, by default Brandy uses CTRL-N for
  accessing the next line in the command line history (along with CTRL-P for
  previous line). OSBYTE 44 with x=0 disables this, so CTRL-N will send the
  VDU14 code, CTRL-P will send the VDU16 (CLG) code. (CTRL-O will always send
  the VDU15 code)
- Enabled VDU23,16; currently bits other than 3 are observed. This sets the
  scroll protect mode, X and Y cursor movement and whether the   screen is
  overprinted or scrolled when the Y limit is reached, and whether VDU5 mode
  linewraps.
  (Bit 3, making Y horizontal and X vertical is NOT supported.)
  Default value is 1 (*CONFIGURE NOSCROLL on RISC OS or BBC Master) and the VDU
  mode when RISC OS Desktop is running (or in a single tasking state from F12
  or Exit) regardless of Scroll/NoScroll configuration setting.
- Fix compiler warnings for MinGW - and allow DOS-type commands to return
  their output to the SDL window (so *dir works for example).
- Flush SDL queue on INKEY and MOUSE reads, otherwise events start to get
  missed (bonus point: Close window icon is more responsive.)
- LISTing a program now stops on ESCAPE.
- Code cleanup part 1: Identify functions that can be declared static.
- Code cleanup part 2: Remove static functions that are never called from
  anywhere.
- Updated some of the documentation to reflect the changes introduced in
  Matrix Brandy.
- Improved the Mode 7 appearance (thanks to Risc OS 5!) - see docs/Mode7.txt

* V1.21.14 - 28 September 2018
- ChangeLog layout change: Most recent release first.
- Similar to the GET fix in V1.21.11, the same problem of spurious zero
  returns was occurring with INKEY(delay). This is now fixed.
- Bug fix for CLS when a text window is active, the cursor was not being
  homed.
- Bug fix for VDU28 text windows where bottom or right were out of range.
- Bug fix for text cursor appearing inappropriately in VDU5 mode.
- Fix more compiler warnings - thanks bakoulis and Coeus at Stardot for
  highlighting where their compilers were warning where mine wasn't,
  and for suggesting a fix.
- PLOT actions redirected to new primitives that support GCOL action codes,
  both foreground and background codes work.
- Behaviour of DELETE (and VDU127) is corrected.
- WAIT (with no parameters) to wait for VSYNC implemented, as far as is
  possible in SDL.
- 24-bit colour support enabled.
- MOUSE TO implemented.
- Code clean-up, "text mode" in SDL screen removed. It's never been used
  since the appearance of MODEs 3 and 6 were corrected.
- BrandyApp compilation on Linux changed to using a library to simplify
  the build process.
- Telstar client updated, enhancements from gARetH baBB - thank you!

* V1.21.13 - 14 September 2018
- Rework temp file bits to use mkstemp instead of tmpnam.
- Reinstated MODE 7 width setting via VDU23,18,255 (from 1.21.7). Note that
  it does not resize the window, and re-selecting MODE 7 restores the default
  glyph width of 16.
- Add *ScreenSave - saves the displayed screen as a Windows Bitmap file
- Add *ScreenLoad - Loads the screen into the currently selected display
  bank for VDU writes
- Initial makefile for SDL on MinGW. Much testing required.
- New Mode 7 demo. Some Prestel graphics, and images from the edit.tf online
  Teletext page editor. Unlike the BBCSDL demo this embeds the data in the
  program itself. Apart from pressing R to reveal it isn't Brandy-specific.
- New Telstar client. Screen updates seem faster, with more convincing
  double-height.

* V1.21.12 - 02 September 2018
- Bug fixed: Closed file warning clobbered ERR value. Thanks to dhg2 @ Stardot
  for highlighting this one.
- Bug fixed: OSWORD via &FFF1 wasn't returning the A register. Thanks to
  luigino @ Github for highlighting this.
- Bugs fixed: Multiple compiler warnings when compiled with -Wall, and
  static analysis.
- Bug fixed: Text-only builds no longer complain about "Unsupported Basic V
  feature" when using WAIT.
- Brought the text-only builds up to date, brought makefile.text back to
  top level.
- *WinTitle now works on text-only builds using XTerm control codes.
- Changing screen mode no longer clears FULLSCREEN.
- Expanded OSBYTE 42 to get or set fullscreen state, and fixed an off-by-one
  error in returning Refresh state.
- RPM SPEC file now builds text builds as well as the graphical build, the
  resulting RPM includes all three builds (graphical, text, simple-text).

* V1.21.11 - 24 August 2018
- Bug fixed: POINT(x,y) should return the logical mode-specific colour number
  rather than an RGB value.
- Bug fixed: GET returning 0 and key value for some keys
- Bug fixed: Crash when ON ERROR handler invoked in program run using CHAIN
  at immediate mode
- Initial structure in place for OSWORD; OSWORD 10 implemented including
  BBC-style call to &FFF1 and SWI &07.
- OSBYTEs 134 and 165 implemented. As Brandy doesn't have the Acorn-style
  editing cursor, these two function identically.
- OSBYTEs 106 and 135 implemented partially (135 only complete in MODE 7),
  106 can only turn the pointer on or off.
- Invocation behaviour change:
  If BASIC program starts with # as the first character, assume we have a
  shell-compatible start line that is invoking Brandy. In this case, if the
  program is started on the Linux command line as a parameter to Brandy, it
  will exit upon program completion instead of returning to immediate mode
  (as if -quit was set on the command line). This also means a BASIC program
  can be made executable and will run when run as a script, and Brandy will
  exit upon completion.

* V1.21.10 - 20 August 2018
- *REFRESH now follows BB4W/BBCSDL behaviour, with extension *REFRESH ONERROR
  which uses the behaviour from V1.21.9 (disabled, re-enabled on error)
- COLOUR r,g,b and GCOL r,g,b now behaves properly when values > 255 supplied.
- OSBYTE 42 implemented to allow BASIC and user programs to get and set REFRESH
  state, allowing access while maintaining logical separation of language and
  MOS.
- OSBYTEs 40 and 41 implmented for fine-tuning the ESCAPE polling.
  OSBYTE 40 with X=0 resets to default.
- Screen banks enabled, set at compile time (default is 4). Use with OSBYTE
  112 and 113. Not enabled for MODE 7.
- OSBYTEs 20 and 25 implemented for resetting the system font.
- BB4W/BBCSDL's VDU23,22 implemented to a degree, defining MODE 126.
- MODEs 3 and 6 now have black bars when background colour used.
- RISC OS 3.5-style MODE commands will define a new mode (126) if a previously
  defined mode is not available. The extended RISC OS 5.x format is not
  supported.
- *NewMode extended to allow input of X and Y eigen factors, used internally
  by the MODE "string" format.
- Initial SWI support, currently only a few SWIs are supported.
  No support for external modules, all supported SWIs are part of the
  MOS code.
- examples/teklib updated - this pre-dates SDL support for Brandy, using Tek
  to provide an element of graphics.  This has been updated to use OSBYTE 43
  to send characters to the controlling terminal, so if run from an xterm,
  the old Tek demos once again run correctly as intended.

* V1.21.9 - 10 August 2018
- Implement *REFRESH (based on RTR's BB4W/BBCSDL).
  Possible divergence: An error condition will re-enable Refresh.
- INKEY implementation improved, we now also pick up mouse keys.
- ESCAPE now works within the SDL window. *FX229 also implemented to disable
  or enable ESCAPE.
- Display warnings/help for *NewMode
- Improve rendering of MODEs 3 and 6.
- MODE 7 flash now locked to the centisecond timer.
- MODE 7 screen memory: An earlier omission meant only the byte pointer
  functions worked, now word pointer functions also work.

* V1.21.8 - 07 August 2018
- Networking: Uses getaddrinfo instead of gethostbyname, this also means we
  can connect to IPv6 hosts. The port can be specified by name (as per
  /etc/services) or by number.
- New command *FULLSCREEN - switches SDL fullscreen mode on or off
- Graphics cursor now on right-most point of circle after drawing,
  as per RISC OS.
- VDU5 text plotting is now transparent.
- Resize window on mode change. We also now start in Mode 0, and report
  bad mode to the program if SDL is unable to select the desired mode.
  This has broken the teletext aspect control, so that is for now disabled.
- Can now define your own screen modes with *NewMode.
- INKEY now working with multiple keys.

* V1.21.7 - 03 August 2018
- Bug fixes for Mode 7 flash and Networking
- String handling was not 64-bit clean. Bins are now multiples of 64-bits long.
- Initial framework for building standalone applications written in BASIC.
- Mode 7 now runs with a high-resolution font.
- MOUSE ON and MOUSE OFF control whether or not the mouse is displayed.
  As per RISC OS it is OFF upon mode change.
- Mode 7 glyph width can be changed on the fly to 12, 14 or 16 pixels wide,
  using VDU23,18,255,x| where x is 12, 14 or 16. Other values are ignored.
- New command *WINTITLE - sets the SDL window title bar amd icon text.
- Background operation now working, as is launching from a non-console source
  for example a Window Manager launcher icon.

* V1.21.6 - 27 July 2018
- Implemented some network connectivity. Connect using OPENUP"ip4:host:port".
  Currently only EOF#, BGET# and BPUT# work (both bytes and strings for BPUT)
- New demo: examples/Mode7/telstar - a client for Telstar!
- Fix for bad plotting, again from Coeus @ Stardot. Thank you!

* V1.21.5 - 24 July 2018
- Merged J.G.Harston's "Banana Brandy" fork, and cleaned up some breakages
  caused by this.
- Refactor code to use new mos.c function names, remove aliases from mos.h
- PLOT codes for drawing dotted lines implemented, along with skipping start
  and end points as required.
- Fix behaviour of OPENUP for file not found - thanks Phlamethrower @ *. for
  the pointer.

* V1.21.4 - 18 July 2018
- Slight rename of application to Matrix Brandy, to distinguish between this
  and the "base" version from Sourceforge, and other forks.
- MOUSE commands no longer error as unsupported. Most now no-op, but
  MOUSE X, Y, B[, C] returns mouse position and button state. If specified,
  C contains a centisecond counter.
  (In this implementation, it equals the value of TIME).
- INKEY with negative argument partially supported. (-129 to -255 not supported)

* V1.21.3 - 10 July 2018
- Teletext fixes for edge cases
- Big performance enhancement when running in Mode 7 no-update mode
  (VDU23,18,1,0|)
- Nested FOR..NEXT fix - thanks Coeus @ stardot.org.uk forums for the patch
- *. is remapped to *ls - so running *. now lists the contents of your current
  directory.
- Mode 7 screen memory access, mapped to &FFFF7C00-&FFFF7FFF. Althought Tube
  BASIC didn't directly allow host screen access, this is where it would have
  been mapped for file system access and OSWORD 6. In Matrix Brandy, just access
  the memory directly.  Note that scrolling does NOT move the start address of
  the screen, the top left character cell will ALWAYS be at &FFFF7C00.
- Fix for PLOTting out of range causing a segfault.
- Fix for DRAWing out of bounds on non-scaled modes with < 800x600 resolution.

* V1.21.2 - 06 July 2018
- Mode 7 character frame buffer implemented, line and screen recalculation
  implemented.
- Glyph size changed to 8x9 (was 8x8).
- Implemented some of RISC OS 5's Teletext extensions on VDU23,18. See
  docs/Mode7 for more details.

* V1.21.1 - 03 July 2018
- Software double buffering implemented, Mode 7 Flash supported.

* V1.21.0 - 01 July 2018
- Replaced system font with hand-reconstructed Acorn system font based on that
  found in RISC OS 3.1
- Initial Teletext support. Font similar to the SAA5050, teletext codes handled
  as a stream.
