Speaking of, little progress report, with screenshots of the real deal, running on the FPGApad.
This is the main screen. The options are obviously still phony, but most of the stuff is in place, including status icons for wifi and battery/power.
Hardware info screen.
Hardware ID is 0x00041040 on every gamepad board I've tested so far. I really want to know if there are any gamepads out there with a different hardware ID.
Specifically, if it ends in 41, it means trouble -- that means the board has the Samsung I2C controller instead of the Renesas one. I haven't really added support for the Samsung controller, because it's a pretty nontrivial difference (completely different controller) and I can't test it. I think this is prototype stuff (the service firmware doesn't support the Samsung controller), but, who knows.
It means trouble because no I2C means no screen, no audio, no camera. I intend to have a failsafe in the installer if this case is encountered, so it would revert to the previous firmware instead of rendering the gamepad unusable...
Wifi configuration screen. Most of it is done at this point, and the wifi driver seems pretty solid.
This is the "Dump FLASH" feature I was working on. Basically, what it does is start a TFTP server, then you connect to it and retrieve your FLASH dump with a "get whatever.bin". The file name doesn't matter, TFTP is just used as a means of transferring the data.
I ran into a couple of issues with this though.
First one, I always get a "Wrong block number" error after a while. I looked into it and it seems at some point the ack message for a given block is received twice, which it doesn't like. I'll need to investigate more and see how to properly address this.
Second one, the transfer is painfully slow. This is a 5GHz network and the FLASH is 32MB, so it shouldn't take as long as it does. I think I know why that is: due to the way this app is programmed, it checks for wifi frames every ~5ms. And a TFTP frame is 512 bytes. You guess how this goes...
The proper way to address this is to add threading, so I don't rely on a "check stuff every N milliseconds" model. Instead I could have a wifi thread that would get waken up whenever the IRQ fires, and handles received data as it comes in. I think I'll bite the bullet and get this going... this is probably going to be "fun". I kinda want to write my own thing. I don't know yet.
-
Regardless, that's it for what's currently being done. Among the missing functionality, we have:
* "Install app" and "Wifi boot". These will work the same way as the "Dump FLASH" screen, but the other way around -- connect to the gamepad's TFTP server and send a file to it. "Install app" would install the received file in FLASH memory, while "Wifi boot" would store it in memory and boot it right away. The latter would be useful for testing code without writing to FLASH a billion times.
* "Boot settings" would be whether to show this boot screen every time or require a special key combination (and maybe let you choose said combo).
* "About" would be a simple about screen, with some options to install an update to melonpad, or uninstall it entirely and restore the gamepad to stock functionality.
* And obviously, I need to have the boot menu screen actually list what's installed, instead of bullshit entries.