Skip to content

RP6502 EhBASIC graphic-plotting support - two screen dimensions

Pre-release
Pre-release

Choose a tag to compare

@netzerohero netzerohero released this 10 Jan 21:47
· 3 commits to main since this release
61b3cd0

Demonstration-code of initial graphic-plotting support to EhBASIC described at https://github.com/picocomputer/ehbasic/issues/2#issuecomment-1868562547.

New 10-Jan-2023: two screen dimensions are supported.

Four new commands are available using EhBasic's "CALL" keyword. Plotting command callable from EhBASIC.
The commands are:

  • HGR,screen_dimension - initializes graphics screen mode
    • CALL HGR,0 - selects 320h x 180v x 8bpp mode (16:9 letterbox);
    • CALL HGR,$FF - selects 320h x 240v x 4bpp mode (4:3 fullscreen)
  • HPLOT,x,y,color - paint a pixel of 'color' at x,y on the screen.
  • TEXTMODE - return VGA-screen back to console/text mode
  • CLS (or HOME) - clear the console/text screen.

Assumptions / Limitations:

  • HPLOT targets (only) the two screen-modes listed above on the rp6502's pico-VGA.
  • The x-coordinate from EhBasic is limited to values <= 255 (8-bits). This is a
    limitation of parameters following the 'CALL' EhBASIC keyword.

The Basic demo/test code includes:

-BarnsleyFern.txt
-Mandelbrot_set - minimal-touch port from Applesoft BASIC listed on Rosettacode.org