Turbo Everdrive

hu, cd, scd, acd, supergrafx discussions.
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Turbo Everdrive

Post by MooZ »

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!
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Re: Turbo Everdrive

Post by MooZ »

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.
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Re: Turbo Everdrive

Post by MooZ »

I spent the evening debugging a test program that only did :

Code: Select all

   jsr ed_begin
   jsr disk_init
   phx
   jsr ed_end
   pla
   ; display A 
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 :D
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 646 times
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Re: Turbo Everdrive

Post by MooZ »

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.
Attachments
ed_test.pce
(72.48 KiB) Downloaded 694 times
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Re: Turbo Everdrive

Post by MooZ »

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?
  • Fix the bloody single block write
  • Code multiple block write
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Re: Turbo Everdrive

Post by MooZ »

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!
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Re: Turbo Everdrive

Post by MooZ »

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.
NippleSalad!!!
Posts: 1
Joined: Sun Feb 15, 2015 5:30 pm

Re: Turbo Everdrive

Post by NippleSalad!!! »

Any further updates on this?
User avatar
MooZ
Site Admin
Posts: 407
Joined: Sun Jun 22, 2008 3:19 pm
Location: Lvl 3
Contact:

Re: Turbo Everdrive

Post by MooZ »

I started porting FAT management to assembly. It's still in early stage.
Debvgger
Posts: 13
Joined: Sun Jun 29, 2008 4:30 pm

Re: Turbo Everdrive

Post by Debvgger »

This could prove very useful for debugging on the real hardware :-)
Post Reply