flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > Hobby BASIC, a simple yet powerful BASIC interpreter

Goto page Previous  1, 2, 3, 4, 5, 6
Author
Thread Post new topic Reply to topic
Picnic



Joined: 05 May 2007
Posts: 1438
Location: Piraeus, Greece
Picnic 15 Jun 2025, 20:11
Hi dosmancer,

I honestly haven’t tried it in WINE, so I can't say for sure. It runs smoothly on Windows 7 and 10, and with a few small tweaks (which I plan to write up soon), it works flawlessly on Windows 11. All 80 example programs have been tested on Windows 11 with no issues.
Post 15 Jun 2025, 20:11
View user's profile Send private message Visit poster's website Reply with quote
dosmancer



Joined: 20 Feb 2025
Posts: 38
Location: Kingdom of Sweden
dosmancer 15 Jun 2025, 21:22
Hi, hi.

Sorry. I tried starting it with `wine HB.EXE` at first but starting it by running `wineconsole HB.EXE` works much better. I see some minor artifacts in Breakout but most of the games I've tried works perfectly!

_________________
fasm68k


Last edited by dosmancer on 15 Jun 2025, 22:34; edited 1 time in total
Post 15 Jun 2025, 21:22
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1438
Location: Piraeus, Greece
Picnic 15 Jun 2025, 22:17
That is very interesting. Thank you for testing it. The “Use Legacy Console” option must be enabled on Windows 10 and 11 for proper functionality in some of the programs. I am not sure how this setting behaves under Wine. Thank you again!
Post 15 Jun 2025, 22:17
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1438
Location: Piraeus, Greece
Picnic 23 Jun 2025, 00:18
Hello everyone,

Hobby BASIC is quietly shaping up as a small game development platform for the Windows console,
combining real-time ASCII graphics and animation with a spirit rooted in the '80s, a look inspired by the '90s, and a simplicity fit for today.

Hobby BASIC v2.3.4 — a stable release with FPU string math support and sample code included.

The online Get Started guide has been updated:

• New examples have been added
• The Troubleshooting section is improved
• A brief note on the new FPU library is included

More detailed documentation about the FPU functions can be found in the full Hobby BASIC manual.

Console-only visuals with character-based rendering — 100% ASCII/ANSI.

Windows 11 Console screenshots.

Image Image Image Image Image

Image Image
Image Image Image
Image Image
Post 23 Jun 2025, 00:18
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1438
Location: Piraeus, Greece
Picnic 08 Aug 2025, 19:55
Hello everyone,

A Boulder Dash-like game featuring ANSI graphics for the Windows 11 console, written in Hobby BASIC.

🔹Collect all gems to unlock the exit door.
🔹A door appears randomly in a different quadrant from the player.
🔹Reach the door before the countdown timer reaches zero.
🔹Remaining time is converted into extra time bonus.
🔹Runs on Windows 10/11 without requiring "Use legacy console" mode.

The game's source code can be found in the folder: EXAMPLES\GAMES\WIN11\BDASH.BAS.
Graphics created with DRAW, the Hobby BASIC graphics tool.

Windows 11 console screenshots.

ImageImage
ImageImage

ImageImage

Image
Post 08 Aug 2025, 19:55
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1438
Location: Piraeus, Greece
Picnic 26 Aug 2025, 22:56
Hello everyone,

Hobby BASIC v2.3.5 — a stable release that now supports direct Win32 API calls via the syscall command.

There are still limitations (32-bit environment, Wide API only, simple structures), but the new capabilities should be quite useful for the size and philosophy of Hobby BASIC.


The syntax is simple:
Code:
    syscall "dllname", "functionname", [arguments...]    


Notes and limitations:

• Wide-character (W) API calls only
• All integers are passed as 32-bit values (DWORD or handles)
• Structures are supported only if fields are DWORD or pointers
• You can simulate structures with DIM arrays and pass them BYREF
• For smaller fields (e.g., WORD), use shifts and masks
• The return value is always stored in system variable V0


syscall command – a few simple examples
Code:
    ! simple message box
    syscall "user32.dll", "MessageBoxW", 0, "Hello from BASIC!", "Title", 0
    


Code:
    ! get current user name
    x = 256
    syscall "advapi32.dll","GetUserNameW", byref a$, byref x
    print "User Name: ", a$
    


Code:
    ! launch calculator
    syscall "shell32.dll", "ShellExecuteW", 0, "open", "calc.exe", 0, 0, 1
    


Code:
    ! milliseconds since boot
    syscall "kernel32.dll","GetTickCount"
    print "Milliseconds since boot: ", V0
    


Code:
    ! RECT structure (4 DWORDs: left, top, right, bottom)
    dim rect[4].ZERO
    syscall "kernel32.dll","GetConsoleWindow"
    hwnd = V0
    syscall "user32.dll","GetWindowRect", hwnd, byref rect[]
    width = rect[2] - rect[0]
    height = rect[3] - rect[1]
    print "Width:", width, " Height:", height
    



To test the new feature,
I’ve added a new folder with API examples, including BALLOON.BAS,
a simple animated scene running in the Windows 11 console, just for demonstration purposes.

Image
Post 26 Aug 2025, 22:56
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5, 6

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.