GRG16 - Now with keyboard input!

The original goal was to make a Mega-drive-like virtual games console which wouldn't have a keyboard.  After some thought, I realised that keyboard input might help me with both the teaching/learning goals (by giving scope for a wider variety of activities) and the development (by giving me easily testable incremental steps towards the final program).

So now I have a keyboard device which populates two memory locations: one for the currently-depressed key, and a second for the current modifier state (CTRL, SHIFT, ALT).

Plus, after much painful debugging, I have a program written for the VM in assembler which reads the key state and displays typed characters to the screen.



This highlighted the need for development/debugging tools for the virtual console itself, and I am seriously daunted by the prospect of having to develop them.

Also, I no longer like the BusController being in its own separate thread.  I've already had problems with the compiler optimising out reads of variables written to by other threads.  Liberal use of the 'volatile' keyword has got it working, but I don't like it.  At least in the short term, I'm switching to the re-entrant update model, where the ConsoleSystem class loops through each device calling update() on it.

The program design is starting to creak and look a little like a Frankenstein's monster.  Time for a re-design and refactor.

So the next iteration will be back to the drawing board to design it from a student's point of view.  I'll need editing and debugging tools whilst still allowing a standalone version to run without the dev tools.  This'll take some time...



Comments

Popular posts from this blog

Micro:Bit and SPI display

DCS World with TrackIR under Ubuntu

Cardboard Mock-up of USB Joystick