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

* V1.22.1
- 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, a
  s 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.
