More details thanks to the original source code
This commit is contained in:
Antoine Vignau 2024-07-31 07:26:51 +02:00
parent 77d42686b9
commit b73be970ff
3 changed files with 218 additions and 208 deletions

View File

@ -599,7 +599,8 @@ sprSTRUCTURE
DB $03 ; Sprite 0: wheel DB $03 ; Sprite 0: wheel
DB $0A DB $0A
DA L6D91 DA L6D91
HEX FD77F0F0FFFFF0F0FFFFF0F0 DA L77FD ; pointer to where sprites must be put
HEX F0F0FFFFF0F0FFFFF0F0
DB $08 ; Sprite 1: vehicle DB $08 ; Sprite 1: vehicle
DB $0F DB $0F
DA L6E00 DA L6E00
@ -1145,10 +1146,15 @@ L77D0 HEX 8095A88180
HEX A8F5EE8580 HEX A8F5EE8580
HEX AAC5BB8180 HEX AAC5BB8180
HEX AA80BE8080 HEX AA80BE8080
HEX 8F8080
*----------------------------------- *-----------------------------------
* $7800 * SHIFTED-SPRITES AREA (UNTIL $7FFF)
*-----------------------------------
L77FD HEX 8F8080
*-----------------------------------
* $7800 (GARBAGE)
*----------------------------------- *-----------------------------------
L7800 HEX 80F081808080F883808080F8838080F8 L7800 HEX 80F081808080F883808080F8838080F8
@ -1292,6 +1298,8 @@ L7F00 HEX 88808080808080808080808080808080
DS $100 DS $100
*--- Garbage...
DB $10 DB $10
DB $73 DB $73
DB $42 DB $42
@ -7251,11 +7259,7 @@ tblFIREX DS 4 ; x-coord of each vertical shoot
tblFIREY DS 4 ; y-coord of each vertical shoot tblFIREY DS 4 ; y-coord of each vertical shoot
tblFIREX2 DS 4 ; old x-coord of each vertical shoot tblFIREX2 DS 4 ; old x-coord of each vertical shoot
tblFIREY2 DS 4 ; old y-coord of each vertical shoot tblFIREY2 DS 4 ; old y-coord of each vertical shoot
tblFIREFL DS 4 ;
LB059 DB $00
DB $00
DB $00
DB $00
*----------------------------------- *-----------------------------------
* SCORE TO ADD (100/500/800/1000) * SCORE TO ADD (100/500/800/1000)
@ -7327,23 +7331,23 @@ courseCHAMPION
* FLYING SAUCERS SPRITES TABLES * FLYING SAUCERS SPRITES TABLES
*----------------------------------- *-----------------------------------
tblSAUCER_X DS 4 ; X tblSAUCER_X DS 4 ; X
tblSAUCER_Y DS 4 ; Y tblSAUCER_Y DS 4 ; Y
tblSAUCER_INDEX DS 4 ; INDEX tblSAUCER_INDEX DS 4 ; INDEX
LB34F DS 4 tblSAUCER_Y_T DS 4
LB353 DS 4 tblSAUCER_Y_T DS 4
LB357 DS 4 LB357 DS 4
LB35B DS 4 tblSAUCER_X_STARTACC DS 4
LB35F DS 4 tblSAUCER_Y_I DS 4
LB363 DS 4 tblSAUCER_X_I DS 4
LB367 DS 4 LB367 DS 4
LB36B DS 4 tblSAUCER_X_MAXACC DS 4
LB36F DS 4 tblSAUCER_LEAVING DS 4
LB373 DS 4 tblSAUCER_BTAD DS 4
LB377 DS 4 tblFLITIME DS 4
LB37B DS 4 tblFIRE_COUNT DS 4
LB37F DS 4 tblSAUCER_EXFL DS 4
LB383 DS 4 COMICAZ DS 4
*----------------------------------- *-----------------------------------
* FLYING ENEMIES SPRITE TABLE (L6501 TABLE) * FLYING ENEMIES SPRITE TABLE (L6501 TABLE)
@ -7401,38 +7405,38 @@ LB3BF DB $00
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
LB3C3 DB $02 tblDML DB $02
DB $02 DB $02
DB $02 DB $02
DB $02 DB $02
DB $02 DB $02
LB3C8 DB $03 tblDMR1 DB $03
DB $04 DB $04
DB $06 DB $06
DB $06 DB $06
DB $06 DB $06
LB3CD DB $05 tblDMR2 DB $05
DB $06 DB $06
DB $06 DB $06
DB $06 DB $06
DB $06 DB $06
LB3D2 DB $01 DCHMSKL DB $01
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
LB3D6 DB $07 DCHMSKR1 DB $07
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
LB3DA DB $05 DCHMSKR2 DB $05
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
LB3DE DB $00 tblDCHFLAGS DB $00
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
LB3E2 DS 4 ; X-coord DCHXS DS 4 ; X-coord
LB3E6 DB $00 LB3E6 DB $00
DB $00 DB $00
DB $00 DB $00
@ -7442,11 +7446,11 @@ LB3EA DB $00
DB $01 DB $01
DB $03 DB $03
DB $03 DB $03
LB3EF DB $00 DCHADD DB $00
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
LB3F3 DS 4 ; sprite index DCHNUMS DS 4 ; sprite index
LB3F7 DB $00 LB3F7 DB $00
DB $00 DB $00
DB $00 DB $00
@ -7718,7 +7722,7 @@ musicGAME_repeat
* *
*----------------------------------- *-----------------------------------
LB801 DB $00 DIV10TBL DB $00
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
@ -7784,7 +7788,7 @@ LB801 DB $00
DB $06 DB $06
DB $06 DB $06
LB842 DB $00 DIV3TTBL DB $00
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00

View File

@ -23,6 +23,7 @@ xCNT = $16 ; byte - X counter
fwdSHOOTX = $1a ; byte - x-coord of the front shoot fwdSHOOTX = $1a ; byte - x-coord of the front shoot
fwdSHOOTY = $1b ; byte - y-coord of the front shoot fwdSHOOTY = $1b ; byte - y-coord of the front shoot
explosionCNT = $1c ; byte - shoot (minus)/explosion (positive) counter explosionCNT = $1c ; byte - shoot (minus)/explosion (positive) counter
theRND = $20 ; adr - random value
fgSOUND = $35 ; byte - 0 = $C030, 1 = $C020 fgSOUND = $35 ; byte - 0 = $C030, 1 = $C020
mountX1 = $41 ; byte - x-index within mountain mountX1 = $41 ; byte - x-index within mountain
mountX2 = $42 ; byte - data to determine where to mountX2 = $42 ; byte - data to determine where to
@ -45,6 +46,7 @@ oldWHEEL2X = $63 ; byte - old x-coord of wheel 2
oldWHEEL2Y = $64 ; byte - old y-coord of wheel 2 oldWHEEL2Y = $64 ; byte - old y-coord of wheel 2
oldWHEEL3X = $65 ; byte - old x-coord of wheel 3 oldWHEEL3X = $65 ; byte - old x-coord of wheel 3
oldWHEEL3Y = $66 ; byte - old y-coord of wheel 3 oldWHEEL3Y = $66 ; byte - old y-coord of wheel 3
bigTRY = $6d ; byte - base location to start bouncing wheels
groundSTARTX = $6e ; byte - x-col where to start drawing ground (0 or 34 if moon base) groundSTARTX = $6e ; byte - x-col where to start drawing ground (0 or 34 if moon base)
fgHIT = $70 ; byte - 0 = player is alive, 1 = player was hit fgHIT = $70 ; byte - 0 = player is alive, 1 = player was hit
plrPOINT = $78 ; byte - point reached by the current player plrPOINT = $78 ; byte - point reached by the current player

View File

@ -309,7 +309,7 @@ clearALL LDA #$22
LDA #$0E LDA #$0E
STA $46 STA $46
LDA #$10 LDA #$10
STA $6D STA bigTRY
LDA #$01 LDA #$01
STA $6F STA $6F
STA $67 STA $67
@ -508,28 +508,28 @@ L0B78 LDA vehicleX ; save X pos of the wheels
CLC CLC
ADC #$10 ADC #$10
STA wheel3X STA wheel3X
LDA $6D LDA bigTRY
BMI L0BB2 BMI L0BB2
JMP L238D JMP getBASEY
L0BB2 LDA fgJUMP ; are we jumping? L0BB2 LDA fgJUMP ; are we jumping?
BEQ L0BB9 ; no BEQ L0BB9 ; no
JMP stillJUMPING ; yes JMP stillJUMPING ; yes
L0BB9 LDA #$02 ; calculate wheels Y-coord L0BB9 LDA #$02 ; calculate wheels Y-coord
JSR L26EC JSR getRANDOM
SEC SEC
SBC #$01 SBC #$01
ADC wheel1Y ADC wheel1Y
STA wheel1Y STA wheel1Y
LDA #$02 LDA #$02
JSR L26EC JSR getRANDOM
SEC SEC
SBC #$01 SBC #$01
ADC wheel3Y ADC wheel3Y
STA wheel3Y STA wheel3Y
LDA #$02 LDA #$02
JSR L26EC JSR getRANDOM
SEC SEC
SBC #$01 SBC #$01
ADC wheel2Y ADC wheel2Y
@ -917,7 +917,7 @@ L0E4D LDA tblFIREX,X
RTS RTS
L0E58 LDA #$00 L0E58 LDA #$00
STA LB059,X STA tblFIREFL,X
LDA vehicleX LDA vehicleX
CLC CLC
ADC #$05 ADC #$05
@ -1046,7 +1046,7 @@ L0F28 STX xCNT
LDA #sprVERTICALSHOOT LDA #sprVERTICALSHOOT
JSR eraseSPRITE JSR eraseSPRITE
LDX xCNT LDX xCNT
LDA LB059,X LDA tblFIREFL,X
BNE L0F4F BNE L0F4F
LDA tblFIREY,X LDA tblFIREY,X
TAY TAY
@ -1073,7 +1073,7 @@ L0F5C LDA tblFIREX,X
BCS L0F74 BCS L0F74
LDA #$01 LDA #$01
STA LB059,X STA tblFIREFL,X
L0F74 STA tblFIREY,X L0F74 STA tblFIREY,X
INX INX
CPX #$04 CPX #$04
@ -1191,7 +1191,7 @@ L1009 LDA #$AA
STA fwdSHOOTX STA fwdSHOOTX
LDX #$03 LDX #$03
L1025 STA tblSAUCER_INDEX,X L1025 STA tblSAUCER_INDEX,X
STA LB3DE,X STA tblDCHFLAGS,X
STA LB413,X STA LB413,X
STA tblFIREX,X STA tblFIREX,X
STA tblFIREX2,X STA tblFIREX2,X
@ -1747,8 +1747,8 @@ L13FA LDA tblSAUCER_X,Y
CMP tblSAUCER_Y,Y CMP tblSAUCER_Y,Y
BCC L146E BCC L146E
LDA #$01 LDA #$01
STA LB37F,Y STA tblSAUCER_EXFL,Y
STA LB059,X STA tblFIREFL,X
LDA tblSAUCER_INDEX,Y LDA tblSAUCER_INDEX,Y
PHA PHA
JSR L108F JSR L108F
@ -2024,10 +2024,10 @@ L160C LDA #sprENEMY2
L1613 LDA $47 L1613 LDA $47
STA tblSAUCER_INDEX,X STA tblSAUCER_INDEX,X
LDA #$00 LDA #$00
STA LB36F,X STA tblSAUCER_LEAVING,X
STA LB373,X STA tblSAUCER_BTAD,X
JSR L2507 JSR L2507
JSR L2548 JSR ALGORITHM
LDA tblSAUCER_Y,X LDA tblSAUCER_Y,X
TAY TAY
LDA tblSAUCER_X,X LDA tblSAUCER_X,X
@ -2035,17 +2035,17 @@ L1613 LDA $47
LDA $47 LDA $47
JSR drawSPRITE JSR drawSPRITE
LDA #$0A LDA #$0A
JSR L26EC JSR getRANDOM
LDX $50 LDX $50
CLC CLC
ADC #$82 ADC #$82
STA LB377,X STA tblFLITIME,X
LDA #$28 LDA #$28
JSR L26EC JSR getRANDOM
CLC CLC
ADC #$0A ADC #$0A
LDX $50 LDX $50
STA LB37B,X STA tblFIRE_COUNT,X
CLC CLC
RTS RTS
@ -2068,13 +2068,13 @@ L165A STX $50
STA $B1 STA $B1
LDA tblSAUCER_Y,X ; Y LDA tblSAUCER_Y,X ; Y
STA $B2 STA $B2
LDA LB373,X LDA tblSAUCER_BTAD,X
STA $B3 STA $B3
JSR L2548 JSR ALGORITHM
DEC LB377,X DEC tblFLITIME,X
BNE L167D BNE L167D
LDA #$01 LDA #$01
STA LB36F,X STA tblSAUCER_LEAVING,X
L167D LDA tblSAUCER_INDEX,X L167D LDA tblSAUCER_INDEX,X
CMP #sprENEMY2 CMP #sprENEMY2
BCS L1693 BCS L1693
@ -2105,13 +2105,13 @@ L16A8 CMP #$10
LDA #$FF LDA #$FF
STA tblSAUCER_INDEX,X STA tblSAUCER_INDEX,X
L16BF LDA LB37F,X L16BF LDA tblSAUCER_EXFL,X
BEQ L16CE BEQ L16CE
LDA #$0E LDA #$0E
STA tblSAUCER_INDEX,X STA tblSAUCER_INDEX,X
LDA #$00 LDA #$00
STA LB37F,X STA tblSAUCER_EXFL,X
L16CE LDA LB383,X L16CE LDA COMICAZ,X
BEQ L16E6 BEQ L16E6
LDA #$10 LDA #$10
STA tblSAUCER_INDEX,X STA tblSAUCER_INDEX,X
@ -2120,7 +2120,7 @@ L16CE LDA LB383,X
SBC #$05 SBC #$05
STA tblSAUCER_Y,X STA tblSAUCER_Y,X
LDA #$00 LDA #$00
STA LB383,X STA COMICAZ,X
L16E6 LDA $B3 L16E6 LDA $B3
STA $39 STA $39
LDY $B2 LDY $B2
@ -2135,7 +2135,7 @@ L16E6 LDA $B3
L16FD JSR eraseSPRITE L16FD JSR eraseSPRITE
L1700 LDX $50 L1700 LDX $50
LDA LB373,X LDA tblSAUCER_BTAD,X
STA $39 STA $39
LDA tblSAUCER_Y,X LDA tblSAUCER_Y,X
TAY TAY
@ -2167,7 +2167,7 @@ L1736 LDX $50
L173F STA $B0 L173F STA $B0
LDX #$03 LDX #$03
L1743 LDA LB3DE,X L1743 LDA tblDCHFLAGS,X
BEQ L174C BEQ L174C
DEX DEX
BPL L1743 BPL L1743
@ -2187,40 +2187,40 @@ L175E LDA $B0
SBC #$13 SBC #$13
TAX TAX
LDY $50 LDY $50
LDA LB3C3,X LDA tblDML,X
STA LB3D2,Y STA DCHMSKL,Y
LDA LB3C8,X LDA tblDMR1,X
STA LB3D6,Y STA DCHMSKR1,Y
LDA LB3CD,X LDA tblDMR2,X
STA LB3DA,Y STA DCHMSKR2,Y
LDA $B0 LDA $B0
LDX $50 LDX $50
STA LB3DE,X STA tblDCHFLAGS,X
STA LB3F3,X STA DCHNUMS,X
STA $C3,X STA $C3,X
LDA #$FC LDA #$FC
STA LB3E2,X STA DCHXS,X
STA $C7,X STA $C7,X
LDA #$04 LDA #$04
STA LB3EF,X STA DCHADD,X
STA $D1,X STA $D1,X
LDA #$00 LDA #$00
STA $2A,X STA $2A,X
L1796 RTS L1796 RTS
L1797 LDX #$03 L1797 LDX #$03
L1799 LDA LB3DE,X L1799 LDA tblDCHFLAGS,X
BNE L17A2 BNE L17A2
L179E DEX L179E DEX
BPL L1799 BPL L1799
RTS RTS
L17A2 STX $50 L17A2 STX $50
LDA LB3EF,X LDA DCHADD,X
STA $33 STA $33
LDA LB3F3,X LDA DCHNUMS,X
STA $B1 STA $B1
LDA LB3E2,X LDA DCHXS,X
TAX TAX
LDA $B1 LDA $B1
CMP #sprMUSHROOM1 CMP #sprMUSHROOM1
@ -2235,55 +2235,55 @@ L17C3 STY $B0
JSR putSPRITE ; blits the mushroom sprite JSR putSPRITE ; blits the mushroom sprite
LDX $50 LDX $50
LDA LB3E2,X LDA DCHXS,X
STA $C7,X STA $C7,X
LDA LB3F3,X LDA DCHNUMS,X
STA $C3,X STA $C3,X
LDA LB3EF,X LDA DCHADD,X
STA $D1,X STA $D1,X
LDA $B0 LDA $B0
STA $CB,X STA $CB,X
LDA LB3F3,X LDA DCHNUMS,X
CMP #$16 CMP #$16
BCC L17FF BCC L17FF
LDA frameCNT LDA frameCNT
CLC CLC
AND #$0F AND #$0F
BNE L17FF BNE L17FF
LDA LB3F3,X LDA DCHNUMS,X
CMP #$16 CMP #$16
BNE L17FA BNE L17FA
LDA #$17 LDA #$17
STA LB3F3,X STA DCHNUMS,X
JMP L17FF JMP L17FF
L17FA LDA #$16 L17FA LDA #$16
STA LB3F3,X STA DCHNUMS,X
L17FF LDA #$00 L17FF LDA #$00
STA $00 STA $00
LDA LB3E2,X LDA DCHXS,X
BPL L180F BPL L180F
LDA #$01 LDA #$01
STA $00 STA $00
LDA LB3E2,X LDA DCHXS,X
L180F SEC L180F SEC
SBC $AF SBC $AF
STA LB3E2,X STA DCHXS,X
BPL L1836 BPL L1836
LDA $00 LDA $00
BNE L1836 BNE L1836
LDA LB3EF,X LDA DCHADD,X
BMI L1831 BMI L1831
LDA LB3E2,X LDA DCHXS,X
CLC CLC
ADC #$69 ADC #$69
STA LB3E2,X STA DCHXS,X
LDA #$F5 LDA #$F5
STA LB3EF,X STA DCHADD,X
JMP L1836 JMP L1836
L1831 LDA #$00 L1831 LDA #$00
STA LB3DE,X STA tblDCHFLAGS,X
L1836 JMP L179E L1836 JMP L179E
L1839 PHA L1839 PHA
@ -2330,7 +2330,7 @@ L187B STX $50
LDA $00 LDA $00
STA $B0 STA $B0
LDA #$0A LDA #$0A
JSR L26EC JSR getRANDOM
CLC CLC
ADC #$0A ADC #$0A
LDX $50 LDX $50
@ -2560,7 +2560,7 @@ L1A51 RTS
* MAKE SPRITES * MAKE SPRITES
*----------------------------------- *-----------------------------------
makeSPRITES LDA #$00 makeSPRITES LDA #$00 ; create all the sprite shifts
STA $14 STA $14
STA $15 STA $15
STA $16 STA $16
@ -3243,14 +3243,14 @@ L1FBB DEX
JMP L2059 JMP L2059
L1FC1 STX $50 L1FC1 STX $50
DEC LB37B,X DEC tblFIRE_COUNT,X
BNE L1FBB BNE L1FBB
LDA #$28 LDA #$28
JSR L26EC JSR getRANDOM
CLC CLC
ADC #$0F ADC #$0F
LDX $50 LDX $50
STA LB37B,X STA tblFIRE_COUNT,X
LDA tblFLYINGENEMIES_INDEX,X LDA tblFLYINGENEMIES_INDEX,X
BNE L1FBB BNE L1FBB
@ -3279,7 +3279,7 @@ L1FFF ADC #$1C
L2007 JMP L1FBB L2007 JMP L1FBB
L200A LDY #$03 L200A LDY #$03
L200C LDA LB3DE,Y L200C LDA tblDCHFLAGS,Y
BNE L1FBB BNE L1FBB
DEY DEY
BPL L200C BPL L200C
@ -3377,7 +3377,7 @@ L2086 INC tblFLYINGENEMIES_X,X
SEC SEC
SBC #$22 SBC #$22
AND #$FC AND #$FC
STA LB3E2,Y STA DCHXS,Y
LDA #sprHORIZONTALBAR LDA #sprHORIZONTALBAR
STA tblFLYINGENEMIES_INDEX,X STA tblFLYINGENEMIES_INDEX,X
JMP L20D7 JMP L20D7
@ -3501,7 +3501,7 @@ L21B6 LDA plrPOINT
RTS RTS
L21C0 LDX #$03 L21C0 LDX #$03
L21C2 LDA LB3DE,X L21C2 LDA tblDCHFLAGS,X
BNE L21CB BNE L21CB
L21C7 DEX L21C7 DEX
BPL L21C2 BPL L21C2
@ -3528,17 +3528,17 @@ L21E6 LDA $D1,X
ADC #$1C ADC #$1C
BCS L21C7 BCS L21C7
CLC CLC
ADC LB3D2,X ADC DCHMSKL,X
BCS L21C7 BCS L21C7
CMP #$96 CMP #$96
BCS L21C7 BCS L21C7
STA $00 STA $00
LDY LB3D6,X LDY DCHMSKR1,X
CLC CLC
ADC tblX7HGR,Y ADC tblX7HGR,Y
BCS L21C7 BCS L21C7
CLC CLC
ADC LB3DA,X ADC DCHMSKR2,X
BCS L21C7 BCS L21C7
SEC SEC
SBC #$07 SBC #$07
@ -3571,13 +3571,13 @@ L222E LDA #$00
STA $03 STA $03
PLA PLA
L223F CLC L223F CLC
ADC LB3D2,X ADC DCHMSKL,X
STA $00 STA $00
LDY LB3D6,X LDY DCHMSKR1,X
CLC CLC
ADC tblX7HGR,Y ADC tblX7HGR,Y
CLC CLC
ADC LB3DA,X ADC DCHMSKR2,X
BPL L2255 BPL L2255
JMP L21C7 JMP L21C7
@ -3752,17 +3752,17 @@ L2387 INY
RTS RTS
*----------------------------------- *-----------------------------------
* * GET BASE Y
*----------------------------------- *-----------------------------------
L238D LDA #$02 getBASEY LDA #$02
JSR L26EC JSR getRANDOM
CLC CLC
ADC #$84 ADC #$84
STA vehicleY STA vehicleY
LDA $6D LDA bigTRY
BMI L239D BMI L239D
DEC $6D DEC bigTRY
L239D RTS L239D RTS
*----------------------------------- *-----------------------------------
@ -3798,7 +3798,7 @@ animMOONBASE
LDA #$FF LDA #$FF
JSR WAIT JSR WAIT
LDA #$22 LDA #$22
STA $6D STA bigTRY
LDA #$46 ; 70 (half of 140) LDA #$46 ; 70 (half of 140)
STA $67 STA $67
L23DE LDA #$79 L23DE LDA #$79
@ -3955,51 +3955,55 @@ L24FB LDA #$00 ; 200
L2504 JMP L2FCE L2504 JMP L2FCE
L2507 LDA #$1E L2507 LDA #$1E
STA LB36B,X STA tblSAUCER_X_MAXACC,X
LDA #$14 LDA #$14
STA LB35B,X STA tblSAUCER_X_STARTACC,X
LDA #$14 LDA #$14
STA LB367,X STA tblSAUCER_Y_MAXACC,X
LDA #$14 LDA #$14
STA LB357,X STA tblSAUCER_Y_STARTACC,X
LDA #$23 LDA #$23
STA tblSAUCER_Y,X STA tblSAUCER_Y,X
LDA #$73 LDA #$73
STX xCNT STX xCNT
JSR L26EC JSR getRANDOM
LDX xCNT LDX xCNT
CLC CLC
ADC #$8C ADC #$8C
STA tblSAUCER_X,X STA tblSAUCER_X,X
LDA #$00 LDA #$00
STA LB34F,X STA tblSAUCER_X_T,X
STA LB353,X STA tblSAUCER_Y_T,X
LDA $4E ; random value? LDA $4E ; random value?
ORA #$01 ORA #$01
STA $20 STA theRND
LDA $4F LDA $4F
ORA #$01 ORA #$01
STA $21 STA theRND+1
EOR $20 EOR theRND
STA $22 STA theRND+2
RTS RTS
L2548 LDA LB36F,X *-----------------------------------
* THE ALGORITHM
*-----------------------------------
ALGORITHM LDA tblSAUCER_LEAVING,X
BEQ L257D BEQ L257D
LDA tblSAUCER_X,X LDA tblSAUCER_X,X
CMP #$8C CMP #$8C
BCS L257D BCS L257D
STA $00 STA $00
LDA LB35B,X LDA tblSAUCER_X_STARTACC,X
BPL L257D BPL L257D
LDA #$00 LDA #$00
STA LB363,X STA tblSAUCER_X_I,X
LDA $00 LDA $00
SEC SEC
SBC #$04 SBC #$04
BCS L259B BCS L259B
LDA LB373,X LDA tblSAUCER_BTAD,X
BEQ L2572 BEQ L2572
LDA #$FF LDA #$FF
STA tblSAUCER_INDEX,X STA tblSAUCER_INDEX,X
@ -4009,15 +4013,15 @@ L2572 CLC
ADC #$2A ADC #$2A
STA tblSAUCER_X,X STA tblSAUCER_X,X
LDA #$FA LDA #$FA
STA LB373,X STA tblSAUCER_BTAD,X
L257D LDA LB35B,X L257D LDA tblSAUCER_X_STARTACC,X
PHP PHP
BPL L2588 BPL L2588
EOR #$FF EOR #$FF
CLC CLC
ADC #$01 ADC #$01
L2588 TAY L2588 TAY
LDA LB842,Y LDA DIV3TTBL,Y
CLC CLC
PLP PLP
BPL L2595 BPL L2595
@ -4028,7 +4032,7 @@ L2595 CLC
ADC tblSAUCER_X,X ADC tblSAUCER_X,X
AND #$FE AND #$FE
L259B STA tblSAUCER_X,X L259B STA tblSAUCER_X,X
LDA LB36F,X LDA tblSAUCER_LEAVING,X
BEQ L25D3 BEQ L25D3
LDA tblSAUCER_INDEX,X LDA tblSAUCER_INDEX,X
CMP #$0D CMP #$0D
@ -4050,17 +4054,17 @@ L25B9 LDA tblSAUCER_Y,X
LDA #$89 LDA #$89
STA tblSAUCER_Y,X STA tblSAUCER_Y,X
LDA #$01 LDA #$01
STA LB383,X STA COMICAZ,X
L25D0 JMP L25F1 L25D0 JMP L25F1
L25D3 LDA LB357,X L25D3 LDA tblSAUCER_Y_STARTACC,X
PHP PHP
BPL L25DE BPL L25DE
EOR #$FF EOR #$FF
CLC CLC
ADC #$01 ADC #$01
L25DE TAY L25DE TAY
LDA LB801,Y LDA DIV10TBL,Y
PLP PLP
BPL L25EA BPL L25EA
EOR #$FF EOR #$FF
@ -4069,20 +4073,20 @@ L25DE TAY
L25EA CLC L25EA CLC
ADC tblSAUCER_Y,X ADC tblSAUCER_Y,X
STA tblSAUCER_Y,X STA tblSAUCER_Y,X
L25F1 LDA LB35B,X L25F1 LDA tblSAUCER_X_STARTACC,X
SEC SEC
SBC LB363,X SBC tblSAUCER_X_I,X
STA LB35B,X STA tblSAUCER_X_STARTACC,X
LDA LB357,X LDA tblSAUCER_Y_STARTACC,X
SEC SEC
SBC LB35F,X SBC tblSAUCER_Y_I,X
STA LB357,X STA tblSAUCER_Y_STARTACC,X
LDA LB36B,X LDA tblSAUCER_X_MAXACC,X
EOR #$FF EOR #$FF
CLC CLC
ADC #$01 ADC #$01
STA $17 STA $17
LDA LB35B,X LDA tblSAUCER_X_STARTACC,X
SEC SEC
SBC $17 SBC $17
BEQ L2620 BEQ L2620
@ -4092,12 +4096,12 @@ L261B JMP L262A
L261E BMI L261B L261E BMI L261B
L2620 LDA #$00 L2620 LDA #$00
STA LB363,X STA tblSAUCER_X_I,X
LDA $17 LDA $17
STA LB35B,X STA tblSAUCER_X_STARTACC,X
L262A LDA LB35B,X L262A LDA tblSAUCER_X_STARTACC,X
SEC SEC
SBC LB36B,X SBC tblSAUCER_X_MAXACC,X
BEQ L2637 BEQ L2637
BVS L263A BVS L263A
BPL L263C BPL L263C
@ -4105,15 +4109,15 @@ L2637 JMP L2647
L263A BPL L2637 L263A BPL L2637
L263C LDA #$00 L263C LDA #$00
STA LB363,X STA tblSAUCER_X_I,X
LDA LB36B,X LDA tblSAUCER_X_MAXACC,X
STA LB35B,X STA tblSAUCER_X_STARTACC,X
L2647 LDA LB367,X L2647 LDA tblSAUCER_Y_MAXACC,X
EOR #$FF EOR #$FF
CLC CLC
ADC #$01 ADC #$01
STA $17 STA $17
LDA LB357,X LDA tblSAUCER_Y_STARTACC,X
SEC SEC
SBC $17 SBC $17
BVS L265E BVS L265E
@ -4122,23 +4126,23 @@ L265B JMP L267F
L265E BMI L265B L265E BMI L265B
L2660 LDA #$0A L2660 LDA #$0A
JSR L26EC JSR getRANDOM
LDX $50 LDX $50
CLC CLC
ADC #$01 ADC #$01
EOR #$FF EOR #$FF
CLC CLC
ADC #$01 ADC #$01
STA LB35F,X STA tblSAUCER_Y_I,X
LDA #$28 LDA #$28
JSR L26EC JSR getRANDOM
LDX $50 LDX $50
CLC CLC
ADC #$01 ADC #$01
STA LB367,X STA tblSAUCER_Y_MAXACC,X
L267F LDA LB357,X L267F LDA tblSAUCER_Y_STARTACC,X
SEC SEC
SBC LB367,X SBC tblSAUCER_Y_MAXACC,X
BEQ L268C BEQ L268C
BVS L268F BVS L268F
BPL L2691 BPL L2691
@ -4146,71 +4150,71 @@ L268C JMP L26AB
L268F BPL L268C L268F BPL L268C
L2691 LDA #$0A L2691 LDA #$0A
JSR L26EC JSR getRANDOM
LDX $50 LDX $50
CLC CLC
ADC #$01 ADC #$01
STA LB35F,X STA tblSAUCER_Y_I,X
LDA #$28 LDA #$28
JSR L26EC JSR getRANDOM
LDX $50 LDX $50
CLC CLC
ADC #$01 ADC #$01
STA LB367,X STA tblSAUCER_Y_MAXACC,X
L26AB LDA tblSAUCER_Y,X L26AB LDA tblSAUCER_Y,X
CMP #$41 CMP #$41
BCS L26BC BCS L26BC
LDA LB357,X LDA tblSAUCER_Y_STARTACC,X
BPL L26BC BPL L26BC
LDA #$FB LDA #$FB
STA LB35F,X STA tblSAUCER_Y_I,X
L26BC LDA tblSAUCER_Y,X L26BC LDA tblSAUCER_Y,X
CMP #$43 CMP #$43
BCC L26D1 BCC L26D1
BEQ L26D1 BEQ L26D1
LDA LB357,X LDA tblSAUCER_Y_STARTACC,X
BMI L26D1 BMI L26D1
BEQ L26D1 BEQ L26D1
LDA #$05 LDA #$05
STA LB35F,X STA tblSAUCER_Y_I,X
L26D1 LDA tblSAUCER_X,X L26D1 LDA tblSAUCER_X,X
CMP #$28 CMP #$28
BCS L26DD BCS L26DD
LDA #$F0 LDA #$F0
STA LB363,X STA tblSAUCER_X_I,X
L26DD LDA tblSAUCER_X,X L26DD LDA tblSAUCER_X,X
CMP #$BE CMP #$BE
BCC L26EB BCC L26EB
BEQ L26EB BEQ L26EB
LDA #$18 LDA #$18
STA LB363,X STA tblSAUCER_X_I,X
L26EB RTS L26EB RTS
*----------------------------------- *-----------------------------------
* * GET RANDOM VALUE
*----------------------------------- *-----------------------------------
L26EC CLC getRANDOM CLC
TAX TAX
LDY #$18 ; 24 bits LDY #$18 ; 24 bits
L26F0 LDA $20 L26F0 LDA theRND
ROL ROL
ROL ROL
ROL ROL
ROL ROL
ROL ROL
EOR $20 EOR theRND
ROL ROL
ROL $22 ROL theRND+2
ROL $21 ROL theRND+1
ROL $20 ROL theRND
DEY DEY
BNE L26F0 BNE L26F0
LDA $20 LDA theRND
CLC CLC
ADC $21 ADC theRND+1
ADC $22 ADC theRND+2
STA $00 STA $00
STX $01 STX $01
LDA #$00 LDA #$00
@ -4632,7 +4636,7 @@ L2B02 BIT KBDSTROBE
JMP L0996 JMP L0996
L2B72 LDA #$FF L2B72 LDA #$FF
STA $6D STA bigTRY
LDA #$00 LDA #$00
STA $6F STA $6F
STA $67 STA $67
@ -4851,13 +4855,13 @@ L2D0F LDA LB407,X
LDA LB3FF,X LDA LB3FF,X
STA LB3F7,X STA LB3F7,X
L2D26 LDA $C7,X L2D26 LDA $C7,X
STA LB3E2,X STA DCHXS,X
LDA $CB,X LDA $CB,X
STA LB3E6,X STA LB3E6,X
LDA $C3,X LDA $C3,X
STA LB3F3,X STA DCHNUMS,X
LDA $D1,X LDA $D1,X
STA LB3EF,X STA DCHADD,X
DEX DEX
BPL L2D0F BPL L2D0F
@ -5674,7 +5678,7 @@ L3327 LDY #$0F
*----------------------------------- *-----------------------------------
L3333 LDX #$03 L3333 LDX #$03
L3335 LDA LB3DE,X L3335 LDA tblDCHFLAGS,X
BNE L333E BNE L333E
L333A DEX L333A DEX
BPL L3335 BPL L3335
@ -5721,7 +5725,7 @@ L333E STX $50
LDA #$FF LDA #$FF
STA explosionCNT STA explosionCNT
L3388 LDA #$15 L3388 LDA #$15
STA LB3F3,X STA DCHNUMS,X
LDY $C7,X LDY $C7,X
LDA tblXBYTE,Y LDA tblXBYTE,Y
CLC CLC
@ -5757,7 +5761,7 @@ L33B0 STA ($26),Y
LDA #$91 ; LOGO LDA #$91 ; LOGO
STA $BF STA $BF
LDA #$02 LDA #$02
JSR L26EC JSR getRANDOM
CLC CLC
ADC #$10 ADC #$10
STA $D9 STA $D9
@ -5960,7 +5964,7 @@ L3590 STX $50
L35A2 LDX #$03 L35A2 LDX #$03
L35A4 LDA #$FF L35A4 LDA #$FF
STA LB37B,X STA tblFIRE_COUNT,X
STA LB426,X STA LB426,X
DEX DEX
BPL L35A4 BPL L35A4
@ -6027,7 +6031,7 @@ L35F5 STY $18
CMP tblFLYINGENEMIES_Y,Y CMP tblFLYINGENEMIES_Y,Y
BCC L35EF BCC L35EF
LDA #$01 LDA #$01
STA LB059,X STA tblFIREFL,X
LDA tblFLYINGENEMIES_INDEX,Y LDA tblFLYINGENEMIES_INDEX,Y
STA $B0 STA $B0
LDA #$00 LDA #$00
@ -6159,28 +6163,28 @@ L3701 LDA #$00 ; 50
JMP L369A JMP L369A
L3713 LDX #$03 L3713 LDX #$03
L3715 LDA LB3DE,X L3715 LDA tblDCHFLAGS,X
BNE L371E BNE L371E
L371A DEX L371A DEX
BPL L3715 BPL L3715
RTS RTS
L371E STX $50 L371E STX $50
LDA LB3EF,X LDA DCHADD,X
BMI L374D BMI L374D
LDA LB3E2,X LDA DCHXS,X
CLC CLC
ADC #$1C ADC #$1C
BCS L371A BCS L371A
CLC CLC
ADC LB3D2,X ADC DCHMSKL,X
BCS L371A BCS L371A
LDY LB3D6,X LDY DCHMSKR1,X
CLC CLC
ADC tblX7HGR,Y ADC tblX7HGR,Y
BCS L371A BCS L371A
CLC CLC
ADC LB3DA,X ADC DCHMSKR2,X
BCS L371A BCS L371A
STA $01 STA $01
LDA vehicleX LDA vehicleX
@ -6190,16 +6194,16 @@ L371E STX $50
L374D LDA #$00 L374D LDA #$00
STA $03 STA $03
LDA LB3E2,X LDA DCHXS,X
SEC SEC
SBC #$4D SBC #$4D
CLC CLC
ADC LB3D2,X ADC DCHMSKL,X
LDY LB3D6,X LDY DCHMSKR1,X
CLC CLC
ADC tblX7HGR,Y ADC tblX7HGR,Y
CLC CLC
ADC LB3DA,X ADC DCHMSKR2,X
BMI L3773 BMI L3773
STA $00 STA $00
LDA vehicleX LDA vehicleX
@ -6209,7 +6213,7 @@ L374D LDA #$00
L3773 LDA $2A,X L3773 LDA $2A,X
BNE L3787 BNE L3787
LDA LB3F3,X LDA DCHNUMS,X
CMP #$15 CMP #$15
BCS L3790 BCS L3790
LDA #$00 ; 50 LDA #$00 ; 50
@ -6282,7 +6286,7 @@ L37EC LDA #$05
STA explosionCNT STA explosionCNT
L37F8 JSR L2FCE L37F8 JSR L2FCE
LDA #$03 LDA #$03
JSR L26EC JSR getRANDOM
CLC CLC
ADC #$10 ADC #$10
STA $DA STA $DA
@ -6426,7 +6430,7 @@ L38F3 LDA $B7
LDA $B9 LDA $B9
STA $BA STA $BA
LDA #$04 LDA #$04
JSR L26EC JSR getRANDOM
CLC CLC
ADC #$8D ADC #$8D
CLC CLC
@ -6707,7 +6711,7 @@ L3BF2 INY
BNE L3BD3 BNE L3BD3
LDX #$03 LDX #$03
L3BF9 LDA LB3DE,X L3BF9 LDA tblDCHFLAGS,X
BNE L3C19 BNE L3C19
L3BFE DEX L3BFE DEX
BPL L3BF9 BPL L3BF9
@ -6724,8 +6728,8 @@ L3C03 LDA LBB00,X
RTS RTS
L3C19 STX xCNT L3C19 STX xCNT
LDA LB3EF,X LDA DCHADD,X
LDY LB3E2,X LDY DCHXS,X
CLC CLC
ADC tblXBYTE,Y ADC tblXBYTE,Y
STA $00 STA $00
@ -6734,7 +6738,7 @@ L3C19 STX xCNT
SEC SEC
SBC #$01 SBC #$01
CLC CLC
ADC LB3D2,X ADC DCHMSKL,X
CMP #$07 CMP #$07
BCC L3C3B BCC L3C3B
INC $00 INC $00
@ -6743,11 +6747,11 @@ L3C19 STX xCNT
L3C3B STA $01 L3C3B STA $01
LDA $00 LDA $00
CLC CLC
ADC LB3D6,X ADC DCHMSKR1,X
STA $02 STA $02
LDA $01 LDA $01
CLC CLC
ADC LB3DA,X ADC DCHMSKR2,X
CMP #$07 CMP #$07
BCC L3C54 BCC L3C54
INC $02 INC $02