MMC/SD Read/Write FAT Source Code

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
JucaBlues
Posts: 14
Joined: Mon Apr 06, 2009 11:15 pm

MMC/SD Read/Write FAT Source Code

Post by JucaBlues »

I've been a bit anxious to hack something in my fuzebox. Since Uzeamp source code (and its FAT filesystem support for SD/MMC) is not released yet, I decided to do it myself during easter hollyday. I have integrated Roland Riegel's FAT filesystem implementation ( http://www.roland-riegel.de/sd-reader/index.html ) to a trivial open/close/read/write/seek API. I had to implement mmc_writesector. Then I tried to used it to store Megatris hiscores on a file, but the resulting binary exceeded maximum size. Then I did the same for Whack-a-Mole and, in this case, it fits in the available memory.

My source code is available here: http://bighead.poli.usp.br/~juca/code/u ... card.patch
Could anybody, please, enable upload of .diff or .patch files here in the forum?

I modified Megatris but have put some ifdefs that can be used to easily enable/disable hiscores in sd/mmc by editing the Makefile. I think that this can eventually be enabled when/whether we decrease memory footprint of the mmc/sd/fat modules.

Also, I have modified some demos Makefiles because they were broken for me on Ubuntu GNU/Linux. I hope that this does not break things for the MS-Windows(tm) developers...

You should test Whack-a-Mole with a card in the slot. It will create a whackahole.hi file if that does not exist in the card.
I've attached to this post an HEX of wackamole built with the above mentioned patch. Have fun!
Attachments
whack-a-mole.hex
(132.64 KiB) Downloaded 554 times
Post Reply