20th of November 2019 – Berzerk

Title “image”

as mentioned in the VectorWar IX, I became quite a fan of Berzerk.Therefor (and because of the wonderful disassambly of Fred Taft) – I am trying to create an “ultimate” version.

Fixes done so far:

  • bonus display bug fixed
  • shoot thru wall bug fixed
  • to many shots bug fixed (shots now limited to 32, but more was probably never reached)
  • displayes most of the time in 50Hz
  • no “prisoners” anymore
  • no “double” drawn walls
Virgin highscores

Additions done:

  • like in the “arcade” Berzerk, robot shots can now be shot by player shots
  • also a max robot-shot speed of 7 (which is still quite fast)
  • color mode, when enabled, displays BERZERK in Arcade Jason color mode*
  • VecVox support (similar to Verzerk, but that one added VecVoice support)*
  • Highscore list (5 scores) can be saved to VecFever or DS 2431*
  • Intro-Screen

* can be enabled/disabled in a yet to be done option screen

In order to do the above I did:

  • Incorporate all known changes done in Berzerk II (unreleased changes done by MB) and Berzerk debugged (changes by Fred Taft).
  • labyrinth generation:
    added functions, that examine the labyrinth for prisons/double draws, and changed the labyrinth when that happened
  • labyrinth display:
    Changed the display routines of the maze.
  • shots changed:
    shots are internally not an “ever growing” array (including dead shots) anymore, instead a linked list of “active” shots
  • display of the robots changed to smartlist:
    before each robot was drawn with 7 (seven!!!) seperate vectorlists, which formed all animation steps, only 8 different “complete” lists are needed for all animations
  • display of player changed to smartlist:
    befor the player was “constructed” of
    – body
    – arms (left/right (anims), 8 shot directions)
    – legs (left/right (anims))
  • score display:
    in a two player game, only the active score is displayed, not both
  • changed the shot handling:
    Before shots with a speed of say 5, increased position information 5 times per round (with 1), and 5 times all checkings (hit wall, hit player, hit robot) were done, this was immensely time consuming. The new detection functions handle all high speed detections in one go.
  • seperated the “scroll” display from the static display (scrolling of the labyrinth)
  • and probably some other changes.


  • Berzerk speed changes done by Binarystar.
    I will probably not incorporate these. The play is with above changes in most cases faster (50Hz display…) anyways – personally I find the “double” movement a bit jerky…
    If someone “needs” this – I plan to open source my changes, so you can do them yourself.
  • Dalek Mode
    I did a “Dalek” mode, (no labyrinth, robots “update” very fast) – I will leave the “switch” in the sources, but it will not be an option within Berzerk.
  • PB6
    VecMulti and VecFlash have problems when PB6 is accessed (and not ment for them).
    Therefor I will release two binaries, one with DS2431 option enabled, and one without. So one version will be the correct one for you!
  • The main resource-“hog” within Berzerk are shots. Even with all of the above mentioned changes and optimizations – when more than about 10 shots are on screen, than the 50Hz are endangered.
    (each shot is tested each round, for player hit, each robot hit, wall hit, each shot hit. Lets say there are 5 robots, 1 player, 8 robot shots and 4 player shots, tests done:
    – 32: 4*8 (player shot – robot shot hits) (only player shots can hit robot shots)
    – 60: 12*5 (shots – robot hits)
    – 8: 8 (robot shots – player hit)
    – 12: 12 (shot – wall hits (this is not totally trivial, since the labyrinth is build in sections, and the shot is tested whether its leaves a section, if so the section is tested for walls on its “borders”…))

    -> 112 tests… lets say each test takes “only” 100 cycles… than we are way above 10000 cycles for shot tests alone (and this can not easily be done during “moves”… either)

Current status
Nearly done. Left todo:

  • option screen
  • implement some other voices for VecVox

Let me say one other thing.
The (original) programming of Berzerk results in many places in not being very fast. But doing Berzerk in only 4kB was amazing. Very clever (size) optimizations were done. I am very grateful to Fred Taft for the disassembly, without him, I probably would have given up understanding the code.


Tagged on:

4 thoughts on “20th of November 2019 – Berzerk

  1. Phillip Eaton

    Excellent programming diversion story and thanks for the update! It’s such a simple game, but has no much in it if you give it a chance. What I found in the Vector Wars is that it’s sort of like on advanced version of Hunchback: you have to get from one side of the screen to the other, making all the frantic preparation at the entry point, then use your position to get some of the other robots to kill themselves, then make a safe dash and zap to the other side by going a little bit up and a little bit down the screen, then finally manipulating Otto to hopefully clean up and residual robots. Avoid they and bottom exits wherever possible. That simple mechanic works really well!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.