Advertisement
Guest User

Untitled

a guest
Feb 16th, 2012
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;***************
  2. ;INITIALIZE TITLE
  3. ;******************************************************************
  4.     ;;    LOAD PALETTES, BACKGROUND, ATTRIBUTES
  5.     InitializeTitle:
  6.     LoadPalettes:
  7.       LDA $2002             ; read PPU status to reset the high/low latch
  8.       LDA #$3F
  9.       STA $2006             ; write the high byte of $3F00 address
  10.       LDA #$00
  11.       STA $2006             ; write the low byte of $3F00 address
  12.       LDX #$00              ; start out at 0
  13.     LoadPalettesLoop:
  14.       LDA palette, x        ; load data from address (palette + the value in x)
  15.                               ; 1st time through loop it will load palette+0
  16.                               ; 2nd time through loop it will load palette+1
  17.                               ; 3rd time through loop it will load palette+2
  18.                               ; etc
  19.       STA $2007             ; write to PPU
  20.       INX                   ; X = X + 1
  21.       CPX #$20              ; Compare X to hex $20, decimal 32 - copying 32 bytes = 8 sprites
  22.       BNE LoadPalettesLoop  ; Branch to LoadPalettesLoop if compare was Not Equal to zero
  23.                             ; if compare was equal to 32, keep going down
  24.      
  25.     LoadTitleScreen:
  26.       LDA $2002                ; read PPU status to reset the high/low latch
  27.       LDA #$20
  28.       STA $2006                ; write the high byte of $2000 address
  29.       LDA #$00
  30.       STA $2006                ; write the low byte of $2000 address
  31.       LDA #low(title)
  32.       STA AddrLow
  33.       LDA #high(title)
  34.       STA AddrHigh
  35.      
  36.       LDX #$04              ; Loop X 4 times
  37.       LDY #$00              ; Loop Y 256 times
  38.     LoadTitleLoop:
  39.       LDA [AddrLow],y
  40.       STA $2007
  41.       INY
  42.       BNE LoadTitleLoop
  43.     ; Outer loop
  44.       INC AddrHigh           ; increment high byte of address backg to next 256 byte chunk
  45.       DEX                    ; one chunk done so X = X - 1.
  46.       BNE LoadTitleLoop   ; if X isn't zero, do again
  47.      
  48.  
  49.  
  50.     ;;:Set starting game state
  51.       LDA #STATETITLE
  52.       STA gamestate
  53.      
  54.       ;;This is the PPU clean up section, so rendering the next frame starts properly.
  55.       LDA #%10010000   ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
  56.       STA $2000
  57.       LDA #%00011110   ; enable sprites, enable background, no clipping on left side
  58.       STA $2001
  59.      
  60.       RTS
  61. ;******************************************************************
  62.  
  63.  
  64.  
  65.  
  66. ;***************
  67. ;INITIALIZE GAME
  68. ;******************************************************************
  69.     InitializeGame:
  70.      
  71.       LDA #$00          ; turn off screen
  72.       STA $2000
  73.       STA $2001
  74.  
  75.       ;;;;;;;;LOAD ALL BACKGROUND INFO FOR GAME PLAYING STATE
  76.     LoadBackgroundScreen:
  77.       LDA $2002                ; read PPU status to reset the high/low latch
  78.       LDA #$20
  79.       STA $2006                ; write the high byte of $2000 address
  80.       LDA #$00
  81.       STA $2006                ; write the low byte of $2000 address
  82.       LDA #low(background)
  83.       STA AddrLow
  84.       LDA #high(background)
  85.       STA AddrHigh
  86.      
  87.       LDX #$04              ; Loop X 4 times
  88.       LDY #$00              ; Loop Y 256 times
  89.     LoadBackgroundLoop:
  90.       LDA [AddrLow],y
  91.       STA $2007
  92.       INY
  93.       BNE LoadBackgroundLoop
  94.     ; Outer loop
  95.       INC AddrHigh           ; increment high byte of address backg to next 256 byte chunk
  96.       DEX                    ; one chunk done so X = X - 1.
  97.       BNE LoadBackgroundLoop   ; if X isn't zero, do again
  98.      
  99.  
  100.  
  101.       ;;;INITIALIZATION
  102.       ;;BALL STATS
  103.       LDA #$01                 ; True
  104.       STA balldown             ; Here we set direction components of ball vector
  105.       STA ballright
  106.       LDA #$00                 ; False
  107.       STA ballup
  108.       STA ballleft
  109.      
  110.       LDA #$78                 ; Vertical center of screen
  111.       STA bally
  112.      
  113.       LDA #$80                 ; Horizontal center of screen
  114.       STA ballx
  115.      
  116.       LDA #$01                 ; Ball will move 1 pixel at a time
  117.       STA ballspeedx
  118.       STA ballspeedy
  119.      
  120.       LDA #$75                 ; Ball will look like top of flagpole from SMB
  121.       STA $0201
  122.      
  123.       LDA #$01                 ; Ball will use first set of 4 colors from sprite palette
  124.       STA $0202
  125.      
  126.      
  127.     ;;;PADDLES Y-COORDINATES
  128.       LDA #$70                 ; Align top of paddle near center
  129.       STA paddle1ytop
  130.       STA paddle2ytop
  131.       LDA #$90                 ; Align bottom of paddle near center
  132.       STA paddle1ybot
  133.       STA paddle2ybot
  134.      
  135.     ;;;LOADING TILES FOR PADDLE GRAPHICS
  136.       LDX #$00
  137.     Load_Paddle_Tile:
  138.       LDA #$5B           ; In mario.chr this is one of the platform graphics from SMB
  139.       STA $0205, x       ; $0205 is paddle 1's top tile y-coordinate
  140.       STA $0215, x       ; $0215 is paddle 2's top tile y-coordinate
  141.       INX
  142.       INX
  143.       INX                ; Increasing X by 4 shifts over 4 bytes in memory to reach next y-coordinate for next paddle tile
  144.       INX
  145.       CPX #$10           ; Once we hit 16, we've loaded 4 tiles (each paddle is 4 tiles high)
  146.       BNE Load_Paddle_Tile
  147.      
  148.     ;;;LOADING ATTRIBUTES FOR EACH PADDLE
  149.       LDX #$00
  150.     Load_Paddle_Attr:
  151.       LDA #$01            ; Use the first set of 4 colors from sprites
  152.       STA $0206, x        ; $0206 is paddle 1's top tile attribute
  153.       STA $0216, x        ; $0216 is paddle 2's top tile attribute
  154.       INX
  155.       INX
  156.       INX
  157.       INX
  158.       CPX #$10
  159.       BNE Load_Paddle_Attr
  160.      
  161.     ;;;LOADING X-COORDINATES FOR EACH PADDLE
  162.       LDX #$00
  163.     Load_Paddle_X:
  164.       LDA #PADDLE1X          ; Paddles can't move horizontally
  165.       STA $0207, x           ; $0207 is paddle 1's top tile x-coordinate
  166.       LDA #PADDLE2X
  167.       STA $0217, x           ; $0217 is paddle 2's top tile x-coordinate
  168.       INX
  169.       INX
  170.       INX
  171.       INX
  172.       CPX #$10
  173.       BNE Load_Paddle_X
  174.      
  175.     ;;;PADDLE SPEEDS
  176.     Load_Paddle_Speeds:
  177.       LDA #$01               ; Paddles can initially move 1 pixel per frame
  178.       STA paddle1speed
  179.       STA paddle2speed
  180.      
  181.     ;;Set scores
  182.       LDA #$00
  183.       STA score1Ones         ; Zero out placeholders (these numbers are drawn to screen)
  184.       STA score1Tens
  185.       STA score2Ones
  186.       STA score2Tens
  187.       STA score1             ; Zero out actual scores which get checked for win conditions
  188.       STA score2
  189.      
  190.       LDA #STATEPLAYING      ; Change state to playing
  191.       STA gamestate
  192.      
  193.       LDA #%10010000   ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
  194.       STA $2000
  195.  
  196.       RTS
  197. ;******************************************************************
  198.  
  199.  
  200.  
  201. ;***************
  202. ;UPDATE SPRITES
  203. ;******************************************************************
  204.     UpdateSprites:
  205.       LDA bally                      ; Update ball y-coordinate
  206.       STA $0200
  207.      
  208.       LDA ballx                       ; Update ball x-coordinate
  209.       STA $0203
  210.      
  211.      
  212.       LDX #$00                       ; Clear out indices
  213.       LDY #$00
  214.      
  215.     Load_Paddle_Y:
  216.       LDA paddle1ytop                ; Load all y-coordinates for paddle 1 relative to the top tile y-coordinate
  217.       CLC
  218.       ADC vertical_offsets, y
  219.       STA $0204, x
  220.      
  221.       LDA paddle2ytop                ; Load all y-coordinates for paddle 2 relative to the top tile y-coordinate
  222.       CLC
  223.       ADC vertical_offsets, y
  224.       STA $0214, x
  225.      
  226.       INX
  227.       INX
  228.       INX
  229.       INX
  230.      
  231.       INY
  232.       CPY #$04
  233.       BNE Load_Paddle_Y
  234.       RTS
  235. ;******************************************************************
  236.      
  237.  
  238. ;***************
  239. ;UPDATE SCORE
  240. ;******************************************************************
  241.     UpdateScore:
  242.       LDA #$00           ;turn off screen
  243.       STA $2000
  244.       STA $2001
  245.  
  246.       LDA $2002
  247.       LDA #$20
  248.       STA $2006
  249.       LDA #$42
  250.       STA $2006          ; start drawing player 1 score at PPU $2042
  251.      
  252.       LDA score1Tens      ; first digit
  253.       STA $2007          ; draw to background
  254.       LDA score1Ones      ; last digit
  255.       STA $2007
  256.  
  257.       LDA $2002          ; start drawing player 2 score at PPU $205A
  258.       LDA #$20
  259.       STA $2006
  260.       LDA #$5A
  261.       STA $2006
  262.  
  263.       LDA score2Tens
  264.       STA $2007
  265.       LDA score2Ones
  266.       STA $2007
  267.      
  268.       LDA #%10010000   ; enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
  269.       STA $2000
  270.  
  271.  
  272.       RTS
  273. ;******************************************************************
  274.  
  275.  
  276. ;***************
  277. ;INCREMENT SCORE 1
  278. ;******************************************************************
  279.     IncrementScore1:
  280.     Inc1Ones:
  281.       LDA score1Ones      ; load the lowest digit of the number
  282.       CLC
  283.       ADC #$01           ; add one
  284.       STA score1Ones
  285.       CMP #$0A           ; check if it overflowed, now equals 10
  286.       BNE Check1Score        ; if there was no overflow, all done
  287.     Inc1Tens:
  288.       LDA #$00
  289.       STA score1Ones      ; wrap digit to 0
  290.       LDA score1Tens      ; load the next digit
  291.       CLC
  292.       ADC #$01           ; add one, the carry from previous digit
  293.       STA score1Tens
  294.      
  295.     Check1Score:
  296.       LDA score1         ; This variable will be used to check win conditions
  297.       CLC
  298.       ADC #$01
  299.       STA score1
  300.       CMP #$10           ; Compare to 16.  If equal to 16, we have a winner
  301.       BNE Inc1Done
  302.       LDA STATEGAMEOVER
  303.       STA gamestate
  304.     Inc1Done:
  305.       JSR PlayerScored
  306.       RTS
  307. ;******************************************************************
  308.      
  309.  
  310. ;***************
  311. ;INCREMENT SCORE 2
  312. ;******************************************************************
  313.     IncrementScore2:
  314.     Inc2Ones:
  315.       LDA score2Ones      ; load the lowest digit of the number
  316.       CLC
  317.       ADC #$01           ; add one
  318.       STA score2Ones
  319.       CMP #$0A           ; check if it overflowed, now equals 10
  320.       BNE Check2Score        ; if there was no overflow, all done
  321.     Inc2Tens:
  322.       LDA #$00
  323.       STA score2Ones      ; wrap digit to 0
  324.       LDA score2Tens      ; load the next digit
  325.       CLC
  326.       ADC #$01           ; add one, the carry from previous digit
  327.       STA score2Tens
  328.      
  329.     Check2Score:
  330.       LDA score2          ; This variable will be used to check win conditions
  331.       CLC
  332.       ADC #$01
  333.       STA score2
  334.       CMP #$10            ; Compare to 16.  If equal to 16, we have a winner
  335.       BNE Inc2Done
  336.       LDA STATEGAMEOVER
  337.       STA gamestate
  338.     Inc2Done:
  339.       JSR PlayerScored
  340.       RTS
  341. ;******************************************************************
  342.      
  343.      
  344. ;***************
  345. ;READ CONTROLLER 1
  346. ;******************************************************************
  347.     ;; In the following subroutines, we loop through controller input and store each button state in a bit
  348.     ;; The order (from left to right) is: A, B, Select, Start, Up, Down, Left, Right
  349.     ReadController1:
  350.       LDA #$01
  351.       STA $4016
  352.       LDA #$00
  353.       STA $4016
  354.       LDX #$08
  355.     ReadController1Loop:
  356.       LDA $4016
  357.       LSR A            ; bit0 -> Carry
  358.       ROL buttons1     ; bit0 <- Carry
  359.       DEX
  360.       BNE ReadController1Loop
  361.       RTS
  362. ;******************************************************************
  363.  
  364.  
  365. ;***************
  366. ;READ CONTROLLER 2
  367. ;******************************************************************
  368.     ReadController2:
  369.       LDA #$01
  370.       STA $4016
  371.       LDA #$00
  372.       STA $4016
  373.       LDX #$08
  374.     ReadController2Loop:
  375.       LDA $4017
  376.       LSR A            ; bit0 -> Carry
  377.       ROL buttons2     ; bit0 <- Carry
  378.       DEX
  379.       BNE ReadController2Loop
  380.       RTS
  381. ;******************************************************************
  382.  
  383.  
  384.  
  385. ;***************
  386. ;INCREASE BALL SPEED X
  387. ;******************************************************************
  388.     IncreaseBallSpeedX:
  389.       LDA ballspeedx
  390.       CLC
  391.       ADC #$01
  392.       STA ballspeedx
  393.       RTS
  394. ;******************************************************************
  395.  
  396. ;***************
  397. ;INCREASE BALL SPEED Y
  398. ;******************************************************************
  399.     IncreaseBallSpeedY:
  400.       LDA ballspeedy
  401.       CLC
  402.       ADC #$01
  403.       STA ballspeedy
  404.       RTS
  405. ;******************************************************************
  406.  
  407. ;***************
  408. ;PLAYER SCORED
  409. ;******************************************************************
  410.     PlayerScored:
  411.       JSR UpdateScore
  412.       LDA #$01
  413.       STA ballspeedx
  414.       STA ballspeedy
  415.       STA paddle1speed
  416.       STA paddle2speed
  417.       LDA #$78
  418.       STA bally
  419.       LDA #$80
  420.       STA ballx
  421.       RTS
  422. ;******************************************************************
  423.  
  424.  
  425.  
  426.  
  427. ;***************
  428. ;MOVE BALL
  429. ;******************************************************************
  430.  
  431.     MoveBall:
  432.     MoveBallRight:
  433.       LDA ballright
  434.       BEQ MoveBallRightDone   ;;if ballright=0, skip this section
  435.  
  436.       LDA ballx
  437.       CLC
  438.       ADC ballspeedx        ;;ballx position = ballx + ballspeedx
  439.       STA ballx
  440.  
  441.       LDA ballx
  442.       CMP #RIGHTWALL
  443.       BCC MoveBallRightDone      ;;if ball x < right wall, still on screen, skip next section
  444.       LDA #$00
  445.       STA ballright
  446.       LDA #$01
  447.       STA ballleft         ;;bounce, ball now moving left
  448.       JSR IncrementScore1  ;;give point to player 1, reset ball
  449.     MoveBallRightDone:
  450.  
  451.  
  452.     MoveBallLeft:
  453.       LDA ballleft
  454.       BEQ MoveBallLeftDone   ;;if ballleft=0, skip this section
  455.  
  456.       LDA ballx
  457.       SEC
  458.       SBC ballspeedx        ;;ballx position = ballx - ballspeedx
  459.       STA ballx
  460.  
  461.       LDA ballx
  462.       CMP #LEFTWALL
  463.       BCS MoveBallLeftDone      ;;if ball x > left wall, still on screen, skip next section
  464.       LDA #$01
  465.       STA ballright
  466.       LDA #$00
  467.       STA ballleft         ;;bounce, ball now moving right
  468.       JSR IncrementScore2  ;;give point to player 2, reset ball
  469.     MoveBallLeftDone:
  470.  
  471.  
  472.     MoveBallUp:
  473.       LDA ballup
  474.       BEQ MoveBallUpDone   ;;if ballup=0, skip this section
  475.  
  476.       LDA bally
  477.       SEC
  478.       SBC ballspeedy        ;;bally position = bally - ballspeedy
  479.       STA bally
  480.  
  481.       LDA bally
  482.       CMP #TOPWALL
  483.       BCS MoveBallUpDone      ;;if ball y > top wall, still on screen, skip next section
  484.       LDA #$01
  485.       STA balldown
  486.       LDA #$00
  487.       STA ballup         ;;bounce, ball now moving down
  488.     MoveBallUpDone:
  489.  
  490.  
  491.     MoveBallDown:
  492.       LDA balldown
  493.       BEQ MoveBallDownDone   ;;if ballup=0, skip this section
  494.  
  495.       LDA bally
  496.       CLC
  497.       ADC ballspeedy        ;;bally position = bally + ballspeedy
  498.       STA bally
  499.  
  500.       LDA bally
  501.       CMP #BOTTOMWALL
  502.       BCC MoveBallDownDone      ;;if ball y < bottom wall, still on screen, skip next section
  503.       LDA #$00
  504.       STA balldown
  505.       LDA #$01
  506.       STA ballup         ;;bounce, ball now moving down
  507.     MoveBallDownDone:
  508.       RTS
  509. ;******************************************************************
  510.  
  511.  
  512.  
  513.  
  514.  
  515. ;***************
  516. ;MOVE PADDLES
  517. ;******************************************************************
  518.     MovePaddles:
  519.     MovePaddle1Up:
  520.       LDA buttons1
  521.       AND #%00001000
  522.       BEQ MovePaddle1UpDone ; Use BEQ because zero flag will be set if result of AND operation is false
  523.  
  524.       ;;if up button pressed, move paddle up
  525.       LDA paddle1ytop
  526.       SEC
  527.       SBC paddle1speed
  528.       STA paddle1ytop
  529.       LDA paddle1ybot
  530.       SEC
  531.       SBC paddle1speed
  532.       STA paddle1ybot
  533.  
  534.       ;;  if paddle top > top wall
  535.       LDA paddle1ytop
  536.       CMP #TOPWALL
  537.       BCS MovePaddle1UpDone
  538.       LDA #TOPWALL
  539.       STA paddle1ytop      ;set top tile y-coordinate to TOPWALL
  540.       CLC
  541.       ADC #$20             ;bottom of paddle is 32 pixels below TOPWALL, so have to keep it set there
  542.       STA paddle1ybot      ;otherwise, bottom y-coordinate will decrease when up is pushed
  543.     MovePaddle1UpDone:
  544.  
  545.     MovePaddle2Up:
  546.       LDA buttons2
  547.       AND #%00001000
  548.       BEQ MovePaddle2UpDone
  549.  
  550.       ;; if up button pressed, move paddle up
  551.       LDA paddle2ytop
  552.       SEC
  553.       SBC paddle2speed
  554.       STA paddle2ytop
  555.       LDA paddle2ybot
  556.       SEC
  557.       SBC paddle2speed
  558.       STA paddle2ybot
  559.  
  560.       ;;  if paddle top > top wall
  561.       LDA paddle2ytop
  562.       CMP #TOPWALL
  563.       BCS MovePaddle2UpDone
  564.       LDA #TOPWALL
  565.       STA paddle2ytop         ;set top tile y-coordinate to TOPWALL
  566.       CLC
  567.       ADC #$20                ;bottom of paddle is 32 pixels below TOPWALL, so have to keep it set there
  568.       STA paddle2ybot         ;otherwise, bottom y-coordinate will decrease when up is pushed
  569.     MovePaddle2UpDone:
  570.  
  571.     MovePaddle1Down:
  572.       LDA buttons1
  573.       AND #%00000100
  574.       BEQ MovePaddle1DownDone
  575.  
  576.       ;;if down button pressed
  577.       LDA paddle1ytop
  578.       CLC
  579.       ADC paddle1speed
  580.       STA paddle1ytop
  581.       LDA paddle1ybot
  582.       CLC
  583.       ADC paddle1speed
  584.       STA paddle1ybot
  585.  
  586.       ;;  if paddle bottom < bottom wall
  587.       LDA paddle1ybot
  588.       CMP #BOTTOMWALL
  589.       BCC MovePaddle1DownDone
  590.       LDA #BOTTOMWALL         ;set bottom tile y-coordinate to BOTTOMWALL
  591.       STA paddle1ybot
  592.       SEC
  593.       SBC #$20                ;top of paddle is 32 pixels above BOTTOMWALL, so have to keep it set there
  594.       STA paddle1ytop         ;otherwise, top y-coordinate will increase when down is pushed
  595.     MovePaddle1DownDone:
  596.  
  597.     MovePaddle2Down:
  598.       LDA buttons2
  599.       AND #%00000100
  600.       BEQ MovePaddle2DownDone
  601.  
  602.       ;;if down button pressed
  603.       LDA paddle2ytop
  604.       CLC
  605.       ADC paddle2speed
  606.       STA paddle2ytop
  607.       LDA paddle2ybot
  608.       CLC
  609.       ADC paddle2speed
  610.       STA paddle2ybot
  611.  
  612.       ;;  if paddle bottom < bottom wall
  613.       LDA paddle2ybot
  614.       CMP #BOTTOMWALL
  615.       BCC MovePaddle2DownDone
  616.       LDA #BOTTOMWALL
  617.       STA paddle2ybot             ;set bottom tile y-coordinate to BOTTOMWALL
  618.       SEC
  619.       SBC #$20                    ;top of paddle is 32 pixels above BOTTOMWALL, so have to keep it set there
  620.       STA paddle2ytop             ;otherwise, top y-coordinate will increase when down is pushed
  621.     MovePaddle2DownDone:
  622.       RTS
  623. ;******************************************************************
  624.  
  625.  
  626. ;***************
  627. ;CHECK COLLISIONS
  628. ;******************************************************************
  629.     CheckCollisions:
  630.     CheckPaddle1Collision:
  631.       ;;if ball x < paddle1x
  632.       LDA ballx
  633.       SEC
  634.       SBC #$08
  635.       CMP #PADDLE1X
  636.       BCS CheckPaddle1CollisionDone
  637.  
  638.       ;;  if ball y > paddle y top
  639.       LDA bally
  640.       CLC
  641.       ADC #$08
  642.       CMP paddle1ytop
  643.       BCC CheckPaddle1CollisionDone
  644.  
  645.       ;;    if ball y < paddle y bottom
  646.       LDA bally
  647.       SEC
  648.       SBC #$08
  649.       CMP paddle1ybot
  650.       BCS CheckPaddle1CollisionDone
  651.  
  652.       ;;      bounce, ball now moving right
  653.       LDA #$01
  654.       STA ballright
  655.       LDA #$00
  656.       STA ballleft
  657.       JSR IncreaseBallSpeedX          ; increase horizontal speed of ball
  658.       LDA paddle1speed
  659.       CLC
  660.       ADC #$01
  661.       STA paddle1speed                ; increase paddle 1 speed
  662.     CheckPaddle1CollisionDone:
  663.  
  664.     CheckPaddle2Collision:
  665.       ;;if ball x < paddle1x
  666.       LDA ballx
  667.       CLC
  668.       ADC #$08
  669.       CMP #PADDLE2X
  670.       BCC CheckPaddle2CollisionDone
  671.  
  672.       ;;  if ball y > paddle y top
  673.       LDA bally
  674.       CLC
  675.       ADC #$08
  676.       CMP paddle2ytop
  677.       BCC CheckPaddle2CollisionDone
  678.  
  679.       ;;    if ball y < paddle y bottom
  680.       LDA bally
  681.       SEC
  682.       SBC #$08
  683.       CMP paddle2ybot
  684.       BCS CheckPaddle2CollisionDone
  685.  
  686.       ;;      bounce, ball now moving right
  687.       LDA #$01
  688.       STA ballleft
  689.       LDA #$00
  690.       STA ballright
  691.       JSR IncreaseBallSpeedY          ; increase vertical speed of ball
  692.       LDA paddle2speed
  693.       CLC
  694.       ADC #$01
  695.       STA paddle2speed                ; increase paddle 2 speed
  696.     CheckPaddle2CollisionDone:
  697.       RTS
  698. ;******************************************************************
  699.  
  700.  
  701. ;***************
  702. ;WAIT FOR NMI
  703. ;******************************************************************
  704. WaitForNMI:
  705.   LDA frameCounter             ;frameCounter starts at 0, counts up to 255 before breaking, allows enough time for NMI to trigger
  706. WaitLoop:
  707.   CMP frameCounter
  708.   BEQ WaitLoop
  709.   RTS
  710. ;******************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement