Skip to navigation

Elite on the BBC Micro and NES

Version analysis of HATB

This code appears in the following versions (click to see it in the source code):

Code variations between these versions are shown below.

Name: HATB Type: Variable Category: Ship hangar Summary: Ship hangar group table
This table contains groups of ships to show in the ship hangar. A group of ships is shown half the time (the other half shows a solo ship), and each of the four groups is equally likely. The bytes for each ship in the group contain the following information: Byte #0 Non-zero = Ship type to draw 0 = don't draw anything Byte #1 Bits 0-7 = Ship's x_hi Bit 0 = Ship's z_hi (1 if clear, or 2 if set) Byte #2 Bits 0-7 = Ship's z_lo Bit 0 = Ship's x_sign The ship's y-coordinate is calculated in the has1 routine from the size of its targetable area. Ships of type 0 are not shown.

Code variation 1 of 14A variation in the comments only

This variation is blank in the 6502 Second Processor and Master versions.

Note that ship numbers are for the ship hangar blueprints at XX21 in the docked code, rather than the full set of ships in the flight code. They are: 1 = Cargo canister 2 = Shuttle 3 = Transporter 4 = Cobra Mk III 5 = Python 6 = Viper 7 = Krait 8 = Constrictor
.HATB \ Hangar group for X = 0 \

Code variation 2 of 14Related to the Master version

In the disc and 6502SP versions, the first ship hangar group (of four) consists of a Transporter on the right and a Shuttle on the left, while in the Master version the first group has a lone Cobra Mk III on the left.

See below for more variations related to this code.

Tap on a block to expand it, and tap it again to revert.

\ Shuttle (left) and Transporter (right)
\ Cobra Mk III (left)

Code variation 3 of 14Related to the Master version

See variation 2 above for details.

Tap on a block to expand it, and tap it again to revert.

EQUB 2 \ Ship type in the hangar = 2 = Shuttle
EQUB 11 \ Ship type = 11 = Cobra Mk III
EQUB 9 \ Ship type = 9 = Shuttle

Code variation 4 of 14Related to the Master version

See variation 2 above for details.

Tap on a block to expand it, and tap it again to revert.

EQUB %01010100 \ x_hi = %01010100 = 84, z_hi = 1 -> x = -84
EQUB %01000100 \ x_hi = %01000100 = 68, z_hi = 1 -> x = -68
 EQUB %00111011         \ z_lo = %00111011 = 59, x_sign = 1        z = +315

Code variation 5 of 14Related to the Master version

See variation 2 above for details.

Tap on a block to expand it, and tap it again to revert.

EQUB 3 \ Ship type in the hangar = 3 = Transporter
EQUB 0 \ No second ship
EQUB 10 \ Ship type = 10 = Transporter
 EQUB %10000010         \ x_hi = %10000010 = 130, z_hi   = 1    -> x = +130
 EQUB %10110000         \ z_lo = %10110000 = 176, x_sign = 0       z = +432

 EQUB 0                 \ No third ship
 EQUB 0
 EQUB 0

                        \ Hangar group for X = 9
                        \
                        \ Three cargo canisters (left, far right and forward,
                        \ right)

Code variation 6 of 14Specific to an individual platform

Tap on a block to expand it, and tap it again to revert.

EQUB 1 \ Ship type in the hangar = 1 = Cargo canister
EQUB OIL \ Ship type = OIL = Cargo canister
 EQUB %01010000         \ x_hi = %01010000 = 80, z_hi   = 1     -> x = -80
 EQUB %00010001         \ z_lo = %00010001 = 17, x_sign = 1        z = +273

Code variation 7 of 14Specific to an individual platform

Tap on a block to expand it, and tap it again to revert.

EQUB 1 \ Ship type in the hangar = 1 = Cargo canister
EQUB OIL \ Ship type = OIL = Cargo canister
 EQUB %11010001         \ x_hi = %11010001 = 209, z_hi = 2      -> x = +209
 EQUB %00101000         \ z_lo = %00101000 =  40, x_sign = 0       z = +552

Code variation 8 of 14Specific to an individual platform

Tap on a block to expand it, and tap it again to revert.

EQUB 1 \ Ship type in the hangar = 1 = Cargo canister
EQUB OIL \ Ship type = OIL = Cargo canister
 EQUB %01000000         \ x_hi = %01000000 = 64, z_hi   = 1     -> x = +64
 EQUB %00000110         \ z_lo = %00000110 = 6,  x_sign = 0        z = +262

                        \ Hangar group for X = 18
                        \

Code variation 9 of 14Related to the BBC Micro disc version

In the disc version, the third ship hangar group (of four) consists of a Transporter on the right and a Cobra Mk III on the left, while in the advanced versions the third group has a Viper on the right and a Krait on the left.

See below for more variations related to this code.

Tap on a block to expand it, and tap it again to revert.

\ Transporter (right) and Cobra Mk III (left)
\ Viper (right) and Krait (left)

Code variation 10 of 14Related to the BBC Micro disc version

See variation 9 above for details.

Tap on a block to expand it, and tap it again to revert.

EQUB 3 \ Ship type in the hangar = 3 = Transporter
EQUB COPS \ Ship type = COPS = Viper
 EQUB %01100000         \ x_hi = %01100000 =  96, z_hi   = 1    -> x = +96
 EQUB %10010000         \ z_lo = %10010000 = 144, x_sign = 0       z = +400

Code variation 11 of 14Related to the BBC Micro disc version

See variation 9 above for details.

Tap on a block to expand it, and tap it again to revert.

EQUB 4 \ Ship type in the hangar = 4 = Cobra Mk III
EQUB KRA \ Ship type = KRA = Krait
 EQUB %00010000         \ x_hi = %00010000 =  16, z_hi   = 1    -> x = -16
 EQUB %11010001         \ z_lo = %11010001 = 209, x_sign = 1       z = +465

 EQUB 0                 \ No third ship
 EQUB 0
 EQUB 0

                        \ Hangar group for X = 27
                        \

Code variation 12 of 14Related to the Master version

In the disc and 6502SP versions, the fourth ship hangar group (of four) consists of a Viper on the right and a Krait on the left, while in the Master version the fourth group has an Adder on the right and a Viper on the left.

See below for more variations related to this code.

Tap on a block to expand it, and tap it again to revert.

\ Viper (right and forward) and Krait (left)
\ Adder (right and forward) and Viper (left)

Code variation 13 of 14Related to the Master version

See variation 12 above for details.

Tap on a block to expand it, and tap it again to revert.

EQUB 6 \ Ship type in the hangar = 6 = Viper
EQUB 20 \ Ship type = 20 = Adder
EQUB 16 \ Ship type = 16 = Viper
 EQUB %01010001         \ x_hi = %01010001 =  81, z_hi  = 2     -> x = +81
 EQUB %11111000         \ z_lo = %11111000 = 248, x_sign = 0       z = +760

Code variation 14 of 14Related to the Master version

See variation 12 above for details.

Tap on a block to expand it, and tap it again to revert.

EQUB 7 \ Ship type in the hangar = 7 = Krait
EQUB 16 \ Ship type = 16 = Viper
EQUB 19 \ Ship type = 19 = Krait
 EQUB %01100000         \ x_hi = %01100000 = 96,  z_hi   = 1    -> x = -96
 EQUB %01110101         \ z_lo = %01110101 = 117, x_sign = 1       z = +373

 EQUB 0                 \ No third ship
 EQUB 0
 EQUB 0