Skip to content

ceh61/GFX-Basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

107 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GFX-Basic for the rp6502 PicoComputer

GFX-Basic is an enhanced version of EhBASIC for the rp6502 PicoComputer, adding graphics, sound, and improved file handling while staying within classic 8-bit constraints.

For a complete list of commands and syntax, see COMMANDS.md.


A Brief History

Having grown up in the era of 8-bit home computing—and after years of building various electronic kits—the PicoComputer immediately caught my interest. I ordered the circuit board and components, assembled it in about two hours, and brought it to life. After loading the .uf2 files along with the BASIC and terminal ROMs, I spent some time exploring what it could do.

The terminal program was a lot of fun, especially connecting to modern retro BBSes. BASIC, while enjoyable, felt a bit limited in places. Then I came across a video about coding on the PicoComputer with AI and thought:

“Why not see what ChatGPT can do with EhBASIC?”


From Simple Idea to Full Expansion

My original goal was modest: add a CLS command and improve some text formatting.

Two weeks later, the project had grown far beyond that.

Together, ChatGPT and I expanded EhBASIC to include:

  • CLS — Clear screen
  • CLG — Graphics mode select
  • PLOT — Plot a pixel
  • LINE — Draw lines
  • BOX — Draw rectangles
  • CIRCLE — Draw circles
  • SOUND — Generate tones (with NOTEON/NOTEOFF for lower-level control)

What started as a small enhancement became the foundation of a full graphics command set.


Development Experience

My programming background is primarily in BASIC, with only limited experience in C++. Working with AI and tools like VS Code turned out to be both enjoyable and surprisingly productive.

More than once, I thought the project was finished—only to return a day later with another idea:

“Wait a minute… we need to add…”


Expanding Further

As development continued, the project gained:

  • Graphics support
  • Sound support
  • File handling
  • Directory management

Commands added:

  • DIR — Directory listing and drive selection
  • MKDIR — Create directories
  • CHDIR — Change directories

Additional commands and functions include:

  • NOTEON / NOTEOFF — Low-level sound control
  • LOCATE — Position the text cursor
  • COLOR — Set text and background colors (text mode only)
  • EOF() — End-of-file detection for file handling
  • TI — Monotonic 100 Hz system timer
  • TI$ — Realtime clock string in HHMMSS UTC format

TI returns a continuously increasing timer value based on the PicoComputer system clock.

TI$ returns the current realtime clock time as a six-character string:

PRINT TI$

Example output:

153138

Which represents:

15:31:38 UTC

Notes:

  • TI$ always returns UTC time, not local timezone time.
  • Programs requiring local time should apply their own timezone offset.
  • LEN(TI$) always returns 6.
  • TI$ is inspired by Commodore BASIC but implemented specifically for the RP6502 PicoComputer environment.

See COMMANDS.md for full details and syntax.

At this point, the system felt nearly complete.


The One That Got Away: RMDIR

There was just one command left to add:

  • RMDIR — Remove directory

This is where reality set in.

To support all features, available RAM for BASIC had already been reduced from 52 KB to ~37 KB—roughly comparable to a Commodore 64.

Rather than reduce memory further, development stopped here.


Final Notes

GFX-Basic is:

  • Feature-rich
  • Compact
  • Built within authentic 8-bit-style constraints

While you can create and navigate directories with:

  • MKDIR
  • CHDIR

Removing directories must be done via:

  • The system monitor
  • Another computer

Documentation

For detailed command syntax and usage, see:


Closing Thoughts

GFX-Basic reflects both modern experimentation and classic limitations—a blend of AI-assisted development and retro computing philosophy.

And honestly… that feels exactly right.

Development Environment

This repository includes a .vscode configuration inherited from and compatible with the RP6502/EhBASIC PicoComputer development workflow.

About

Making EhBASIC Better on the RP6502 PicoComputer

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors