slviajero / tinybasic

A BASIC interpreter for Arduino, ESP, RP2040, STM32, Infineon XMC and POSIX with IoT and microcontroller features.
GNU General Public License v3.0
203 stars 31 forks source link

Question: Would it be possible to include "Adafruit_Floppy" Lib? #48

Closed leandrofriedrich closed 7 months ago

leandrofriedrich commented 1 year ago

Hello, i was wondering if it would be possible to add https://github.com/adafruit/Adafruit_Floppy to this project to (for example) store basic programs on a floppy?

Greetings from Germany and i hope you are having a nice day so far!

slviajero commented 1 year ago

I thought about it but for lack of hardware I can’t do this. Actually it would be very exotic and ver retro. Implementing it would not be hard. BASIC has a generic filesystem driver interface. You would have to implement the following functions

void fsbegin(char); int fsstat(char); void filewrite(char); char fileread(); char ifileopen(const char); void ifileclose(); char ofileopen(char, const char*); void ofileclose(); int fileavailable();

void rootopen(); int rootnextfile(); int rootisfile(); const char* rootfilename(); int rootfilesize(); void rootfileclose(); void rootclose(); void removefile(char ) void formatdisk(short);

The upper half is for opening and closing files. They would be enough for simple file operation. Only if you want CATALOG, DELETE and FDISK, you would have to implement the second half of the functions.

Am 17.01.2023 um 07:09 schrieb Leandro Friedrich @.***>:

Hello, i was wondering if it would be possible to add https://github.com/adafruit/Adafruit_Floppy https://github.com/adafruit/Adafruit_Floppy to this project to (for example) store basic programs on a floppy?

Greetings from Germany and i hope you are having a nice day so far!

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/48, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56FWWP44SK6W5FYKIPLWSYZSHANCNFSM6AAAAAAT5OTPUY. You are receiving this because you are subscribed to this thread.

leandrofriedrich commented 1 year ago

thanks for the answer! ill dig out my pi pico over the next days and see if i can get something to work

slviajero commented 1 year ago

I wrote a little tutorial on file system implementation:

https://github.com/slviajero/tinybasic/wiki/Peripherals:-SD-Cards,-SPIFFS,-littleFS,-EEPROM,-and-IO-channels.#build-the-file-access-functions https://github.com/slviajero/tinybasic/wiki/Peripherals:-SD-Cards,-SPIFFS,-littleFS,-EEPROM,-and-IO-channels.#build-the-file-access-functions

Maybe this helps. Best Regards, Stefan

Am 18.01.2023 um 22:17 schrieb Leandro Friedrich @.***>:

thanks for the answer! ill dig out my pi pico over the next days and see if i can get something to work

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/48#issuecomment-1396099887, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56HNICHRXMFJT6DTZLTWTBMW5ANCNFSM6AAAAAAT5OTPUY. You are receiving this because you commented.

slviajero commented 7 months ago

Not in focus as hardware not really relevant.