Turbo Everdrive
Turbo Everdrive
Hi!
I just received my Turbo Everdrive. And as I understood it, it's possible to access the SD card from a PC Engine program (source: http://krikzz.com/forum/index.php?topic=69.0). Some dude suggested using PetiteFS.
I'll put the code on github as soon as I something ready!
I just received my Turbo Everdrive. And as I understood it, it's possible to access the SD card from a PC Engine program (source: http://krikzz.com/forum/index.php?topic=69.0). Some dude suggested using PetiteFS.
I'll put the code on github as soon as I something ready!
Re: Turbo Everdrive
Here's a first shot: https://gist.github.com/3240689
It compiles. But I haven't tested it. So I urge you not to test it atm I first need to check/double check/triple check it againt the original C code. But the most important thing to do is to first figure out how the sd is initialized/accessed.
As always, any help is more than welcome.
It compiles. But I haven't tested it. So I urge you not to test it atm I first need to check/double check/triple check it againt the original C code. But the most important thing to do is to first figure out how the sd is initialized/accessed.
As always, any help is more than welcome.
Re: Turbo Everdrive
I spent the evening debugging a test program that only did :
The "worst" bug was that the termination tests for the active wait macro were wrong (bne instead of beq). I also had to "fixed" the font printing. I forgot to specify the palette to use for the text print routine. Hence the crappy results. And last but not least I managed to blast the SD card filesystem
Anyway! It seems to be working now. disk_init returns 0 (which means success). The next test will be to read the CID register (card identification information).
The updated code can be found here : https://gist.github.com/3240689
I attached the test rom. Note that it won't work under Mednafed as SPI_BUSY_WAIT will loop indefinitely. As suggested by Charles, I should use the timer interrupt for timeouts.
Code: Select all
jsr ed_begin
jsr disk_init
phx
jsr ed_end
pla
; display A
Anyway! It seems to be working now. disk_init returns 0 (which means success). The next test will be to read the CID register (card identification information).
The updated code can be found here : https://gist.github.com/3240689
I attached the test rom. Note that it won't work under Mednafed as SPI_BUSY_WAIT will loop indefinitely. As suggested by Charles, I should use the timer interrupt for timeouts.
- Attachments
-
- ed_test.pce
- (72.48 KiB) Downloaded 1582 times
Re: Turbo Everdrive
KRIKzz forgot the function that opens the sd card for reading (here).
After hours of testing (and sd card reformating) and the help from Chilly Willy, I managed to read sector 0
The code is at the same place and I attached a new version of the test rom.
After hours of testing (and sd card reformating) and the help from Chilly Willy, I managed to read sector 0
The code is at the same place and I attached a new version of the test rom.
- Attachments
-
- ed_test.pce
- (72.48 KiB) Downloaded 1656 times
Re: Turbo Everdrive
A lot of stuffs happened behind the hood (namely by email and on some other forum).
To keep things short John Snowdon (aka megatron-uk) picked up the "super tenokoe card" project and started working on the FAT driver using the low level SD card access code I wrote. As he's using HuC, I had to code some C wrapper around the asm routines. You can now read bytes from the SD card but writing is still buggy. At the moment, only single block write is implemented. The only problem is that once you write a single block you can't perform anything afterwards. Every other command will fail. At least the SD card is not fubar.
Here's the main git repository : https://github.com/megatron-uk/everdrive-fat
And here's my fork where you can find experimental bleeding edge SD card driver code: https://github.com/BlockoS/everdrive-fat
What's left?
To keep things short John Snowdon (aka megatron-uk) picked up the "super tenokoe card" project and started working on the FAT driver using the low level SD card access code I wrote. As he's using HuC, I had to code some C wrapper around the asm routines. You can now read bytes from the SD card but writing is still buggy. At the moment, only single block write is implemented. The only problem is that once you write a single block you can't perform anything afterwards. Every other command will fail. At least the SD card is not fubar.
Here's the main git repository : https://github.com/megatron-uk/everdrive-fat
And here's my fork where you can find experimental bleeding edge SD card driver code: https://github.com/BlockoS/everdrive-fat
What's left?
- Fix the bloody single block write
- Code multiple block write
Re: Turbo Everdrive
Thanks to Microchip engineers, I managed to fix single block write. I think I'm going to burn all my arduino boards and buy PIC devboard!
Re: Turbo Everdrive
Huzzah! Multiple sector writes are defeated! The start/dostuff/stop sequence routines were removed. Instead disk_read_sector, disk_write_sector were added.
You can find the code here: sd.asm
I still need to add the C "exports" and send a pull request to John.
You can find the code here: sd.asm
I still need to add the C "exports" and send a pull request to John.
-
- Posts: 1
- Joined: Sun Feb 15, 2015 5:30 pm
Re: Turbo Everdrive
Any further updates on this?
Re: Turbo Everdrive
I started porting FAT management to assembly. It's still in early stage.
Re: Turbo Everdrive
This could prove very useful for debugging on the real hardware