Tuesday 18 May 2021

An Iron Curtain Adventure: Miroslav Fídler's P.R.E.S.T.A.V.B.A


In the past I ported a Hungarian game and translated it to English (A Hös Lovag) with the help of Google and a lot of guess work. I recently came across another game from "behind the Iron curtain." It's a Czech game with an anti-Soviet theme, written as a protest when Czechoslovakia was still under the thumb of the USSR. It’s called P.R.E.S.T.A.V.B.A.

I picked up on this fascinating game from Arron Reed’s fascinating writeup. The author, Miroslav Fídler, was one of the few good programmers in Czechoslovakia at the time and knew how to code in assembler, so he intentionally used humble Sinclair Spectrum Basic to program the game in order to disguise his identity.  It was funny to read about how Basic was used as a screen to prevent his identity from being rumbled by the authorities– The people’s language being used to protect him against "the people’s government."  He also apparently, according to Reed, intentionally mangled the code to further disguise his identity.

However, the code was generally pretty clean. I'm not sure if he designed it completely himself, or drew on some standard Basic text adventure engine. There was an error in the room DATA that would have the program read beyond the room description strings available, at least in my Micro Color Basic version. There are only 19 room descriptions, but there is no reference to room 19 (which is the location outside the church), but instead some rooms send you to room 20. In any other machine than the Spectrum, this would cause some kind of error, but due to some quirk in Speccy Basic this discrepancy doesn't seem to cause a problem. I think Fidler might be taking advantage of some features of the Speccy that allows it somehow to ignore anomalous reads so that the data from room 19 is left in place despite there being no room 20 data. So no harm no foul.  But I'm not 100% sure what's going on.

I believe that string DATA items and number DATA items are handled completely separately in a Speccy and you can RESTORE to the beginning of any line number you desire, which is a feature Fídler uses extensively. This means you can read all the strings in order or all the number items in order– the Speccy just doesn’t care. But in other BASICs you have to read all items, string and numeric, in their precise sequence, so I had to do some fixing of how DATA statements were read. The program also has a hidden DATA statement that never gets used. Line 103 reads DATA”DON’T BE AFRAID OF THEM!” Chilling.

The program also contains a weird technique of using the PI function along with the functions NOT, SGN, and INT as replacements for the numbers 0, 1 and 3.  For other numbers, instead of using simple digit, Fídler uses the VAL function and then the number expressed as a string "11."  This might be why Reed suggests that the code was somehow mangled as a further protection against detection by the authorities.  However, this might just be a memory saving trick of Speccy Basic. Instead of multiple bytes being used for each numeric value, 2 bytes, one for each keyword token, is all that is needed. I know in Micro Color Basic floating point numbers require 5 bytes, but it might be more in Speccy Basic. Perhaps then even the VAL plus a string and its 2 quote marks can provide a memory saving.  Again, I can't be sure, and I'm not going to pour over the idiosyncrasies of Sinclair Basic to find out.  Reed might be right that it is some kind of red herring for the authorities.

I also fixed a few quirks and annoyances in the parser and added some responses that are shown by Reed, but were not part of the Speccy version.  I think Reed might have used an Atari port as the basis for his translations and discussion. I was able to draw on Reed's translations to help with my own, especially his English transliteration of the satirical acronym used as the title.

I also added a few tweaks to the descriptions.  I added the date to the slogan about "golden February" since most non-Czechs will be unfamiliar with the year of the February coup that brought in communism.  The downstairs hall now "echoes strangely" to give some clue of where to dig. It now prints a message when you hit your item max, chiding you not to be a "hoarder." And a few others. All the graphics and sound in my version are my additions, including a flashing screen for the pyrotechnics at the end.

Info about playing the game can be found here: http://faculty.cbu.ca/jgerrie/Home/Type-in-Mania.html


The game can be played here under the "Play our 8-bit Text Adventures" link:


No comments:

Post a Comment