• Contact
  • Journal
  • Home
  • Arcade
  • Asteroids 80%
  • DVG
  • Site
  • Page
  • Amiga
    • Rainbow Islands
      • 1loader-dec
      • 1loader
      • boot
      • orig-boot
      • Journal
  • Arcade
    • Asteroids 80%
      • Hardware
      • RAMUse
      • Code

      • DVG
      • VectorROM

      • Journal
    • Crazy Climber 1%
      • BigSpriteGraphics.pdf
      • Buildings.pdf
      • cclimber.asm
      • CharEnc.inc
      • CrazyClimberMemoryMapInfo.pdf
      • GraphicsAndCharacterAssetInfo.pdf
      • MemoryMap.inc
    • Defender 75%
      • RAMUse
      • Hardware
      • Bank1
      • Bank2
      • Bank3
      • Bank7
      • BankFixed
      • Mapping.txt
      • SoundHardware
      • SoundRAMUse
      • SoundCode
      • Defender-Theory-Early.pdf
      • Defender-Theory-Later.pdf
      • Defender.CPU.jpg
      • Defender.ROM.B&W.jpg
      • Defender.Vid.B&W.jpg
      • SoundROM.txt
    • Frogger (Sound)
      • SoundHardware
      • SoundRAMUse
      • SoundCode

      • Hardware
      • RAMUse
      • Code

      • GFX

      • Journal
    • Galaga 5%
      • CPU1 (Main)
      • CPU2 (Secondary)
      • CPU3 (Sound)
      • GFX1 (Characters)
      • GFX2 (Sprites)
      • PROMcolors
      • PROMpaletteChar
      • PROMpaletteSprite

      • CPU1Fix

      • Journal
    • Moon Patrol 75%
      • Hardware
      • RAMUse
      • Code

      • GFX1 (Text)
      • GFX2 (Sprites)
      • GFX3 (Mountains)
      • GFX4 (Hills)
      • GFX5 (City)
      • ImageBackgroundColors
      • SpriteColors
      • SpriteColorSets
      • TextColors

      • MoonPatrolSound
      • SoundHardware
      • SoundRAMUse
      • SoundCode

      • Journal
    • Omega Race 10%
      • Hardware
      • RAMUse
      • MainBoard

      • SoundHardware
      • SoundRAMUse
      • SoundBoard

      • DVGPROM
      • VectorROM

      • Journal
    • Phoenix 35%
      • Hardware
      • RAMUse
      • Code

      • Background
      • Foreground

      • Journal

      • Scramble HHi
        • phoenixj-func-main2.pdf
        • phoenixj-func-main2.scap
        • phoenixj.asm-may2025.txt
        • phoenixj.asm-may2025.txt.pdf
    • Space Invaders
      • Hardware
      • RAMUse
      • Code

      • Journal
    • Time Pilot (Sound)
      • SoundHardware
      • SoundRAMUse
      • SoundCode

      • Hardware
      • RAMUse
      • Code

      • Journal
    • Sea Wolf 1%
      • Hardware
      • RAMUse
      • Code

      • Journal
    • Scramble 1%
      • SoundHardware
      • SoundRAMUse
      • SoundCode

      • Journal
  • Atari2600
    • Stella (Hardware Info)
    • Asteroids 5%
      • RAMUse
      • Code

      • Journal
    • Battle Zone 1%
      • RAMUse
      • Code

      • Journal
    • Chess 1%
      • RAMUse
      • Code

      • Journal
    • Combat 10%
      • RAMUse
      • Code
      • CodePAL

      • Journal
    • Double Gap
      • Code
      • DoubleGap.asm

      • Journal
    • Entombed 1%
      • RAMUse
      • Code

      • Journal
    • ET 1%
      • RAMUse
      • Code

      • Journal
    • Burger Time 1%
      • RAMUse
      • CodeBank0
      • CodeBank1
      • CodeBank2
      • CodeBank3
      • CodeBank4
      • CodeBank5
      • CodeBank6
      • CodeBank7

      • Journal
    • Missile Command 1%
      • RAMUse
      • Code

      • Journal
    • Space Invaders 1%
      • RAMUse
      • Code

      • Journal
  • CoCo
    • Hardware
    • Early Work
    • Pyramid
      • RAMUse
      • Code

      • Journal
    • Raaka Tu
      • RAMUse
      • Code

      • Journal
    • Bedlam
      • RAMUse
      • Code

      • Journal
    • Madness & Minotaur
      • Walk Through
        • after_start.txt
        • after_start.cas
        • after_1.txt
        • after_1.cas
        • after_2.txt
        • after_2.cas
        • after_3.txt
        • after_3.cas
        • after_4.txt
        • after_4.cas
        • after_5.txt
        • after_5.cas
        • after_6.txt
        • after_6.cas
        • after_7.txt
        • after_7.cas
        • after_8.txt
        • after_8.cas
        • after_9.txt
        • after_9.cas
        • after_10.txt
        • after_10.cas
        • after_11.txt
        • after_11.cas
        • after_12.txt
        • after_12.cas
        • after_13.txt
        • after_13.cas
        • after_14.txt
        • after_14.cas
        • after_15.txt
        • after_15.cas
        • after_16.txt
        • after_16.cas
        • after_17.txt
        • after_17.cas
        • after_18.txt
        • after_18.cas
        • after_19.txt
        • after_19.cas
        • after_20.txt
        • after_20.cas
        • after_21.txt
        • after_21.cas
        • after_22.txt
        • after_22.cas
        • after_23.txt
        • after_23.cas
        • after_24.txt
        • after_24.cas
        • after_25.txt
        • after_25.cas
      • RAMUse
      • Code

      • SaveGameViewer

      • Journal
    • Mega-Bug
      • RAMUse
      • Code

      • Journal
    • Daggorath
      • RAMUse
      • Code

      • Level Maps

      • Journal
    • Downland 5%
      • RAMUse
      • Code

      • Journal
    • Audio Analyzer 5%
      • RAMUse
      • Code

      • Journal
    • Doubleback
      • RAMUse
      • Code

      • Journal
  • NES
    • Zelda 5%
      • Hardware
      • RAMUse
      • Bank0
      • Bank1
      • Bank2
      • Bank3
      • Bank4
      • Bank5
      • Bank6
      • Bank7

      • Journal
    • Kid Icarus 1%
      • Hardware
      • RAMUse
      • Bank0
      • Bank1
      • Bank2
      • Bank3
      • Bank4
      • Bank5
      • Bank6
      • Bank7

      • Journal
  • Gameboy
    • Hardware
    • Link's Awakening 1%
      • RAMUse
      • Bank00
      • Bank01
      • Bank02
      • Bank03
      • Bank04
      • Bank05
      • Bank06
      • Bank07
      • Bank08
      • Bank09
      • Bank0A
      • Bank0B
      • Bank0C
      • Bank0D
      • Bank0E
      • Bank0F
      • Bank10
      • Bank11
      • Bank12
      • Bank13
      • Bank14
      • Bank15
      • Bank16
      • Bank17
      • Bank18
      • Bank19
      • Bank1A
      • Bank1B
      • Bank1C
      • Bank1D
      • Bank1E
      • Bank1F

      • Journal
    • Tetris 1%
      • RAMUse
      • Code

      • Journal
  • TRS80
    • Hardware
    • HauntedHouse
      • RAMUse1
      • Code1
      • RAMUse2
      • Code2

      • Journal
    • Pyramid
      • RAMUse
      • Code

      • RAMUse1
      • Code1

      • Journal
    • RaakaTu
      • RAMUse
      • Code

      • Journal
    • Bedlam
      • RAMUse
      • Code

      • Journal
  • Virus
    • Morris Worm 1%
      • Journal
    • Stoned
      • Journal

  • Tools
    • Blend
      • blend.zip

      • Journal
  • Digital Vector Generator (DVG)
  • Vector Graphics
  • Memory Layout
  • Screen Geometry
  • Vector Specification
  • DVG Opcodes
    • VEC
    • CUR
    • HALT
    • JSR
    • RTS
    • JMP
    • SVEC

Digital Vector Generator (DVG)

There is a lot of info here:

http://www.philpem.me.uk/elec/vecgen.pdf

This info talks about the global scale factor allowing multiply and divide.

Follow the schematics here to figure it out:

http://www.jmargolin.com/vgens/aster.pdf

Vector Graphics

Modern computers use raster graphics. The monitor display is essentially a giant two dimensional matrix of dots (a dot matrix). The states of these dots must be configured a giant buffer in memory. The more dots you have on the screen and the more color values each dot can take the more memory you need.

Memory was expensive in the arcade era. Some games like Asteroids use a vector-display mechanism. The display hardware reads a list of lines from memory and actually steers the monitor's beam around to draw lines one after the other on the screen. These lines were super-crisp compared to the blocky lines drawn on low-resolution raster displays. The vector display doesn't need much memory -- just a list of lines.

But in the end all your program can draw is a bunch of lines.

Detailed information on the DVG from Asteroids: http://www.jmargolin.com/vgens/aster.pdf

  • Asteroids Vector ROM
  • Omega Race Vector ROM

Memory Layout

The DVG reads lines from an 8K bank of memory. The first 4K is RAM. The last 4K is ROM containing vector sequences for the game: asteroids, letters and numbers, ships, UFOs, etc. The "display list" is much more than a list of lines. It is actually an opcode language that includes the ability to jump to one of these ROM subroutines and then back to the next command.

The main program fills the display RAM with "Move to" commands and "subroutine" commands to draw all the game object lines on the screen. The last command in RAM is the "Halt" command that tells the display hardware it has reached the end of the list.

The DVG and main CPU share this 8K area of memory. The main CPU writes to it and the vector generator reads from it. The main CPU writes to this area as individual bytes. But the DVG itself reads the area as two-bytes words. The bytes are read little-endian -- least significant byte first.

For instance, the main CPU writes four bytes to the shared RAM as follows:

8000: BF 36 BF 06

The DVG would fetch these bytes as two words LSB first:

8000: 36BF 06BF

Screen Geometry

The DVG keeps up with a current (x,y) cursor coordinate. (0,0) is the lower left corner of the display. (1023,1023) is the upper right corner of the display.

Vectors are defined as a deltaX, deltaY, and intensity (0 through 15). The line intensity (brightness) increases with 0 being "off" and 15 being the brightest. Intensity 0 can be used to move the (x,y) cursor without drawing a line.

The deltas can be positive or negative to draw a line in any direction from the current cursor location.

In addition to the (x,y) cursor, the DVG keeps a scaling-factor that can be changed before calling a ROM routine. This allows the same asteroid image to be drawn in different sizes. The scaling-factor remains in effect until you change it.

The scaling-factor is a power-of-two divisor:

   0     /512
   1     /256
   2     /128
   3     /64
   4     /32
   5     /16
   6     /8
   7     /4
   8     /2
   9     /1

Imagine a sequence that draws a square like this:

MoveTo(0,0,9)   ; Bottom left corner of screen, global-scale of 9 (divide-by-one)
LineTo(1023,0)  ; To the right 1023
LineTo(0,1023)  ; Up 1023
LineTo(-1023,0) ; Left 1023
LineTo(0,-1023) ; Down 1023

If the scale was set to 9 then all the values get divided by 1 (unchanged). The square bounds the entire screen. But if the scale was set to 8 then the values get divided by 2 and the square wraps the lower left quadrant of the screen. A scale-factor of 0 divides everything by 512 -- turning those 1023's into 2's. That would draw a tiny box in the bottom left corner of the screen.

Vector Specification

A vector has a deltaX, deltaY, and an intensity. It also has its own "local" scale factor. This "local" scale-factor is added to the global scale-factor to make a "total" scale-factor used in rendering the vector.

Take these two lines for instance. Assume the global scale-factor is 0:

         dx   dy  int  scale
LineTo (800,   0,  15,  5)
LineTo (1600,  0,  15,  4)

The first line is drawn 50 units to the right since the total scale factor is 0+5 = 5 (divide-by-16). 800/16=50.

The second line has a total factor of 0+4 = 4 (divide by 32). It is also drawn 50 units to the right. 1600/32=50.

If the global scale-factor were set to 4 then the first line would be drawn with a factor of 5+4=9 (divide-by-one). The line would be 800 units long.

The second line would be drawn with a factor of 4+4=8 (divide-by-two). The line would be 800 units long.

Thus the added global scale-factor of 4 has made the sequence of lines 16 times larger.

DVG Opcodes

Most DVG commands are one word (two bytes) long. Some are two words (four bytes).

The upper nibble of the first word is the command.

0 - 9 : VEC  -- a full vector command
    A : CUR  -- set the current (x,y) and global scale-factor
    B : HALT -- end of commands
    C : JSR  -- jump to a vector program subroutine
    D : RTS  -- return from a vector program subroutine
    E : JMP  -- jump to a location in the vector program
    F : SVEC -- a short vector command

VEC

Draw a line from the current (x,y) coordinate.

Example:    
             ;  SSSS -mYY YYYY YYYY | BBBB -mXX XXXX XXXX
87FE 73FE    ;  1000 0111 1111 1110 | 0111 0011 1111 1110
             ; - SSSS is the local scale 0 .. 9 added to the global scale
             ; - BBBB is the brightness: 0 .. 15
             ; - m is 1 for negative or 0 for positive for the X and Y deltas
             ; - (x,y) is the coordinate delta for the vector
   
VEC  scale=08(/2)    bri=07  x=1022    y=-1022  (511.00, -511.00)
  

CUR

Set the current (x,y) and global scale-factor.

Example:
             ; 1010 00yy yyyy yyyy | SSSS 00xx xxxx xxxx
A37F 03FF    ; 1010 0011 0111 1111 | 0000 0011 1111 1111
             ; - SSSS is the global scale 0 .. 15
             ; - (x,y) is the new (x,y) coordinate. This is NOT adjusted by SSSS.
   
CUR  scale=00(/512)  y=895  x=1023

HALT

End the current drawing list.

B000         ; 1011 0000 0000 0000

HALT

JSR

Jump to a vector subroutine. Note that there is room in the internal "stack" for only FOUR levels of nested subroutine calls. Be careful.

Note that the target address is the WORD address -- not the byte address.

Example:             
             ; 1100 aaaa aaaa aaaa
CAE4         ; 1100 1010 1110 0100
             ; - a is the word address of the destination
  
In this case:
  a = 0AE4
  Conversion to byte address: (0AE4-0800)*2 + 0800 = 0DC8
  
JSR  $0DC8

RTS

Return from current vector subroutine.

D000         ; 1101 0000 0000 0000

RTS

JMP

Jump to a new location in the vector program.

Note that the target address is the WORD address -- not the byte address.

Example:
             ; 1110 aaaa aaaa aaaa
EA0A         ; 1110 1010 0000 1010
             ; - a is the word address of the destination

In this case:
  a = 0A0A
  Conversion to byte address: (0A0A-0800)*2 + 0800 = 0C14
  
JMP  $0C14

SVEC

Use a "short" notation to draw a vector. This does not mean the vector itself is necessarily short. It means that the notation is shorter (fewer bits of resolution).

Example:
        ; 1111 smYY BBBB SmXX
FF70    ; 1111 1111 0111 0000
        ; - Ss (0=*2, 1=*4, 2=*8, 3=*16)
        ; - BBBB is the brightness: 0 .. 15
        ; - m is 1 for negative and 0 for positive for the X and Y
        ; - (x,y) is the coordinate change for the vector   
   
SVEC scale=01(*2)  bri=07  x=0       y=-3     (0.00, -6.00)