I was looking for a battlezone disassembly and didn't find one, but did find this interesting thread:

https://forums.arcade-museum.com/archive/index.php/t-88714.html

which pointed me to the avg docs:

http://www.ionpool.net/arcade/atari_docs/avg.pdf
http://arcarc.xmission.com/Tech/neilw_xy.txt

The avg is pretty interesting.

Let's see if we can draw some vectors from the data in rom:

I was having trouble getting the moon to draw properly until I figured out that short vector numbers represent "one-half" of the actual value (in other words, multiply by 2). If you can read "half" below your eyes (or monitor) is better than mine.

[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]

the moon

[Linked Image from i.imgur.com]



Code

-- pause the emulator with p or emu.pause() or you won't see anything on screen
-- unpause with p or emu.unpause() to remove the drawing

function printt(a) for i,j in pairs(a) do print ("ITEM "..i,hex(j)) end end
function maskbits(a,b) local r = 0,i for i=a,b do r=r|(2^i) end return r end
function getbits(n,a,b) return (n & maskbits(a,b))>>a end
function hex(a) return string.format("%x",a) end
function iif(a,b,c) if a then return b else return c end end

mem=manager:machine().devices[":maincpu"].spaces["program"]

function cmdprocess(i) 
print("ADDRESS="..hex(i))
cmd=mem:read_u16(i) i=i+2 cmdbits=getbits(cmd,13,15) 
if (cmdbits<<1) == 0x4 then
xbits=getbits(cmd,0,4) if getbits(xbits,4,4)==1 then xbits=xbits-32 end  
ibits=getbits(cmd,5,7) 
ybits=getbits(cmd,8,12) if getbits(ybits,4,4)==1 then ybits=ybits-32 end 
print(hex(cmd),hex(cmdbits<<1),xbits,ybits,ibits) 
elseif (cmdbits<<1) == 0x0 then 
   io.write("MEMORY"..hex(i-2)..":")for k=i-2,i-2+3 do io.write(hex(mem:read_u8(k)).." ") end print()
   cmd=(cmd<<16) | mem:read_u16(i) i=i+2
  xbits=getbits(cmd,0,12) 
  if getbits(xbits,12,12)==1 then xbits=xbits-2^13 end   
  ibits=getbits(cmd,13,15) 
  ybits=getbits(cmd,16,16+8+5-1) 
  if getbits(ybits,12,12)==1 then ybits=ybits-2^13 end 
  print(hex(cmd),hex(cmdbits<<1).." x="..xbits.." y="..ybits.."  i="..ibits) 
elseif ((cmdbits<<1) == 0xe or ((cmdbits<<1) == 0xa)) then 
  jumpbits=getbits(cmd,0,12) print(hex(cmd),hex(cmdbits<<1).."  JUMP="..hex(jumpbits)) 
  jumpaddress=jumpbits*2+0x2000
  --beforejump = i i=jumpbits*2+0x2000
  if (cmdbits<<1)==0xa then print("ADD TO STACK"..hex(i)) table.insert(callstack,i) end
  beforejump=i
  i=jumpaddress
  print("JUMP ADDRESS="..hex(jumpaddress))
elseif ((cmdbits<<1) == 0xc) then
   print("RETURN FROM SUBROUTINE",hex(cmd),hex(cmdbits<<1))
   printt(callstack)
   if #callstack==0 then print("RETURN STACK EMPTY") 
   else i=table.remove(callstack) print ("RETURN STACK ADDRESS="..hex(i)) cmd=cmd<<8 end
elseif ((cmdbits<<1) == 0x70) then print("NEW SCALE ***************") 
else
  print(hex(cmd),hex(cmdbits<<1))
end
return i
end


-- draw the alphabet

xo=0 yo=100 xs=0.3 ys=xs stuckmax=1500 stuckcount=0 i=0x3282 callstack={} for count=1,40 do x=xo y=yo print(manager:machine().screens[":screen"]:draw_text(x,y-20,hex(i))) print ("COUNT="..count) x=xo y=yo cmd=0 beforejump=0 while  not(cmd == 0xc000 and #callstack == 0) and stuckcount < stuckmax do stuckcount=stuckcount + 1 i=cmdprocess(i)   if ((cmdbits<<1) == 0x4) or ((cmdbits<<1) == 0) then x1=x+xbits*iif((cmdbits<<1)==0,1,2)*xs y1=y-ybits*iif((cmdbits<<1)==0,1,2)*ys print(manager:machine().screens[":screen"]:draw_line(x,y,x1,y1,0xff000000 | (math.floor((ibits/11)*0xff)<<8))) x=x1 y=y1 end end  if beforejump ~= 0 then i=beforejump end xo=xo+60 if xo > 440 then xo=0 yo=yo+60 end end


-- draw the moon

xo=100 xs=2.0 ys=xs stuckmax=500 stuckcount=0 i=0x3058 callstack={} for count=1,1 do x=xo y=yo print(manager:machine().screens[":screen"]:draw_text(x,y-20,hex(i))) print ("COUNT="..count) x=xo y=yo cmd=0 beforejump=0 while  not(cmd == 0xc000 and #callstack == 0) and stuckcount < stuckmax do stuckcount=stuckcount + 1 i=cmdprocess(i)  if ((cmdbits<<1) == 0x4) or ((cmdbits<<1) == 0) then x1=x+xbits*iif((cmdbits<<1)==0,1,2)*xs y1=y-ybits*iif((cmdbits<<1)==0,1,2)*ys print(manager:machine().screens[":screen"]:draw_line(x,y,x1,y1,0xff000000 | (math.floor((ibits/11)*0xff)<<8))) x=x1 y=y1 end end  if beforejump ~= 0 then i=beforejump end xo=xo+20 if xo > 400 then xo=0 yo=yo+20 end end