flat assembler
Message board for the users of flat assembler.
Index
> Tutorials and Examples > Hobby BASIC, a simple yet powerful BASIC interpreterGoto page Previous 1, 2, 3, 4, 5, 6 |
| Author |
|
|
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! Last edited by dosmancer on 15 Jun 2025, 22:34; edited 1 time in total |
|||
|
|
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!
|
|||
|
|
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.
![]() |
|||
|
|
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. ![]()
![]()
![]()
![]() |
|||
|
|
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. ![]() |
|||
|
|
Picnic 01 Oct 2025, 22:28
Hello everyone,
New projects recently added to the Hobby BASIC EXAMPLES collection: • Super Tiny BASIC - A minimalist 80s-style BASIC interpreter written entirely in Hobby BASIC. • Lunar Lander - A modern implementation of the classic game with physics simulation and graphics. • Retro Climber - A classic platform game featuring puzzle challenges with pushing and climbing. • Chain Reaction - A puzzle game where the goal is to match either color or shape to clear the board. All programs are written entirely in Hobby BASIC 2.3.5. For Chain Reaction, as with Lunar Lander, the "Use Legacy Console" option must be enabled under Windows 10/11. Windows 11 Console Screenshots. ![]() |
|||
|
|
chastitywhiterose 06 Nov 2025, 05:40
QBASIC was my first programming language and got me started on my path to C and Assembly. I will recommend this as one of the BASIC interpreters for people new to programming. I haven't used BASIC for a long time, but it certainly has enough power to write almost anything.
|
|||
|
|
Picnic 06 Nov 2025, 12:33
Thanks for sharing your experience!
QBASIC definitely has its place in history, many of us started there. Hobby BASIC is something quite different though: it’s my own small project for Windows, built just for fun and learning. I’m developing it in my spare time, so it’s not really about comparing, just exploring and keeping the BASIC spirit alive. |
|||
|
|
Picnic 08 Nov 2025, 03:26
Hello everyone,
Laser League is a faithful remake of an original PuzzleScript game, rewritten in Hobby BASIC with ANSI graphics for the Windows 11 console. Lead a team of three heroes to solve laser puzzles and recover the stolen jewels from the Robber Baron! This remake was created with permission from the original PuzzleScript author, Tim Knauf. The heroes: 🔹 Bridget – strong and steady, pushes crates to block laser beams 🔹 Sophie – agile acrobat, rolls safely under active lasers 🔹 Zelda – small and quick, slips through tight spaces others can’t How it plays: 🔹 Lasers travel across rooms until they hit a wall or crate 🔹 Switches turn lasers on and off 🔹 Includes movable crates, collectible gems, tutorial screens, and a final boss 🔹 Each character has a unique death animation when hit by a laser Tech details: 🔹 ANSI-style graphics with 16 colors 🔹 Smooth tile-based rendering (5x5 pixels per tile) 🔹 Undo system – go back up to 1000 moves 🔹 13 levels with increasing challenge 🔹 Sound effects for actions and events Source code: EXAMPLES\GAMES\WIN11\LASER.BAS Graphics: Created with DRAW, an ANSI art editor written entirely in Hobby BASIC Screenshot: Taken directly from the Windows 11 console ![]() |
|||
|
|
Picnic 30 Nov 2025, 22:31
Hello everyone,
Stephen’s Deadly Rooms of Death is a faithful remake of an original PuzzleScript game, rewritten in Hobby BASIC with ANSI graphics for the Windows 11 console. Become a master of swordsmanship in this turn-based tactical puzzle game. Move strategically and use your sword to defeat your enemies. Features: 🔹 ANSI graphics with 16 colors 🔹 Smooth tile-based rendering (5×5 pixels per tile) 🔹 Sword handling (pick up, rotate, push) 🔹 Enemies that move toward the player when in line of sight 🔹 Combat system with different rules for enemies and bosses 🔹 9 levels with increasing difficulty 🔹 Sound effects for actions and events 🔹 Full UNDO system Source code: Located in EXAMPLES\GAMES\WIN11\SWORD.BAS Graphics: Created using DRAW, the ANSI art program written entirely in Hobby BASIC Screenshot: Taken directly from the Windows 11 console ![]() |
|||
|
|
Picnic 10 Dec 2025, 23:31
Good day, everyone.
Upcoming version 2.4.1 of Hobby BASIC enhances the continuation character, the backslash (\), adding new capabilities. This seemingly minor but significant extension fundamentally reshapes Hobby BASIC syntax moving forward. ► Continuation character example prior to version 2.4.1: Code: print \ "hello" Equivalent to: print "hello" The limitation in previous versions: The line immediately after the \ character could not be empty nor contain comments - it had to directly continue the command. Examples causing syntax errors: Code: print \ ← empty line "hello" Code: print \ ! This is a comment "hello" I hadn't anticipated this syntax, even though it's absolutely logical and expected by users. The new version 2.4.1 corrects this oversight. Let's see the example again: Code: print \ ! Continue to next line ! <-- This empty space is now allowed in 2.4.1 "Hello world" ! Command completes here The difference is significant: it provides greater flexibility in code and, by extension, for the programmer, while simultaneously improving readability. ► Line Continuation Support for the TIMES command! The TIMES command: • Executes commands multiple times in one line • Uses the V3 variable as counter (zero-based: 0 to n-1) • Accepts multiple commands separated by colon : • Creates inline loops without needing separate FOR/NEXT lines Example: Code: times repeatCount swap 0, 0, 80, 11, 0, 12 : title repeatCount-V3 : wait 120 Equivalent to: Code: FOR i = 0 TO repeatCount-1 swap 0, 0, 80, 11, 0, 12 title repeatCount-i wait 120 NEXT i TIMES didn't support the continuation character. With version 2.4.1 we can break loops into multiple lines using the backslash (\) character! Old syntax (up to 2.4.0): Code: times 10 print "Hello" : print "World" : wait 100 Or even worse for nested loops: Code: times 5 times 5 print "X:", V3;" Y:", V3 New syntax (2.4.1): Code: times 10 \ print "Hello" : \ print "World" : \ wait 100 ► TIMES continuation examples: Test 1: Basic test with single line Code: times 3 print "Hello" Test 2: Multi-line with backslash Code: times 3 \ print "Line 1" : \ print "Line 2" : \ print "Line 3" Test 3: Backslash inside quotes Code: times 2 \ print "This has backslash \\ in string" : \ print "Another with '\' quote" Test 4: Complex expressions with arithmetic Code: times 4 \ x = V3 * 10 : \ print "Iteration ", V3, " value ", x Test 5: Nested commands with graphics Code: times 5 \ color \ RND(15), RND(15) : \ paint V3*5, V3*5, 5, 5, -1, 1 Test 6: With empty line continuation Code: times 3 \ print "Start" : \ \ print "Middle" : \ \ print "End" Test 7: Multiple backslashes on different lines Code: times 2 \ a = 1 : b = 2 : \ \ c = a + b : \ \ print "Sum = ", c : \ \ wait 100 Test 8: Backslash at end without space Code: times 3 print "Test"\ : print "Continued" Test 9: Backslash with empty lines and comments Code: times 3 \ ! Comment \ print "Hello" : \ print "World" Test 10: Zero count Code: times 0 \ print "This should not print" print "Skipped" ► Advanced TIMES continuation examples: Nested TIMES Code: print "Nested TIMES test:" times 2 \ print "Outer ", V3, ":" : \ times 3 \ print " Inner ", V3 inkey Nested FOR/TIMES with Full Continuation Support Code: for \ outer = 1 \ to 3 \ print "┌─ OUTER ITERATION ", outer, " ───────────────────────┐" : \ for \ middle = 1 \ to 4 \ print "│ Middle: ", middle, " " : \ times \ 2 \ print "│ Times[", V3, "] " : \ if \ V3 = 0 \ then \ print "First " : \ else \ print "Second" : \ print "│" next \ middle : \ print "└──────────────────────────────────────────────┘" : \ print ! Blank line next \ outer Dynamic Array Average Calculation Code: forever# dim data[5,5].RND 10000 data[].SIZE array_length = V0 times array_length : \ sum = 0 : \ times 5 \ value = data[V3,V3] : \ sum = sum + value : \ average = sum / 5 : \ print "row ", V3, " average: ", average goto forever With each iteration, I aim to make Hobby BASIC's syntax more programmer-friendly while keeping its BASIC DNA intact. Hobby BASIC is built from scratch in 100% Win32 Assembly, hand-coded parser, zero dependencies, straight byte crunching. ► New Examples in version 2.4.1 Two new examples have been added in the 2.4.1 update: CIRCLES.BAS - Multiple Random Circles Generator Creates random circles with different sizes, colors, and positions. EQUALIZER.BAS - Fully Parameterizable Equalizer / VU Meter Visual equalizer simulation with moving bars that react to random values. Screenshots from Windows 11 console. ![]() |
|||
|
| Goto page Previous 1, 2, 3, 4, 5, 6 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.