I have as I wrote earlier been quite unpleased with the serial interface between my PC and the FPGA. On the Vic64 you have the special keys [CONTROL], [LSHIFT], [RSHIFT] and [COMMODORE]. There are also obviously the function keys, [RUN/STOP] and [RESTORE] key. I wanted to scan [ALT] on the PC to bind it to [COMMODORE] which was a tricky task to do. Also the auto repeat on the PC became a problem in TeraTerm. So I decided to try windows programming (which I really don't like).
In the past, around 2000 to 2006 or so, I did a lot of coding in VB so I thought that could be a way forward. You can get nice GUI's, easy coding and a good result pretty quick. The problem is that VB6 which I used back then is not anything like Visual Studio 2015. A lot of things has changed. I realized that it would take some weeks to get the needed knowledge so I skipped that.
Python is something I would like to learn, so I checked that out too. I wanted a GUI, I need to use the serial port and I also need to read files. That shouldn't be too hard, so I checked the alternatives for the GUI in Python and ... skipped that too. That will be a future project to learn, I think.
C-coding then. I have been coding C in embedded systems for quite a while and should handle that. Linux came to my mind, but before setting up a system to test (my system is on Windows...), I saw something about MinGW. Of course! This is the shit, I used that in the past too. So that is what I have been doing the last week, beside having a terrible cold.
So - I coded a really basic terminal in which I can scan all keys. Numbers and characters are all the same positions except for (on my swedish keyboard) special characters like ÅÄÖ, some other keys differs too - the layout is not at all the same. The easiest way to see the complete binding at the moment is to check out the code in scankeyb.c. There will probably be some kind of instruction later. When I checked out the WinVice - the best emulator as I know of - I saw that [CONTROL] in the C64 is bound to [TAB] on the PC and [COMMODORE] is bound to [LCONTROL]. I thought this is a bit confusing, but it could be changed at a later stage if I want it to be easier to remember when running the emulator. Otherwise I could change the mapping in the emulator instead since this is easily done in a configuration file.
A known issue in my "terminal"-ish kind of application is that it allways scans the keyboard. Not really a good thing, if the program is running, and you switch over to something else and lets say you enter a password... this password will appear in clear text in the FPGA. So to be correct - I have made a keyboard listener which was not at all my intention. I am not a Windows hacker...
The goal with my terminal was to be able to download homebrewed assembler compilations in PRG format. This format (beside a range of other formats) is widely used to make digital copies of the original C64 programs. You can also compile own PRG-files and test them in the VICE emulator. It is possible to do that now, so I can make assembler test programs and run them in my FPGA so this was a successful enhancement of the system. Below you see a picture of a background change test which was my first test program to download.
In short - the change in hardware is that I replaced the Arduino with a USB to RS232 stick and on the software side replaced the TeraTerm with my own terminal.
Another thing that has been added is the [RESTORE] and [RESET]. The restore is some Vic64 stuff, enable the NMI when pressed and the reset is just what is sounds like - a reset of the system.