D-Lib
Still grinding away in the code mines, working on the D-Lev preset librarian. Had a minor breakthrough yesterday implementing a bank view:
Above is a view of the actual presets in the EEPROM of my prototype. It's a little involved producing this screen: the program downloads the preset EEPROM data for the desired preset slots on the D-lev (for the view above this is slots -40 thru +39) via the serial port, and then stores that data in a string vector (one string per preset slot). It then performs a directory listing, filters out the non-preset file names, opens each of the remaining files, and stores the contents to a string vector (again one string per preset file). Then it compares each preset slot string to all of the file content strings, and if there is a match it assigns the file name to the displayed slot. If there is no match the displayed slot name is "-?-". For 80 slots this takes a couple of seconds, most of which is spent on the serial port data transfer.
There is also a directory listing screen, and before I came up with the "live slot bank" thing above which incorporates the functionality, it was just a way to view the available preset files.
Above is the preset file list view. When in edit mode you can select a file with the arrow keys, and pressing the spacebar or return will copy the file name to the command line and exit edit mode. Then you can type in " rf " to read the preset file data into the editor, or " owf " to overwrite the preset file with the data currently in the editor, etc.
What was fairly tricky was rolling my own "auto-complete" for the command line. This is where you enter a character or two and then hit the tab key to complete the remaining file name, but only up to the point of uniqueness. It's funny how aware you get of the inner workings of these mechanisms in the operating system console when you have to re-implement them.
Finally, with all the serial port code and such just laying there, I thought it would be good to implement a way to pump the SW into the EEPROM. In the past I was doing all of this via TeraTerm and its TTL macro language, and thought for a while I might implement some small subset of the TTL language. But in the end I made the Hive simulator / assembler just kick out four byte lines of hex text (this is the way preset files are formatted as well) and wrote a C++ routine in the librarian to upload it. The new file extension is "*.spi" and the upload process seems to work more reliably than the TeraTerm method. Here's a view of the beginning of the current SW load SPI file:
3dc407cc
81c09
3e08
0
49809
0
57609
0
65d09
0
82f09
0
d80a00b8
80301b04
8b8030c
fd04d80b
2c01d82f
69065c01
5907cc01
Each line is parsed to 4 bytes. You can see there is no hex prefix like "0x" or "$" as the format is known to be hex always. And there are no addresses as the format is pure data. And there are no compression routines, as shorter data and zeros perform this naturally. IMO virtually all raw data formats are over-thought, over-featured, and overly complicated.
Currently it's all running in Linux; when it's a bit more finished I'll start in on the Win compile (where the real fun starts). I need to make the file listing be able to display more files than fit on the screen, add error messages, and generally make the serial port communications as robust as possible. But it's fairly useful even now. IMO the bank view, which allows you can see the actual contents of the D-Lev preset slots en mass, is a really essential and powerful thing, and once you have that a lot of other features aren't all that necessary.
So there are a total of four screens in the D-Lev librarian: preset editor, directory listing, bank listing, and raw serial port console.