DSi-enhanced games make use of an extended header together with other data structures which implement additional integrity and obfuscation measures over those already present in NDS games. These measures make it currently impossible to produce a ROM image that will run on unmodded retail hardware, however due to the existence of leaked debug keys, it is possible to resign retail ROMs to make them bootable on dev hardware such as the IS-TWL-DEBUGGER.
A very good description of the TWL header format can be found on GBATEK. It is expanded from the 512 bytes of the DS to 4KiB, and it contains many additional entries, but I will be mainly referring to the following:
- The flags field (0x1BF)
- Digest sector entries (0x1E0 - 0x208)]
- Modcrypt entries (0x220 - 0x230)
- HMAC array (0x300 - 0x3B4)
- RSA signature (0xF80 - 0x1000)