; Start Screen at 1890 ;******************************************************************************* ; ; BattlePong ; ---------- ;******************************************************************************* ; Yet another game attempt ; Jeff Haber ; July 2016 ; Code Contributors: Spiceware, Omegamatrix ; ; compile using DASM: ; dasm BP5m.asm -f3 -v0 -sBP5.sym -lBP5.lst -oBP5.bin ;=============================================================================== ; Change Log ;=============================================================================== ; BP3 Added player / playfield collisions and coin decrement routine ; BP3d Player 0 / One stack of coins collision working ; BP3g Coin collisions working fairly well ; BP3h Attempting to separate left and right coin piles ; BP3n Left coins working, with color glitch ; BP4b Adding ball state ; BP5k Adding start screen 12FEB2017 ;=============================================================================== ; Initialize DASM ;=============================================================================== PROCESSOR 6502 include vcs.h include macro.h include TwoScores.h ;*** include graphics.h ;=============================================================================== ; Define Constants ;=============================================================================== ARENA_HEIGHT = 80 ; height of gameplay area ?Was 100 PF_COLOR = $1C ; yellow BALL_HEIGHT = 8 ; 8 MISSILE_HEIGHT = 1 ; 1 SHOULDER_COLOR = $06 ;$E4 HELMET_COLOR = $22 ;$24 HEAD_COLOR = $0A ;$4C BODY_COLOR = $08 ;$82 BASE_COLOR = $04 ;$22 BELT_COLOR = $82 ;Score Display RAM_SCORE_HI_MED_LO = 1 ; If MSB and LSB of score appear to be exchanged, change this to 0. VERT_SEGMENT_HEIGHT = 5 ; Change to adjust digit height COL_BACKGROUND = $00 COL_DIGITS = $8A TIME_VBLANK = 46 TIME_OVERSCAN = 23 TOP_BLANK_LINES = 2 BOT_BLANK_LINES = 192-VERT_SEGMENT_HEIGHT*2 ;=============================================================================== ; Define RAM Usage ;=============================================================================== SEG.U VARS ORG $80 BackgroundColor: ds 1 ; stored in $80 ; holds X locations in $81-85 ObjectX: ds 5 ; player0, player1, missile0, missile1, ball ; holds Y locations in $86-90 ObjectY: ds 5 ; player0, player1, missile0, missile1, ball ; DoDraw storage in $90-94 Player0Draw: ds 1 ; used for drawing player0 Player1Draw: ds 1 ; used for drawing player1 BallDraw: ds 1 ; Missile0Draw: ds 1 Missile1Draw: ds 1 ; DoDraw Graphic Pointers in $ Player0Ptr: ds 2 ; used for drawing player0 Player1Ptr: ds 2 ; used for drawing player1 CoinPtr: ds 2 ; CoinPtrB: ds 2 ; PlayerColorPtr: ds 2 ; used for drawing player0 Player1ColorPtr: ds 2 ; current random number Rand8: ds 1 ; stored in $8b CoinY: ds 1 ; CoinRAMGfx: ds 12 ; CoinRAMGfxB: ds 12 GameState: ds 1 SelectDelay: ds 1 Variation: ds 1 FrameCounter: ds 1 BallMood: ds 1 JumboState: ds 1 jumbo_JumpInd: ds 2 BallState: ds 1 ball_JumpInd: ds 2 BallHSpeed: ds 1 BallVSpeed: ds 1 pfMasks: ds 14 NeedForFBgraphic: ds 1 leftScore: ds 3 rightScore: ds 3 ;-------- TempVar1: ds 1 TempVar2: ds 1 ; redefined values for Main Menu G48 EQU pfMasks ; uses all of Wall1L and Wall1R echo "----", [$FA-*]d, "bytes before end of RAM" ;=============================================================================== ; Define Start of Cartridge ;=============================================================================== SEG CODE ; 2K ROM starts at $F800, 4K ROM starts at $F000 ORG $F000 ;=============================================================================== ; Subroutines ;=============================================================================== ALIGN 256 LEFT_SCORE_MASK_SUBROUTINE RIGHT_SCORE_MASK_SUBROUTINE DRAW_HORIZONTAL_SEGMENT ;------------------------------------------------------------------------------- ; One player logic ;------------------------------------------------------------------------------- ComputerPlayer: ; Get ball direction ;jmp ChaseBall ; Temporarily chase ball lda BallHSpeed bpl ChaseBall ; If ball if coming, then chase ball ChasePlayer0: lda ObjectY ; Load player 0's Y cmp ObjectY+1 ; Compare to self beq EndComputerPlayer bmi MoveDown ; inc ObjectY+1 ; If its left, then go to player 1's y pos ChaseBall: lda ObjectX+4 cmp #70 bmi EndComputerPlayer lda ObjectY+4 ; Get ball Y cmp ObjectY+1 ; Compare to self bmi MoveDown ; If ball is lower, move down inc ObjectY+1 ; Otherwise, move up jmp EndComputerPlayer MoveDown: dec ObjectY+1 EndComputerPlayer: rts ;------------------------------------------------------------------------------ ; Decrement Coins ;------------------------------------------------------------------------------ ; The stacks of coins are displayed using PF2 register. Three stacks of coins. ; Before the jsr, the y register will have been loaded with either %00000100, ; %00010000, or %01000000 which correspond to one of the stacks. CoinCollision: ; ldx #12 ; The stacks of coins are potentially 12 high CoinTest: tya ; y has to be transferred each time through dex ; go to next coin location beq EndCoinCheck ; End if we're at the bottom of the coin stack. and CoinRAMGfx,x ; Check to see if there is a match on this line beq CoinTest ; If zero matches, go back up RemoveCoin: eor #%11111111 ; Change 00000100 to 111111011 for example and CoinRAMGfx,x ; Remove a coin from the first stack for this example sta CoinRAMGfx,x ; Then store it back from where it came. EndCoinCheck: rts CoinCollision1: ; ldx #12 ; The stacks of coins are potentially 12 high CoinTest1: tya ; y has to be transferred each time through dex ; go to next coin location beq EndCoinCheck1 ; End if we're at the bottom of the coin stack. and CoinRAMGfxB,x ; Check to see if there is a match on this line beq CoinTest1 ; If zero matches, go back up RemoveCoin1: eor #%11111111 ; Change 00000100 to 111111011 for example and CoinRAMGfxB,x ; Remove a coin from the first stack for this example sta CoinRAMGfxB,x ; Then store it back from where it came. EndCoinCheck1: rts ;------------------------------------------------------------------------------- ; PosObject ;------------------------------------------------------------------------------- PosObject: sec sta WSYNC DivideLoop sbc #15 ; 2 2 - each time thru this loop takes 5 cycles, which is bcs DivideLoop ; 2 4 - the same amount of time it takes to draw 15 pixels eor #7 ; 2 6 - The EOR & ASL statements convert the remainder asl ; 2 8 - of position/15 to the value needed to fine tune asl ; 2 10 - the X position asl ; 2 12 asl ; 2 14 sta.wx HMP0,X ; 5 19 - store fine tuning of X sta RESP0,X ; 4 23 - set coarse X position of object rts ; 6 29 - ReTurn from Subroutine ;------------------------------------------------------------------------------- ; Random ;------------------------------------------------------------------------------- Random: lda Rand8 ; 3 3 lsr ; 2 5 bcc noeor ; 2,3 7,8 eor #$B4 ; 2 9 noeor: sta Rand8 ; 3 12 or 11 from bcc rts ; 6 18 ; also the jsr ; 6 24 ;=============================================================================== ; Initialize Atari ;=============================================================================== InitSystem: CLEAN_START ; set initial player0 position lda #40 sta ObjectX lda #(ARENA_HEIGHT - PLAYER0_HEIGHT)/2 sta ObjectY ; set initial player 1 position lda #120 sta ObjectX+1 lda #(ARENA_HEIGHT - PLAYER1_HEIGHT)/2 sta ObjectY+1 ; set initial pill position lda #15 ;(ARENA_HEIGHT - COIN_HEIGHT)/2 sta CoinY ; set initial ball position lda #55 ;#(ARENA_HEIGHT - BALL_HEIGHT)/2 sta ObjectY+4;BallY sta ObjectX+4 ; set initial missile0 position ;lda #(ARENA_HEIGHT - MISSILE_HEIGHT)/2 ;sta Missile0Y ; set initial missile1 position ;lda #(ARENA_HEIGHT - MISSILE_HEIGHT)/2 ;sta Missile1Y lda #0 ; black background sta BackgroundColor lda #PF_COLOR sta COLUPF lda #$84 sta Rand8 ; also use $84 as seed for the LFSR ; Set temporary ball speed lda #1 sta BallVSpeed lda #1 sta BallHSpeed ; Set temporary Missile0 speed ;lda #%11000000 ; ;sta HMM0 ; Set temporary missile1 speed ;lda #%01000000 ; ;sta HMM1 ; Set temporary ball size and reflect lda #%1111001 sta CTRLPF sta VDELBL ;D0 to delay ;sta REFP0 ;D3 to reflect ;sta REFP1 ;D3 to reflect lda #$B2 sta BallMood ;=============================================================================== ; Main Program Loop ;=============================================================================== Main: ;jmp StartScreen ; temporary to build start screen jsr VerticalSync ; Jump to SubRoutine VerticalSync jsr VerticalBlank ; Jump to SubRoutine VerticalBlank ;jsr Kernel ; Jump to SubRoutine Kernel jsr StartScreen jsr OverScan ; Jump to SubRoutine OverScan jmp Main ; JuMP to Main ;======================================== ; Sync Signal ;======================================== VerticalSync: lda #2 ; LoaD Accumulator with 2 sta WSYNC ; STore Accumulator to WSYNC, any value halts CPU until start of next scanline sta VSYNC ; Accumulator D1=1, turns on Vertical Sync signal sta VBLANK ; Accumulator D1=1, turns on Vertical Blank signal (image output off) lda #47 sta TIM64T ; set timer for end of Vertical Blank sta WSYNC ; 1st scanline of VSYNC sta WSYNC ; 2nd scanline of VSYNC lda #0 ; LoaD Accumulator with 0 sta GRP0 sta GRP1 sta WSYNC ; 3rd scanline of VSYNC sta VSYNC ; Accumulator D1=0, turns off Vertical Sync signal rts ;======================================== ; Vertical Blank ; -------------- ; game logic runs here. ; ;======================================== VerticalBlank: jsr ProcessSwitches jsr Random ;Called and not used to advance the register jsr ProcessJoystick jsr PositionObjectsY jsr PositionObjectsX jsr GetScoreLeftPlayfield jsr GetScoreRightPlayfield VBwait: sta WSYNC bit TIMINT bpl VBwait ; wait for the timer to denote end of Vertical Blank rts ;------------------------------------------------------------------------------- ; Process Switches ;------------------------------------------------------------------------------- ProcessSwitches: lda SWCHB ; load in the state of the switches lsr ; D0 is now in C bcs NotReset ; if D0 was on, the RESET switch was not held jsr NewGame ; Prep for new game Jeff- was jsr lda #%10000000 sta GameState bne NotSelect ; clear SelectDelay NotReset: ;rts ;Jeff added to bypass lsr ; D1 is now in C bcs NotSelect ; if D1 was on, the SELECT switch was not held lda #0 sta GameState ; clear D7 to signify Game Over Ê Ê Ê Ê lda SelectDelay ; do we need to delay the Select switch? beq SelectOK ; if delay is 0 then no dec SelectDelay ; else decrement the delay rts ; and exit the subroutine SelectOK: lda #60 ; Set the Select Delay to 1 second sta SelectDelay ; ldx Variation ; Get the Game Variation inx ; and increase it txa ; transfer it to A and #%00000011 ; limit Variation to 0-3 sta Variation ; save it tax ; transfer it to X inx ; and increase it by 1 for the human readable varation 1-4 stx rightScore ; save in Score so it shows on left side ;ldy #1 ; default to showing 1 player variation ;lsr ; D0 of Variation, # of players, now in Carry flag ;bcc Not2 ; if Carry is clear, then show 1 player ;iny ; else set Y to 2 to show 2 players Not2: ;ror Players ; put Carry into D7 for BIT testing of # of players ;sty Score+1 ; show the human readable # of players on right side rts NotSelect: lda #0 ; clears SelectDelay if SELECT not held sta SelectDelay rts NewGame: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set starting location of player0 and player1 objects lda #40 sta ObjectX sta REFP1 ; bit D3 is on, so reflect player1 lda #120 sta ObjectX+1 lda #(ARENA_HEIGHT - PLAYER0_HEIGHT)/2 sta ObjectY sta ObjectY+1 sta REFP0 ; bit D3 is off, so don't reflect player0 ; reset timer lda #%11111111 ;sta TimerPF ;sta TimerPF+1 ;sta TimerPF+2 ;sta TimerPF+3 ;sta TimerPF+4 ;sta TimerPF+5 ; Randomly position the boxes for the new game. Set X to 1 for a 1 player ; game or 2 for a 2 player game so that the appropriate objects will be ; randomly placed in the Arena. ;lda Variation ;and #1 ; value of 0=1 player game, 1=2 player game ;tax ; transfer to X ;inx ; start with 1 for a 1 player game, or 2 for a 2 player game IPloop: ;jsr RandomLocation ; randomly position object specified by X ;inx ; increase X for next object ;cpx #5 ; check if we hit 5 ;bne IPloop ; branch back if we haven't ; reset scores ldx #0 stx leftScore stx leftScore+1 stx leftScore+2 stx leftScore+3 stx leftScore+4 stx leftScore+5 ;bit Players ; check # of players ;bpl BlankRightScore ;stx Score+1 rts ;------------------------------------------------------------------------------- ; Process Joysticks ;------------------------------------------------------------------------------- ProcessJoystick: lda SWCHA ; reads joystick positions ldx #0 ; x=0 for left joystick, x=1 for right PJloop: ;ldy ObjectX,x ; save original X location so the player can be ;sty SavedX,x ; bounced back upon colliding with the playfield ;ldy ObjectY,x ; save original Y location so the player can be ;sty SavedY,x ; bounced back upon colliding with the playfield asl ; shift A bits left, R is now in the carry bit bcs CheckLeft ; branch if joystick is not held right ldy ObjectX,x ; get the object's X position iny ; and move it right cpy #160 ; test for edge of screen bne SaveX ; save Y if we're not at the edge ldy #0 ; else wrap to left edge SaveX: sty ObjectX,x ; saveX ldy #0 ; turn off reflect of player, which sty REFP0,x ; makes humanoid image face right CheckLeft: asl ; shift A bits left, L is now in the carry bit bcs CheckDown ; branch if joystick not held left ldy ObjectX,x ; get the object's X position dey ; and move it left cpy #255 ; test for edge of screen bne SaveX2 ; save X if we're not at the edge ldy #159 ; else wrap to right edge SaveX2: sty ObjectX,x ; save X ldy #0 ;#8 ; turn on reflect of player, which; ;Disabled for score sty REFP0,x ; makes humanoid image face left CheckDown: asl ; shift A bits left, D is now in the carry bit bcs CheckUp ; branch if joystick not held down ldy ObjectY,x ; get the object's Y position dey ; move it down dey cpy #255 ; test for bottom of screen bne SaveY ; save Y if we're not at the bottom ldy #ARENA_HEIGHT;*2+1 ; else wrap to top SaveY: sty ObjectY,x ; save Y CheckUp: asl ; shift A bits left, U is now in the carry bit bcs NextJoystick ; branch if joystick not held up ldy ObjectY,x ; get the object's Y position iny ; move it up iny cpy #ARENA_HEIGHT;*2+2 ; test for top of screen bne SaveY2 ; save Y if we're not at the top ldy #0 ; else wrap to bottom SaveY2: sty ObjectY,x ; save Y NextJoystick: ; Bypassed the bit test to make it 2 player game. ;bit Players ; test number of players by putting D7 into N ;bpl OnePlayer ; if N is off, it's a 1 player game so abort loop inx ; increase loop control cpx #2 ; check if we've processed both joysticks bne PJloop ; branch if we haven't OnePlayer: jsr ComputerPlayer rts ;rts ; 6 9 after 2 wsyncs ;=============================================================================== ; PositionObjects ; -------------- ; Updates TIA for X position of both player objects ; Updates Kernel variables for Y position of both player objects ;=============================================================================== PositionObjectsX: PositionForMarquee: lda #56 ; Position of P0 graphics ldx #0 ; Player 0 index jsr PosObject lda #64 ; Payer 1 position of graphics ldx #1 ; Player 1 index jsr PosObject sta WSYNC sta HMOVE ; Wait 24 cycles before motion register changes ldx #4 ;#1 ; 2 position players 0 and 1, missiles, ball POloop: lda ObjectX,x ; 4 get the object's X position jsr PosObject ; 6 set coarse X position and fine-tune amount ; 29 time of PosObjext after its WSYNC dex ; 2 DEcrement X ;bpl POloop ; 2 Branch PLus so we position all objects cpx #1 ; Don't do players now. bne POloop ;sta WSYNC ; 3 wait for end of scanline ;sta HMOVE ; 3 3Tell TIA to use fine-tune values to set final X positions ; Moved to the kernel rts ; 6 9 after 2 wsyncs PositionObjectsY: ; Player0Draw = ARENA_HEIGHT + PLAYER0_HEIGHT - Y_position lda #(ARENA_HEIGHT + PLAYER0_HEIGHT) sec sbc ObjectY sta Player0Draw ; Set Player0Ptr to proper value for drawing player0 lda #<(Player0Gfx + PLAYER0_HEIGHT - 1) sec sbc ObjectY sta Player0Ptr lda #>(Player0Gfx + PLAYER0_HEIGHT - 1) sbc #0 sta Player0Ptr+1 ; Set PlayerColorPtr to proper value for drawing player0 lda #<(PlayerColor + COLOR_HEIGHT - 1) sec sbc ObjectY sta PlayerColorPtr lda #>(PlayerColor + COLOR_HEIGHT - 1) sbc #0 sta PlayerColorPtr+1 ; Player1Draw = ARENA_HEIGHT + PLAYER1_HEIGHT - Y_position lda #(ARENA_HEIGHT + PLAYER1_HEIGHT) sec sbc ObjectY+1 sta Player1Draw ; Set Player1Ptr to proper value for drawing player1 lda #<(Player1Gfx + PLAYER1_HEIGHT - 1) sec sbc ObjectY+1 sta Player1Ptr lda #>(Player1Gfx + PLAYER1_HEIGHT - 1) sbc #0 sta Player1Ptr+1 ; Set Player1ColorPtr to proper value for drawing player1 lda #<(PlayerColor + COLOR_HEIGHT - 1) sec sbc ObjectY+1 sta Player1ColorPtr lda #>(PlayerColor + COLOR_HEIGHT - 1) sbc #0 sta Player1ColorPtr+1 ; Set CoinPtr to proper value for drawing pills ;lda #<(CoinGfx + COIN_HEIGHT - 1) lda #<(CoinRAMGfx + COIN_HEIGHT - 1) sec sbc CoinY sta CoinPtr ;lda #>(CoinGfx + COIN_HEIGHT - 1) lda #>(CoinRAMGfx + COIN_HEIGHT - 1) sbc #0 sta CoinPtr+1 ; Set CoinPtrB to proper value for drawing pills ;lda #<(CoinGfx + COIN_HEIGHT - 1) lda #<(CoinRAMGfxB + COIN_HEIGHT - 1) sec sbc CoinY sta CoinPtrB ;lda #>(CoinGfx + COIN_HEIGHT - 1) lda #>(CoinRAMGfxB + COIN_HEIGHT - 1) sbc #0 sta CoinPtrB+1 ; BallDraw = ARENA_HEIGHT + BALL_HEIGHT - Y_position lda #(ARENA_HEIGHT + BALL_HEIGHT) sec sbc ObjectY+4;BallY sta BallDraw ; Missile0Draw = ARENA_HEIGHT + MISSILE_HEIGHT - Y_position ;lda #(ARENA_HEIGHT + MISSILE_HEIGHT) ;sec ;sbc Missile0Y ;sta Missile0Draw ; Missile1Draw = ARENA_HEIGHT + MISSILE_HEIGHT - Y_position ;lda #(ARENA_HEIGHT + MISSILE_HEIGHT) ;sec ;sbc Missile1Y ;sta Missile1Draw ; Removed Change Ball Position ; Temporary missile movement inc ObjectX+2 inc ObjectX+2 dec ObjectX+3 dec ObjectX+3 rts ;=============================================================================== ; Kernel ; -------------- ; generate the display ;=============================================================================== Kernel: lda #0 ldy #ARENA_HEIGHT ; init loop counter sta WSYNC sta VBLANK ; 3 3 - turn on video output ;111111111111111111111111111111111111111111111111111111111111111111111111111111 ;111111111111111111111111111111111111111111111111111111111111111111111111111111 ;111111111111111111111111111111111111111111111111111111111111111111111111111111 ;111111111111111111111111111111111111111111111111111111111111111111111111111111 ldy JumboState lda JumboLo,Y sta jumbo_JumpInd lda JumboHi,Y sta jumbo_JumpInd+1 jmp.ind (jumbo_JumpInd) ; indirect jump into code segment TwoScore: sta WSYNC lda #0 sta VDELP0 ; 3 19 turn off vertical delay for P0 sta VDELP1 ; 3 22 turn off vertical delay for P1 sta WSYNC sta WSYNC TWO_SCORE_KERNEL ;*** sta WSYNC sta WSYNC lda #PF_COLOR sta COLUPF sta VDELBL ;D0 to delay ;sta REFP0 ;D3 to reflect ;sta REFP1 ;D3 to reflect sta CXCLR ;Score routine sets off the PF/P0/P1 collisions sta WSYNC Band2Prep: ldy #90 ; 2 2 Probaby can just use x reg here ;222222222222222222222222222222222222222222222222222222222222222222222222222222 ;222222222222222222222222222222222222222222222222222222222222222222222222222222 ;222222222222222222222222222222222222222222222222222222222222222222222222222222 ;222222222222222222222222222222222222222222222222222222222222222222222222222222 lda #%11110101 ; Set temporary ball size and reflect sta CTRLPF lda #%00000010 sta NUSIZ0 sta NUSIZ1 lda FrameCounter sta COLUP0 sta COLUP1 ldx #17 ;2 ArenaLoop2: ; sta WSYNC ; 3 0 ;---------------------------- start of line 1 of the 2LK lda TopBand0,x ; 4 4 sta PF0 ; 3 7 lda TransformerGfx,x sta GRP0 sta GRP1 lda TopBand1,x ; 4 11 sta PF1 ; 3 14 nop sta RESP0 lda TopBand2,x ; 4 18 sta PF2 ; 3 21 dex ; 2 23 nop nop nop nop nop sta RESP1 sta WSYNC ; 3 26 ;---------------------------- start of line 2 of the 2LK lda TopBand0,x ;4 4 sta PF0 ;3 7 lda TopBand1,x ;4 11 sta PF1 ;3 14 lda TopBand2,x ;4 18 sta PF2 ;3 21 dex ;2 23 dey ; 2 25 - update loop counter cpy #85 ;#83 ; 2 45 was 80 Compensated for 3 WSYNCs in jsr bne ArenaLoop2 ; 2 27 - 3 48 if taken lda #%00100000 ; 2 29 sta NUSIZ0 ; 3 32 sta NUSIZ1 ; 3 35 lda #53 sta TIM8T ldx #1 lda ObjectX,x ; 4 get the object's X position jsr PosObject ldx #0 lda ObjectX,x ; 4 get the object's X position jsr PosObject sta WSYNC ; 3 wait for end of scanline sta HMOVE ; 3 3Tell TIA to use fine-tune values to set final X positions ;jsr PositionObjectsX ; Contains 5 WSYNCs currently ; 9 after the last WSYNC from the subroutine. KernalTimer lda INTIM bne KernalTimer ;End ldx #%10000000 ;2 11 stx PF0 ;3 14 ldx #%11101111 ;2 16 stx PF1 ;3 19 ldx #%11110111 ;2 21 stx PF2 ;3 24 sta WSYNC ;3 27 ldx #0 ;2 29 stx PF1 ;3 32 stx PF2 ;3 35 ldy #80 ; Preload data lda #PLAYER0_HEIGHT-1 sta CXCLR ;Score routine sets off the PF/P0/P1 collisions ;3333333333333333333333333333333333333333333333333333333333333333333333333333333 ;3333333333333333333333333333333333333333333333333333333333333333333333333333333 ;3333333333333333333333333333333333333333333333333333333333333333333333333333333 ;3333333333333333333333333333333333333333333333333333333333333333333333333333333 ArenaLoop3: ; ? - worse case time to get here sta WSYNC ; 3 ? ;---------------------------- start of line 1 of the 2LK ;lda #PLAYER0_HEIGHT-1 ; 2 - height of the player graphics, dcp Player0Draw ; 5 5 - Decrement Player0Draw and compare with height bcs CDoDrawGrp0 ; 2 7 - (3 10) if Carry is Set then player0 is on current scanline lda #0 ; 2 9 - otherwise use 0 to turn off player0 .byte $2C ; 4 13 - $2C = BIT with absolute addressing, trick that ; causes the lda (Player0Ptr),y to be skipped CDoDrawGrp0: ; 8 - from bcs DoDrawGRP0 lda (Player0Ptr),y ; 5 13 - load the shape for player0 sta GRP0 ; 3 16 sta ENAM0 ; 3 19 lda (PlayerColorPtr),y ; 5 24 sta COLUP0 ; 3 27 stx COLUPF ; 3 30 Ball: lda #BALL_HEIGHT-1 ; 2 32 dcp BallDraw ; 5 37 bcs DoDrawBall ; 2 39 lda #0 ; 2 41 .byte $2C ; 4 55 DoDrawBall: ; 40 - from bcs DoDrawBall lda #2 ; 2 42 sta ENABL ; 3 45 nop ; 2 47 nop ; 2 49 nop ; 2 51 ;nop ; 2 53 ;nop ; 2 55 nop ; 2 57 lda #PLAYER0_HEIGHT-1 ; 2 59 - height of the player graphics, nop ; 2 61 ldx #PF_COLOR ; 2 65 stx COLUPF ; 3 68 ldx BallMood ; 2 70 sta WSYNC ; 3 73 ;---------------------------- start of line 2 of the 2LK ;lda #PLAYER1_HEIGHT-1 ; 2 - height of the player 1 graphics, subtract 1 due to starting with 0 dcp Player1Draw ; 5 5 - Decrement Player1Draw and compare with height bcs CDoDrawGrp1 ; 2 7 - (3 10) if Carry is Set, then player1 is on current scanline lda #0 ; 2 9 - otherwise use 0 to turn off player1 .byte $2C ; 4 13 - $2C = BIT with absolute addressing, trick that ; causes the lda (Player1Ptr),y to be skipped CDoDrawGrp1: ; 8 - from bcs DoDrawGrp1 lda (Player1Ptr),y ; 5 13 - load the shape for player1 sta GRP1 ; 3 16 sta ENAM1 ; 3 19 lda (Player1ColorPtr),y ; 5 24 sta COLUP1 ; 3 27 stx COLUPF ; 3 30 nop ; 2 32 nop ; 2 34 nop ; 2 36 nop ; 2 38 nop ; 2 40 nop ; 2 42 nop ; 2 44 ;nop ; 2 44 nop ; 2 46 nop ; 2 48 nop ; 2 50 nop ; 2 52 lda #PLAYER0_HEIGHT-1 ; 2 54 - height of the player graphics, ldx #PF_COLOR ; 2 56 stx COLUPF ; 3 60 ldx BallMood ; 3 63 dey ; 2 65 - update loop counter cpy #20 ; 2 67 bne ArenaLoop3 ; 2 69 - 3 63 if taken ;444444444444444444444444444444444444444444444444444444444444444444444444444444 ;444444444444444444444444444444444444444444444444444444444444444444444444444444 ;444444444444444444444444444444444444444444444444444444444444444444444444444444 ;444444444444444444444444444444444444444444444444444444444444444444444444444444 ldx #3 ArenaLoop4: sta WSYNC ; 3 0 ;---------------------------- start of line 1 of the 2LK DoDrawPills: lda #PLAYER0_HEIGHT-1 ; 2 2 - height of the player graphics, dcp Player0Draw ; 5 7 - Decrement Player0Draw and compare with height bcs DDoDrawGrp0 ; 2 9 - (3 10) if Carry is Set then player0 is on current scanline lda #0 ; 2 11 - otherwise use 0 to turn off player0 .byte $2C ; 4 15 - $2C = BIT with absolute addressing, trick that ; causes the lda (Player0Ptr),y to be skipped DDoDrawGrp0: ; 10 - from bcs DoDrawGRP0 lda (Player0Ptr),y ; 5 15 - load the shape for player0 sta GRP0 ; 3 18 lda (PlayerColorPtr),y ; 5 23 sta COLUP0 ; 3 26 lda CoinColor,x ; 4 30 sta COLUPF ; 3 33 nop ; 2 35 nop ; 2 37 nop ; 2 39 nop ; 2 41 lda (CoinPtrB),y ; 2 43 sta PF2 ; 3 46 nop ; 2 48 nop ; 2 50 lda #PF_COLOR ; 2 52 sta COLUPF ; 2 54 dex ; 2 56 lda (CoinPtr),y ; 5 61 sta PF2 ; 3 64 sta WSYNC ; 3 67 ;---------------------------- start of line 2 of the 2LK lda #PLAYER1_HEIGHT-1 ; 2 2 - height of the player 1 graphics, subtract 1 due to starting with 0 dcp Player1Draw ; 5 7 - Decrement Player1Draw and compare with height bcs DDoDrawGrp1 ; 2 9 - (3 10) if Carry is Set, then player1 is on current scanline lda #0 ; 2 11 - otherwise use 0 to turn off player1 .byte $2C ; 4 15 - $2C = BIT with absolute addressing, trick that ; causes the lda (Player1Ptr),y to be skipped DDoDrawGrp1: ; 10 - from bcs DoDrawGrp1 lda (Player1Ptr),y ; 5 15 - load the shape for player1 sta GRP1 ; 3 18 lda (Player1ColorPtr),y ; 5 23 sta COLUP1 ; 3 26 lda CoinColor,x ; 4 30 sta COLUPF ; 3 33 dey ; 2 35 dex ; 2 37 nop lda (CoinPtrB),y ; 2 39 sta PF2 ; 3 41 txa ; 2 43 Coin Colors and #%00000011 ; 2 45 tax ; 2 47 lda #PF_COLOR ; 2 49 sta COLUPF ; 3 52 lda (CoinPtr),y ; 5 57 sta PF2 ; 3 60 cpy #10 ; 2 62 bne ArenaLoop4 ; 2 64 - 3 65 if taken ;5555555555555555555555555555555555555555555555555555555555555555555555555555555 ;5555555555555555555555555555555555555555555555555555555555555555555555555555555 ;5555555555555555555555555555555555555555555555555555555555555555555555555555555 ;5555555555555555555555555555555555555555555555555555555555555555555555555555555 ldx #0 ArenaLoop5: ; sta WSYNC ; 3 26 ;---------------------------- start of line 1 of the 2LK lda TopBand0,x sta PF0 lda TopBand1,x sta PF1 lda TopBand2,x sta PF2 inx lda #0 ; 2 11 - otherwise use 0 to turn off player0 sta GRP0 ; 3 18 sta ENAM0 ;disabling missiles sta ENAM1 sta WSYNC ; 3 21 ;---------------------------- start of line 2 of the 2LK lda TopBand0,x sta PF0 lda TopBand1,x sta PF1 lda TopBand2,x sta PF2 inx lda #0 ; 2 11 - otherwise use 0 to turn off player1 sta GRP1 ; 3 18 dey ; 2 20 - update loop counter bne ArenaLoop5 ; 2 22 - 3 23 if taken rts ; 6 28 ;======================================== ; ; Overscan ; ;======================================== OverScan: sta WSYNC ; Wait for SYNC (start of next scanline) lda #2 ; LoaD Accumulator with 2 sta VBLANK ; STore Accumulator to VBLANK, D1=1 turns image output off lda #22 sta TIM64T ; set timer for end of Overscan jsr ProcessCollisions ;Bookmark- Rolling Cleanup Edit ;**********************************Ball State********************************* BallStateJumper: ldy BallState ;ldy #0 ;temporarily pong state lda BallLo,Y sta ball_JumpInd lda BallHi,Y sta ball_JumpInd+1 jmp.ind (ball_JumpInd) ; indirect jump into code segment EndBallStateJumper: FrameCount: inc FrameCounter lda FrameCounter cmp #255 beq IncDisplay jmp EndIncDisplay IncDisplay: inc JumboState inc BallState lda JumboState ; Temporariy disabled and #%00000011 sta JumboState BallStates: lda BallState and #%00000001 sta BallState EndIncDisplay: lda JumboState cmp #0 beq StaticSound cmp #1 beq TestPatternSound jmp EndSound StaticSound: lda #%00001000 sta AUDC0 lda #%00001010 sta AUDF0 lda #%00000000 ; Turned sound off sta AUDV0 jmp ContinueSound TestPatternSound: lda #%00001100 sta AUDC0 sta AUDF0 lda #%00000000 ; Turned cound off sta AUDV0 jmp ContinueSound EndSound: lda #0 sta AUDV0 sta AUDC0 sta AUDF0 ContinueSound: ResetCoins: lda FrameCounter cmp #100 bne DoNotReset lda #%00000000 sta CoinRAMGfx lda #%00000000 sta CoinRAMGfx+1 lda #%01010100 sta CoinRAMGfx+2 lda #%01010100 sta CoinRAMGfx+3 lda #%01010100 sta CoinRAMGfx+4 lda #%01010100 sta CoinRAMGfx+5 lda #%01010100 sta CoinRAMGfx+6 lda #%01010100 sta CoinRAMGfx+7 lda #%00010100 sta CoinRAMGfx+8 lda #%00010000 sta CoinRAMGfx+9 lda #%00010000 sta CoinRAMGfx+10 lda #%00010000 sta CoinRAMGfx+11 lda #%00000000 sta CoinRAMGfxB lda #%00000000 sta CoinRAMGfxB+1 lda #%01010100 sta CoinRAMGfxB+2 lda #%01010100 sta CoinRAMGfxB+3 lda #%01010100 sta CoinRAMGfxB+4 lda #%01010100 sta CoinRAMGfxB+5 lda #%01010100 sta CoinRAMGfxB+6 lda #%01010100 sta CoinRAMGfxB+7 lda #%00010100 sta CoinRAMGfxB+8 lda #%00010000 sta CoinRAMGfxB+9 lda #%00010000 sta CoinRAMGfxB+10 lda #%00010000 sta CoinRAMGfxB+11 DoNotReset: OSwait: sta WSYNC bit TIMINT bpl OSwait ; wait for the timer to denote end of Overscan rts ;======================================== ; Process Collisions ; -------------- ; ;======================================== ProcessCollisions: ;bit CXBLPF ;Ball with Playfield ;bpl notBLPF ;lda BallHSpeed ;eor #%11111111 ;clc ;adc #1 ;sta BallHSpeed notBLPF bit CXP0FB ;Player 0 with Ball bvc notP0BL ;Branch if not ;ldy #%11110000 ;Change ball speed to -1 ;sty HMBL ;Store it ;lda #1 ;sta BallHSpeed inc BallHSpeed ;lda Rand8 ;sta BallMood ldx #2 ; 2 = left score lda #$01 ; BCD for 1 point jsr AddToScore notP0BL bit CXP1FB ; Player 1 with Ball bvc notP1BL ;ldy #%00010000 ;sty HMBL ;lda #-1 ;sta BallHSpeed dec BallHSpeed ;lda Rand8 ;sta BallMood ldx #5 ; 5 = right score lda #$01 ; BCD for 1 point jsr AddToScore notP1BL bit CXM0FB ; Missile 0 with Ball bvc notM0BL inc BallHSpeed ldy #%11110000 sty HMBL ldx #2 ; 2 = left score lda #$10 ; BCD for 10 points jsr AddToScore notM0BL ; Missile 0 with PF bpl notM0PF lda ObjectX sta ObjectX+2 notM0PF bit CXM1FB ; Missile 1 with ball bvc notM1BL dec BallHSpeed ldy #%00010000 sty HMBL ldx #5 ; 5 = right score lda #$10 ; BCD for 10 points jsr AddToScore notM1BL bpl notM1PF lda ObjectX+1 sta ObjectX+3 notM1PF ;*************************************************************** bit CXP0FB ; N=player0/playfield, V=player0/ball bpl notP0PF ; if N is off then player0 did not collide with playfield lda ObjectX cmp #106 bpl notP0PF cmp #98 bpl FirstStack cmp #90 bpl SecondStack cmp #76 ;82 bpl ThirdStack cmp #64 bpl FourthStack cmp #56 bpl FifthStack cmp #48 bpl SixthStack jmp notP0PF FirstStack: ldx #2 ; 2 = left score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00000100 jsr CoinCollision1 jmp notP0PF SecondStack: ldx #2 ; 2 = left score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00010000 jsr CoinCollision1 jmp notP0PF ThirdStack: ldx #2 ; 2 = left score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%01000000 jsr CoinCollision1 jmp notP0PF FourthStack: ldx #2 ; 2 = left score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%01000000 jsr CoinCollision jmp notP0PF FifthStack: ldx #2 ; 2 = left score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00010000 jsr CoinCollision jmp notP0PF SixthStack: ldx #2 ; 2 = left score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00000100 jsr CoinCollision jmp notP0PF notP0PF: ; Player 1 ******************************************************************** bit CXP1FB ; N=player1/playfield, V=player1/ball bpl notP1PF ; if N is off, then player1 did not collide with playfield lda ObjectX+1 cmp #106 bpl notP1PF cmp #98 bpl FirstStack1 cmp #90 bpl SecondStack1 cmp #82 bpl ThirdStack1 cmp #64 bpl FourthStack1 cmp #56 bpl FifthStack1 cmp #48 bpl SixthStack1 jmp notP1PF FirstStack1: ldx #5 ; 5 = right score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00000100 jsr CoinCollision1 jmp notP1PF SecondStack1: ldx #5 ; 5 = right score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00010000 jsr CoinCollision1 jmp notP1PF ThirdStack1: ldx #5 ; 5 = right score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%01000000 jsr CoinCollision1 jmp notP1PF FourthStack1: ldx #5 ; 5 = right score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%01000000 jsr CoinCollision jmp notP1PF FifthStack1: ldx #5 ; 5 = right score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00010000 jsr CoinCollision jmp notP1PF SixthStack1: ldx #5 ; 5 = right score lda #$10 ; BCD for 10 points jsr AddToScore ldy #%00000100 jsr CoinCollision jmp notP1PF notP1PF: jmp ExitPC ; Temporarily disabled the code below bit CXPPMM ; check to see if player0 collided with player1 ; (also used to check if missile collided with missile) ;cld bpl ExitPC NewX: jsr Random ; get a random value between 0-255 cmp #152 ; compare it with 152 bcs NewX ; get a new random number if >= 152 sta ObjectX+1 ; save player 1's new X location NewY: jsr Random ; get a random value between 0-255 cmp #ARENA_HEIGHT-PLAYER1_HEIGHT bcs NewY ; get a new random number if Y position is offscreen adc #PLAYER1_HEIGHT ; adjust value so player 1 is fully onscreen sta ObjectY+1 ; save Player 1's new Y location ExitPC: sta CXCLR ; clear collision detection latches ; There are two of these in the game at the moment. rts JumboLo: .byte ShowFireballsLogo .byte >TestPattern .byte >TwoScore .byte >TwoScore BallStateTable: BallLo: .byte PongMode ; .byte >StopMode .byte >AngerMode ; .byte >HideMode ;**************************************************************************** ;Ball Moods ;*************************************************************************** PongMode: ; Change Ball Position clc lda BallHSpeed ;Collision detection determines this. adc ObjectX+4 sta ObjectX+4 MoveBallY: lda ObjectY+4 clc adc BallVSpeed sta ObjectY+4 DetermineVerticalDirection: lda ObjectY+4 cmp #80 bpl BallDown cmp #30 bmi BallUp jmp WallCheck BallUp: lda #1 sta BallVSpeed jmp WallCheck BallDown: lda #-1 sta BallVSpeed ;jmp EndBallStateJumper WallCheck: lda ObjectX+4 cmp #17 bmi BallRight cmp #138 bpl BallLeft jmp EndWallCheck BallRight: lda #1 sta BallHSpeed jmp EndWallCheck BallLeft: lda #-1 sta BallHSpeed EndWallCheck jmp EndBallStateJumper ;bit CXBLPF ;Ball with Playfield ;bpl notBLPF ;lda BallHSpeed ;eor #%11111111 ;clc ;adc #1 ;sta BallHSpeed StopMode: clc lda #0 ;BallHSpeed adc ObjectX+4 sta ObjectX+4 ;inc ObjectY+4 jmp EndBallStateJumper AngerMode: ; Find out which player is closer lda ObjectX+4 ; Load ball position sbc ObjectX ; Get distance to Player 0. sta TempVar1 ; usually a positive number lda ObjectX+1 ; load payer 1 sbc ObjectX+4 ; Get distance to ball ; accumulator is player 1 distance, TempVar1 is plyer 0 distance cmp TempVar1 ; bpl GoToPlayer0 GoToPlayer1: lda ObjectX+4 ; load ball cmp ObjectX+1 ; cmp player 1 bpl GoLeft inc ObjectX+4 jmp EndAngerMode GoLeft: dec ObjectX+4 lda ObjectY+4 cmp ObjectY+1 bpl GoDown inc ObjectY+4 jmp EndAngerMode GoDown: dec ObjectY+4 jmp EndAngerMode GoToPlayer0: lda ObjectX+4 ; load ball cmp ObjectX ; cmp player 0 bpl GoLeft1 inc ObjectX+4 jmp EndAngerMode GoLeft1: dec ObjectX+4 lda ObjectY+4 cmp ObjectY ;Y1 bpl GoDown1 inc ObjectY+4 jmp EndAngerMode GoDown1: dec ObjectY+4 EndAngerMode: jmp EndBallStateJumper CircleMode: ShakeMode: EndBallMood: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;Static Display ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; StaticDisplay: ; 6 from the jsr ldy #10 ; 2 8 lda #$0C ; 2 10 sta COLUPF ; 3 13 ;lda #0 ;sta CTRLPF SD: sta WSYNC ; 3 16 lda Rand8 ; 3 19 sta PF0 ; 3 22 eor #$FF ; 2 24 sta PF1 ; 3 37 eor #$FF ; 3 40 sta PF2 ; 3 43 ;and #%00111000 background color filter ;sta COLUBK jsr Random ; 24 67 sta WSYNC ; 3 70 lda Rand8 ; 3 3 sta PF0 ; 3 6 sta PF1 ; 3 9 sta PF2 ; 3 12 jsr Random ; 24 36 dey ; 2 38 bne SD ; 2,3 40 not taken ;lda #PF_COLOR ; 2 42 ;sta COLUPF ; 3 45 lda #0 ; 2 47 sta COLUBK ; 3 50 nop ;nop nop nop sta PF2 ; 3 sta PF1 ; 3 sta PF0 ; 3 lda #PF_COLOR ; 2 42 sta COLUPF ; 3 45 sta WSYNC ;rts ; 6 jmp Band2Prep ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;Test Pattern Display ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TestPattern: ; 6 from the jsr ldy #20 ; 2 8 lda #PF_COLOR sta COLUPF lda #%11111111 sta PF0 TP: sta WSYNC nop lda #$34 ; 2 10 sta COLUBK ; 3 13 ror ; 2 15 sta COLUBK ; 3 18 ror ; 2 20 sta COLUBK ; 3 23 ror ; 2 25 sta COLUBK ; 3 28 ror ; 2 30 sta COLUBK ; 3 33 ror ; 2 35 sta COLUBK ; 3 38 ror ; 2 40 sta COLUBK ; 3 43 ror ; 2 45 sta COLUBK ; 3 48 ror ; 2 50 sta COLUBK ; 3 53 ror ; 2 55 sta COLUBK ; 3 58 ror ; 2 60 sta COLUBK ; 3 63 ror ; 2 65 sta COLUBK ; 3 68 lda #0 ; 2 70 sta COLUBK ; 3 73 ;sta WSYNC dey ; 2 bne TP ; 2,3 40 not taken ;rts ; 6 jmp Band2Prep ;------------------------------------------------------------------------------- ; Marquee Display ;------------------------------------------------------------------------------- ShowFireballsLogo: ;------------------------Spliced in sta WSYNC ;Jeff added lda #3 ; 2 10 sta NUSIZ0 ; 3 13 set triple copies of P0 sta NUSIZ1 ; 3 16 set triple copies of P1 sta VDELP0 ; 3 19 turn on vertical delay for P0 sta VDELP1 ; 3 22 turn on vertical delay for P1 ;lda #$F0 ; 2 24 ;sta HMP0 ; 3 27 x adjust for P0 nop 0 ; 3 30 nop ; 2 32 nop ; 2 34 nop ; 2 36 ;sta RESP0 ; 3 39 set x for P0 nop ;sta RESP1 ; 3 42 set x for P1 sta WSYNC ;sta HMOVE ; fine adjust for P0 ;--------------------------- sta WSYNC lda #0 sta COLUBK lda #$0E ; white sta COLUP0 sta COLUP1 lda #Fireballs sta G48+1 lda #<(Fireballs+15) sta G48+2 lda #>(Fireballs+15) sta G48+3 lda #<(Fireballs+30) sta G48+4 lda #>(Fireballs+30) sta G48+5 lda #<(Fireballs+45) sta G48+6 lda #>(Fireballs+45) sta G48+7 lda #<(Fireballs+60) sta G48+8 lda #>(Fireballs+60) sta G48+9 lda #<(Fireballs+75) sta G48+10 lda #>(Fireballs+75) sta G48+11 ldy #14 ; jsr Show48graphic Show48graphic SUBROUTINE ; call with Y holding the lines-1 to show ; G48 thru G48+$B must be preloaded with pointers to the ; 48 pixel graphic image STY TempVar1 sta WSYNC .graphicLoop ldy TempVar1 ;+3 63 189 lda (G48),y ;+5 68 204 sta GRP0 ;+3 71 213 D1 -- -- -- sta WSYNC ;go lda (G48+$2),y ;+5 5 15 sta GRP1 ;+3 8 24 D1 D1 D2 -- lda (G48+$4),y ;+5 13 39 sta GRP0 ;+3 16 48 D3 D1 D2 D2 lda (G48+$6),y ;+5 21 63 sta TempVar2 ;+3 24 72 lda (G48+$8),y ;+5 29 87 tax ;+2 31 93 lda (G48+$A),y ;+5 36 108 tay ;+2 38 114 lda TempVar2 ;+3 41 123 ! sta GRP1 ;+3 44 132 D3 D3 D4 D2! stx GRP0 ;+3 47 141 D5 D3! D4 D4 sty GRP1 ;+3 50 150 D5 D5 D6 D4! sta GRP0 ;+3 53 159 D4* D5! D6 D6 dec TempVar1 ;+5 58 174 ! bpl .graphicLoop ;+2 60 180 ; sta WSYNC ;JUST ADDED lda #0 sta GRP0 sta GRP1 sta GRP0 sta GRP1 rts ; added to test start screen ; jmp Band2Prep Temporarily disabled for testing start screen AddToScore: ; A holds points to add ($00 thru $99) ; Y holds score to update, 2= Left Score, 5=Right Score sed clc adc leftScore,x sta leftScore,x lda #0 adc leftScore-1,x sta leftScore-1,x lda #0 adc leftScore-2,x sta leftScore-2,x cld rts ;------------------------------------------------------------------------------ ; ; Start Screen ; ;------------------------------------------------------------------------------ StartScreen: ldx #0 stx VBLANK StartScreen2: stx WSYNC stx COLUBK inx txa cmp #86 bne StartScreen2 ShowStartLogo: lda #<(StartScreenReturn-1) pha lda #>(StartScreenReturn-1) pha jmp ShowFireballsLogo StartScreenReturn: ;StartScreen2B: ldx #100 StartScreen3 stx WSYNC stx COLUBK inx txa cmp #194 bne StartScreen3 rts ;======================================== ; Graphics ; ;======================================== align 256 Player0Gfx: .byte %00111100 .byte %00000000 .byte %00111100 .byte %00111100 .byte %00111100 .byte %10111101 .byte %10111101 .byte %10111101 .byte %11111111 .byte %00111100 .byte %00100100 .byte %00111100 .byte %00011000 PLAYER0_HEIGHT = * - Player0Gfx Player1Gfx: .byte %00111100 .byte %00000000 .byte %00111100 .byte %00111100 .byte %00111100 .byte %00111100 .byte %00111100 .byte %00111100 .byte %11111111 .byte %10100101 .byte %10111101 .byte %10011001 .byte %10011001 PLAYER1_HEIGHT = * - Player1Gfx TransformerGfx: .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00001111 .byte %00001111 .byte %00001111 .byte %00001111 .byte %00001111 .byte %00001111 TRANSFORMER_HEIGHT = * - TransformerGfx CoinGfx: ; .byte %11111111 ; .byte %00000000 ; .byte %10000001 ; .byte %00000000 ; .byte %10000001 ; .byte %00000000 .byte %10000001 ; Not currently used .byte %00000000 .byte %10000001 .byte %00000000 .byte %10000001 .byte %11111111 COIN_HEIGHT = * - CoinGfx PlayerColor: .byte BASE_COLOR .byte BODY_COLOR .byte BODY_COLOR .byte BODY_COLOR .byte BODY_COLOR .byte BODY_COLOR .byte BELT_COLOR .byte SHOULDER_COLOR .byte SHOULDER_COLOR .byte SHOULDER_COLOR .byte SHOULDER_COLOR .byte HEAD_COLOR .byte HELMET_COLOR COLOR_HEIGHT = * - PlayerColor CoinColor: .byte $50 .byte $46 .byte $50 .byte $00 TopBand0: .byte %10000000 ; Last Line .byte %10000000 .byte %10000000 .byte %10000000 .byte %10000000 .byte %10000000 .byte %10000000 .byte %10000000 ;This line and the ones before are never used .byte %10000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 ;+17 .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;added ; .byte %00000000 ; .byte %11111111 ; .byte %01000100 ; .byte %10101010 ; .byte %00010001 .byte %11111111 TopBand1: .byte %00000000 .byte %00000000 .byte %11101111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %00111000 .byte %00010000 .byte %00010000 .byte %00000000 .byte %00010000 .byte %00000000 .byte %00010000 .byte %00000000 .byte %00010000 ;+17 .byte %00000000 .byte %00000000 .byte %00000000 ;+20 TopBand2: .byte %00000000 .byte %00000000 .byte %11110111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %11111111 .byte %00011100 .byte %00001000 .byte %00001000 .byte %00000000 .byte %00001000 .byte %00000000 .byte %00001000 .byte %00000000 .byte %00001000 .byte %00000000 .byte %00000000 .byte %00000000 ;20 ; .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 %11111111 ; .byte %01000100 ; .byte %10101010 ;.byte %00010001 ;.byte %11111111 ;added extra ; V 1 V 2 V 3 V 4 ;123456789012345678901234567890123456789012345678 ;____XXXX__X_____________________________________ ;__X_X__XXX______________________________________ ;_XX_X__________________X_____________X___X______ ;X_X_X____X_____________X_____________X___X______ ;__X_X__________________X_____________X___X______ ;_XX_XXX_____X__X____X__X_X_____XX____X___X___XX_ ;X_X_X__X_X_XXXXXX__XXX_XX_XX__X_XX___X___X__X_XX ;__X_X____X__X__X__X_X__X___X_X___X___X___X__X___ ;__X_X____X__X_____XX___X___X_X___X___X___X__XXX_ ;__X_X____X__X_____X____X___X_X___X___X___X_____X ;__X_X___XXX_X_____XX_X_XX_X__XX_X_X_XXX_XXX_XX_X ;_X_______X___X_____XX__XXX____XX_____X___X___XX_ ;X_______________________________________________ ;________________________________________________ ;________________________________________________ ; A 1 A 2 A 3 A 4 ;123456789012345678901234567890123456789012345678 Fireballs .byte zz________ .byte zz________ .byte zzX_______ .byte zz_X______ .byte zz__X_X___ .byte zz__X_X___ .byte zz__X_X___ .byte zz__X_X___ .byte zzX_X_X__X .byte zz_XX_XXX_ .byte zz__X_X___ .byte zzX_X_X___ .byte zz_XX_X___ .byte zz__X_X__X .byte zz____XXXX .byte zz________ .byte zz________ .byte zz________ .byte zz_X___X__ .byte zzXXX_X___ .byte zz_X__X___ .byte zz_X__X___ .byte zz_X__X__X .byte zz_X_XXXXX .byte zz____X__X .byte zz________ .byte zz_X______ .byte zz________ .byte zzXX______ .byte zz__X_____ .byte zz________ .byte zz________ .byte zz________ .byte zz___XX__X .byte zz__XX_X_X .byte zz__X____X .byte zz__XX___X .byte zz__X_X__X .byte zzX__XXX_X .byte zz____X__X .byte zz_______X .byte zz_______X .byte zz_______X .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zzXX____XX .byte zzX_X__XX_ .byte zz___X_X__ .byte zz___X_X__ .byte zz___X_X__ .byte zzX_XX__X_ .byte zz_X_____X .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz_____X__ .byte zzX_X_XXX_ .byte zz_X___X__ .byte zz_X___X__ .byte zz_X___X__ .byte zzXX___X__ .byte zzX____X__ .byte zz_____X__ .byte zz_____X__ .byte zz_____X__ .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz________ .byte zz_X___XX_ .byte zzXXX_XX_X .byte zz_X_____X .byte zz_X__XXX_ .byte zz_X__X___ .byte zz_X__X_XX .byte zz_X___XX_ .byte zz_X______ .byte zz_X______ .byte zz_X______ .byte zz________ .byte zz________ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; DATA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIGN 256 PF_MASK_TABLES ;======================================== ; Define End of Cartridge ;======================================== if (* & $FF) echo "----", [$FFFA-*]d, "bytes free before end of cart." align 256 endif ORG $FFFA ; set address to 6507 Interrupt Vectors .WORD InitSystem ; NMI .WORD InitSystem ; RESET .WORD InitSystem ; IRQ