Close

New firmware R2.6

A project log for LM80C Color Computer

A Z80 homebrew computer with 64KB SRAM & 32KB ROM (with BASIC), TMS9918A VDP (video) and AY-3-8910 PSG (audio)

leonardo-milianiLeonardo Miliani 11/02/2019 at 17:060 Comments

New release for the LM80C firmware, reaching version R2.6.

In this release I've added a new function, INKEY. This returns the ASCII char being pressed by the user. Since the computer is still dependent by the host computer and get inputs through the serial line, I've had to make some tricks to let INKEY works properly due to the fact that the BASIC interpreter is constantly looking at the incoming chars from the serial and works by collecting them into a "input line" that is not as easy as it seems to manage without using the built-in functions. So I changed the firmware by adding a simple flag: when the INKEY function is "sniffing" the serial line for an incoming char, the firmware won't echo it into the serial buffer but store it into a temporary and separated buffer from which the INKEY function will collect it as soon as it is available. The firmware will delete that char after 1/100 sec. so that "fresh" keys will be available for future readings. There is also a timer hat the user can set inside the function so that INKEY will wait for up to 1,023 hundredths  of seconds for an incoming char before to return to the main program.

The R2.6 release is available from my GitHub repo.

Discussions