Author Topic: TinyAGI for Raspberry Pi Pico  (Read 788 times)

0 Members and 1 Guest are viewing this topic.

Offline r1sc

TinyAGI for Raspberry Pi Pico
« on: January 14, 2023, 10:33:30 AM »
Hi! I just wanted to share a project I've been working off and on for the past year. It's an AGI interpreter capable of running on the Raspberry Pi Pico. Not terribly useful, but fun :)

https://github.com/r1sc/tiny_agi



Offline cosmicr

Re: TinyAGI for Raspberry Pi Pico
« Reply #1 on: January 17, 2023, 12:34:37 AM »
Very cool! I often considered writing an AGI interpreter for Arduino, although it's not as powerful as the Pico.

Did you base it off of any existing AGI Interpreter, or is it all original code?

Offline pmkelly

Re: TinyAGI for Raspberry Pi Pico
« Reply #2 on: January 17, 2023, 07:51:56 AM »
Nice work!

I was curious about the bug with large views you mentioned (haven't tested myself, but looked through the code). What do you think is causing it? I couldn't see anything in the view drawing code itself that looked wrong, but I noticed the IRQ handler for the VGA driver, is it possible that this is being called while the drawing code is half-way through its work and leaving things in a bad state?

Offline r1sc

Re: TinyAGI for Raspberry Pi Pico
« Reply #3 on: January 18, 2023, 07:53:42 AM »
Very cool! I often considered writing an AGI interpreter for Arduino, although it's not as powerful as the Pico.

Did you base it off of any existing AGI Interpreter, or is it all original code?

Pretty much everthing is original code. I may have borrowed some parts from Lance Ewings SHOWPIC program for the PIC drawing routines, as I did with the AGI.js interpreter. The DMA request setup and the PIO program for driving the VGA signals was derived from a blogpost somewhere.

Nice work!

I was curious about the bug with large views you mentioned (haven't tested myself, but looked through the code). What do you think is causing it? I couldn't see anything in the view drawing code itself that looked wrong, but I noticed the IRQ handler for the VGA driver, is it possible that this is being called while the drawing code is half-way through its work and leaving things in a bad state?

Yeah so this only happens on the Pico, and it's simply because that part of the code is too slow. There is no double buffering, so the VIEW rendering never have time to fill the view if it's large enough, or if there are too many of them, before it's cleared as part of next frame. There are multiple optimization options here. The simplest may be to just redraw the view when viewno/loop/cel/position changed. I've also considered dumping som subsystems on the other core, like the soundsystem for example, to free up CPU time.

EDIT: By the way.. Peter Kelly? Wow! :o Thanks a lot for AGI Studio and its associated documentation - it helped ALOT during development!
« Last Edit: January 18, 2023, 08:11:37 AM by r1sc »


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.013 seconds with 17 queries.