NDS Cartridge ROM specs

Discussion of development of software for any "obsolete" computer or video game system.
nocash
Posts: 1348
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: NDS Cartridge ROM specs

Post by nocash » Tue Mar 23, 2021 3:06 pm

I've finished the specs for the nds infrared port and pedometers:
http://problemkaputt.de/gbatek-ds-cart- ... meters.htm
That was quite a huge project, the SPI commands for the infrared port have been quite harmless, but then I couldn't stop adding more and more specs for the infrared commands, instruction set, memory maps, accelerometer and lcd controller.

Maybe the hardest part were the P-walker IR commands, they were already documented on dmitry's webpage, but I couldn't make any sense of that table. I've spent several days on sorting and reformatting the table (like moving the word EEPROM to the begin of each line for EEPROM related commands), but that didn't really help on making it more legible.
I've finally spent some more days on disassembling the firmware myself and making two new separate tables from scratch up (one for incoming packets, and one for outgoing packets). I hope it's a bit more clear which commands/replies have what parameter bytes. The overall descriptions are ripped from dmitry's table - I didn't reverse-engineer everything from scratch up.

Alongsides, I've noticed a few things that appear to be wrong on dmitry's webpage:

Code: Select all

 Cmd 16h has 38h-byte data (not 34h-byte data)
 Cmd 40h,42h,44h are mis-numbered (and one of them is completely missing)
 Cmd 2Ah,2Ch are said to have incoming data for "RTC" (seems to be wrong?)
 Cmd 32h,40h,52h,60h are said to have incoming data for "RTC" (seems true?)
 Cmd WHAT is used to set RTC? (2Ah/2Ch don't? and 32h/etc are said to be unused)
 Elsewhere CMD_52 is said TO BE USED from nds, hence "dir=g2w", not "?2w"?
 Cmd F0h is marked as unknown/unused transfer direction, but also says from NDS
 struct EnrollData is missing the last byte (that says if/how to init LCD)
 struct EventBitmap might mean a boolean array (probably not bitmap graphics)?
 0x0172-0x017F unused does actually start at 0171h, not 0172h?
 does "0xCE88" (aka CE44h+4) really relate to "99999 steps reached"??? (looks more like 9999999 decimal?)
 the 16bit value "copied from unk_0" (32bit) probably means "unk_2" (16bit)
 small typos: fine=find, intead=instead, tmie=time
For the RTC, I am unsure what is used to set the RTC time, it sounds as if it's done using Cmd 52h, probably with a 32bit "seconds since 2001" value in the "Identity" data packet.
For reading the p-walker step counters, several data structures are containing "steps", but it isn't always clear which "steps since when" are meant, since today, since last sync, since forever? So it's still kinda unknown how to use which values for reading the step counters.
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty

nocash
Posts: 1348
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: NDS Cartridge ROM specs

Post by nocash » Fri Mar 26, 2021 3:35 am

The display controller being SSD1854 isn't quite right. The firmware uses a 1-byte page select command (BYh), but SSD1854 is using a 2-byte command (B0h,YYh). There are a number of similar grayscale LCD chips, most of them having the correct 1-byte command:

Code: Select all

  SSD0852  128x128 would allow double-buffer, but extended commands are wrong
  SSD0858  104x65  close, but extended commands are wrong
  SSD0859  128x81  could be correct (almost same as SSD1850)
  SSD1820  128x65  wrong, lacks palette (command 88h-8Fh)
  SSD1820A 128x65  wrong, lacks palette (command 88h-8Fh)
  SSD1821  128x81  wrong, lacks palette (command 88h-8Fh)
  SSD1850  128x65  could be correct (ysiz is good, but no double-buffering)
  SSD1851  128x81  as above, but more lines than needed
  SSD1852  128x128 would allow double-buffer, but extended commands are wrong
  SSD1854  128x160 wrong, uses 2-byte command B0h,YYh lacks extended commands
                   (also cmd 18h,20h,4xh,50h,60h-63h,64h,82h,83h,etc. differ)
  SSD1858  104x65  close, but lacks many extended commands
  SSD1859  128x81  could be correct (almost same as SSD1850)
But, none of them is mentioning the extended 2-byte command F7h,02h. And none is mentioning VRAM double buffering (though one could probably abuse the 128-line SSD0852/SSD1852 chips for 64-line double buffering).
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty

Post Reply