Making use of the built in BASIC interpreter
- Fuzzyzilla
- Posts: 22
- Joined: Sun Apr 23, 2017 3:19 am
Making use of the built in BASIC interpreter
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!
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!
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Making use of the built in BASIC interpreter
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.
- Fuzzyzilla
- Posts: 22
- Joined: Sun Apr 23, 2017 3:19 am
Re: Making use of the built in BASIC interpreter
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
It is a bit sad that the built in one is not available for use, but 4kB out of 4MB is not much
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Making use of the built in BASIC interpreter
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
What about from a wake stub?
Re: Making use of the built in BASIC interpreter
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
Ah OK, not ideal, but could you then point it to a basic program to execute in rtc fast memory?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.
Re: Making use of the built in BASIC interpreter
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.
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Making use of the built in BASIC interpreter
BRB, porting Doom to Basic
Re: Making use of the built in BASIC interpreter
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: No registered users and 125 guests