BIOS dumper for DITTO mini

PM development, programming, hacking and all that fun stuff.
Post Reply
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

BIOS dumper for DITTO mini

Post by zoranc »

For all of those who own a DITTO mini flash cart and want to dump the BIOS here is a small program to do it:
bios_dump.min
BIOS dumper
(11.89 KiB) Downloaded 720 times
You need to write the program to the flash cart, run it, then download the contents of the flash cart. The BIOS will be in the first 4K of that file. Cutting the first 4K can be done in many different ways. Under Linux and mac OS one can use a dd command:

Code: Select all

dd if=flash.min of=bios.min ibs=4096 count=1
For those curious how the dumper works, here is the source code too:
bios_dump.tar.gz
(3.83 KiB) Downloaded 731 times
Only a slight adjustment to the C compiler is needed as the code uses a large memory model one needs to create a new pml.mk file that is copy of pm.mk where occurrences of "-Md" are substituted with "-Ml". The standard flash chip SST39VF1681 is used in DITTO mini, but there is a particularity that all the command bytes need to be with reversed bits. Highest to the lowest bits should be ordered from the lowest to the highest position, so for instance 0x3A becomes 0x5C. Naturally all the flashing functionality should be executed in the RAM.
User avatar
RazorLeafAttack
PM.net Staff
Posts: 145
Joined: May 9th, 2017, 00:58

Re: BIOS dumper for DITTO mini

Post by RazorLeafAttack »

There was a suggestion from user brizzo on the Discord server…

Would it be possible to add a function to run a checksum against the known BIOS and display a message if we happen to find a previously unknown version of the BIOS? Then if it's the same, you could simply try another Mini without connecting to the computer.
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: BIOS dumper for DITTO mini

Post by zoranc »

Here you go:
bios_dump2.min
BIOS dumper with CRC check if it's a standard one.
(13.36 KiB) Downloaded 930 times
I decided on CRC32 as a check since it's more reliable than a simple checksum. However it needs 3-4 seconds to be calculated...

Here s the source code too:
bios_dump2.tar.gz
(6.42 KiB) Downloaded 919 times
zoranc
Posts: 298
Joined: August 13th, 2010, 18:13
Contact:

Re: BIOS dumper for DITTO mini

Post by zoranc »

A side note - it is an example how to calculate CRC32. It could be useful for other checks - consistency of a save data for instance.

Second side note - too much writing to either Pokemon mini saves or flash cart itself is deteriorating their life. It is not so small - the flash specs say at least 100'000 writing cycles which is a lot, but still worth having in mind (it is not like the RAM where you can write as much as you want). Writing cycles are times one clears some bit I believe. For instance one can zero up to 8 times the individual bits in a byte and then reset it to all ones, which is considered one writing cycle. The clear state of the flash is all ones (0xFF).
Post Reply