mirror of
https://github.com/antoinevignau/source.git
synced 2025-01-16 21:32:11 +00:00
V+1
assembly gives same resuts as the original file
This commit is contained in:
parent
be98267dde
commit
dd9ce9c843
BIN
pacman/PACMAN
BIN
pacman/PACMAN
Binary file not shown.
@ -24,7 +24,7 @@ score200 = 2
|
|||||||
score400 = 4
|
score400 = 4
|
||||||
score800 = 8
|
score800 = 8
|
||||||
|
|
||||||
nbDOTS = 248 ; 244 normal dots & 4 energizer dots
|
NBDOTS = 248 ; 244 normal dots & 4 energizer dots
|
||||||
|
|
||||||
L0300 = $0300 ; buffer area to save scores
|
L0300 = $0300 ; buffer area to save scores
|
||||||
GHOST1MOVE = $0800 ; buffer area for ghosts moves
|
GHOST1MOVE = $0800 ; buffer area for ghosts moves
|
||||||
@ -65,11 +65,12 @@ zpPTR1 = $14 ; (word) 1st pointer
|
|||||||
zpPTR2 = $16 ; (word) 2nd pointer
|
zpPTR2 = $16 ; (word) 2nd pointer
|
||||||
ptrMOVE = zpPTR2 ; (word) pointer to the list of authorized moves
|
ptrMOVE = zpPTR2 ; (word) pointer to the list of authorized moves
|
||||||
sprHEIGHT = $18 ; (byte) sprite height in lines
|
sprHEIGHT = $18 ; (byte) sprite height in lines
|
||||||
|
*
|
||||||
sprWIDTH = $1a ; (byte) sprite width in bytes
|
sprWIDTH = $1a ; (byte) sprite width in bytes
|
||||||
zpPTR3 = $1b ; (word)
|
zpPTR3 = $1b ; (word) pointer to board moves
|
||||||
fgCOLOR = $1d ; 0: b&w, 1: color
|
fgCOLOR = $1d ; 0: b&w, 1: color
|
||||||
hgrBIT7 = $1e ; (byte) defines which palette to use ($00 or $80)
|
hgrBIT7 = $1e ; (byte) defines which palette to use ($00 or $80)
|
||||||
zp1F = $1f
|
zp1F = $1f ; (byte) $1f is no more used, see $8B7E
|
||||||
* $20 to $4F are not used
|
* $20 to $4F are not used
|
||||||
curPLAYER = $50 ; (byte) current player index
|
curPLAYER = $50 ; (byte) current player index
|
||||||
nbPLAYERS = $51 ; (byte) number of players (1..5)
|
nbPLAYERS = $51 ; (byte) number of players (1..5)
|
||||||
@ -79,7 +80,7 @@ nbDOTS = $56 ; 4 (byte) number of dots on the board (248 by default)
|
|||||||
fruitFREQ = $57 ; 5 (byte) appearance frequency of a fruits
|
fruitFREQ = $57 ; 5 (byte) appearance frequency of a fruits
|
||||||
nbLIVES = $58 ; 6 (byte) number of lives (bit 7 is set)
|
nbLIVES = $58 ; 6 (byte) number of lives (bit 7 is set)
|
||||||
frameCNT = $59 ; 7 (byte) frame counter
|
frameCNT = $59 ; 7 (byte) frame counter
|
||||||
fruitCNT = $5a ; (word) fruit counter (how long it is displayed)
|
fruitCNT = $5a ; (word) fruit display counter
|
||||||
ptrFRUIT = $5c ; (word) pointer to the fruit sprite
|
ptrFRUIT = $5c ; (word) pointer to the fruit sprite
|
||||||
dotTEMPO = $5e ; (byte) tempo for energizer dot blinking
|
dotTEMPO = $5e ; (byte) tempo for energizer dot blinking
|
||||||
fgDOTS = $5f ; (byte) 0: show dots, 1: hide dots
|
fgDOTS = $5f ; (byte) 0: show dots, 1: hide dots
|
||||||
@ -98,23 +99,43 @@ theDIR = $63 ; (byte) next Pacman direction (given by input device)
|
|||||||
pacmanBOARD = $64 ; (byte) current index in boardMOVES where Pacman is
|
pacmanBOARD = $64 ; (byte) current index in boardMOVES where Pacman is
|
||||||
pacmanNEXTBOARD = $65 ; (byte) next index in the same table, $FF if move is invalid
|
pacmanNEXTBOARD = $65 ; (byte) next index in the same table, $FF if move is invalid
|
||||||
pacmanSTEP = $66 ; (byte) Pacman sprite index (that makes the animation step)
|
pacmanSTEP = $66 ; (byte) Pacman sprite index (that makes the animation step)
|
||||||
* $67 is no more used, see $8B7E
|
zp67 = $67 ; (byte) $67 is no more used, see $8B7E
|
||||||
bonusINDEX = $68 ; (byte) 2/4/8/16 for bonus 200/400/800/1600
|
bonusINDEX = $68 ; (byte) 2/4/8/16 for bonus 200/400/800/1600
|
||||||
pacmanTUNNEL = $69 ; (byte) 0: Pacman not in tunnel, 1: Pacman in tunnel
|
pacmanINTUNNEL = $69 ; (byte) 0: Pacman not in tunnel, 1: Pacman in tunnel
|
||||||
boardY = $6a ; (byte) y-coord in board
|
boardY = $6a ; (byte) y-coord in board
|
||||||
boardX = $6b ; (byte) x-coord in board
|
boardX = $6b ; (byte) x-coord in board
|
||||||
*
|
*
|
||||||
ghostDATA = $70 ; (struct) structure of 8/20 bytes for the current ghost
|
ghostDATA = $70 ; (struct) structure of 8/20 bytes for the current ghost
|
||||||
ghostX = $70 ; 0 (byte) ghost X
|
ghostX = $70 ; 0 (byte) ghost X
|
||||||
ghostY = $71 ; 1 (byte) ghost Y
|
ghostY = $71 ; 1 (byte) ghost Y
|
||||||
ghostDIR = $72 ; 2
|
ghostDIR = $72 ; 2 (byte) ghost direction (see above)
|
||||||
ghostBOARD = $73 ; 3 (byte) current index in boardMOVES where the ghost is
|
ghostBOARD = $73 ; 3 (byte) current index in boardMOVES where the ghost is
|
||||||
ghostNEXTBOARD = $74 ; 4 (byte) next index in the same table, $FF if move is invalid
|
ghostNEXTBOARD = $74 ; 4 (byte) next index in the same table, $FF if move is invalid
|
||||||
ghostMOVE = $75 ; 5 (word) pointer to the ghost move board of 256 bytes
|
ghostMOVE = $75 ; 5 (word) pointer to the ghost move board of 256 bytes
|
||||||
ghostMOVEINDEX = $77 ; 7 (byte) index within that board
|
ghostMOVEINDEX = $77 ; 7 (byte) index within that board
|
||||||
ghostFRIGHTENED = $78 ; (byte) 0: ghost is not frightened, 1: ghost is frightened
|
ghostFRIGHTENED = $78 ; 8 (byte) 0: ghost is not frightened, 1: ghost is frightened
|
||||||
ghostISDEAD = $79 ; (byte) 0: ghost is alive, dead otherwise
|
ghostISDEAD = $79 ; 9 (byte) 0: ghost is alive, dead otherwise
|
||||||
ghostTEMPO = 80 ; (byte) tempo to refresh a ghost (aka ghost speed)
|
* = 7a ; 10 (byte)
|
||||||
|
* = 7b ; 11 (byte)
|
||||||
|
* = 7c ; 12 (byte)
|
||||||
|
* = 7d ; 13 (byte)
|
||||||
|
* = 7e ; 14 (byte)
|
||||||
|
* = 7f ; 15 (byte)
|
||||||
|
ghostTEMPO = 80 ; 16 (byte) tempo to refresh a ghost (aka ghost speed)
|
||||||
|
* 81 ; 17 (byte) ghost is dead flag
|
||||||
|
* = 82 ; 18 (byte)
|
||||||
|
* = 83 ; 19 (byte)
|
||||||
|
|
||||||
|
idxGHOST_X = 0
|
||||||
|
idxGHOST_Y = 1
|
||||||
|
idxGHOST_DIR = 2
|
||||||
|
idxGHOST_BOARD = 3
|
||||||
|
idxGHOST_NEXTBOARD = 4
|
||||||
|
idxGHOST_MOVE = 5
|
||||||
|
idxGHOST_MOVEINDEX = 7
|
||||||
|
idxGHOST_FRIGHTENED = 8
|
||||||
|
idxGHOST_ISDEAD = 9
|
||||||
|
|
||||||
* Each ghost data is: 84 / 98 / AC / C0
|
* Each ghost data is: 84 / 98 / AC / C0
|
||||||
ghost1DATA = $84
|
ghost1DATA = $84
|
||||||
ghost1X = ghost1DATA
|
ghost1X = ghost1DATA
|
||||||
@ -144,7 +165,7 @@ ghost4FRIGHTENED = ghost4DATA+8
|
|||||||
ghost4DEAD = ghost4DATA+9
|
ghost4DEAD = ghost4DATA+9
|
||||||
*
|
*
|
||||||
ghostINDEX = $e0 ; (byte) 1: Inky, 2: Pinky, 3: Blinky, 4: Clyde
|
ghostINDEX = $e0 ; (byte) 1: Inky, 2: Pinky, 3: Blinky, 4: Clyde
|
||||||
frFRUIT = $e7 ; (byte) 0: fruit counter not activated, 1: fruit counter activated
|
fgFRUIT = $e7 ; (byte) 0: fruit counter not activated, 1: fruit counter activated
|
||||||
fgDEMO = $e8 ; (byte) 0: game, 1: demo
|
fgDEMO = $e8 ; (byte) 0: game, 1: demo
|
||||||
saveVAR = $f1 ; (byte) save variable
|
saveVAR = $f1 ; (byte) save variable
|
||||||
* $F2 is not used
|
* $F2 is not used
|
||||||
|
227
pacman/PACMAN.S
227
pacman/PACMAN.S
@ -826,7 +826,7 @@ L4733 LDA #$66
|
|||||||
STA zpY1
|
STA zpY1
|
||||||
LDA #$4A
|
LDA #$4A
|
||||||
STA zpX1
|
STA zpX1
|
||||||
JSR L7819
|
JSR hideENERGIZERDOT
|
||||||
LDA #$01
|
LDA #$01
|
||||||
L4740 STA fgDOTS
|
L4740 STA fgDOTS
|
||||||
L4742 LDA pacmanX
|
L4742 LDA pacmanX
|
||||||
@ -1439,7 +1439,7 @@ L530F JSR L7861
|
|||||||
L531E LDA #$01
|
L531E LDA #$01
|
||||||
STA frameCNT
|
STA frameCNT
|
||||||
JSR setDEFAULTBOARD
|
JSR setDEFAULTBOARD
|
||||||
LDA #nbDOTS
|
LDA #NBDOTS
|
||||||
STA nbDOTS
|
STA nbDOTS
|
||||||
LDA #$40
|
LDA #$40
|
||||||
STA fruitFREQ
|
STA fruitFREQ
|
||||||
@ -1555,7 +1555,7 @@ savePLAYERDATA
|
|||||||
LDY tbplPDOFFSET,X
|
LDY tbplPDOFFSET,X
|
||||||
LDX #$07
|
LDX #$07
|
||||||
L53C5 LDA curSCORE,X
|
L53C5 LDA curSCORE,X
|
||||||
STA pacmanDATA,Y
|
STA L0300,Y
|
||||||
DEY
|
DEY
|
||||||
DEX
|
DEX
|
||||||
BPL L53C5
|
BPL L53C5
|
||||||
@ -1569,7 +1569,7 @@ loadPLAYERDATA
|
|||||||
LDX curPLAYER
|
LDX curPLAYER
|
||||||
LDY tbplPDOFFSET,X
|
LDY tbplPDOFFSET,X
|
||||||
LDX #$07
|
LDX #$07
|
||||||
L53D6 LDA pacmanDATA,Y
|
L53D6 LDA L0300,Y
|
||||||
STA curSCORE,X
|
STA curSCORE,X
|
||||||
DEY
|
DEY
|
||||||
DEX
|
DEX
|
||||||
@ -1614,7 +1614,7 @@ L5402 STA |frameCNT,Y
|
|||||||
STA $EB
|
STA $EB
|
||||||
STA $E4
|
STA $E4
|
||||||
STA fgFRUIT
|
STA fgFRUIT
|
||||||
STA $1F
|
STA zp1F ; no more used
|
||||||
JSR getMAXRANK15
|
JSR getMAXRANK15
|
||||||
TAX
|
TAX
|
||||||
LDY #$12
|
LDY #$12
|
||||||
@ -1659,7 +1659,7 @@ dftGHOSTS_DATA
|
|||||||
DB $03 ; 72
|
DB $03 ; 72
|
||||||
DB $17 ; 73
|
DB $17 ; 73
|
||||||
DB $18 ; 74
|
DB $18 ; 74
|
||||||
DA L0800 ; 75
|
DA GHOST1MOVE ; 75
|
||||||
DB $FF ; 77
|
DB $FF ; 77
|
||||||
DB $00 ; 78
|
DB $00 ; 78
|
||||||
DB $00 ; 79
|
DB $00 ; 79
|
||||||
@ -1673,12 +1673,13 @@ dftGHOSTS_DATA
|
|||||||
DB $00 ; 81
|
DB $00 ; 81
|
||||||
DB $00 ; 82
|
DB $00 ; 82
|
||||||
DB $00 ; 83
|
DB $00 ; 83
|
||||||
|
*
|
||||||
DB $7F ; Ghost 2
|
DB $7F ; Ghost 2
|
||||||
DB $5D
|
DB $5D
|
||||||
DB $01
|
DB $01
|
||||||
DB $17
|
DB $17
|
||||||
DB $18
|
DB $18
|
||||||
DA L0900
|
DA GHOST2MOVE
|
||||||
DB $FF
|
DB $FF
|
||||||
DB $00
|
DB $00
|
||||||
DB $00
|
DB $00
|
||||||
@ -1692,12 +1693,13 @@ dftGHOSTS_DATA
|
|||||||
DB $01
|
DB $01
|
||||||
DB $80
|
DB $80
|
||||||
DB $00
|
DB $00
|
||||||
|
*
|
||||||
DB $8B ; Ghost 3
|
DB $8B ; Ghost 3
|
||||||
DB $55
|
DB $55
|
||||||
DB $00
|
DB $00
|
||||||
DB $17
|
DB $17
|
||||||
DB $18
|
DB $18
|
||||||
DA L0A00
|
DA GHOST3MOVE
|
||||||
DB $FF
|
DB $FF
|
||||||
DB $00
|
DB $00
|
||||||
DB $00
|
DB $00
|
||||||
@ -1711,12 +1713,13 @@ dftGHOSTS_DATA
|
|||||||
DB $01
|
DB $01
|
||||||
DB $40
|
DB $40
|
||||||
DB $00
|
DB $00
|
||||||
|
*
|
||||||
DB $99 ; Ghost 4
|
DB $99 ; Ghost 4
|
||||||
DB $5D
|
DB $5D
|
||||||
DB $01
|
DB $01
|
||||||
DB $17
|
DB $17
|
||||||
DB $18
|
DB $18
|
||||||
DA L0B00
|
DA GHOST4MOVE
|
||||||
DB $FF
|
DB $FF
|
||||||
DB $00
|
DB $00
|
||||||
DB $00
|
DB $00
|
||||||
@ -1752,7 +1755,7 @@ L54E0 LDA #$01 ; ZP - RANK
|
|||||||
STA frameCNT
|
STA frameCNT
|
||||||
LDA #$83 ; 3 lives!
|
LDA #$83 ; 3 lives!
|
||||||
STA nbLIVES
|
STA nbLIVES
|
||||||
LDA #nbDOTS
|
LDA #NBDOTS
|
||||||
STA nbDOTS
|
STA nbDOTS
|
||||||
LDA #$40
|
LDA #$40
|
||||||
STA fruitFREQ
|
STA fruitFREQ
|
||||||
@ -2062,7 +2065,7 @@ L5756 LDY #$00 ; was it already eaten?
|
|||||||
STA zpX1
|
STA zpX1
|
||||||
LDA #$15
|
LDA #$15
|
||||||
STA zpY1
|
STA zpY1
|
||||||
JSR L7819
|
JSR hideENERGIZERDOT
|
||||||
|
|
||||||
L5767 CLC ; go to dot 2
|
L5767 CLC ; go to dot 2
|
||||||
LDA zpPTR2
|
LDA zpPTR2
|
||||||
@ -2077,7 +2080,7 @@ L5772 LDY #$00 ; was it already eaten?
|
|||||||
STA zpX1
|
STA zpX1
|
||||||
LDA #$8D
|
LDA #$8D
|
||||||
STA zpY1
|
STA zpY1
|
||||||
JSR L7819
|
JSR hideENERGIZERDOT
|
||||||
|
|
||||||
L5783 CLC ; go to dot 3
|
L5783 CLC ; go to dot 3
|
||||||
LDA #<theBOARD
|
LDA #<theBOARD
|
||||||
@ -2093,7 +2096,7 @@ L5783 CLC ; go to dot 3
|
|||||||
STA zpX1
|
STA zpX1
|
||||||
LDA #$15
|
LDA #$15
|
||||||
STA zpY1
|
STA zpY1
|
||||||
JSR L7819
|
JSR hideENERGIZERDOT
|
||||||
|
|
||||||
L57A1 CLC ; go to dot 4
|
L57A1 CLC ; go to dot 4
|
||||||
LDA zpPTR2
|
LDA zpPTR2
|
||||||
@ -2108,7 +2111,7 @@ L57AC LDY #$00
|
|||||||
STA zpX1
|
STA zpX1
|
||||||
LDA #$8D
|
LDA #$8D
|
||||||
STA zpY1
|
STA zpY1
|
||||||
JSR L7819
|
JSR hideENERGIZERDOT
|
||||||
L57BD RTS
|
L57BD RTS
|
||||||
|
|
||||||
*-----------------------------------
|
*-----------------------------------
|
||||||
@ -2333,8 +2336,8 @@ drawDOT LDA xBITON,X
|
|||||||
STA (zpHGR),Y
|
STA (zpHGR),Y
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
LDA xBITOFF,X
|
LDA xBITOFF,X ; this erases a dot
|
||||||
AND (zpHGR),Y
|
AND (zpHGR),Y ; but it is useless
|
||||||
ORA hgrBIT7
|
ORA hgrBIT7
|
||||||
STA (zpHGR),Y
|
STA (zpHGR),Y
|
||||||
RTS
|
RTS
|
||||||
@ -2756,14 +2759,14 @@ drawENERGIZERDOT
|
|||||||
|
|
||||||
*--- Energizer dot sprite (value depends on bit position)
|
*--- Energizer dot sprite (value depends on bit position)
|
||||||
|
|
||||||
L61CA HEX 8680 ; bit 0
|
L61CA HEX 8680 ; 1000_0110_1000_0000
|
||||||
HEX 8F80
|
HEX 8F80 ; 1000_1111_1000_0000
|
||||||
HEX 8F80
|
HEX 8F80 ; 1000_1111_1000_0000
|
||||||
HEX 8680
|
HEX 8680 ; 1000_0110_1000_0000
|
||||||
HEX 8080
|
HEX 8080 ; 1000_0000_1000_0000
|
||||||
HEX 8080
|
HEX 8080 ; 1000_0000_1000_0000
|
||||||
HEX 8080
|
HEX 8080 ; 1000_0000_1000_0000
|
||||||
HEX 8080
|
HEX 8080 ; 1000_0000_1000_0000
|
||||||
|
|
||||||
HEX 8C80 ; bit 1
|
HEX 8C80 ; bit 1
|
||||||
HEX 9E80
|
HEX 9E80
|
||||||
@ -3596,20 +3599,20 @@ L6E1A DB $00
|
|||||||
setGHOSTMOVES
|
setGHOSTMOVES
|
||||||
LDY #$0E
|
LDY #$0E
|
||||||
L6E7B LDA L8A44,Y
|
L6E7B LDA L8A44,Y
|
||||||
STA GHOST1MOVE,Y , TEXT2,Y
|
STA GHOST1MOVE,Y ; TEXT2,Y
|
||||||
DEY
|
DEY
|
||||||
BPL L6E7B
|
BPL L6E7B
|
||||||
|
|
||||||
LDY #$00
|
LDY #$00
|
||||||
LDX #$01
|
LDX #$01
|
||||||
L6E88 LDA #$00
|
L6E88 LDA #$00
|
||||||
STA ghost3MOVE,X ; TEXT2+$200,Y
|
STA GHOST3MOVE,Y ; TEXT2+$200,Y
|
||||||
STA ghost2MOVE,X ; TEXT2+$100,X
|
STA GHOST2MOVE,X ; TEXT2+$100,X
|
||||||
STA ghost4MOVE,X ; TEXT2+$300,X
|
STA GHOST4MOVE,X ; TEXT2+$300,X
|
||||||
INX
|
INX
|
||||||
INY
|
INY
|
||||||
LDA #$01
|
LDA #$01
|
||||||
STA GHOST3MOVE,X ; TEXT2+$200,Y
|
STA GHOST3MOVE,Y ; TEXT2+$200,Y
|
||||||
STA GHOST2MOVE,X ; TEXT2+$100,X
|
STA GHOST2MOVE,X ; TEXT2+$100,X
|
||||||
STA GHOST4MOVE,X ; TEXT2+$300,X
|
STA GHOST4MOVE,X ; TEXT2+$300,X
|
||||||
INX
|
INX
|
||||||
@ -4270,75 +4273,67 @@ calcSPROFFSET
|
|||||||
L7812 HEX 00,1E,3C,5A,78,96,B4
|
L7812 HEX 00,1E,3C,5A,78,96,B4
|
||||||
|
|
||||||
*-----------------------------------
|
*-----------------------------------
|
||||||
*
|
* HIDE ENERGIZER DOT
|
||||||
*-----------------------------------
|
*-----------------------------------
|
||||||
|
|
||||||
L7819 LDA #$F8
|
hideENERGIZERDOT
|
||||||
|
LDA #$F8
|
||||||
STA sprHEIGHT
|
STA sprHEIGHT
|
||||||
JSR calcXYHGR
|
JSR calcXYHGR
|
||||||
ASL zpXBIT ; *2
|
ASL zpXBIT ; *2
|
||||||
L7822 JSR setHGRADDRESS
|
L7822 JSR setHGRADDRESS
|
||||||
LDX zpXBIT
|
LDX zpXBIT
|
||||||
LDY zpXCOL
|
LDY zpXCOL
|
||||||
LDA L7843,X
|
LDA sprEEDOT,X
|
||||||
AND (zpHGR),Y
|
AND (zpHGR),Y
|
||||||
ORA #$80
|
ORA #$80 ; force bit 7
|
||||||
STA (zpHGR),Y
|
STA (zpHGR),Y
|
||||||
INY
|
INY
|
||||||
LDA L7843+1,X
|
LDA sprEEDOT+1,X
|
||||||
AND (zpHGR),Y
|
AND (zpHGR),Y
|
||||||
ORA #$80
|
ORA #$80 ; force bit 7
|
||||||
STA (zpHGR),Y
|
STA (zpHGR),Y
|
||||||
INC zpY1
|
INC zpY1
|
||||||
INC sprHEIGHT
|
INC sprHEIGHT
|
||||||
BNE L7822
|
BNE L7822
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
L7843 HEX 407F ; erase value to draw based on bit
|
* Sprite Erase Energizer Dot value to draw based on bit position
|
||||||
HEX 017F
|
|
||||||
HEX 037E
|
|
||||||
HEX 077C
|
|
||||||
HEX 0F78
|
|
||||||
HEX 1F70
|
|
||||||
HEX 3F60
|
|
||||||
|
|
||||||
L7851 DB $09
|
sprEEDOT HEX 407F ; 0100_0000_0111_1111
|
||||||
DB $09
|
HEX 017F ; 0000_0001_0111_1111
|
||||||
DB $08
|
HEX 037E ; 0000_0011_0111_1110
|
||||||
DB $07
|
HEX 077C ; 0000_0111_0111_1100
|
||||||
DB $07
|
HEX 0F78 ; 0000_1111_0111_1000
|
||||||
DB $06
|
HEX 1F70 ; 0001_1111_0111_0000
|
||||||
DB $06
|
HEX 3F60 ; 0011_1111_0110_0000
|
||||||
DB $06
|
|
||||||
DB $06
|
|
||||||
DB $05
|
|
||||||
DB $05
|
|
||||||
DB $05
|
|
||||||
DB $05
|
|
||||||
DB $04
|
|
||||||
DB $04
|
|
||||||
DB $04
|
|
||||||
|
|
||||||
*-----------------------------------
|
*-----------------------------------
|
||||||
*
|
*
|
||||||
*-----------------------------------
|
*-----------------------------------
|
||||||
|
|
||||||
|
L7851 HEX 09090807070606060605050505040404
|
||||||
|
|
||||||
|
*-----------------------------------
|
||||||
|
* TOTO
|
||||||
|
*-----------------------------------
|
||||||
|
|
||||||
L7861 LDA theDEVICE ; which device?
|
L7861 LDA theDEVICE ; which device?
|
||||||
BNE L7868 ; joystick?
|
BNE L7868 ; joystick?
|
||||||
JSR getINPUT ; no, keyboard or joypad
|
JSR getINPUT ; no, keyboard or joypad
|
||||||
L7868 DEC frameCNT
|
L7868 DEC frameCNT
|
||||||
BEQ L786D
|
BEQ L786D
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
L786D LDA theDEVICE
|
L786D LDA theDEVICE
|
||||||
BEQ L7874
|
BEQ L7874
|
||||||
JSR getINPUT
|
JSR getINPUT
|
||||||
|
|
||||||
L7874 JSR L808C
|
L7874 JSR L808C
|
||||||
JSR getMAXRANK15
|
JSR getMAXRANK15
|
||||||
TAX
|
TAX
|
||||||
LDA L7851,X
|
LDA L7851,X
|
||||||
CLC
|
CLC
|
||||||
LDX #$08
|
LDX #idxGHOST_FRIGHTENED
|
||||||
LDY ghost2DATA,X
|
LDY ghost2DATA,X
|
||||||
BEQ L7887
|
BEQ L7887
|
||||||
ADC #$01
|
ADC #$01
|
||||||
@ -4354,10 +4349,12 @@ L7895 LDY ghost3DATA,X
|
|||||||
BEQ L789B
|
BEQ L789B
|
||||||
SBC #$01
|
SBC #$01
|
||||||
L789B STA frameCNT
|
L789B STA frameCNT
|
||||||
|
|
||||||
LDA $F3
|
LDA $F3
|
||||||
BEQ L78A5
|
BEQ L78A5
|
||||||
DEC $F3
|
DEC $F3
|
||||||
INC frameCNT
|
INC frameCNT
|
||||||
|
|
||||||
L78A5 LDA pacmanBOARD
|
L78A5 LDA pacmanBOARD
|
||||||
TAX
|
TAX
|
||||||
JSR checkMOVE
|
JSR checkMOVE
|
||||||
@ -4370,8 +4367,8 @@ L78A5 LDA pacmanBOARD
|
|||||||
CMP pacmanY
|
CMP pacmanY
|
||||||
BEQ L78D1
|
BEQ L78D1
|
||||||
L78BA LDA pacmanNEXTBOARD ; is move possible?
|
L78BA LDA pacmanNEXTBOARD ; is move possible?
|
||||||
BMI L78D7 ; no
|
BMI L78D7 ; no
|
||||||
TAX ; perhaps
|
TAX ; perhaps
|
||||||
JSR checkMOVE
|
JSR checkMOVE
|
||||||
LDY #$00
|
LDY #$00
|
||||||
LDA (ptrMOVE),Y
|
LDA (ptrMOVE),Y
|
||||||
@ -4383,7 +4380,7 @@ L78BA LDA pacmanNEXTBOARD ; is move possible?
|
|||||||
L78CF BNE L794B
|
L78CF BNE L794B
|
||||||
|
|
||||||
L78D1 STX pacmanBOARD ; save new position
|
L78D1 STX pacmanBOARD ; save new position
|
||||||
LDA #$FF ; move is not possible
|
LDA #$FF ; move is not possible
|
||||||
STA pacmanNEXTBOARD
|
STA pacmanNEXTBOARD
|
||||||
|
|
||||||
L78D7 LDA fgDEMO ; are in demo mode?
|
L78D7 LDA fgDEMO ; are in demo mode?
|
||||||
@ -4420,6 +4417,8 @@ L78FD LDY pacmanDIR
|
|||||||
JSR setXYPACMAN
|
JSR setXYPACMAN
|
||||||
JMP L79A4
|
JMP L79A4
|
||||||
|
|
||||||
|
*--- Check tunnel
|
||||||
|
|
||||||
L7915 STA pacmanNEXTBOARD
|
L7915 STA pacmanNEXTBOARD
|
||||||
LDA pacmanBOARD
|
LDA pacmanBOARD
|
||||||
CMP #$1A
|
CMP #$1A
|
||||||
@ -4433,7 +4432,6 @@ L7915 STA pacmanNEXTBOARD
|
|||||||
LDA pacmanDIR
|
LDA pacmanDIR
|
||||||
CMP #dirRIGHT
|
CMP #dirRIGHT
|
||||||
BNE L7935
|
BNE L7935
|
||||||
|
|
||||||
L792F LDA #$01 ; Pacman enters tunnel
|
L792F LDA #$01 ; Pacman enters tunnel
|
||||||
STA pacmanINTUNNEL
|
STA pacmanINTUNNEL
|
||||||
BNE L795B
|
BNE L795B
|
||||||
@ -4486,12 +4484,14 @@ L7988 STA pacmanY
|
|||||||
LDA pacmanX
|
LDA pacmanX
|
||||||
STA zpX1
|
STA zpX1
|
||||||
INC pacmanSTEP
|
INC pacmanSTEP
|
||||||
INC $1F
|
|
||||||
LDA $1F
|
INC zp1F ; variable is no more used
|
||||||
CMP #$FB ; 251?
|
LDA zp1F
|
||||||
|
CMP #$FB
|
||||||
BNE L799E
|
BNE L799E
|
||||||
LDA #$00
|
LDA #$00
|
||||||
STA $1F
|
STA zp1F
|
||||||
|
|
||||||
L799E JSR L79A4
|
L799E JSR L79A4
|
||||||
JMP L79CD
|
JMP L79CD
|
||||||
|
|
||||||
@ -5610,28 +5610,36 @@ moveXY44 CLC
|
|||||||
STA zpY1
|
STA zpY1
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
L805D LDA ghostINDEX
|
*-----------------------------------
|
||||||
|
*
|
||||||
|
*-----------------------------------
|
||||||
|
|
||||||
|
L805D LDA ghostINDEX ; save out ghost index
|
||||||
STA saveVAR
|
STA saveVAR
|
||||||
JSR getGHOSTSDATA
|
JSR getGHOSTSDATA ; save its data
|
||||||
LDA #gCLYDE
|
LDA #gCLYDE ; loop 4..1
|
||||||
STA ghostINDEX
|
STA ghostINDEX
|
||||||
L8068 JSR setGHOSTSDATA
|
L8068 JSR setGHOSTSDATA ; get data
|
||||||
LDA ghostISDEAD
|
LDA ghostISDEAD ; is ghost dead?
|
||||||
BEQ L807D
|
BEQ L807D ; no
|
||||||
|
LDA #$01 ; yes
|
||||||
|
STA $80
|
||||||
|
JSR L8763 ; do something
|
||||||
LDA #$01
|
LDA #$01
|
||||||
STA $80
|
STA $80
|
||||||
JSR L8763
|
JSR L8763 ; do something
|
||||||
LDA #$01
|
L807D JSR getGHOSTSDATA ; save data
|
||||||
STA $80
|
DEC ghostINDEX ; ghost--
|
||||||
JSR L8763
|
|
||||||
L807D JSR getGHOSTSDATA
|
|
||||||
DEC ghostINDEX
|
|
||||||
BNE L8068
|
BNE L8068
|
||||||
LDA saveVAR
|
LDA saveVAR ; restore ghost index
|
||||||
STA ghostINDEX
|
STA ghostINDEX
|
||||||
JSR setGHOSTSDATA
|
JSR setGHOSTSDATA ; ...and its data
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
*-----------------------------------
|
||||||
|
*
|
||||||
|
*-----------------------------------
|
||||||
|
|
||||||
L808C LDA $EA
|
L808C LDA $EA
|
||||||
BNE L8092
|
BNE L8092
|
||||||
DEC $EB
|
DEC $EB
|
||||||
@ -5661,21 +5669,21 @@ L80B1 JSR L80C1
|
|||||||
STA $EA
|
STA $EA
|
||||||
L80C0 RTS
|
L80C0 RTS
|
||||||
|
|
||||||
L80C1 LDA #gCLYDE
|
L80C1 LDA #gCLYDE ; loop 4..1
|
||||||
STA ghostINDEX
|
STA ghostINDEX
|
||||||
L80C5 JSR setGHOSTSDATA
|
L80C5 JSR setGHOSTSDATA ; get data
|
||||||
LDA $81
|
LDA $81 ; can we handle?
|
||||||
BNE L80DB
|
BNE L80DB ; nope
|
||||||
LDA ghostDIR
|
LDA ghostDIR ; yes, change direction
|
||||||
EOR #$01
|
EOR #$01
|
||||||
STA ghostDIR
|
STA ghostDIR
|
||||||
LDY ghostMOVEINDEX
|
LDY ghostMOVEINDEX ; update the ghost board/move table
|
||||||
STA (ghostMOVE),Y
|
STA (ghostMOVE),Y
|
||||||
LDA #$FF
|
LDA #$FF
|
||||||
INY
|
INY
|
||||||
STA (ghostMOVE),Y
|
STA (ghostMOVE),Y
|
||||||
L80DB JSR getGHOSTSDATA
|
L80DB JSR getGHOSTSDATA ; save data
|
||||||
DEC ghostINDEX
|
DEC ghostINDEX ; next ghost
|
||||||
BNE L80C5
|
BNE L80C5
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
@ -5793,7 +5801,7 @@ initCARTOON
|
|||||||
STA ghostISDEAD
|
STA ghostISDEAD
|
||||||
STA ghostFRIGHTENED
|
STA ghostFRIGHTENED
|
||||||
STA pacmanSTEP
|
STA pacmanSTEP
|
||||||
LDA #gINKY
|
LDA #gINKY ; 1
|
||||||
STA ghostINDEX
|
STA ghostINDEX
|
||||||
STA $81
|
STA $81
|
||||||
STA frameCNT
|
STA frameCNT
|
||||||
@ -6447,7 +6455,7 @@ L8763 DEC $80 ; timer for ghost refresh
|
|||||||
BEQ L8768
|
BEQ L8768
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
L8768 LDA $E4 ; are we un frighten mode?
|
L8768 LDA $E4 ; are we in frighten mode?
|
||||||
BEQ L8780
|
BEQ L8780
|
||||||
LDA $E1 ; what about the frighten tempo?
|
LDA $E1 ; what about the frighten tempo?
|
||||||
BNE L8772
|
BNE L8772
|
||||||
@ -6550,7 +6558,7 @@ L880B LDY ghostDIR
|
|||||||
LDA #$00
|
LDA #$00
|
||||||
STA $7D
|
STA $7D
|
||||||
LDA ghostDIR
|
LDA ghostDIR
|
||||||
CMP #$02
|
CMP #dirRIGHT
|
||||||
BNE L8862
|
BNE L8862
|
||||||
L8833 LDA #$01
|
L8833 LDA #$01
|
||||||
STA $7A
|
STA $7A
|
||||||
@ -6572,7 +6580,7 @@ L8854 LDA #$06
|
|||||||
LDA #$00
|
LDA #$00
|
||||||
STA $7D
|
STA $7D
|
||||||
LDA ghostDIR
|
LDA ghostDIR
|
||||||
CMP #$03
|
CMP #dirLEFT
|
||||||
BEQ L8833
|
BEQ L8833
|
||||||
L8862 LDA #$00
|
L8862 LDA #$00
|
||||||
STA $7A
|
STA $7A
|
||||||
@ -6744,6 +6752,10 @@ L8981 ASL ; *2
|
|||||||
ADC zpTEMP4 ; +6
|
ADC zpTEMP4 ; +6
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
*-----------------------------------
|
||||||
|
*
|
||||||
|
*-----------------------------------
|
||||||
|
|
||||||
L8988 DEC $82
|
L8988 DEC $82
|
||||||
BNE L89DA
|
BNE L89DA
|
||||||
LDY ghostMOVEINDEX
|
LDY ghostMOVEINDEX
|
||||||
@ -6751,7 +6763,7 @@ L8988 DEC $82
|
|||||||
ROR
|
ROR
|
||||||
BCC L89A6
|
BCC L89A6
|
||||||
LDA ghostDIR
|
LDA ghostDIR
|
||||||
CMP #$00
|
CMP #dirDOWN
|
||||||
BNE L899E
|
BNE L899E
|
||||||
L8999 LDA #$01
|
L8999 LDA #$01
|
||||||
INY
|
INY
|
||||||
@ -6762,11 +6774,12 @@ L899E LDA #$01
|
|||||||
JMP L89C7
|
JMP L89C7
|
||||||
|
|
||||||
L89A6 LDA ghostDIR
|
L89A6 LDA ghostDIR
|
||||||
CMP #$01
|
CMP #dirUP
|
||||||
BNE L89B1
|
BNE L89B1
|
||||||
INY
|
INY
|
||||||
LDA #$00
|
LDA #$00
|
||||||
STA (ghostMOVE),Y
|
STA (ghostMOVE),Y
|
||||||
|
|
||||||
L89B1 LDA ghostINDEX
|
L89B1 LDA ghostINDEX
|
||||||
CMP #$02
|
CMP #$02
|
||||||
BNE L89BF
|
BNE L89BF
|
||||||
@ -6791,6 +6804,8 @@ L89C7 INY
|
|||||||
BNE L89DA
|
BNE L89DA
|
||||||
L89D7 JSR L6EA5
|
L89D7 JSR L6EA5
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
L89DA LDA ghostINDEX
|
L89DA LDA ghostINDEX
|
||||||
ROR
|
ROR
|
||||||
BCC L89E1
|
BCC L89E1
|
||||||
@ -6814,6 +6829,7 @@ L89FC JMP L8874
|
|||||||
L89FF CMP #$5D
|
L89FF CMP #$5D
|
||||||
BEQ L89F4
|
BEQ L89F4
|
||||||
BNE L89FC
|
BNE L89FC
|
||||||
|
|
||||||
L8A05 LDA ghostX
|
L8A05 LDA ghostX
|
||||||
CMP #$8B
|
CMP #$8B
|
||||||
BNE L89FC
|
BNE L89FC
|
||||||
@ -7003,23 +7019,28 @@ L8B6F LDA pacmanY
|
|||||||
JMP L8B3F
|
JMP L8B3F
|
||||||
L8B7D RTS
|
L8B7D RTS
|
||||||
|
|
||||||
L8B7E LDA $67
|
*--- This code makes $1F and $67 useless
|
||||||
|
|
||||||
|
L8B7E LDA zp67
|
||||||
JMP L8B9D ; PATCH
|
JMP L8B9D ; PATCH
|
||||||
BEQ L8B8A
|
|
||||||
DEC $67
|
BEQ L8B8A ; Dead code...
|
||||||
|
DEC zp67
|
||||||
BEQ L8B9D
|
BEQ L8B9D
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
L8B8A LDA $1F
|
L8B8A LDA zp1F
|
||||||
LDX ghostFRIGHTENED ; is ghost frightened?
|
LDX ghostFRIGHTENED ; is ghost frightened?
|
||||||
BNE L8B92 ; yes
|
BNE L8B92 ; yes
|
||||||
AND #$3F ; no
|
AND #$3F ; no
|
||||||
L8B92 CMP #$00
|
L8B92 CMP #$00
|
||||||
BNE L8B9D
|
BNE L8B9D
|
||||||
LDA #$04
|
LDA #$04
|
||||||
STA $67
|
STA zp67
|
||||||
STA pacmanSTEP
|
STA pacmanSTEP
|
||||||
RTS
|
RTS ; ...dead code
|
||||||
|
|
||||||
|
*--- End of useless code
|
||||||
|
|
||||||
L8B9D LDA ghostFRIGHTENED ; is ghost frightened?
|
L8B9D LDA ghostFRIGHTENED ; is ghost frightened?
|
||||||
BEQ L8BDD ; no, exit
|
BEQ L8BDD ; no, exit
|
||||||
@ -9469,7 +9490,7 @@ LA616 HEX 7C01007C01003306003306007F07007F
|
|||||||
DB $95
|
DB $95
|
||||||
DB $98
|
DB $98
|
||||||
DB $95
|
DB $95
|
||||||
DB $AD
|
DB $AC
|
||||||
DB $95
|
DB $95
|
||||||
DB $C0
|
DB $C0
|
||||||
DB $85
|
DB $85
|
||||||
|
19991
pacman/PACMAN_Output.txt
19991
pacman/PACMAN_Output.txt
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user