;Super Toboggan Challenge title screen sei ;Kill all existing interrupts ldx #$31 ldy #$ea stx $0314 sty $0315 lda #$81 sta $dc0d sta $dd0d lda #$00 ;Zero the following: sta $d418 ;SID volume (No sound wanted) sta $d019 ;IRQ interrupt values sta $d01a sta $d015 ;All sprites are off (for now) sta $d011 ;Screen is blank (for now) sta ANIMDELAY ;Animation delay and animation pointer reset sta ANIMPOINTER ;for the game's animation. sta COLOURBARDELAY sta COLOURBARPOINTER ;One time reset of colour bar effect jsr DoSwap ;Set text charset on screen lda #$1a sta $d018 ;Black out the border and background colour. lda #$00 sta $d020 sta $d021 ;Clear the entire screen ldx #$00 ClearScreen lda #$20 sta $0400,x sta $0500,x sta $0600,x sta $06e8,x lda #$09 sta $d800,x sta $d900,x sta $da00,x sta $dae8,x inx bne ClearScreen ;Init scroll text position lda #ScrollText sta MessRead+2 ;Initialise toboggon frames and position ;for title screen sprites ldx #$00 zerospritepostitle lda #$00 sta ObjPos,x inx cpx #$10 bne zerospritepostitle ;Sprite multicolour black and White ldx #$09 ldy #$01 stx $d025 sty $d026 ;Set sprite 0 virtual X,Y position left of logo ldx #$0c ldy #$60 stx ObjPos sty ObjPos+1 ;Set sprite 1 virtual X,Y position right of logo ldx #$a0 ldy #$60 stx ObjPos+2 sty ObjPos+3 ;Set default toboggon frame from sprites 0 and 1 lda #$95 sta $07f8 sta $07f9 ;Both toboggons should be red as main colour ;as in the game. Set colours red to sprites 0 and 1 lda #$02 sta $d027 sta $d028 ;Now allow only 2 sprites 0 and 1 on screen with ;multicolour. lda #%00000011 sta $d015 sta $d01c ;Just in case a program used used expanded sprites or ;sprites behind background properties. ;we should disable this function. lda #$00 sta $d017 ;Disable expand sprite X sta $d01b ;Disable sprite behind background setting sta $d01d ;Disable expand sprite Y ;Draw the title screen logo (Length per row = 40 columns) ldx #$00 DrawLogo lda LogoMatrix,x sta row1,x lda LogoMatrix+40,x sta row2,x lda LogoMatrix+80,x sta row3,x lda LogoMatrix+120,x sta row4,x lda LogoMatrix+160,x sta row5,x lda LogoMatrix+200,x sta row6,x lda LogoMatrix+240,x sta row7,x lda LogoMatrix+280,x sta row8,x lda LogoMatrix+320,x sta row9,x lda LogoMatrix+360,x sta row10,x lda LogoMatrix+400,x sta row11,x inx cpx #40 bne DrawLogo ;Place in the credits text ldx #$00 PlaceTitleText lda Line1,x sta row13,x lda Line2,x sta row15,x lda Line3,x sta row16,x inx cpx #$28 bne PlaceTitleText ;Draw score panel mask ldx #$00 DrawScorePanelToTitle lda StatusPanel,x sta $0720,x inx cpx #4*40 bne DrawScorePanelToTitle lda #0 sta FIREBUTTON ;Setup the front end interrupts ldx #titleirq lda #$2e stx $0314 sty $0315 sta $d012 lda #$7f sta $dc0d sta $dd0d lda #$1b sta $d011 lda #$01 sta $d01a lda #TitleMusic jsr MusicInit cli TitleLoop jsr SYNCLOOP jsr ExpandMSB ;Expand sprite MSB jsr ScoreConvert ;As with the game, convert score pointers to chars jsr TitleScroll ;Perform smooth scroller for text jsr ScrollLogoCharset ;Simple charset \ scrolling animation for the logo jsr AnimTitleSprites ;Rotating toboggan beside logo jsr ColourSwap lda $dc00 lsr lsr lsr lsr lsr bit FIREBUTTON ror FIREBUTTON bmi TitleLoop bvc TitleLoop lda #0 sta FIREBUTTON jmp GameCode jmp TitleLoop ;Title screen scroller TitleScroll lda XPOS sec sbc #2 and #7 sta XPOS bcs EndScroll ldx #$00 ShiftScroll lda $06d1,x sta $06d0,x inx cpx #$28 bne ShiftScroll MessRead lda ScrollText cmp #$00 bne Store lda #ScrollText sta MessRead+2 jmp MessRead Store sta $06f7 inc MessRead+1 bne EndScroll inc MessRead+2 EndScroll rts ;Scroll the logo's character set. The design of the logo ;looks as if there's actually a rotating raster over the ;the chosen chars, but apparently there isn't. ScrollLogoCharset lda 129*8+TitleChar ;Grab first byte of char 129 sta $02 ;store to a temp zeropage ;This loop will scroll 8 byte of the chars upwards ldx #$00 ScrollCharLoop lda 129*8+TitleChar+1,x ;Grab the next byte of char sta 129*8+TitleChar,x ;Pull it to the previous char byte inx cpx #24 ;The scroll consists of 24 bytes (3*8=24) bne ScrollCharLoop ;therefore 3 chars are used one after another lda $02 ;Store the zero page to the last byte of sta 129*8+TitleChar+23 ;the charset. rts ;Animate the title screen sprites AnimTitleSprites lda ANIMDELAY cmp #4 ;This speed should be fast enough beq DoRotation inc ANIMDELAY rts ;After the set speed is reached, we can reset ;the animation delay (ANIMDELAY) pointer and ;then do the main sprite animation (The Rotation) routine ;which consists of 8 frames. DoRotation lda #$00 sta ANIMDELAY ldx ANIMPOINTER lda TitleSpritesTable1,x ;Read table for clockwise rotation sta $07f8 ;Store to sprite 0 type lda TitleSpritesTable2,x ;Read table for anticlockwise rotation sta $07f9 ;Store to sprite 1 type inx cpx #8;8 frames read? beq ResetRotation ;Yes, reset rotation inc ANIMPOINTER ;else move to next frame rts ResetRotation ldx #$00 ;Resets animation. stx ANIMPOINTER rts ;Colour change feature: ;Perform a colour bar (the animated charset) swappping ;trick. ColourSwap lda COLOURBARDELAY cmp #240 ;Duration of colour delay beq DoSwap inc COLOURBARDELAY rts DoSwap lda #0 sta COLOURBARDELAY ldx COLOURBARPOINTER lda ColourBarTable1,x sta COLOURSM1+1 lda ColourBarTable2,x sta COLOURSM2+1 inx cpx #ColourBarTableEnd-ColourBarTable1 beq ResetColourTable inc COLOURBARPOINTER rts ResetColourTable ldx #$00 stx COLOURBARPOINTER rts ;Title screen interrupts ;Bottom screen area (Score panel) titleirq inc $d019 lda #$2e sta $d012 lda #$18 sta $d016 lda #$0e sta $d022 lda #$03 sta $d023 ldx #titleirq2 stx $0314 sty $0315 lda #1 sta SYNCTIMER jsr PALNTSCPlayerTest jmp $ea7e ;Title screen logo colour settings titleirq2 inc $d019 lda #$92 sta $d012 lda #$18 sta $d016 COLOURSM1 ;ColourSM1 = The pointer which a new colour is stored lda #$0e sta $d022 COLOURSM2 ;ColourSM2 = The pointer which a new colour is stored lda #$03 sta $d023 ldx #titleirq3 stx $0314 sty $0315 jmp $ea7e ;Irq 2 still text titleirq3 inc $d019 lda #$c1 sta $d012 lda #$18 sta $d016 lda #$0c sta $d022 lda #$0f sta $d023 ldx #titleirq4 stx $0314 sty $0315 jmp $ea7e ;irq 3 scrolling message titleirq4 inc $d019 lda #$ca sta $d012 lda XPOS ora #$10 sta $d016 lda #$05 sta $d022 lda #$0d sta $d023 ldx #titleirq stx $0314 sty $0315 jmp $ea7e XPOS !byte 0 COLOURBARDELAY !byte 0 COLOURBARPOINTER !byte 0 TitleText !ct scr Line1 !text " (c) 2019 the new dimension " Line2 !text " program, graphics, design and sonics by" Line3 !text " richard bayliss " ;Frames for spinning toboggans TitleSpritesTable1 !byte $95,$96,$97,$98,$99,$9a,$9b,$9c TitleSpritesTable2 !byte $9c,$9b,$9a,$99,$98,$97,$96,$95 ;Colour bar sequence ColourBarTable1 !byte $0e,$0a,$0c,$08 ColourBarTableEnd ColourBarTable2 !byte $03,$07,$0f,$0a ScrollText !text " ... hello competitor, and welcome to the wackiest in winter extreme sports ... " !text "- super toboggon challenge -, a game written as part of the assemble it game programming " !text "feature ... programming, graphics, design, sound effects and music were all done " !text "by richard bayliss ... (c) 2019 the new dimension ... " !text "you are a participating competitor, who enters the latest the challenge with a state of the art toboggon ... " !text "using left or right on your joystick, you must go through the course of infinity and " !text "collect as many flags as you possibly can ... each flag carries 150 points, but if you complete " !text "a lap, you will gain a bonus of 1000 points ... avoid crashing " !text "into any obstacles, or hit the water ... if you do this, the game is up and " !text "you will take home your final score ... score as many points as you can and try to beat your " !text "own high score (or play against some friends to see who can score the most points) ... " !text "that's basically it ... there's only one course, due to memory being filled by single " !text "char based maps ... maybe in the future i might decide to develop some additional courses and " !text "make each course tile based ... who knows what will happen in the future? ... anyway, i " !text "do hope you enjoy this game, and check out the project and its source " !text "in c64studio, for assemble it, and try to make something even cooler from it! ... " !text "so until next time ... goodbye for now! ... - press fire to start - " !text " " !byte 0