/circle-bwbasic

The goal of this project is to provide BASIC support for the PI Computer with Bare-Metal Circle

Primary LanguageC

circle-bwbasic

Overview

If like me you play with 80's computers, you remembered the time where computer have all-in-one OS & Language BASIC.

My goal is to have an equivalent with the Raspberry PI

The goal of this project is to provide BASIC support for the PI Computer

This project use

  • Raspberry Pi bare metal environment Circle.
  • C and C++ standard library support for Circle Circle-stdlib.
  • A small C basic interpreter Bwbasic

Getting Started

Prerequisites

Building the Libraries

Then copy these files to SD :

kernel.img    
profile.bas    
TEST.bas    

Current Release v0.1

Initial build of circle-bwbasic with Circle, Circle-stdlib

What's working

  • The banner of bwbasic is ok, so stdout work
  • Input in command-line, so stdin work
  • some basic BASIC test work (example : 100 PRINT "HELLO")
  • access to files on SD works (LOAD "TEST.BAS" and then RUN)

Known issues

  • some function may not be called : sleep(),chdir(),mkdir(),rmdir() - Missing in circle-stdlib ?

    Analyzed : some functions exists in circle (fatdir.cpp)

  • Typing OPTION TERMINAL ANSI and then CLS hangs the system (work under linux)

    Analyzed : Sequence escape [2J not implemented in circle
    in screen.cpp function CScreenDevice::Write (char chChar)

  • I have a french keyboard

    Analyzed : change mapping in circle in stdlib

  • When compiling, message for TRUE/FALSE redefined : conflict between STDLIB define and bywater define (in progress)

  • Some minor warning in compilation

  • When no keyboard, scrolling with false input (minor)

  • Many commands/functions not tested

Which script created/updated

  • Create kernel.cpp,kernel.h,main.cpp
  • Create Makefile
  • Update of bwbasic files :
  • bwbasic.c

    replace
    extern int main (int argc, char **argv);
    by
    #if defined(NO_MAIN)
    extern int main_bwbasic (int argc, char **argv);
    #else
    extern int main (int argc, char **argv);
    #endif

  • bwbasic.h

    uncomment #include "bwb_user.h"
    replace
    extern int main (int argc, char **argv);
    by
    #if defined(NO_MAIN)
    extern int main_bwbasic (int argc, char **argv);
    #else
    extern int main (int argc, char **argv);
    #endif

  • add bwb_user.h file #define HAVE_UNIX TRUE
    #define DIRECTORY_CMDS FALSE
    #define NO_MAIN
    #define HAVE_UNIX_GCC FALSE

Explanations

  • HAVE_UNIX TRUE added to compile with stdlib
  • NO_MAIN created replace main by main_bwbasic
  • DIRECTORY_CMDS FALSE added to avoid use of chdir(),mkdir(),rmdir()
  • HAVE_UNIX_GCC FALSE added to avoid use of sleep()

Action plan

  • Stabilization of BWBASIC --> will be the new reference (actually my reference is BWBASIC on linux)
  • Creation of PIBASIC = BWBASIC with enhancements (speed, editor, most hardware connection with circle, best method to add command)

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 3 - see the LICENSE file for details

Acknowledgements