Saturday, February 9, 2019

CF7 Compact Flash Hacking...

One of the devices I have for my TI is a cheap little compact flash adapter called either the CF7 or the NanoPeb... it changed names at some point. It didn't come with much for documentation but now that I actually need to get big files into my TI, I decided to see if I could figure it out.

I had a dump of the BIOS already, so I loaded that into my emulator and it didn't take long to map out the startup register accesses. From there it was a quick verification to map that to the CF spec, and I had the data I was interested in.

For anyone curious, the read registers map at >5Exx and the write registers map at >5Fxx (when CRU base >1100 is turned on, of course).

The CF7 deliberately uses 16-bit access but only 8-bits of the bus, but I found turning on 8-bit mode in the CF card worked just fine, so the entire card data is accessible by the hardware, at least. I need to do a little more work on the sector mapping though.. I couldn't (quickly) find sectors I wrote on the PC, using LBA addressing. I think that's a sector, but I need to double-check.

CF seems pretty forgiving, I was even able to command reads and writes through Easy Bug. But I did hit the issue with larger cards just not working when I tried my 512MB card. Reading would hang in EasyBug (on the LED at least), and I would forever get the first byte from the sector only.

Oddly, the startup was able to overwrite my boot sector (grr...), so I guess access is intermittent. It'd be neat to figure out why the cards don't work, but I guess I have bigger fish to fry right now.

My 32MB card works fine, so I guess I'll go try to find some mid-size cards at Fry's tomorrow and see if any of them work. If I can just find one that works, then I can write some code to program Dragon's Lair right from the compact flash card, just using sector reads.

It'd be fun to someday write a replacement DSR that could read a normal card... but add that to the huge stack of things I'll never get to...

No comments:

Post a Comment

About Me

Tursilion is a grumpy programmer rapidly approaching the 'old' category and starting to understand the appeal of calling anyone younger than himself 'whippersnapper'. Nobody has yet bought him a cane for his birthday but he's practicing chasing kids off his lawn for the day that happens.