NEWS ARTICLES


Testing replacement LinkDLL block parser PlayBASIC V1.65

PlayBASIC V1.65C3 - Beta 38/39 - Testing replacement LinkDLL block parser

  My Goals to finalize PlayBASIC V1.65 edition is to round it out..  Smoothing whatever edges that were left behind during the Compiler->VM translation progress that was made now years ago.. Too many years ago ! 

  This adventure (some would call it a nightmare) has seen me work through the built in libraries from obvious changes / nice to have things... like resorting Sprites / Images back to it's original specification, fleshing out ink mode support even more for graphical commands..  Through to replacing the scene sorting / the world partitioning /  replacing the arena allocation libraries used mostly in the Maps libraries..  Stuff I could have left, but felt those components needed some attention.  In fact all the legacy stuff needs a good shake down.  But I only have so much time.. 

  The command sets help the runtime abilities of PlayBASIC, but the compiler is how uses communicate intend through the command sets.  So making the language syntax smoother / more consistent is something I'd always slated as a PlayBASIC 2 thing..  But really those ideas work in either version.   

  Now I'm sure we all have a list of annoying syntactical things in the legacy editions of PlayBASIC, but the ones that still bother me are the one I would run into while writing things.

  For example, while writing the PolyWOLF demo(s) I actually ran into some of the recent syntax changes..  What have loving to be able to read the Handle from an array into and integer directly,  still change use them within expressions, but just being able to read the handle saves having to write helper functions to gain access to it.  Then ran into the MakeArray syntax only supported the legacy short hand..  For counter variables had to be declared while in explicit modes.  Etc.. 

  None of those are earth shattering by themselves, but they do create little frictions when writing code..

  Another area that was missing some this syntactical consistency was the LinkDLL->EndLInkDLL blocks.  Luckily a lot of this compiler / parser segmentation occurred during the initial transition from PlayBASIC V1.64 ->V1.65.  Since the compiler and Vm had be made to work more inline with each other.  So this when the compiler encounter a keyword, it passes control to a parser function that decodes the block..

  So while looking over these blocks, I kept wondering if any of them could be replacement and and LinkDLL blocks jumped out at me initially.. Namely the parameter syntax for those blocks expects the same short hand as old statements would use.  So i wrote a external replacement for those linkdll parser just to see how ugly stepping through all the existing and new cases would be,  yeah... it's a little more code than the classic approach, but more of focused.

    The main benefits from replacing such blocks are two fold. 

    1) Syntax is more inline with other declaration statements

    2) Can supports Pointers (User Defined Types) directly


    Just allowing a pointer types through the declarations alone makes like easier for library authors. 


    This is just example block the parser can decode,

PlayBASIC Code:
LinkDll "Some.dll"

    This() alias "cool"
        
    zTest1() alias "cool" 
    zTest2() alias "cool" as integer

    zTest100(a=100) alias "cool" 

    zTest1() alias "cool" 
    zTest2() alias "cool" as integer
    zTest3() alias "cool" as float
    zTest4() alias "cool" as string
    zTest5(A remstart hello world remend ) alias "cool" as string

    zTest6(ptr as byte) alias "cool"
    zTest7(ptr as word) alias "cool"
    zTest8(ptr as integer) alias "cool"
    zTest9(ptr as float) alias "cool"
    zTest10(ptr as string) alias "cool"
    zTest11(ptr as pointer) alias "cool" as string
    zTest12(ptr as byte pointer) alias "cool"
    zTest13(ptr as word pointer) alias "cool"
    zTest14(ptr as integer pointer) alias "cool"
    zTest15(ptr as float pointer) alias "cool"

        zTest200(a=100, b#= 123.456, c$="Hello World") alias "cool" 
    ;    zTest300(myarray()) alias "cool" 

    rem yeah

    /*  this is a comment */

    zTest20(a,b#,    c$    ,D as byte,E as word,P as pointer,PB as byte pointer,PW as word pointer, PI as integer pointer, PF as float pointer ) alias "cool"

    zTest(MyInt,MyFloat#,MyString$, A as integer , B as float ,C as string) alias "cool"  rem yeah 

    xCreateLine3D(fromX#, fromY#, fromZ#, toX#, toY#, toZ#, red, green ) Alias "_xCreateLine3D@44" As Integer
    xLine3DOrigin(line3d, x#, y#, z#, isGlobal) Alias "_xLine3DOrigin@20"
    xLine3DAddNode(line3d, x#, y#, z#, isGlobal) Alias "_xLine3DAddNode@20"
    xLine3DUseZBuffer(line3d, state) Alias "_xLine3DUseZBuffer@8"
    xLine3DRed(line3d) Alias "_xLine3DRed@4" As Integer
EndLinkDLL
COMMANDS USED: LINKDLL | ALIAS | INTEGER | FLOAT | STRING | BYTE | WORD | POINTER | ENDLINKDLL |
   

   
  Output:

CODE:

LINKDLL:"Some.dll"
This() alias "cool"
zTest1() alias "cool"
zTest2() alias "cool" as Integer
zTest100(a as Integer = 100) alias "cool"
zTest1() alias "cool"
zTest2() alias "cool" as Integer
zTest3() alias "cool" as Float
zTest4() alias "cool" as string
zTest5(A as Integer) alias "cool" as string
zTest6(ptr as Byte) alias "cool"
zTest7(ptr as Word) alias "cool"
zTest8(ptr as Integer) alias "cool"
zTest9(ptr# as Float) alias "cool"
zTest10(ptr$ as string) alias "cool"
zTest11(ptr as Pointer) alias "cool" as string
zTest12(ptr as Byte Pointer) alias "cool"
zTest13(ptr as WORD Pointer) alias "cool"
zTest14(ptr as INTEGER Pointer) alias "cool"
zTest15(ptr as FLOAT Pointer) alias "cool"
zTest200(a as Integer = 100 , b# as Float = 123.456 , c$ as string = "Hello World" alias "cool"
zTest20(a as Integer , b# as Float , c$ as string , D as Byte , E as Word , P as Pointer , PB as Byte Pointer , PW as WORD Pointer , PI as INTEGER Pointer , PF as FLOAT Pointer) alias "cool"
zTest(MyInt as Integer , MyFloat# as Float , MyString$ as string , A as Integer , B# as Float , C$ as string) alias "cool"
xCreateLine3D(fromX# as Float , fromY# as Float , fromZ# as Float , toX# as Float , toY# as Float , toZ# as Float , red as Integer , green as Integer) alias "_xCreateLine3D@44" as Integer
xLine3DOrigin(line3d as Integer , x# as Float , y# as Float , z# as Float , isGlobal as Integer) alias "_xLine3DOrigin@20"
xLine3DAddNode(line3d as Integer , x# as Float , y# as Float , z# as Float , isGlobal as Integer) alias "_xLine3DAddNode@20"
xLine3DUseZBuffer(line3d as Integer , state as Integer) alias "_xLine3DUseZBuffer@8"
xLine3DRed(line3d as Integer) alias "_xLine3DRed@4" as Integer
ENDLINKDLL



    The nice thing about the replacement is not only can it parse the existing code we can extend it without breaking it too badly..  I'll have to insert some of the original errors mind you... but I should be able to compare the new and old versions side by side..  Which is pretty handy..   

    Something I didn't notice before was the original LinkDLL parser had a way to embed the DLL into the program as PlayBASIC resource.  This is done by adding the "*" character in front of the initial DLL name. 

    Eg.

    LinkDLL "ExternalLIbrary.DLL"

    This would load it from disc externally.


    LinkDLL "*ExternalLIbrary.DLL"

    This version would pre-load the DLL into a resource in memory during compile time and then load the DLL from memory at runtime.


    Which is fine, but given the descriptive native of PlayBASIC, it's probably best add a keyword to make such declarations that little more obvious to the reader. 

    Something like

    LinkDLL "ExternalLIbrary.DLL" as resource

    LinkDLL "ExternalLIbrary.DLL" attach resource


    That sort of thing. 


    Mind you can just use the  #AddResource directive which would load the file into the PlayBASIC resource buffer.

PlayBASIC Code:
    #AddResource "ExternalLIbrary.DLL"
    LinkDLL "ExternalLIbrary.DLL" as resource

      etc etc

    EndLInkDLL
COMMANDS USED: LINKDLL | ENDLINKDLL |


    None of this matters when compiling and running from the PlayBASIC IDE though, the resource bundle is only built when exporting program into the final EXE..  (Retail Editions of PlayBASIC)

   

PlayBASIC V1.65C3 Beta 35 Development Blog

In this update (recorded September 4th, 2025), we dive into the latest progress on the PlayBASIC v1.65 revision. This session covers key language tweaks, compiler improvements, and a few long-standing “gotchas” that have now been ironed out.

What’s inside this update:

- Undim All command – A look at its history, how it worked globally in older versions, and the safer scope-based behavior in the current build.

- Array handles & assignments – You can now directly assign array handles to variables, removing the need for extra wrapper functions.

- Global/Local statements – Fixes to edge cases and error handling, ensuring clearer scoping rules and preventing compiler confusion.

- Improved phrasing for declarations – More robust support for `global`, `local`, and `static` statements, plus expanded syntax options for declaring variables and arrays.

- Compiler enhancements – Behind-the-scenes changes to the phrasing system for cleaner, more consistent parsing of declarations, and better handling of remarks and stacked declarations.

- Debug examples – Practical demonstrations of the updated syntax, showing how variables and arrays behave across scopes.

These changes are all about smoothing out inconsistencies, making code more predictable, and giving PlayBASIC programmers clearer tools when working with variables, arrays, and scopes.

If you’ve ever been puzzled by odd behavior with `undim all`, global variables declared inside functions, or inconsistent declaration rules—this video breaks down what’s changed and why.

👉 Stay tuned for more progress updates as PlayBASIC v1.65 heads toward its next release!




⏱️ Timestamps

0:00 – Introduction & update overview
0:30 – The **Undim All** command (history & scope-based behavior)
3:06 – Assignments with **array handles** (new shorthand)
5:01 – **Global / Local statements** update & error handling
7:38 – Revised **Global phrasing** and declaration improvements
11:00 – Debugging examples & scope behavior
14:01 – Remarks, stacked declarations & limitations
16:06 – Dim, Local, and Static differences explained
17:16 – Compiler phrasing improvements (new approach vs. old lexer)
19:30 – Wrapping up & what’s next



PlayBASIC V1.65C3 Beta 25 Development Blog

PlayBASIC V1.65C3 Beta 25 Development Blog - Summary

In this update, I dig deep into the behind-the-scenes technical work that’s been rounding off the PlayBASIC 1.65 release. Over the past couple of weeks, I’ve been fixing missing blend modes, resolving allocation issues in the mapping libraries, and tackling a series of elusive compiler bugs.

The main challenge was discovering and fixing fixed-size tables inside the compiler — such as function, label, and patch address tables — that could overflow when compiling large projects. I added dynamic expansion to these structures, improved their efficiency, and tracked down a particularly nasty overflow caused by optional parameter handling. This now allows PlayBASIC to successfully compile and run the largest programs in its history — over 10,000 lines — with quick, responsive recompiles.

I also showcased improvements to memory allocation in the mapping libraries, including a robust arena-based system that speeds up tile map handling, prevents silent crashes, and provides clearer runtime error messages when allocations go out of control. These changes greatly enhance stability and pave the way for further optimizations, such as reusing the allocator in other parts of the legacy command set.

Beyond the core engine, I’ve been reviewing and updating the example pack, tweaking controls, ensuring windowed mode starts by default, and making old demos more compatible with modern builds.

Overall, Beta 25 feels faster, more stable, and more robust than ever, setting the stage for future PlayBASIC 2 development while ensuring the current version remains as polished as possible.

Index:

0:00 – Welcome & blog overview
0:24 – Final cleanup for the 1.65 release
0:49 – Xors3D library & Direct3D dependency
1:33 – Tracking down compiler crashes
2:42 – Function and label table overflows
7:58 – Patch list system explained
12:58 – Fixing the optional parameter crash
17:00 – Compiling the largest PB program ever
22:20 – Arena-based memory allocation
27:06 – How map level data is stored
33:05 – Preventing silent crashes on big allocations
39:01 – Updating the example pack & demos
43:57 – Wrap-up & future plans for PlayBASIC 2




PlayBASIC Website Bug Fixes (Aug 2025)

PlayBASIC Website Bug Fixes (Aug 2025)

We're continuing to update PlayBASIC website to bring you a faster, cleaner, and more feature-rich experience.

Some pages may be temporarily unavailable or look a little strange while we finish the transition — hang tight, it won't be long!

Thank you for your patience and continued support.


Fixes:

  - Some case sensitivity issues prevented Article Parser from working  (2025-06-13)
  - Email Support restored (2025-06-13)
  - Fixed file path that wouldn't allow users to download their products from their account.
  - Fixed password reset (2025-06-26)  (Read News)
  - Fixed TOOLS attachments which were broken on the server ...  (2025-06-27)
  - Fixed SOURCE CODE attachments are broken on the server ...  (2025-06-27)
  - Fixed GETFILE attachments were broken on the server ...  (2025-08-10)


PlayBASIC V165C3 Beta 15 Quick Dev Blog Expanding Inkmode Support in Scene Buffer

PlayBASIC V165C3 Beta 15  - Quick Dev Blog - Expanding Inkmode Support in Scene Buffer

In this quick development update, we take a look at the ongoing integration of **variable alpha blending** support for polygon rendering within the **scene buffer system** in PlayBASIC. Classic versions lacked full support for per-polygon alpha levels when capturing filled, Gouraud-shaded, and textured polygons into the scene.

This update showcases how surfaces—like walls and objects—can now retain and display their individual alpha values when rendered to the scene buffer, allowing for more dynamic and layered visual effects. The video demonstrates various polygon types with unique alpha levels, including previously unsupported modes like **Gouraud shading** and **textured alpha subtraction**.

Some rendering bugs and quirks are also highlighted, such as partial shading on the ground layer, creating unintentional but visually interesting effects. It's all part of the development process as alpha blending becomes more flexible and fully integrated into the rendering pipeline.

Whether you're a PlayBASIC veteran or just diving into scene rendering, this update shows promising steps toward a more expressive and capable 2D engine.