I’ve made a public repository on github.
It is a fork of superzazu/8080 plus my additions tailored to Altair BASIC. and the PicoCalc. It uses drivers from picocalc-text-starter (made it easier to get up and running on PicoCalc fast).
Since it’s a full version of supersazu’s code, you can build the emulator alone by running their Makefile at the top level, the PicoCalc binary is built using cmake, and instructions for both are in the README.md
You’ll need to obtain a copy of Altair BASIC itself..
This project does not distribute Microsoft’s Altair BASIC binaries. You must supply your own copy from legally obtained sources (e.g., original cassette, licensed distribution, or source as released by GatesNotes for educational purposes).”
I got mine off of an original cassette tape i own (I’m releasing the code needed to decode a tape to a .bin file separately on github here). It takes a file called basicload.bin – this is just a flat memory dump starting at address 0x0000 up to the end of BASIC.
Over and above what you get with the emulator, my code adds the following:
- Redirecting CSAVE/CLOAD to/from files in the /Altair/tapes directory rather than using an actuall cassette interface. Presently it’s using BASIC’s limitation of having a single character to name the file.. future versions can extend this to full file names..
- Reversing the sense of the shift key for alpha characters… it defaults to typing upper case alpha, to get lower case you hit shift and the character. Makes it easier to type in BASIC programs because all the keywords are in upper case and BASIC is case sensitive.
- By typing a ctrl-i, you can source in a basic listing in a text file on /Altair or below.. Makes it easy to write basic programs because BASIC’s editing capabilities are primitive. So you can write your programs on another computer with a modern editor, save them onto the SD card, and source them in to BASIC. A future version will have the ability to dump a text version of the BASIC program in memory out to a text file.
- Altair 8K BASIC V3.2 has a bug.. if you have a full 64k of ram, with no rom (our case) BASIC’s memory sizing code will probe from the end of BASIC to 0xffff, then wrap around to 0x0000 and ultimately probe itself to death. To solve it my memory code forces 0xffff to look like ROM – so you get the full 64k minus one byte.
Upon startup BASIC will ask for MEMORY SIZE… you can type a number less than the full memory to reserve high memory for any machine language code you put into memory, or just hit enter to get as much as possible. It will ask for the terminal width.. you can type a number or hit enter for the default (which seems to work on PicoCalc). It will ask you if you want certain trig functions configured in or not… this mattered more when people only had a few K of RAM.
NOTE!: When they wrote basic, most were using teletypes for terminal io and the modern backspace key was non-existent. You have to use an underscore to delete the previous character typed on a line. To delete more than one recent characters type more than one underscore. It’s not WYSIWYG, so editing lines is difficult. Refer to the Altair BASIC manual for details.
Enjoy… let me know if anyone has success or ideas for improvements.