Monday, October 10, 2022

BASIC Programming

Days 7-9

I started working on a BASIC game for the MC-10. Previously, I had been able to use the MC's serial port to "LPRINT" any BASIC programs to my Mac. Of course, this did not work anymore, since I had to change the serial cable wiring. So, I had to make a little adapter to make the serial port cable work with the BASIC ROM functions. Very frustrating.

After I got that working I had a decent build chain to write a BASIC game, doing as much of the programming as possible on the MC-10 and saving to my Mac. The line editor for the MC-10 is non-existant, but there are some solutions out there. Still it took a long time for me to write a simple mine-sweeper type game that was based on my TS-1000 efforts in a previous Retrochallenge. As much as I despise the keyboard on the TS-1000, the BASIC implementation is quite good with some conditional printing syntax that is lacking in the traditional MS BASICs. But I enjoyed figuring out how to work around the shortcomings in the MC-10 BASIC. I know there are a number of minesweeper games out there for the MC-10, but they don't seem to work on an unexpanded 4K RAM MC-10. Anyway, I have a working first version that is pretty fun to play. I intend to add a second level before the end of RetroChallenge. I used a few of the tricks that I learned on the TS-1000 to keep memory down. I was also proud of how it only has code for 2 loops - one to loop through the locations on the game board and one to loop through the 8 locations surrounding the current selection. The loops call different subroutines to do the work on each square on the grid based on a preset variable. Probably horrible coding practices, but it kept the number of code intensive for-next loops down to a minimum. Screenshot:

Screenshot of minesweeper type game on TRS-80 MC-10

You can find it on my MC-10 Cassette Server.

No comments:

Post a Comment