8 Bit Retro Programming with uGBasic

in #programming2 months ago (edited)

UGBasic is an open-source language designed to create programs for multiple 8-bit systems, all without sacrificing efficiency.

With a single program you can build games for a variety of classic hardware.

uGBasic supports a whole range of target computers, including:

  • Amstrad
  • Atari
  • ColecoVision
  • Commodore
  • Dragon 32
  • MSX
  • TRS-80
  • Thomson
  • Sega
  • ZX Spectrum

Not all functions are available on every platform, as you might expect and as well as the compiler and/or IDE, to test the game you’ll also need the emulator or physical hardware for the target machine.

Getting Started with uGBasic

The quickest way to try it out is with the browser-based "sandbox" at sandbox.ugbasic.io. There, you can open example files and code directly in the browser. This option is great for testing, but keep in mind you cannot save your work or write programs that use files.

If you are on Windows or Linux, you can download and install the uGBasic compiler from the official site. Once installed, you can code and compile programs directly on your local system.

For Windows users, the best coding experience is the uGBasic IDE available for purchase on itch.io. The IDE streamlines the process of writing, testing, and building UGBasic code.

Working with the IDE

After downloading and installing the IDE, you’ll want to configure it for the platforms you plan to target.

Remember to set the path to your emulator too in the IDE.

Hello World Example

A simple “Hello World” program in uGBasic:

Open the IDE and create a new file and enter the following:

PRINT "Hello World"

Commands like PRINT must be in uppercase. The IDE will highlight them in blue.

Save your file, then go to Build and click Run. The IDE will compile your code and launch it in the specified emulator.

uGBasic also supports more advanced features such as loading images and vector line art:

Screenshot by Dropbox Capture.png

Screenshot by Dropbox Capture.png

There is a manual available plus a Facebook group or Forum for if you get stuck.

Sort:  

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.