diff options
Diffstat (limited to 'packages/libndsfpc/src/nds/memory.inc')
-rw-r--r-- | packages/libndsfpc/src/nds/memory.inc | 98 |
1 files changed, 88 insertions, 10 deletions
diff --git a/packages/libndsfpc/src/nds/memory.inc b/packages/libndsfpc/src/nds/memory.inc index a2c2125cbf..151771a541 100644 --- a/packages/libndsfpc/src/nds/memory.inc +++ b/packages/libndsfpc/src/nds/memory.inc @@ -11,6 +11,16 @@ const ARM7_OWNS_ROM = (1 shl 7); + REG_MBK1: pcuint8 = pointer($04004040); // WRAM_A 0..3 + REG_MBK2: pcuint8 = pointer($04004044); // WRAM_B 0..3 + REG_MBK3: pcuint8 = pointer($04004048); // WRAM_B 4..7 + REG_MBK4: pcuint8 = pointer($0400404C); // WRAM_C 0..3 + REG_MBK5: pcuint8 = pointer($04004050); // WRAM_C 4..7 + REG_MBK6: pcuint32 = pointer($04004054); + REG_MBK7: pcuint32 = pointer($04004058); + REG_MBK8: pcuint32 = pointer($0400405C); + REG_MBK9: pcuint32 = pointer($04004060); + // Protection register (write-once sadly) {$ifdef ARM7} PROTECTION : pcuint32 = pointer($04000308); @@ -69,13 +79,13 @@ type flags: cuint8; // auto-boot flag arm9romOffset: cuint32; - arm9executeAddress: cuint32; - arm9destination: cuint32; + arm9executeAddress: pointer; + arm9destination: pointer; arm9binarySize: cuint32; arm7romOffset: cuint32; - arm7executeAddress: cuint32; - arm7destination: cuint32; + arm7executeAddress: pointer; + arm7destination: pointer; arm7binarySize: cuint32; filenameOffset: cuint32; @@ -108,20 +118,88 @@ type gbaLogo: array [0..155] of cuint8; logoCRC16: cuint16; headerCRC16: cuint16; - + end; + tNDSHeader = sNDSHeader; + pNDSHeader = ^tNDSHeader; + + DSiHeader = packed record + ndshdr: tNDSHeader; debugRomSource: cuint32; debugRomSize: cuint32; debugRomDestination: cuint32; offset_0x16C: cuint32; - zero: array [0..143] of cuint8; + zero: array [0..15] of cuint8; + + global_mbk_setting: array [0..4, 0..3] of cuint8; + arm9_mbk_setting: array [0..2] of cuint32; + arm7_mbk_setting: array [0..2] of cuint32; + mbk9_wramcnt_setting: cuint32; + + region_flags: cuint32; + access_control: cuint32; + scfg_ext_mask: cuint32; + offset_0x1BC: array [0..2] of cuint8; + appflags: cuint8; + + arm9iromOffset: pointer; + offset_0x1C4: cuint32; + arm9idestination: pointer; + arm9ibinarySize: cuint32; + arm7iromOffset: pointer; + offset_0x1D4: cuint32; + arm7idestination: pointer; + arm7ibinarySize: cuint32; + + digest_ntr_start: cuint32; + digest_ntr_size: cuint32; + digest_twl_start: cuint32; + digest_twl_size: cuint32; + sector_hashtable_start: cuint32; + sector_hashtable_size: cuint32; + block_hashtable_start: cuint32; + block_hashtable_size: cuint32; + digest_sector_size: cuint32; + digest_block_sectorcount: cuint32; + + banner_size: cuint32; + offset_0x20C: cuint32; + total_rom_size: cuint32; + offset_0x214: cuint32; + offset_0x218: cuint32; + offset_0x21C: cuint32; + + modcrypt1_start: cuint32; + modcrypt1_size: cuint32; + modcrypt2_start: cuint32; + modcrypt2_size: cuint32; + + tid_low: cuint32; + tid_high: cuint32; + public_sav_size: cuint32; + private_sav_size: cuint32; + reserved3: array [0..175] of cuint8; + age_ratings: array [0..15] of cuint8; + + hmac_arm9: array [0..19] of cuint8; + hmac_arm7: array [0..19] of cuint8; + hmac_digest_master: array [0..19] of cuint8; + hmac_icon_title: array [0..19] of cuint8; + hmac_arm9i: array [0..19] of cuint8; + hmac_arm7i: array [0..19] of cuint8; + reserved4: array [0..39] of cuint8; + hmac_arm9_no_secure: array [0..19] of cuint8; + reserved5: array [0..2635] of cuint8; + debug_args: array [0..383] of cuint8; + rsa_signature: array [0..127] of cuint8; end; - tNDSHeader = sNDSHeader; - pNDSHeader = ^tNDSHeader; + T__DSiHeader = DSiHeader; + P__DSiHeader = ^T__DSiHeader; + const - __NDSHeader : pNDSHeader = pointer($02FFFE00); - + __NDSHeader : pNDSHeader = pointer($02FFFE00); + __DSiHeader : P__DSiHeader = pointer($02FFE000); type sNDSBanner = packed record |