Software-update: QB64 Phoenix Edition 4.0.0

QB64 Phoenix Edition logo (Über)QB64 is een moderne versie van de programmeertaal BASIC. De code wordt gecompileerd naar machinetaal en is daardoor snel en kan er worden gelinkt naar externe C- en C++-programmeerbibliotheken. Het is nagenoeg volledig compatibel met QBasic 4.5 en biedt ondersteuning voor extensies, zoals OpenGL. Nadat Fellippe Heitor drie jaar geleden plotseling bij QB64 vertrok werd het erg stil rondom dit project. Een nieuwe groep ontwikkelaars heeft met QB64 Phoenix Edition echter een doorstart gemaakt. Net als QB64 is QB64 Phoenix Edition opensource, beschikbaar voor Windows, Linux en macOS, en heeft een goede support forum. Versie 4.0.0 is uitgekomen en de releasenotes daarvan kunnen hieronder worden gevonden.

QB64 Phoenix Edition 4.0.0

Long time announced, now finally done and the main reason for us to give this release a major version bump, is the deprecation of $NOPREFIX. But no worries, we've added a converter which will automatically transform your old $NOPREFIX using programs back to the regular underscore using syntax as soon as you open such a program. Aside from some subtle side cases, the converter should perfectly do its job without requiring further manual adjustments afterwards.

Moreover the new version got a big audio library update with lots of new features, and a comprehensive new logging system which will help debugging and streamlining your programs. These two had been probably worth a major version bump by itself. Also to highlight is the addition of several new precompiler flags and a huge set of preset constants for use in your programs.

Breaking changes
  • #544, #548 - Complete deprecation of $NOPREFIX.
  • #553 - Added automatic $NOPREFIX to underscore usage converter, triggered when a file using $NOPREFIX is opened in the IDE. If the user agrees to convert, a backup of the file and any includes are made.
Enhancements
  • #535 - Relax ALIAS function name validation, closing issue #493.
  • #536, #571, #572 - The "Export As ..." feature now checks for an active selection first. If there is one, only the selected code is exported, otherwise the entire source will be exported as usual. Plus some adjustments for new commands.
  • #550 - added new _MOUSEHIDDEN function.
  • #558 - Implements the _QB64PE_ precompiler flag, closing issue #551.
  • #561 - Various enhancements to the IDE and the Compiler.
    • Now showing the syntax for all user defined SUBs and FUNCTIONs for better reference in the status messages.
    • Added lots of preset constants available in every program by default.
    • Added _MIN, _MAX, _ENCODEURL$ and _DECODEURL$ functions.
  • #562 - The HTTP support for _OPENCLIENT is stabilized now, $UNSTABLE:HTTP is no longer required. Also added the _DEBUG_ precompiler flag, closing issue #29.
  • #565 - The big audio library update.
Lot of things:
  • PLAY now ignores the ";" character as QB4.5 did, fixing issue #554
  • Adds Pink noise, Brownian noise, LFSR noise, pulse, and custom (_WAVE) waveform support to SOUND & PLAY
  • Adds support for ADSR envelope for SOUND & PLAY
  • Adds multi-channel (4 voice) support for SOUND & PLAY
  • Adds SOUND WAIT and SOUND RESUME support for multi-channel for SOUND & PLAY
  • Adds Amiga Basic like _WAVE command, closing issue #187
  • Adds support for _SNDRAWBATCH that can push a batch of audio sample frames at once compared to just one frame that _SNDRAW supports
  • Moves BEEP out of the audio library, i.e. a simple BEEP no longer pull in the entire audio library
  • Restores CHR$(7) beep support (due to the above change)
New commands and enhancements:
  • SOUND frequency!, duration![, volume!][, panning!][, waveform&][, waveformParameters!][, voice&]
  • SOUND WAIT
  • SOUND RESUME
  • PLAY voiceCommands1$[, voiceCommands2$][, voiceCommands3$][, voiceCommands4$]
  • remainingTime# = PLAY([voice&])
  • _WAVE voice&, waveDefinition%%([index&])[, frameCount&]
  • _SNDRAWBATCH array!([index&])[, channels&][, handle&][, frameCount&]
PLAY MML language improvements:
  • Wn / @n: waveform select (1 = SQUARE, 2 = SAWTOOTH, 3 = TRIANGLE, 4 = SINE, 5 = NOISE_WHITE, 6 = NOISE_PINK, 7 = NOISE_BROWNIAN, 8 = NOISE_LFSR, 9 = PULSE, 10 = CUSTOM_WAVE)
  • /n: attack (percentage of total note time 0 - 100)
  • \n: decay (percentage of total note time 0 - 100)
  • ^n: sustain (percentage of MML volume 0 - 100)
  • _n: release (percentage of total note time 0 - 100)
  • Yn: extra params for current waveform (percentage 0 - 100 - usually for pulse wave)
  • Sn: pan position (0 to 100) where 0 is leftmost and 100 is rightmost
  • R / P: rest / pause
  • V+ & V-: Volume increment / decrement (single-step & clamped)
  • S+ & S-: Pan right / left (single-step & clamped)
  • #566, #583 - Add built-in logging support.

This adds new logging capabilities to QB64, both internally from libqb and also exposed to the QB64 code. Beyond being a bit nicer than a Print since it captures the function name and line number, a big feature is that logging an error captures a stacktrace of the program at that point. Logging can also easily be turned on without recompilation via environment variables, and can be filtered via various scopes and a couple different logging levels. Overall this should hopefully be a big aid for debugging, as we can ask users to provide us with the logging output of programs when they error.

Below is an example of some logging from a QB64 program (note how the IDE opens a separate console window to display it):

The new commands are _LOGTRACE, _LOGINFO, _LOGWARN, _LOGERROR and _LOGMINLEVEL. The first four write out log messages at the indicated log level. The last returns a number indicating the lowest level of logging is enabled, allowing you to skip generating more expensive logging if it won't be displayed.

Logging is enabled via a variety of different environment variables (when run from the IDE these are configured automatically):

  1. QB64PE_LOG_LEVEL - sets the lowest log level to display, options are Trace, Information, Warning, Error
  2. QB64PE_LOG_SCOPES - A comma-separated list of different sets of logging to turn on, allowing basic filtering of what is displayed. Options are:
    a. libqb - Some generic logging from libqb, such as error codes when they happen, program startup/shutdown, etc.
    b. libqb-image - Logging from the image subsystem (when images are loaded,freed, errors that happen, etc.)
    c. libqb-audio - Logging from the audio subsystem
    d. qb64 - Logging from the QB64 Program ( _Log* statements)
  3. QB64PE_LOG_HANDLERS - A comma-separated list of the logging handlers to enable. If no handlers are enabled, then no logging is generated. Current options are:
    a. console - Logging output is written to the console.
    b. file - Writes logs to the file set via the QB64PE_LOG_FILE_PATH environment variable

Currently the IDE just defaults to using Information and enabling all the scopes, in a future update I'd like to have an IDE dialog that lets you pick the log level and scopes.

  • #567 - Added new function _TOSTR$ which supports the full _FLOAT range. Also added _ASSERTS_, _CONSOLE_, _EXPLICIT_ and _EXPLICITARRAY_ precompiler flags.
  • #574 - Added the _IIF function for conditional evaluation like the ternary operator in C, with short-circuiting behavior, closing issue #403.
  • #581 - Lifts the restrictions of doing arithmetic with _OFFSET in expressions. Also added the new function _CAST, which works like explicit type casting in C.
  • #582 - Added new function _CLAMP and a set of functions dealing with the HSB colorspace in symmetry with the RGB functions, namely _HSB32, _HSBA32, _HUE32, _SATURATION32 and _BRIGHTNESS32.
Bug fixes
  • #534 - Allows users to revert to the built-in soundbank by passing an empty string to _MIDISOUNDBANK. Before it was not possible to switch back to the default soundbank once an external one had been used with _MIDISOUNDBANK.
  • #537 - Fixed some wrong Wiki links in exported code.
  • #546 - Update clipboard library to latest, fixing issue #541.
  • #557 - Fixed a bug where KILL, FILES, and _FILES$ unintentionally shared a static DIR pointer when performing file searches. As a result, calling any of these functions would reset the search state of _FILES$, leading to unexpected behavior. This issue was reported here.
  • #560 - Fixed unary negation when using CONST, closing issue #542.
  • #568 - Reloading a MIDI file with a different soundfont now works as expected, also _MEMSOUND now works correctly with fully decoded MEMORY sounds.
  • #570 - Removes the voice range check in _PLAY (function). If the voice is out of range, it now simply defaults to zero, aligning the behavior with QB4.5 standards.
  • #574 - Resolved an issue in _ROL and _ROR, where the second argument could incorrectly be a STRING.
Internal changes
  • #539, #585 - Switch to LLVM MinGW C++ compiler on all Windows architectures.
  • #538, #540, #543, #547 - Enable globbing by default and silence lots of C++ compiler warnings.
  • #548, #550 - Complete removal of rotten Android remains, i.e. $VIRTUALKEYBORD and friends.
  • #569 - Various libqb refactoring, silence more C++ compiler warnings.
  • #588 - Tidy up the markdown files in the repository

QB64 Phoenix Edition screenshot

Versienummer 4.0.0
Releasestatus Final
Besturingssystemen Linux, macOS, Windows 8, Windows 10, Windows 11
Website QB64 Phoenix Edition
Download https://github.com/QB64-Phoenix-Edition/QB64pe/releases/tag/v4.0.0
Licentietype GPL

Door Bart van Klaveren

Downloads en Best Buy Guide

17-12-2024 • 07:30

3

Submitter: zaadstra

Bron: QB64 Phoenix Edition

Update-historie

Reacties (3)

3
3
3
0
0
0
Wijzig sortering
Heb zelf nog verschillende Quick Basic programma's, gemaakt in QB4.5. Toch wel benieuwd naar deze implementatie, dus even downloaden dan maar en kijken wat 't doet met mijn oude code. Geslaagd dat men dit nog steeds ontwikkelt.

Edit: Gedownload, geïnstalleerd. In hun documentatie geeft men aan dat je de installatiemap moet white-listen voor anti-virus software. Defender Smartscreen geeft in elk geval een waarschuwing, toch maar niet gebruiken, val wel terug op DosBox en QB4.5.

[Reactie gewijzigd door Server.1968 op 17 december 2024 07:57]

Ik heb ooit de grootste qbasic website gehad (qb45.com). Leuk om te lezen dat er een moderne variant is!
Voor de fun, misschien weet jij mijn code wel te waarderen. Wel slecht becommentarieerd vrees ik.
https://metric.science/download/dbmove.bas.txt
En als je direct output wil zien: https://metric.science/video/dbmove.mp4

Op dit item kan niet meer gereageerd worden.