.ENTRY CLD ; Clear the decimal flag, so we're not in decimal mode LDA #LO(U%-1) ; Set FRIN(1 0) = U%-1 as the low address of the STA FRIN ; decryption block, so we decrypt the loader routine LDA #HI(U%-1) ; at U% below STA FRIN+1 LDA #HI(V%-1) ; Set (A Y) to V% as the high address of the decryption LDY #LO(V%-1) ; block, so we decrypt to V% at the end of the loader ; routine LDX #KEY3 ; Set X = KEY3 as the decryption seed (the value used to ; encrypt the code, which is done in elite-checksum.py) IF _REMOVE_CHECKSUMS NOP ; If we have disabled checksums, skip the call to DEEORS NOP NOP ELSE JSR DEEORS ; Call DEEORS to decrypt between U% and V% ENDIF LDA #LO(W%-1) ; Set FRIN(1 0) = W%-1 as the low address of the STA FRIN ; decryption block, so we decrypt the game data at LDA #HI(W%-1) ; at W% above STA FRIN+1 LDA #HI(X%-1) ; Set (A Y) to X% as the high address of the decryption LDY #LO(X%-1) ; block, so we decrypt to X% at the end of the game data LDX #KEY4 ; Set X = KEY4 as the decryption seed (the value used to ; encrypt the code, which is done in elite-checksum.py) IF _REMOVE_CHECKSUMS NOP ; If we have disabled checksums, skip the call to DEEORS NOP NOP ELSE JSR DEEORS ; Call DEEORS to decrypt between W% and X% ENDIF JMP U% ; Now that both the game data and the loader routine ; have been decrypted, jump to the loader routine at U% ; to load the gameName: Elite loader (Part 1 of 7) [Show more] Type: Subroutine Category: Loader Summary: Unscramble the loader code and game dataContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Subroutine DEEORS (category: Loader)
Decrypt a multi-page block of memory
[X]
Variable FRIN (category: Loader)
A temporary variable that's used for storing addresses
[X]
Configuration variable KEY3 = $8E
The seed for decrypting COMLOD from U% to V%, which is the second block of data, after the decryption routine
[X]
Configuration variable KEY4 = $6C
The seed for decrypting COMLOD from W% to X%, which is the first block of data, before the decryption routine
[X]
Label U% in subroutine Elite loader (Part 2 of 7)
[X]
Variable V% (category: Utility routines)
Denotes the end of the second block of loader code, as used in the encryption/decryption process
[X]
Variable W% (category: Utility routines)
Denotes the start of the first block of loader code, as used in the encryption/decryption process
[X]
Variable X% (category: Utility routines)
Denotes the end of the first block of loader code, as used in the encryption/decryption process