Making use of the built in BASIC interpreter

User avatar
Fuzzyzilla
Posts: 22
Joined: Sun Apr 23, 2017 3:19 am

Making use of the built in BASIC interpreter

Postby Fuzzyzilla » Wed Jul 19, 2017 8:55 pm

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!

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Making use of the built in BASIC interpreter

Postby ESP_Sprite » Thu Jul 20, 2017 1:45 am

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.

User avatar
Fuzzyzilla
Posts: 22
Joined: Sun Apr 23, 2017 3:19 am

Re: Making use of the built in BASIC interpreter

Postby Fuzzyzilla » Thu Jul 20, 2017 3:00 am

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

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Making use of the built in BASIC interpreter

Postby ESP_Sprite » Thu Jul 20, 2017 3:41 am

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.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Making use of the built in BASIC interpreter

Postby WiFive » Thu Jul 20, 2017 4:56 am

What about from a wake stub?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Making use of the built in BASIC interpreter

Postby ESP_igrr » Thu Jul 20, 2017 5:10 am

Well, technically you can use the interpreter from wake stub: copy it into RAM, un-memfrob it, jump to the entry point.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Making use of the built in BASIC interpreter

Postby WiFive » Thu Jul 20, 2017 6:41 am

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?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Making use of the built in BASIC interpreter

Postby ESP_igrr » Thu Jul 20, 2017 7:07 am

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.

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Making use of the built in BASIC interpreter

Postby ESP_Sprite » Thu Jul 20, 2017 7:22 am

BRB, porting Doom to Basic :)

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Making use of the built in BASIC interpreter

Postby WiFive » Thu Jul 20, 2017 8:56 am

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?).

Who is online

Users browsing this forum: Bing [Bot] and 51 guests