Skip to navigation


Big Code File source

[Apple II version]

APPLE II ELITE BIG CODE FILE SOURCE Apple II Elite was written by Ian Bell and David Braben and is copyright D. Braben and I. Bell 1986 The code in this file is identical to the source disks released on Ian Bell's personal website at http://www.elitehomepage.org/ (it's just been reformatted to be more readable) The commentary is copyright Mark Moxon, and any misunderstandings or mistakes in the documentation are entirely my fault The terminology and notations used in this commentary are explained at https://elite.bbcelite.com/terminology The deep dive articles referred to in this commentary can be found at https://elite.bbcelite.com/deep_dives
This source file contains code to produce the Big Code File for Apple II Elite. The Big Code File comprises the game code and the ship blueprints.
This source file produces the following binary files: * CODE.unprot.bin * CODE1.unprot.bin * CODE2.unprot.bin after reading in the following files: * ELTA.bin * ELTB.bin * ELTC.bin * ELTD.bin * ELTE.bin * ELTF.bin * ELTG.bin * ELTH.bin * ELTI.bin * ELTJ.bin * ELTK.bin * SHIPS.bin
INCLUDE "1-source-files/main-sources/elite-build-options.asm" _IB_DISK = (_VARIANT = 1) _SOURCE_DISK_BUILD = (_VARIANT = 2) _SOURCE_DISK_CODE_FILES = (_VARIANT = 3) _SOURCE_DISK_ELT_FILES = (_VARIANT = 4) _4AM_CRACK = (_VARIANT = 5) _SOURCE_DISK = (_VARIANT = 2) OR (_VARIANT = 3) OR (_VARIANT = 4)
Configuration variables
CODE% = $4000 ; The address where the main game code file is run LOAD% = $4000 ; The load address of the main game code file, which is ; the same as the load address as it doesn't get moved ; after loading
Load the compiled binaries to create the Big Code File
ORG CODE% .elitea PRINT "elitea = ", ~P% INCBIN "3-assembled-output/ELTA.bin" .eliteb PRINT "eliteb = ", ~P% INCBIN "3-assembled-output/ELTB.bin" .elitec PRINT "elitec = ", ~P% INCBIN "3-assembled-output/ELTC.bin" .elited PRINT "elited = ", ~P% INCBIN "3-assembled-output/ELTD.bin" .elitee PRINT "elitee = ", ~P% INCBIN "3-assembled-output/ELTE.bin" .elitef PRINT "elitef = ", ~P% INCBIN "3-assembled-output/ELTF.bin" .eliteg PRINT "eliteg = ", ~P% INCBIN "3-assembled-output/ELTG.bin" .eliteh PRINT "eliteh = ", ~P% INCBIN "3-assembled-output/ELTH.bin" .elitei PRINT "elitei = ", ~P% INCBIN "3-assembled-output/ELTI.bin" .elitej PRINT "elitej = ", ~P% INCBIN "3-assembled-output/ELTJ.bin" .elitek PRINT "elitek = ", ~P% INCBIN "3-assembled-output/ELTK.bin" F% = P% PRINT "F% = ", ~F% PRINT "P% = ", ~P% IF _SOURCE_DISK_BUILD EQUB $79, $68, $00, $00, $EA, $82, $74, $31 ; These bytes appear to be EQUB $00, $8F, $79, $6E, $00, $00, $05, $8A ; unused and just contain random EQUB $74, $33, $00, $8F, $79, $7C, $00, $00 ; workspace noise left over from EQUB $FE, $83, $4C, $4F, $4F, $50, $00, $8F ; the BBC Micro assembly process EQUB $79, $A6, $00, $00 ELIF _IB_DISK OR _4AM_CRACK OR _SOURCE_DISK_CODE_FILES OR _SOURCE_DISK_ELT_FILES SKIPTO $A300 ENDIF .ships PRINT "ships = ", ~P% INCBIN "3-assembled-output/SHIPS.bin" SKIPTO $C000
Save CODE.unprot.bin
PRINT "P% = ", ~P% PRINT "S.A.CODE ", ~LOAD%, " ", ~P%, " ", ~LOAD%, " ", ~LOAD% SAVE "3-assembled-output/CODE.unprot.bin", CODE%, P%, LOAD%
Save CODE1.unprot.bin
SAVE "3-assembled-output/CODE1.unprot.bin", CODE%, CODE% + $5000, LOAD%
Save CODE2.unprot.bin
SAVE "3-assembled-output/CODE2.unprot.bin", CODE% + $5000, P%, LOAD%