kervinck / gigatron-rom

System, apps and tooling for the Gigatron TTL microcomputer
BSD 2-Clause "Simplified" License
231 stars 80 forks source link

Pull request SPI/SD for gtemuAT67 #206

Closed lb3361 closed 2 years ago

lb3361 commented 2 years ago

Hello AT67.

Here are small additions to Contrib/at67/gtemuAT67 that emulate a SD card plugged to a 128K RAM&IO expansion board. This code can boot from the SD card using Marcel's CardBoot program that is included in ROMv5a (with the version number bug fixed) and DEVROM. Initializing the card and reading single blocks is reasonably tested. Reading multiple blocks and writing blocks has not been tested for lack of Gigatron software that does this. I intend to correct as soon as bugs show up.

Demo:

The pull request has three main commits (and two smallish improvements.)

Caveat: I haven't tried to compile it under windows. The only window specific code is the _fseeki64 call in the last two functions of spi.cpp. The rest is plain stdio.