Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .inesprg 1 ; 1x 16KB PRG code
- .ineschr 1 ; 1x 8KB CHR data
- .inesmap 0 ; mapper 0 = NROM, no bank swapping
- .inesmir 1 ; background mirroring
- ;declare our variables
- .rsset 0 ;starting at address zero
- ballxspeed: .rs 1 ;pixels per frame x
- ballyspeed: .rs 1 ;pixels per frame y
- ballx: .rs 1 ;ball x pos
- bally: .rs 1 ;ball y pos
- ;balldir: .rs 1 ;ball direction: bit zero = up/down; bit one = left/right
- ballupdown: .rs 1 ;ball direction: 1 = down
- ballleftright: .rs 1 ;ball direction: 1 = right
- paddle1: .rs 1 ;top position for paddle 1
- paddle2: .rs 1 ;top position for paddle 2
- p1score: .rs 1 ;score for player 1
- p2score: .rs 1 ;score for player 2
- buttons1: .rs 1 ;buttons for player 1
- buttons2: .rs 1 ;buttons for player 2
- state: .rs 1 ;our current state
- arrowpos: .rs 1 ;current position of the arrow
- pressed: .rs 1 ;if the select button hasn't been released yet (used to avoid wild switching)
- ballmoving: .rs 1 ;if the ball is currently moving
- AIplayer: .rs 1 ;1 if AI is playing
- AIplayed: .rs 1 ;variable to keep AI's speed down
- cheatenabled: .rs 1 ;set to 1 if cheats are enabled
- cheatcounter: .rs 1 ;current button in the cheat code
- cheatpressed: .rs 1 ;set if a button hasn't been released yet
- ;declare our constants
- ;paddle constants
- PADDLE1_X = $00
- PADDLE2_X = $F8
- PADDLE_HEIGHT = 32
- PADDLE_SEGMENT_HEIGHT = 8
- ;ball bounds
- TOP = $08
- BOTTOM = $E0
- LEFT = $08
- RIGHT = $F0
- PADDLE_BOTTOM = BOTTOM-PADDLE_HEIGHT
- PADDLE_TOP = $08
- ;game speeds
- PADDLE_SPEED = 4
- BALL_SPEED = 2
- ;text stuff
- PLAYER1TEXT_LOC = $2C
- PLAYER2TEXT_LOC = $3C
- WINTEXT_HIGH = $21 ;nametable address to place the winner text
- WINTEXT_LOW = $48
- WINNING_SCORE = 10
- ;button constants
- BUTTON_A = $80
- BUTTON_B = $40
- BUTTON_SELECT = $20
- BUTTON_START = $10
- BUTTON_UP = $08
- BUTTON_DOWN = $04
- BUTTON_LEFT = $02
- BUTTON_RIGHT = $01
- ;ppu constants
- PPUREG_1 = %10010000 ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
- PPUREG_2 = %00011110 ; enable sprites, enable background, no clipping on left side
- ;state defines
- STATE_TITLE = $00
- STATE_PLAYING = $01
- STATE_WIN = $02
- ;positions
- ARROW_POS_HIGH = $22
- ARROW_POS_1 = $A9
- ARROW_POS_2 = $E9
- .bank 0 ;program bank 0
- .org $C000
- RESET: ;NES init code stolen from Nerdy Nights, I was too lazy to write my own and didn't understand some of the stuff it did and why
- SEI ; disable IRQs
- CLD ; disable decimal mode
- LDX #$40
- STX $4017 ; disable APU frame IRQ
- LDX #$FF
- TXS ; Set up stack
- INX ; now X = 0
- STX $2000 ; disable NMI
- STX $2001 ; disable rendering
- STX $4010 ; disable DMC IRQs
- vblankwait1: ; First wait for vblank to make sure PPU is ready
- BIT $2002
- BPL vblankwait1
- clrmem:
- LDA #$00
- STA $0000, x
- STA $0100, x
- STA $0300, x
- STA $0400, x
- STA $0500, x
- STA $0600, x
- STA $0700, x
- LDA #$FE
- STA $0200, x
- INX
- BNE clrmem
- vblankwait2: ; Second wait for vblank, PPU is ready after this
- BIT $2002
- BPL vblankwait2
- ;stolen code ends here
- ;initialize the PPU RAM and copy over our palettes and nametables and other fun stuff
- PaletteCopy: ;copy the palettes to the PPU
- LDA $2002 ;read the PPU status to reset the address
- LDA #$3F ;write out the palette address to the PPU ($3F00)
- STA $2006
- LDA #$00
- STA $2006
- LDX #0 ;reset X for the copy
- PaletteCopyLoop:
- LDA palettes,x ;load our palette byte
- STA $2007 ;store it to the magic address where it gets written to PPU RAM
- INX
- CPX #32 ;test if we're done (we need to copy 32 bytes of palette data)
- BNE PaletteCopyLoop
- CopyNametable:
- LDA #LOW(titlenametable) ;set up addresses for indirect copying
- STA $30
- LDA #HIGH(titlenametable)
- STA $31
- JSR NametableCopy ;actually copy the nametable
- AttributeCopy:
- LDA $2002 ;read the PPU status to reset the address
- LDA #$23 ;write out the nametable address to the PPU ($23C0)
- STA $2006
- LDA #$C0
- STA $2006
- LDX #0 ;reset X for the copy
- AttributeCopyLoop:
- LDA playfieldattributes,x ;load attribute byte
- STA $2007 ;write it to the PPU
- INX
- CPX #0 ;if we haven't copied all of it
- BNE AttributeCopyLoop ;copy more
- JSR ClearSprites
- JSR UpdateSpritesTransfer
- JSR TitleRamInit
- ;JSR UpdateSpritesTransfer
- PPUInit: ;set up the PPU registers
- LDA #PPUREG_1
- STA $2000
- LDA #PPUREG_2
- STA $2001
- InfiniteLoop:
- JMP InfiniteLoop ;what could it be? I wonder...
- NmiHandler:
- LDA state ;do different actions depending upon the current state
- CMP #STATE_TITLE ;if we're at the title screen
- BEQ DoTitle
- CMP #STATE_PLAYING ;or playing
- BEQ DoPlay
- CMP #STATE_WIN
- BEQ DoWin
- RTI ;huh, how could this have happened?
- DoPlay:
- JSR DrawScore
- JSR UpdateSprites
- JSR ReadControllers
- JSR HandleControllers
- JSR MovePaddles
- JSR BounceBall
- JSR MoveBall
- JMP NmiFinished
- DoTitle:
- JSR ReadControllers
- JSR HandleTitleButtons
- JMP NmiFinished
- DoWin:
- JSR ReadControllers
- JSR HandleWinButtons
- NmiFinished:
- LDA #0 ;reset the PPU for the next frame
- STA $2005
- STA $2005
- RTI
- ClearSprites:
- LDX #$FF
- LDA #$FF
- ClearSpritesLoop:
- STA $200,x
- DEX
- BNE ClearSpritesLoop
- UpdateSprites:
- LDA bally ;store the ball position to the sprite area
- STA $200
- LDA ballx
- STA $203
- CLC
- LDA paddle1 ;do the same with the paddles
- STA $204 ;it needs to be done 4 times for each paddle because each paddle is composed of 4 sprites
- ADC #8
- STA $204+4
- ADC #8
- STA $204+8
- ADC #8
- STA $204+12
- ADC #8
- LDA paddle2
- STA $204+16
- ADC #8
- STA $204+20
- ADC #8
- STA $204+24
- ADC #8
- STA $204+28
- UpdateSpritesTransfer:
- ;transfer the sprite data to the PPU via DMA
- LDA #0 ;set the low RAM address
- STA $2003
- LDA #2 ;set the high RAM address and start the dma
- STA $4014
- RTS
- DrawScore:
- LDA $2002 ;read the PPU status to reset the address
- LDA #$20 ;write out the score location
- STA $2006
- LDA #PLAYER1TEXT_LOC
- STA $2006
- LDA p1score
- STA $2007
- LDA $2002 ;read the PPU status to reset the address
- LDA #$20 ;write out the score location
- STA $2006
- LDA #PLAYER2TEXT_LOC
- STA $2006
- LDA p2score
- STA $2007
- RTS
- ReadControllers:
- LDA #1 ;latch the buttons
- STA $4016
- LDA #0
- STA $4016
- LDX #8 ;get ready for the loop
- ReadControllersLoop:
- LDA $4016 ;get button for controller 1
- LSR A ;put the button in carry
- ROL buttons1 ;and then put it in buttons
- LDA $4017 ;do the same for controller 2
- LSR A ;put the button in carry
- ROL buttons2 ;and then put it in buttons
- DEX ;check if we have any more buttons left
- BNE ReadControllersLoop
- RTS
- HandleControllers:
- LDY buttons1
- TYA
- AND #BUTTON_START ;if start is pressed
- BNE StartBall ;start the ball moving
- RTS
- StartBall:
- LDA ballmoving ;if the ball is already moving
- BNE RtsBranch1 ;no need to set it up again
- LDA #BALL_SPEED ;set up the speed
- STA ballxspeed
- STA ballyspeed
- LDA #1 ;and indicate that it's moving
- STA ballmoving
- RtsBranch1:
- RTS
- MovePaddles:
- LDA ballmoving ;if the ball isn't moving
- BEQ MovePaddlesDone ;the paddles shouldn't either
- LDY buttons1 ;load the buttons and paddle position
- TYA
- LDX paddle1
- AND #BUTTON_UP ;if up is pressed
- BNE Player1Up ;move up
- TYA
- AND #BUTTON_DOWN
- BNE Player1Down ;and move down if down is pressed
- JMP MovePaddlesNext ;if neither is pressed, go check player 2
- Player1Down:
- CPX #PADDLE_BOTTOM ;if the paddle is as far down as it can go
- BEQ MovePaddlesNext ;ignore this and go test player 2
- TXA ;otherwise, add the paddle speed
- ADC #PADDLE_SPEED
- STA paddle1 ;and store it
- JMP MovePaddlesNext ;then go test player 2
- Player1Up:
- CPX #PADDLE_TOP ;if the paddle is as far up as it can go
- BEQ MovePaddlesNext ;ignore this and go test player 2
- TXA ;otherwise, subtract the paddle speed from the paddle position
- SBC #PADDLE_SPEED
- STA paddle1 ;and store it
- MovePaddlesNext: ;everything is the same for player 2
- LDA AIplayer ;however, if AI is playing
- BNE AIRun ;allow it to make its move
- AIRunDone:
- LDX paddle2
- LDY buttons2
- TYA
- AND #BUTTON_UP
- BNE Player2Up
- TYA
- AND #BUTTON_DOWN
- BNE Player2Down
- RTS
- Player2Down:
- CPX #PADDLE_BOTTOM
- BEQ MovePaddlesDone
- TXA
- ADC #PADDLE_SPEED
- STA paddle2
- JMP MovePaddlesDone
- Player2Up:
- CPX #PADDLE_TOP
- BEQ MovePaddlesDone
- TXA
- SBC #PADDLE_SPEED
- STA paddle2
- MovePaddlesDone:
- RTS
- AIRun: ;basic philosophy is to get the paddle as close to the ball as possible
- LDA #0 ;clear out buttons
- STA buttons2
- LDA AIplayed
- BNE AIPlayedDone ;if we played last frame, don't this frame
- LDA #1 ;otherwise, indicate that we have
- STA AIplayed
- LDA paddle2 ;and begin AI logic
- CMP bally ;if the ball is above the paddle
- BCS AIMoveUp ;move the paddle up
- CLC
- ADC #PADDLE_HEIGHT
- CMP bally ;but if it is below the ball
- BCC AIMoveDown ;move the paddle down
- JMP AIRunDone
- AIPlayedDone:
- LDA #0
- STA AIplayed
- JMP AIRunDone
- AIMoveUp: ;I'm lazy so all it does is write to the button variables
- LDA #BUTTON_UP
- STA buttons2
- JMP AIRunDone
- AIMoveDown:
- LDA #BUTTON_DOWN
- STA buttons2
- JMP AIRunDone
- BounceBall:
- LDX ballx
- LDY bally
- CPX #LEFT ;if the ball X position is smaller than the left boundary
- BCC CollideLeft ;handle collisions
- CPX #RIGHT ;if the ball X is bigger than the right boundary
- BCS CollideRight ;do the same
- BounceNext:
- CPY #TOP ;if x < top
- BCC CollideTop
- CPY #BOTTOM ;if x > bottom
- BCS CollideBottom
- RTS
- CollideTop:
- LDA #1 ;set the direction to down
- STA ballupdown
- RTS
- CollideBottom:
- LDA #0 ;set the direction to up
- STA ballupdown
- RTS
- CollideLeft:
- LDA paddle1 ;check if we're hitting the paddle
- SEC ;this checks if the bottom of the ball is touching the paddle
- SBC #PADDLE_SEGMENT_HEIGHT
- CMP bally ;check if we're above the paddle
- BCS ResetBall1 ;if so, change the score and reset everything
- ADC #PADDLE_HEIGHT+PADDLE_SEGMENT_HEIGHT ;check if we're below the paddle
- CMP bally
- BCC ResetBall1 ;if so, reset
- LDA #1 ;otherwise, set the direction to left
- STA ballleftright
- LDA paddle1 ;and perform angling
- ADC #PADDLE_SEGMENT_HEIGHT*3 ;check if we're below the third segment
- CMP bally
- BCC AngleBall ;if so, angle the ball
- LDA paddle1 ;or above the second segment
- ADC #PADDLE_SEGMENT_HEIGHT
- CMP bally
- BCS AngleBall
- LDA #BALL_SPEED ;otherwise, reset the default angle
- STA ballxspeed
- STA ballyspeed
- JMP BounceNext ;and go back to test up/down
- AngleBall:
- LDA #BALL_SPEED+1 ;set the y speed 1 higher than the x speed
- STA ballyspeed
- LDA ballupdown ;and invert the up/down direction
- EOR #1
- STA ballupdown
- JMP BounceNext
- CollideRight:
- LDA cheatenabled ;if cheats are enabled
- BNE ResetBall2 ;player 2 always dies
- LDA paddle2 ;check if we're hitting the paddle
- CMP bally ;check if we're above the paddle
- BCS ResetBall2 ;if so, change the score and reset everything
- ADC #PADDLE_HEIGHT ;check if we're below the paddle
- CMP bally
- BCC ResetBall2 ;if so, reset
- LDA #0 ;set the direction to right
- STA ballleftright
- LDA paddle2 ;and perform angling
- ADC #PADDLE_SEGMENT_HEIGHT*3 ;check if we're below the third segment
- CMP bally
- BCC AngleBall ;if so, angle the ball
- LDA paddle2 ;or above the second segment
- ADC #PADDLE_SEGMENT_HEIGHT
- CMP bally
- BCS AngleBall
- LDA #BALL_SPEED ;otherwise, reset the default angle
- STA ballxspeed
- STA ballyspeed
- JMP BounceNext ;and go back to test up/down
- ResetBall1:
- INC p2score ;increment player 2's score
- LDA p2score ;check if player 2 wins
- CMP #WINNING_SCORE
- BEQ Player2Wins
- LDA #16 ;set up the ball position
- STA bally
- LDA #RIGHT-8
- STA ballx
- LDA #1 ;and direction
- STA ballupdown
- LDA #0 ;set up other variables
- STA ballleftright ;keep the ball from moving
- STA ballxspeed
- STA ballyspeed
- STA ballmoving
- LDA #PADDLE_TOP
- STA paddle1
- STA paddle2
- RTS
- ResetBall2:
- INC p1score ;increment player 1's score
- LDA p1score ;check if player 1 wins
- CMP #WINNING_SCORE
- BEQ Player1Wins
- LDA #16 ;set up the ball position
- STA ballx
- STA bally
- LDA #1 ;and direction
- STA ballupdown
- STA ballleftright
- LDA #0 ;and speed
- STA ballxspeed
- STA ballyspeed
- STA ballmoving
- LDA #PADDLE_TOP
- STA paddle1
- STA paddle2
- RTS
- Player1Wins:
- ;write out the player 1 wins text
- LDA $2002 ;read the PPU status to reset the address
- LDA #WINTEXT_HIGH ;write out the bottom address
- STA $2006
- LDA #WINTEXT_LOW
- STA $2006
- ;now copy the text over to the PPU RAM
- LDX #0
- Player1Loop:
- LDA p1wintext,x
- CMP #$FF ;check if this is the end
- BEQ HandleWinnage ;it is, so stop spitting out text
- STA $2007 ;otherwise write out the text
- INX
- JMP Player1Loop
- Player2Wins:
- ;write out the player 2 wins text
- LDA $2002 ;read the PPU status to reset the address
- LDA #WINTEXT_HIGH ;write out the bottom address
- STA $2006
- LDA #WINTEXT_LOW
- STA $2006
- ;now copy the text over to the PPU RAM
- LDX #0
- Player2Loop:
- LDA p2wintext,x
- CMP #$FF ;check if this is the end
- BEQ HandleWinnage ;it is, so stop spitting out text
- STA $2007 ;otherwise write out the text
- INX
- JMP Player2Loop
- HandleWinnage:
- LDA #STATE_WIN ;change the state to winning
- STA state
- LDA #0 ;set up the button state
- STA pressed
- RTS
- MoveBall:
- LDA ballupdown ;if the ball is going up
- BEQ MoveUp ;move up
- LDA bally ;otherwise, it is going down
- CLC
- ADC ballyspeed ;so add the ball speed
- STA bally ;and store it
- JMP NextMove ;then calculate the horizontal ball position
- MoveUp:
- LDA bally ;move the ball up
- SEC
- SBC ballyspeed ;subtract the ball speed
- STA bally ;and store the ball position
- NextMove:
- LDA ballleftright
- BEQ MoveLeft ;branch to moveleft if the ball is doing so
- LDA ballx ;otherwise, it's going right
- CLC
- ADC ballxspeed ;so move it right
- STA ballx
- RTS ;and return
- MoveLeft:
- LDA ballx
- SEC
- SBC ballxspeed ;going left
- STA ballx
- RTS
- HandleTitleButtons:
- LDY buttons1 ;get player 1's buttons
- JSR PreHandleCheats ;handle the cheats
- TYA
- AND #BUTTON_SELECT ;if select pressed
- BNE MoveArrow ;move the arrow on the screen
- LDA #0 ;select has been released
- STA pressed
- TYA
- AND #BUTTON_START ;if start is pressed
- BNE StartPlay
- RTS
- PreHandleCheats:
- LDA cheatenabled ;if cheats have already been enabled
- BNE RtsBranch ;return
- LDA cheatpressed ;if the previous button is still pressed
- BNE HandleCheatsPressed ;go deal with it
- TYA ;if no buttons are pressed
- BEQ RtsBranch ;return
- HandleCheats:
- LDA #1 ;indicate that a button has been pressed
- STA cheatpressed
- LDX cheatcounter ;load the next cheat byte
- LDA cheatcode,x
- INX ;and increment the counter
- STX cheatcounter
- CMP #$FF ;if this is the ending marker
- BEQ HandleCheatsSuccess ;the user entered the cheat successfully
- CMP buttons1 ;if the byte isn't equal to the buttons
- BNE HandleCheatsFail ;the user failed
- RTS
- HandleCheatsSuccess:
- LDA #1 ;enable cheats
- STA cheatenabled
- RTS
- HandleCheatsFail:
- LDX #0 ;reset the counter to 0
- STX cheatcounter
- RTS
- HandleCheatsPressed:
- TYA ;if the previous button hasn't been released
- BNE RtsBranch ;go return
- LDA #0 ;since it has been, indicate so
- STA cheatpressed
- JMP RtsBranch ;and return
- MoveArrow:
- LDA pressed ;if it hasn't been released yet
- BNE RtsBranch ;don't do anything
- LDA #1 ;indicate that it has been pressed
- STA pressed
- LDA arrowpos
- AND #1 ;if it's at the top position
- BEQ HandleTop ;erase and redraw it
- BNE HandleBottom ;otherwise, it's at the bottom, so erase and redraw it there
- RtsBranch:
- RTS
- StartPlay:
- LDA arrowpos ;set AI playing status
- EOR #1
- STA AIplayer
- LDA #STATE_PLAYING ;change the state to playing
- STA state
- LDA #0 ;turn off the PPU so things don't look funky while we copy over the new nametable
- STA $2001
- LDA #LOW(playfieldnametable) ;set up addresses for indirect copying
- STA $30
- LDA #HIGH(playfieldnametable)
- STA $31
- JSR NametableCopy ;actually copy the nametable
- JSR CopySprites ;copy the sprites to RAM as well
- LDA #PPUREG_2 ;and turn the PPU back on
- STA $2001
- RAMInit: ;set up the RAM variables
- LDA #0
- STA ballxspeed
- STA ballyspeed
- STA ballmoving
- STA p1score
- STA p2score
- STA AIplayed
- LDA #1
- STA ballupdown
- STA ballleftright
- LDA #16
- STA ballx
- STA bally
- LDA #PADDLE_TOP
- STA paddle1
- STA paddle2
- RTS
- HandleTop:
- LDA $2002 ;read the PPU status to reset the address
- LDA #ARROW_POS_HIGH ;write out the top address
- STA $2006
- LDA #ARROW_POS_1
- STA $2006
- LDA #$24 ;and write a blank tile
- STA $2007
- ;now write the arrow at the new position
- LDA $2002 ;read the PPU status to reset the address
- LDA #ARROW_POS_HIGH ;write out the bottom address
- STA $2006
- LDA #ARROW_POS_2
- STA $2006
- LDA #$28 ;and write an arrow tile
- STA $2007
- LDA #1
- STA arrowpos
- RTS
- HandleBottom:
- LDA $2002 ;read the PPU status to reset the address
- LDA #ARROW_POS_HIGH ;write out the bottom address
- STA $2006
- LDA #ARROW_POS_2
- STA $2006
- LDA #$24 ;and write a blank tile
- STA $2007
- ;now write the arrow at the new position
- LDA $2002 ;read the PPU status to reset the address
- LDA #ARROW_POS_HIGH ;write out the top address
- STA $2006
- LDA #ARROW_POS_1
- STA $2006
- LDA #$28 ;and write an arrow tile
- STA $2007
- LDA #0
- STA arrowpos
- RTS
- NametableCopy:
- LDA $2002 ;read the PPU status to reset the address
- LDA #$20 ;write out the nametable address to the PPU ($2000)
- STA $2006
- LDA #$00
- STA $2006
- LDY #0 ;reset Y for the copy
- LDX #0
- NametableCopyLoop:
- LDA [$30],y ;load the byte
- STA $2007 ;store it at the magic address
- INY
- CPY #0 ;if we haven't yet copied 8 rows
- BNE NametableCopyLoop ;copy more
- NametableCopyNext: ;however, if we have, get ready for the next block of 8
- INC $31 ;increment the address
- INX ;check if we have any more blocks left
- CPX #4
- BNE NametableCopyLoop
- RTS
- TitleRamInit:
- LDA #0
- STA arrowpos
- STA pressed
- STA cheatcounter
- STA cheatenabled
- STA cheatpressed
- RTS
- HandleWinButtons:
- LDA buttons1
- AND #BUTTON_START ;check if start is pressed
- BEQ WinButtonsDone ;if it isn't, return
- LDA pressed ;if START hasn't already been pressed
- BEQ WinButtonsSetPressed ;indicate that it has, but don't return
- ActualWinButtons:
- ;otherwise, set everything up for the title screen
- JSR TitleRamInit
- JSR ClearSprites
- JSR UpdateSpritesTransfer
- LDA #0 ;turn off the PPU so things don't look funky while we copy over the new nametable
- STA $2001
- LDA #LOW(titlenametable) ;set up the nametable address
- STA $30
- LDA #HIGH(titlenametable)
- STA $31
- JSR NametableCopy ;actually copy over the nametable
- LDA #STATE_TITLE ;and update the state
- STA state
- LDA #PPUREG_2 ;and turn the PPU back on
- STA $2001
- WinButtonsDone:
- LDA pressed ;if it's been pressed
- BNE ActualWinButtons ;we can actually handle it now
- RTS
- WinButtonsSetPressed:
- LDA #1
- STA pressed
- RTS
- CopySprites: ;copy the default sprite data to RAM
- LDX #0 ;reset X for the copy
- CopySpritesLoop:
- LDA defaultsprites,x
- STA $200,x
- INX
- CPX #4*9 ;check if we have copied everything
- BNE CopySpritesLoop
- RTS
- .bank 1 ;program bank 1, used for data in this case
- .org $E000
- palettes:
- ;.db $30,$0F,$10,$00, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F ;background palette data
- ;.db $30,$0F,$10,$00, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F ;sprite palette data
- .db $0F,$30,$10,$00, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F
- .db $0F,$30,$10,$00, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F, $3F,$3F,$3F,$3F
- playfieldnametable:
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$19,$15,$0A,$22,$0E,$1B,$24,$01,$24,$24,$24,$24,$25
- .db $25,$24,$24,$19,$15,$0A,$22,$0E,$1B,$24,$02,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- .db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$25
- .db $25,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24
- playfieldattributes:
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000
- p1wintext:
- .db $19,$15,$0A,$22,$0E,$1B,$24,$01,$24,$20,$12,$17,$1C,$2B,$01,$2B,$FF ; "PLAYER 1 WINS!1!"
- p2wintext:
- .db $19,$15,$0A,$22,$0E,$1B,$24,$02,$24,$20,$12,$17,$1C,$2B,$01,$2B,$FF ; "PLAYER 2 WINS!1!"
- cheatcode:
- .db BUTTON_UP,BUTTON_DOWN,BUTTON_RIGHT,BUTTON_A,BUTTON_LEFT,BUTTON_B,$FF ; the cheat code specified in a series of buttons terminated by $FF
- titlenametable:
- .incbin "title.nam"
- defaultsprites:
- .db $00,$01,$00,$00 ;ball
- .db $00,$02,$00,PADDLE1_X ;paddle 1 segment 1
- .db $08,$02,$00,PADDLE1_X ;paddle 1 segment 2
- .db $10,$02,$00,PADDLE1_X ;paddle 1 segment 3
- .db $18,$02,$00,PADDLE1_X ;paddle 1 segment 4
- .db $00,$02,$00,PADDLE2_X ;paddle 1 segment 1
- .db $08,$02,$00,PADDLE2_X ;paddle 1 segment 2
- .db $10,$02,$00,PADDLE2_X ;paddle 1 segment 3
- .db $18,$02,$00,PADDLE2_X ;paddle 1 segment 4
- .org $FFFA ;various vectors
- .dw NmiHandler ;NMI Handler routine vector
- .dw RESET ;reset vector
- .dw 0 ;external interrupt IRQ, not used yet
- .bank 2 ;bank 2, used for chr data
- .org $0000
- .incbin "graphics.chr" ;8KB of chr data
Add Comment
Please, Sign In to add comment