First successful code build.

Here is the small, but significant, first step into programming the VT168. Using a standard build of the cc65 C compiler and a draft configuration file, I successfully mapped the memory and structure of the VT168 hardware. With that and the available register documentation, I had a sample running in a few days. However, there is one glaring flaw in the main datasheet – it does not explain how to select color modes for the background layers. After a bit of head scratching, here is how it’s configured:

 Color Mode  BKx_Color
 ----------  ---
 16 colors   0 0
 16 colors?  0 1
 64 colors   1 0
 256 colors  1 1

The BK1_Color and BK2_Color bits can be found in the 0×2013 and 0×2017 registers, respectively. One interesting feature of this SoC is that, while only 64Kb addressing space is available to the main CPU, with higher portions of the 8Mb memory visible by a mappable 32Kb segment starting at 0×8000, the graphical unit fetches data from that memory space using automatic segment mapping. This makes graphical access very clean. There are a bunch of very clever things in this SoC, actually, and I hope to be able to show them off – that is, if they’re actually not horribly broken in the real hardware.

Continue reading

NJ Pocket memory reverse engineering.

I finally got around to figure out the pinout of the little Flash ROM board in the NJ Pocket. For that I had to remove it to check the bottom pins… and well, let’s say things didn’t went very well:

Despite my best efforts to safely remove it, the board is glued before the soldering. This complicated the job of removing the solder cleanly, and it led to a last ditch effort that resulted in way more damage than was needed. Luckily there are plenty of test pads and I haven’t damaged any additional hardware other than a slightly scratched ground track. As such, It might still be possible to connect some test hardware to the CPU – I already have a simple VHDL module ready for this and will get around to writing some code soon.

Click on to see the results of my efforts…

Continue reading