]> github.com/historicalsource and other repositories - cruisin-usa.git/commitdiff
Let's go cruisin' main
authorteamarchive2.fnf.archive.org root <root@teamarchive2.fnf.archive.org>
Tue, 6 Apr 2021 21:18:34 +0000 (21:18 +0000)
committerteamarchive2.fnf.archive.org root <root@teamarchive2.fnf.archive.org>
Tue, 6 Apr 2021 21:18:34 +0000 (21:18 +0000)
166 files changed:
ATTRACTA.ASM [new file with mode: 0755]
ATTRDRNE.ASM [new file with mode: 0755]
AUDITS.ASM [new file with mode: 0755]
BACKGRND.ASM [new file with mode: 0755]
BIG2.GEO [new file with mode: 0755]
BIG2.PTG [new file with mode: 0755]
BIG2.TGA [new file with mode: 0755]
BONUS.ASM [new file with mode: 0755]
BSSSTART.ASM [new file with mode: 0755]
C30.EQU [new file with mode: 0755]
CHECKSUM.EQU [new file with mode: 0755]
CHOPPER.ASM [new file with mode: 0755]
CKSUM.ASM [new file with mode: 0755]
CKSUM.EQU [new file with mode: 0755]
CMOS.ASM [new file with mode: 0755]
CMOS.EQU [new file with mode: 0755]
COIN.ASM [new file with mode: 0755]
COINTAB.ASM [new file with mode: 0755]
COLLA.ASM [new file with mode: 0755]
COMM.ASM [new file with mode: 0755]
COMM.EQU [new file with mode: 0755]
COMMDRNE.ASM [new file with mode: 0755]
COMMQ.ASM [new file with mode: 0755]
COMP.ASM [new file with mode: 0755]
CORN.POL [new file with mode: 0755]
CORN/CORN.POL [new file with mode: 0755]
CORN/DO.BAT [new file with mode: 0755]
CORN/OBJECTS.ASM [new file with mode: 0755]
CORN/OBJECTS.EQU [new file with mode: 0755]
CORN/OBJECTS.MAP [new file with mode: 0755]
CORN/PCOMP.XRF [new file with mode: 0755]
CORN/T [new file with mode: 0755]
CORNOBJ.ASM [new file with mode: 0755]
CORNOBJ.EQU [new file with mode: 0755]
CORNPOPS.GEO [new file with mode: 0755]
CORNPOPS.PTG [new file with mode: 0755]
CORNPOPS.TGA [new file with mode: 0755]
CUSA.ASM [new file with mode: 0755]
CUSA.CMD [new file with mode: 0755]
DATE.ASM [new file with mode: 0755]
DELTA.ASM [new file with mode: 0755]
DELTA.EQU [new file with mode: 0755]
DIAG.ASM [new file with mode: 0755]
DIAG.EQU [new file with mode: 0755]
DIRQ.ASM [new file with mode: 0755]
DIRQ.EQU [new file with mode: 0755]
DO.BAT [new file with mode: 0755]
DRONES.ASM [new file with mode: 0755]
EFFECTS.ASM [new file with mode: 0755]
ERROR.ASM [new file with mode: 0755]
ERROR.EQU [new file with mode: 0755]
FLAME.ASM [new file with mode: 0755]
FONT.ASM [new file with mode: 0755]
FONT1A.ASM [new file with mode: 0755]
GALIL.ASM [new file with mode: 0755]
GLOBALS.EQU [new file with mode: 0755]
H2H.POL [new file with mode: 0755]
H2HOBJ.ASM [new file with mode: 0755]
H2HOBJ.EQU [new file with mode: 0755]
HD2HD.GRP [new file with mode: 0755]
HEADS.ASM [new file with mode: 0755]
HOTTUB.ASM [new file with mode: 0755]
HPMATH.ASM [new file with mode: 0755]
HPMATH.C [new file with mode: 0755]
HSTDP.ASM [new file with mode: 0755]
HUD.ASM [new file with mode: 0755]
INFIN.ASM [new file with mode: 0755]
INTRO.ASM [new file with mode: 0755]
INVTAB30.ASM [new file with mode: 0755]
LEG.ASM [new file with mode: 0755]
LINE.ASM [new file with mode: 0755]
LINE.C [new file with mode: 0755]
M/CORN.RPD [new file with mode: 0755]
M/H2H.RPD [new file with mode: 0755]
M/HED2HED/BIG2.GEO [new file with mode: 0755]
M/HED2HED/BIG2.PTG [new file with mode: 0755]
M/HED2HED/BIG2.TGA [new file with mode: 0755]
M/HED2HED/CORNPOPS.GEO [new file with mode: 0755]
M/HED2HED/CORNPOPS.PTG [new file with mode: 0755]
M/HED2HED/CORNPOPS.TGA [new file with mode: 0755]
M/HED2HED/HD2HD.GRP [new file with mode: 0755]
M/HED2HED/P1 [new file with mode: 0755]
M/HED2HED/P1.GEO [new file with mode: 0755]
M/HED2HED/P1.PAL [new file with mode: 0755]
M/HED2HED/P1.PTG [new file with mode: 0755]
M/HED2HED/P1.TGA [new file with mode: 0755]
M/HED2HED/P1A.GEO [new file with mode: 0755]
M/HED2HED/P1A.PTG [new file with mode: 0755]
M/HED2HED/P1TMP.PAL [new file with mode: 0755]
M/HED2HED/P1TMP.TGA [new file with mode: 0755]
M/HED2HED/P2.GEO [new file with mode: 0755]
M/HED2HED/P2.PTG [new file with mode: 0755]
M/HED2HED/P2B.GEO [new file with mode: 0755]
M/HED2HED/P2B.PTG [new file with mode: 0755]
M/HED2HED/REDHD1.GEO [new file with mode: 0755]
M/HED2HED/REDHD1.PTG [new file with mode: 0755]
M/HED2HED/REDHD1.TGA [new file with mode: 0755]
M/HED2HED/YELHD1.GEO [new file with mode: 0755]
M/HED2HED/YELHD1.PTG [new file with mode: 0755]
MACS.EQU [new file with mode: 0755]
MAKEFILE [new file with mode: 0755]
MAP.ASM [new file with mode: 0755]
MATH.ASM [new file with mode: 0755]
MEMTEST.ASM [new file with mode: 0755]
MOTION.ASM [new file with mode: 0755]
MPROC.ASM [new file with mode: 0755]
MPROC.EQU [new file with mode: 0755]
OBJ.ASM [new file with mode: 0755]
OBJ.EQU [new file with mode: 0755]
OBJECTS.ASM [new file with mode: 0755]
OBJECTS.EQU [new file with mode: 0755]
OBJECTS.MAP [new file with mode: 0755]
OVERLAY.ASM [new file with mode: 0755]
P1 [new file with mode: 0755]
P1.GEO [new file with mode: 0755]
P1.PAL [new file with mode: 0755]
P1.PTG [new file with mode: 0755]
P1.TGA [new file with mode: 0755]
P1A.GEO [new file with mode: 0755]
P1A.PTG [new file with mode: 0755]
P1TMP.PAL [new file with mode: 0755]
P1TMP.TGA [new file with mode: 0755]
P2.GEO [new file with mode: 0755]
P2.PTG [new file with mode: 0755]
P2B.GEO [new file with mode: 0755]
P2B.PTG [new file with mode: 0755]
PALL.ASM [new file with mode: 0755]
PALL.EQU [new file with mode: 0755]
PCOMP.XRF [new file with mode: 0755]
PLYR.ASM [new file with mode: 0755]
RACER.ASM [new file with mode: 0755]
RACER.EQU [new file with mode: 0755]
REDHD1.GEO [new file with mode: 0755]
REDHD1.PTG [new file with mode: 0755]
REDHD1.TGA [new file with mode: 0755]
RHO.ASM [new file with mode: 0755]
ROADBLCK.ASM [new file with mode: 0755]
ROADKILL.ASM [new file with mode: 0755]
ROUTS.ASM [new file with mode: 0755]
RROAD.ASM [new file with mode: 0755]
SETUPS.ASM [new file with mode: 0755]
SIGMA.ASM [new file with mode: 0755]
SMOKE.ASM [new file with mode: 0755]
SND.ASM [new file with mode: 0755]
SNDTAB.EQU [new file with mode: 0755]
SNDTAB.INC [new file with mode: 0755]
SNDTABA.ASM [new file with mode: 0755]
STABLE.INC [new file with mode: 0755]
SYS.EQU [new file with mode: 0755]
SYSID.EQU [new file with mode: 0755]
T [new file with mode: 0755]
T.C [new file with mode: 0755]
TEXT.ASM [new file with mode: 0755]
TEXT.EQU [new file with mode: 0755]
TEXTTAB.ASM [new file with mode: 0755]
TEXTTAB.EQU [new file with mode: 0755]
TOTALA.ASM [new file with mode: 0755]
TRACKSEL.ASM [new file with mode: 0755]
TRANS.ASM [new file with mode: 0755]
UTIL.ASM [new file with mode: 0755]
VANTAB.INC [new file with mode: 0755]
VUNIT.EQU [new file with mode: 0755]
WAVE.ASM [new file with mode: 0755]
WHEEL.ASM [new file with mode: 0755]
YELHD1.GEO [new file with mode: 0755]
YELHD1.PTG [new file with mode: 0755]

diff --git a/ATTRACTA.ASM b/ATTRACTA.ASM
new file mode 100755 (executable)
index 0000000..112bcd2
--- /dev/null
@@ -0,0 +1,397 @@
+       .FILE   "ATTRACTA.ASM"\r
+*----------------------------------------------------------------------------\r
+*ATTRACT MODE\r
+*\r
+*COPYRIGHT (C) 1994  BY TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+*\r
+\r
+       .include        MPROC.EQU\r
+       .include        MACS.EQU\r
+       .include        OBJ.EQU\r
+       .include        OBJECTS.EQU\r
+       .include        GLOBALS.EQU\r
+       .include        SYS.EQU\r
+       .include        TEXT.EQU\r
+       .include        VUNIT.EQU\r
+       .include        CMOS.EQU\r
+       .include        SNDTAB.EQU\r
+\r
+\r
+\r
+       .text\r
+NOVANITY       .set    1\r
+\r
+*----------------------------------------------------------------------------\r
+startthey      .set    4.18894205      ;-deg(10)\r
+startthez      .set    0.087266462     ; deg(5)\r
+CREATED_DCS    .set    PDATA+1\r
+DECOMP_COUNT   .set    PDATA+1\r
+\r
+*----------------------------------------------------------------------------\r
+*AR6 is set by the creator of this routine. 0= play dcs logo sound 1=don't play\r
+*\r
+_MIDWAYSPIN:\r
+       LDI     0,AR6\r
+       LDI     @_ATTR_MODE,R0\r
+       CMPI    -2,R0\r
+       BNE     NO_NINTENDO\r
+       LDI     @ATTRWAVE,R0\r
+       BNE     NO_NINTENDO\r
+       READADJ ADJ_ATTRACT_MODE_SOUND\r
+       CMPI    0,R0\r
+       BEQ     NO_NINTENDO\r
+\r
+       READADJ ADJ_VOLUME              ;make sure volume correct\r
+       LDI     R0,R1\r
+       CALL    SET_MASTER_VOL\r
+\r
+\r
+       ;if COMM on and SLAVE then NO NINTENDO\r
+       ;\r
+       LDI     @DIPRAM,R0\r
+       TSTB    DIP_COMMP,R0\r
+       BNZ     DOMUS\r
+       TSTB    CMDP_MASTER,R0\r
+       BNZ     NO_NINTENDO\r
+DOMUS\r
+\r
+       LDI     890,AR6                 ;Length of sound\r
+       SOND1   NINTENDO_SND\r
+\r
+NO_NINTENDO\r
+       CALL    ULTRA_LOGO\r
+\r
+       LDI     0,R0\r
+       STI     R0,*+AR7(DECOMP_COUNT)\r
+;      STI     R0,*+AR7(CREATED_DCS)\r
+       LDI     0,R0\r
+       STI     R0,@BGNDCOLA\r
+\r
+       LDP     @_CAMERAPOS+Y\r
+       FLOAT   -2780,R0\r
+       STF     R0,@_CAMERAPOS+Y\r
+       SETDP\r
+\r
+       LDL     midway,AR2\r
+       CALL    OBJ_GETE\r
+       .if     DEBUG\r
+       BC      $\r
+       .endif\r
+       LDI     AR0,AR4\r
+\r
+       CLRF    R0\r
+       STF     R0,*+AR4(OPOSX)\r
+;      FLOAT   -480,R0\r
+       FLOAT   -910,R0\r
+       STF     R0,*+AR4(OPOSY)\r
+       FLOAT   5500,R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+\r
+       LDI     *+AR4(OFLAGS),R0\r
+       OR      O_ILLUM|O_NOUNIV|O_NOUROT,R0\r
+       LDI     1,R1\r
+       LS      16,R1\r
+       OR      R1,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+\r
+       CLRF    R0\r
+       STF     R0,*+AR4(ORADX)\r
+       LDF     startthey,R2\r
+       ADDF    HALFPI,R2\r
+       STF     R2,*+AR4(ORADY)\r
+       LDF     startthez,R2\r
+       STF     R2,*+AR4(ORADZ)\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       LDI     AR4,R2\r
+       ADDI    ORADX,R2\r
+       CALL    FIND_MATRIX\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERTP\r
+\r
+\r
+       LDF     *+AR4(ORADY),R0\r
+       STF     R0,*+AR4(OUSR1)\r
+\r
+\r
+;      LDI     470,AR5\r
+MSLP1\r
+       LDF     0.0174539,R0\r
+       FLOAT   @NFRAMES,R1\r
+       MPYF    R1,R0\r
+       ADDF    *+AR4(OUSR1),R0         ;ORADY\r
+       STF     R0,*+AR4(OUSR1)\r
+       LDP     @_CAMERARAD+Y\r
+       SUBF    @_CAMERARAD+Y,R0\r
+       SETDP\r
+       STF     R0,*+AR4(ORADY)\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       LDI     AR4,R2\r
+       ADDI    ORADX,R2\r
+       CALL    FIND_MATRIX\r
+\r
+MSLP2\r
+       SLEEP   1\r
+       CALL    MSLP_CHECK\r
+       BR      MSLP1\r
+\r
+MSLP_CHECK\r
+       SUBI    @NFRAMES,AR6\r
+\r
+       LDI     @DECOMP_ACTIVE,R0\r
+       CMPI    0,R0\r
+       BNE     MSLP3\r
+       LDI     *+AR7(DECOMP_COUNT),R0\r
+       ADDI    1,R0\r
+       STI     R0,*+AR7(DECOMP_COUNT)\r
+       CMPI    3,R0\r
+       BGT     MSLP4                           ;Done Loading\r
+MSLP3\r
+       RETS\r
+;      BR      MSLP1\r
+MSLP4\r
+       CMPI    0,AR6\r
+       RETSGT\r
+;      BGT     MSLP1   \r
+MSLPX\r
+\r
+       LDI     0,R0\r
+       STI     R0,@LOADED\r
+\r
+       POP     BK              ;POP return address\r
+       BR      CYCLE_ATTR\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+MIDWAYSPINENTER:\r
+\r
+       LDL     midway,AR2\r
+       CALL    OBJ_GETE\r
+       .if     DEBUG\r
+       BC      $\r
+       .endif\r
+       LDI     AR0,AR4\r
+\r
+       CLRF    R0\r
+       STF     R0,*+AR4(OPOSX)\r
+       FLOAT   -480,R0\r
+       STF     R0,*+AR4(OPOSY)\r
+       FLOAT   5500,R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+\r
+       LDI     *+AR4(OFLAGS),R0\r
+       OR      O_ILLUM|O_NOUNIV|O_NOUROT,R0\r
+       LDI     1,R1\r
+       LS      16,R1\r
+       OR      R1,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+\r
+       CLRF    R0\r
+       STF     R0,*+AR4(ORADX)\r
+       LDF     startthey,R2\r
+       ADDF    PI,R2\r
+       STF     R2,*+AR4(ORADY)\r
+       LDF     startthez,R2\r
+       STF     R2,*+AR4(ORADZ)\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       LDI     AR4,R2\r
+       ADDI    ORADX,R2\r
+       CALL    FIND_MATRIX\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERTP\r
+\r
+\r
+       LDF     *+AR4(ORADY),R0\r
+       STF     R0,*+AR4(OUSR1)\r
+\r
+\r
+       LDI     690,AR5\r
+MSLP1a\r
+       LDF     *+AR4(OUSR1),R0         ;ORADY\r
+       ADDF    0.0174539,R0\r
+       STF     R0,*+AR4(OUSR1)\r
+       LDP     @_CAMERARAD+Y\r
+       SUBF    @_CAMERARAD+Y,R0\r
+       SETDP\r
+       STF     R0,*+AR4(ORADY)\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       LDI     AR4,R2\r
+       ADDI    ORADX,R2\r
+       CALL    FIND_MATRIX\r
+\r
+       SLEEP   1\r
+       DBU     AR5,MSLP1a\r
+\r
+       CALL    TEXT_INIT\r
+       BR      CYCLE_ATTR\r
+*----------------------------------------------------------------------------\r
+       .globl  SPIN_CAR\r
+SPIN_CARTABI   .word   SPIN_CARTAB\r
+       romdata\r
+SPIN_CARTAB    .word   missle,hotrod,testor,cvette\r
+       .text\r
+\r
+SPIN_CAR:\r
+       LDI     0,R0\r
+       STI     R0,*+AR7(DECOMP_COUNT)\r
+\r
+       LDIL    logo,AR2\r
+       CALL    OBJ_GETE\r
+       LDI     O_IROT|O_NOROT|O_NOUROT|O_NOUNIV,R0\r
+       OR      *+AR0(OFLAGS),R0\r
+       STI     R0,*+AR0(OFLAGS)\r
+       FLOAT   -150,R0\r
+       STF     R0,*+AR0(OPOSX)\r
+       FLOAT   -110,R0\r
+       STF     R0,*+AR0(OPOSY)\r
+       FLOAT   436,R0\r
+       STF     R0,*+AR0(OPOSZ)\r
+       LDI     AR0,AR2\r
+       CALL    OBJ_INSERT\r
+\r
+       CALL    LOGO_SMALL\r
+\r
+       LDI     @ATTRWAVE,AR2\r
+       LSH     -1,AR2\r
+       SUBI    1,AR2\r
+       AND     3,AR2\r
+       ADDI    @SPIN_CARTABI,AR2\r
+       LDI     *AR2,AR2\r
+       CALL    OBJ_GETE\r
+       LDI     O_IROT|O_NOROT|O_NOUROT|O_NOUNIV,R0\r
+       OR      *+AR0(OFLAGS),R0\r
+       STI     R0,*+AR0(OFLAGS)\r
+\r
+       FLOAT   1368,R0\r
+       STF     R0,*+AR0(OPOSZ)\r
+       LDI     AR0,AR4\r
+\r
+       LDF     -0.196,R2\r
+       STF     R2,*+AR4(ORADX)\r
+\r
+       LDF     3.534,R2\r
+       STF     R2,*+AR4(ORADY)\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       LDI     AR4,R2\r
+       ADDI    ORADX,R2\r
+       CALL    FIND_MATRIX\r
+\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERTP\r
+\r
+       LDI     16,AR6\r
+SPIN_CAR_WAIT\r
+       SLEEP   1\r
+       SUBI    1,AR6\r
+       CMPI    0,AR6\r
+       BGT     SPIN_CAR_WAIT\r
+\r
+       LDI     550,AR6\r
+SPIN_CARLP\r
+       LDF     *+AR4(ORADY),R2\r
+       FLOAT   @NFRAMES,R0\r
+       MPYF    0.018,R0\r
+       ADDF    R0,R2\r
+       STF     R2,*+AR4(ORADY)\r
+\r
+       LDI     AR4,R2\r
+       ADDI    ORADX,R2\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    FIND_MATRIX\r
+\r
+       SLEEP   1\r
+       CALL    MSLP_CHECK\r
+       BU      SPIN_CARLP\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+TEXTTOGET:\r
+       SLEEP   75\r
+\r
+       LDI     @TEXT_ACTIVEI,AR0\r
+       CLRF    R1\r
+TXTLP  LDI     *AR0,R0\r
+       BZ      NXTWT\r
+       LDI     R0,AR0\r
+\r
+       STF     R1,*+AR0(TEXT_VELX)\r
+       BR      TXTLP\r
+NXTWT\r
+       SLEEP   460\r
+\r
+       LDI     @TEXT_ACTIVEI,AR0\r
+       LDF     -6,R1\r
+TXTLPA LDI     *AR0,R0\r
+       BNZ     TXTLPB\r
+       BR      SUICIDE\r
+TXTLPB\r
+       LDI     R0,AR0\r
+\r
+       STF     R1,*+AR0(TEXT_VELY)\r
+       BR      TXTLPA\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       .data\r
+DEMOTHANKS_LISTI       .word   DEMOTHANKS_LIST\r
+       .SECT "THEDATA"\r
+\r
+DT1    .string "THANK YOU FOR PLAYING",0\r
+DT2    .string "CRUISIN USA",0\r
+DT3    .string "SNEAK PREVIEW",0\r
+\r
+DEMOTHANKS_LIST\r
+       .word   140,DT1\r
+       .word   180,DT2\r
+       .word   220,DT3\r
+\r
+       .text\r
+\r
+DEMOTHANKS:\r
+       LDI     1,R0\r
+       STI     R0,@COINOFF\r
+\r
+       CLRI    R0\r
+       STI     R0,@BGNDCOLA    ;COLORAM\r
+\r
+       LDI     2,AR5\r
+       LDI     @DEMOTHANKS_LISTI,AR4\r
+DTLP\r
+       FLOAT   256,R2\r
+       FLOAT   *AR4++,R3\r
+       LDI     *AR4++,AR2\r
+       LDI     9999,RC\r
+       CALL    TEXT_ADDDS\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       ORM     TXT_CENTER,*+AR1(TEXT_COLOR)\r
+\r
+       DBU     AR5,DTLP\r
+\r
+       LDI     -6,R0\r
+       STI     R0,@_ATTR_MODE\r
+\r
+       BR      MIDWAYSPINENTER\r
+*----------------------------------------------------------------------------\r
+       .END\r
diff --git a/ATTRDRNE.ASM b/ATTRDRNE.ASM
new file mode 100755 (executable)
index 0000000..eddef39
--- /dev/null
@@ -0,0 +1,1815 @@
+       .FILE   "ATTRDRNE.ASM"\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*COPYRIGHT (C) 1994 BY  TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+\r
+       .include        C30.EQU\r
+       .include        MACS.EQU\r
+       .include        MPROC.EQU\r
+       .include        VUNIT.EQU\r
+       .include        CMOS.EQU\r
+       .include        SYSID.EQU\r
+       .include        SYS.EQU\r
+       .include        OBJ.EQU\r
+       .include        GLOBALS.EQU\r
+       .include        SNDTAB.EQU\r
+       .include        PALL.EQU\r
+       .include        OBJECTS.EQU\r
+       .include        TEXT.EQU\r
+       .include        DIRQ.EQU\r
+       .include        DELTA.EQU\r
+\r
+\r
+               .data\r
+\r
+_CAMERAPOSI            .word   _CAMERAPOS\r
+VIEWLISTI              .word   VIEWLIST\r
+ATTR_WAVETABI          .word   ATTR_WAVETAB\r
+\r
+               pbss    ATTRWAVE,1\r
+               .global CAMVIEW\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+* CAMERA variable space\r
+*\r
+\r
+CUT_PAN                        .set    PDATA+1\r
+ZOOMVEL                        .set    PDATA+2\r
+CAMERA_XYZR            .set    PDATA+3         ;4 long\r
+NEWCAMERA_XYZR         .set    PDATA+7         ;4 long\r
+NEW_POSX               .set    PDATA+11\r
+NEW_POSY               .set    PDATA+12\r
+NEW_POSZ               .set    PDATA+13\r
+NEW_RADX               .set    PDATA+14\r
+NEW_RADY               .set    PDATA+15\r
+NEW_RADZ               .set    PDATA+16\r
+NEW_MATRIX             .set    PDATA+17        ;9 long\r
+CAMERA_VIEW            .set    PDATA+26\r
+CAMERA_VEL             .set    PDATA+27\r
+CAROBJ                 .set    PDATA+28\r
+CARDIS                 .set    PDATA+29\r
+CAMERA_ACCEL           .set    PDATA+30\r
+CAMERA_INFIN           .set    PDATA+31\r
+TEMP_DATA              .set    PDATA+32        ;10 long\r
+LIST_NUM               .set    PDATA+42\r
+CAMERA_LANE            .set    PDATA+43\r
+OBJINS                 .set    PDATA+44\r
+CAMYOFF                        .set    PDATA+45\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+;      .data\r
+;STARTXPOS     .float  -1754318\r
+;STARTYPOS     .float  2345\r
+;STARTZPOS     .float  1314000\r
+       .text\r
+\r
+ATTRACT_DELTA:\r
+       LDI     0,R0\r
+       STI     R0,*+AR7(OBJINS)\r
+       LDI     @ATTRWAVE,R4\r
+       LSH     -1,R4\r
+       STI     R4,*+AR7(LIST_NUM)\r
+       CALL    INIT_ATTR_LEG\r
+\r
+\r
+       LDI     4,R0\r
+       STI     R0,@NOSWAP\r
+\r
+       CREATE  LOGO_PROC,UTIL_C\r
+\r
+       LDI     @_MODE,R0\r
+       OR      MGO,R0\r
+       STI     R0,@_MODE\r
+\r
+       LDI     -1,R0\r
+       STI     R0,*+AR7(CUT_PAN)\r
+\r
+       LDI     1,R0                    ;SET GAME FRAME RATE\r
+       STI     R0,@FRAMRATE\r
+       STI     R0,@TIMECLR\r
+       STI     R0,@DRONE_DISPATCH_P\r
+\r
+       SLEEP   1\r
+       LDI     @PLYCAR,AR4\r
+       LDI     *+AR4(PAR5),AR5\r
+       LDI     *+AR4(PAR4),AR4\r
+       LDI     *+AR5(PAR5),AR0\r
+       STI     AR4,@PLYCAR\r
+       STI     AR0,@PLYCBLK\r
+\r
+       LDI     90,R0\r
+       STI     R0,@_countdown\r
+\r
+       LDI     1,R0\r
+       STI     R0,*+AR7(CUT_PAN)\r
+\r
+       CALL    GET_LIST_ADDR\r
+       BR      DELTA_LOOP_ENTRY\r
+\r
+aDELTA_LOOP\r
+       LDI     *AR6,AR0\r
+       CALLU   AR0\r
+\r
+ADELTA2\r
+       CALL    UPDATE_CAMERA\r
+       SLEEP   1\r
+\r
+       LDI     @NOSWAP,R0\r
+       BEQ     ADELTA2A\r
+       SUBI    1,R0            ;OK Now we have a valid frame\r
+       STI     R0,@NOSWAP\r
+ADELTA2A       \r
+\r
+       CMPI    0,AR5\r
+       BGT     aDELTA_LOOP\r
+\r
+       ADDI    1,AR6           ;Advance to next mode\r
+DELTA_LOOP_ENTRY\r
+       LDI     *AR6,AR0\r
+       CMPI    0,AR0\r
+       BNE     sDELTA_LOOP\r
+;      CALL    GET_LIST_ADDR\r
+;      BU      $\r
+       SUBI    3,AR6           ;Loop on last entry\r
+\r
+sDELTA_LOOP\r
+       LDI     *+AR7(OBJINS),R0\r
+       BEQ     NO_OBJINS\r
+       LDI     R0,AR2\r
+       CALL    OBJ_INSERT                      ;INSERT PLAYER OBJECT\r
+       LDI     0,R0\r
+       STI     R0,*+AR7(OBJINS)\r
+NO_OBJINS\r
+       LDI     *AR6++,AR0\r
+       CALLU   AR0\r
+\r
+       LDI     *AR6++,AR5\r
+       B       ADELTA2\r
+*----------------------------------------------------------------------------\r
+*----------------------------------------------------------------------------\r
+*CREATE THE OBJECT 'CRUISIN USA' FOR OVERLAY DURING ATTRACT MODE\r
+*\r
+LOGO_STARTZ            .set    10000\r
+LOGO_ENDX              .set    -120\r
+LOGO_ENDY              .set    -85\r
+LOGO_ENDZ              .set    368\r
+LOGO_FLYIN_FRAMES      .set    125\r
+LOGO_WHOOSH_FRAMES     .set    462\r
+LOGO_SPINZ             .set    18.85   ;3 revolutions\r
+\r
+LOGO_PROC:\r
+       CALL    OBJ_GET\r
+       BC      LOGOX\r
+       LDI     AR0,AR4\r
+       LDIL    logo,R0\r
+       STI     R0,*+AR0(OROMDATA)\r
+       LDI     O_IROT|O_NOROT|O_NOUROT|O_NOUNIV,R0\r
+       OR      *+AR0(OFLAGS),R0\r
+       STI     R0,*+AR0(OFLAGS)\r
+\r
+\r
+       LDI     UTIL_C|LOGO_T,R0\r
+       STI     R0,*+AR0(OID)\r
+\r
+\r
+       FLOAT   LOGO_STARTZ,R0\r
+       STF     R0,*+AR0(OPOSZ)\r
+       LDI     AR0,AR2\r
+       CALL    OBJ_INSERTP\r
+\r
+       LDF     LOGO_SPINZ,R0\r
+       STF     R0,*+AR4(ORADX)\r
+\r
+       LDF     0,R7            ;SPEED FACTOR\r
+       LDI     LOGO_FLYIN_FRAMES,AR5\r
+LOGO_LOOP1\r
+       SLEEP   1\r
+       FLOAT   @NFRAMES,R6\r
+\r
+       FLOAT   LOGO_ENDY,R0\r
+       CMPF    *+AR4(OPOSY),R0\r
+       BEQ     LOGO2\r
+\r
+       FLOAT   LOGO_ENDX,R0\r
+       SUBF    *+AR4(OPOSX),R0\r
+       MPYF    R7,R0\r
+       MPYF    R6,R0\r
+       ADDF    *+AR4(OPOSX),R0\r
+       FLOAT   LOGO_ENDX,R1\r
+       CMPF    R1,R0\r
+       LDFLT   R1,R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       FLOAT   LOGO_ENDY,R0\r
+       SUBF    *+AR4(OPOSY),R0\r
+       MPYF    R7,R0\r
+       MPYF    R6,R0\r
+       ADDF    *+AR4(OPOSY),R0\r
+       FLOAT   LOGO_ENDY,R1\r
+       CMPF    R1,R0\r
+       LDFLT   R1,R0\r
+       STF     R0,*+AR4(OPOSY)\r
+\r
+       ADDF    0.03,R7\r
+\r
+LOGO2\r
+       FLOAT   LOGO_ENDZ-LOGO_STARTZ,R0\r
+       FLOAT   LOGO_FLYIN_FRAMES,R1\r
+       CALL    DIV_F\r
+       MPYF    R6,R0\r
+       LDF     *+AR4(OPOSZ),R1\r
+       ADDF    R1,R0\r
+       FLOAT   LOGO_ENDZ,R1\r
+       CMPF    R1,R0\r
+       LDFLT   R1,R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+       LDF     LOGO_SPINZ,R0\r
+       FLOAT   LOGO_FLYIN_FRAMES,R1\r
+       CALL    DIV_F\r
+       MPYF    R6,R0\r
+       LDF     *+AR4(ORADX),R2\r
+       SUBF    R0,R2\r
+       LDFN    0,R2\r
+       STF     R2,*+AR4(ORADX)\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    FIND_ZMATRIX\r
+\r
+       SUBI    @NFRAMES,AR5\r
+       CMPI    0,AR5\r
+       BP      LOGO_LOOP1\r
+\r
+LOGOX\r
+       DIE\r
+\r
+*----------------------------------------------------------------------------\r
+GET_LIST_ADDR:\r
+       LDI     *+AR7(LIST_NUM),AR6\r
+       ADDI    @VIEWLISTI,AR6\r
+       LDI     *AR6,AR6\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+\r
+       .SECT   "THEDATA"\r
+VIEWLIST\r
+       .word   GGPARK_LIST\r
+       .word   BEVHILL_LIST\r
+       .word   GCANYON_LIST\r
+       .word   CHICAGO_LIST\r
+       .word   GGPARK_LIST\r
+       .word   BEVHILL_LIST\r
+       .word   GCANYON_LIST\r
+       .word   CHICAGO_LIST\r
+\r
+GGPARK_LIST\r
+*THE first call is to intialize\r
+       .word   INIT_STARTING,70,ROAD_VIEW\r
+       .word   INIT_LEAD,80,LEAD_VIEW\r
+       .word   INIT_WATCH,1214h,240,WATCH_VIEW\r
+       .word   CUT_TO_VIEW2,1404h,SMOOTH_VIEW\r
+       .word   INITVIEW1_VIEW,17FBh,SMOOTH_VIEW\r
+       .word   INIT_LEAD,80,LEAD_VIEW\r
+       .word   0,0\r
+\r
+BEVHILL_LIST\r
+*THE first call is to intialize\r
+       .word   INIT_STARTING,80,ROAD_VIEW\r
+       .word   CUT_TO_VIEW2,14AFBh,SMOOTH_VIEW\r
+       .word   INITVIEW1_VIEW,14DF3h,SMOOTH_VIEW\r
+       .word   INIT_STARTING,100,ROAD_VIEW\r
+       .word   0,0\r
+\r
+\r
+GCANYON_LIST\r
+*THE first call is to intialize\r
+       .word   INIT_STARTING,70,ROAD_VIEW\r
+       .word   INIT_WATCH,2E20Ah,220,WATCH_VIEW\r
+       .word   CUT_TO_VIEW2,2E800h,SMOOTH_VIEW\r
+       .word   INITVIEW1_VIEW,2EC00h,SMOOTH_VIEW\r
+       .word   INIT_WATCH,2EF00h,240,WATCH_VIEW\r
+       .word   CUT_TO_VIEW2,30000h,SMOOTH_VIEW\r
+       .word   0,0\r
+\r
+CHICAGO_LIST\r
+*THE first call is to intialize\r
+       .word   INIT_STARTING,80,ROAD_VIEW\r
+       .word   INIT_REVERS_CUP,60,REV_ROAD_VIEW\r
+       .word   CUT_TO_VIEW2,3AA0Eh,SMOOTH_VIEW\r
+       .word   INITVIEW1_VIEW,3C00Ah,SMOOTH_VIEW\r
+       .word   INIT_WATCH,3C5F5h,240,WATCH_VIEW\r
+       .word   INIT_LEAD,80,LEAD_VIEW\r
+       .word   0,0\r
+\r
+       .text\r
+*----------------------------------------------------------------------------\r
+INIT_STARTING:\r
+       LDI     -350,R0\r
+       FLOAT   R0,R1\r
+       STF     R1,*+AR7(CAMYOFF)\r
+       LDI     4,R0            ;direction to search in\r
+       LDI     1,R1            ;distance to start with\r
+       LDI     8,R2            ;Position to follow\r
+       LDF     0,R3            ;RADY OFFSET\r
+\r
+       CALL    INITROAD_VIEW\r
+       LDF     1,R2\r
+       CALL    SET_LANE\r
+       CALL    INIT_LANE\r
+       CALL    ROAD_VIEW\r
+\r
+       CALL    UPDATE_CAMERA\r
+       CALL    RESCAN\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+INIT_WATCH:\r
+       LDI     1,R0\r
+       STI     R0,*+AR7(CUT_PAN)\r
+\r
+       LDF     0,R0\r
+       STF     R0,*+AR7(CAMERA_XYZR+3)         ;Reset the offset\r
+       LDI     *AR6++,R2                               ;READ the track ID from the VIEWLIST\r
+       CALL    FIND_MAP\r
+INIW1\r
+       LDI     *+AR4(3),R2             ;Get ID\r
+       CALL    FIND_TRACK              ;MAKE DAMN SURE WE ARE ON A LOADED TRACK SECTION!!!\r
+       CMPI    0,AR2\r
+       BNE     INIW2\r
+       SUBI    4,AR4\r
+       BR      INIW1\r
+INIW2\r
+       PUSH    AR4\r
+       LDI     4,R2\r
+       CALL    FIND_RACER\r
+       STI     AR4,*+AR7(CAROBJ)\r
+       STI     AR4,@PLYCAR\r
+       LDI     *+AR4(OCARBLK),AR0\r
+       STI     AR0,@PLYCBLK\r
+       POP     AR4\r
+\r
+       LDI     -300,R0\r
+       FLOAT   R0,R1\r
+       STF     R1,*+AR7(CAMYOFF)\r
+       ADDI    *+AR4(Y),R0\r
+       FLOAT   R0\r
+       STF     R0,*+AR7(NEW_POSY)\r
+\r
+       FLOAT   *+AR4(X),R0\r
+       STF     R0,*+AR7(NEW_POSX)\r
+\r
+       FLOAT   *+AR4(Z),R0\r
+       STF     R0,*+AR7(NEW_POSZ)\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    -4,AR2\r
+\r
+       LDI     *+AR2(X),R0\r
+       SUBI    *+AR4(X),R0\r
+       FLOAT   R0\r
+       MPYF    R0,R0\r
+       LDI     *+AR2(Z),R1\r
+       SUBI    *+AR4(Z),R1\r
+       FLOAT   R1\r
+       MPYF    R1,R1\r
+       ADDF    R0,R1,R2\r
+       CALL    SQRT\r
+       LDF     R0,R2\r
+\r
+       LDI     *+AR2(Y),R3\r
+       SUBI    *+AR4(Y),R3\r
+       FLOAT   R3\r
+       MPYF    1.8,R3\r
+       CALL    ARCTANF\r
+       CALL    NORM_VECTOR\r
+       NEGF    R0\r
+       ADDF    0.09,R0         ;Offset for VIEWX\r
+       STF     R0,*+AR7(NEW_RADX)\r
+\r
+       FLOAT   -2500,R3\r
+       CALL    DO_LANE_POS\r
+\r
+       LDF     -100,R6                 ;SMALL number for a rad\r
+       CALL    WATCH_VIEW\r
+       LDF     *+AR7(NEW_RADY),R6      ;Save initial value\r
+\r
+       CALL    UPDATE_CAMERA\r
+       PUSHF   R6\r
+       CALL    RESCAN                  ;This hoses all RX registers\r
+       POPF    R6\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+INIT_REVERS_CUP:\r
+       LDI     -350,R0\r
+       FLOAT   R0,R1\r
+       STF     R1,*+AR7(CAMYOFF)\r
+       LDI     4,R0            ;direction to search in\r
+       LDI     1,R1            ;distance to start with\r
+       LDI     5,R2            ;Position to follow\r
+       LDF     PI,R3\r
+       CALL    INITROAD_VIEW\r
+       LDF     1,R2\r
+       CALL    SET_LANE\r
+       CALL    INIT_LANE\r
+       CALL    REV_ROAD_VIEW\r
+\r
+       CALL    UPDATE_CAMERA\r
+       CALL    RESCAN\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+INIT_CATCHUP:\r
+       LDI     -350,R0\r
+       FLOAT   R0,R1\r
+       STF     R1,*+AR7(CAMYOFF)\r
+       LDI     4,R0            ;direction to search in\r
+       LDI     1,R1            ;distance to start with\r
+       LDI     5,R2            ;Position to follow\r
+       LDF     0,R3\r
+       CALL    INITROAD_VIEW\r
+       LDF     1,R2\r
+       CALL    SET_LANE\r
+       CALL    INIT_LANE\r
+       CALL    ROAD_VIEW\r
+       CALL    UPDATE_CAMERA\r
+       CALL    RESCAN\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+INIT_LEAD:\r
+       LDI     -300,R0\r
+       FLOAT   R0,R1\r
+       STF     R1,*+AR7(CAMYOFF)\r
+       LDI     -4,R0\r
+       LDI     1,R1\r
+       LDI     0,R2\r
+       LDF     PI,R3\r
+       CALL    INITROAD_VIEW\r
+       LDF     1,R2\r
+       CALL    SET_LANE\r
+       CALL    INIT_LANE\r
+       CALL    LEAD_VIEW\r
+       CALL    UPDATE_CAMERA\r
+       CALL    RESCAN\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+INITROAD_VIEW:\r
+       STI     R0,*+AR7(CAMERA_XYZR)\r
+       STI     R1,*+AR7(CAMERA_XYZR+1)\r
+       STI     R2,*+AR7(CAMERA_XYZR+2)\r
+       STF     R3,*+AR7(CAMERA_XYZR+3)\r
+\r
+       LDF     0,R0\r
+       STF     R0,*+AR7(CAMERA_ACCEL)\r
+\r
+       LDI     1,R0\r
+       STI     R0,*+AR7(CUT_PAN)\r
+\r
+       LDI     *+AR7(CAMERA_XYZR+2),R2         ;Position to find\r
+       CALL    FIND_RACER\r
+\r
+       LDI     AR4,AR0\r
+       STI     AR4,*+AR7(CAROBJ)\r
+       STI     AR4,@PLYCAR\r
+       LDI     *+AR4(OCARBLK),AR1\r
+       STI     AR1,@PLYCBLK\r
+\r
+       CALL    GET_MAP_CARBLK\r
+\r
+       LDI     *+AR7(CAMERA_XYZR+1),R0\r
+       MPYI    *+AR7(CAMERA_XYZR),R0\r
+       SUBI    R0,AR4          ;Start this many track sections behind first place\r
+       LDI     @NOSWAP,R0\r
+       CMPI    0,R0                    ;Don't check during init\r
+       BNE     OK_FOUNDIT\r
+TRY_AGAIN\r
+       LDI     *+AR4(3),R2             ;Get ID\r
+       CALL    FIND_TRACK\r
+       CMPI    0,AR2\r
+       BNE     OK_FOUNDIT\r
+       ADDI    *+AR7(CAMERA_XYZR),AR4\r
+       BR      TRY_AGAIN\r
+OK_FOUNDIT\r
+       CALL    GET_ROAD_RADY\r
+       STF     R0,*+AR7(NEW_RADY)\r
+\r
+       FLOAT   *+AR4(X),R0\r
+       STF     R0,*+AR7(NEW_POSX)\r
+\r
+       FIX     *+AR7(CAMYOFF),R0\r
+       ADDI    *+AR4(Y),R0\r
+       FLOAT   R0\r
+       STF     R0,*+AR7(NEW_POSY)\r
+\r
+       FLOAT   *+AR4(Z),R0\r
+       STF     R0,*+AR7(NEW_POSZ)\r
+\r
+       RETS\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+WATCH_VIEW:\r
+\r
+       LDI     *+AR7(CAROBJ),AR0\r
+       LDF     *+AR0(OPOSX),R2         ;Get the direction of the car relative to \r
+       SUBF    *+AR7(NEW_POSX),R2      ;the direction the camera is moving in.\r
+       LDF     *+AR0(OPOSZ),R3\r
+       SUBF    *+AR7(NEW_POSZ),R3\r
+       CALL    ARCTANF\r
+       CALL    NORM_VECTOR\r
+       SUBF    HALFPI,R0\r
+       CALL    NORM_VECTOR\r
+       NEGF    R0\r
+       STF     R0,*+AR7(NEW_RADY)\r
+WV1\r
+       LDI     AR7,R2\r
+       ADDI    NEW_RADX,R2\r
+       LDI     AR7,AR2\r
+       ADDI    NEW_MATRIX,AR2\r
+       CALL    FIND_MATRIX\r
+\r
+       LDI     @NFRAMES,R0\r
+       SUBI    R0,AR5          ;Will count frames in this case\r
+\r
+       LDI     @ATTRWAVE,R0\r
+       CMPI    2,R0            ;preincremented will actually be GGPARK\r
+       BNE     NO_WHOOSH\r
+       READADJ ADJ_ATTRACT_MODE_SOUND\r
+       CMPI    0,R0\r
+       BEQ     NO_WHOOSH\r
+       LDF     R6,R0\r
+       SUBF    *+AR7(NEW_RADY),R0\r
+       CMPF    0.18,R0                 ;9deg   diff\r
+       BLT     NO_WHOOSH\r
+       LDF     -100,R6                         ;do only once\r
+       SOND1   WHOOSH\r
+NO_WHOOSH\r
+\r
+       RETS\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+REV_ROAD_VIEW:\r
+       LDI     *+AR7(CAROBJ),AR0\r
+       LDI     *+AR0(OCARBLK),AR1\r
+       LDF     *+AR1(CARSPEED),R0\r
+       MPYF    1.8,R0\r
+       STF     R0,*+AR7(CAMERA_VEL)    ;Set initial camera velocity\r
+       LDF     0.6,R2\r
+       CALL    SET_LANE\r
+       CALL    MOVE_ROAD_CAMERA\r
+       RETS\r
+       \r
+*----------------------------------------------------------------------------\r
+       .data\r
+ACCEL_RATE     .float  0.000002\r
+       .text\r
+ROAD_VIEW:\r
+       CALL    FIND_CLOSEST_RACER\r
+       CMPI    0,AR1\r
+       LDIZ    0,AR5           ;PASSED FIRST PLACE CHANGE MODES (AR5 = frame to switch)\r
+       BEQ     RV1\r
+\r
+       CMPI    *+AR7(CAROBJ),AR1\r
+       BEQ     RV1A\r
+       LDF     0,R2\r
+       STF     R2,*+AR7(CAMERA_ACCEL)\r
+\r
+\r
+       STI     AR1,*+AR7(CAROBJ)       ;FOUND a NEW CAR\r
+       STI     AR1,@PLYCAR\r
+       LDI     *+AR1(OCARBLK),AR0\r
+       STI     AR0,@PLYCBLK\r
+       STF     R0,*+AR7(CARDIS)\r
+RV1A\r
+\r
+       LDF     @ACCEL_RATE,R3\r
+       LDF     *+AR7(CAMERA_ACCEL),R2\r
+       LDF     *+AR7(CARDIS),R1\r
+       MPYF    0.6,R1\r
+       CMPF    R0,R1                   ;Are we half way there yet?\r
+       BLT     RV1B\r
+       NEGF    R3\r
+RV1B\r
+       ADDF    R3,R2\r
+       LDFLT   0,R2\r
+       STF     R2,*+AR7(CAMERA_ACCEL)\r
+       MPYF    R0,R2                   ;Factor in overall distance\r
+       ADDF    1.6,R2\r
+       \r
+       LDI     *+AR1(OCARBLK),AR0\r
+       LDF     *+AR0(CARSPEED),R0\r
+       MPYF    R2,R0\r
+       STF     R0,*+AR7(CAMERA_VEL)    ;Set initial camera velocity\r
+RV1\r
+       LDF     0.6,R2\r
+       CALL    SET_LANE\r
+       CALL    MOVE_ROAD_CAMERA\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+LEAD_VIEW:\r
+       LDI     *+AR7(CAROBJ),AR0\r
+       LDI     *+AR0(OCARBLK),AR1\r
+       LDF     *+AR1(CARSPEED),R0\r
+       MPYF    1.51,R0\r
+       STF     R0,*+AR7(CAMERA_VEL)    ;Set initial camera velocity\r
+\r
+       LDF     0.6,R2\r
+       CALL    SET_LANE\r
+       CALL    MOVE_ROAD_CAMERA\r
+       RETS\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+MOVE_ROAD_CAMERA:\r
+       LDI     @NOSWAP,R0      ;If noswap is on definatly do it\r
+       BNE     MRC1\r
+       LDI     @SUSPEND_MODE,R0        ;This stops the shimmer at the start of bevhills\r
+       CMPI    SM_HALT,R0\r
+       BEQ     MRCX\r
+MRC1\r
+       CALL    GETCAMDIR\r
+\r
+       LDI     @VECTORBI,AR2\r
+       LDF     *+AR7(NEW_RADX),R0\r
+       STF     R0,*+AR2(X)\r
+       LDF     *+AR7(NEW_RADZ),R0\r
+       STF     R0,*+AR2(Z)\r
+\r
+       LDF     *+AR7(NEW_RADY),R0\r
+       SUBF    *+AR7(CAMERA_XYZR+3),R0 ;LOOSE the Offset rad for viewing\r
+       CALL    NORM_VECTOR\r
+       NEGF    R0                      ;Move in oposite direction looking?\r
+       STF     R0,*+AR2(Y)\r
+\r
+       LDI     @VECTORBI,R2\r
+       LDI     @MATRIXAI,AR2\r
+       CALL    FIND_MATRIX\r
+\r
+       LDI     @VECTORAI,AR2\r
+       LDF     0,R0\r
+       STF     R0,*+AR2(X)\r
+       STF     R0,*+AR2(Y)\r
+       LDF     *+AR7(CAMERA_VEL),R0\r
+       FLOAT   @NFRAMES,R1\r
+       MPYF    R1,R0\r
+       STF     R0,*+AR2(Z)\r
+       LDI     @VECTORBI,R3\r
+       LDI     @MATRIXAI,R2\r
+       CALL    MATRIX_MUL\r
+\r
+       LDI     @VECTORBI,AR2\r
+       LDF     *+AR2(X),R0\r
+       ADDF    *+AR7(NEW_POSX),R0\r
+       STF     R0,*+AR7(NEW_POSX)\r
+\r
+       LDF     *+AR2(Z),R0\r
+       ADDF    *+AR7(NEW_POSZ),R0\r
+       STF     R0,*+AR7(NEW_POSZ)\r
+\r
+       PUSH    AR4\r
+       LDI     AR7,AR4\r
+       ADDI    NEW_POSX,AR4\r
+       CALL    CAMSCAN\r
+       POP     AR4\r
+       BNC     USE_SLOPE\r
+       LDF     *+AR7(CAMYOFF),R1\r
+       ADDF    R1,R0\r
+       ADDF    *+AR7(NEW_POSY),R0\r
+       STF     R0,*+AR7(NEW_POSY)\r
+       BR      NO_SLOPE\r
+USE_SLOPE\r
+;This code should really never get used\r
+       LDI     AR4,AR2\r
+       ADDI    4,AR2\r
+       LDI     *+AR2(Z),R0\r
+       SUBI    *+AR4(Z),R0\r
+       FLOAT   R0\r
+       MPYF    R0,R0\r
+       LDI     *+AR2(X),R1\r
+       SUBI    *+AR4(X),R1\r
+       FLOAT   R1\r
+       MPYF    R1,R1\r
+       ADDF3   R0,R1,R2        ;R= SQRT (X^2 + Z^2)\r
+       CALL    SQRT\r
+       LDF     R0,R1\r
+\r
+       LDI     *+AR2(Y),R0\r
+       SUBI    *+AR4(Y),R0\r
+       FLOAT   R0\r
+       MPYF    1.05,R0         ;FUDGE FACTOR\r
+       CALL    DIV_F\r
+       LDI     @VECTORAI,AR0\r
+       LDF     *+AR0(Z),R1\r
+       MPYF    R1,R0\r
+       ADDF    *+AR7(NEW_POSY),R0\r
+       STF     R0,*+AR7(NEW_POSY)\r
+\r
+       LDI     -400,R1         ;at 1000 above the road\r
+       ADDI    *+AR4(Y),R1\r
+       FLOAT   R1\r
+       SUBF    *+AR7(NEW_POSY),R1\r
+       MPYF    0.04,R1\r
+       ADDF    *+AR7(NEW_POSY),R1\r
+       STF     R1,*+AR7(NEW_POSY)\r
+NO_SLOPE\r
+\r
+       LDI     AR7,R2\r
+       ADDI    NEW_RADX,R2\r
+       LDI     AR7,AR2\r
+       ADDI    NEW_MATRIX,AR2\r
+       CALL    FIND_MATRIX\r
+\r
+       CALL    NEXT_ROAD\r
+MRCX\r
+       RETS\r
+*---------------------------------------------------------------------------\r
+* Updates AR4 to point to the road segment that the camera is on\r
+* NOTE: uses Stealth mode\r
+* INPUT        AR4 = segment on\r
+* OUTPUT AR4 = segment on (updated)\r
+*\r
+\r
+NEXT_ROAD:\r
+       FLOAT   *+AR4(X),R0\r
+       SUBF    *+AR7(NEW_POSX),R0\r
+       MPYF    R0,R0\r
+       FLOAT   *+AR4(Z),R1\r
+       SUBF    *+AR7(NEW_POSZ),R1\r
+       MPYF    R1,R1\r
+       ADDF    R1,R0\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    4,AR2\r
+       FLOAT   *+AR2(X),R1\r
+       SUBF    *+AR7(NEW_POSX),R1\r
+       MPYF    R1,R1\r
+       FLOAT   *+AR2(Z),R2\r
+       SUBF    *+AR7(NEW_POSZ),R2\r
+       MPYF    R2,R2\r
+       ADDF    R2,R1\r
+\r
+       CMPF    R1,R0\r
+       BLE     fcrx                    ;didn't move\r
+       ADDI    4,AR4\r
+;      .if     DEBUG\r
+;      LDI     *+AR4(3),R2\r
+;      CALL    FIND_TRACK\r
+;      CMPI    0,AR2\r
+;      BNE     fcr1\r
+;      LOCKUP                          ;TRACK not loaded yet\r
+;fcr1\r
+;      .endif\r
+       DEC     AR5                     ;AR5 is the number of road segments before swithching\r
+       BR      NEXT_ROAD               ;See if the road segment beyond is even closer\r
+fcrx\r
+       RETS\r
+\r
+*---------------------------------------------------------------------------\r
+* Sets the cameras RADY based on the next track segments reletive position\r
+* NOTE: uses stealth mode\r
+* No I/O\r
+*      Sets CAMERA_RADY = (CAMERA_XYZR+3)+ RAD to next track section\r
+\r
+GETCAMDIR:\r
+       LDF     *+AR7(CAMERA_VEL),R0    ;Adjust the smothing factor to speed\r
+       FLOAT   @NFRAMES,R1\r
+       MPYF    R1,R0\r
+       FLOAT   5000,R1\r
+       CALL    DIV_F\r
+       LDF     R0,R4\r
+\r
+       CALL    GET_ROAD_RADY           ;Calculate the offset for lane position\r
+       NEGF    R0                      ;based on the roads direction\r
+       LDF     R0,R2\r
+       LDI     @MATRIXAI,AR2\r
+       CALL    FIND_YMATRIX\r
+\r
+       LDI     @VECTORAI,AR2\r
+       LDF     0,R0\r
+       STF     R0,*+AR2(Y)\r
+       STF     R0,*+AR2(Z)\r
+       LDF     *+AR7(CAMERA_LANE),R0\r
+       STF     R0,*+AR2(X)\r
+       LDI     @VECTORBI,R3\r
+       LDI     @MATRIXAI,R2\r
+       CALL    MATRIX_MUL\r
+\r
+       LDI     AR4,AR1\r
+       ADDI    4*2,AR1\r
+\r
+       LDI     @VECTORBI,AR2                   ;Factor in the desired location to be at\r
+       FLOAT   *+AR1(Z),R2                     ;reletive to where we are\r
+       ADDF    *+AR2(Z),R2\r
+       SUBF    *+AR7(NEW_POSZ),R2\r
+       FLOAT   *+AR1(X),R3\r
+       ADDF    *+AR2(X),R3\r
+       SUBF    *+AR7(NEW_POSX),R3\r
+       CALL    ARCTANF\r
+       CALL    NORM_VECTOR\r
+       ADDF    *+AR7(CAMERA_XYZR+3),R0         ;Offset for VIEW\r
+       CALL    NORM_VECTOR\r
+       SUBF    *+AR7(NEW_RADY),R0\r
+       LDF     R4,R2\r
+       CALL    SMOOTH_VECTOR\r
+       ADDF    *+AR7(NEW_RADY),R0\r
+       STF     R0,*+AR7(NEW_RADY)\r
+\r
+       LDF     0,R0\r
+       STF     R0,*+AR7(NEW_RADX)\r
+       STF     R0,*+AR7(NEW_RADZ)\r
+\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+*INPUT R2 = FL smoothing\r
+SET_LANE:\r
+       LDI     *+AR7(CAROBJ),AR0\r
+       LDI     *+AR0(OPLINK),AR0\r
+       FLOAT   1000,R1                 ;Offset to center of right lanes\r
+       LDF     *+AR0(ROADOFFSET),R0\r
+       BP      SL1\r
+       NEGF    R1\r
+SL1\r
+       SUBF    R1,R0\r
+;      MPYF    0.40,R0                 ;Move to just inside where the car is.\r
+       MPYF    0.30,R0                 ;Move to just inside where the car is.\r
+       ADDF    R1,R0\r
+       CMPF    1.0,R2\r
+       BEQ     SL2\r
+       SUBF    *+AR7(CAMERA_LANE),R0\r
+       MPYF    R2,R0\r
+       ADDF    *+AR7(CAMERA_LANE),R0\r
+       STF     R0,*+AR7(CAMERA_LANE)\r
+SL2\r
+       STF     R0,*+AR7(CAMERA_LANE)\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+INIT_LANE:\r
+       LDF     *+AR7(CAMERA_LANE),R3\r
+       CALL    DO_LANE_POS\r
+       RETS\r
+\r
+*---------------------------------------------------------------------------\r
+*INPUT R2 = RADIANS to offset for doing the lanes\r
+*      R3 = Distance from center +/-\r
+\r
+DO_LANE_POS:\r
+       PUSHF   R3\r
+       LDI     AR4,AR1\r
+       ADDI    4*2,AR1\r
+\r
+       CALL    GET_ROAD_RADY\r
+       NEGF    R0\r
+       LDF     R0,R2\r
+       LDI     @MATRIXAI,AR2\r
+       CALL    FIND_YMATRIX\r
+\r
+       LDI     @VECTORAI,AR2\r
+       LDF     0,R0\r
+       STF     R0,*+AR2(Y)\r
+       STF     R0,*+AR2(Z)\r
+       POPF    R0\r
+       STF     R0,*+AR2(X)\r
+\r
+       LDI     @VECTORBI,R3\r
+       LDI     @MATRIXAI,R2\r
+       CALL    MATRIX_MUL\r
+\r
+       LDI     @VECTORBI,AR2\r
+       LDF     *+AR2(X),R0\r
+       ADDF    *+AR7(NEW_POSX),R0\r
+       STF     R0,*+AR7(NEW_POSX)\r
+\r
+       LDF     *+AR2(Z),R0\r
+       ADDF    *+AR7(NEW_POSZ),R0\r
+       STF     R0,*+AR7(NEW_POSZ)\r
+       RETS\r
+\r
+*---------------------------------------------------------------------------\r
+*INPUT AR4 = POINTER to LEG_MAP where road is\r
+*OUTPUT        R0 = DIRECTION of road \r
+GET_ROAD_RADY:\r
+       PUSH    AR1\r
+       PUSH    R2\r
+       PUSHF   R2\r
+       PUSH    R3\r
+       PUSHF   R3\r
+\r
+       LDI     AR4,AR1\r
+       ADDI    4*2,AR1\r
+\r
+       LDI     *+AR1(Z),R2\r
+       SUBI    *+AR4(Z),R2\r
+       FLOAT   R2\r
+       LDI     *+AR1(X),R3     ;Get the direction of the road\r
+       SUBI    *+AR4(X),R3\r
+       FLOAT   R3\r
+       CALL    ARCTANF\r
+       CALL    NORM_VECTOR\r
+\r
+       POPF    R3\r
+       POP     R3\r
+       POPF    R2\r
+       POP     R2\r
+       POP     AR1\r
+       RETS\r
+\r
+*---------------------------------------------------------------------------\r
+*This algorithm is based on a bubble sort\r
+*Find the RACER DRONE IN FIRST PLACE based on position in LEG_MAP\r
+*INPUT R2 = Position to find\r
+*OUTPUT AR4 = OBJ of the racer\r
+*\r
+*\r
+FIND_RACER:\r
+       LDI     AR7,AR3                 ;clear the list\r
+       ADDI    TEMP_DATA,AR3\r
+       LDI     0,R0\r
+       RPTS    9\r
+       STI     R0,*AR3++\r
+       LDI     AR7,AR3\r
+       ADDI    TEMP_DATA,AR3\r
+\r
+       LDI     0,IR0\r
+       LDI     0,AR1\r
+       LDI     7FFFh,R3\r
+       MPYI    R3,R3                   ;BIG number\r
+FR0\r
+       LDI     0,R4\r
+       LDI     @CAR_LISTI,AR0          ;Scan the list of car objects\r
+       SUBI    OLINK3,AR0\r
+\r
+FR1\r
+       LDI     *+AR0(OLINK3),AR0       ;They are linked by OLINK3\r
+       CMPI    0,AR0\r
+       BEQ     FRX\r
+\r
+       LDI     *+AR0(OID),R0                   ;Is this a racer?\r
+       CMPI    DRONE_C|VEHICLE_T|DRNE_RACER,R0\r
+       BNE     FR1\r
+\r
+       CALL    GET_MAP_CARBLK\r
+\r
+       CMPI    AR4,R3                  ;Best position looking for\r
+       BLT     FR1\r
+       CMPI    AR4,R4                  ;Greatest entry in the LEG_MAP wins\r
+       BGT     FR1\r
+\r
+       LDI     IR0,IR1                 ;WHILE ((IR0>0) && (*+AR3(IR1++) != AR0))\r
+FR2A\r
+       SUBI    1,IR1\r
+       CMPI    0,IR1\r
+       BN      FR2B\r
+FR2\r
+       CMPI    *+AR3(IR1),AR0          ;IF THIS CAR IS ALLREADY ON LIST, Then Get NEXT\r
+       BEQ     FR1\r
+       BR      FR2A\r
+FR2B\r
+       LDI     AR4,R4\r
+       LDI     AR0,AR1                 ;Set the pointer to the cars obj\r
+       BU      FR1\r
+FRX\r
+       STI     AR1,*+AR3(IR0)\r
+       ADDI    1,IR0\r
+       LDI     R4,R3\r
+       SUBI    1,R2\r
+       BP      FR0                     ;Find the next best\r
+       CMPI    0,AR1\r
+       BNE     FRXX\r
+       LOCKUP                          ;No RACERS?\r
+FRXX\r
+       LDI     AR1,AR4\r
+       RETS    \r
+\r
+*----------------------------------------------------------------------------\r
+*This algorithm is based on a single pass bubble sort\r
+*OUTPUT\r
+*      R0      =       Distance to the closest Racer Drone\r
+*      AR1     =       Pointer to the Closest Racer Drone in front of the camera\r
+*      AR1     =       0, If no Racer Drones in front of the camera\r
+*\r
+\r
+\r
+FIND_CLOSEST_RACER:\r
+       FLOAT   30000,R5\r
+       MPYF    R5,R5\r
+       MPYF    R5,R5\r
+       MPYF    R5,R5\r
+       MPYF    R5,R5           ;BIG F'N NUMBER\r
+\r
+       LDI     @CAR_LISTI,AR0          ;Scane the linked list of cars\r
+       SUBI    OLINK3,AR0\r
+       LDI     0,AR1\r
+FCR1\r
+       LDI     *+AR0(OLINK3),AR0\r
+       CMPI    0,AR0\r
+       BEQ     FCRX\r
+\r
+       LDI     *+AR0(OID),R0\r
+       CMPI    DRONE_C|VEHICLE_T|DRNE_RACER,R0 ;Racer drones only\r
+       BNE     FCR1\r
+\r
+       LDF     *+AR0(OPOSZ),R2\r
+       SUBF    *+AR7(NEW_POSZ),R2\r
+       LDF     *+AR0(OPOSX),R3         ;Get the direction of the car relative to \r
+       SUBF    *+AR7(NEW_POSX),R3      ;the direction the camera is moving in.\r
+       CALL    ARCTANF\r
+       CALL    NORM_VECTOR\r
+       SUBF    *+AR7(NEW_RADY),R0      ;DEG from camera\r
+       CALL    NORM_VECTOR\r
+       SUBF    *+AR7(CAMERA_XYZR+3),R0 ;LOOSE the Offset rad for viewing\r
+       CALL    NORM_VECTOR\r
+       ABSF    R0\r
+       CMPF    0.78,R0                 ;Within +/- 45deg?\r
+       BGT     FCR1                    ;Nop this car is beside us or behind us\r
+\r
+       LDF     *+AR0(OPOSX),R0         ;Now compute the distance to the car\r
+       SUBF    *+AR7(NEW_POSX),R0      ;D = SQRT((X2-X1)^2+(Y2-Y1)^2)\r
+       MPYF    R0,R0\r
+       LDF     *+AR0(OPOSZ),R1\r
+       SUBF    *+AR7(NEW_POSZ),R1\r
+       MPYF    R1,R1\r
+       ADDF    R0,R1,R2\r
+       CALL    SQRT\r
+       CMPF    R0,R5\r
+       LDFGT   R0,R5\r
+       LDIGT   AR0,AR1\r
+       BU      FCR1\r
+FCRX\r
+       LDF     R5,R0\r
+       RETS\r
+\r
+*---------------------------------------------------------------------------\r
+*\r
+*GET OBJECT POINTER TO ROAD SEG ID IN R2\r
+*INPUTS  R2=OUSR1\r
+*OUPTUTS AR2=POINTER TO OBJECT\r
+*        AR2=0 not found\r
+FIND_TRACK:\r
+       LDI     @DYNALIST_TRUEBEGIN,AR2\r
+FDL\r
+       LDI     *+AR2(OUSR1),R0\r
+       CMPI    R0,R2\r
+       BZ      FDLX\r
+       LDI     *+AR2(OLINK4),AR2\r
+       CMPI    0,AR2                   ;CHECK END OF THE LINE\r
+       BNZ     FDL\r
+FDLX\r
+       RETS\r
+\r
+*---------------------------------------------------------------------------\r
+*\r
+*GET POINTER TO MAP_LEG, FOR THE CAR IN AR4\r
+*INPUTS  AR0=POINTER TO CARBLK\r
+*OUPTUTS AR4=POINTER TO place in LEG_MAP\r
+*SETS CAROBJ IF GET_MAP_SEGMENT is called\r
+\r
+GET_MAP_CARBLK:                                ;INPUT is AR0=POINTER TO THE CARBLK\r
+       PUSH    R2\r
+       LDI     *+AR0(OPLINK),AR2\r
+       LDI     *+AR2(DELTA_SPTR),AR4\r
+       LDI     *+AR2(STEALTHMODE),R0   ;ARE YOU A STEALTHY BITCH?\r
+       BNZ     GMSX\r
+       LDI     *+AR0(OCARBLK),AR4\r
+       LDI     *+AR4(CARTRAK),AR4      ;Get the track piece the car is on\r
+       LDI     *+AR4(OUSR1),R2\r
+\r
+       CALL    FIND_MAP\r
+\r
+GMSX\r
+       POP     R2\r
+       RETS\r
+\r
+*---------------------------------------------------------------------------\r
+*\r
+*GET POINTER TO MAP_LEG, ID IN R2\r
+*INPUTS  R2=OUSR1\r
+*OUPTUTS AR4=POINTER TO place in LEG_MAP\r
+\r
+FIND_MAP:\r
+       LDI     @LEG_MAPI,AR4           ;FIND THE POSITION IN THE MAP\r
+       ADDI    3,AR4                           ;OFFSET TO ID\r
+FIND_LP\r
+       LDI     *AR4++(4),R0\r
+       CMPI    R2,R0\r
+       BLT     FIND_LP\r
+FINDX\r
+       SUBI    7,AR4\r
+       RETS\r
+\r
+INITVIEW1_VIEW:\r
+       LDI     0,R1\r
+       STI     R0,*+AR7(CAMERA_VIEW)\r
+       LDI     @PLYCAR,AR4\r
+       LDF     0,R0\r
+       FLOAT   -150,R1\r
+       FLOAT   0,R2\r
+       LDF     0,R3\r
+       BR      SET_SMOOTH_VIEW\r
+\r
+CUT_TO_VIEW2:\r
+       LDI     1,R0                    ;Don't smooth while spinning\r
+       STI     R0,*+AR7(CUT_PAN)\r
+\r
+       LDI     4,R2            ;FOLOW 3rd place\r
+       CALL    FIND_RACER\r
+       STI     AR4,@PLYCAR\r
+       LDI     *+AR4(OCARBLK),AR0\r
+       STI     AR0,@PLYCBLK\r
+       CALL    INITVIEW2_VIEW\r
+       CALL    UPDATE_CAMERA\r
+       CALL    RESCAN\r
+       RETS\r
+\r
+INITVIEW2_VIEW:\r
+       LDI     @PLYCAR,AR4\r
+\r
+       LDI     1,R0\r
+       STI     R0,*+AR7(CAMERA_VIEW)\r
+       LDF     0,R0\r
+       FLOAT   -400,R1\r
+       FLOAT   -2200,R2\r
+       LDF     0,R3\r
+       BR      SET_SMOOTH_VIEW\r
+\r
+INITVIEW3_VIEW:\r
+       LDI     BUT_VIEW3,R1\r
+       STI     R0,*+AR7(CAMERA_VIEW)\r
+       LDF     0,R0\r
+       FLOAT   -900,R1\r
+       FLOAT   -3840,R2\r
+       LDF     0,R3\r
+       BR      SET_SMOOTH_VIEW\r
+\r
+*----------------------------------------------------------------------------\r
+       .ref    CAMYADJ\r
+\r
+FACE_FRONT:\r
+       PUSH    AR5\r
+\r
+       LDI     *+AR4(OCARBLK),AR5\r
+       LDI     *+AR4(OFLAGS),R0        ;CHECK IF CAR IS DISPLAYED\r
+       TSTB    O_LIST_M,R0\r
+       BNZ     SECOND_PERSON                   \r
+FIRST_PERSON                           ;NO, Then in first person\r
+       LDI     0,R0\r
+       STI     R0,@CAMVIEW\r
+\r
+       LDI     AR7,AR2\r
+       ADDI    NEW_MATRIX,AR2\r
+       LDI     AR4,R2\r
+       ADDI    OMATRIX,R2\r
+       CALL    CPYIMAT                 ;Copy the cars matrix into NEW_MATRIX\r
+\r
+       LDF     0,R0\r
+       STF     R0,*+AR5(CARROT)        ;NO OVERROTATION IN CORNER\r
+\r
+       LDF     0,R0\r
+       STF     R0,*+AR7(NEW_RADY)              ;NOTE this is not used for first person\r
+\r
+       LDF     *+AR5(CARXLEAN),R0\r
+       MPYF    -0.7,R0                 ;NEGATE AND SCALE\r
+       SUBF    *+AR7(NEW_RADX),R0\r
+       LDF     0.20,R2\r
+       CALL    SMOOTH_VECTOR   \r
+       ADDF    *+AR7(NEW_RADX),R0\r
+       STF     R0,*+AR7(NEW_RADX)              ;NOTE this is not used for first person\r
+\r
+       LDF     *+AR5(CARZLEAN),R0      ;GET Z LEAN FACTOR\r
+       MPYF    -0.5,R0                 ;NEGATE AND SCALE\r
+       STF     R0,*+AR7(NEW_RADZ)\r
+\r
+       LDI     @MATRIXCI,AR2\r
+       LDI     AR7,R2\r
+       ADDI    NEW_RADX,R2\r
+       CALL    FIND_MATRIX\r
+\r
+       LDI     AR7,AR2\r
+       ADDI    NEW_MATRIX,AR2\r
+       LDI     AR2,R3\r
+       LDI     @MATRIXCI,R2\r
+       CALL    CONCATMAT\r
+\r
+       NEGF    *+AR5(CARYROT),R0       ;SAVE this for switching out of first person\r
+       STF     R0,*+AR7(NEW_RADY)              ;NOTE this is not used for first person\r
+\r
+       LDI     *+AR5(CAR_SPIN),R0      ;SPINNING?\r
+       BZ      FFX\r
+       LDI     1,R0                    ;Don't smooth while spinning\r
+       STI     R0,*+AR7(CUT_PAN)\r
+       BR      FFX\r
+\r
+SECOND_PERSON\r
+       LDI     1,R0\r
+       STI     R0,@CAMVIEW\r
+       LDI     *+AR5(CAR_SPIN),R0      ;SPINNING?\r
+       BNZ     FFX                     ;YES, DONT mess WITH CAMERA ANGLE\r
+\r
+       LDF     *+AR4(OVELX),R3         \r
+       LDF     *+AR4(OVELZ),R2\r
+       ADDF3   R3,R2,R1\r
+       CMPF    0,R1\r
+       BNE     FFX1\r
+       NEGF    *+AR5(CARYROT),R0       ;If stopped don't use the velocity\r
+       BR      FFX2\r
+FFX1\r
+       CALL    ARCTANF\r
+FFX2\r
+       CALL    NORM_VECTOR\r
+       ADDF    *+AR7(CAMERA_XYZR+3),R0\r
+\r
+       LDI     *+AR7(CUT_PAN),R2\r
+       CMPI    0,R2\r
+       BNE     FFX3                            ;NO smoothing in a cut\r
+       SUBF    *+AR7(NEW_RADY),R0\r
+       LDF     0.10,R2 \r
+;      LDF     0.20,R2 \r
+       CALL    SMOOTH_VECTOR\r
+\r
+       ADDF    *+AR7(NEW_RADY),R0\r
+FFX3\r
+       STF     R0,*+AR7(NEW_RADY)\r
+\r
+       LDF     0,R0\r
+       STF     R0,*+AR7(NEW_RADX)\r
+       STF     R0,*+AR7(NEW_RADZ)\r
+FFX4\r
+       LDI     AR7,R2\r
+       ADDI    NEW_RADX,R2\r
+       LDI     AR7,AR2\r
+       ADDI    NEW_MATRIX,AR2\r
+       CALL    FIND_MATRIX\r
+\r
+       LDI     AR7,AR0\r
+       ADDI    NEW_POSX,AR0\r
+       CALL    CAMYADJ                 ;MAKE sure the camera doesn't go below the road\r
+\r
+FFX\r
+       POP     AR5\r
+       RETS\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*Does averaging\r
+*INPUT\r
+*              R2 = average    0.20\r
+*              R0 = difference between the two angles\r
+*OUTPUT\r
+*              R0 = SMOOTHED difference\r
+SMOOTH_VECTOR:\r
+       CALL    NORM_VECTOR\r
+\r
+       LDI     *+AR5(CAR_SPIN),R3      ;SPINNING?\r
+       CMPI    1,R3\r
+       BEQ     SV1                     ;Yes then don't smooth\r
+       LDF     R0,R3           ;Save of the non smoothed value\r
+\r
+       MPYF    R2,R0                   ;ANGLE SMOOTHING\r
+\r
+       ABSF    R3,R2\r
+       CMPF    0.78,R2         ;Is this within 45 degrees?\r
+       BLT     SVX\r
+       LDF     R3,R0           ;NO, Then don't smooth the pig (PROBABLY JUST CHANGED CAMERA ANGLE)\r
+SV1\r
+       LDI     1,R3\r
+       STI     R3,*+AR7(CUT_PAN)       ;This is a cut, Don't smooth the matrix\r
+SVX\r
+       RETS\r
+\r
+SERIOUSLY_NORMALIZE:           ;For those crazy wacked out vectors that are more than 360deg\r
+       ABSF    R0,R1\r
+       CMPF    @TWOPII,R1\r
+       BLT     NORM_VECTOR\r
+       LDF     @TWOPII,R1\r
+       PUSHF   R0\r
+       CALL    DIV_F\r
+       FIX     R0,R1\r
+       FLOAT   R1\r
+       MPYF    @TWOPII,R1              ;MOD 6.28\r
+       POPF    R0\r
+       SUBF    R1,R0\r
+NORM_VECTOR:\r
+       LDF     0,R1                    ;NORMALIZE DIFFERENCE\r
+       CMPF    3.14,R0\r
+       LDFGT   -6.28,R1\r
+\r
+       CMPF    -3.14,R0\r
+       LDFLT   6.28,R1\r
+       ADDF    R1,R0\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+\r
+SET_SMOOTH_VIEW:\r
+       LDI     0,AR5                   ;Set AR5 for init\r
+\r
+       STF     R0,*+AR7(NEWCAMERA_XYZR)\r
+       STF     R1,*+AR7(NEWCAMERA_XYZR+1)\r
+       STF     R2,*+AR7(NEWCAMERA_XYZR+2)\r
+       STF     R3,*+AR7(NEWCAMERA_XYZR+3)\r
+\r
+       LDF     0,R4\r
+       STF     R4,*+AR7(ZOOMVEL)\r
+\r
+       LDI     *+AR7(CUT_PAN),R4\r
+       BEQ     SMOOTH_VIEW\r
+;DO A CUT\r
+       STF     R0,*+AR7(CAMERA_XYZR)\r
+       STF     R1,*+AR7(CAMERA_XYZR+1)\r
+       STF     R2,*+AR7(CAMERA_XYZR+2)\r
+       STF     R3,*+AR7(CAMERA_XYZR+3)\r
+       \r
+SMOOTH_VIEW:\r
+       CALL    ZOOM_CAMERA\r
+       CALL    FACE_FRONT\r
+\r
+       LDI     AR7,AR2\r
+       ADDI    CAMERA_XYZR,AR2\r
+       LDI     AR7,R2\r
+       ADDI    NEW_MATRIX,R2\r
+       LDI     AR7,R3\r
+       ADDI    NEW_POSX,R3\r
+       CALL    MATRIX_MUL\r
+\r
+       LDF     *+AR4(OPOSX),R0\r
+       SUBF    *+AR7(NEW_POSX),R0\r
+       STF     R0,*+AR7(NEW_POSX)\r
+\r
+       LDF     *+AR4(OPOSY),R0\r
+       ADDF    *+AR7(NEW_POSY),R0\r
+       STF     R0,*+AR7(NEW_POSY)\r
+\r
+       LDF     *+AR4(OPOSZ),R0\r
+       ADDF    *+AR7(NEW_POSZ),R0\r
+       STF     R0,*+AR7(NEW_POSZ)\r
+\r
+       LDI     *+AR4(OCARBLK),AR0\r
+       LDI     *+AR0(CARTRAK),AR0\r
+       LDI     *+AR0(OUSR1),R1\r
+       CMPI    AR5,R1\r
+       RETSLT\r
+       LDI     0,AR5\r
+\r
+;Put car back if it was removed\r
+       LDI     *+AR4(OFLAGS),R0        ;CHECK IF ALREADY ON LIST\r
+       TSTB    O_LIST_M,R0\r
+       BNZ     SMOOTH_VIEWX                    ;YES, DONT INSERT\r
+\r
+       STI     AR4,*+AR7(OBJINS)\r
+;      LDI     AR4,AR2\r
+;      CALL    OBJ_INSERT                      ;INSERT PLAYER OBJECT\r
+\r
+SMOOTH_VIEWX\r
+       RETS\r
+\r
+ZOOMACCEL      .float  0.006\r
+\r
+ZOOM_CAMERA:\r
+       LDI     *+AR7(CUT_PAN),R0\r
+       BNE     ZOOMX\r
+       LDF     *+AR7(ZOOMVEL),R0\r
+       ADDF    @ZOOMACCEL,R0\r
+       CMPF    0.2,R0\r
+       LDFGT   0.2,R0\r
+       STF     R0,*+AR7(ZOOMVEL)\r
+       LDI     AR7,AR0\r
+       ADDI    CAMERA_XYZR,AR0\r
+       LDI     AR7,AR1\r
+       ADDI    NEWCAMERA_XYZR,AR1\r
+       LDI     3,RC\r
+\r
+       RPTB    ZOOMLP\r
+       LDF     *AR1++,R2\r
+       SUBF    *AR0,R2\r
+       MPYF    R0,R2\r
+       ADDF    *AR0,R2\r
+ZOOMLP STF     R2,*AR0++\r
+\r
+       LDI     *+AR7(CAMERA_VIEW),R0\r
+       CMPI    0,R0\r
+       BNE     ZOOM1\r
+       ABSF    *+AR7(CAMERA_XYZR+2),R0\r
+       CMPF    100,R0\r
+       BGT     ZOOMX\r
+       LDI     *+AR4(OFLAGS),R0        ;CHECK IF ALREADY OFF LIST\r
+       TSTB    O_LIST_M,R0\r
+       BZ      ZOOMX                   ;YES, DONT DELETE\r
+       LDI     AR4,AR2         ;IN first person\r
+       CALL    OBJ_PULL\r
+       BR      ZOOMX\r
+ZOOM1\r
+       ABSF    *+AR7(CAMERA_XYZR+2),R0\r
+       CMPF    100,R0\r
+       BLT     ZOOMX\r
+       LDI     *+AR4(OFLAGS),R0        ;CHECK IF ALREADY ON LIST\r
+       TSTB    O_LIST_M,R0\r
+       BNZ     ZOOMX                   ;YES, DONT INSERT\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERT                      ;INSERT PLAYER OBJECT\r
+       LDI     1,R0\r
+       STI     R0,*+AR7(CUT_PAN)\r
+ZOOMX\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+\r
+*----------------------------------------------------------------------------\r
+* UPDATE_CAMERA\r
+*      INPUT   NEW_POSx/y/z,NEW_RADx/y/z,NEW_MATRIX\r
+*      OUTPUT  _CAMERAPOS,_CAMERAMATRIX,_CAMERARAD\r
+*\r
+UPDATE_CAMERA:\r
+       LDI     @_CAMERAPOSI,AR0\r
+       LDF     *+AR7(NEW_POSX),R0\r
+       STF     R0,*AR0\r
+       LDF     *+AR7(NEW_POSY),R0\r
+       STF     R0,*+AR0(Y)\r
+       LDF     *+AR7(NEW_POSZ),R0\r
+       STF     R0,*+AR0(Z)\r
+\r
+       LDP     @_CAMERARAD\r
+       LDF     *+AR7(NEW_RADX),R0\r
+       STF     R0,@_CAMERARAD\r
+       LDF     *+AR7(NEW_RADY),R0\r
+       STF     R0,@_CAMERARAD+Y\r
+       LDF     *+AR7(NEW_RADZ),R0\r
+       STF     R0,@_CAMERARAD+Z\r
+       SETDP\r
+\r
+       LDI     @CAMERAMATRIXI,AR0\r
+       LDI     AR7,AR1\r
+       ADDI    NEW_MATRIX,AR1\r
+\r
+       LDI     *+AR7(CUT_PAN),R0\r
+       BEQ     SMOOTH_MATRIX\r
+\r
+       LDI     8,RC\r
+       RPTB    loopA\r
+       LDF     *AR1++,R1\r
+loopA  STF     R1,*AR0++\r
+       BR      UPCAMX\r
+\r
+SMOOTH_MATRIX\r
+       LDI     8,RC\r
+       RPTB    loop\r
+       LDF     *AR0,R0\r
+       MPYF    0.20,R0\r
+       LDF     *AR1++,R1\r
+       MPYF    0.80,R1\r
+       ADDF    R0,R1\r
+loop   STF     R1,*AR0++\r
+\r
+UPCAMX\r
+       CALL    CAMERA_HORIZON_PROJECTION\r
+       LDI     0,R0\r
+       STI     R0,*+AR7(CUT_PAN)               ;Ok to smooth after this\r
+       RETS\r
+\r
+\r
+;*----------------------------------------------------------------------------\r
+;* MOVE_CAMERA\r
+;*\r
+;*     INPUT CAMERA_SPEED,CAMERA_VEC\r
+;*\r
+;\r
+;MOVE_CAMERA\r
+;      LDF     @NEW_CAMERA+CAMERA_SPEED,R0\r
+;      BEQ     no_movment\r
+;      LDI     @NEW_CAMERAI,R2\r
+;      ADDI    CAMERA_VECX,R2\r
+;      LDI     @MATRIXAI,AR2\r
+;      CALL    FIND_MATRIX\r
+;\r
+;      LDF     0,R0\r
+;      STF     R0,@VECTORA\r
+;      STF     R0,@VECTORA+1\r
+;      LDF     @NEW_CAMERA+CAMERA_SPEED,R0\r
+;      STF     R0,@VECTORA+2\r
+;\r
+;      LDI     @MATRIXAI,R2\r
+;      LDI     @VECTORAI,AR2\r
+;      LDI     AR2,R3\r
+;      CALL    MATRIX_MUL\r
+;\r
+;      LDF     @VECTORA,R0\r
+;      ADDF    @NEW_CAMERA+CAMERAX,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERAX\r
+;\r
+;      LDF     @VECTORA+1,R0\r
+;      ADDF    @NEW_CAMERA+CAMERAY,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERAY\r
+;\r
+;      LDF     @VECTORA+2,R0\r
+;      ADDF    @NEW_CAMERA+CAMERAZ,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERAZ\r
+;no_movment\r
+;      RETS\r
+;\r
+*----------------------------------------------------------------------------\r
+CAMERA_HORIZON_PROJECTION:\r
+       LDF     *+AR7(NEW_RADX),R2\r
+       CALL    _SINE\r
+\r
+       FLOAT   512,R1\r
+       MPYF    R1,R0\r
+       ADDF    *+AR7(CAMERA_INFIN),R0\r
+       STF     R0,@INFIN_CORRECT\r
+\r
+       RETS\r
+\r
+       .SECT "THEDATA"\r
+ATTR_WAVETAB   \r
+       .word   0,0\r
+       .word   L_LEG5_BEGIN+1,4\r
+       .word   L_LEG9_BEGIN+1,8\r
+       .word   L_LEG11_BEGIN+1,10\r
+       .word   0,0\r
+       .word   L_LEG5_BEGIN+1,4\r
+       .word   L_LEG9_BEGIN+1,8\r
+       .word   L_LEG11_BEGIN+1,10\r
+\r
+ATTR_WAVETAB_LEN       .set $-ATTR_WAVETAB-1\r
+       .text\r
+\r
+INIT_ATTR_LEG:\r
+       LDI     @ATTRWAVE,R0\r
+       BNE     NO_MUSIC\r
+\r
+       ;Wed Mar 8 11:02:10 1995\r
+       ;\r
+       ;\r
+       ;if COMMP ON  && SLAVE then no music\r
+       ;if COMMP ON && MASTER then send_attrsnd\r
+       ;if COMMP OFF do regular\r
+       ;\r
+       ;\r
+       LDI     @DIPRAM,R0\r
+       TSTB    DIP_COMMP,R0\r
+       BNZ     DOTEST\r
+       TSTB    CMDP_MASTER,R0\r
+       BNZ     NO_MUSIC\r
+\r
+       CALL    SEND_ATTRSND\r
+\r
+DOTEST\r
+       ;\r
+       ;\r
+       ;\r
+\r
+       READADJ ADJ_ATTRACT_MODE_SOUND\r
+       CMPI    0,R0\r
+       BEQ     NO_MUSIC\r
+       SOND1   ATTR_THEME\r
+NO_MUSIC\r
+\r
+       LDI     MATTR|MINFIN,R0\r
+       STI     R0,@_MODE\r
+\r
+       LDL     press_PALETTES,AR2      ;make sure these are gone\r
+       CALL    dealloc_section\r
+\r
+       LDI     0,R0                    ;NO CHALLENGE RACES IN ATTRACT MODE\r
+       STI     R0,@CHALLENGE_RACE\r
+\r
+       LDI     @ATTR_WAVETABI,AR1\r
+       ADDI    @ATTRWAVE,AR1\r
+\r
+\r
+       LDI     *AR1++,R0\r
+       STI     R0,@NEXT_STARTUP\r
+       LDI     *AR1,R1\r
+       STI     R1,@BONUS_WAVE\r
+\r
+       LDI     @BONUS_WAVE,AR0\r
+       ADDI    @FULLSETUP_TABLEI,AR0\r
+       LDI     *AR0,R0\r
+       CALLU   R0\r
+\r
+       LDF     @INFIN_CORRECT,R0\r
+       STF     R0,*+AR7(CAMERA_INFIN)\r
+\r
+       CALL    OBJ_INIT\r
+       CALL    INIT_DRONES     ;init DRONE tracker system\r
+       CALL    DYNAOBJ_INIT    ;init DYNAMIC OBJECTS\r
+       CALL    CARB_INIT       ;init CAR BLOCKS\r
+       CALL    INIT_RDDEBRIS   ;initialize ROAD DEBRIS list(s)\r
+\r
+       ;\r
+       ;RE INITIALIZE TRACK...\r
+       ;\r
+       LDI     @BONUS_WAVE,AR0\r
+       ADDI    @BONUS_POSTLAUNCHI,AR0\r
+       LDI     *AR0,R0\r
+       CALLU   R0\r
+\r
+       LDI     @NEXT_STARTUP,R0\r
+       STI     R0,@STARTSECTION\r
+       CALL    BGD_INIT\r
+\r
+       PUSH    AR7\r
+       LDI     UTIL_C|BACKGRND_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_FIND\r
+       LDI     AR0,AR7\r
+       LDI     3,R0\r
+       STI     R0,*+AR7(PTIME)\r
+       POP     AR7\r
+\r
+       LDI     *+AR7(PDATA),R0\r
+       STI     R0,@BGNDCOLA\r
+\r
+       LDI     1,R0\r
+       STI     R0,@NOAERASE\r
+       CLRI    R0\r
+       STI     R0,@OHIGH_PRIORITY\r
+\r
+       CREATE  WAVEFLAG,UTIL_C|MONKEY_T\r
+\r
+       CALL    ATTR_INIT_GAMELEG\r
+\r
+       LDI     MAX_DRONES,R0\r
+       STI     R0,@DD_MAX_DRONES\r
+\r
+       LDI     @ATTRWAVE,R0\r
+       ADDI    2,R0\r
+       CMPI    ATTR_WAVETAB_LEN-1,R0\r
+       LDIGT   0,R0\r
+       STI     R0,@ATTRWAVE\r
+\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+ATTR_INIT_GAMELEG:\r
+       CREATE  RHO_DISPATCHER,SPAWNER_C|TRAFFIC_T\r
+       CREATE  SIGMA_DISPATCHER,SPAWNER_C|TRAFFIC_T\r
+       CREATE  CPOINT_LIGHT,SPAWNER_C|COLORCYC_T\r
+       CREATE  POSITION_FINDER,SPAWNER_C|TRAFFIC_T\r
+\r
+       LDI     SM_HALT,R0\r
+       STI     R0,@SUSPEND_MODE\r
+\r
+       LDI     0,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+       LDI     1,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+\r
+       LDI     2,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+\r
+       LDI     3,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+\r
+       LDI     4,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+       STI     AR0,@PLYCAR\r
+\r
+       LDI     5,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+\r
+       LDI     6,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+       LDI     7,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+\r
+       LDI     9,R4\r
+       CREATE  RACER_DRONE,DRONE_C\r
+\r
+       RETS\r
+;*----------------------------------------------------------------------------\r
+;\r
+LOAD_ATTR_LEG:\r
+       LDI     @ATTRWAVE,AR0\r
+       ADDI    @ATTR_WAVETABI,AR0\r
+       LDI     *+AR0(1),AR0\r
+\r
+       .if DEBUG\r
+       CMPI    0,AR0\r
+       LDILT   0,AR0\r
+       CMPI    13,AR0\r
+       LDIGT   13,AR0\r
+       .endif\r
+\r
+       ADDI    @LOADSECTION_TABLEI,AR0\r
+       LDI     *AR0,R0\r
+       CALLU   R0\r
+       RETS\r
+\r
+*----------------------------------------------------------------------------\r
+*----------------------------------------------------------------------------\r
+*OLD CODE THAT I DEARLY LIKE TO REFFERENCE\r
+\r
+;*----------------------------------------------------------------------------\r
+;*TURN CAMERA TO FOLLOW OBJECT IN AR4\r
+;*\r
+;*PARAMETERS\r
+;*     AR4     OBJECT TO 'WATCH'\r
+;*\r
+;WATCH_OBJ:\r
+;      LDF     *+AR4(OPOSX),R2\r
+;      SUBF    @NEW_CAMERA+CAMERAX,R2\r
+;      LDF     *+AR4(OPOSZ),R3\r
+;      SUBF    @NEW_CAMERA+CAMERAZ,R3\r
+;      CALL    ARCTANF\r
+;      SUBF    HALFPI,R0\r
+;\r
+;      NEGF    R0,R2\r
+;      STF     R2,@NEW_CAMERA+CAMERARADY\r
+;\r
+;      LDF     *+AR4(OPOSZ),R0\r
+;      SUBF    @NEW_CAMERA+CAMERAZ,R0\r
+;      MPYF    R0,R0\r
+;      LDF     *+AR4(OPOSX),R1\r
+;      SUBF    @NEW_CAMERA+CAMERAX,R1\r
+;      MPYF    R1,R1\r
+;      ADDF3   R0,R1,R2        ;R= SQRT (X^2 + Z^2)\r
+;      CALL    SQRT\r
+;      LDF     R0,R3\r
+;\r
+;      LDF     *+AR4(OPOSY),R2\r
+;      SUBF    @NEW_CAMERA+CAMERAY,R2\r
+;\r
+;      CALL    ARCTANF\r
+;\r
+;      SUBF    HALFPI,R0\r
+;\r
+;      STF     R0,@NEW_CAMERA+CAMERARADX\r
+;\r
+;      LDI     @NEW_CAMERAI,R2\r
+;      ADDI    CAMERARADX,R2\r
+;      LDI     @NEW_CAMERAI,AR2\r
+;      ADDI    CAMERA_MATRIX,AR2\r
+;      CALL    FIND_MATRIX\r
+;\r
+;      CAll    CAMERA_HORIZON_PROJECTION\r
+;\r
+;      RETS\r
+;*----------------------------------------------------------------------------\r
+;INITFLYBY_VIEW:\r
+;      LDI     -1,R0\r
+;      STI     R0,*+AR7(CUT_PAN)\r
+;\r
+;      FLOAT   -4300,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERA_SPEED\r
+;\r
+;FLYBY_VIEW:\r
+;      LDF     @NEW_CAMERA+CAMERA_SPEED,R0\r
+;      FLOAT   150,R1\r
+;      ADDF    R1,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERA_SPEED\r
+;\r
+;      LDF     *+AR4(OPOSY),R0\r
+;      STF     R0,@NEW_CAMERA+CAMERAY\r
+;\r
+;      LDF     *+AR4(ORADY),R2\r
+;      ADDF    -1.54,R2\r
+;      CALL    _SINE\r
+;      FLOAT   500,R2\r
+;      MPYF    R0,R2\r
+;      LDF     *+AR4(OPOSX),R0\r
+;      ADDF    R2,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERAX\r
+;\r
+;      LDF     *+AR4(ORADY),R2\r
+;      ADDF    -1.54,R2\r
+;      CALL    _COSI\r
+;      FLOAT   500,R2\r
+;      MPYF    R0,R2\r
+;      LDF     *+AR4(OPOSZ),R0\r
+;      ADDF    R2,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERAZ\r
+;\r
+;      LDF     *+AR4(ORADY),R0\r
+;      SUBF    0.10,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERA_VECY\r
+;\r
+;      LDF     0.3,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERA_VECX\r
+;\r
+;      LDF     *+AR4(ORADZ),R0\r
+;      STF     R0,@NEW_CAMERA+CAMERA_VECZ\r
+;\r
+;      CALL    MOVE_CAMERA\r
+;\r
+;      LDF     *+AR4(OPOSY),R0\r
+;      FLOAT   -1500,R1                        ;FIX ELEVATION\r
+;      ADDF    R1,R0\r
+;      STF     R0,@NEW_CAMERA+CAMERAY\r
+;passed\r
+;      CALL    WATCH_OBJ\r
+;\r
+;      RETS\r
+\r
+       .END\r
diff --git a/AUDITS.ASM b/AUDITS.ASM
new file mode 100755 (executable)
index 0000000..9234d83
--- /dev/null
@@ -0,0 +1,374 @@
+;      .FILE   "AUDITS.ASM"\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*COPYRIGHT (C) 1994 BY  TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+\r
+\r
+       .include        C30.EQU\r
+       .include        MACS.EQU\r
+       .include        VUNIT.EQU\r
+       .include        CMOS.EQU\r
+       .include        SYSID.EQU\r
+       .include        SYS.EQU\r
+       .include        GLOBALS.EQU\r
+       .include        TEXT.EQU\r
+\r
+       .include        DIRQ.EQU\r
+       .include        DIAG.EQU\r
+       .include        ERROR.EQU\r
+\r
+\r
+\r
+       .text\r
+*----------------------------------------------------------------------------\r
+*DISPLAYABLE AUDITS\r
+*\r
+*      .word   AUDIT_#,string\r
+*\r
+*\r
+AUDENT .MACRO  AUDITI,ATEXT\r
+       .word   :AUDITI:,l?\r
+       .sect   "THEDATA"\r
+l?     .string ":ATEXT:",0\r
+       .text\r
+       .ENDM\r
+\r
+AUDENT_SPACER  .MACRO\r
+       .word   -3\r
+       .ENDM\r
+\r
+AUDENT_PAGE    .MACRO\r
+       .word   -1\r
+       .ENDM\r
+\r
+AUD_ROUTINE    .set    5Ah\r
+AUD_ROUTINEH   .set    5A0000h\r
+\r
+AUDENTR        .MACRO  AUDITI,ATEXT,ROUTINE\r
+       .word   AUD_ROUTINEH|:AUDITI:,:ROUTINE:,l?\r
+       .sect   "THEDATA"\r
+l?     .string ":ATEXT:",0\r
+       .text\r
+       .ENDM\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*RETURN\r
+*      R0      VALUE\r
+*\r
+COMPUTE_FREEGAMES_PRCNT:\r
+       READAUD AUD_GAMES_CONTINUES\r
+       LDI     R0,R1\r
+       READAUD AUD_GAMES_START\r
+       ADDI    R0,R1\r
+       LDIZ    R1,R0\r
+       RETSZ\r
+\r
+       READAUD AUD_TOTAL_FREEGAMES\r
+;      ADDI    R0,R1\r
+       MPYI    100,R0\r
+\r
+       CALL    DIV_I30\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*RETURN\r
+*      R0      VALUE\r
+*\r
+COMPUTE_GAMETIME:\r
+       READAUD AUD_GAMES_CONTINUES\r
+       LDI     R0,R1\r
+       READAUD AUD_GAMES_START\r
+       ADDI    R0,R1\r
+       READAUD AUD_GAMEON_TIME\r
+\r
+       CALL    DIV_I30\r
+       RETS\r
+\r
+       \r
+AUDIT_LIST\r
+       AUDENT  AUD_COIN1,"LEFT COIN"\r
+       AUDENT  AUD_COIN2,"RIGHT COIN"\r
+       AUDENT  AUD_COIN3,"THIRD COIN"\r
+       AUDENT  AUD_COIN4,"FOURTH COIN"\r
+       AUDENT  AUD_SERVICE_CREDITS,"SERVICE CREDITS"\r
+       AUDENT_SPACER\r
+\r
+       AUDENT  AUD_GAMES_START,"TOTAL STARTS"\r
+       AUDENT  AUD_GAMES_CONTINUES,"TOTAL CONTINUES"\r
+       AUDENT  AUD_H2HGAMES,"HEAD 2 HEAD GAMES"\r
+       AUDENT  AUD_TOTAL_FREEGAMES,"FREE RACES"\r
+       AUDENT  AUD_GAMES_EXPIRED,"EXPIRED RACES"\r
+       AUDENTR AUD_GAMEON_TIME,"FREE RACE PERCENTAGE",COMPUTE_FREEGAMES_PRCNT\r
+       AUDENT_SPACER\r
+\r
+;      AUDENT  ADJ_DIFFICULTY,"DIFFICULTY"\r
+;      AUDENT  ADJ_FIRST_PLACE_PERCENT,"1ST PLACE AUTO PERCENT"\r
+       AUDENT  AUD_POWERON_TIME,"POWER ON TIME SECS"\r
+       AUDENT  AUD_GAMEON_TIME,"GAME TIME SECS"\r
+       AUDENTR AUD_GAMEON_TIME,"AVERAGE GAME TIME SECS",COMPUTE_GAMETIME\r
+\r
+       AUDENT_PAGE\r
+       ;-------\r
+       \r
+\r
+       AUDENT  AUD_AUTOMATIC_TRANS_SELECTED,"AUTOMATIC SELECTED"\r
+       AUDENT  AUD_MANUAL_TRANS_SELECTED,"MANUAL SELECTED"\r
+       AUDENT_SPACER\r
+\r
+       AUDENT  AUD_VETTE_SELECTED,"63 MUSCLE SELECTED"\r
+       AUDENT  AUD_LABOMBA_SELECTED,"LABOMBA SELECTED"\r
+       AUDENT  AUD_DEVASTATOR_SELECTED,"DEVASTATOR SELECTED"\r
+       AUDENT  AUD_ITALIA_SELECTED,"ITALIA SELECTED"\r
+       AUDENT_SPACER\r
+       AUDENT  AUD_HID_JEEP_SELECTED,"JEEP SELECTED"\r
+       AUDENT  AUD_HID_COPCAR_SELECTED,"COPCAR SELECTED"\r
+       AUDENT_SPACER\r
+\r
+       AUDENT  AUD_VIEW1_TIME,"VIEW1 TIME SECS"\r
+       AUDENT  AUD_VIEW2_TIME,"VIEW2 TIME SECS"\r
+       AUDENT  AUD_VIEW3_TIME,"VIEW3 TIME SECS"\r
+       AUDENT_PAGE\r
+       ;-------\r
+\r
+       AUDENT  AUD_LOG_COUNT,"EVENT"\r
+       AUDENT  AUD_NUM_UNFINISHED,"U-GAMES"\r
+       AUDENT  AUD_NUM_WATCHDOGS,"WATCHDOGS"\r
+       AUDENT  AUD_SUCCESSFULL_BURNINS,"BURNIN LOOPS"\r
+       AUDENT_SPACER\r
+\r
+       AUDENT  ADJ_DIFFICULTY,"GAME DIFFICULTY"\r
+;      AUDENT  ADJ_DIFF_LOCAL,"LOCAL DIFFICULTY"\r
+;      AUDENT  ADJ_FIRST_PLACE_PERCENT,"1ST PLACE AUTOPERCENTAGE"\r
+;      AUDENT  ADJ_RAMP_PERCENTAGE,"RAMP PERCENTAGE"\r
+;      AUDENT  ADJ_RAMPGAMES,"AUTO RAMP GAMES"\r
+;      AUDENT  ADJ_RAMP_COUNT,"RAMP COUNT"\r
+       AUDENT_PAGE\r
+       ;-------\r
+\r
+       AUDENT  AUD_FS_AZ,"SELECT ARIZONA"\r
+       AUDENT  AUD_FS_US101,"SELECT US101"\r
+       AUDENT  AUD_FS_LA,"SELECT LA"\r
+       AUDENT  AUD_FS_IOWA,"SELECT IOWA"\r
+       AUDENT  AUD_FS_DV,"SELECT DEATH VALLEY"\r
+       AUDENT  AUD_FS_USA,"SELECT USA"\r
+       AUDENT  AUD_FS_BH,"SELECT BEVHILLS"\r
+       AUDENT  AUD_FS_APPL,"SELECT APPALACHIA"\r
+       AUDENT  AUD_FS_RW,"SELECT REDWOOD"\r
+       AUDENT  AUD_FS_RM,"SELECT RUSHMORE"\r
+       AUDENT  AUD_FS_CH,"SELECT CHICAGO"\r
+       AUDENT_SPACER\r
+\r
+       AUDENT  AUD_FS_HID_SF,"SELECT SANFRAN"\r
+       AUDENT  AUD_FS_HID_IN,"SELECT INDIANA"\r
+       AUDENT  AUD_FS_HID_GG,"SELECT GGATE"\r
+       AUDENT_PAGE\r
+       ;-------\r
+\r
+       AUDENT  AUD_START_GGATE,"START GGATE"\r
+       AUDENT  AUD_START_SF,"START SF"\r
+       AUDENT  AUD_START_US101,"START US101"\r
+       AUDENT  AUD_START_REDWOOD,"START REDWOOD"\r
+       AUDENT  AUD_START_BEVHILLS,"START BEVHILLS"\r
+       AUDENT  AUD_START_LA,"START LA"\r
+       AUDENT  AUD_START_DV,"START DV"\r
+       AUDENT  AUD_START_ARIZONA,"START ARIZONA"       \r
+       AUDENT  AUD_START_GC,"START GC"         \r
+       AUDENT  AUD_START_IOWA,"START IOWA"             \r
+       AUDENT  AUD_START_CHICAGO,"START CHICAGO"       \r
+       AUDENT  AUD_START_INDIANA,"START INDIANA"\r
+       AUDENT  AUD_START_APPALACHIA,"START APPALACHIA"\r
+       AUDENT  AUD_START_DC,"START DC"\r
+       AUDENT_PAGE\r
+       ;-------\r
+\r
+       AUDENT  AUD_WIN_GGATE,"GGATE WINS"\r
+       AUDENT  AUD_WIN_SF,"SANFRAN WINS"\r
+       AUDENT  AUD_WIN_US101,"US101 WINS"\r
+       AUDENT  AUD_WIN_REDWOOD,"REDWOOD WINS"\r
+       AUDENT  AUD_WIN_BEVHILLS,"BEVHILLS WINS"\r
+       AUDENT  AUD_WIN_LA,"LA WINS"\r
+       AUDENT  AUD_WIN_DV,"DEATHVALLEY WINS"\r
+       AUDENT  AUD_WIN_ARIZONA,"ARIZONA WINS"\r
+       AUDENT  AUD_WIN_GC,"GRAND CANYON WINS"\r
+       AUDENT  AUD_WIN_IOWA,"IOWA WINS"\r
+       AUDENT  AUD_WIN_CHICAGO,"CHICAGO WINS"\r
+       AUDENT  AUD_WIN_INDIANA,"INDIANA WINS"\r
+       AUDENT  AUD_WIN_APPALACHIA,"APPALACHIA WINS"\r
+       AUDENT  AUD_WIN_DC,"DC WINS"\r
+\r
+       AUDENT_PAGE\r
+       ;-------\r
+\r
+       .word   -2      ;end of list\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*AUDITS DISPLAY\r
+*\r
+       .bss    OLDDIP,1\r
+AUDIT_DISPLAY:\r
+       CALL    SETUP_DIAG_SCREEN\r
+\r
+       CLRI    AR4                     ;page index\r
+\r
+       LDI     DEFAULT_COLOR,RC\r
+       TEXTITT "HIT VOLUME UP FOR NEXT PAGE",50,330\r
+\r
+       LDI     @SOFT_AUDIT,R0\r
+       BNZ     KKLL\r
+\r
+       LDI     DEFAULT_COLOR,RC\r
+       TEXTITT "DIP SWITCH BANK 2 SELECTS COIN MODE",50,340\r
+\r
+       CALL    TOEXIT\r
+KKLL   IWINFR  10,40,400,220\r
+\r
+\r
+       LDL     AUDIT_LIST,AR5\r
+LYTL\r
+       FILL    12,42,398,218,COL_LGREY\r
+       LDI     50,R5\r
+\r
+       LDI     DEFAULT_COLOR,RC\r
+LLTT   LDI     *AR5++,AR2\r
+       CMPI    -1,AR2\r
+       BEQ     LLRR\r
+       CMPI    -2,AR2\r
+       BEQ     KKLL\r
+       CMPI    -3,AR2\r
+       BEQ     JJTTA\r
+\r
+\r
+       LDI     AR2,R0\r
+       RS      16,R0\r
+       CMPI    AUD_ROUTINE,R0\r
+       BNE     NOCALL\r
+       LDI     *AR5++,R0\r
+       CALLU   R0\r
+       BU      J22AB\r
+\r
+NOCALL CALL    AUDIT_READ\r
+\r
+J22AB  LDI     R0,R2\r
+       LDI     @bufferI,AR2\r
+       CALL    _itoa\r
+J22A\r
+\r
+       LDI     R5,R3\r
+       LDI     250,R2\r
+       LDI     DEFAULT_COLOR,RC\r
+       CALL    _outtextxyc\r
+\r
+       LDI     *AR5++,AR2\r
+       LDI     R5,R3\r
+       LDI     20,R2\r
+       LDI     DEFAULT_COLOR,RC\r
+       CALL    _outtextxyc\r
+JJTTA  ADDI    10,R5\r
+       BU      LLTT\r
+LLRR\r
+\r
+\r
+       LDI     0,R0\r
+       STI     R0,@OLDDIP\r
+\r
+WL2A\r
+       LDI     @DIPRAM,R0\r
+       LDI     @OLDDIP,R1\r
+       CMPI    R0,R1\r
+       BEQ     NODIPPLOT\r
+\r
+       STI     R0,@OLDDIP\r
+\r
+       LDI     50,AR2\r
+       LDI     240,R2\r
+       LDI     300,R3\r
+       LDI     249,RC\r
+       LDI     0,RS\r
+       CALL    _fill\r
+\r
+;      LDI     @SOFT_AUDIT,R0\r
+;      BZ      KKL7\r
+;\r
+;      CALL    GETCOINTXT\r
+;      LDI     AR0,AR2\r
+;      LDI     DEFAULT_COLOR,RC\r
+;      LDI     50,R2\r
+;      LDI     240,R3\r
+;      LDI     R0,AR0\r
+;      CALL    _outtextxyc\r
+;\r
+;KKL7\r
+\r
+NODIPPLOT\r
+       LDI     @_newbut,R0     ;old system method\r
+\r
+\r
+       LDI     @_newbut,R1             ;debounce\r
+       TSTB    SW_DIAG,R1              ;start to return to main\r
+       BZ      BOOKX\r
+\r
+       RS      16,R1\r
+       TSTB    SW_VIEW0_H,R1\r
+       BNZ     NOLOG\r
+\r
+       LDI     @SOFT_AUDIT,R0          ;OPERATOR MAY NOT VIEW THESE\r
+       BZ      NOLOG\r
+       CALL    ERROR_LOG_DISPLAY\r
+       BU      AUDIT_DISPLAY\r
+NOLOG\r
+\r
+       TSTB    SW_VOLPLUS,R0\r
+       BZ      DBNCE\r
+;      BZ      LYTL                    ;NEXT PAGE\r
+       TSTB    SW_VOLMINUS,R0\r
+       BNZ     FFB2\r
+;      BZ      LYTL                    ;NEXT PAGE\r
+\r
+DBNCE  NOT     @_newbut,R1             ;debounce\r
+       AND     SW_VOLPLUS|SW_VOLMINUS,R1\r
+       BNZ     DBNCE\r
+       BU      LYTL\r
+\r
+FFB2   TSTB    SW_VIEW2_H,R1           ;view2 to display next audit page\r
+       BNZ     KKLL5\r
+\r
+RB44   LDI     @_newbut,R1             ;debounce\r
+       RS      16,R1\r
+       TSTB    SW_VIEW2_H,R1           ;view2 to display next audit page\r
+       BZ      RB44\r
+       BU      LYTL                    ;NEXT PAGE\r
+KKLL5\r
+\r
+       LDI     @SOFT_AUDIT,R0\r
+       BZ      KKL\r
+       TSTB    SW_VIEW1_H,R1           ;VIEW1 TO EXIT TO GAME (IN SECRET MODE)\r
+       RETSZ\r
+KKL\r
+       BU      WL2A\r
+\r
+BOOKX\r
+\r
+WL266\r
+       NOT     @_newbut,R0\r
+       AND     SW_DIAG,R0\r
+       BNZ     WL266\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
diff --git a/BACKGRND.ASM b/BACKGRND.ASM
new file mode 100755 (executable)
index 0000000..b67d3ec
--- /dev/null
@@ -0,0 +1,2461 @@
+       .FILE   "BACKGRND.ASM"\r
+*----------------------------------------------------------------------------\r
+*BACKGROUND ALLOCATION/DEALLOCATION SYSTEM\r
+*\r
+*COPYRIGHT (C) 1994 BY  TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+       .include        MACS.EQU\r
+       .include        MPROC.EQU\r
+       .include        OBJ.EQU\r
+       .include        VUNIT.EQU\r
+       .include        CMOS.EQU\r
+       .include        SYSID.EQU\r
+       .include        SYS.EQU\r
+       .include        GLOBALS.EQU\r
+       .include        SNDTAB.EQU\r
+       .include        PALL.EQU\r
+       .include        OBJECTS.EQU\r
+       .include        CORNOBJ.EQU\r
+\r
+\r
+       .text\r
+\r
+       .bss    STARTSECTION,1          ;Section index to start game at\r
+       .bss    START_POS,3             ;Section X Y Z start (if DEBUGSECTION != 0)\r
+       .bss    START_RADY,1            ;Section Y Radian (if DEBUG SECTION != 0)\r
+\r
+\r
+       .bss    DRIVE_LIST,1            ;OBJECTs which can be driven over (road/shoulder)\r
+       .bss    CAR_LIST,1              ;OBJECTs which are vehicles (drones/player car)\r
+       .bss    SIGN_LIST,1             ;OBJECTs which are signs (posts, road signs, trees etc)\r
+       .bss    GROUND_LIST,1           ;OBJECTs which define the the ground but are not ROAD_C or SHLDR_C\r
+\r
+*----------------------------------------------------------------------------\r
+*DYNAMIC fLEX OBJECTS (THE ACTUAL ROAD OBJECTS (LIST))\r
+*\r
+*      OLINK2  GROUP SUBLINK (standard)\r
+*      OLINK4  DYNATRACK fLEX LINK\r
+*      OBLINK4 DYNATRACK fLEX BACK LINK  (== OPLINK)\r
+*      OUSR1   fLEX code\r
+*\r
+*\r
+NEW_GROUPI\r
+       .word   NEW_GROUP\r
+       .bss    NEW_GROUP,1     ;TEMP PTR TO START OF NEW DGROUP LIST\r
+\r
+\r
+DGROUPSI\r
+       .word   DGROUPS\r
+       .bss    DGROUPS,DGRP_SIZE*MAX_DGROUPS\r
+       .bss    DGROUP_COUNT,1          ;NUMBER OF ACTIVE BACKGRNDS (on DYNA LIST)\r
+       .bss    DGROUP_AW,1             ;activate watch pointer (->TYCO.ASM)\r
+\r
+\r
+\r
+       .bss    DYNALIST_TRUEBEGIN,1    ;FIRST ELEMENT OF DYNAFLEX LIST\r
+       .bss    DYNALIST_BEGIN,1        ;FIRST ELEMENT OF DYNAFLEX LIST (SECOND SET)\r
+       .bss    DYNALIST_END,1          ;LAST ELEMENT OF DYNAFLEX LIST\r
+       .bss    SUBLIST_BEGIN,1         ;FIRST ELEMENT OF SUBLIST (OLINK 3)\r
+       .bss    SUBLIST_END,1           ;LAST ELEMENT OF SUBLIST (OLINK 4)\r
+\r
+       .bss    STARTS,1\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       .bss    SECTIONIDX,1            ;section index (of next to activate)\r
+       .bss    TYCO_TRACK,1\r
+       .bss    TYCO_TRACK_NTL,1\r
+       .bss    TYCO_NTL_IDX,1\r
+\r
+\r
+ATTRACT_ACTIVATE_DIST  .float  15000\r
+ACTIVATE_DIST          .float  5000    ;to activate\r
+\r
+DACT_DIST              .float  80000   ;dynamic activate distance\r
+DDACT_DIST             .float  15000   ;dynamic activate distance (+ radius)\r
+;ATTR_DDACT_DIST               .float  35000   ;dynamic deactivate distance (+ radius)\r
+ATTR_DDACT_DIST                .float  45000   ;dynamic deactivate distance (+ radius)\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+FIND_STARTING_VALUES:\r
+       LDI     @TYCO_TRKI,AR1\r
+       LDI     @STARTSECTION,R0        ;first time dont do the crime\r
+       CMPI    0,R0\r
+       BEQ     NOWARP\r
+\r
+       LDI     R0,AR0\r
+       DEC     AR0\r
+\r
+LPP    LDI     *AR1++(6),R1\r
+       TSTB    1,R1\r
+       BZ      NOOVER\r
+       ADDI    1,AR1\r
+NOOVER TSTB    SC_REVERSE,R1\r
+       BZ      CNT\r
+       NOP     *AR1++(4)\r
+CNT    TSTB    SC_OVER2,R1\r
+       BZ      CNTN\r
+       NOP     *AR1++                  ;OVERLAY 2\r
+CNTN   DBU     AR0,LPP\r
+\r
+NOWARP\r
+       STI     AR1,@TYCO_TRACK\r
+       STI     AR1,@DGROUP_AW\r
+       STI     R0,@SECTIONIDX\r
+       STI     R0,@TYCO_NTL_IDX\r
+\r
+\r
+       LDF     *++AR1,R0\r
+       STF     R0,@START_POS\r
+       LDF     *++AR1,R0\r
+       STF     R0,@START_POS+Y\r
+       LDF     *++AR1,R0\r
+       STF     R0,@START_POS+Z\r
+       LDF     *++AR1,R2\r
+       STF     R2,@START_RADY\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*INITIALIZE the background system for the game\r
+*\r
+*\r
+BGD_INIT:\r
+       CLRI    R0\r
+       STI     R0,@DGROUP_COUNT\r
+       STI     R0,@DYNALIST_END\r
+       STI     R0,@DYNALIST_BEGIN\r
+       STI     R0,@SIGN_LIST\r
+       STI     R0,@TYCO_NTL_IDX\r
+\r
+;      LDI     @_MODE,R1\r
+;      AND     MMODE,R1\r
+;      CMPI    MATTR,R1\r
+;      BEQ     REGULAR_START           ;START AT WORLD BEGINING\r
+\r
+;      .if     DEBUG\r
+;      .globl  DEBUG_STARTSECTION\r
+;      .data\r
+;DEBUG_STARTSECTION    .word   0\r
+;      .text\r
+;      LDI     @DEBUG_STARTSECTION,R0\r
+;      BZ      L17\r
+;      STI     R0,@STARTSECTION\r
+;      .globl  SECTION_SETUP\r
+;      CALLNZ  SECTION_SETUP\r
+;L17\r
+;      .endif\r
+       \r
+\r
+       CALL    FIND_STARTING_VALUES\r
+       BU      KKTIL\r
+\r
+\r
+REGULAR_START                          ;kept for attract mode only\r
+       CLRI    R0\r
+       STI     R0,@SECTIONIDX\r
+       STI     R0,@TYCO_NTL_IDX\r
+\r
+       LDI     @TYCO_TRKI,R0\r
+       STI     R0,@TYCO_TRACK\r
+       STI     R0,@DGROUP_AW\r
+\r
+       CLRF    R0\r
+       STF     R0,@START_POS+X\r
+       STF     R0,@START_POS+Y\r
+       STF     R0,@START_POS+Z\r
+       STF     R0,@START_RADY\r
+\r
+\r
+KKTIL\r
+       LDI     @DGROUP_AW,AR2\r
+       LDI     AR2,AR0\r
+       CALL    BGD_ACTIVATE_TYCOGROUP  ;returns top pointer in R0\r
+       LDI     @DGROUPSI,AR1\r
+       STI     R0,*+AR1(DGRP_HEAD)     ;lead object (link by OLINK3)\r
+       STI     AR0,*+AR1(DGRP_BIN)     ;rom struct ptr\r
+       LDI     @STARTS,R0\r
+       STI     R0,*+AR1(DGRP_FSTART)\r
+       LDI     @SECTIONIDX,R0\r
+       STI     R0,*+AR1(DGRP_IDX)      ;SAVE THE INDEX #\r
+       STI     R0,@TYCO_NTL_IDX\r
+\r
+       LDI     @TYCOFLAG,R0\r
+       STI     R0,*+AR1(DGRP_FLAG)     ;SAVE THE TYCOFLAG\r
+\r
+\r
+       INCM    @DGROUP_COUNT\r
+\r
+       LDI     @DGROUP_AW,AR0\r
+       STI     AR0,@TYCO_TRACK_NTL\r
+       LDI     *AR0++(6),R1\r
+       TSTB    1,R1\r
+       BZ      NOOVERD\r
+       ADDI    1,AR0\r
+NOOVERD\r
+       TSTB    SC_REVERSE,R1\r
+       BZ      CNT55a\r
+       NOP     *AR0++(4)\r
+CNT55a TSTB    SC_OVER2,R1\r
+       BZ      NOO2a\r
+       ADDI    1,AR0\r
+NOO2a  STI     AR0,@DGROUP_AW\r
+\r
+\r
+       .if     DEBUG\r
+       LDI     @DGROUP_COUNT,R0\r
+       CMPI    1,R0\r
+       SLOCKON NE,"DGROUP\BACKGRND_INIT ERROR"\r
+       .endif\r
+\r
+       PUSH    AR6\r
+       LDI     @DGROUPSI,AR1\r
+       LDI     3,AR6\r
+LPP5\r
+       LDI     @DGROUP_AW,AR2\r
+       LDI     AR2,AR0\r
+       CALL    BGD_ACTIVATE_TYCOGROUP  ;returns top pointer in R0\r
+       STI     R0,*+AR1(DGRP_HEAD+DGRP_SIZE)   ;lead object (link by OLINK3)\r
+       STI     AR0,*+AR1(DGRP_BIN+DGRP_SIZE)   ;rom struct ptr\r
+       LDI     @STARTS,R0\r
+       STI     R0,*+AR1(DGRP_FSTART+DGRP_SIZE)\r
+       LDI     @SECTIONIDX,R0\r
+       STI     R0,*+AR1(DGRP_IDX+DGRP_SIZE)    ;SAVE THE INDEX #\r
+       LDI     @TYCOFLAG,R0\r
+       STI     R0,*+AR1(DGRP_FLAG+DGRP_SIZE)   ;SAVE THE TYCOFLAG\r
+\r
+       INCM    @DGROUP_COUNT\r
+\r
+       LDI     @DGROUP_AW,AR0\r
+       LDI     *AR0++(6),R1\r
+       TSTB    1,R1\r
+       BZ      NOOVERE\r
+       ADDI    1,AR0\r
+NOOVERE        TSTB    SC_REVERSE,R1\r
+       BZ      CNT55d\r
+       NOP     *AR0++(4)\r
+CNT55d TSTB    SC_OVER2,R1\r
+       BZ      NOO2d\r
+       ADDI    1,AR0\r
+NOO2d  STI     AR0,@DGROUP_AW\r
+\r
+       ADDI    DGRP_SIZE,AR1\r
+       DBU     AR6,LPP5\r
+       POP     AR6\r
+\r
+       CREATE  BGD_WATCHER,UTIL_C|BACKGRND_T\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*CONTROLLING PROCESS FOR THE DYNAMIC TRACK ALLOCATION SYSTEM\r
+*\r
+* CONTROLS:\r
+*      1)      WHEN ROUTINE IS CALLED\r
+*      2)      WHEN NEW SECTION IS LOADED\r
+*      3)      WHEN OLD SECTION IS DELETED\r
+*\r
+*\r
+BGD_SLP\r
+       SLEEP   1\r
+\r
+BGD_WATCHER:\r
+\r
+       LDI     @_MODE,R0\r
+       AND     MMODE,R0\r
+       CMPI    MGAME,R0\r
+       BEQ     LLKK\r
+       CMPI    MATTR,R0\r
+       BNE     BGD_SLP\r
+LLKK\r
+\r
+       ;--------------------------------------------------------------------\r
+       ;CHECK #1:      HAVE WE CROSSED A THRESHOLD?\r
+       ;\r
+       ;if (distance_to(THRESHOLD_POS) < ACTIVATE_DIST)\r
+       ;       CALL    routine\r
+       ;       increment THRESHOLD CHECK PTR\r
+       ;\r
+       ;New Method::\r
+       ;       if Closest Road Piece ROAD_ID (OUSR1) > Checkpoint ROAD_ID\r
+       ;               CALL    routine\r
+       ;               increment THRESHOLD CHECK PTR\r
+       ;\r
+       LDI     @_MODE,R0\r
+       AND     MMODE,R0\r
+       CMPI    MGAME,R0\r
+       BNE     NO_ACTIVATION\r
+\r
+       LDI     @PLYCBLK,AR0\r
+       LDI     *+AR0(CARTRAK),AR0\r
+       LDI     *+AR0(OUSR1),R0\r
+       LDI     @TYCO_NTL_IDX,R1\r
+       LS      8,R1\r
+       CMPI    R1,R0\r
+       BLT     NO_ACTIVATION\r
+       ;blah.asm\r
+\r
+       LDI     @TYCO_TRACK_NTL,AR2\r
+       LDI     *AR2,AR0\r
+       RS      16,AR0\r
+       AND     0FFh,AR0\r
+       LDI     AR0,R0\r
+       CALLNZ  SECTION_ROUTINE\r
+\r
+\r
+       LDI     @TYCO_NTL_IDX,R0\r
+       INC     R0\r
+       STI     R0,@TYCO_NTL_IDX\r
+\r
+       LDI     @TYCO_TRACK_NTL,AR1\r
+       LDI     *AR1++(6),R1\r
+       TSTB    1,R1\r
+       BZ      NOOVERA\r
+       ADDI    1,AR1\r
+NOOVERA        TSTB    SC_REVERSE,R1\r
+       BZ      CNTFF\r
+       NOP     *AR1++(4)\r
+CNTFF  TSTB    SC_OVER2,R1\r
+       BZ      NOO2FF\r
+       ADDI    1,AR1\r
+NOO2FF STI     AR1,@TYCO_TRACK_NTL\r
+\r
+\r
+       ;in the end we probably want this check to insure we dont\r
+       ;continue trying to allocated beyond the end of the defined game\r
+       ;although this can also be done by a routine...\r
+       ;\r
+;      LDI     @SECTIONIDX,R1\r
+;      LDI     @TYCO_LENGTH,R0\r
+;      CMPI    R0,R1\r
+;      BGE     SUICIDE\r
+NO_ACTIVATION\r
+\r
+\r
+\r
+       ;--------------------------------------------------------------------\r
+       ;CHECK #2:      SHOULD THE NEXT SECTION BE ACTIVATED?\r
+       ;\r
+       ;if (distance_to(DGROUP_AW) < DACT_DIST)\r
+       ;       CALL    BGD_ACTIVATE_TYCOGROUP(AR2 <- GROUP_POINTER)\r
+       ;       SETUP DGROUP STRUCTURE  (APPEND TO END OF LIST)\r
+       ;       INCM    @DGROUP_COUNT\r
+       ;       increment DGROUP_AW     //DGROUP ACTIVATE WATCH\r
+       ;\r
+       ;\r
+       LDI     @DGROUP_AW,AR0\r
+       LDI     AR0,AR2\r
+       ADDI    1,AR2\r
+       LDI     @CAMERAPOSI,R2\r
+       CALL    GET_XZ_DISTANCE\r
+\r
+       CMPF    @DACT_DIST,R0\r
+       BGT     NOACT\r
+\r
+       LDI     AR0,AR2\r
+       CALL    BGD_ACTIVATE_TYCOGROUP  ;returns top pointer in R0\r
+\r
+       LDI     @DGROUP_COUNT,AR1\r
+       MPYI    DGRP_SIZE,AR1\r
+       ADDI    @DGROUPSI,AR1\r
+       STI     R0,*+AR1(DGRP_HEAD)     ;lead object (link by OLINK3)\r
+       STI     AR0,*+AR1(DGRP_BIN)     ;rom struct ptr\r
+       LDI     @SECTIONIDX,R0\r
+       STI     R0,*+AR1(DGRP_IDX)      ;SAVE THE INDEX #\r
+       LDI     @TYCOFLAG,R0\r
+       STI     R0,*+AR1(DGRP_FLAG)     ;SAVE THE TYCOFLAG\r
+\r
+       LDI     @STARTS,R0\r
+       STI     R0,*+AR1(DGRP_FSTART)\r
+\r
+       INCM    @DGROUP_COUNT\r
+\r
+\r
+       LDI     *AR0++(6),R1\r
+       TSTB    1,R1\r
+       BZ      NOOVERB\r
+       ADDI    1,AR0\r
+NOOVERB        TSTB    SC_REVERSE,R1\r
+       BZ      CNT55\r
+       NOP     *AR0++(4)\r
+CNT55  TSTB    SC_OVER2,R1\r
+       BZ      NOO2\r
+       ADDI    1,AR0\r
+NOO2   STPI    AR0,@DGROUP_AW\r
+\r
+\r
+NOACT  ;end of activation routine\r
+\r
+\r
+\r
+       ;--------------------------------------------------------------------\r
+       ;CHECK #3:      SHOULD THE OLDEST SECTION BE DEACTIVATED?\r
+       ;\r
+       ;if (distance_to(THRESHOLD_POS) < DACT_DIST)\r
+       ;       CALL  GROUP_DELETE\r
+       ;       PACK DGROUP STRUCTURES\r
+       ;       DECM    @DGROUP_COUNT\r
+       ;       increment DGROUP_AW     //DGROUP ACTIVATE WATCH\r
+       ;\r
+       ;\r
+       LDI     @(DGROUPS+DGRP_BIN),AR2\r
+       INC     AR2\r
+       LDI     @CAMERAPOSI,R2\r
+       CALL    GET_XZ_DISTANCE\r
+\r
+\r
+       LDI     @(DGROUPS+DGRP_BIN),AR0\r
+       LDI     *+AR0(TB_GROUP),AR0\r
+       SUBF    *AR0,R0\r
+\r
+       LDI     @_MODE,R1\r
+       AND     MMODE,R1\r
+       CMPI    MATTR,R1\r
+       BNE     GAMECHK\r
+\r
+       CMPF    @ATTR_DDACT_DIST,R0\r
+       BLT     NODEACT\r
+       BU      DO_DEL\r
+\r
+GAMECHK        CMPF    @DDACT_DIST,R0\r
+       BLT     NODEACT\r
+\r
+DO_DEL\r
+       LDI     @(DGROUPS+DGRP_HEAD),AR2\r
+       CALL    GROUP_DELETE\r
+\r
+       LDI     @(DGROUPS+DGRP_SIZE+DGRP_FSTART),AR2\r
+       STI     AR2,@DYNALIST_BEGIN\r
+       STI     AR2,@DYNALIST_TRUEBEGIN\r
+       CLRI    R0\r
+       STI     R0,*+AR2(OBLINK4)       ;NULL TERMINATE BACK LINK ON LIST\r
+\r
+\r
+\r
+       ;REPACK DGROUP SECTIONS\r
+       ;\r
+       ;for i = 1 to dgroup_count\r
+       ;       memcpy(dgroup[i-1], dgroup[i], sizeof(dgroup))\r
+       ;\r
+       LDI     @DGROUP_COUNT,RC\r
+       SUBI    2,RC\r
+       .if     DEBUG\r
+       CMPI    0,RC\r
+       SLOCKON LT,"BACKGRND\LBACK_WATCH ERROR"\r
+       .endif\r
+       BLT     SHIFT1\r
+       LDI     @DGROUPSI,AR0\r
+       LDI     AR0,AR1\r
+       ADDI    DGRP_SIZE,AR1\r
+\r
+\r
+       RPTB    LL45\r
+SHIFT1 LDI     *AR1++,R0\r
+       STI     R0,*AR0++\r
+\r
+       LDI     *AR1++,R0\r
+       STI     R0,*AR0++\r
+\r
+       LDI     *AR1++,R0\r
+       STI     R0,*AR0++\r
+\r
+       LDI     *AR1++,R0\r
+       STI     R0,*AR0++\r
+\r
+       LDI     *AR1++,R0\r
+LL45   STI     R0,*AR0++\r
+\r
+\r
+       DECM    @DGROUP_COUNT\r
+NODEACT\r
+\r
+       .if     DEBUG\r
+       ;DEBUGGING CHECK TO VERIFY THAT WE NEVER EXCEED\r
+       ;THE AMOUNT OF DGROUPs WE CAN HANDLE\r
+       ;\r
+       LDI     @DGROUP_COUNT,R0\r
+       SLOCKON LE,"BACKGRND\LBACK_WATCH ERRONEOUS DGROUP_COUNT LE"\r
+       CMPI    MAX_DGROUPS,R0\r
+       SLOCKON GE,"BACKGRND\LBACK_WATCH ERRONEOUS DGROUP_COUNT GE"\r
+       .endif\r
+\r
+       SLEEP   3\r
+       B       BGD_WATCHER\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*ACTIVATE A TYCO GROUP (ROAD PIECES ARE LINKED, ETC.)\r
+*\r
+*PARAMETERS\r
+*      AR2     PTR TO TYCO BLOCK\r
+*\r
+*\r
+*\r
+NEWSUBLIST_TOP .word   NEWSUBLIST_TOPB\r
+       .bss    NEWSUBLIST_TOPB,1       ;POINTER TO TOP OF SUBLIST (OF GROUP)\r
+       .bss    GROUP_RADY,1    ;CURRENT SUBLIST Y RADIAN\r
+       .bss    TYCOFLAG,1      ;CURRENT SUBLIST TYCOFLAG (FROM ROM)\r
+       .bss    PASS1,1         ;CURRENT PASS INDEX (0,1) (USED WHEN ACTIVATING AN OVERLAY)\r
+       .bss    SECRADY,1       ;SECTION RADIAN Y\r
+\r
+BGD_ACTIVATE_TYCOGROUP:\r
+       PUSH    R4\r
+       PUSH    R5\r
+       PUSH    AR0\r
+       PUSH    AR1\r
+       PUSH    AR2\r
+       PUSH    AR4\r
+       PUSH    AR5\r
+       PUSH    AR7\r
+\r
+       LDI     @SECTIONIDX,R0\r
+       INC     R0\r
+       STI     R0,@SECTIONIDX\r
+\r
+*CORNFLAKE CHECK\r
+       CMPI    4,R0\r
+       BNE     NOTCORNFLAKE\r
+\r
+       PUSH    AR4\r
+       LDL     cornpops,AR2\r
+       LDI     6700,R2\r
+       LDI     -4250,R3\r
+       LDI     32600,RC\r
+       .data\r
+LVAL   .word   151720\r
+       .text\r
+       ADDI    @LVAL,RC\r
+       CALL    OBJ_QMAKE\r
+       LDI     AR0,AR4\r
+\r
+       LDF     -0.2,R2\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    FIND_YMATRIX\r
+\r
+       LDI     *+AR4(OFLAGS),R0\r
+       OR      O_1PAL,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+       LDL     CORNPAL,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR4(OPAL)\r
+\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERT\r
+\r
+       LDI     @SECTIONIDX,R0\r
+       LS      8,R0\r
+       OR      0AAh,R0\r
+       STI     R0,*+AR4(OLINK2)\r
+       POP     AR4\r
+\r
+NOTCORNFLAKE\r
+*CORNFLAKE END CHECK\r
+\r
+\r
+       LDI     -1,R0\r
+       STI     R0,@SUBLIST_BEGIN\r
+\r
+       CLRI    R0\r
+       STI     R0,@PASS1\r
+       STI     R0,@NEW_GROUP\r
+\r
+       LDI     @TYCO_TRACK,AR2\r
+       LDI     AR2,AR7                         ;DEDICATED POINTER\r
+       LDI     *AR7,R0                         ;LOAD FLAG\r
+       STI     R0,@TYCOFLAG\r
+\r
+\r
+       TSTB    SC_OVERLAY,R0\r
+       BZ      NOVRDD\r
+       ADDI    1,AR2\r
+NOVRDD TSTB    SC_REVERSE,R0\r
+       BZD     REG_LD\r
+       NOP\r
+       ADDI    TB_REGSIZE-1,AR2\r
+       STI     AR2,@TYCO_TRACK\r
+       ;---->  BZD     REG_LD\r
+\r
+       ADDI    TB_RVSSIZE-TB_REGSIZE,AR2       ;REVERSED SECTION HAS LARGER STRUCTURE\r
+       STI     AR2,@TYCO_TRACK\r
+REG_LD TSTB    SC_OVER2,R0                     ;hopefully...\r
+       BZ      NOEXTRA\r
+       LDI     @TYCO_TRACK,R0\r
+       INC     R0\r
+       STI     R0,@TYCO_TRACK\r
+NOEXTRA\r
+       LDF     *+AR7(TB_RADY),R0\r
+       STF     R0,@SECRADY\r
+\r
+\r
+       LDI     @MATRIXAI,AR2           ;Group rotation matrix\r
+       LDF     @SECRADY,R2\r
+       CALL    HPFIND_YMATRIX          ;require High Precision\r
+\r
+       LDI     *+AR7(TB_GROUP),AR5     ;Group pointer\r
+       ADDI    1,AR5                   ;skip radius\r
+\r
+\r
+       LDI     @SECTIONIDX,R0\r
+       LS      8,R0\r
+       OR      0AAh,R0\r
+       STI     R0,@NEWSUBLIST_TOPB\r
+\r
+       PUSH    R0\r
+\r
+       LDI     *AR5++,R4               ;get number of objects to load\r
+       SLOCKON LE,"BACKGRND 1"\r
+       SUBI    1,R4\r
+\r
+       CMPI    @OFREECNT,R4\r
+       SLOCKON GT,"BACKGRND\ACTIVATE TYCOGROUP OUT OF OBJECTS"\r
+L12\r
+\r
+       LDI     *AR5++,AR2              ;GET MODEL PTR\r
+       CALL    OBJ_GETE\r
+       SLOCKON C,"BACKGRND\ACTIVATE   DANGER ERROR *FATAL*"\r
+       BC      ACTIVATE_X\r
+                                       ;INTERNAL LINK (FOR DEALLOCATION)\r
+       LDI     AR0,AR4                 ;SET OBJECT ROM PTR\r
+\r
+       POP     R0                      ;GET LAST BACK LINK\r
+       STI     R0,*+AR4(OLINK2)\r
+       PUSH    R0\r
+\r
+\r
+       FLOAT   *AR5++,R1               ;GET X POSITION\r
+       STF     R1,*+AR4(OPOSX)\r
+       FLOAT   *AR5++,R1               ;GET Y POSITION\r
+       LDI     @TYCOFLAG,R0\r
+       TSTB    SC_REVERSE,R0\r
+       BZD     NOTREVERSED\r
+       STF     R1,*+AR4(OPOSY)\r
+       FLOAT   *AR5++,R1               ;GET Z POSITION\r
+       STF     R1,*+AR4(OPOSZ)\r
+       ;---->BZD       NOTREVERSED\r
+\r
+\r
+       ;\r
+       ;       SPECIAL REVERSED CASE\r
+       ;\r
+       PUSH    AR7\r
+       TSTB    SC_OVERLAY,R0\r
+       BNZ     ISOVER\r
+       DEC     AR7\r
+ISOVER\r
+\r
+       LDF     *+AR7(TB_RVS_POSX),R0   ;TRANSLATE BY THE NEGATIVE OFFSET\r
+       ADDF    *+AR4(OPOSX),R0         ;POSITION (THIS BLOCKS ENDING POSITION)\r
+       STF     R0,*+AR4(OPOSX)         \r
+       LDF     *+AR7(TB_RVS_POSY),R0\r
+       ADDF    *+AR4(OPOSY),R0\r
+       STF     R0,*+AR4(OPOSY)\r
+       LDF     *+AR7(TB_RVS_POSZ),R0\r
+       ADDF    *+AR4(OPOSZ),R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+       POP     AR7\r
+\r
+\r
+\r
+       LDI     @MATRIXAI,R2\r
+       LDI     AR4,AR2\r
+       ADDI    OPOSX,AR2\r
+       LDI     @VECTORAI,R3\r
+       CALL    MATRIX_MUL              ;rotation by occurance matrix\r
+\r
+\r
+       LDI     @VECTORAI,AR0\r
+       LDF     *AR0++,R1\r
+       ADDF    *+AR7(TB_POSX),R1\r
+       STF     R1,*+AR4(OPOSX)\r
+       LDF     *AR0++,R1\r
+       ADDF    *+AR7(TB_POSY),R1\r
+       STF     R1,*+AR4(OPOSY)\r
+       LDF     *AR0++,R1\r
+       ADDF    *+AR7(TB_POSZ),R1\r
+       STF     R1,*+AR4(OPOSZ)\r
+\r
+\r
+       LDF     *AR5++,R2               ;GET Y ROT\r
+       ADDF    @SECRADY,R2\r
+       STF     R2,*+AR4(ORADY)\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    HPFIND_YMATRIX\r
+       BU      JOIN_UP\r
+\r
+\r
+NOTREVERSED\r
+       LDI     @MATRIXAI,R2\r
+       LDI     AR4,AR2\r
+       ADDI    OPOSX,AR2\r
+       LDI     R2,R3\r
+       LDI     @VECTORAI,R3\r
+       CALL    MATRIX_MUL              ;ROTATION BY OCCURANCE MATRIX\r
+\r
+\r
+       LDI     @VECTORAI,AR0\r
+       LDF     *AR0++,R1\r
+       ADDF    *+AR7(TB_POSX),R1\r
+       STF     R1,*+AR4(OPOSX)\r
+       LDF     *AR0++,R1\r
+       ADDF    *+AR7(TB_POSY),R1\r
+       STF     R1,*+AR4(OPOSY)\r
+       LDF     *AR0++,R1\r
+       ADDF    *+AR7(TB_POSZ),R1\r
+       STF     R1,*+AR4(OPOSZ)\r
+\r
+\r
+       LDF     *AR5++,R2               ;SET THE RADIANS FOR THE OBJECT\r
+       ADDF    @SECRADY,R2\r
+       STF     R2,*+AR4(ORADY)\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    HPFIND_YMATRIX\r
+\r
+JOIN_UP\r
+       LDI     *AR5++,R1               ;LOAD OBJECT ID (GENV STYLE)\r
+       LDI     R1,R2\r
+       AND     CLASS_M|TYPE_M|SUBTYPE_M,R1\r
+       STI     R1,*+AR4(OID)\r
+\r
+\r
+\r
+       ;TEST TO SEE IF WE SHOULD CALL A SPECIAL ROUTINE\r
+       ;OR PALETTE SHIFT\r
+       ;\r
+       TSTB    BGD_ROUTINE,R2\r
+       CALLNZ  BGD_OROUTINE\r
+\r
+\r
+\r
+       LDI     R2,R0\r
+       RS      16,R2\r
+       AND     O_GENVSPEC,R2           ;make sure list data is not ORed in\r
+\r
+       TSTB    BGD_BIGOBJ,R0           ;BIG OBJECT TEST\r
+       BZ      NOTBIGOBJ\r
+       LDI     1,R0\r
+       LS      O_BIGOBJECT_B,R0\r
+       OR      R0,R2\r
+NOTBIGOBJ\r
+\r
+       OR      *+AR4(OFLAGS),R2        ;or in the flags\r
+       STI     R2,*+AR4(OFLAGS)\r
+\r
+\r
+\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERT                      ;INSERT THE BABE\r
+\r
+\r
+\r
+\r
+       ;NOW FIND IF THE OBJECT BELONGS IN A SUPPLIMENTAL\r
+       ;LIST. \r
+       ;OID =  x3xx    -> DRIVE_SUPP\r
+       ;       x4xx    -> BUILD_SUPP\r
+       ;\r
+       LDI     *+AR4(OID),R0\r
+       AND     CLASS_M,R0\r
+       CMPI    ROAD_C,R0\r
+       BNE     NOTDRIVE\r
+\r
+       LDI     @DRIVE_LIST,AR0\r
+       STI     AR0,*+AR4(OLINK3)\r
+       STI     AR4,@DRIVE_LIST\r
+\r
+       LDI     1,R1\r
+       BUD     DONELISTS\r
+       LS      28,R1                   ;O_ROAD_SUPP\r
+       OR      *+AR4(OFLAGS),R1\r
+       STI     R1,*+AR4(OFLAGS)\r
+NOTDRIVE\r
+\r
+       CMPI    GROUND_C,R0\r
+       BNE     NOTGROUND\r
+       LDI     @GROUND_LIST,AR0\r
+       STI     AR0,*+AR4(OLINK3)\r
+       STI     AR4,@GROUND_LIST\r
+       LDI     1,R1\r
+       LS      O_GROUND_B,R1\r
+       OR      *+AR4(OFLAGS),R1\r
+       STI     R1,*+AR4(OFLAGS)\r
+       B       DONELISTS\r
+NOTGROUND\r
+\r
+       CMPI    TSIGN_C,R0\r
+       BNE     NOTSIGN\r
+       LDI     @SIGN_LIST,AR0\r
+       STI     AR0,*+AR4(OLINK3)\r
+       STI     AR4,@SIGN_LIST\r
+       LDI     1,R1\r
+       LS      O_SIGN_SUPP_B,R1\r
+       OR      *+AR4(OFLAGS),R1\r
+       STI     R1,*+AR4(OFLAGS)\r
+       B       DONELISTS\r
+NOTSIGN\r
+\r
+       CMPI    0B00h,R0\r
+       BNE     NOTDYNAROAD\r
+\r
+       ;\r
+       ;add this element to dynamic fLEX list\r
+       ;\r
+\r
+       LDI     @SECTIONIDX,R1\r
+       LS      8,R1\r
+\r
+       LDI     *+AR4(OID),R0\r
+       AND     0FFh,R0\r
+\r
+       LDI     @TYCOFLAG,R2                    ;in the case of reversed track\r
+       TSTB    SC_REVERSE,R2                   ;we say the index value is\r
+       BZ      NOTRVSTRK                       ;255 - index\r
+       SUBRI   255,R0                          ;\r
+NOTRVSTRK                                      ;\r
+\r
+       OR      R1,R0\r
+       STI     R0,*+AR4(OUSR1)\r
+\r
+       LDI     0300h,R0\r
+       STI     R0,*+AR4(OID)\r
+\r
+\r
+       LDI     @DRIVE_LIST,AR0\r
+       STI     AR0,*+AR4(OLINK3)\r
+       STI     AR4,@DRIVE_LIST\r
+\r
+       LDI     1,R1\r
+       LS      O_DRIVE_SUPP_B,R1\r
+       OR      *+AR4(OFLAGS),R1\r
+       STI     R1,*+AR4(OFLAGS)\r
+\r
+       CALL    ADD_TO_NEWLIST\r
+       BU      DONELISTS\r
+NOTDYNAROAD\r
+\r
+\r
+DONELISTS\r
+       SUBI    1,R4\r
+       BGE     L12\r
+\r
+ACTIVATE_X\r
+       POP     AR0                     ;clear stack of last item\r
+\r
+       LDI     @PASS1,R0\r
+       BNZ     CHECK2\r
+\r
+       LDI     1,R0\r
+       STI     R0,@PASS1\r
+\r
+       LDI     *AR7,R0                 ;load flag\r
+       TSTB    SC_OVERLAY,R0\r
+       BZ      CHECK2II\r
+\r
+\r
+       LDI     *+AR7(TB_GROUPOVERLAY),AR5      ;Group pointer\r
+       ADDI    1,AR5                   ;skip radius\r
+\r
+       LDI     @NEWSUBLIST_TOPB,R0\r
+       PUSH    R0\r
+\r
+       LDI     *AR5++,R4               ;get number of objects to load\r
+       SLOCKON LE,"BACKGRND  ERRONEOUS GROUP LOADED"\r
+       SUBI    1,R4\r
+\r
+       CMPI    @OFREECNT,R4\r
+       SLOCKON GT,"BACKGRND\ACTIVATE TYCOGROUP OUT OF OBJECTS 2"\r
+       BU      L12\r
+CHECK2\r
+       CMPI    2,R0\r
+       BEQ     NOOVERLAYGROUP\r
+\r
+       LDI     2,R0\r
+       STI     R0,@PASS1\r
+\r
+       LDI     *AR7,R0                 ;load flag\r
+       TSTB    SC_OVER2,R0\r
+       BZ      NOOVERLAYGROUP\r
+\r
+       PUSH    IR0\r
+       TSTB    SC_REVERSE,R0\r
+       LDIZ    TB_GROUPOVERLAY+1,IR0\r
+       LDINZ   TB_GROUPOVERLAY+5,IR0\r
+\r
+       LDI     *+AR7(IR0),AR5  ;Group pointer\r
+       ADDI    1,AR5                   ;skip radius\r
+\r
+       TSTB    SC_REVERSE,R0\r
+       BZ      UHNO2\r
+\r
+       TSTB    SC_OVERLAY,R0\r
+       LDIZ    TB_RVS_RADY-1,IR0\r
+       LDINZ   TB_RVS_RADY,IR0\r
+       LDF     *+AR7(IR0),R0\r
+       STPF    R0,@SECRADY\r
+UHNO2\r
+\r
+       POP     IR0\r
+\r
+\r
+       LDI     @TYCOFLAG,R0            ;overlay 2 is not reversed - EVER!\r
+       ANDN    SC_REVERSE,R0\r
+       STI     R0,@TYCOFLAG\r
+\r
+\r
+       LDI     @NEWSUBLIST_TOPB,R0\r
+       PUSH    R0\r
+\r
+       LDI     *AR5++,R4               ;get number of objects to load\r
+       SLOCKON LE,"BACKGRND  ERRONEOUS GROUP LOADED OVER2"\r
+       SUBI    1,R4\r
+\r
+       CMPI    @OFREECNT,R4\r
+       SLOCKON GT,"BACKGRND\ACTIVATE TYCOGROUP OUT OF OBJECTS 2"\r
+       BU      L12\r
+\r
+\r
+CHECK2II\r
+       CMPI    2,R0\r
+       BEQ     NOOVERLAYGROUP\r
+\r
+       LDI     2,R0\r
+       STI     R0,@PASS1\r
+\r
+       LDI     *AR7,R0                 ;load flag\r
+       TSTB    SC_OVER2,R0\r
+       BZ      NOOVERLAYGROUP\r
+\r
+       PUSH    IR0\r
+       TSTB    SC_REVERSE,R0\r
+       LDIZ    TB_GROUPOVERLAY,IR0\r
+       LDINZ   TB_GROUPOVERLAY+4,IR0\r
+\r
+\r
+       LDI     *+AR7(IR0),AR5          ;Group pointer\r
+\r
+\r
+       TSTB    SC_REVERSE,R0\r
+       BZ      UHNO\r
+\r
+       TSTB    SC_OVERLAY,R0\r
+       LDIZ    TB_RVS_RADY-1,IR0\r
+       LDINZ   TB_RVS_RADY,IR0\r
+       LDF     *+AR7(IR0),R0\r
+       STPF    R0,@SECRADY\r
+UHNO\r
+\r
+       POP     IR0\r
+       ADDI    1,AR5                   ;skip radius\r
+\r
+\r
+       LDI     @TYCOFLAG,R0            ;overlay 2 is not reversed - EVER!\r
+       ANDN    SC_REVERSE,R0\r
+       STI     R0,@TYCOFLAG\r
+\r
+       LDI     @NEWSUBLIST_TOPB,R0\r
+       PUSH    R0\r
+\r
+       LDI     *AR5++,R4               ;get number of objects to load\r
+       SLOCKON LE,"BACKGRND  ERRONEOUS GROUP LOADED OVER2"\r
+       SUBI    1,R4\r
+\r
+       CMPI    @OFREECNT,R4\r
+       SLOCKON GT,"BACKGRND\ACTIVATE TYCOGROUP OUT OF OBJECTS 2"\r
+       BU      L12\r
+\r
+\r
+NOOVERLAYGROUP\r
+\r
+\r
+\r
+\r
+       ;*NOW DO THE FANCY MESS OF:\r
+       ;*\r
+       ;*      1)      DO WE LOAD A NEW OVERLAY INTO A SECTION?\r
+       ;*      2)      WHICH SECTION DO WE OVERLAY IT INTO (1 OR 2)?\r
+       ;*      3)      WHICH LOOK DO WE PLACE INTO THE SECTION (DESERT..)?\r
+       ;*\r
+       ;*\r
+       LDI     @TYCOFLAG,R0\r
+       TSTB    SC_LDSECT,R0\r
+       BZ      NO_NEWLOAD\r
+\r
+\r
+NO_NEWLOAD\r
+       CALL    FIND_SUBLIST_START_END\r
+       CALL    APPEND_NEWLIST\r
+\r
+\r
+       LDI     @NEWSUBLIST_TOPB,R0             ;return pointer to 1st object\r
+\r
+       POP     AR7\r
+       POP     AR5\r
+       POP     AR4\r
+       POP     AR2\r
+       POP     AR1\r
+       POP     AR0\r
+       POP     R5\r
+       POP     R4\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*ADD AN ELEMENT (OBJECT) TO THE NEW LIST BEING CREATED\r
+*SEARCH ON ITS OID SO THAT IT IS IN ORDER\r
+*\r
+*\r
+*PARAMETERS\r
+*      AR4             POINTER TO OBJECT\r
+*      *AR4(OUSR1)     INDEX (lower 2 nybbles of OID)\r
+*\r
+*\r
+*PLACE IN ASCENDING ORDER IN THE LIST\r
+*\r
+*\r
+ADD_TO_NEWLIST:\r
+       LDI     @NEW_GROUPI,AR1\r
+       LDI     *AR1,R0\r
+       BNZ     REGADD\r
+\r
+       STI     AR4,*AR1\r
+       CLRI    R0\r
+       STI     R0,*+AR4(OLINK4)\r
+       STI     R0,*+AR4(OBLINK4)\r
+       RETS\r
+\r
+REGADD\r
+\r
+       SUBI    OLINK4,AR1\r
+       LDI     AR1,AR2\r
+       LDI     *+AR4(OUSR1),R0         ;GET fLEX index number\r
+ADDNOBJL\r
+       LDI     AR1,AR0                 ;AR0 IS PREVIOUS LINK\r
+       LDI     *+AR1(OLINK4),R1        ;CHECK END OF LIST\r
+       BZ      ADDNOBJ_AT_END\r
+\r
+       LDI     R1,AR1\r
+       CMPI    *+AR1(OUSR1),R0\r
+       BGT     ADDNOBJL\r
+\r
+ADDNOBJ_AT_END\r
+       STI     R1,*+AR4(OLINK4)        ;LINK TO NEXT (SUBLIST LINK)\r
+       STI     AR4,*+AR0(OLINK4)       ;LINK FROM PREVIOUS (SUBLIST LINK)\r
+\r
+       CMPI    AR2,AR0                 ;IS IT THE HEAD OF LIST WE LOAD AT\r
+       LDIEQ   0,AR0\r
+       STI     AR0,*+AR4(OBLINK4)      ;BACK LINK\r
+\r
+       CMPI    0,R1                    ;IS THE NEXT ELEMENT NULL\r
+       BEQ     ISZERO\r
+       LDI     R1,AR0                  ;IF NOT THE NEXT ELEMENTS BACK LINK\r
+       STI     AR4,*+AR0(OBLINK4)      ;  MUST POINT TO NEW ELEMENT\r
+ISZERO\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+FIND_SUBLIST_START_END:\r
+       PUSH    R1\r
+       PUSH    AR0\r
+       LDI     @NEW_GROUP,AR0\r
+       .if     DEBUG\r
+       CMPI    0,AR0\r
+       SLOCKON EQ,"BACKGRND\FIND_SUBLIST_START_END"\r
+       .endif\r
+       STPI    AR0,@SUBLIST_BEGIN\r
+FSLP\r
+       LDI     *+AR0(OLINK4),R1        ;CHECK END OF LIST\r
+       BZ      FSDN\r
+       LDI     R1,AR0\r
+       BU      FSLP\r
+FSDN\r
+       STPI    AR0,@SUBLIST_END        ;ALWAYS NAME IT AS THE END\r
+       POP     AR0\r
+       POP     R1\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*APPEND THE NEW LIST TO THE OLD LIST\r
+*\r
+*LINKED VIA OLINK4\r
+*\r
+*      DONT FORGET THE BACK LINK\r
+*\r
+*      if (DYNALIST empty)  {\r
+*              DYNALIST_END    <- SUBLIST_END\r
+*              DYNALIST_TRUE_BEGIN <- SUBLIST_BEGIN\r
+*              DYNALIST_BEGIN  <- SUBLIST_BEGIN\r
+*              STARTS  <- SUBLIST_BEGIN\r
+*      }\r
+*      else  {\r
+*              *(DYNALIST_END+OLINK4) <- SUBLIST_BEGIN\r
+*              DYNALIST_END <- SUBLIST_END     new end of list pointer\r
+*              STARTS <- SUBLIST_BEGIN\r
+*      }\r
+*\r
+*\r
+APPEND_NEWLIST:\r
+       LDI     @DYNALIST_END,R0\r
+       BZ      SHINY_NEWLIST\r
+       LDI     R0,AR0\r
+\r
+       LDI     @SUBLIST_BEGIN,R0\r
+       STI     R0,*+AR0(OLINK4)\r
+\r
+       LDI     @SUBLIST_END,AR1\r
+       STPI    AR1,@DYNALIST_END\r
+\r
+       LDI     R0,AR1\r
+       STI     AR0,*+AR1(OBLINK4)\r
+\r
+       STPI    R0,@STARTS\r
+       RETS\r
+\r
+SHINY_NEWLIST:\r
+       LDI     @SUBLIST_END,R0\r
+       STPI    R0,@DYNALIST_END\r
+\r
+       LDI     @SUBLIST_BEGIN,R0       ;new line, check it out...\r
+       STPI    R0,@DYNALIST_TRUEBEGIN\r
+\r
+       LDI     @SUBLIST_BEGIN,R0\r
+       SLOCKON Z,"BACKGRND\SHINY_NEWLIST"\r
+\r
+       STPI    R0,@DYNALIST_BEGIN\r
+       STPI    R0,@STARTS\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*DELETE GROUP LIST FROM OBJECT LIST\r
+*\r
+*      CYCLE OUT THE LRU IN ACTIVE GROUPS\r
+*\r
+*PARAMETERS\r
+*      AR2     ID OF ELEMENTS WITHIN THE LIST\r
+*\r
+*search for items in active\r
+*search for items in idle\r
+*\r
+*\r
+GROUP_DELETE:\r
+\r
+       PUSH    R0\r
+       PUSH    R1\r
+       PUSH    AR0\r
+       PUSH    AR1\r
+\r
+       LDI     @OACTIVEI,R1\r
+       CALL    DELLP\r
+\r
+       LDI     @IDLE_LISTI,R1\r
+       CALL    DELLP\r
+\r
+       POP     AR1\r
+       POP     AR0\r
+       POP     R1\r
+       POP     R0\r
+       RETS\r
+\r
+\r
+DELLP  LDI     R1,AR1                  ;WE MUST FIND DEAD OBJECT TO LINK AROUND\r
+       LDI     *AR1,R1\r
+       BZ      NXTCHK\r
+\r
+       LDI     R1,AR0\r
+       CMPI    *+AR0(OLINK2),AR2\r
+       BNE     DELLP\r
+\r
+       LDI     *AR0,R0                 ;find link from delete-e\r
+       STI     R0,*AR1                 ;LINK AROUND\r
+\r
+\r
+\r
+       PUSH    AR2\r
+       LDI     AR0,AR2\r
+\r
+       ;Mirror these checks in OBJ.ASM\r
+       ;       'OBJ_DELETE'\r
+       ;\r
+       LDI     *+AR2(OFLAGS),R0        ;KILL PROC ASSOCIATED WITH OBJ\r
+       RS      (O_DEBRIS_B+1),R0\r
+       CALLC   FREE_RDDEBRIS\r
+\r
+       LDI     *+AR2(OFLAGS),R0        ;KILL PROC ASSOCIATED WITH OBJ\r
+       RS      (O_PROC_B+1),R0\r
+       CALLC   OBJ_FREE_PROC\r
+\r
+       LDI     *+AR2(OFLAGS),R0        ;DELINK IN CASE OF DRIVE LIST\r
+       RS      (O_DRIVE_SUPP_B+1),R0\r
+       CALLC   OBJ_FREE_DRIVE\r
+\r
+       LDI     *+AR2(OFLAGS),R0        ;DELINK IN CASE OF GROUND LIST\r
+       RS      (O_GROUND_B+1),R0\r
+       CALLC   OBJ_FREE_GROUND\r
+\r
+       LDI     *+AR2(OFLAGS),R0        ;DELINK IN CASE OF SIGN LIST\r
+       RS      (O_SIGN_SUPP_B+1),R0\r
+       CALLC   OBJ_FREE_SIGN\r
+\r
+       POP     AR2\r
+\r
+       CLRI    R0\r
+       STI     R0,*+AR0(OLINK2)        ;CLEAR SEARCH ID\r
+       STI     R0,*+AR0(OFLAGS)\r
+\r
+\r
+       LDI     @OFREE,R0\r
+       STI     R0,*AR0                 ;place delete-e on free\r
+       STI     AR0,@OFREE\r
+\r
+       LDI     @OFREECNT,R0            ;INCREMENT FREE OBJECT COUNT\r
+       ADDI    1,R0\r
+       STI     R0,@OFREECNT\r
+       LDI     AR1,R1\r
+       BU      DELLP\r
+NXTCHK\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*PARAMETERS\r
+*      AR2     VECTOR V1\r
+*      R2      VECTOR V2\r
+*RETURNS\r
+*      R0      (FLOAT) DISTANCE FROM V1 TO V2\r
+*      (FROM X/Z ONLY)\r
+*\r
+*\r
+GET_XZ_DISTANCE:\r
+       PUSH    AR0\r
+       PUSH    R3\r
+       LDI     R2,AR0\r
+       LDF     *AR0++(2),R3\r
+       SUBF    *AR2++(2),R3\r
+       LDF     *AR0++,R2\r
+       SUBF    *AR2++,R2\r
+\r
+\r
+       MPYF    R3,R3\r
+       MPYF    R2,R2\r
+       ADDF    R3,R2\r
+       CALL    SQRT\r
+\r
+       POP     R3\r
+       POP     AR0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*BGD_OROUTINE\r
+*      The object has (or will have) a routine associated with it, search the\r
+*      ID of the object vs the list and call any routine nessesary.\r
+*\r
+*\r
+*\r
+*PARAMETERS\r
+*      AR4     OBJECT (NOT INSERTED)\r
+*      \r
+*\r
+*NOTE\r
+*      ALL REGISTERS MUST BE SAVED\r
+*\r
+BGD_OROUTINE:\r
+       PUSH    R0\r
+       PUSH    R1\r
+       PUSH    AR0\r
+       LDI     *+AR4(OID),R0\r
+       LDI     @ROUTINE_TABI,AR0\r
+BGDORLP        CMPI    *AR0,R0\r
+       BEQ     BGD_RFND\r
+       LDI     *AR0++(2),R1\r
+       BNZ     BGDORLP\r
+       POP     AR0\r
+       POP     R1\r
+       POP     R0\r
+       RETS\r
+BGD_RFND\r
+       LDI     *+AR0,R0\r
+       CALLU   R0\r
+       POP     AR0\r
+       POP     R1\r
+       POP     R0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+OVERCAR:\r
+       PUSH    R0\r
+       PUSH    R2\r
+       PUSH    AR2\r
+       CREATE  CARFORWARD,22\r
+       STI     AR0,*+AR4(OPLINK)\r
+       LDI     SPAWNER_C,R0\r
+       STI     R0,*+AR0(PID)\r
+       LDI     1,R0\r
+       LS      O_PROC_B,R0\r
+       OR      *+AR4(OFLAGS),R0\r
+       ANDN    O_1PAL,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+       RANDN   4\r
+       ADDI    @OVERCARLISTI,R0\r
+       LDI     R0,AR2\r
+       LDI     *AR2,AR2\r
+       STI     AR2,*+AR4(OROMDATA)\r
+       POP     AR2\r
+       POP     R2\r
+       POP     R0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+OVERCARLISTI   .word   OVERCARLIST\r
+OVERCARLIST    .word   dcbus,dgtruck,dsbus,dcbus\r
+\r
+CARFORWARD:\r
+       RANDN   50\r
+       CMPI    25,R0\r
+       BLT     CARSUP\r
+\r
+\r
+       CALL    CLR_VECTORA\r
+       FLOAT   16000,R0\r
+       STF     R0,*+AR2(Z)\r
+\r
+       LDI     AR2,R3\r
+       LDI     AR4,R2\r
+       ADDI    OMATRIX,R2\r
+       CALL    MATRIX_MUL\r
+\r
+       LDF     *+AR4(OPOSX),R0\r
+       ADDF    *+AR2(X),R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR4(OPOSY),R0\r
+       ADDF    *+AR2(Y),R0\r
+       STF     R0,*+AR4(OPOSY)\r
+\r
+       LDF     *+AR4(OPOSZ),R0\r
+       ADDF    *+AR2(Z),R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+\r
+       LDF     *+AR4(ORADY),R2\r
+       ADDF    PI,R2\r
+       STF     R2,*+AR4(ORADY)\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    FIND_YMATRIX\r
+\r
+CARSUP\r
+       RANDN   500\r
+       FLOAT   R0\r
+\r
+       CALL    CLR_VECTORA\r
+       STF     R0,*+AR2(Z)\r
+\r
+       LDI     AR2,R3\r
+       LDI     AR4,R2\r
+       ADDI    OMATRIX,R2\r
+       CALL    MATRIX_MUL\r
+\r
+       LDF     *+AR4(OPOSX),R0\r
+       ADDF    *+AR2(X),R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR4(OPOSY),R0\r
+       ADDF    *+AR2(Y),R0\r
+       STF     R0,*+AR4(OPOSY)\r
+\r
+       LDF     *+AR4(OPOSZ),R0\r
+       ADDF    *+AR2(Z),R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+\r
+\r
+\r
+       RANDN   30\r
+       FLOAT   R0\r
+       LDF     R0,R6\r
+       ADDF    50,R6\r
+\r
+       RANDN   3\r
+       ADDI    1,R0\r
+       FLOAT   R0\r
+       MPYF    R0,R6\r
+\r
+CARFORWARDLP\r
+       CALL    CLR_VECTORA\r
+       LDF     R6,R0\r
+       MPYF    @NFRAMES,R0\r
+       STF     R0,*+AR2(Z)\r
+\r
+       LDI     AR2,R3\r
+       LDI     AR4,R2\r
+       ADDI    OMATRIX,R2\r
+       CALL    MATRIX_MUL\r
+\r
+\r
+       LDF     *+AR4(OPOSX),R0\r
+       ADDF    *+AR2(X),R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR4(OPOSY),R0\r
+       ADDF    *+AR2(Y),R0\r
+       STF     R0,*+AR4(OPOSY)\r
+\r
+       LDF     *+AR4(OPOSZ),R0\r
+       ADDF    *+AR2(Z),R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+       SLEEP   1\r
+       BU      CARFORWARDLP\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+ROAD_DEBRIS_CREATE_55GAL:\r
+       PUSH    R0\r
+       CALL    ADD_RDDEBRIS\r
+       LDI     0731h,R0\r
+       STI     R0,*+AR4(OID)\r
+       POP     R0\r
+       RETS\r
+ROAD_DEBRIS_CREATE:\r
+       BU      ADD_RDDEBRIS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+SMOKE_STACK:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       BUD     MAKEPPP\r
+       PUSH    R2\r
+       NOP\r
+       LDI     @SMOKE_ANII,AR6\r
+       ;---->  BUD     MAKEPPP\r
+\r
+CAR_FIRE:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       BUD     MAKEPPP\r
+       PUSH    R2\r
+       NOP\r
+       LDI     @CAR_FIRE_ANII,AR6\r
+       ;---->  BUD     MAKEPPP\r
+\r
+SMOKE_ANII     .word   SMOKE_ANI\r
+SMOKE_ANI      .word   smoa,smob,smoc,smod,smoe,smof\r
+               .word   -1\r
+\r
+;eug1,eug2,eug3,eug4,eug5,eug6\r
+CAR_FIRE_ANII  .word   CAR_FIRE_ANI\r
+CAR_FIRE_ANI\r
+       .word   rdflm1,rdflm2,rdflm3,rdflm4,rdflm5,rdflm6\r
+       .word   rdflm7,rdflm8,rdflm9,rdflm10,rdflm11,rdflm12\r
+       .word   -1\r
+\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+DC_MINIFOUNTAIN_ANII   .word   DC_MINIFOUNTAIN_ANI\r
+DC_MINIFOUNTAIN_ANI\r
+       .word   aft1,aft2,aft3,aft4,aft5,aft6,-1\r
+DC_MINIFOUNTAIN:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+\r
+       LDI     @DC_MINIFOUNTAIN_ANII,AR6\r
+       CREATE  WATERANI_PROC,SPAWNER_C|ANIMATION_T\r
+       BC      FWL1A\r
+       BU      J262\r
+\r
+DC_FOUNTAIN_ANII       .word   DC_FOUNTAIN_ANI\r
+DC_FOUNTAIN_ANI\r
+       .word   ft2,ft3,ft4,ft5,ft6,-1\r
+DC_FOUNTAIN:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+\r
+       LDI     @DC_FOUNTAIN_ANII,AR6\r
+       CREATE  WATERANI_PROC,SPAWNER_C|ANIMATION_T\r
+       BC      FWL1A\r
+       BU      J262\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+WATERFALL_ANII .word   WATERFALL_ANI\r
+WATERFALL_ANI  .word   w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,-1\r
+\r
+WATERFALL:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+\r
+       CREATE  WATERFALL_SND,SPAWNER_C|ANIMATION_T\r
+\r
+       LDI     @WATERFALL_ANII,AR6\r
+       CREATE  WATERANI_PROC,SPAWNER_C|ANIMATION_T\r
+       BC      FWL1A\r
+J262   STI     AR0,*+AR4(OPLINK)\r
+       LDI     1,R0\r
+       LS      O_PROC_B,R0\r
+       OR      *+AR4(OFLAGS),R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+FWL1A  POP     R2\r
+       POP     AR6\r
+       POP     AR5\r
+       POP     AR2\r
+       POP     AR0\r
+       POP     R0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*AR6   START OF SCRIPT\r
+*\r
+*the big difference is that this *MUST* handle the sound animation also...\r
+*\r
+*\r
+WATERANI_PROC:\r
+       LDI     AR6,AR5\r
+WATERANI_LP\r
+       LDI     *AR5++,R0\r
+       BLT     WATERANI_PROC\r
+       STI     R0,*+AR4(OROMDATA)\r
+\r
+       RANDN   4\r
+       LDI     R0,R0\r
+       LDIZ    1,AR2\r
+       LDINZ   2,AR2\r
+       CALL    PRC_SLEEP\r
+       BU      WATERANI_LP\r
+*----------------------------------------------------------------------------\r
+\r
+*\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*AR4=WATERFALL OBJECT\r
+*\r
+WATERFALL_SND:\r
+       SLEEP   1\r
+       LDI     *+AR4(ODIST),R0\r
+       LDFN    4.0,R1\r
+       LDFNN   1.0,R1\r
+\r
+       CMPI    -20000,R0\r
+       BGT     WF1\r
+\r
+       LDI     @CAMVIEW,R2\r
+       BNE     WF0\r
+\r
+       LDI     @PLYCBLK,AR0\r
+       LDI     *+AR0(CAR_SPIN),R2\r
+       BNE     WF1\r
+WF0\r
+       LDI     WATERFALLSND,AR2        ;KILL OFF SOUND\r
+       CALL    KILLSNDFX\r
+       DIE\r
+WF1\r
+       FLOAT   R0,R2\r
+       MPYF    R1,R2\r
+       ABSF    R2\r
+       MPYF    0.01,R2\r
+       MPYF    0.1,R2                  ;0-50\r
+       SUBRF   75,R2\r
+       BN      WATERFALL_SND\r
+\r
+       MPYF    7,R2\r
+       FIX     R2\r
+\r
+       CMPI    255,R2\r
+       LDIGT   255,R2\r
+\r
+       LDI     WATERFALLSND,AR2\r
+       CALL    AMBIENCE_SOUND\r
+\r
+       BU      WATERFALL_SND\r
+\r
+*----------------------------------------------------------------------------\r
+\r
+*\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*PARAMETERS\r
+*      AR2     SOUND\r
+*      R2      VOLUME (0-255)\r
+*\r
+AMBIENCE_SOUND:\r
+       CMPI    @SNDSTR+SND_SIZ+SND_IDX,AR2     ;CHECK TRACK1\r
+       BEQ     IS_T1\r
+       CMPI    @SNDSTR+(2*SND_SIZ)+SND_IDX,AR2 ;CHECK TRACK2\r
+       BEQ     IS_T2\r
+       CALL    ONESNDFX\r
+\r
+       CMPI    @SNDSTR+SND_SIZ+SND_IDX,AR2     ;CHECK TRACK1\r
+       BNE     NOT_T1\r
+IS_T1\r
+       LDI     R2,R1                           ;volume\r
+       LDI     1,R0\r
+       CALL    SET_TRACK_VOL\r
+       BU      HEND\r
+\r
+NOT_T1 CMPI    @SNDSTR+(2*SND_SIZ)+SND_IDX,AR2 ;CHECK TRACK2\r
+       BNE     NOT_T2\r
+IS_T2\r
+       LDI     R2,R1\r
+       LDI     2,R0\r
+       CALL    SET_TRACK_VOL\r
+NOT_T2\r
+HEND\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+FLAGANII       .word   FLAGANI\r
+FLAGANI                .word   bflag1,bflag2,bflag3,bflag4,bflag5\r
+               .word   bflag6,bflag7,bflag9,bflag10,-1\r
+\r
+FLAGANITALLI   .word   FLAGANITALL\r
+FLAGANITALL    .word   aflag1,aflag2,aflag3,aflag4,aflag5\r
+               .word   aflag6,aflag7,aflag9,aflag10,-1\r
+\r
+       .globl  RUT_ANISI\r
+       .globl  HUNGH_ANISI\r
+\r
+RUT_ANISI      .word   RUT_ANIS\r
+RUT_ANIS       .word   rut,rut2,rut3,-1\r
+HUNGH_ANISI    .word   HUNGH_ANIS\r
+HUNGH_ANIS     .word   hungh1,hungh2,hungh3,hungh4,hungh5,hungh6,hungh7,-1\r
+*----------------------------------------------------------------------------\r
+       .global BABE_PALISTI\r
+BABE_PALISTI   .word   BABE_PALIST\r
+       romdata\r
+BABE_PALIST\r
+       .word   ungh1_blue,logo_p,ungh1_green,nintendo_p,ungh1_silver,map1_p\r
+       .word   ungh1_yellow,lift_p,ungh1_skin,bvwall_p\r
+       .text\r
+\r
+       .globl  HUNGH_ANI\r
+HUNGH_ANI:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+\r
+       PUSH    AR2\r
+       READAUD ADJ_GIRLS\r
+       POP     AR2\r
+       CMPI    0,R0\r
+       BEQ     DORUT_ANI\r
+\r
+       LDI     @HUNGH_ANISI,AR6\r
+       LDI     *+AR4(OFLAGS),R0\r
+;      ANDN    O_1PAL,R0\r
+       OR      O_POSTER,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+       LDI     5,AR2\r
+       CALL    RANDU0\r
+       CMPI    4,R0\r
+       BEQ     HUNGH_NOPAL\r
+       MPYI    2,R0\r
+       ADDI    @BABE_PALISTI,R0\r
+       LDI     R0,AR5\r
+       LDI     *+AR5,AR2\r
+       CALL    PAL_FIND\r
+       BC      HUNGH_NOPAL\r
+       LDI     R0,R2\r
+       LDI     *AR5,AR2\r
+       LDI     *AR2++,R3\r
+       CALL    PAL_SET\r
+       STI     R0,*+AR4(OPAL)\r
+HUNGH_NOPAL\r
+       CALL    PLACE_ON_ROAD\r
+       LDI     RDDEBRIS_C|TSC_IGNORE|TSC_BABE_S,R0\r
+       STI     R0,*+AR4(OID)\r
+\r
+\r
+       LDI     AR6,AR5\r
+       CREATE  PLAINANI_LP_SLOW,SPAWNER_C|ANIMATION_T|7\r
+       BC      FWL1\r
+       BU      J2\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       .global HUNGH_ANI_REENTER\r
+HUNGH_ANI_REENTER:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+       LDI     @HUNGH_ANISI,AR6\r
+       LDI     *+AR4(OFLAGS),R0\r
+;      ANDN    O_1PAL,R0\r
+       OR      O_POSTER,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+       LDI     AR6,AR5\r
+       CREATE  PLAINANI_LP_SLOW,SPAWNER_C|ANIMATION_T|7\r
+       BC      FWL1\r
+       BU      J2\r
+\r
+       romdata\r
+       .include        babe.pal\r
+       .text\r
+\r
+PLACE_ON_ROAD:\r
+       CALL    ADD_RDDEBRIS\r
+\r
+       PUSH    AR4\r
+       ADDI    OPOSX,AR4\r
+       CALL    CAMSCAN\r
+       POP     AR4\r
+       FIX     R0,R1           ;Check for dude in the sign\r
+       CMPI    1000,R1\r
+       BGT     PORX\r
+       LDF     *+AR4(OPOSY),R1\r
+       ADDF    R1,R0\r
+       SUBF    45,R0\r
+       STF     R0,*+AR4(OPOSY)\r
+PORX\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       .globl  RUT_ANI\r
+RUT_ANI:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+\r
+DORUT_ANI\r
+       LDI     @RUT_ANISI,AR6\r
+       LDI     *+AR4(OFLAGS),R0\r
+       ANDN    O_1PAL,R0\r
+       OR      O_POSTER,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+       CALL    PLACE_ON_ROAD\r
+       LDI     RDDEBRIS_C|TSC_IGNORE|TSC_DUDE_S,R0\r
+       STI     R0,*+AR4(OID)\r
+\r
+\r
+       LDI     AR6,AR5\r
+       CREATE  PLAINANI_LP_SLOW,SPAWNER_C|ANIMATION_T|7\r
+       BC      FWL1\r
+       BU      J2\r
+*----------------------------------------------------------------------------\r
+PLAINANI_PROC_SLOW:\r
+       LDI     AR6,AR5\r
+PLAINANI_LP_SLOW\r
+       LDI     *AR5++,R0\r
+       BLT     PLAINANI_PROC_SLOW\r
+       STI     R0,*+AR4(OROMDATA)\r
+\r
+       RANDN   4\r
+       LDI     R0,R0\r
+       LDIZ    1,AR2\r
+       LDINZ   2,AR2\r
+       ADDI    1,AR2\r
+       CALL    PRC_SLEEP\r
+       BU      PLAINANI_LP_SLOW\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+FLAGWAVE_TALL:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+       LDI     @FLAGANITALLI,AR6\r
+       LDI     *+AR4(OFLAGS),R0\r
+       ANDN    O_1PAL,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+       RANDN   7\r
+       LDI     AR6,AR5\r
+       ADDI    R0,AR5\r
+       CREATE  PLAINANI_LP,SPAWNER_C|ANIMATION_T\r
+       BC      FWL1\r
+       BU      J2\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+FLAGWAVE:\r
+       PUSH    R0\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    R2\r
+       LDI     @FLAGANII,AR6\r
+       LDI     *+AR4(OFLAGS),R0\r
+       ANDN    O_1PAL,R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+       RANDN   7\r
+       LDI     AR6,AR5\r
+       ADDI    R0,AR5\r
+       CREATE  PLAINANI_LP,SPAWNER_C|ANIMATION_T\r
+       BC      FWL1\r
+       BU      J2\r
+\r
+MAKEPPP\r
+       CREATE  PLAINANI_PROC,SPAWNER_C|ANIMATION_T\r
+       BC      FWL1\r
+J2     STI     AR0,*+AR4(OPLINK)\r
+       LDI     1,R0\r
+       LS      O_PROC_B,R0\r
+       OR      *+AR4(OFLAGS),R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+FWL1   POP     R2\r
+       POP     AR6\r
+       POP     AR5\r
+       POP     AR2\r
+       POP     AR0\r
+       POP     R0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*AR6   START OF SCRIPT\r
+*\r
+PLAINANI_PROC:\r
+       LDI     AR6,AR5\r
+PLAINANI_LP\r
+       LDI     *AR5++,R0\r
+       BLT     PLAINANI_PROC\r
+       STI     R0,*+AR4(OROMDATA)\r
+\r
+       RANDN   4\r
+       LDI     R0,R0\r
+       LDIZ    1,AR2\r
+       LDINZ   2,AR2\r
+       CALL    PRC_SLEEP\r
+       BU      PLAINANI_LP\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*ABSOLUTE LOAD INTO OBJECT LIST FOR A SINGLE SECTION\r
+*\r
+*\r
+*PARAMETERS\r
+*      AR2     POINTER TO ROM GROUP (OBJECTS.EQU)\r
+*\r
+*RETURNS\r
+*      R0      PTR TO THE FIRST OBJECT IN GROUP\r
+*\r
+       .bss    SINGLE_SECTION_TEMPPTR,1\r
+LOAD_SINGLE_SECTION:\r
+       PUSH    R4\r
+       PUSH    R5\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR4\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    AR7\r
+\r
+       LDL     SINGLE_SECTION_TEMPPTR,AR6\r
+       SUBI    OLINK2,AR6\r
+\r
+       LDI     AR2,AR5\r
+       INC     AR5\r
+       LDI     *AR5++,R4               ;get number of objects to load\r
+       SLOCKON LE,"BACKGRND\LOAD_SINGLE_SECTION GROUP ERROR"\r
+\r
+       DEC     R4\r
+\r
+       CMPI    @OFREECNT,R4\r
+       SLOCKON GT,"BACKGRND\LOAD_SINGLE_SECTION OUT OF OBJECTS"\r
+LS_L12\r
+\r
+       LDI     *AR5++,AR2              ;GET MODEL PTR\r
+       CALL    OBJ_GETE\r
+       SLOCKON C,"BACKGRND\LOAD_SINGLE_SECTION OUT OF OBJECTS *FATAL*"\r
+       BC      LS_ACTIVATE_X\r
+       LDI     AR0,AR4\r
+\r
+       STI     AR4,*+AR6(OLINK2)\r
+       LDI     AR4,AR6\r
+\r
+       FLOAT   *AR5++,R1               ;GET X POSITION\r
+       STF     R1,*+AR4(OPOSX)\r
+       FLOAT   *AR5++,R1               ;GET Y POSITION\r
+       STF     R1,*+AR4(OPOSY)\r
+       FLOAT   *AR5++,R1               ;GET Z POSITION\r
+       STF     R1,*+AR4(OPOSZ)\r
+       LDF     *AR5++,R2               ;SET THE RADIANS FOR THE OBJECT\r
+       STF     R2,*+AR4(ORADY)\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    HPFIND_YMATRIX\r
+       LDI     *AR5++,R1               ;LOAD OBJECT ID (GENV STYLE)\r
+       LDI     R1,R2\r
+       AND     CLASS_M|TYPE_M|SUBTYPE_M,R1\r
+       STI     R1,*+AR4(OID)\r
+\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERT                      ;INSERT THE BABE\r
+\r
+       SUBI    1,R4\r
+       BGE     LS_L12\r
+\r
+LS_ACTIVATE_X\r
+\r
+       CLRI    R0\r
+       STI     R0,*+AR6(OLINK2)\r
+       LDI     @SINGLE_SECTION_TEMPPTR,R0\r
+\r
+       POP     AR7\r
+       POP     AR6\r
+       POP     AR5\r
+       POP     AR4\r
+       POP     AR2\r
+       POP     AR0\r
+       POP     R5\r
+       POP     R4\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+;*----------------------------------------------------------------------------\r
+;OIL_PUMP:\r
+;      PUSH    AR0\r
+;      PUSH    AR2\r
+;      PUSH    R2\r
+;      CREATE  OILWELL,UTIL_C\r
+;      POP     R2\r
+;      POP     AR2\r
+;      POP     AR0\r
+;      RETS\r
+;\r
+;OILWELL_DYNA\r
+;      .word   2               ;#OF DYNAS-1\r
+;\r
+;;     .float  -1197,0,0       ;WHEEL\r
+;      .float  0,-538,0        ;WHEEL\r
+;      .word   41              ;VERTS-1\r
+;      .word   2               ;DYNAFLAG\r
+;\r
+;      .float  -1276,-2325,0   ;HAMMER\r
+;      .word   38              ;VERTS-1\r
+;      .word   3               ;DYNAFLAG\r
+;\r
+;      .float  0,0,0           ;main body\r
+;      .word   56              ;VERTS-1\r
+;      .word   1               ;DYNAFLAG\r
+;\r
+;*\r
+;*PARAMETERS\r
+;*     AR4     OILWELL OBJECT\r
+;*\r
+;*\r
+;OILWELL:\r
+;      STI     AR7,*+AR4(OPLINK)\r
+;\r
+;      LDI     1,R0\r
+;      LS      O_PROC_B,R0\r
+;      OR      *+AR4(OFLAGS),R0\r
+;      OR      O_DYNAMIC,R0            ;MAKE PARENT OBJECT DYNAMIC\r
+;      STI     R0,*+AR4(OFLAGS)\r
+;\r
+;      LDL     OILWELL_DYNA,AR2\r
+;\r
+;      LDI     AR4,AR3\r
+;      ADDI    ODYNALIST,AR3\r
+;\r
+;*INIT DYNA OBJECTS\r
+;      LDI     *AR2++,RC               ;GET DYNAMIC OBJECT COUNT (-1)\r
+;      RPTB    OWINLP\r
+;\r
+;      CALL    GETDYNA                 ;LINK HIM INTO LIST\r
+;      STI     AR0,*AR3\r
+;\r
+;\r
+;      LDF     *AR2++,R0\r
+;      STF     R0,*+AR0(DYNACENTERX)\r
+;      STF     R0,*+AR0(DYNATRANSX)\r
+;      LDF     *AR2++,R0\r
+;      STF     R0,*+AR0(DYNACENTERY)\r
+;      STF     R0,*+AR0(DYNATRANSY)\r
+;      LDF     *AR2++,R0\r
+;      STF     R0,*+AR0(DYNACENTERZ)\r
+;      STF     R0,*+AR0(DYNATRANSZ)\r
+;      LDI     *AR2++,R0\r
+;      STI     R0,*+AR0(DYNANVERTS)\r
+;      LDI     *AR2++,R0\r
+;      STI     R0,*+AR0(DYNAFLAG)\r
+;\r
+;      CMPI    2,R0    ;\r
+;      BNE     H75\r
+;      STI     AR0,*+AR7(PDATA)                ;WHEEL\r
+;H75\r
+;\r
+;      CMPI    3,R0    ;\r
+;      BNE     H76\r
+;      STI     AR0,*+AR7(PDATA+1)      ;HAMMER\r
+;H76\r
+;\r
+;      STI     AR4,*+AR0(DYNAPARENT)\r
+;OWINLP        LDI     AR0,AR3\r
+;\r
+;      LDI     0,R0\r
+;      STI     R0,*AR3                 ;LAST LINK IS ZERO, DUDES\r
+;\r
+;      LDI     AR3,AR0\r
+;      ADDI    DYNAMATRIX,AR0\r
+;      CALL    INITMAT\r
+;\r
+;      CLRF    R6\r
+;      CLRF    R7\r
+;\r
+;      LDF     0.1,R0\r
+;      STF     R0,*+AR7(PDATA+2)\r
+;\r
+;*\r
+;*\r
+;*     R6      THETA FOR THE WHEELS\r
+;*     R7      THETA FOR THE HAMMER\r
+;*\r
+;OILWELLP\r
+;\r
+;      ADDF    0.1,R6\r
+;      LDF     R6,R2\r
+;      CALL    NORMITS\r
+;      LDF     R2,R6\r
+;      LDI     *+AR7(PDATA),AR2\r
+;      ADDI    DYNAMATRIX,AR2\r
+;      CALL    FIND_ZMATRIX\r
+;\r
+;\r
+;      LDF     *+AR7(PDATA+2),R0\r
+;      NEGF    R0,R1\r
+;\r
+;      CMPF    PI,R7\r
+;      BLT     NC1\r
+;      LDF     R1,R0\r
+;      BU      IRV\r
+;NC1\r
+;      CMPF    -PI,R7\r
+;      BGT     IRV\r
+;      LDF     R1,R0\r
+;IRV\r
+;      ADDF    R0,R7\r
+;      STF     R0,*+AR7(PDATA+2)\r
+;\r
+;      LDF     R0,R2\r
+;      LDI     *+AR7(PDATA+1),AR2\r
+;      ADDI    DYNAMATRIX,AR2\r
+;      CALL    FIND_ZMATRIX\r
+;\r
+;      SLEEP   1\r
+;      BU      OILWELLP\r
+;*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+OHARE_PLANE:\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    R2\r
+       SONDFX  JETFLYBY\r
+       CREATE  PLANE_FWRD,UTIL_C\r
+\r
+       STI     AR0,*+AR4(OPLINK)\r
+       LDI     1,R0\r
+       LS      O_PROC_B,R0\r
+       OR      *+AR4(OFLAGS),R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+       POP     R2\r
+       POP     AR2\r
+       POP     AR0\r
+       RETS\r
+PLANE_FWRD:\r
+\r
+       FLOAT   250,R7\r
+       FLOAT   32000,R6\r
+       MPYF    4,R6\r
+*\r
+*\r
+PLANE_FWL\r
+\r
+       LDF     *+AR4(ORADY),R2\r
+       ADDF    HALFPI,R2\r
+       LDI     @MATRIXAI,AR2\r
+       CALL    FIND_YMATRIX\r
+\r
+       CALL    CLR_VECTORA\r
+       LDF     R7,R0\r
+       FLOAT   @NFRAMES,R1\r
+       MPYF    R1,R0\r
+       STF     R0,*+AR2(Z)\r
+       LDI     @MATRIXAI,R2\r
+       LDI     AR2,R3\r
+       CALL    MATRIX_MUL\r
+\r
+       LDI     @VECTORAI,AR2\r
+       LDF     *+AR4(OPOSX),R0\r
+       ADDF    *+AR2(X),R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR4(OPOSY),R0\r
+       ADDF    *+AR2(Y),R0\r
+       ADDF    50,R0\r
+       STF     R0,*+AR4(OPOSY)\r
+\r
+       LDF     *+AR4(OPOSZ),R0\r
+       ADDF    *+AR2(Z),R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+\r
+       ABSF    R7,R0\r
+       FLOAT   @NFRAMES,R1\r
+       MPYF    R1,R0\r
+       SUBF    R0,R6\r
+       BLT     TRAINX\r
+\r
+       SLEEP   1\r
+       BU      PLANE_FWL\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+TRAIN_FWRD_MAKEB:\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    R2\r
+       CREATE  TRAIN_FWRDB,UTIL_C\r
+       STI     AR0,*+AR4(OPLINK)\r
+       LDI     1,R0\r
+       LS      O_PROC_B,R0\r
+       OR      *+AR4(OFLAGS),R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+       BU      J87\r
+TRAIN_FWRD_MAKE:\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    R2\r
+       CREATE  TRAIN_FWRD,UTIL_C\r
+       STI     AR0,*+AR4(OPLINK)\r
+       LDI     1,R0\r
+       LS      O_PROC_B,R0\r
+       OR      *+AR4(OFLAGS),R0\r
+       STI     R0,*+AR4(OFLAGS)\r
+\r
+J87    POP     R2\r
+       POP     AR2\r
+       POP     AR0\r
+       RETS\r
+\r
+TRAIN_FWRDB:\r
+       LDI     *+AR4(OUSR1),R0\r
+       ADDI    5,R0                    ;kludge to delete later than loaded\r
+       STI     R0,*+AR4(OUSR1)\r
+\r
+       FLOAT   -150,R7\r
+       FLOAT   32000,R6\r
+       MPYF    8,R6\r
+       BU      J765\r
+\r
+TRAIN_FWRD:\r
+\r
+       FLOAT   150,R7\r
+       FLOAT   32000,R6\r
+       MPYF    3,R6\r
+J765\r
+\r
+\r
+*\r
+*\r
+TRAIN_FWL\r
+\r
+       CALL    CLR_VECTORA\r
+       LDF     R7,R0\r
+       FLOAT   @NFRAMES,R1\r
+       MPYF    R1,R0\r
+       STF     R0,*+AR2(Z)\r
+       LDI     AR4,R2\r
+       ADDI    OMATRIX,R2\r
+       LDI     AR2,R3\r
+       CALL    MATRIX_MUL\r
+\r
+       LDI     @VECTORAI,AR2\r
+       LDF     *+AR4(OPOSX),R0\r
+       ADDF    *+AR2(X),R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR4(OPOSY),R0\r
+       ADDF    *+AR2(Y),R0\r
+       STF     R0,*+AR4(OPOSY)\r
+\r
+       LDF     *+AR4(OPOSZ),R0\r
+       ADDF    *+AR2(Z),R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+\r
+\r
+       ABSF    R7,R0\r
+       FLOAT   @NFRAMES,R1\r
+       MPYF    R1,R0\r
+       SUBF    R0,R6\r
+       BLT     TRAINX\r
+\r
+       SLEEP   1\r
+       BU      TRAIN_FWL\r
+TRAINX\r
+       CLRI    R0\r
+       STI     R0,*+AR4(OPLINK)\r
+       LDI     1,R0\r
+       LS      O_PROC_B,R0\r
+       LDI     *+AR4(OFLAGS),R1\r
+       ANDN    R0,R1\r
+       STI     R1,*+AR4(OFLAGS)\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*PARAMETERS\r
+*      AR2     SECTION POINTER\r
+*      \r
+*      OFFSET BY START_POS\r
+*      \r
+*\r
+LOAD_SINGLE_SECTION_OFFSET:\r
+       PUSH    R4\r
+       PUSH    R5\r
+       PUSH    AR0\r
+       PUSH    AR2\r
+       PUSH    AR4\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       PUSH    AR7\r
+\r
+\r
+\r
+       LDL     SINGLE_SECTION_TEMPPTR,AR6\r
+       SUBI    OLINK2,AR6\r
+\r
+       LDI     AR2,AR5\r
+       INC     AR5\r
+       LDI     *AR5++,R4               ;get number of objects to load\r
+       SLOCKON LE,"BACKGRND\LOAD_SINGLE_SECTION GROUP ERROR"\r
+\r
+       DEC     R4\r
+\r
+       LDF     @START_RADY,R2\r
+       LDI     @MATRIXAI,AR2\r
+       CALL    HPFIND_YMATRIX\r
+\r
+       CMPI    @OFREECNT,R4\r
+       SLOCKON GT,"BACKGRND\LOAD_SINGLE_SECTION OUT OF OBJECTS"\r
+LS_L12O\r
+\r
+       LDI     *AR5++,AR2              ;GET MODEL PTR\r
+       CALL    OBJ_GETE\r
+       SLOCKON C,"BACKGRND\LOAD_SINGLE_SECTION OUT OF OBJECTS *FATAL*"\r
+       BC      LS_ACTIVATE_XO\r
+       LDI     AR0,AR4\r
+\r
+       STI     AR4,*+AR6(OLINK2)\r
+       LDI     AR4,AR6\r
+\r
+       LDI     @VECTORAI,AR2\r
+       FLOAT   *AR5++,R1               ;GET X POSITION\r
+       STF     R1,*+AR2(X)\r
+       FLOAT   *AR5++,R1               ;GET Y POSITION\r
+       STF     R1,*+AR2(Y)\r
+       FLOAT   *AR5++,R1               ;GET Z POSITION\r
+       STF     R1,*+AR2(Z)\r
+\r
+       LDI     @MATRIXAI,R2\r
+       LDI     AR2,R3\r
+       CALL    MATRIX_MUL\r
+\r
+       LDF     *+AR2(X),R1\r
+       ADDF    @START_POS+X,R1\r
+       STF     R1,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR2(Y),R1\r
+       ADDF    @START_POS+Y,R1\r
+       STF     R1,*+AR4(OPOSY)\r
+\r
+       LDF     *+AR2(Z),R1\r
+       ADDF    @START_POS+Z,R1\r
+       STF     R1,*+AR4(OPOSZ)\r
+\r
+       LDF     *AR5++,R2               ;GET THE RADIANS FOR THE OBJECT\r
+       ADDF    @START_RADY,R2\r
+       STF     R2,*+AR4(ORADY)\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    HPFIND_YMATRIX\r
+\r
+       LDI     *AR5++,R1               ;GET OBJECT ID (GENV STYLE)\r
+       LDI     R1,R2\r
+       AND     CLASS_M|TYPE_M|SUBTYPE_M,R1\r
+       STI     R1,*+AR4(OID)\r
+\r
+       LDI     AR4,AR2\r
+       CALL    OBJ_INSERT                      ;INSERT THE BABE\r
+\r
+       SUBI    1,R4\r
+       BGE     LS_L12O\r
+\r
+LS_ACTIVATE_XO\r
+\r
+       CLRI    R0\r
+       STI     R0,*+AR6(OLINK2)\r
+       LDI     @SINGLE_SECTION_TEMPPTR,R0\r
+\r
+       POP     AR7\r
+       POP     AR6\r
+       POP     AR5\r
+       POP     AR4\r
+       POP     AR2\r
+       POP     AR0\r
+       POP     R5\r
+       POP     R4\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*USE ACTUAL ID (0FFFh)\r
+*\r
+       .globl  RRSTART_ENGINE,RRSTART_FLATBED,RRSTART_BOXCAR\r
+       .globl  COPBLOCK,COPBLOCK2\r
+\r
+ROUTINE_TABI   .word   ROUTINE_TAB\r
+ROUTINE_TAB:\r
+       .word   40Ah,FLAGWAVE\r
+       .word   460h,ROAD_DEBRIS_CREATE\r
+       .word   461h,ROAD_DEBRIS_CREATE_55GAL\r
+       .word   462h,ROAD_DEBRIS_CREATE_55GAL   ;actually TOXIC\r
+       .word   463h,ROAD_DEBRIS_CREATE_55GAL   ;actually CONE\r
+       .word   465h,FLAGWAVE                   ;short flag\r
+       .word   466h,FLAGWAVE_TALL              ;tall flag\r
+       ;\r
+       .word   467h,WATERFALL\r
+       .word   469h,OVERCAR            ;LA & CHICAGO, FREEWAY OVERPASS CAR\r
+       .word   470h,RRSTART_ENGINE\r
+       .word   471h,RRSTART_BOXCAR\r
+       .word   472h,RRSTART_BOXCAR\r
+       .word   473h,RRSTART_BOXCAR\r
+       .word   474h,RRSTART_BOXCAR\r
+       .word   475h,RRSTART_BOXCAR\r
+       .word   476h,RRSTART_BOXCAR\r
+       ;\r
+       .word   481h,SMOKE_STACK\r
+       .word   482h,CAR_FIRE\r
+       ;\r
+;      .word   485h,TRAIN_FWRD_MAKEB   ;CHICAGO TRAIN FORWARD SPECIFIED DISTANCE BOXCAR (BRIDGE)\r
+;      .word   486h,TRAIN_FWRD_MAKEB   ;CHICAGO TRAIN FORWARD SPECIFIED DISTANCE ENGINE (BRIDGE)\r
+;      .word   487h,OIL_PUMP           ;RUSHMORE OIL PUMP\r
+;      .word   495h,TRAIN_FWRD_MAKE    ;CHICAGO TRAIN FORWARD SPECIFIED DISTANCE BOXCAR\r
+;      .word   496h,TRAIN_FWRD_MAKE    ;CHICAGO TRAIN FORWARD SPECIFIED DISTANCE ENGINE\r
+       .word   498h,OHARE_PLANE        ;CHICAGO AIRPLANE\r
+       ;\r
+       .word   741h,RUT_ANI\r
+       .word   742h,HUNGH_ANI\r
+\r
+       .word   4A1h,DC_FOUNTAIN\r
+       .word   4A2h,DC_MINIFOUNTAIN\r
+       .word   0       ;END OF TABLE ID\r
+*----------------------------------------------------------------------------\r
+       .END\r
diff --git a/BIG2.GEO b/BIG2.GEO
new file mode 100755 (executable)
index 0000000..50a5b94
Binary files /dev/null and b/BIG2.GEO differ
diff --git a/BIG2.PTG b/BIG2.PTG
new file mode 100755 (executable)
index 0000000..f20f7f7
Binary files /dev/null and b/BIG2.PTG differ
diff --git a/BIG2.TGA b/BIG2.TGA
new file mode 100755 (executable)
index 0000000..fa69316
Binary files /dev/null and b/BIG2.TGA differ
diff --git a/BONUS.ASM b/BONUS.ASM
new file mode 100755 (executable)
index 0000000..21f681c
--- /dev/null
+++ b/BONUS.ASM
@@ -0,0 +1,2282 @@
+       .FILE   "BONUS.ASM"\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*COPYRIGHT (C) 1994 BY  TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+\r
+       .include        MACS.EQU\r
+       .include        MPROC.EQU\r
+       .include        OBJ.EQU\r
+       .include        VUNIT.EQU\r
+       .include        CMOS.EQU\r
+       .include        SYSID.EQU\r
+       .include        SYS.EQU\r
+       .include        GLOBALS.EQU\r
+       .include        SNDTAB.EQU\r
+       .include        PALL.EQU\r
+       .include        OBJECTS.EQU\r
+       .include        TEXT.EQU\r
+       .include        DELTA.EQU\r
+       .include        COMM.EQU\r
+       .include        H2HOBJ.EQU\r
+\r
+\r
+\r
+       .bss    MAXMPH,1                ;FL\r
+       .bss    CHALLENGE_RACE,1        ;FL 1= TRUE,0= FALSE\r
+       .bss    NEXT_STARTUP,1          ;IDX\r
+       .bss    BONUS_WAVE,1            ;IDX\r
+       .bss    FINISH_LINE,1           ;UH     RoadCode for the finish line of this leg\r
+       .bss    DO_FOLDFLAG,1           ;UH     ==1 when folding flag\r
+\r
+\r
+\r
+\r
+NUM_LEGS       .set    14\r
+LEG_NAMESI     .word   LEG_NAMES\r
+LEG_NAMES      .word   LEG1,LEG2,LEG3,LEG4,LEG5,LEG6,LEG7,LEG8\r
+               .word   LEG9,LEG10,LEG11,LEG12,LEG13,LEG14,LEG_USA\r
+\r
+\r
+       romdata\r
+LEG1   .string "GOLDEN GATE PARK",0\r
+LEG2   .string "SAN FRANCISCO",0               ;+tunnel\r
+LEG3   .string "US 101",0\r
+LEG4   .string "REDWOOD FOREST",0              ;+beach\r
+LEG5   .string "BEVERLY HILLS",0               ;+tunnel2\r
+LEG6   .string "LA FREEWAY",0\r
+LEG7   .string "DEATH VALLEY",0\r
+LEG8   .string "ARIZONA",0\r
+LEG9   .string "GRAND CANYON",0\r
+LEG10  .string "IOWA",0                        ;midwest\r
+LEG11  .string "CHICAGO",0\r
+LEG12  .string "INDIANA",0                     ;midwest\r
+LEG13  .string "APPALACHIA",0\r
+LEG14  .string "WASHINGTON DC",0\r
+LEG_USA        .string "SF TO WASHINGTON DC",0\r
+\r
+\r
+WINT1  .string "FREE GAME FOR",0\r
+WINT2  .string "1ST PLACE",0\r
+\r
+EXPIRED        .string "EXPIRED",0\r
+       .text\r
+\r
+\r
+\r
+\r
+*STATISTICAL STRUCTURE FOR THE GAME LEGS <NERD DATA>\r
+*\r
+*\r
+*\r
+*STRUCT        tagGAMETRAK\r
+GT_ETIME       .set    0       ;TC     ELAPSED TIME (TIME CODED)\r
+GT_POS         .set    1       ;UD     POSITION\r
+GT_MAXMPH      .set    2       ;UD     MAX MPH\r
+GT_COLLS       .set    3       ;UD     NUMBER OF COLLISIONS\r
+GT_SIZE                .set    4       ;SIZ\r
+*ENDSTRUCT\r
+\r
+GAMETRAKI      .word   GAMETRAK\r
+               .bss    GAMETRAK,NUM_LEGS*GT_SIZE\r
+               .bss    ETIME,1\r
+\r
+\r
+;etime,#,maxmph\r
+BUFFERSI       .word   BIGBUFFER\r
+               .bss    BIGBUFFER,(4+1+2+2)*NUM_LEGS\r
+\r
+BONUS_POSTLAUNCHI      .word   BONUS_POSTLAUNCH\r
+       romdata\r
+BONUS_POSTLAUNCH\r
+       .word   BONUS_GGATE,BONUS_SANFRAN,BONUSNULL,BONUSNULL\r
+       .word   BONUS_BEVHILLS,BONUSNULL,BONUSNULL\r
+       .word   BONUSNULL,BONUSNULL,BONUSNULL\r
+       .word   BONUSNULL,BONUSNULL,BONUSNULL\r
+       .word   BONUSNULL,BONUSNULL,BONUSNULL\r
+       .text\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+BONUS_SANFRAN:\r
+       CREATE  TRAFFIC_LIGHT,SPAWNER_C|COLORCYC_T\r
+       FLOAT   -35,R0\r
+       STF     R0,@INFIN_CORRECT\r
+BONUS_GGATE:\r
+BONUS_BEVHILLS:\r
+       LDI     @_MODE,R0\r
+       OR      MWATER,R0\r
+       STI     R0,@_MODE\r
+BONUSNULL:\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+BONUS_TABLEI   .word   BONUS_TABLE\r
+       romdata\r
+BONUS_TABLE    .word   BONUS1,BONUS2,BONUS3,BONUS4,BONUS5\r
+               .word   BONUS6,BONUS7,BONUS8,BONUS9,BONUS10\r
+               .word   BONUS11,BONUS12,BONUS13,BONUS14\r
+       .text\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*ROUTINES FOR OVERLAY.ASM\r
+*\r
+*\r
+BONUS14\r
+       LDI     14,R1\r
+       BU      LK\r
+BONUS13        LDI     L_LEG14_BEGIN+1,R0\r
+       LDI     13,R1\r
+       BU      LK\r
+\r
+BONUS12        LDI     L_LEG13_BEGIN+1,R0\r
+       LDI     12,R1\r
+       BU      LK\r
+\r
+BONUS11        LDI     L_LEG12_BEGIN+1,R0\r
+       LDI     11,R1\r
+       BU      LK\r
+\r
+BONUS10        LDI     L_LEG11_BEGIN+1,R0\r
+       LDI     10,R1\r
+       BU      LK\r
+\r
+BONUS9 LDI     L_LEG10_BEGIN+1,R0\r
+       LDI     9,R1\r
+       BU      LK\r
+\r
+BONUS8 LDI     L_LEG9_BEGIN+1,R0\r
+       LDI     8,R1\r
+       BU      LK\r
+\r
+BONUS7 LDI     L_LEG8_BEGIN+1,R0\r
+       LDI     7,R1\r
+       BU      LK\r
+\r
+BONUS6 LDI     L_LEG7_BEGIN+1,R0\r
+       LDI     6,R1\r
+       BU      LK\r
+\r
+BONUS5 LDI     L_LEG6_BEGIN+1,R0\r
+       LDI     5,R1\r
+       BU      LK\r
+\r
+BONUS4 LDI     L_LEG5_BEGIN+1,R0\r
+       LDI     4,R1\r
+       BU      LK\r
+\r
+BONUS3 LDI     L_LEG4_BEGIN+1,R0\r
+       LDI     3,R1\r
+       BU      LK\r
+\r
+BONUS2 LDI     L_LEG3_BEGIN+1,R0\r
+       LDI     2,R1\r
+       BU      LK\r
+\r
+BONUS1 LDI     L_LEG2_BEGIN+1,R0\r
+       LDI     1,R1\r
+LK     STI     R0,@NEXT_STARTUP\r
+       STI     R1,@BONUS_WAVE\r
+\r
+       LDI     @_MODE,R0\r
+       LDI     R0,R1\r
+       AND     MMODE,R1\r
+       CMPI    MGAME,R1\r
+       RETSNE\r
+\r
+       ANDN    MMODE,R0\r
+       OR      MBONUS,R0\r
+       ANDN    MINTUNNEL,R0\r
+       STI     R0,@_MODE\r
+\r
+\r
+\r
+       ;;;     COMMUNICATIONS ALCHEMY\r
+       ;;;\r
+       LDI     @MY_STATE,R0\r
+       OR      OMS_FINISHLINE,R0\r
+       STI     R0,@MY_STATE\r
+\r
+\r
+       ;DIFFICULTY ADJUSTMENTS\r
+       ;\r
+       LDI     @POSITION,R0\r
+       CALL    DIFF_CHANGE\r
+\r
+\r
+       ;AUDIT MUMBO JUMBO\r
+       ;\r
+       LDI     @BONUS_WAVE,R2\r
+       SETAUD  AUD_LAST_LEG\r
+\r
+       LDI     @BONUS_WAVE,AR2\r
+       DEC     AR2\r
+       MPYI    2,AR2\r
+       ADDI    AUD_FINISH_GGATE,AR2\r
+       CALL    AUDIT_INC\r
+\r
+       CLRI    R0\r
+       STI     R0,@FIRST_RACE\r
+\r
+\r
+       CALL    KILL_PLYR_SOUNDS\r
+\r
+       LDI     MAX_DRONES,R0\r
+       STI     R0,@DD_MAX_DRONES\r
+\r
+       READAUD ADJ_CHECKPOINT_BONUS\r
+       STI     R0,@CHECKPOINT_TIME_BONUS\r
+\r
+       \r
+       LDI     @PLYCAR,AR4\r
+       LDI     @PLYCBLK,AR5\r
+       CALL    FIND_PLAYERS_POSITION\r
+\r
+       CREATEC BONUS_SCREEN,22\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+\r
+JSUB:\r
+       LDL     BHDDFAS,AR2\r
+       FLOAT   256,R2\r
+       FLOAT   278,R3\r
+       LDI     7,RC\r
+       CALL    TEXT_ADDDS\r
+       LDI     *+AR0(TEXT_COLOR),R0\r
+       OR      TXT_CENTER,R0\r
+       STI     R0,*+AR0(TEXT_COLOR)\r
+       LDI     *+AR1(TEXT_COLOR),R0\r
+       OR      TXT_CENTER,R0\r
+       STI     R0,*+AR1(TEXT_COLOR)\r
+       LDL     font18_white,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(TEXT_PAL)\r
+       STI     R0,*+AR1(TEXT_PAL)\r
+       RETS\r
+\r
+DISPLAY_H2H_WINNER:\r
+       LDI     @WAS_HEAD2HEAD_ON,R0\r
+       BZ      DODIE\r
+\r
+       LDI     @OM_POSITION,R0\r
+       CMPI    @POSITION,R0\r
+       BLT     DODIE\r
+\r
+       CLRI    R0\r
+       STI     R0,@UNFOLDFLAG\r
+\r
+\r
+\r
+\r
+       LDL     big2,AR2\r
+       LDI     0,R2\r
+       LDI     140,R3\r
+       LDI     856,RC\r
+       CALL    OBJ_QMAKE\r
+       LDI     O_IROT|O_NOROT|O_NOUROT|O_NOUNIV|O_1PAL,R0\r
+       OR      *+AR0(OFLAGS),R0\r
+       STI     R0,*+AR0(OFLAGS)\r
+       LDI     AR0,AR2\r
+       CALL    OBJ_INSERTHP\r
+\r
+       LDL     H2HPAL3,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(OPAL)\r
+       STI     AR0,*+AR7(PDATA+2)      ;big2\r
+               \r
+\r
+       LDL     redhd1,AR2\r
+       LDI     0,R2\r
+       LDI     80,R3\r
+       LDI     868,RC\r
+       CALL    OBJ_QMAKE\r
+       LDI     O_IROT|O_NOROT|O_NOUROT|O_NOUNIV|O_1PAL,R0\r
+       OR      *+AR0(OFLAGS),R0\r
+       STI     R0,*+AR0(OFLAGS)\r
+\r
+       LDI     AR0,AR2\r
+       CALL    OBJ_INSERTHP\r
+\r
+       LDL     H2HPAL2,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(OPAL)\r
+       STI     AR0,*+AR7(PDATA)        ;red (bottom)\r
+\r
+\r
+\r
+       LDL     yelhd1,AR2\r
+       LDI     0,R2\r
+       LDI     200,R3\r
+       LDI     868,RC\r
+       CALL    OBJ_QMAKE\r
+       LDI     O_IROT|O_NOROT|O_NOUROT|O_NOUNIV|O_1PAL,R0\r
+       OR      *+AR0(OFLAGS),R0\r
+       STI     R0,*+AR0(OFLAGS)\r
+       LDI     AR0,AR2\r
+       CALL    OBJ_INSERTHP\r
+       LDL     H2HPAL2,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(OPAL)\r
+       STI     AR0,*+AR7(PDATA+1)      ;yellow (bottom)\r
+\r
+\r
+\r
+\r
+\r
+       romdata\r
+BHDDFAS        .string "WINNER",0\r
+       .text\r
+       .globl  font18_white\r
+\r
+       .bss    UNFOLDFLAG,1\r
+DHHW_LP\r
+       LDI     @UNFOLDFLAG,R0\r
+       BNZ     DODIEXXX\r
+\r
+       CALL    JSUB\r
+\r
+       SLEEP   10\r
+\r
+       CALL    JSUB\r
+\r
+\r
+       SLEEP   5\r
+       FLOAT   -5000,R6\r
+       LDI     *+AR7(PDATA),AR2\r
+       LDF     *+AR2(OPOSZ),R0\r
+       ADDF    R6,R0\r
+       STF     R0,*+AR2(OPOSZ)\r
+       \r
+       LDI     *+AR7(PDATA+1),AR2\r
+       LDF     *+AR2(OPOSZ),R0\r
+       ADDF    R6,R0\r
+       STF     R0,*+AR2(OPOSZ)\r
+\r
+       LDI     *+AR7(PDATA+2),AR2\r
+       LDF     *+AR2(OPOSZ),R0\r
+       ADDF    R6,R0\r
+       STF     R0,*+AR2(OPOSZ)\r
+       SLEEP   5\r
+\r
+       FLOAT   5000,R6\r
+       LDI     *+AR7(PDATA),AR2\r
+       LDF     *+AR2(OPOSZ),R0\r
+       ADDF    R6,R0\r
+       STF     R0,*+AR2(OPOSZ)\r
+\r
+       LDI     *+AR7(PDATA+1),AR2\r
+       LDF     *+AR2(OPOSZ),R0\r
+       ADDF    R6,R0\r
+       STF     R0,*+AR2(OPOSZ)\r
+\r
+       LDI     *+AR7(PDATA+2),AR2\r
+       LDF     *+AR2(OPOSZ),R0\r
+       ADDF    R6,R0\r
+       STF     R0,*+AR2(OPOSZ)\r
+\r
+       DBU     AR5,DHHW_LP\r
+\r
+DODIEXXX\r
+\r
+       LDI     *+AR7(PDATA),AR2\r
+       CALL    OBJ_DELETE_HIGH_PRIORITY\r
+       LDI     *+AR7(PDATA+1),AR2\r
+       CALL    OBJ_DELETE_HIGH_PRIORITY\r
+       LDI     *+AR7(PDATA+2),AR2\r
+       CALL    OBJ_DELETE_HIGH_PRIORITY\r
+DODIE\r
+\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+OBJ_DELETE_HIGH_PRIORITY:\r
+       PUSH    R0\r
+       PUSH    R1\r
+       PUSH    AR1\r
+       PUSH    AR2\r
+\r
+       .globl  OHIGH_PRIORITYI\r
+       LDI     @OHIGH_PRIORITYI,R1\r
+\r
+DELLP  LDI     R1,AR1          ;WE MUST FIND DEAD OBJECT TO LINK AROUND\r
+       LDI     *AR1,R1\r
+       BZ      DELOBJX\r
+\r
+       CMPI    R1,AR2\r
+       BNE     DELLP\r
+\r
+       LDI     *AR2,R1         \r
+       STI     R1,*AR1                 ;LINK AROUND\r
+       LDI     @OFREE,R1\r
+       STI     R1,*AR2\r
+       STI     AR2,@OFREE\r
+\r
+       LDI     @OFREECNT,R0            ;INCREMENT FREE OBJECT COUNT\r
+       ADDI    1,R0\r
+       STI     R0,@OFREECNT\r
+\r
+       CLRI    R0\r
+       STI     R0,*+AR2(OLINK2)        ;CLEAR SEARCH ID\r
+       STI     R0,*+AR2(OFLAGS)\r
+\r
+DELOBJX\r
+       POP     AR2\r
+       POP     AR1\r
+       POP     R1\r
+       POP     R0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+       .bss    SAVED_COUNTDOWN,1\r
+BONUS_SCREEN:\r
+       LDI     @BGNDCOLA,R0\r
+       STI     R0,*+AR7(PDATA)\r
+\r
+       LDI     @_countdown,R0\r
+       STI     R0,@SAVED_COUNTDOWN\r
+\r
+       CLRI    R0\r
+       STI     R0,@BGNDCOLA\r
+       CALL    SILENT\r
+       CALL    SND_RESET_QUIET\r
+\r
+       CLRI    R0\r
+       STI     R0,@STOPWATCH_CNTL\r
+       STI     R0,@DO_FOLDFLAG\r
+\r
+       CALL    KILL_THEM\r
+       LDI     0,R0                    ;SMOKE MAY BE KILLED, SO I HAVE TO RESET THIS\r
+       STI     R0,@TIRE_SMOKE_COUNT\r
+\r
+       LDI     1,R0\r
+       STI     R0,@IGNORE_UPDATES\r
+       CALL    PRC_INIT\r
+       CREATE  BONSCRN2,UTIL_C\r
+       CREATE  BONUS_WAIT_LOOP,PLYR_C|PLYR1_T\r
+       CREATE  SCAN_OBJECTS,UTIL_C\r
+\r
+       CALL    FIND_AND_REACTIVATE     ;REACTIVATE CHEERING ANIMATIONS\r
+\r
+       .if     DEBUG\r
+       CALL    VERIFY_CODE_INTEGRITY\r
+       .endif\r
+\r
+        LDP     @FASTSTKI              ;GET PAGE OF STORED ADDRESS\r
+        LDI    @FASTSTKI,SP            ;LOAD THE ADDRESS INTO SP\r
+       BR      COLD_ENTER\r
+\r
+\r
+       .bss    SPEEDHIT,1\r
+\r
+*\r
+*\r
+*\r
+BONSCRN2:\r
+       LDI     @DID_TIMED_OUT,R0\r
+       BZ      DOREG3A\r
+       LDI     0,R0            ;ELAPSED TIME OF 0 = DID NOT FINISH\r
+       STI     R0,@ETIME\r
+DOREG3A        LDI     @STOPWATCH,R0\r
+       STI     R0,@ETIME\r
+\r
+*ELP CHANGE\r
+       ;TURN ON LINK HERE... ALL LISTEN\r
+       ;\r
+       ;\r
+       CALL    CLRONE          ;CAN NOW BE DUAL PLAYER\r
+\r
+*ELP END CHANGE\r
+\r
+\r
+       CLRI    R0\r
+       STI     R0,@START_HIT   ;----------------------------------\r
+\r
+\r
+       CREATE  MOVEOUT_HUD_EQUIP,UTIL_C\r
+\r
+       ;Wait for sound board to reset\r
+       ;\r
+CNR_ENTER\r
+       LDP     @IN_RESET_MODE\r
+       LDI     @IN_RESET_MODE,R0\r
+       SETDP\r
+       BZ      CONTINUE\r
+       SLEEP   1\r
+       BU      CNR_ENTER\r
+CONTINUE\r
+\r
+       .bss    WAS_HEAD2HEAD_ON,1\r
+       LDI     @HEAD2HEAD_ON,R0\r
+       STI     R0,@WAS_HEAD2HEAD_ON\r
+\r
+       CALL    CLEAR_LINK      ;WE ARE NOW *NOT* LINKED\r
+       SOND1   MAPTUNE\r
+\r
+\r
+       LDI     @DID_TIMED_OUT,R0\r
+       BZ      PAPAPA44\r
+\r
+       LDI     @POSITION,R0\r
+       CMPI    1,R0\r
+       BNE     COOLRET\r
+       LDI     @WAS_HEAD2HEAD_ON,R0\r
+       BZ      COOLRET\r
+\r
+       LDI     2,R0\r
+       STI     R0,@POSITION\r
+       BU      COOLRET\r
+PAPAPA44\r
+       CREATE  BACKUP_CAMERA,UTIL_C|BONUS_SCREEN_T\r
+\r
+       SONDFX  CROWD1\r
+;      LDI     @DID_TIMED_OUT,R0\r
+;      B\r
+       SONDFX  CROWDROAR\r
+       SOND1   CHICKCHEER              ;CHAN3\r
+JJDDHH\r
+\r
+\r
+       LDI     @POSITION,R0\r
+       CMPI    1,R0\r
+       BNE     COOLRET\r
+\r
+       CREATEC FREE_RACE_ANNOUNCE,UTIL_C\r
+       JSRP    BABE_TROPHY\r
+COOLRET\r
+\r
+\r
+       ;LAME TEXT EFFECTS\r
+       ;\r
+       ;\r
+       LDI     AR7,AR5\r
+       CREATE  BONS_MAXMPH,UTIL_C|TEXTP_T\r
+       CREATE  BONS_ETIME,UTIL_C|TEXTP_T\r
+       CREATE  BONS_POSITION,UTIL_C|TEXTP_T\r
+       CREATE  BONS_RECORDTIME,UTIL_C|TEXTP_T\r
+       CREATE  DISPLAY_H2H_WINNER,UTIL_C|TEXTP_T|3\r
+\r
+       LDI     @DID_TIMED_OUT,R0\r
+       BNZ     NODOHOTTIME\r
+\r
+       CALL    INTO_TABLE_P\r
+       BNC     NODOHOTTIME\r
+       CMPI    0,R0\r
+       BNE     ISREC\r
+       CREATE  BONS_HOTTIME_REC,UTIL_C|TEXTP_T\r
+       BU      NODOHOTTIME\r
+ISREC  CREATE  BONS_HOTTIME,UTIL_C|TEXTP_T\r
+NODOHOTTIME\r
+\r
+\r
+       ;insert show best times here!\r
+       ;\r
+       ;\r
+       SLEEP   5\r
+       LDI     @POSITION,R0\r
+       CMPI    1,R0\r
+       BEQ     JJAG\r
+\r
+       LDI     0,R0\r
+       LDI     100,R1\r
+       CALL    SET_TRACK_VOL\r
+       SOND1   MAPTUNE\r
+JJAG\r
+\r
+       SONDFX  CROWD1\r
+\r
+       LDI     120-1,AR5\r
+PAPA45\r
+       LDI     @START_HIT,R0\r
+       BNZ     PAPA45X\r
+\r
+       SUBI    @NFRAMES,AR5\r
+       CMPI    0,AR5\r
+       LDILT   0,AR5\r
+       SLEEP   1\r
+       DBU     AR5,PAPA45\r
+PAPA45X\r
+\r
+       CREATE  UNFOLDMAP,UTIL_C\r
+       SLEEP   10\r
+       LDI     1,R0\r
+       STI     R0,@UNFOLDFLAG\r
+       SLEEP   30\r
+\r
+       CALL    LOAD_FIXED_PALETTES\r
+\r
+\r
+;THIS RELOADS THE PALETTES THAT WERE USED FOR THE BABES\r
+       .global BABE_PALISTI\r
+       PUSH    AR5\r
+       PUSH    AR6\r
+       LDI     @BABE_PALISTI,AR5\r
+       LDI     4,AR6\r
+FIXPALLP\r
+       LDI     *+AR5,AR2\r
+       CALL    PAL_FIND\r
+       BC      FIXPAL1\r
+       LDI     AR2,R0\r
+       LDI     R0,R1\r
+       CALL    PAL_OVERWRITE\r
+FIXPAL1\r
+       NOP     *++AR5(2)\r
+       DBU     AR6,FIXPALLP\r
+       POP     AR6\r
+       POP     AR5\r
+\r
+\r
+\r
+       LDL     SW_VIEW0|SW_VIEW1|SW_VIEW2|SW_RADIO|SW_4TH|SW_3RD|SW_2ND|SW_1ST,R1\r
+       LDL     SW_VIEW1|SW_RADIO|SW_2ND,R2\r
+\r
+       LDI     @SWITCHBUTS,R0\r
+       AND     R1,R0\r
+       CMPI    R2,R0\r
+       BNE     NOWAY\r
+\r
+       READADJ ADJ_STEERMIN\r
+       SUBI    @_pot0,R0\r
+       ABSI    R0\r
+       CMPI    20,R0\r
+       BGT     NOWAY\r
+\r
+       LDI     RM_USA,R0\r
+       STI     R0,@RACE_MODE\r
+NOWAY\r
+\r
+\r
+       CALL    KILL_THE_REANIMATORS            ;cheering crowd\r
+\r
+\r
+       LDL     shared_PALETTES,AR2\r
+       CALL    dealloc_section\r
+       LDL     shared_PALETTES,AR2\r
+       CALL    alloc_section\r
+       LDL     _SECshared,AR2\r
+       CALL    LOAD_SECTION_REQ\r
+\r
+       CALL    INIT_DRONES                     ;init DRONE tracker system\r
+\r
+       LDI     @RACE_MODE,R0\r
+       CMPI    RM_USA,R0\r
+       BNE     DDF1\r
+       CREATE  SHOWLEG_PROC,UTIL_C|55h\r
+DDF1\r
+\r
+       SONDFX  CC_DIGIT\r
+\r
+\r
+       ;SHOW STATISTICS TO DATE\r
+       ;\r
+       ;\r
+       LDI     @BONUS_WAVE,R5\r
+       SUBI    1,R5\r
+       LDI     R5,AR0\r
+       MPYI    GT_SIZE,AR0\r
+       ADDI    @GAMETRAKI,AR0\r
+\r
+;      LDI     @MAXMPH,R0\r
+;      STI     R0,*+AR0(GT_MAXMPH)\r
+\r
+       LDI     1,R0\r
+       STI     R0,*+AR0(GT_POS)\r
+       STI     R0,*+AR0(GT_COLLS)\r
+\r
+       LDI     @ETIME,R0\r
+       STI     R0,*+AR0(GT_ETIME)\r
+\r
+\r
+\r
+\r
+       LDI     @RACE_MODE,R0\r
+       CMPI    RM_USA,R0\r
+       BNE     NOTNIN2\r
+\r
+\r
+       LDI     @GAMETRAKI,AR3\r
+       LDI     @BUFFERSI,AR4\r
+       CLRI    R4\r
+       FLOAT   180,R7          ;Y\r
+\r
+NXTNAME\r
+       LDI     @START_HIT,R0\r
+       BNZ     NOTNIN2\r
+\r
+       CALL    PLACE_FLAG\r
+       SLEEP   2\r
+\r
+       ADDF    10,R7\r
+       ADDI    GT_SIZE,AR3\r
+       INC     R4\r
+       CMPI    R5,R4\r
+       BLE     NXTNAME\r
+NOTNIN2\r
+\r
+\r
+       ;CHECK INITS\r
+       ;\r
+       ;SLEEP  30                      ;Make sure last flag is done\r
+       LDI     20-1,AR5\r
+PAPA35\r
+       LDI     @START_HIT,R0\r
+       BNZ     PAPA35X\r
+       SLEEP   1\r
+       DBU     AR5,PAPA35\r
+PAPA35X\r
+\r
+\r
+       ;DANGEROUS AND MESSY CODE, BUT\r
+       ;WE NEVER TOUCH THE ACTIVE LIST\r
+       ;ANYWAY, THEREFORE WE DONT NEED \r
+       ;THESE ELEMENTS\r
+       ;(OBJ_INIT CALLED IMMEDIATELY NEXT)\r
+       ;\r
+       CLRI    R0\r
+       STI     R0,@OACTIVE\r
+\r
+\r
+\r
+       READAUD ADJ_HIGH_SCORE_ENTRY\r
+       CMPI    0,R0\r
+       BEQ     NOENTER\r
+       JSRP    ENTER_INITIALS\r
+       LDF     @STEERCT,R0             ;STEERING CENTER\r
+       STF     R0,@WHEELPOS\r
+NOENTER\r
+\r
+\r
+       CLRI    R0\r
+       STI     R0,@NOSWAP              ;NO PAGE SWAPPING OFF\r
+\r
+\r
+\r
+       LDI     @RACE_MODE,R0\r
+       CMPI    RM_USA,R0\r
+       BNE     NOTNIN  \r
+       LDI     @BONUS_WAVE,R0\r
+       CMPI    14,R0\r
+       BEQ     CLINTON_SHOW\r
+NOTNIN\r
+\r
+       CLRI    R0\r
+       STI     R0,@NOSWAP\r
+       STI     R0,@NOLONG_VEHICLES\r
+\r
+\r
+       CLRF    R0\r
+       LDP     @_CAMERAPOS+X\r
+       STF     R0,@_CAMERAPOS+X\r
+       FLOAT   -1000,R0\r
+       STF     R0,@_CAMERAPOS+Y\r
+       FLOAT   -2500,R0\r
+       STF     R0,@_CAMERAPOS+Z\r
+\r
+       CLRF    R2\r
+       STF     R2,@_CAMERARAD+Y\r
+       SETDP\r
+       LDI     @CAMERAMATRIXI,AR2\r
+       CALL    FIND_YMATRIX\r
+\r
+\r
+\r
+\r
+       ;\\++\\     //--//\r
+       ;  \\++\\ //--//\r
+       ;    \\++\\ //\r
+       LDI     @RACE_MODE,R0\r
+       CMPI    RM_USA,R0\r
+       BNE     NOT_ATOZ\r
+\r
+\r
+;      CALL    CLEANUP_PALS\r
+\r
+       LDI     @BONUS_WAVE,AR0\r
+       ADDI    @FULLSETUP_TABLEI,AR0\r
+ISWRP  LDI     *AR0,R0\r
+       CALLU   R0\r
+NOT_ATOZ\r
+       SLEEP   10\r
+\r
+       LDI     1,R0\r
+       STI     R0,@DO_FOLDFLAG\r
+       SLEEP   10\r
+\r
+\r
+       LDI     @RACE_MODE,R0\r
+       CMPI    RM_USA,R0\r
+       BNE     CHOOSE_NEXT_RACE\r
+\r
+\r
+       .globl  MOTION_SCREWED\r
+       READAUD AUD_RESET_TOTALLY\r
+       CMPI    0,R0\r
+       BNE     MOTION_SCREWED\r
+\r
+\r
+       CREATE  SHOWNEXTLEG_PROC,UTIL_C|TEXTP_T\r
+\r
+       LDI     @DID_TIMED_OUT,R0               ;IF TIMED OUT THEN YOU MAY NOT GET A FREE RACE\r
+       BNZ     NOT1ST\r
+\r
+       LDI     @POSITION,R0\r
+       CMPI    1,R0\r
+       BNE     NOT1ST\r
+\r
+       READAUD ADJ_FREEGAME\r
+       CMPI    0,R0\r
+       BEQ     NOT1ST\r
+\r
+\r
+       LDI     @BONUS_WAVE,AR2\r
+       DEC     AR2\r
+       ADDI    AUD_WIN_GGATE,AR2\r
+       CALL    AUDIT_INC\r
+\r
+       INCAUD  AUD_TOTAL_FREEGAMES\r
+\r
+       LDI     @_MODE,R0\r
+       ANDN    MMODE,R0\r
+       OR      MINTRO,R0\r
+       STI     R0,@_MODE\r
+\r
+       LDI     @BONUS_WAVE,R0\r
+       STI     R0,@CHOSEN_RACE\r
+       CALL    SEND_RACENUM\r
+\r
+       BU      FINFIN\r
+       ;Has the player made Pole Position?  (1)\r
+       ;T-> Branch over this Coin Grab\r
+       ;F-> Get more coin to continue\r
+       ;\r
+NOT1ST\r
+\r
+       ;;;     SYNCED INSMORE...\r
+       ;;;     the difference is that the two machine communicate the time\r
+       ;;;     \r
+       ;;;     \r
+       JSRP    INSMORE\r
+\r
+       LDI     @_MODE,R0\r
+       ANDN    MMODE,R0\r
+       OR      MINTRO,R0\r
+       STI     R0,@_MODE\r
+\r
+*ELP CHANGE\r
+;      CALL    CLRONE          ;CAN NOW BE DUAL PLAYER\r
+*ELP END CHANGE\r
+\r
+       CMPI    1,AR6\r
+       BNE     ENDPLAYER\r
+       INCAUD  AUD_GAMES_CONTINUES\r
+       CALL    HSTDEC\r
+\r
+       LDI     @BONUS_WAVE,R0\r
+       STI     R0,@CHOSEN_RACE\r
+       CALL    SEND_RACENUM\r
+FINFIN\r
+\r
+\r
+*ELP CHANGE\r
+;      LDI     @_MODE,R0\r
+;      ANDN    MINFIN|MWATER,R0\r
+;      STI     R0,@_MODE\r
+*ELP END CHANGE\r
+\r
+       JSRP    ISSUE_STARTGAME\r
+       JSRP    WAIT_FOR_CHALLENGER\r
+\r
+\r
+\r
+       ;  /-----RACE MODE ONLY-------\r
+       ;  |\r
+       ;  V\r
+\r
+       LDI     @BONUS_WAVE,AR2\r
+       MPYI    2,AR2\r
+       ADDI    AUD_START_GGATE,AR2\r
+       CALL    AUDIT_INC\r
+\r
+\r
+\r
+       CALL    TEXT_INIT\r
+       LDI     UTIL_C|TEXTP_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+\r
+*ELP CHANGE\r
+       LDI     @_MODE,R0\r
+       ANDN    MINFIN|MWATER,R0\r
+       STI     R0,@_MODE\r
+*ELP END CHANGE\r
+\r
+\r
+       CALL    OBJ_INIT\r
+       CALL    DYNAOBJ_INIT            ;init DYNAMIC OBJECTS\r
+       CALL    CARB_INIT               ;init CAR BLOCKS\r
+       CALL    INIT_RDDEBRIS           ;initialize ROAD DEBRIS list(s)\r
+\r
+\r
+\r
+       ;;;     RE INITIALIZE TRACK...\r
+       ;;;\r
+       ;;;\r
+       CALL    TEXT_INIT\r
+       LDI     UTIL_C|TEXTP_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+       LDI     0,R0\r
+       LDI     255,R1\r
+       CALL    SET_TRACK_VOL\r
+       CALL    RESUME_TUNE_NT\r
+\r
+\r
+\r
+\r
+       LDI     BUT_VIEW2,R0                    ;BUTTON OVERWRITE (MAYBE USE MASK IN FUTURE)\r
+       STI     R0,@BUTTON_STATUS\r
+\r
+       READAUD ADJ_TIME_TO_START\r
+       MPYI    5,R0\r
+       ADDI    60,R0\r
+       STI     R0,@_countdown\r
+\r
+       LDI     @_MODE,R0\r
+       ANDN    MGO|MMODE,R0\r
+       OR      MGAME|MINFIN,R0\r
+       STI     R0,@_MODE\r
+\r
+       CREATEC FOLDMAP,UTIL_C\r
+\r
+\r
+       LDI     @BONUS_WAVE,AR0\r
+       ADDI    @BONUS_POSTLAUNCHI,AR0\r
+       LDI     *AR0,R0\r
+       CALLU   R0\r
+\r
+\r
+       LDI     @NEXT_STARTUP,R0\r
+       STI     R0,@STARTSECTION\r
+       CALL    BGD_INIT\r
+\r
+       PUSH    AR7\r
+       LDI     UTIL_C|BACKGRND_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_FIND\r
+       LDI     AR0,AR7\r
+       LDI     3,R0\r
+       STI     R0,*+AR7(PTIME)\r
+\r
+       LDI     PLYR_C|PLYR1_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_FIND\r
+       LDI     AR0,AR2\r
+       CALL    PRC_FOLLOW\r
+       POP     AR7\r
+\r
+       LDI     *+AR7(PDATA),R0\r
+       STI     R0,@BGNDCOLA\r
+\r
+       LDI     1,R0\r
+       STI     R0,@NOAERASE\r
+       CLRI    R0\r
+       STI     R0,@OHIGH_PRIORITY\r
+\r
+       CREATE  WAVEFLAG,UTIL_C|MONKEY_T\r
+\r
+       CLRI    R0\r
+       STI     R0,@DID_TIMED_OUT\r
+\r
+       CALL    INIT_GAMELEG\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*entered into from above (process)\r
+*\r
+*\r
+*\r
+*\r
+CLINTON_SHOW:\r
+       LDI     RM_SINGLE,R0\r
+       STI     R0,@RACE_MODE\r
+\r
+       LDI     1,R0\r
+       STI     R0,@DO_FOLDFLAG\r
+       LDI     UTIL_C,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+\r
+       LDI     UTIL_C|TEXTP_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+\r
+       LDI     PLYR_C|PLYR1_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+\r
+       CALL    TEXT_INIT\r
+\r
+\r
+       READAUD ADJ_CLINTON\r
+       CMPI    1,R0\r
+       BNE     NOCLINTON\r
+       JSRP    HOTTUB_SCENE\r
+NOCLINTON\r
+\r
+\r
+       ;patched from hottub.asm\r
+       ;to cure potential lockup when HOTTUB_SCENE\r
+       ;is not called.\r
+       ;Wed Mar 8 09:52:18 1995\r
+       ;\r
+       ;\r
+       SLEEP   1\r
+       CALL    OBJ_INIT\r
+       CALL    INIT_DRONES     ;initialize DRONE tracker system\r
+       CALL    DYNAOBJ_INIT    ;initialize DYNAMIC OBJECTS\r
+       CALL    CARB_INIT       ;initialize CAR BLOCKS\r
+       CALL    INIT_RDDEBRIS   ;initialize ROAD DEBRIS list(s)\r
+\r
+\r
+       LDI     1234h,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+\r
+\r
+       LDI     SPAWNER_C|ANIMATION_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+\r
+\r
+       LDL     dc_shared_PALETTES,AR2\r
+       CALL    dealloc_section\r
+       LDL     finale_PALETTES,AR2\r
+       CALL    dealloc_section\r
+       ;\r
+       ;\r
+\r
+\r
+\r
+       ;>>>insert MAP with time for entire race\r
+       ;\r
+       LDI     15,R0\r
+       STI     R0,@BONUS_WAVE\r
+       READAUD ADJ_HIGH_SCORE_ENTRY\r
+       CMPI    0,R0\r
+       BEQ     NOENTR2\r
+\r
+       JSRP    ENTER_INITIALS\r
+       LDF     @STEERCT,R0             ;STEERING CENTER\r
+       STF     R0,@WHEELPOS\r
+NOENTR2        CLRI    R0\r
+       STI     R0,@NOSWAP\r
+\r
+\r
+       CALL    OBJ_INIT\r
+\r
+       .globl  CLEAR_MAP_PALS\r
+       CALL    CLEAR_MAP_PALS\r
+\r
+\r
+       LDI     MATTR,R0\r
+       STI     R0,@_MODE\r
+\r
+       LDI     @POSITION,R0\r
+       CMPI    1,R0\r
+       BNE     JAJD\r
+       INCAUD  AUD_CREDITS\r
+       INCAUD  AUD_WIN_DC\r
+       INCAUD  AUD_TOTAL_FREEGAMES\r
+JAJD\r
+       .globl  VANITY_SUB\r
+       JSRP    VANITY_SUB\r
+       LDI     -2,R0\r
+       STI     R0,@_ATTR_MODE\r
+       BU      SET_ATTR\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       .globl  font18_white\r
+BLINK_FREEBE:\r
+       SLEEP   5\r
+       LDI     5*18,AR5\r
+BFLP1\r
+       LDI     @_MODE,R4\r
+       AND     MMODE,R4\r
+       CMPI    MATTR,R4\r
+       LDINE   70,R3\r
+       LDIEQ   125,R3\r
+\r
+       LDINE   256,R2\r
+       LDIEQ   365,R2\r
+\r
+\r
+       FLOAT   R2\r
+       FLOAT   R3\r
+       LDI     1,RC\r
+       LDL     WINT1,AR2\r
+       CALL    TEXT_ADDDS\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       ORM     TXT_CENTER,*+AR1(TEXT_COLOR)\r
+       LDL     font18_white,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(TEXT_PAL)\r
+       STI     R0,*+AR1(TEXT_PAL)\r
+\r
+       CMPI    MATTR,R4\r
+       LDINE   90,R3\r
+       LDIEQ   150,R3\r
+\r
+       LDINE   256,R2\r
+       LDIEQ   365,R2\r
+\r
+\r
+       FLOAT   R2\r
+       FLOAT   R3\r
+       LDI     1,RC\r
+       LDL     WINT2,AR2\r
+       CALL    TEXT_ADDDS\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       ORM     TXT_CENTER,*+AR1(TEXT_COLOR)\r
+       LDL     font18_white,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(TEXT_PAL)\r
+       STI     R0,*+AR1(TEXT_PAL)\r
+\r
+;insert frame rate equalizer\r
+;\r
+       SLEEP   1\r
+       DBU     AR5,BFLP1\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+BACKUP_CAMERA:\r
+       LDI     @PLYCBLK,AR0\r
+       LDI     *+AR0(CARTRAK),AR2\r
+       LDI     *+AR2(OLINK4),AR0\r
+\r
+       LDF     *+AR0(OPOSX),R2\r
+       SUBF    *+AR2(OPOSX),R2\r
+       LDF     *+AR0(OPOSZ),R3\r
+       SUBF    *+AR2(OPOSZ),R3\r
+       CALL    ARCTANF\r
+       SUBF    HALFPI,R0\r
+       LDF     R0,R2\r
+\r
+       FLOAT   -7500,R0\r
+       ADDF    @ZOOMD,R0\r
+       CALL    DISTANCE_2D\r
+\r
+       LDF     R0,R6\r
+       LDF     R1,R7\r
+\r
+       LDP     @_CAMERAPOS+X\r
+       ADDF    @_CAMERAPOS+X,R6\r
+       ADDF    @_CAMERAPOS+Z,R7\r
+       SETDP\r
+\r
+       LDI     30,AR5\r
+BACKLP\r
+       LDP     @_CAMERAPOS+X\r
+       LDF     @_CAMERAPOS+X,R0\r
+       LDF     @_CAMERAPOS+Z,R1\r
+\r
+       SUBF    R0,R6,R2\r
+       SUBF    R1,R7,R3\r
+       MPYF    0.02,R2\r
+       MPYF    0.02,R3\r
+       ADDF    R0,R2,R0\r
+       ADDF    R1,R3,R1\r
+\r
+       STF     R0,@_CAMERAPOS+X\r
+       STF     R1,@_CAMERAPOS+Z\r
+\r
+       LDF     @_CAMERAPOS+Y,R0\r
+       SUBF    10,R0\r
+       STF     R0,@_CAMERAPOS+Y\r
+       SETDP\r
+\r
+       SLEEP   1\r
+       DBU     AR5,BACKLP\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+       .bss    DID_TIMED_OUT,1\r
+*----------------------------------------------------------------------------\r
+TIMED_OUT:\r
+       LDI     1,R0\r
+       STI     R0,@DID_TIMED_OUT\r
+\r
+       INCAUD  AUD_GAMES_EXPIRED\r
+\r
+       LDI     @BONUS_WAVE,AR2\r
+       ADDI    @BONUS_TABLEI,AR2\r
+       LDI     *AR2,R0\r
+       CALLU   R0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+KILL_PLYR_SOUNDS:\r
+       LDI     1000,AR2                ;ENGINE RPM IDLE\r
+       CALL    SENDSND\r
+\r
+       LDI     SKIDB,AR2               ;KILL LOOPERS WHILE SUSPENDED\r
+       CALL    KILLSNDFX\r
+\r
+       LDI     SKIDC,AR2               ;KILL LOOPERS WHILE SUSPENDED\r
+       CALL    KILLSNDFX\r
+\r
+       LDI     BRAKSND,AR2\r
+       CALL    KILLSNDFX\r
+       \r
+       LDI     TUNSND,AR2\r
+       CALL    KILLSNDFX\r
+\r
+       LDI     GRAVELA,AR2\r
+       CALL    KILLSNDFX\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       .include        ommdfont.pal\r
+\r
+       romdata\r
+FRA1   .string "FIRST PLACE",0\r
+FRA2   .string "FREE RACE",0\r
+       .text\r
+\r
+\r
+CONGRATS       .set    4\r
+CONGRAT_SPEECHI        .word   CONGRAT_SPEECH\r
+CONGRAT_SPEECH:        .word   GL_WOOLAUGH,GL_YEAH,GL_YES,GL_YOUDIDIT\r
+\r
+\r
+FREE_RACE_ANNOUNCE:\r
+       SOND1   GETREADYTUNE\r
+\r
+       LDI     CONGRATS,AR2\r
+       CALL    RANDU0\r
+       LDI     R0,AR2\r
+       ADDI    @CONGRAT_SPEECHI,AR2\r
+       LDI     *AR2,AR2\r
+       CALL    ONESNDFX\r
+\r
+\r
+       LDI     7,AR5\r
+FRAL1\r
+       LDI     @START_HIT,R0\r
+       BNZ     PRC_SUICIDE\r
+\r
+       LDL     FRA1,AR2\r
+       FLOAT   256,R2\r
+       FLOAT   100,R3\r
+       LDI     15,RC\r
+       CALL    TEXT_ADD\r
+       CALL    SET40FONT\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+\r
+       SLEEP   9\r
+\r
+       LDL     FRA2,AR2\r
+\r
+       PUSH    AR2\r
+       READAUD ADJ_FREEGAME\r
+       POP     AR2\r
+       CMPI    0,R0\r
+       BNE     ISFREE\r
+       LDL     FRA1,AR2\r
+ISFREE\r
+\r
+       FLOAT   256,R2\r
+       FLOAT   150,R3\r
+       LDI     15,RC\r
+       CALL    TEXT_ADD\r
+       CALL    SET40FONT\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       SLEEP   10\r
+       DBU     AR5,FRAL1\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+LCTSI  .word   LCTS\r
+LNLSI  .word   LNLS\r
+       romdata\r
+LCTS   .string "RACE COMPLETED:",0\r
+LNLS   .string "NEXT RACE:",0\r
+       .text\r
+*\r
+*\r
+SHOWLEG_TIME   .set    20+20+50\r
+*\r
+*\r
+SHOWLEG_PROC:\r
+       LDI     @BONUS_WAVE,AR2\r
+       DEC     AR2\r
+       ADDI    @LEG_NAMESI,AR2\r
+       LDI     *AR2,AR2\r
+\r
+       FLOAT   256,R2\r
+       FLOAT   300,R3\r
+       LDI     SHOWLEG_TIME,RC\r
+       CALL    TEXT_ADDDS\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       ORM     TXT_CENTER,*+AR1(TEXT_COLOR)\r
+       STI     AR0,*+AR7(PDATA)\r
+       STI     AR1,*+AR7(PDATA+1)\r
+       CALL    SET18FONTDS\r
+\r
+       LDI     @LCTSI,AR2\r
+       FLOAT   256,R2\r
+       FLOAT   275,R3\r
+       LDI     SHOWLEG_TIME,RC\r
+       CALL    TEXT_ADDDS\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       ORM     TXT_CENTER,*+AR1(TEXT_COLOR)\r
+       STI     AR0,*+AR7(PDATA+2)\r
+       STI     AR1,*+AR7(PDATA+3)\r
+       CALL    SET18FONTDS\r
+\r
+\r
+\r
+       FLOAT   -100,R6\r
+       LDI     20,AR5  ;20\r
+SLLP1  FLOAT   256,R0\r
+       SUBF    R6,R0\r
+       MPYF    0.2,R0\r
+       ADDF    R0,R6\r
+\r
+       LDI     *+AR7(PDATA+1),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+3),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       LDI     *+AR7(PDATA),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+2),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       SLEEP   1\r
+       DBU     AR5,SLLP1\r
+\r
+\r
+       ;CENTER IT\r
+       ;\r
+       FLOAT   256,R6  \r
+       LDI     *+AR7(PDATA+1),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+3),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       LDI     *+AR7(PDATA),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+2),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+\r
+\r
+       SLEEP   35\r
+\r
+\r
+\r
+       LDI     20,AR5\r
+SLLP1A FLOAT   -100,R0\r
+       SUBF    R6,R0\r
+       MPYF    0.2,R0\r
+       ADDF    R0,R6\r
+\r
+       LDI     *+AR7(PDATA+1),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+3),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       LDI     *+AR7(PDATA),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+2),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       SLEEP   1\r
+       DBU     AR5,SLLP1A\r
+\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+SHOWNEXTLEG_PROC:\r
+       SLEEP   20\r
+\r
+\r
+       LDI     @BONUS_WAVE,AR2\r
+       ADDI    @LEG_NAMESI,AR2\r
+       LDI     *AR2,AR2\r
+\r
+       FLOAT   256,R2\r
+       FLOAT   50,R3\r
+       LDI     SHOWLEG_TIME,RC\r
+       CALL    TEXT_ADDDS\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       ORM     TXT_CENTER,*+AR1(TEXT_COLOR)\r
+       STI     AR0,*+AR7(PDATA)\r
+       STI     AR1,*+AR7(PDATA+1)\r
+       CALL    SET18FONTDS\r
+\r
+       LDI     @LNLSI,AR2\r
+       FLOAT   256,R2\r
+;      FLOAT   275,R3\r
+       FLOAT   25,R3\r
+       LDI     SHOWLEG_TIME,RC\r
+       CALL    TEXT_ADDDS\r
+       ORM     TXT_CENTER,*+AR0(TEXT_COLOR)\r
+       ORM     TXT_CENTER,*+AR1(TEXT_COLOR)\r
+       STI     AR0,*+AR7(PDATA+2)\r
+       STI     AR1,*+AR7(PDATA+3)\r
+       CALL    SET18FONTDS\r
+\r
+\r
+\r
+       FLOAT   600,R6\r
+       LDI     16,AR5\r
+SLLP2  FLOAT   256,R0\r
+       SUBF    R6,R0\r
+       MPYF    0.25,R0\r
+       ADDF    R0,R6\r
+\r
+       LDI     *+AR7(PDATA+1),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+3),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       LDI     *+AR7(PDATA),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+2),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       SLEEP   1\r
+       DBU     AR5,SLLP2\r
+\r
+\r
+       ;CENTER IT\r
+       ;\r
+       FLOAT   256,R6  \r
+       LDI     *+AR7(PDATA+1),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+3),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       LDI     *+AR7(PDATA),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+2),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+\r
+\r
+       SLEEP   50\r
+\r
+\r
+       LDI     215,AR5\r
+SLLP2A FLOAT   600,R0\r
+       SUBF    R6,R0\r
+       MPYF    0.25,R0\r
+       ADDF    R0,R6\r
+\r
+       LDI     *+AR7(PDATA+1),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+3),AR0\r
+       STF     R6,*+AR0(TEXT_POSX)\r
+\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       LDI     *+AR7(PDATA),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+2),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+       SLEEP   1\r
+       DBU     AR5,SLLP2A\r
+\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*PARAMETERS\r
+*      R4      INDEX\r
+*\r
+*\r
+FLAG_POS_TABLEI        .word   FLAG_POS_TABLE\r
+       romdata\r
+FLAG_POS_TABLE\r
+       .word    36,133 ;GGpark\r
+       .word    39,147 ;Sanfran\r
+       .word    40,156 ;I101\r
+       .word    43,166 ;Redwds\r
+       .word    63,192 ;BeverlyHils\r
+       .word    76,200 ;LA freeway\r
+       .word    88,190 ;Deathvalley\r
+       .word   128,198 ;Arizona\r
+       .word   257,106 ;Mount Rush\r
+       .word   302,125 ;Iowa\r
+       .word   334,125 ;Chicago\r
+       .word   358,134 ;Indiana\r
+       .word   412,129 ;Appalachia\r
+       .word   434,140 ;Washington\r
+       .text\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*PARAMETERS\r
+*      R4      INDEX\r
+*\r
+PLACE_FLAG:\r
+       PUSH    AR0\r
+       PUSH    AR4\r
+       PUSH    R2\r
+       PUSH    R3\r
+       PUSH    RC\r
+       LDI     R4,AR0\r
+       MPYI    2,AR0\r
+       ADDI    @FLAG_POS_TABLEI,AR0\r
+       LDI     *AR0,R2\r
+       SUBI    256,R2\r
+       LDI     *+AR0,R3\r
+       SUBI    200-20,R3\r
+       LDI     367,RC\r
+       LDL     star,AR2\r
+       CALL    OBJ_QMAKE\r
+\r
+       LDIL    O_3DROT,R0\r
+       OR      O_NOUROT|O_NOUNIV,R0\r
+       OR      *+AR0(OFLAGS),R0\r
+       STI     R0,*+AR0(OFLAGS)\r
+\r
+       LDI     AR0,AR2\r
+       CALL    OBJ_INSERTHP\r
+\r
+\r
+       LDI     AR0,AR4\r
+       LDF     *+AR4(OPOSX),R0\r
+       STF     R0,*+AR4(OVELX)\r
+       LDF     *+AR4(OPOSY),R0\r
+       STF     R0,*+AR4(OVELY)\r
+\r
+       LDF     100,R0\r
+       CALL    SFRAND\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       FLOAT   -230,R0\r
+       STF     R0,*+AR4(OPOSY)\r
+       CREATEC PLACE_FLAG_PROC,UTIL_C\r
+\r
+\r
+       SONDFX  MAPSTAR2\r
+\r
+       POP     RC\r
+       POP     RC\r
+       POP     R2\r
+       POP     AR4\r
+       POP     AR0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*PARAMETERS\r
+*      AR4     OBJECT\r
+*      AR4     *+(OVEL) POSITION TO ACHIEVE\r
+*\r
+*\r
+PLACE_FLAG_PROC:\r
+       LDI     12,AR5\r
+PFPLP\r
+       LDF     *+AR4(OVELX),R0\r
+       SUBF    *+AR4(OPOSX),R0\r
+       MPYF    0.25,R0\r
+       ADDF    *+AR4(OPOSX),R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR4(OVELY),R1\r
+       SUBF    *+AR4(OPOSY),R1\r
+       MPYF    0.25,R1\r
+       ADDF    *+AR4(OPOSY),R1\r
+       STF     R1,*+AR4(OPOSY)\r
+\r
+       MPYF    R1,R1\r
+       MPYF    R0,R0\r
+       ADDF    R1,R0\r
+       CMPF    25,R0\r
+       BLT     ALLDN7\r
+\r
+\r
+       LDF     *+AR4(ORADZ),R2\r
+       ADDF    0.1,R2\r
+       STF     R2,*+AR4(ORADZ)\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    FIND_ZMATRIX\r
+\r
+       SLEEP   1\r
+       DBU     AR5,PFPLP\r
+\r
+ALLDN7\r
+       LDF     *+AR4(OVELX),R0\r
+       STF     R0,*+AR4(OPOSX)\r
+\r
+       LDF     *+AR4(OVELY),R0\r
+       STF     R0,*+AR4(OPOSY)\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       romdata\r
+BT1    .string "AVERAGE MPH:",0\r
+BT1A   .string "AVERAGE KPH:",0\r
+       .text\r
+BONS_MAXMPH:\r
+\r
+       LDL     BT1,R6\r
+       LDL     BT1A,R7\r
+\r
+       READAUD ADJ_MPHORKPM\r
+       CMPI    0,R0\r
+       LDIEQ   R6,AR2\r
+       LDINE   R7,AR2\r
+\r
+       FLOAT   0,R2\r
+       FLOAT   20,R3\r
+       LDI     999,RC\r
+       CALL    TEXT_ADDDS\r
+       STI     AR0,*+AR7(PDATA+10)     ;SHADOW\r
+       STI     AR1,*+AR7(PDATA+11)     ;ACTUAL\r
+\r
+       LDI     *+AR0(TEXT_COLOR),R0\r
+       OR      TXT_RIGHT,R0\r
+       STI     R0,*+AR0(TEXT_COLOR)\r
+       LDI     *+AR1(TEXT_COLOR),R0\r
+       OR      TXT_RIGHT,R0\r
+       STI     R0,*+AR1(TEXT_COLOR)\r
+\r
+\r
+       READAUD ADJ_MPHORKPM\r
+       CMPI    0,R0\r
+       BEQ     ISMPHT\r
+\r
+       LDF     @MAXMPH,R0\r
+       MPYF    1.6666,R0\r
+       BU      KJL\r
+\r
+ISMPHT LDF     @MAXMPH,R0\r
+KJL    LDF     @MAXMPH_COUNT,R1\r
+       CALL    DIV_F\r
+       FIX     R0,R2\r
+       LDI     AR7,AR2\r
+       ADDI    PDATA,AR2\r
+       CALL    _itoa\r
+       FLOAT   512,R2\r
+       FLOAT   20,R3\r
+       LDI     999,RC\r
+       CALL    TEXT_ADDDS\r
+       CALL    SETLGDIGITFONTDS\r
+       STI     AR0,*+AR7(PDATA+12)\r
+       STI     AR1,*+AR7(PDATA+13)\r
+       .globl  dnums_amber\r
+       LDL     dnums_amber,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(TEXT_PAL)\r
+       STI     R0,*+AR1(TEXT_PAL)\r
+\r
+\r
+       CLRF    R0\r
+       STF     R0,@MAXMPH\r
+       STF     R0,@MAXMPH_COUNT\r
+\r
+\r
+ENTER_HERE:\r
+       LDI     31,AR5\r
+       CLRF    R6              ;FIXED STF\r
+       FLOAT   512,R7          ;FLT STF\r
+BML\r
+       FLOAT   250,R0\r
+       SUBF    R6,R0\r
+       MPYF    0.1,R0\r
+\r
+\r
+       CMPF    8,R0\r
+       LDFLT   8,R0\r
+\r
+\r
+       ADDF    R0,R6\r
+\r
+       FLOAT   250,R0\r
+       CMPF    R0,R6\r
+       LDFGT   R0,R6\r
+\r
+       LDI     *+AR7(PDATA+10),AR0\r
+       LDI     *+AR7(PDATA+11),AR1\r
+       STF     R6,*+AR1(TEXT_POSX)\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+\r
+\r
+       FLOAT   260,R0\r
+       SUBF    R7,R0\r
+       MPYF    0.20,R0\r
+\r
+       CMPF    -12,R0\r
+       LDFLT   -12,R0\r
+\r
+       ADDF    R0,R7\r
+\r
+       FLOAT   260,R0\r
+       CMPF    R0,R7\r
+       LDFLT   R0,R7\r
+\r
+       LDI     *+AR7(PDATA+12),AR0\r
+       LDI     *+AR7(PDATA+13),AR1\r
+       STF     R7,*+AR1(TEXT_POSX)\r
+       LDF     R7,R0\r
+       ADDF    3,R0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+\r
+       SLEEP   1\r
+       DBU     AR5,BML\r
+\r
+       FLOAT   250,R0\r
+       FLOAT   253,R1\r
+       FLOAT   260,R2\r
+       FLOAT   263,R3\r
+\r
+       LDI     *+AR7(PDATA+10),AR0\r
+       STF     R1,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+11),AR0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+\r
+       LDI     *+AR7(PDATA+12),AR0\r
+       STF     R3,*+AR0(TEXT_POSX)\r
+       LDI     *+AR7(PDATA+13),AR0\r
+       STF     R2,*+AR0(TEXT_POSX)\r
+\r
+\r
+KKL    SLEEP   1\r
+       LDI     @DO_FOLDFLAG,R0\r
+       BZ      KKL\r
+\r
+       SONDFX  WIPE2\r
+\r
+       LDI     31,AR5\r
+       FLOAT   250,R6          ;FIXED STF\r
+       FLOAT   260,R7          ;FLT STF\r
+BML2\r
+       FLOAT   -20,R0\r
+       SUBF    R6,R0\r
+       MPYF    0.1,R0\r
+       ADDF    R0,R6\r
+       LDI     *+AR7(PDATA+10),AR0\r
+       LDI     *+AR7(PDATA+11),AR1\r
+       STF     R6,*+AR1(TEXT_POSX)\r
+       LDF     R6,R0\r
+       ADDF    3,R0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+\r
+       FLOAT   532,R0\r
+       SUBF    R7,R0\r
+       MPYF    0.1,R0\r
+       ADDF    R0,R7\r
+       LDI     *+AR7(PDATA+12),AR0\r
+       LDI     *+AR7(PDATA+13),AR1\r
+       STF     R7,*+AR1(TEXT_POSX)\r
+       LDF     R7,R0\r
+       ADDF    3,R0\r
+       STF     R0,*+AR0(TEXT_POSX)\r
+\r
+       SLEEP   1\r
+       DBU     AR5,BML2\r
+\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       romdata\r
+RT2    .string "RECORD TIME:",0                ;coded time format\r
+       .text\r
+\r
+BONS_RECORDTIME:\r
+       SLEEP   5\r
+       LDL     RT2,AR2\r
+       FLOAT   0,R2\r
+       FLOAT   120,R3\r
+       LDI     999,RC\r
+       CALL    TEXT_ADDDS\r
+       CALL    SET18FONTDS\r
+\r
+       LDI     *+AR0(TEXT_COLOR),R0\r
+       OR      TXT_RIGHT,R0\r
+       STI     R0,*+AR0(TEXT_COLOR)\r
+       LDI     *+AR1(TEXT_COLOR),R0\r
+       OR      TXT_RIGHT,R0\r
+       STI     R0,*+AR1(TEXT_COLOR)\r
+\r
+       STI     AR0,*+AR7(PDATA+10)\r
+       STI     AR1,*+AR7(PDATA+11)\r
+\r
+\r
+\r
+       LDI     @BONUS_WAVE,R6\r
+       DEC     R6\r
+       LDI     0,R7\r
+       CALL    GET_TABLE_ADDR\r
+       CALL    TABLE_ENTRY_READ\r
+       ;\r
+       ;R0     time code\r
+       ;R1     init 1\r
+       ;R2     init 2\r
+       ;R3     init 3\r
+       ;\r
+       LDI     AR7,AR1\r
+       ADDI    PDATA+14,AR1\r
+\r
+       AND     0FFh,R1\r
+       AND     0FFh,R2\r
+       AND     0FFh,R3\r
+       LS      8,R2\r
+       OR      R2,R1\r
+       LS      16,R3\r
+       OR      R3,R1\r
+       LDI     ' ',R2\r
+       LS      24,R2\r
+       OR      R2,R1\r
+       STI     R1,*AR1\r
+       LDI     ' ',R2\r
+       STI     R2,*+AR1\r
+\r
+       LDI     AR7,AR2\r
+       ADDI    PDATA,AR2\r
+       CALL    TIME2STR\r
+\r
+       LDI     AR1,AR0\r
+       LDI     AR2,AR1\r
+       LDI     AR0,AR2\r
+       CALL    STRCAT          ;AR1 from above\r
+\r
+\r
+       FLOAT   512,R2\r
+       FLOAT   120,R3\r
+       LDI     999,RC\r
+       CALL    TEXT_ADDDS\r
+       CALL    SET18FONTDS\r
+       STI     AR0,*+AR7(PDATA+12)\r
+       STI     AR1,*+AR7(PDATA+13)\r
+\r
+\r
+       BU      ENTER_HERE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       romdata\r
+HH1    .string "NEW RECORD TIME",0\r
+HH2    .string "NEW HOT TIME",0\r
+       .text\r
+BONS_HOTTIME_REC:\r
+       CLRI    R4                      ;ON OFF TOGGLE\r
+       SLEEP   5\r
+       LDL     HH1,AR2\r
+       BU      BLAHB\r
+\r
+BONS_HOTTIME:\r
+       CLRI    R4                      ;ON OFF TOGGLE\r
+       SLEEP   5\r
+       LDL     HH2,AR2\r
+BLAHB  STI     AR2,*+AR7(PDATA)\r
+       FLOAT   256,R2\r
+       FLOAT   (150+300),R3\r
+       LDI     999,RC\r
+       CALL    TEXT_ADDDS\r
+\r
+       LDI     *+AR0(TEXT_COLOR),R0\r
+       OR      TXT_CENTER,R0\r
+       STI     R0,*+AR0(TEXT_COLOR)\r
+       LDI     *+AR1(TEXT_COLOR),R0\r
+       OR      TXT_CENTER,R0\r
+       STI     R0,*+AR1(TEXT_COLOR)\r
+\r
+       LDI     AR0,AR4\r
+       LDI     AR1,AR5\r
+\r
+       .globl  font18_white\r
+       LDL     font18_white,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR4(TEXT_PAL)\r
+       STI     R0,*+AR5(TEXT_PAL)\r
+\r
+\r
+BONHTLP\r
+\r
+       LDF     *+AR4(TEXT_POSY),R0\r
+       FLOAT   152,R1\r
+       LDF     R1,R3\r
+\r
+       SUBF    R0,R1,R1\r
+       MPYF    0.1,R1\r
+       ADDF    R0,R1\r
+\r
+       CMPF    R3,R1\r
+       LDFLT   R3,R1\r
+       STF     R1,*+AR4(TEXT_POSY)\r
+\r
+\r
+       LDF     *+AR5(TEXT_POSY),R0\r
+       FLOAT   150,R1\r
+       LDF     R1,R3\r
+       SUBF    R0,R1,R1\r
+       MPYF    0.1,R1\r
+       ADDF    R0,R1\r
+\r
+       CMPF    R3,R1\r
+       LDFLT   R3,R1\r
+       STF     R1,*+AR5(TEXT_POSY)\r
+\r
+       CALL    TEXTTOG\r
+\r
+\r
+       SLEEP   1\r
+       LDI     @DO_FOLDFLAG,R0\r
+       BZ      BONHTLP\r
+\r
+\r
+BONHTLP2\r
+\r
+       LDF     *+AR4(TEXT_POSY),R0\r
+       FLOAT   152+300,R1\r
+       LDF     R1,R3\r
+\r
+       SUBF    R0,R1,R1\r
+       MPYF    0.1,R1\r
+       ADDF    R0,R1\r
+\r
+       CMPF    R3,R1\r
+       LDFGT   R3,R1\r
+       STF     R1,*+AR4(TEXT_POSY)\r
+\r
+\r
+       LDF     *+AR5(TEXT_POSY),R0\r
+       FLOAT   150+300,R1\r
+       LDF     R1,R3\r
+       SUBF    R0,R1,R1\r
+       MPYF    0.1,R1\r
+       ADDF    R0,R1\r
+\r
+       CMPF    R3,R1\r
+       LDFGT   R3,R1\r
+       STF     R1,*+AR5(TEXT_POSY)\r
+\r
+       SLEEP   1\r
+       BU      BONHTLP2\r
+\r
+BADA   LDI     1,R0\r
+       STI     R0,*+AR4(TEXT_TIKS)\r
+       STI     R0,*+AR5(TEXT_TIKS)\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+*----------------------------------------------------------------------------\r
+TEXTTOG:\r
+\r
+       ADDI    @NFRAMES,R4\r
+       CMPI    30,R4\r
+       BLT     ISOFF\r
+\r
+       CMPI    35,R4\r
+       BLT     GAGA\r
+       CLRI    R4\r
+GAGA\r
+\r
+       LDL     NULLSTR5,R0\r
+       BU      IBOIBO\r
+ISOFF  LDI     *+AR7(PDATA),R0\r
+IBOIBO STI     R0,*+AR4(TEXT_PTR)\r
+       STI     R0,*+AR5(TEXT_PTR)\r
+       RETS\r
+       romdata\r
+NULLSTR5       .string " ",0\r
+       .text\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       romdata\r
+BT2    .string "ELAPSED TIME:",0               ;coded time format\r
+       .text\r
+\r
+BONS_ETIME:\r
+       SLEEP   5\r
+       LDL     BT2,AR2\r
+       FLOAT   0,R2\r
+       FLOAT   50,R3\r
+       LDI     999,RC\r
+       CALL    TEXT_ADDDS\r
+       CALL    SET18FONTDS\r
+\r
+       LDI     *+AR0(TEXT_COLOR),R0\r
+       OR      TXT_RIGHT,R0\r
+       STI     R0,*+AR0(TEXT_COLOR)\r
+       LDI     *+AR1(TEXT_COLOR),R0\r
+       OR      TXT_RIGHT,R0\r
+       STI     R0,*+AR1(TEXT_COLOR)\r
+\r
+       STI     AR0,*+AR7(PDATA+10)\r
+       STI     AR1,*+AR7(PDATA+11)\r
+\r
+\r
+       LDI     @DID_TIMED_OUT,R0\r
+       BZ      DOREG3\r
+\r
+       LDI     0,R0            ;ELAPSED TIME OF 0 = DID NOT FINISH\r
+       STI     R0,@ETIME\r
+\r
+       LDL     EXPIRED,AR2\r
+       BU      LREG3\r
+\r
+DOREG3 LDI     @STOPWATCH,R0\r
+       STI     R0,@ETIME\r
+       LDI     AR7,AR2\r
+       ADDI    PDATA,AR2\r
+       CALL    TIME2STR\r
+\r
+LREG3\r
+       FLOAT   512,R2\r
+       FLOAT   50,R3\r
+       LDI     999,RC\r
+       CALL    TEXT_ADDDS\r
+       CALL    SET18FONTDS\r
+       STI     AR0,*+AR7(PDATA+12)\r
+       STI     AR1,*+AR7(PDATA+13)\r
+\r
+\r
+       .globl  font18_white\r
+       LDL     font18_white,AR2\r
+       CALL    PAL_FIND_RAW\r
+       STI     R0,*+AR0(TEXT_PAL)\r
+       STI     R0,*+AR1(TEXT_PAL)\r
+\r
+       CLRI    R0\r
+       STI     R0,@STOPWATCH\r
+       BU      ENTER_HERE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+       romdata\r
+BT3    .string "POSITION:",0           ;coded time format\r
+       .text\r
+BONS_POSITION:\r
+\r
+       LDI     @POSITION,AR4\r
+       DEC     AR4\r
+       MPYI    3,AR4\r
+       ADDI    @POS_TABLEI,AR4\r
+\r
+       LDI     -60,R5          ;YPOS\r
+\r
+       LDI     40,AR6\r
+BPL1\r
+       FLOAT   R5,R0\r
+       LDF     R0,R1\r
+       FLOAT   138-60,R2\r
+       SUBRF   R2,R0\r
+       MPYF    0.2,R0\r
+       ADDF    R1,R0\r
+       FIX     R0,R5\r
+       \r
+       LDI     *AR4,AR2\r
+       LDI     220,R2\r
+       ADDI    *+AR4(2),R2\r
+       LDI     R5,R3\r
+       LDI     TM|ZS,R4\r
+       CALL    BLTMOD2D_DS\r
+\r
+       LDI     *+AR4(1),AR2\r
+       LDI     220+35,R2\r
+       LDI     R5,R3\r
+       LDI     TM|ZS,R4\r
+       CALL    BLTMOD2D_DS\r
+       SLEEP   1\r
+       DBU     AR6,BPL1\r
+\r
+\r
+\r
+       LDI     158,AR6\r
+BPL2\r
+       LDI     *AR4,AR2\r
+       LDI     220,R2\r
+       ADDI    *+AR4(2),R2\r
+       LDI     R5,R3\r
+       LDI     TM|ZS,R4\r
+       CALL    BLTMOD2D_DS\r
+\r
+       LDI     *+AR4(1),AR2\r
+       LDI     220+35,R2\r
+       LDI     R5,R3\r
+       LDI     TM|ZS,R4\r
+       CALL    BLTMOD2D_DS\r
+       SLEEP   1\r
+\r
+       LDI     @DO_FOLDFLAG,R0\r
+       BZ      BPL2\r
+\r
+\r
+       LDI     40,AR6\r
+BPL3\r
+       FLOAT   R5,R0\r
+       LDF     R0,R1\r
+       SUBRF   -60,R0\r
+       MPYF    0.2,R0\r
+       ADDF    R1,R0\r
+       FIX     R0,R5\r
+\r
+       LDI     *AR4,AR2\r
+       LDI     220,R2\r
+       ADDI    *+AR4(2),R2\r
+       LDI     R5,R3\r
+       LDI     TM|ZS,R4\r
+       CALL    BLTMOD2D_DS\r
+\r
+       LDI     *+AR4(1),AR2\r
+       LDI     220+35,R2\r
+       LDI     R5,R3\r
+       LDI     TM|ZS,R4\r
+       CALL    BLTMOD2D_DS\r
+       SLEEP   1\r
+       DBU     AR6,BPL3\r
+       DIE\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+KILL_THEM:\r
+       ;KILL ALL DRONES\r
+       LDI     DRONE_C,R0\r
+       LDI     CLASS_M,R1\r
+       CALL    PRC_KILLALL\r
+\r
+       ;TRAFFIC\r
+       LDI     SPAWNER_C,R0\r
+       LDI     CLASS_M,R1\r
+       CALL    PRC_KILLALL\r
+\r
+       ;WAVEFLAG, MONKEYs\r
+       LDI     UTIL_C|MONKEY_T,R0\r
+       LDI     CLASS_M|TYPE_M,R1\r
+       CALL    PRC_KILLALL\r
+\r
+       ;LBACK_WATCH\r
+       LDI     UTIL_C|BACKGRND_T,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+\r
+       CALL    DELETE_SPLAT\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+FIND_AND_REACTIVATE:\r
+       PUSH    AR0\r
+       PUSH    AR4\r
+\r
+       LDI     @OACTIVE,AR0\r
+FARLP  LDI     *AR0,R0\r
+       BZ      FARX\r
+\r
+       LDI     R0,AR0\r
+       LDI     *+AR0(OID),R0\r
+       CMPI    RDDEBRIS_C|TSC_IGNORE|TSC_DUDE_S,R0\r
+       BNE     NOTRUT\r
+\r
+       LDI     AR0,AR4\r
+       .globl  RUT_ANI\r
+       CALL    RUT_ANI\r
+       BU      FARLP\r
+\r
+NOTRUT CMPI    RDDEBRIS_C|TSC_IGNORE|TSC_BABE_S,R0\r
+       BNE     FARLP\r
+       LDI     AR0,AR4\r
+\r
+       .global HUNGH_ANI_REENTER\r
+       CALL    HUNGH_ANI_REENTER\r
+\r
+       BU      FARLP\r
+\r
+FARX\r
+       POP     AR4\r
+       POP     AR0\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+KILL_THE_REANIMATORS:\r
+       LDI     SPAWNER_C|ANIMATION_T|7,R0\r
+       LDI     -1,R1\r
+       CALL    PRC_KILLALL\r
+       RETS\r
+*----------------------------------------------------------------------------\r
+       .END\r
+\r
diff --git a/BSSSTART.ASM b/BSSSTART.ASM
new file mode 100755 (executable)
index 0000000..a016105
--- /dev/null
@@ -0,0 +1,12 @@
+       .FILE   "BSSSTART.ASM"\r
+*----------------------------------------------------------------------------\r
+*\r
+*\r
+*COPYRIGHT (C) 1994 BY  TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+\r
+       .include        MACS.EQU\r
+\r
+       .globl  BSSSTART\r
+       lobss   BSSSTART,0      ;THIS MUST BE THE FIRST SYMBOL IN BSS\r
diff --git a/C30.EQU b/C30.EQU
new file mode 100755 (executable)
index 0000000..5c6d110
--- /dev/null
+++ b/C30.EQU
@@ -0,0 +1,51 @@
+*C30.EQU\r
+*\r
+*COPYRIGHT (C) 1994  BY TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*STATUS WORD FLAGS\r
+INT0_M         .set    1               ;DISPLAY INT\r
+INT1_M         .set    2               ;TV30 INT\r
+INT2_M         .set    4               ;COMM INT\r
+INT3_M         .set    8               ;ATOD INT\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*ON CHIP RAM BLOCKS\r
+RAM0           .set    0809800h\r
+RAM1           .set    0809C00h\r
+\r
+*----------------------------------------------------------------------------\r
+*WAIT STATE GENERATION\r
+CPU_WS         .set    0808064h        ;WAIT STATE CPU CONTROL REGISTER\r
+\r
+SOFT_WS                .set    00470h\r
+\r
+HARD_WS                .set    01000h          ;WAVE RAM & SCREEN RAM\r
+CMOS_WS                .set    00090h          ;CMOS ACCESS\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*TIMER DEFINES\r
+*\r
+TIMER_CNTL1    .set    808020h\r
+TIMER_CNTL2    .set    808030h\r
+TIMER_CNTR1    .set    808024h\r
+TIMER_CNTR2    .set    808034h\r
+TIMER_PERIOD1  .set    808028h\r
+TIMER_PERIOD2  .set    808038h\r
+\r
+\r
+TMR_GO         .set    40h     ;reset and start timer counter\r
+TMR_HOLD       .set    80h     ;=0 -> suspend\r
+\r
+TMR_RESET_GO   .set    TMR_GO|TMR_HOLD\r
+TMR_SUSPEND    .set    0\r
+\r
+\r
+       .globl  TIMER_RESET,TIMER_READ\r
+\r
diff --git a/CHECKSUM.EQU b/CHECKSUM.EQU
new file mode 100755 (executable)
index 0000000..717c9c3
--- /dev/null
@@ -0,0 +1 @@
+CHECKSUM_GEN .set 0 \r
diff --git a/CHOPPER.ASM b/CHOPPER.ASM
new file mode 100755 (executable)
index 0000000..f522592
--- /dev/null
@@ -0,0 +1,1673 @@
+       .FILE   "CHOPPER.ASM"\r
+*----------------------------------------------------------------------------\r
+*CHOPPER IN THE SKY\r
+*\r
+*COPYRIGHT (C) 1994 BY  TV GAMES, INC.\r
+*ALL RIGHTS RESERVED\r
+*\r
+\r
+       .include        MACS.EQU\r
+       .include        MPROC.EQU\r
+       .include        OBJ.EQU\r
+       .include        VUNIT.EQU\r
+       .include        CMOS.EQU\r
+       .include        SYSID.EQU\r
+       .include        SYS.EQU\r
+       .include        GLOBALS.EQU\r
+       .include        SNDTAB.EQU\r
+       .include        PALL.EQU\r
+       .include        OBJECTS.EQU\r
+       .include        TEXT.EQU\r
+       .include        DELTA.EQU\r
+\r
+       .bss    HELI_ABORT,1    ;P      abort chopper routine?\r
+\r
+*\r
+*      !!!!NO JSRPing!!!!\r
+*\r
+\r
+*LOCALS  (AFTER DELTA EQUATES)\r
+CD_ANIPROC     .set    PDATA+18\r
+CD_MODE                .set    PDATA+19\r
+CD_ACC         .set    PDATA+20        ;acceleration\r
+CD_SPEED       .set    PDATA+21        ;current speed\r
+CD_BOMBTIK     .set    PDATA+22        ;bomb pause\r
+CD_TSPEED      .set    PDATA+23        ;true speed (x/y/z)\r
+CD_TSPEED_OLD  .set    PDATA+24        ;old true speed (x/y/z)\r
+CD_FLYTDIR     .set    PDATA+25        ;breakaway theta\r
+CD_DHEIGHT     .set    PDATA+26        ;FL desired height value\r
+CD_ODHEIGHT    .set    PDATA+27        ;FL old desired height value\r
+CD_CLOSEROAD   .set    PDATA+28        ;UD closest road object\r
+CD_AHEADP      .set    PDATA+29        ;UD     flag ahead of player?\r
+CD_PASS_COUNT  .set    PDATA+30\r
+CD_BOMB_COUNT  .set    PDATA+31\r
+CD_MAX_PASSES  .set    PDATA+32\r
+CD_MAX_BOMBS   .set    PDATA+33\r
+CD_LASTPASS    .set    PDATA+34        ;P\r
+CD_DOATTACK    .set    PDATA+35        ;P\r
+*NO MORE UNLESS NOT JSRPing\r
+\r
+*CHOPPER MODE\r
+CM_CU          .set    1               ;CATCH UP\r
+CM_DB          .set    2               ;DROP BOMBS\r
+CM_FA          .set    3               ;FLY AWAY\r
+\r
+CRADZ  .set    OUSR1\r
+\r
+MAX_SPEED      .set    667             ;about 180 mph\r
+\r
+*----------------------------------------------------------------------------\r
+CHOPPERDYNA\r
+       .word   1               ;#OF DYNAS-1\r
+\r
+       .float  0,-206,14       ;blades\r
+       .word   3               ;VERTS-1\r
+       .word   1               ;DYNAFLAG\r
+\r
+       .float  0,0,0           ;main body\r
+       .word   94              ;VERTS-1\r
+       .word   1               ;DYNAFLAG\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+*---------------------------------------------------------------------------\r
+*\r
+*go straight for the plyrs car\r
+*\r
+*(already close by)\r
+*branched to from oncoming buzz\r
+*\r
+*\r
+DIRECT_ATTACK:\r
+\r
+       ;\r
+       ;DEBUG  only attack player when he is in the first position\r
+       ;\r
+       LDI     @POSITION,R0\r
+       CMPI    1,R0\r
+       BNE     FLYAWAY\r
+       ;\r
+       ;\r
+\r
+\r
+       CALL    DIST_TO_PLYR\r
+       LDF     *+AR7(DELTA_PLYRDIST),R1\r
+       STF     R0,*+AR7(DELTA_PLYRDIST)\r
+       STF     R1,*+AR7(DELTA_OPLYRDIST)\r
+\r
+\r
+       CALL    HELI_SND\r
+\r
+       ;see if we should track the next piece\r
+CHECK_DIST28:\r
+       LDI     *+AR7(DELTA_LAST_OID),R0        ;CHECK TO SEE IF IT IS IN THE RANGE\r
+       RS      8,R0\r
+       LDI     @SECTIONIDX,R1\r
+       SUBPI   @DGROUP_COUNT,R1\r
+       CMPI    R1,R0\r
+       BLE     FLYAWAY         ;CHOPPER_DIE\r
+\r
+\r
+       LDI     *+AR7(DELTA_TPIECE),AR2\r
+       LDI     *+AR2(OBLINK4),R0\r
+       BZ      FLYAWAY ;CHOPPER_DIE\r
+\r
+       LDI     @PLYCBLK,AR2\r
+       LDF     *+AR2(CARDIST2CNTR),R0\r
+       STF     R0,*+AR7(DELTA_XLANE)\r
+\r
+       CALL    GET_TRACK_POS_RVS_XLANE         ;CHECK IF WE SHOULD ADVANCE \r
+       FLOAT   5000,R1                         ;TO THE NEXT ROADPIECE\r
+       CMPF    R1,R0\r
+       BGT     THIS_PIECE28\r
+\r
+       LDI     *+AR7(DELTA_TPIECE),AR2\r
+       LDI     *+AR2(OBLINK4),R0\r
+       STI     R0,*+AR7(DELTA_TPIECE)\r
+       LDI     R0,AR0\r
+       LDI     *+AR0(OUSR1),R0\r
+       STI     R0,*+AR7(DELTA_LAST_OID)        ;SAVE THE LAST KNOWN VALID OID\r
+       BU      CHECK_DIST28\r
+THIS_PIECE28\r
+\r
+\r
+       FLOATP  @NFRAMES,R1\r
+       MPYF    *+AR7(CD_TSPEED),R1\r
+       LDFLE   30,R1                   ;if 0 or less assume 30 voxel per frame\r
+       CALL    DIV_F                   ;R0/R1 (distance to piece/speed) -> # frames to achieve\r
+       FIX     R0,R7\r
+\r
+       LDI     *+AR7(DELTA_TPIECE),AR2\r
+       LDP     @_VECTORA               ;lane position\r
+       LDF     *+AR2(OPOSX),R2         ;X\r
+       SUBF    *+AR4(OPOSX),R2\r
+       ADDF    @_VECTORA+X,R2\r
+       LDF     *+AR2(OPOSZ),R3         ;Z\r
+       SUBF    *+AR4(OPOSZ),R3\r
+       ADDF    @_VECTORA+Z,R3\r
+       SETDP\r
+\r
+\r
+\r
+       ;find the theta delta to this position\r
+       ;\r
+       CALL    ARCTANF                 ;-> R0\r
+       SUBF    HALFPI,R0               ;R0     DESIRED THETA (float)\r
+\r
+       LDF     *+AR4(ORADY),R2         ;R2     CURRENT THETA\r
+       CALL    GETTHETADIFF            ;->R0   THETA DELTA (float)\r
+       FLOAT   R7,R1                   ;theta / number of turns to achieve\r
+       SUBF    1,R1\r
+       BLE     NODIV8\r
+       CALL    DIV_F                   ;-> R0\r
+NODIV8\r
+       CMPF    0.3926,R0               ;PI/8 (maximum turning radius)\r
+       LDFGT   0.3926,R0\r
+       CMPF    -0.3926,R0\r
+       LDFLT   -0.3926,R0\r
+       STF     R0,*+AR7(DELTA_RADYDELTA)\r
+\r
+\r
+       PUSH    AR4\r
+       ADDI    OPOSX,AR4\r
+       CALL    CAMSCAN\r
+       POP     AR4\r
+       BNC     LLK28\r
+\r
+       NEGF    R0\r
+       FLOAT   -300,R1\r
+       SUBF    R1,R0\r
+       NEGF    R0\r
+       ADDF    *+AR4(OPOSY),R0\r
+       STF     R0,*+AR7(CD_DHEIGHT)\r
+LLK28\r
+\r
+       LDF     *+AR7(CD_SPEED),R0\r
+       ADDF    *+AR7(CD_ACC),R0\r
+       FLOAT   MAX_SPEED,R1\r
+       CMPF    R1,R0\r
+       LDFGT   R1,R0\r
+       STF     R0,*+AR7(CD_SPEED)\r
+\r
+       LDF     *+AR7(DELTA_RADYDELTA),R2\r
+       LDF     *+AR7(CD_SPEED),R3\r
+       CALL    FSL_MOVE\r
+\r
+       SLEEP   1\r
+       BU      DIRECT_ATTACK\r
+*----------------------------------------------------------------------------\r
+\r
+\r
+\r
+\r
+*----------------------------------------------------------------------------\r
+*Take the helicopter, and buzz (@ 200 MPH) right over the players car\r
+*exit when start of the world is hit\r
+*\r
+*\r
+*\r
+ONCOMMING_BUZZ:\r
+       LDF     0,R0\r
+       STF     R0,*+AR4(ORADX)\r
+       STF     R0,*+AR4(ORADY)\r
+       STF     R0,*+AR4(CRADZ)\r
+\r
+       STF     R0,*+AR4(OVELX)\r
+       STF     R0,*+AR4(OVELY)\r
+       STF     R0,*+AR4(OVELZ)\r
+\r
+\r
+       ;\r
+       ;find where player is\r
+\r
+       LDI     @PLYCBLK,AR2\r
+       LDF     *+AR2(CARDIST2CNTR),R0\r
+       STF     R0,*+AR7(DELTA_XLANE)\r
+\r
+       LDI     @DYNALIST_END,AR2\r
+       LDI     *+AR2(OBLINK4),AR2\r
+       LDI     *+AR2(OBLINK4),AR2\r
+       STI     AR2,*+AR7(DELTA_TPIECE)\r
+       LDI     *+AR2(OUSR1),R0\r
+       STI     R0,*+AR7(DELTA_LAST_OID)\r
+       CALL    SUB_FUNCTION_RVS_XLANE          ;MATRIXA,VECTORA,R2\r
+\r
+       LDP     @_VECTORA\r
+       LDF     *+AR2(OPOSX),R0\r
+       ADDF    @_VECTORA+X,R0\r
+       STF     R0,*+AR4(OPOSX)\r
+       LDF     *+AR2(OPOSY),R0\r
+       FLOAT   1000,R1\r
+       SUBF    R1,R0\r
+       ADDF    @_VECTORA+Y,R0\r
+       STF     R0,*+AR4(OPOSY)\r
+       LDF     *+AR2(OPOSZ),R0\r
+       ADDF    @_VECTORA+Z,R0\r
+       STF     R0,*+AR4(OPOSZ)\r
+       SETDP\r
+\r
+\r
+       ;initialize Ytheta to the intentional direction\r
+       STF     R2,*+AR4(ORADY)\r
+       STF     R2,*+AR7(DELTA_RADYDELTA)\r
+\r
+       LDI     AR4,AR2\r
+       ADDI    OMATRIX,AR2\r
+       CALL    FIND_YMATRIX\r
+\r
+\r
+ONBUZZ_L\r
+\r
+       CALL    DIST_TO_PLYR\r
+       LDF     *+AR7(DELTA_PLYRDIST),R1\r
+       STF     R0,*+AR7(DELTA_PLYRDIST)\r
+       STF     R1,*+AR7(DELTA_OPLYRDIST)\r
+\r
+\r
+       FLOAT   22000,R2\r
+       CMPF&nbs