Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4989

General • Re: PT52-Lua The Modern Retro computer

$
0
0
I will copy that one to the SD to try!

How does one use the draw library. It reminds me of the old TRS-80 models with Extended basic, a ROM basic. To draw a circle on that, you did the format

Code:

CIRCLE (X, Y), RADIUS
example

Code:

' Draw a circle with center at (100, 50) and radius 20CIRCLE (100, 50), 20
The TRS-80 uses a coordinate system where the top left corner of the screen is (0, 0), with X increasing to the right and Y increasing downwards.

Anyway, for the draw.circle lua, I tried some stuff but no circle.

Code:

douses "draw"draw.circle(5,5,5,5,5)end
You forgot to put the display into graphics mode. The draw commands will silently fail on a text mode because the text mode uses a character buffer not a frame buffer.

draw.mode() - Set the graphics mode
0 - monochrome 640x200
1 - 4 colours 320x200
2 - 16 colours 320 x 100
3 - 256 colours 160 x 100

To get back to a text mode you to use draw.mode( 4 ) or higher, pt.set_textmode(1) or you can use vram.set("reg",0,1) just remember to load the correct library.

I use to have a TSR-80 Coco 2 so same idea as that!

But the circle command is draw.circle(x, y, r, Colour, [Fill Colour]). I need to fill in the missing arguments in the documentation that would be a huge help.

The Libraries are all documented at https://gitlab.com/DarkElvenAngel/pt52- ... type=heads

The Draw commands in the overlay library are mostly the same as the draw library!
What!? Wow, I had a TRS-80 CoCo as well! The BASIC books were some of the best I have ever seen to teach children (or adults) programming! I have fond memories of typing in code for hours, and my Dad telling me he needed a screen full of hexagons for some science research, and I said, okay, I will see what I can do, lol. Anyway, I have fond memories of that old 16K RAM micro.

Yes, I saw your list of Lua library commands, with link to the source, but I was not sure of the parameters, so thanks. I didn't study the code and absorb what is going on fully yet to really understand it.

PT52-Lua is really cool though. It's an Operating System, essentially!

Statistics: Posted by breaker — Wed Dec 18, 2024 5:07 pm



Viewing all articles
Browse latest Browse all 4989

Trending Articles