#173254 - wintermute - Mon Mar 29, 2010 2:11 am
I've just finished rewriting the libnds eeprom detection code which should hopefully work as well as the prior code. I'd still like to get a few more data points to test with though so if you could compile this with svn libnds, or download the prebuilt one from http://davejmurphy.com/files/eepromtest.nds
sr = 0xff, id =0xffffff - no save.
sr = 0xf0, id =0xffffff - 512 byte save.
sr = 0x00, id =0xffffff - 8k/64k save
sr = 0x00, id !=0xffffff - flash with 24 bit address.
I'm particularly interested in devices which have an ID code, sr = 0, id != 0xffffff. The upper byte is a manufacturer id, you can find a list at http://www.idhw.com/textual/chip/jedec_spd_man.html . The second byte is a device code, the third may be a dummy byte or have some special meaning. If we can get a list of the jedec id codes along with save sizes it should help with improving detection.
My MarioKart DS has an id of 0x621600 which is a Sanyo LE25FW203A 2mbit flash.
Someone was also asking me about the new pokemon games recently. These appear to have some sort of controller on the eeprom SPI which switches between IR for the pokewalker and the save chip, not entirely sure how this is done but there's some save related code which issues cardEepromCommand(0x08), expecting a response of 0xAA.
Edit: Just gone through my game collection and added TheLazy1's results
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
Last edited by wintermute on Tue Apr 13, 2010 8:04 pm; edited 2 times in total
Code: |
#include <nds.h> #include <stdio.h> //--------------------------------------------------------------------------------- void pause() { //--------------------------------------------------------------------------------- iprintf("Press A ...\n"); while(1) { scanKeys(); if(keysDown() & KEY_A) break; swiWaitForVBlank(); } scanKeys(); } //--------------------------------------------------------------------------------- int main(void) { //--------------------------------------------------------------------------------- consoleDemoInit(); sysSetCardOwner(BUS_OWNER_ARM9); while(1) { int pressed = 0; u8 header1[512]; u8 header2[512]; while(1) { cardReadHeader(header1); cardReadHeader(header2); if (memcmp(header1,header2,32) == 0) break; printf("Please eject & reinsert DS card.\n"); pause(); } header1[32] = 0; printf("%s\n", header1); int sr = cardEepromCommand(EEPROM_RDSR); int id = cardEepromReadID(); printf("sr = %02x, id = %06x\n", sr, id); do { swiWaitForVBlank(); scanKeys(); pressed = keysDown(); } while (!pressed); if (pressed & KEY_START) break; } return 0; } |
sr = 0xff, id =0xffffff - no save.
sr = 0xf0, id =0xffffff - 512 byte save.
sr = 0x00, id =0xffffff - 8k/64k save
sr = 0x00, id !=0xffffff - flash with 24 bit address.
I'm particularly interested in devices which have an ID code, sr = 0, id != 0xffffff. The upper byte is a manufacturer id, you can find a list at http://www.idhw.com/textual/chip/jedec_spd_man.html . The second byte is a device code, the third may be a dummy byte or have some special meaning. If we can get a list of the jedec id codes along with save sizes it should help with improving detection.
My MarioKart DS has an id of 0x621600 which is a Sanyo LE25FW203A 2mbit flash.
Someone was also asking me about the new pokemon games recently. These appear to have some sort of controller on the eeprom SPI which switches between IR for the pokewalker and the save chip, not entirely sure how this is done but there's some save related code which issues cardEepromCommand(0x08), expecting a response of 0xAA.
Edit: Just gone through my game collection and added TheLazy1's results
Code: |
Band Brothers DX: sr = 84, id = 202017 m25p64 64mbit The Sims 2: sr = 00, id = 204012 m25p20 2mbit Spore:Creatures sr = 00, id = 204012 m25p20 2mbit Zelda: Phantom Hourglass sr = 00, id = 204013 m25p40 4mbit 100 Classic Book Collection sr = 00, id = 204014 m45pe80 8mbit DS Browser sr = 00, id = 621600 LE25FW203A 2mbit Advance Wars: Dual Strike sr = 00, id = 621600 LE25FW203A 2mbit Starfox Command sr = 00, id = 621600 LE25FW203A 2mbit Contact sr = 00, id = 621600 LE25FW203A 2mbit Brain age sr = 00, id = 621600 LE25FW203A 2mbit Mariokart DS sr = 00, id = 621600 LE25FW203A 2mbit |
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
Last edited by wintermute on Tue Apr 13, 2010 8:04 pm; edited 2 times in total