Page 1 of 2

Making use of the built in BASIC interpreter

Posted: Wed Jul 19, 2017 8:55 pm
by Fuzzyzilla
Hello!

I just accidentally stumbled upon the ESP32's built in BASIC interpreter when my code failed(?) to run. I found it to be very functional and could possibly be useful in my projects. Is there a way to run this interpreter from inside a sketch? To continue on that, would it be possible to implement my own functions into the interpreter (eg. drawing to a screen, SD IO, etc)? It would be very cool if I could run a BASIC program off an SD card!

So, is this possible? I know I could find a BASIC library somewhere, but it would save on space to make use of the built in one!

Thanks!

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 1:45 am
by ESP_Sprite
It is not. The idea is that it is very small anyway (<4K) so if people wanted to use it in their own projects, they can just include their own copy in a project. While the source code of the ROM console has not been released, the interpreter is derived from https://github.com/BleuLlama/TinyBasicPlus; you should be able to drop that into your Arduino project with none or only tiny changes.

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 3:00 am
by Fuzzyzilla
Ok, thank you!

It is a bit sad that the built in one is not available for use, but 4kB out of 4MB is not much :P

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 3:41 am
by ESP_Sprite
The reasoning was also that there was some pressure on the ROM build... I could justify taking a day to add in the ROM console, but I could not justify more time to make it expandable, especially if that would only lead to a 4K gain in some very specific applications. I agree with your sentiment, but I'm not unhappy with the way it is now.

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 4:56 am
by WiFive
What about from a wake stub?

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 5:10 am
by ESP_igrr
Well, technically you can use the interpreter from wake stub: copy it into RAM, un-memfrob it, jump to the entry point.

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 6:41 am
by WiFive
ESP_igrr wrote:Well, technically you can use the interpreter from wake stub: copy it into RAM, un-memfrob it, jump to the entry point.
Ah OK, not ideal, but could you then point it to a basic program to execute in rtc fast memory?

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 7:07 am
by ESP_igrr
I am tempted to announce a challenge to run some old game written in BASIC, using BASIC interpreter, all from RTC memory. Just worried that we will lose Sprite for a day or two.

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 7:22 am
by ESP_Sprite
BRB, porting Doom to Basic :)

Re: Making use of the built in BASIC interpreter

Posted: Thu Jul 20, 2017 8:56 am
by WiFive
Yes! Seriously, though, it would be great to be able to have the ability to deploy an interpreted main program, interpreted wake stub, and interpreted ULP program (what kind of interpreter could run there?).