;-- p1VertSpeed grav... p1YPosFromBot ;bugfix: cutting off player graphic right before setting background for 'floor' ; ; ; ; ; ; JoustPong by Kirk Israel processor 6502 include vcs.h include macro.h ;-------------------------------------- ;CONSTANTS ;-------------------------------------- CEILING_HEIGHT = #88 SLOW_GRAV_LO_BYTE = #%11110000 SLOW_GRAV_HI_BYTE = #%11111111 SLOW_FLAP_LO_BYTE = #%11001000 SLOW_FLAP_HI_BYTE = #%00000000 SLOW_REBOUND_LO_BYTE = #%00000000 SLOW_REBOUND_HI_BYTE = #%11111111 GAMEFIELD_HEIGHT_IN_BRICKS = #22 SPRITEHEIGHT = #8 ;floor heights are different, because heights are actually ;relative to the 'top' of the player or ball, but we want to ;make sure that the bottoms are hitting the floor FLOOR_HEIGHT_FOR_BALL = #4 FLOOR_HEIGHT_FOR_PLAYERS = #10 STRENGTH_OF_CEILING_REBOUND = #3; SCORE_KERNAL_LENGTH = #5 GAME_KERNAL_LENGTH = #88 LENGTH_OF_FLAPSOUND = #15 PITCH_OF_FLAPSOUND = #15 ;2!,8-,15 all kind of worked TYPE_OF_FLAPSOUND = #2 VOLUME_OF_PONGHIT = #7 PITCH_OF_PONGHIT = #7 PITCH_OF_GOAL = #15 PITCH_OF_PONG_WALL_HIT = #25 ;was 6 pixel height, 6 scanlines per ; 74 - 36 = 38 PIXEL_HEIGHT_OF_TITLE = #30 PIXEL_HEIGHT_OF_TITLE_PONG = #7 SCANLINES_PER_TITLE_PIXEL = #2 WINNING_SCORE = #10 BALLPOS_LEFT = #5 ;had to hack so it didn't show up on right side before reset... BALLPOS_CENTER = #80 BALLPOS_RIGHT = #160 ;-------------------------------------- ;VARIABLES ;-------------------------------------- SEG.U VARS ORG $80 copyIntegerCoordP0 ds 1 copyIntegerCoordP1 ds 1 slowP0YCoordFromBottom ds 2 slowP0YSpeed ds 2 slowP1YCoordFromBottom ds 2 slowP1YSpeed ds 2 p0VisibleLine ds 1 p0DrawBuffer ds 1 p1VisibleLine ds 1 p1DrawBuffer ds 1 but0WasOn ds 1 but1WasOn ds 1 ballPosFromBot ds 1 ballVisibleLine ds 1 ballVertSpeed ds 1 ballBuffer ds 1 p0score ds 1 p1score ds 1 pointerP0Score ds 2 pointerP1Score ds 2 pointerP0Graphic ds 2 pointerP1Graphic ds 2 booleanBallRight ds 1 flapsoundRemaining ds 1 booleanGameIsTwoPlayers ds 1 ;variableGameMode ds 1 booleanSelectSwitchIsDown ds 1 booleanResetSwitchIsDown ds 1 booleanGameOver ds 1 booleanOverrideSelectChangeThisTime ds 1 bufferPFLeft ds 1;;WALL;; bufferPFRight ds 1;;WALL;; playfieldMatrixLeft ds 22;;WALL;; playfieldMatrixRight ds 22;;WALL;; booleanFujiFrame ds 1 ;for horiz pos... ;PlayerX ds 2 ;PS_temp ds 1 ballXposition ds 1 tempVar ds 1 echo ($100 - *) , "bytes of RAM left" SEG CODE org $F000 ;MAXIMUM_SPEED = #6 ;-------------------------------------- ;BOILER PLATE STARTUP ;-------------------------------------- Start SEI CLD TXS LDX #$FF LDA #0 ClearMem STA 0,X DEX BNE ClearMem LDA #$00 STA COLUBK ;-------------------------------------- ;OTHER INITIALIZATIONS ;-------------------------------------- LDA #33 STA COLUP0 ;Set P0 Reddish LDA #66 STA COLUP1 ;Set P1 Purplish LDA #%11111111 STA booleanGameIsTwoPlayers LDA #%00100000 ;;WALL;; ;;WALL;; LDX #GAMEFIELD_HEIGHT_IN_BRICKS-1;;WALL;; InitTheBricks;;WALL;; STA playfieldMatrixLeft,X;;WALL;; STA playfieldMatrixRight,X;;WALL;; DEX;;WALL;; BNE InitTheBricks;;WALL;; ;-------------------------------------- ;START THE TITLE SCREEN ;-------------------------------------- TitleStart ;ok, now we're getting the usual 'just hit reset stuff' LDA #$1F STA COLUPF ;colored playfield for title LDA #0 STA CTRLPF ;playfield ain't reflected STA AUDV0 STA AUDV1 ;-------------------------------------- ;OBJECT POSITIONING--VERY PRIMITIVE! ;-------------------------------------- ;use NOPs to position the players LDA #0 STA WSYNC SLEEP 20 ;Thomas's Sleep Macro STA RESM0 STA RESP0 SLEEP 37 ;Thomas's Sleep Macro STA RESP1 NOP STA RESM1 ;-------------------------------------- ;-------------------------------------- ; TITLE SCREEN ;-------------------------------------- ;-------------------------------------- TitleMainLoop LDA SWCHB AND #%00000001 ;is game reset? BNE TitleResetWasNotHit ;if so jump to MainGame JMP MainGameStart TitleResetWasNotHit LDA SWCHB AND #%00000010 ;is game select? BNE TitleSelectIsNotDownNow;if so proceed TitleSelectIsDownNow LDA #1 STA booleanSelectSwitchIsDown JMP TitleDoneCheckingSelect TitleSelectIsNotDownNow ;so the switch is currently not down LDA booleanSelectSwitchIsDown ;see if it was on before BNE TitleSelectWasAlreadyOn TitleSelectWasNotOn ; it wasn't on, it's still not on, what are we worried about? JMP TitleDoneCheckingSelect TitleSelectWasAlreadyOn ;it's not on now, they just let go LDA #0 STA booleanSelectSwitchIsDown ;record that it wasn't on before LDA booleanOverrideSelectChangeThisTime BNE OverridingSelectChange LDA booleanGameIsTwoPlayers EOR #%11111111 ;toggle the boolean for # of players STA booleanGameIsTwoPlayers ;;;;;;;DEC variableGameMode OverridingSelectChange LDA #0 STA booleanOverrideSelectChangeThisTime TitleDoneCheckingSelect ;MainLoop starts with usual VBLANK code, ;and the usual timer seeding LDA #2 STA VSYNC STA WSYNC STA WSYNC STA WSYNC LDA #43 STA TIM64T LDA #0 STA VSYNC ; LDA booleanGameIsTwoPlayers ; BEQ GameIsTwoPlayers ;GameIsOnePlayer ; LDA #77 ; STA COLUPF ; JMP DoneCheckingPlayerCount ;GameIsTwoPlayers ; LDA #121 ; STA COLUPF ;DoneCheckingPlayerCount TitleSelectWasNotHit ;--------------------- ;alternate the fuji logo for kicks ;--------------------- LDA booleanFujiFrame BEQ FujiWasZeroInBlank FujiWasNotZeroInBlank LDA #0 STA booleanFujiFrame JMP DoneSettingFuji FujiWasZeroInBlank LDA #1 STA booleanFujiFrame DoneSettingFuji TitleWaitForVblankEnd LDA INTIM BNE TitleWaitForVblankEnd STA VBLANK ;just burning scanlines....you could do something else LDY #20 TitlePreLoop STA WSYNC DEY BNE TitlePreLoop LDA #$1E STA COLUPF LDX #PIXEL_HEIGHT_OF_TITLE ; X will hold what letter pixel we're on LDY #SCANLINES_PER_TITLE_PIXEL ; Y will hold which scan line we're on for each pixel ; ;the next part is careful cycle counting from those ;who have gone before me.... TitleShowLoop STA WSYNC LDA PFDataTitleJoust0Left-1,X ;[0]+4 STA PF0 ;[4]+3 = *7* < 23 ;PF0 visible LDA PFDataTitleJoust1Left-1,X ;[7]+4 STA PF1 ;[11]+3 = *14* < 29 ;PF1 visible LDA PFDataTitleJoust2Left-1,X ;[14]+4 STA PF2 ;[18]+3 = *21* < 40 ;PF2 visible NOP ;[21]+2 NOP ;[23]+2 NOP ;[25]+2 ;six cycles available Might be able to do something here LDA PFDataTitleJoust0Right-1,X ;[27]+4 ;PF0 no longer visible, safe to rewrite STA PF0 ;[31]+3 = *34* LDA PFDataTitleJoust1Right-1,X ;[34]+4 ;PF1 no longer visible, safe to rewrite STA PF1 ;[38]+3 = *41* LDA PFDataTitleJoust2Right-1,X ;[41]+4 ;PF2 rewrite must begin at exactly cycle 45!!, no more, no less STA PF2 ;[45]+2 = *47* ; > DEY ;ok, we've drawn one more scaneline for this 'pixel' BNE NotChangingWhatTitlePixel ;go to not changing if we still have more to do for this pixel DEX ; we *are* changing what title pixel we're on... BEQ DoneWithTitle ; ...unless we're done, of course LDY #SCANLINES_PER_TITLE_PIXEL ;...so load up Y with the count of how many scanlines for THIS pixel... NotChangingWhatTitlePixel ; STX tempVar ; ; LDA #7 ; CLC ; CMP tempVar ; BCC DoneCheckingChangePFColor ; JMP TitleShowLoop DoneWithTitle NOP NOP NOP LDA #$7C STA COLUPF LDX #PIXEL_HEIGHT_OF_TITLE_PONG ; X will hold what letter pixel we're on LDY #SCANLINES_PER_TITLE_PIXEL ; Y will hold which scan line we're on for each pixel ; ;the next part is careful cycle counting from those ;who have gone before me.... PongTitleShowLoop STA WSYNC LDA PFDataTitlePong0Left-1,X ;[0]+4 STA PF0 ;[4]+3 = *7* < 23 ;PF0 visible LDA PFDataTitlePong1Left-1,X ;[7]+4 STA PF1 ;[11]+3 = *14* < 29 ;PF1 visible LDA PFDataTitlePong2Left-1,X ;[14]+4 STA PF2 ;[18]+3 = *21* < 40 ;PF2 visible NOP ;[21]+2 NOP ;[23]+2 NOP ;[25]+2 ;six cycles available Might be able to do something here LDA PFDataTitlePong0Right-1,X ;[27]+4 ;PF0 no longer visible, safe to rewrite STA PF0 ;[31]+3 = *34* LDA PFDataTitlePong1Right-1,X ;[34]+4 ;PF1 no longer visible, safe to rewrite STA PF1 ;[38]+3 = *41* LDA PFDataTitlePong2Right-1,X ;[41]+4 ;PF2 rewrite must begin at exactly cycle 45!!, no more, no less STA PF2 ;[45]+2 = *47* ; > DEY ;ok, we've drawn one more scaneline for this 'pixel' BNE NotChangingWhatPongTitlePixel ;go to not changing if we still have more to do for this pixel DEX ; we *are* changing what title pixel we're on... BEQ DoneWithPongTitle ; ...unless we're done, of course LDY #SCANLINES_PER_TITLE_PIXEL ;...so load up Y with the count of how many scanlines for THIS pixel... NotChangingWhatPongTitlePixel ; STX tempVar ; ; LDA #7 ; CLC ; CMP tempVar ; BCC DoneCheckingChangePFColor ; JMP PongTitleShowLoop DoneWithPongTitle ;clear out the playfield registers for obvious reasons LDA #0 STA PF2 ;clear out PF2 first, I found out through experience STA PF0 STA PF1 ;just burning scanlines....you could do something else LDY #40 ;was 138 TitlePostLoop STA WSYNC DEY BNE TitlePostLoop ;mirror player 1 LDA #%00001000 STA REFP1 LDY #8 TitlePlayerLoop STA WSYNC LDA WingUpGraphic-1,Y STA GRP0 LDA booleanGameIsTwoPlayers BEQ TitleDrawPlayer1ForTwoPlayers LDA booleanFujiFrame BEQ FujiWasZeroFrame FujiWasNotZeroFrame LDA FujiGraphic0-1,Y JMP TitleDoneChooseDrawPlayer1 FujiWasZeroFrame LDA FujiGraphic1-1,Y JMP TitleDoneChooseDrawPlayer1 TitleDrawPlayer1ForTwoPlayers LDA WingUpGraphic-1,Y TitleDoneChooseDrawPlayer1 STA GRP1 DEY STA WSYNC BNE TitlePlayerLoop LDA #0 STA GRP0 STA GRP1 ;just burning scanlines....you could do something else LDY #44 TitlePostPostLoop STA WSYNC DEY BNE TitlePostPostLoop ; usual vblank LDA #2 STA VBLANK LDX #30 TitleOverScanWait STA WSYNC DEX BNE TitleOverScanWait JMP TitleMainLoop ;-------------------------------------- ;-------------------------------------- ; MAIN GAME ;-------------------------------------- ;-------------------------------------- MainGameStart LDA #%00010001 STA CTRLPF LDA #44 STA slowP0YCoordFromBottom + 1 ;(integer position) STA slowP1YCoordFromBottom + 1;(integer position) LDA #0 STA slowP0YCoordFromBottom ;(fractional position) STA slowP1YCoordFromBottom ;(fractional position) STA slowP0YSpeed STA slowP0YSpeed + 1 STA slowP1YSpeed STA slowP1YSpeed + 1 LDA #0 STA p0score STA p1score STA booleanGameOver LDA #>GraphicsPage ;grab the hight byte of the graphic location STA pointerP0Graphic+1 STA pointerP1Graphic+1 ;generate the background ;this is just one dot on the edge ;reflected. we'll use it for collision ;detection to know when a goal ;is scored ;-------------------------------------- ;SETTING UP PLAYFIELD AND BALL ETC ;-------------------------------------- LDA #99 STA COLUPF ;color here LDA #BALLPOS_CENTER STA ballXposition ;TODO: don't just oddly put in ball sped ;LDA #%11111111 ;LDA #%00000001 LDA #1 STA ballVertSpeed ;position ball LDA #20 STA ballPosFromBot ;make missiles double wide LDA #%00110000 STA NUSIZ0 ;seed the sound buffers LDA #TYPE_OF_FLAPSOUND STA AUDC0 ;type of sound LDA #PITCH_OF_FLAPSOUND STA AUDF0 ;pitch LDA #4 STA AUDC1 ;type of sound ;-------------------------------------- ;-------------------------------------- ;START MAIN LOOP W/ VSYNC ;-------------------------------------- ;-------------------------------------- MainLoop LDA SWCHB AND #%00000001 ;is game reset? BNE ResetWasNotHit ;if so jump to MainGame JMP MainGameStart ResetWasNotHit LDA SWCHB AND #%00000010 ;is game select hit? BNE SelectWasNotHit ;if so jump to the title screen ;hopefully these are the only initialzations we have to perform? ;might need to change logic if not... LDA #0 STA CTRLPF ;playfield ain't reflected STA AUDV0 STA AUDV1 LDA #1 STA booleanOverrideSelectChangeThisTime JMP TitleSelectIsDownNow SelectWasNotHit LDA #2 STA VSYNC STA WSYNC STA WSYNC STA WSYNC LDA #43 STA TIM64T LDA #0 STA VSYNC STA AUDV1 ;volume for dinger ;-------------------------------------- ;SEE IF BUTTON 0 IS NEWLY PRESSED ;-------------------------------------- CheckButton0 LDA INPT4 BMI NoButton0 ;Check to see if the button was already down LDA but0WasOn BNE Button0WasAlreadyDown ;this is a new button press... ;time to flap! do 16 bit math ;to get integer and fractional speed CLC LDA slowP0YSpeed ADC #SLOW_FLAP_LO_BYTE ; HIGH BYTE OF 16-BIT Y MOVEMENT SPEED STA slowP0YSpeed LDA slowP0YSpeed+1 ADC #SLOW_FLAP_HI_BYTE STA slowP0YSpeed+1 LDA #1 STA but0WasOn LDA #LENGTH_OF_FLAPSOUND STA flapsoundRemaining LDA #Score0Graphic ;grab the hight byte of the graphic location STA pointerP0Score+1 LDA p1score ;accumulator = score ASL ;accumulator = score * 2 ASL ;accumulator = score * 4 ADC p1score ;accumulator = (score * 4) + score = score * 5 ADC #Score0Graphic ;grab the hight byte of the graphic location STA pointerP1Score+1 ;-------------------------------------- ;DIMINISH FLAP SOUND ;-------------------------------------- LDA flapsoundRemaining BMI NoFlapSound STA AUDV0 ;volume DEC flapsoundRemaining NoFlapSound LDX #22;;WALL;; LDA playfieldMatrixLeft,X;;WALL;; STA bufferPFLeft;;WALL;; LDA playfieldMatrixRight,X;;WALL;; STA bufferPFRight;;WALL;; LDA slowP0YCoordFromBottom+1 STA copyIntegerCoordP0 LDA slowP1YCoordFromBottom+1 STA copyIntegerCoordP1 ;-------------------------------------- ;WAIT FOR VBLANK TO END ;-------------------------------------- WaitForVblankEnd LDA INTIM BNE WaitForVblankEnd STA VBLANK STA GRP0 STA GRP1 STA ENABL STA WSYNC ; STA HMOVE ;STA PF0 ;-------------------------------------- ;SCORE DISPLAY KERNAL ;-------------------------------------- LDY #SCORE_KERNAL_LENGTH ;make sure p1 isn't reversed LDA #%00000000 STA REFP1 STA WSYNC LDA #$06 STA COLUBK STA WSYNC ScoreDisplayLoop ; LDA (pointerP0Graphic),Y LDA (pointerP0Score),Y STA GRP0 LDA (pointerP1Score),Y STA GRP1 DEY STA WSYNC STA WSYNC BNE ScoreDisplayLoop LDA #0 STA GRP0 STA GRP1 STA WSYNC ; STA WSYNC ; STA WSYNC ;flip p1 before game kernal LDA #%00001000 STA REFP1 STA WSYNC ;-------------------------------------- ;MAIN GAME KERNAL ;-------------------------------------- LDX #GAME_KERNAL_LENGTH ;-------------------------------------- ;MAIN SCANLINE LOOP ;-------------------------------------- MainGameLoop STA WSYNC LDA #$00 STA COLUBK LDA bufferPFLeft ;get leftside of PF loaded;;WALL;; STA PF0;;WALL;; LDA booleanGameOver BNE DoneWithBall ;game is over, never draw ball LDA ballBuffer STA ENABL DoneWithBall LDA p0DrawBuffer STA GRP0 LDA p1DrawBuffer STA GRP1 ;-------------------------------------- ;do buffer for P0 ;-------------------------------------- TXA; transfer scanline count to A SEC SBC copyIntegerCoordP0 adc #SPRITEHEIGHT+1 bcc skipDrawP0 ; out of range??? tay lda (pointerP0Graphic),y sta p0DrawBuffer skipDrawP0 LDA bufferPFRight ;left pf is drawn, ready for right;;WALL;; STA PF0;;WALL;; ;-------------------------------------- ;do buffer for P1 ;-------------------------------------- TXA; transfer scanline count to A SEC ; well for this example I don't know the state SBC copyIntegerCoordP1 ; so that's 96 - 96 = 0 adc #SPRITEHEIGHT+1 ; remember the sprite is 8 lines high bcc skipDrawP1 ; out of range??? tay lda (pointerP1Graphic),y ; use indirect loading here sta p1DrawBuffer skipDrawP1 ;-------------------------------------- ;do buffer for Ball ;-------------------------------------- ldy #0 TXA; transfer scanline count to A SEC ; well for this example I don't know the state SBC ballPosFromBot ; so that's 96 - 96 = 0 adc #2 LDA bufferPFLeft;;WALL;; STA PF0;;WALL;; bcc skipDrawBall ; out of range??? tay ldy #2 ; use indirect loading here skipDrawBall sty ballBuffer SLEEP 8 TXA;;WALL;; LSR;;WALL;; LSR;;WALL;; TAY;;WALL;; LDA bufferPFRight;;WALL;; STA PF0 ;;WALL;; LDA playfieldMatrixLeft,Y;;WALL;; STA bufferPFLeft;;WALL;; LDA playfieldMatrixRight,Y;;WALL;; STA bufferPFRight;;WALL;; DoneChangingPlayfieldBrick;;WALL;; ;SLEEP 41-43 ; SLEEP 60 ;now just finish counting of scanloop DEX BNE MainGameLoop STA WSYNC LDA #$06 ;grey for background... STA COLUBK LDA #0 STA GRP0 STA GRP1 STA WSYNC LDA #2 STA WSYNC STA VBLANK LDX #30 OverScanWait STA WSYNC DEX BNE OverScanWait STA PF0 LDA #$00 STA COLUBK JMP MainLoop org $FE00 ;-------------------------------------- ;GRAPHICS ;-------------------------------------- GraphicsPage .byte #%00000000 ;here to stop page errors WingUpGraphic .byte #%00001100 .byte #%00001100 .byte #%10001100 .byte #%11011100 .byte #%11111100 .byte #%01111100 .byte #%00101100 .byte #%00001100 .byte #%00000000 ;here because my skipdraw's a bit off... WingDownGraphic .byte #%00001100 .byte #%00011100 .byte #%00111100 .byte #%01111100 .byte #%01111100 .byte #%00111100 .byte #%00001100 .byte #%00001100 Score0Graphic .byte #%00111100 .byte #%01000010 .byte #%01000010 .byte #%01000010 .byte #%00111100 Score1Graphic .byte #%00111110 .byte #%00001000 .byte #%00001000 .byte #%00101000 .byte #%00011000 Score2Graphic .byte #%01111110 .byte #%01100000 .byte #%00011100 .byte #%01000010 .byte #%00111100 Score3Graphic .byte #%01111100 .byte #%00000010 .byte #%00011100 .byte #%00000010 .byte #%01111100 Score4Graphic .byte #%00000100 .byte #%00000100 .byte #%01111110 .byte #%01000100 .byte #%01000100 Score5Graphic .byte #%01111100 .byte #%00000010 .byte #%01111100 .byte #%01000000 .byte #%01111110 Score6Graphic .byte #%00111100 .byte #%01000010 .byte #%01111100 .byte #%01100000 .byte #%00011110 Score7Graphic .byte #%00010000 .byte #%00001000 .byte #%00000100 .byte #%00000010 .byte #%01111110 Score8Graphic .byte #%00111100 .byte #%01000010 .byte #%00111100 .byte #%01000010 .byte #%00111100 Score9Graphic .byte #%00000010 .byte #%00000010 .byte #%00011110 .byte #%00100010 .byte #%00011100 ScoreWGraphic .byte #%01000100 .byte #%10101010 .byte #%10010010 .byte #%10000010 .byte #%00000000 PFDataTitlePong0Left .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 PFDataTitleJoust0Left .byte #%00000000 .byte #%10000000 .byte #%11000000 .byte #%11000000 .byte #%11000000 .byte #%11100000 .byte #%01100000 .byte #%01100000 .byte #%01100000 .byte #%01000000 .byte #%01000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 PFDataTitlePong1Left .byte #%00000000 .byte #%00000011 .byte #%00000011 .byte #%11110011 .byte #%00111011 .byte #%11110011 .byte #%11110000 PFDataTitleJoust1Left .byte #%00000001 .byte #%11000001 .byte #%11100011 .byte #%11100011 .byte #%11100011 .byte #%11100110 .byte #%01110110 .byte #%00110110 .byte #%00110110 .byte #%00110110 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110110 .byte #%00110110 .byte #%00110110 .byte #%00110110 .byte #%10110110 .byte #%01110010 .byte #%00110011 .byte #%00010011 .byte #%00000011 .byte #%00000001 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 PFDataTitlePong2Left .byte #%00011111 .byte #%01111111 .byte #%01110001 .byte #%01110001 .byte #%01110001 .byte #%01111111 .byte #%00011111 PFDataTitleJoust2Left .byte #%00000001 .byte #%11000001 .byte #%11000011 .byte #%11000011 .byte #%11100111 .byte #%11100110 .byte #%11100110 .byte #%11100110 .byte #%01110110 .byte #%01110100 .byte #%01110100 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110100 .byte #%00110110 .byte #%00100110 .byte #%00100110 .byte #%00100110 .byte #%01100110 .byte #%01100111 .byte #%01000011 .byte #%01010011 .byte #%01010001 .byte #%01010000 .byte #%10110000 .byte #%10100000 .byte #%11000000 PFDataTitlePong0Right .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 .byte #%11100000 PFDataTitleJoust0Right .byte #%00000000 .byte #%10110000 .byte #%10110000 .byte #%11110000 .byte #%11110000 .byte #%11110000 .byte #%11110000 .byte #%11100000 .byte #%11000000 .byte #%11000000 .byte #%11000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 .byte #%10000000 PFDataTitlePong1Right .byte #%00111100 .byte #%00111100 .byte #%01111101 .byte #%11111101 .byte #%11011101 .byte #%10011100 .byte #%00011100 PFDataTitleJoust1Right .byte #%00000100 .byte #%10001110 .byte #%10111110 .byte #%10111110 .byte #%10111111 .byte #%10111111 .byte #%10111111 .byte #%10110011 .byte #%10110001 .byte #%10100011 .byte #%10100010 .byte #%10100010 .byte #%10000110 .byte #%10000110 .byte #%10001100 .byte #%10011100 .byte #%10011000 .byte #%10111000 .byte #%10110000 .byte #%10110000 .byte #%10110010 .byte #%10110010 .byte #%10100110 .byte #%10111110 .byte #%10111100 .byte #%11011100 .byte #%11010000 .byte #%11000000 .byte #%10000000 .byte #%00000000 PFDataTitlePong2Right .byte #%01111110 .byte #%11111111 .byte #%11000011 .byte #%11110011 .byte #%00000011 .byte #%11111111 .byte #%01111110 PFDataTitleJoust2Right .byte #%00011000 .byte #%01111100 .byte #%01111110 .byte #%01111110 .byte #%01001110 .byte #%00001110 .byte #%00001110 .byte #%00000110 .byte #%00000110 .byte #%00000110 .byte #%00000110 .byte #%00000110 .byte #%00001110 .byte #%00001100 .byte #%00001100 .byte #%00001100 .byte #%00001100 .byte #%00011000 .byte #%00011001 .byte #%11111011 .byte #%01111111 .byte #%00111111 .byte #%00100111 .byte #%01000000 .byte #%01000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 .byte #%00000000 FujiGraphic0 .byte #%00000000 .byte #%10011001 .byte #%01011010 .byte #%00111100 .byte #%00111100 .byte #%00111100 .byte #%00111100 .byte #%00000000 .byte #%00000000 .byte #%10011001 .byte #%11011011 .byte #%01111110 .byte #%00111100 .byte #%00111100 .byte #%00111100 .byte #%00000000 ; .byte #%00000000 ; .byte #%10000010 ; .byte #%01000100 ; .byte #%00101000 ; .byte #%00101000 ; .byte #%00101000 ; .byte #%00101000 ; .byte #%00000000 FujiGraphic1 .byte #%00000000 .byte #%00011000 .byte #%00011000 .byte #%00011000 .byte #%00011000 .byte #%00011000 .byte #%00011000 .byte #%00000000 ; .byte #%00000000 ; .byte #%00010000 ; .byte #%00010000 ; .byte #%00010000 ; .byte #%00010000 ; .byte #%00010000 ; .byte #%00010000 ; .byte #%00000000 org $FFFC .word Start .word Start ;;;;THE JUNKYARD ;;See if we're going too darn fast ; LDA MaximumSpeed ; SEC ; ;;;;SBC MaximumSpeed ; Maximum Speed ; ; CMP p0VertSpeed ; BCS SpeedNotMaxxed ; ; ;; BMI SpeedNotMaxxed ;if speed - maxspeed is positive, we need to slow down ; LDA MaximumSpeed ; STA p0VertSpeed ; ;SpeedNotMaxxed ;;assum horiz movement will be zero ; LDX #$00 ; LDA #$40 ;Left? ; BIT SWCHA ; BNE SkipMoveLeftP0 ; LDX #$10 ; LDA #%00001000 ; STA REFP0 ;show reflected version ;SkipMoveLeftP0 ; ; LDA #$80 ;Right? ; BIT SWCHA ; BNE SkipMoveRightP0 ; LDX #$F0 ; LDA %00000000 ; STA REFP0 ;SkipMoveRightP0 ; ; STX HMP0 ;set horiz movement for player 0 ; ; ;;assum horiz movement will be zero ; LDX #$00 ; LDA #$04 ;Left? ; BIT SWCHA ; BNE SkipMoveLeftP1 ; LDX #$10 ; LDA #%00001000 ; STA REFP1 ;SkipMoveLeftP1 ; ; LDA #$08 ;Right? ; BIT SWCHA ; BNE SkipMoveRightP1 ; LDX #$F0 ; LDA %00000000 ; STA REFP1 ;SkipMoveRightP1 ; ; STX HMP1 ;set horiz movement for player 0 ;BigHeadGraphic ; .byte %00111100 ; .byte %01111110 ; .byte %11000001 ; .byte %10111111 ; .byte %11111111 ; .byte %11101011 ; .byte %01111110 ; .byte %00111100