HI, megavolt85 swat, some time ago I passed this post
https://segaxtreme.net/threads/sdloader-...ves.25275/
Learn about using SD cards on the sega Saturn(Thanks to Murzik for writing)
Now I feel that I have almost mastered it,
so I started to play with the SD card of DC again.
After learning the source code of DreamShell, I finally finished writing a small program, which can be executed directly from the application file manager, or can also be made into a cdi format run
The function of this program is very simple, it will detect the SD card, if the detection is passed, it will generate the bios (DC_BIOS.BIN) and flash (DC_FLASH.BIN) files of your dreamcast host on the root directory of the SD card.
Because I wrote the assembly directly, the file is not big, 5kb after decompression
In order to reduce the complexity of the program, I do not consider cards smaller than 4G, so this program only supports SD TF cards greater than or equal to 4G
(Thanks to megavolt85 swat Murzik, and everyone who contributed to DreamShell)
I encountered some problems in the process of writing the program, so I would like to ask for advice
1 If you use the SD card on the DC, you will use the spi mode like Saturn, right?
If yes, by looking at the data, the CRC check digit of the SPI mode command (command) is not needed
(Only need 0x95 of CMD0 and 0x87 of CMD8, others can be directly replaced by 1)
So the first question is, if the sd card is used on the dc, does the CRC check digit of the command (command) have to be calculated and filled in?
(I found that the source code of DreamShell has been calculated and used, but in the program I wrote myself, I have not used it, but it is normal after testing)
2 In my program, I don't use the cache, but the source code of DreamShell uses the pref instruction to transfer data to the cache when writing data to the SD card. Does using the cache improve the writing speed? (Because I tested it myself, using the pref command did not increase the speed, but the speed decreased. Is the way I used it wrong?
Код:
sub_cache:
add r4, r5 r4 = memory address (32-byte alignment)
mov #0xe0, r0 r5 = 0x200
and r0, r4
loc_cache_1:
pref @r4
cmp/hs r4, r5
bt/s loc_cache_1
add #0x20, r4
rts
nop
3 In the source code of DreamShell, 5 nop idle cycles are added to most instructions of the sd card. Is it to consider the compatibility of some SD cards?
(In my sd cards and tf cards, I have tested that if the 5 nop idle cycles are removed, there will be no error. Maybe I missed something?
4 The last question, why can't I go back to the application file manager after executing my program from the application file manager
There are a lot of questions, thank you for your reply~
please forget my bad language, i don't know english, i use google translate
This program has passed the test in the following tf sd card
This program failed the test in the following tf sd cards
The reason why the 2 TF cards failed the test was that they were smaller than 4G
But this 16G Toshiba sd card failed the test, which is more interesting, because even if I copy the ds folder in, start the DreamShell image with gdemu after booting, it still prompts that the SD card is not found
but this card directly uses GDEMU to play games. Normal, I guess this kind of card does not support spi mode?