Vector programming

From: Josh McCormick <jmccorm_at_galstar.com>
Date: Tue Sep 28 1999 - 11:22:49 EDT

Howdy. Being new to this list, forgive this message if it comes out
looking like a troll. :)

You may have come across my announcement of the Tempest Code Project,
which has the goal of commenting the assembler code to Tempest to such a
degree that the Tempest hardware and software are easily understood. (And
there are a few side goodies along the way, like vector game coding
techniques.) The follow-up project being to create a documented code base
that could be used as a starting place for new vector games for the same
hardware.

The project is in the early stages, but a significant amount of progress
has been made. With the combined use of the source code, MAME, and the
Tempest: Theory of Operation document, a good number of software traps
have been identified. When enough traps have been identified, it'll be a
matter of doing searches and determining the logic.

I've already dug into some of the logic which handles the Superzapper
button. Location 03AAh stores the number of times the zapper has been
used. Location 0125h stores how long the zapping session has been running
for. Here's a sample of the logic:

(Warning: I'm building back up my 6502 assembler skillset.)

003E AD:25 01 LDA:abs $0125 # If superzapper in use,
0041 D0:23 BNE:rel Branch->$0066 # branch to $0066.

0043 AD:01 02 LDA:abs $0201 # If dead (tunnel position
0046 30:1B BMI:rel Branch->$0063 # < 79h) then branch to $0063

0048 A5:4E LDA:zp Zp RAM 004E # If they have not pressed
004A 29:08 AND:imm #08 # the superzapper button,
004C F0:15 BEQ:rel Branch->$0063 # goto $0063.

004E AD:AA 03 LDA:abs $03AA # If the zapper has already
0051 C9:02 CMP:imm #02 # been used twice, then
0053 B0:08 BCS:rel Branch->$005D # branch to $005D.

0055 EE:AA 03 INC:abs $03AA # Increase zapper use count.
0058 A9:01 LDA:imm #01 # Start the zapper
005A 8D:25 01 STA:abs $0125 # run-length timer.

005D A5:4E LDA:zp Zp RAM 004E # Clear the zapper from
005F 29:77 AND:imm #77 # the buttons-to-process
0061 85:4E STA:zp Zp RAM 004E # list.

0063 B8: CLV:imp Clear Overflow # No zap to handle.
0064 50:16 BVC:rel Branch->$007C # Goto ADDR 7C.

0066 EE:25 01 INC:abs $0125 # Increase zapper run-time

0069 AE:AA 03 LDX:abs $03AA # Look up the zap run-length
006C AD:25 01 LDA:abs $0125 # table see if it is time to
006F DD:83 A8 CMP:abs,x $A883,X # end the zap in progress.

0072 90:05 BCC:rel Branch->$0079 # If not, goto ADDR 79.

0074 A9:00 LDA:imm #00 # End the current zapper
0076 8D:25 01 STA:abs $0125 # session.

Delicious code, isn't it? Critiques of this analysis is welcome (from a
documentation standpoint or a logic standpoint). Anyhow, this is an
example of what I'm wanting to do throughout the code.

If you want to visit the web page, it is location at:
http://arcade.gameshop.com/tempest.htm

I hope to have some CGI scripts up soon that will allow for
open-contribution of trap locations, routine locations, and code
documentation. (Making the CGI scripts is far more of a bitch than
evaluating this code.)

I'm also looking for anything that gives some insight into the programming
aspects of the Tempest hardware. That, and constructive
comments/criticisms, ideas, whatever you can dish out if you're
interested.

Thanks all,
JCM
Received on Tue Sep 28 11:17:54 1999

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2003 - 00:33:02 EDT