{$ifdef NDS_INTERFACE} const {$ifdef ARM9} REG_EXMEMCNT : pcuint16 = pointer($04000204); {$else} REG_EXMEMSTAT: pcuint16 = pointer($04000204); {$endif} ARM7_MAIN_RAM_PRIORITY = (1 shl 15); ARM7_OWNS_CARD = (1 shl 11); ARM7_OWNS_ROM = (1 shl 7); // Protection register (write-once sadly) {$ifdef ARM7} PROTECTION : pcuint32 = pointer($04000308); {$endif ARM7} ALLRAM : pcuint8 = pointer($00000000); MAINRAM8 : pcuint8 = pointer($02000000); MAINRAM16 : pcuint16 = pointer($02000000); MAINRAM32 : pcuint32 = pointer($02000000); // fixme: shared RAM // GBA_BUS is volatile, while GBAROM is not GBA_BUS : pcuint16 = pointer($08000000); GBAROM : pcuint16 = pointer($08000000); SRAM : pcuint8 = pointer($0A000000); {$ifdef ARM7} VRAM : pcuint16 = pointer($06000000); {$endif ARM7} type sGBAHeader = packed record entryPoint: cuint32; logo: array [0..155] of cuint8; title: array [0..11] of cchar; gamecode: array [0..3] of cchar; makercode: cuint16; is96h: cuint8; unitcode: cuint8; devicecode: cuint8; unused: array [0..6] of cuint8; version: cuint8; complement: cuint8; checksum: cuint16; end; TGBAHeader = sGBAHeader; PGBAHeader = ^sGBAHeader; const GBA_HEADER : pGBAHeader = pointer($08000000); type sNDSHeader = packed record gameTitle: array [0..11] of cchar; gameCode: array [0..3] of cchar; makercode: array [0..1] of cchar; unitCode: cuint8; deviceType: cuint8; // type of device in the game card deviceSize: cuint8; // device capacity (1<