1985 · Beyond Software

Shadowfire

This minisite was contributed by air. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/shadowfire with me to Gold.

Combat works out how hard each weapon hits the next location and then never uses the answer, and the search for enemies reads past the end of its table into places where nobody stands.

01 · Combat

Bug: every weapon hits the next location as hard as its own

Each weapon has two strengths, one for an enemy in the same location and one for an enemy next door, and the manual advises firing some weapons into the next location. Combat works out both and then uses only the first, everywhere.


    

The routine and the 36 weapons' strength bytes (weapon_strength, $CF15) from the listing. X is set to 0 at $5C9B, and the loop goes round with INY at $5D3A only. Run from a moment of play, the routine takes as much strength from an enemy next door to a defending Syylk as from one in his own location.

Before a round, combat fills an eight-byte table with the damage for each place the attacker can reach: the first entry from the high four bits of the weapon's strength, for its own location, and the seven after it from the low four bits, for the locations around it (damage, $68D7). The loop over the targets then reads the table with X, and X is set to 0 before the loop and never changed. Every target in reach takes the first entry, so a weapon's second strength is never used, and range makes no difference to any weapon.

02 · Phantom enemies

Bug: five locations hold enemies that are not there

The check for an enemy in a location reads eight records past the end of the people, and the bytes it finds there say that someone alive is standing in five places.

The eight "records" after the fiftieth person, eighteen bytes each from $CD92, read as enemy_at ($7250) reads them: bit 1 of the first byte clear for alive, the third byte the location. The objects' bytes are as a new game starts them.

enemy_at starts at person 8, the first enemy, and steps through fifty records of eighteen bytes. There are only 42 enemies, so its last eight records lie beyond the table: three spare pointers and then the objects' records. The first of them always reads as alive in location $80, MILITARY ACCESS BY PASS. The others change as objects are moved and picked up, and a new game puts phantoms in four more locations.

Attack and Retreat both call enemy_at. A character told to retreat towards one of these locations refuses, with "CANNOT RUN IN THAT DIRECTION ENEMY IN THAT LOCATION", and an attack into one is accepted with nobody there to fight.

03 · Zoff's pet

Bug: Zoff's invisible pet began as a bug

The mission briefing warns of the Phantom, Zoff's invisible pet alien, which roams the starship attacking characters at random. Its makers said in July 1985 that the Phantom was a bug in the Commodore 64 version, and that they had taken it out.

WhereWhat it says
The booklet, mission briefing"Beware the Phantom. Zoff's invisible pet alien roams the starship attacking characters at random."
Steve Cain of Denton Designs, Sinclair User 40, July 1985, page 58"On the Commodore 64 Shadowfire there was a bug. A phantom would appear and attack members of the Enigma team. We couldn't work out why, so we decided it was Zoff's pet. It turned out there was a spelling mistake on a single mnemonic in the machine code somewhere. We've taken the bug out now, so the bit in the booklet about Zoff's pet doesn't matter any more."

The booklet's warning and the explanation Denton Designs gave for it. The magazine's interview is on the Internet Archive.

In the program on Beyond's tape, every attacker is one of the fifty people aboard. The game moves them one at a time, one each time the screen is redrawn, and after the fiftieth it starts again at the first (irq_entity, $66D1, and $6197). Combat ($5BE6) runs only for someone who is attacking, defending or retreating, and every one of the fifty shows on the view screen's map and in the list of people in a location. Beyond's disk and four cracked copies, one of them dated 30 April 1985, hold the same program.

Which mnemonic was wrong, and what it did, is unknown. The one search in this program that runs past the end of the people is enemy_at (section 02), and its phantoms do not attack anyone: they block a retreat and take an attack with nobody there to fight.

04 · A guard

Bug: one guard was meant to patrol and never moves

Person $27, a horned guard in XATOR SECURITY, has a patrol script like the guards around him, but the bit that sets him walking was left out of his record.

The records of the horned guards as a new game starts them, from $CA0E. Byte +7's top bit sends a guard along the script numbered in byte +8.

A guard walks a patrol when bit 7 of byte +7 is set. Person $27 has $50 there, bit 7 clear, with script 1 waiting in byte +8, so he stands in location $40 all game while every other horned guard walks its route.

05 · The clock

Secret: the clock runs on past 00:00

The mission has one hour forty minutes. When the clock reaches 00:00 the game carries on, and the clock counts up.

The team screen with the clock at 00:02 and the ticker scrolling the start of AMBASSADOR KRYXIX HAS BEEN EXECUTED

The emulator two seconds past zero: the clock reads 00:02, counting up, and the ticker has begun "AMBASSADOR KRYXIX HAS BEEN EXECUTED".

Past 00:00 the clock counts up from 00:01 (clock_up, $CA04). Kryxix, unless he is dead already, is executed, and "WAR HAS BEEN DECLARED BY THE REPUBLIC" follows him on the ticker. Play goes on. Counting up past 99:59, the clock shows a ten in its first digit for one second and turns back into a countdown from 99:59 (clock_wraps, $6473).

06 · The portraits

Bug: the portraits never show the top line of their cells

A portrait rolls onto the monitor a line at a time. The roll copies seven of each cell's eight lines, and the eighth, the top one, shows the line below it again.

Syylk's portrait as its bytes hold it ($F38F).

The monitor in a frame recorded in the emulator.

show_portrait ($48B1) makes seven passes. Each copies one pixel line of all 80 cells, line 7 first and line 1 last, into the top line of every cell row, then rolls the rows down a line, like a television picture settling. Line 0 of each cell is never copied, so after the last roll the top line holds line 1 for a second time: 80 of each portrait's 640 bitmap bytes are never seen.

07 · The music

Secret: the music in play starts silent

The manual says the arrows on the team screen turn the music on and off. They fade it in and out, and a new game starts with it faded out.

The in-game tune plays all along, but its two melody voices are pulse waves whose width is the byte at $1603, and a new game leaves it at 0, a pulse of no width (How it works). The up arrow adds one to it on every pass of the screen's loop while fire is held, up to $40, and the down arrow takes one off, down to 0. Holding fire on the up arrow for a third of a second takes it from 0 to $11.

08 · The self-destruct

Bug: the self-destruct takes 256 seconds where the manual says four minutes

Armed with its card, the self-destruct unit counts down a byte that starts at 0, and its first second takes it to 255.

The start menu's summary after the self-destruct: six survivors, 44 enemy killed or captured, mission incomplete, Kryxix not rescued

The emulator 256 seconds after the unit was armed, with the team still aboard the attack craft: Zoff V destroyed, 44 counted, and the mission incomplete with Kryxix not rescued.

activate_destruct_unit ($747F) sets the countdown to 0 and arms it, and the interrupt takes a second off it each second, so it runs out after 256 rather than the 240 of four minutes.

When the countdown runs out, the team members still aboard Zoff V die with Kryxix and Zoff, the 42 enemies are counted as killed, Kryxix and Zoff take the count to 44, and the ship counts as destroyed ($61D1).

09 · Kryxix and Zoff

Secret: Kryxix and Zoff cannot be hurt

Zoff walks the ship like anyone else and can be captured, but weapons cannot touch him, or the ambassador he holds.

In combat an enemy hits the six team members and a team member hits people 8 to 49 ($5BFF). Kryxix is person 6 and Zoff person 7, so they are on neither list: they never fight and never lose strength. Zoff is beaten by beaming him aboard the attack craft, which counts as his capture, and Kryxix is rescued the same way ($5A68).

10 · Patrols

Secret: guards walk home four times as fast as they walk out

A patrol script gives a time for each step, and the guard uses it differently in each direction.

Walking a script forwards, each step takes its time multiplied by four seconds; walking it back, the time as it stands ($5E22). The Maps / levels tab draws each script's route.

11 · The view screen

Bug: one cell of the view screen never shows anybody

The view screen's map has seventeen places where an icon can appear, and the search for people fills only sixteen of them.

find_view_locations ($6BB7) counts X down from 15 to 0 through the seventeen cells of the view, so cell 16, two tiles right of the character and two down, is never searched. Anyone standing in a location there is not shown on the view screen.

12 · The explosion

Secret: Zoff V's explosion shakes the screen to the game's own code

When the ship blows up, the screen shakes and flashes for 256 frames, and the shaking comes from reading the program as if it were a table of random numbers.

shake_screen from the listing.

shake_screen ($4AD7) sets the screen's fine scroll, up and down and side to side, from the bytes at $4000 and $5000 onwards, one byte of each a frame, and flashes the border and background through sixteen colours. The bytes at $4000 are the start of the game's code, and those at $5000 the middle of a routine: the explosion's movement is the program's own instructions.

13 · The demonstration

Bug: the demonstration ends by clicking its way out

Left alone on the title, the game plays itself by walking the cursor through a script of 55 points. The script has no end mark: it stops by choosing Quit twice.

input_demo ($5570) would end the demonstration at a point whose second byte is $FF, and none has one. The last two points are the team screen's Quit and the start menu's Quit, which goes back to the control menu, and the control menu turns the demonstration off ($41FC). The demonstration ends the same way every time it runs.

14 · Leftovers

Secret: rules for a talking program are left in three corners of memory

Three runs of unused bytes hold text that has nothing to do with the game: pronunciation rules in the form a text-to-speech program reads.

The bytes from the listing, shown as text (the top bit of a rule's last character marks its end).

Each rule names a spelling in brackets and what it sounds like after the equals sign: "(THOSE)=DHOHZ". That is the form of the rules in Reciter, the part of the speech program S.A.M. that turns English spelling into sounds. The bytes sit after the colour matrix, after the colour source and after the demonstration's script, in places the game never reads.