Prof. Dr. rer. nat. Peer Johannsen

Weird Science - Tales from the Vectrex Academy Lab

Vectrex Project Title


Project Status

  • Completed


  • An investigation of the Vectrex BIOS routine Draw_Grid_VL / NIBBY ($FF9F)
  • Some interesting, yet probably utterly useless findings...


  • In contrast to all other BIOS routines, Draw_Grid_VL is not listed in the official GCE Vectrex Programming Manuals Part 1 and Part 2.
  • Draw_Grid_VL is the only BIOS routine which is located at the very end of the ROM, after the ROM data sections (lookup tables, music, etc.).
  • I strongly suspect that this routine is not at all intended for drawing grids. It is rather a drawing routine for vector lists that use a simplified but memory-saving compressed format where each vector coordinate is encoded by a nibble (i.e. only 4 bits). A y/x coordinate pair is thus condensed in a single byte. This format is called a "NIBBY STYLE LIST".
  • I think this routine is some sort of experimental code that somehow survived in the BIOS.
  • The implementation code significantly differs between BIOS versions (B796) and (7931 + 7ADB).
  • Also the semantics of the vector list encodings differs (e.g. the way how "moves" and "draws" are encoded).
  • Let us call these encodings "nibby style 0" (B796) and "nibby style 1" (other versions). For further explanations of the encodings, an annotated C source code example is available below.
  • The whole thing constitutes an incompatibility between those BIOS versions, and code working on the one version will not work on the other versions (or rather produce a different result on the screen).
  • I also presume that Draw_Grid_VL requires just one parameter, which is the base address of the nibby style list, passed to the routine in the y register. The x register is not used in a meaningful way and is modified internally only as a side effect of the subroutines used by Draw_Grid_VL.


  • Draw_Grid_VL internally writes to $C880, using it as a temporal storage. Since $C880 is usually considered as the beginning of the user RAM, using Draw_Grid_VL is a bit dangerous.


  • Peer Johannsen


  • nibby style 0 on BIOS version B796 (left), and on different versions(right)


  • nibby style 1 on BIOS version B796 (left), and on different versions(right)


  • Downloads are free and for non commercial use only. Use at your own risk.
  • Please respect the copyright and credit the author and the origin of this project.

Latest modification on 05/02/2020, 19:00
  • Page created