This is what I do. How can I help you?

Codex entry · Commodore 64

Dino Christmas Village — Codex Version

Collect presents, carry them to the numbered houses, and press Fire to deliver before time runs out.

Codex game title screen

Play the game

Download the D64 and mount it as device 8 in your Commodore 64 emulator, or drive A on your C64 Ultimate. Enter LOAD"*",8,1 to start. Use a joystick mapped to port 2. Fire starts the game and picks up or delivers a present.

The HUD’s TO digit shows the destination house. Release Fire between actions.

The D64 runs when mounted as drive A on the C64 Ultimate, as confirmed by the owner. Direct PRG launch was reported to fail; use the D64.

Source code

charset.asm
// Original 256-character font and village tiles; no ROM assets.

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$38,$44,$44,$7c,$44,$44,$44

.byte $00,$78,$44,$44,$78,$44,$44,$78,$00,$3c,$40,$40,$40,$40,$40,$3c

.byte $00,$78,$44,$44,$44,$44,$44,$78,$00,$7c,$40,$40,$78,$40,$40,$7c

.byte $00,$7c,$40,$40,$78,$40,$40,$40,$00,$3c,$40,$40,$5c,$44,$44,$3c

.byte $00,$44,$44,$44,$7c,$44,$44,$44,$00,$7c,$10,$10,$10,$10,$10,$7c

.byte $00,$1c,$08,$08,$08,$48,$48,$30,$00,$44,$48,$50,$60,$50,$48,$44

.byte $00,$40,$40,$40,$40,$40,$40,$7c,$00,$44,$6c,$54,$54,$44,$44,$44

.byte $00,$44,$64,$54,$4c,$44,$44,$44,$00,$38,$44,$44,$44,$44,$44,$38

.byte $00,$78,$44,$44,$78,$40,$40,$40,$00,$38,$44,$44,$44,$54,$48,$34

.byte $00,$78,$44,$44,$78,$50,$48,$44,$00,$3c,$40,$40,$38,$04,$04,$78

.byte $00,$7c,$10,$10,$10,$10,$10,$10,$00,$44,$44,$44,$44,$44,$44,$38

.byte $00,$44,$44,$44,$44,$44,$28,$10,$00,$44,$44,$44,$54,$54,$54,$28

.byte $00,$44,$44,$28,$10,$28,$44,$44,$00,$44,$44,$28,$10,$10,$10,$10

.byte $00,$7c,$04,$08,$10,$20,$40,$7c,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$10,$10,$10,$10,$10,$00,$10

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7c,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$10,$10,$00,$04,$04,$08,$10,$20,$40,$40

.byte $00,$38,$44,$4c,$54,$64,$44,$38,$00,$10,$30,$10,$10,$10,$10,$38

.byte $00,$38,$44,$04,$08,$10,$20,$7c,$00,$78,$04,$04,$38,$04,$04,$78

.byte $00,$08,$18,$28,$48,$7c,$08,$08,$00,$7c,$40,$40,$78,$04,$04,$78

.byte $00,$38,$40,$40,$78,$44,$44,$38,$00,$7c,$04,$08,$10,$20,$20,$20

.byte $00,$38,$44,$44,$38,$44,$44,$38,$00,$38,$44,$44,$3c,$04,$04,$38

.byte $00,$00,$10,$10,$00,$10,$10,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$80,$80,$ff,$08,$08,$08,$ff

.byte $01,$03,$07,$0f,$1f,$3f,$7f,$ff,$80,$c0,$e0,$f0,$f8,$fc,$fe,$ff

.byte $ff,$81,$bd,$a5,$bd,$81,$ff,$ff,$7e,$7e,$7e,$76,$7e,$7e,$7e,$7e

.byte $ff,$ff,$ff,$ff,$ff,$ef,$ff,$ff,$ff,$ff,$ff,$e7,$ff,$ff,$ff,$ff

.byte $55,$59,$59,$6a,$66,$aa,$a6,$aa,$aa,$6a,$aa,$9a,$aa,$55,$5d,$5d

.byte $00,$00,$00,$00,$00,$00,$ff,$aa,$00,$00,$00,$00,$00,$00,$ff,$55

.byte $55,$55,$55,$55,$55,$55,$55,$55,$00,$18,$18,$7e,$18,$18,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

main.asm
// Dino Christmas Village - stock 6510 / VIC-II / SID, PAL and NTSC.

// Pure machine-code CHROUT-vector autostart; no BASIC launcher.

.encoding "screencode_upper"

.const SCREEN = $0400

.const COLOR = $d800

.const PTR = $f7

.const CPTR = $f9

.const TEXT = $fb

.const TMP = $fd



* = $0326 "Autostart vectors"

.word entry, $f6ed, $f13e, $f32f, $fe66, $f4a5, $f5ed

.fill $1000-*,0



* = $1000 "Game"

entry:

    sei

    cld

    ldx #$ff

    txs

    lda #$ca

    sta $0326

    lda #$f1

    sta $0327

    lda $02a6

    beq ntsc

    lda #50

    bne videoSet

ntsc:

    lda #60

videoSet:

    sta videoHz

    lda #$7f

    sta $dc0d

    sta $dd0d

    lda $dc0d

    lda $dd0d

    lda #0

    sta $d01a

    sta $dc0e

    sta $dc0f

    sta $dd0e

    sta $dd0f

    sta $dc02

    sta $dc03

    lda #$ff

    sta $dc00

    lda #$2f

    sta $00

    lda #$35

    sta $01

    lda #<interruptReturn

    sta $fffa

    sta $fffe

    lda #>interruptReturn

    sta $fffb

    sta $ffff

    lda $dd02

    ora #3

    sta $dd02

    lda $dd00

    and #$fc

    ora #3

    sta $dd00

    lda #$1b

    sta $d011

    lda #$18

    sta $d016

    lda #$1c

    sta $d018

    lda #6

    sta $d020

    sta $d021

    lda #1

    sta $d022

    lda #5

    sta $d023

    lda #0

    sta $d010

    sta $d01b

    sta $d01c

    sta $d01d

    sta $d017

    sta state

    sta ratePhase

    sta fireHeld

    jsr soundInit

    jsr titleScreen

mainLoop:

    jsr waitFrame

    clc

    lda ratePhase

    adc #50

    cmp videoHz

    bcc skipTick

    sbc videoHz

    sta ratePhase

    jsr soundTick

    jsr readFire

    lda state

    beq menuTick

    cmp #1

    beq gameTick

    lda fireEdge

    beq mainLoop

    lda state

    cmp #2

    bne restart

    inc level

    lda level

    cmp #3

    bcc nextLevel

restart:

    jsr newGame

    jmp mainLoop

nextLevel:

    jsr startLevel

    jmp mainLoop

skipTick:

    sta ratePhase

    jmp mainLoop

menuTick:

    lda fireEdge

    beq mainLoop

    jsr newGame

    jmp mainLoop

gameTick:

    jsr movePlayer

    jsr updateSprites

    lda fireEdge

    beq noAction

    jsr interact

noAction:

    lda state

    cmp #1

    bne mainLoop

    dec secondsTick

    bne gameHud

    lda #50

    sta secondsTick

    dec seconds

    bne gameHud

    jsr gameOver

    jmp mainLoop

gameHud:

    jsr drawHud

    jmp mainLoop



interruptReturn:

    rti

waitFrame:

    bit $d011

    bpl waitFrame

waitLow:

    bit $d011

    bmi waitLow

    rts

readFire:

    lda #0

    sta fireEdge

    lda $dc00

    sta joystick

    and #16

    beq pressed

    lda #0

    sta fireHeld

    rts

pressed:

    lda fireHeld

    bne fireDone

    inc fireHeld

    inc fireEdge

fireDone:

    rts

newGame:

    lda #0

    sta level

    sta score

    sta score+1

    sta score+2

startLevel:

    lda #1

    sta state

    lda #0

    sta delivered

    sta carried

    sta musicOn

    sta $d404

    sta $d40b

    lda #50

    sta secondsTick

    ldx level

    lda levelTime,x

    sta seconds

    lda levelCount,x

    sta total

    lda levelHouses,x

    sta houseCount

    lda #128

    sta playerX

    lda #180

    sta playerY

    ldx #0

resetPresents:

    lda #0

    sta presentState,x

    inx

    cpx #7

    bne resetPresents

    jsr villageScreen

    lda #0

    sta $d01d

    sta $d017

    lda #1

    sta $d01c

    lda #5

    sta $d025

    lda #1

    sta $d026

    lda #10

    sta $d027

    jsr updateSprites

    jsr drawHud

    rts



movePlayer:

    lda joystick

    and #1

    bne moveDown

    lda playerY

    cmp #98

    bcc moveDown

    dec playerY

    dec playerY

moveDown:

    lda joystick

    and #2

    bne moveLeft

    lda playerY

    cmp #219

    bcs moveLeft

    inc playerY

    inc playerY

moveLeft:

    lda joystick

    and #4

    bne moveRight

    lda playerX

    cmp #34

    bcc moveRight

    dec playerX

    dec playerX

moveRight:

    lda joystick

    and #8

    bne moveDone

    lda playerX

    cmp #239

    bcs moveDone

    inc playerX

    inc playerX

moveDone:

    rts



// Explicit bounded AABB collisions. VIC sprite latch is acknowledged each tick;

// doors are character graphics, so their hitboxes use matching screen positions.

interact:

    lda carried

    bne tryDeliver

    ldx #0

pickupLoop:

    lda presentState,x

    bne pickupNext

    lda playerX

    sec

    sbc giftX,x

    clc

    adc #15

    cmp #31

    bcs pickupNext

    lda playerY

    sec

    sbc giftY,x

    clc

    adc #14

    cmp #29

    bcs pickupNext

    lda #1

    sta presentState,x

    txa

    clc

    adc #1

    sta carried

    txa

targetModulo:

    cmp houseCount

    bcc targetReady

    sec

    sbc houseCount

    jmp targetModulo

targetReady:

    sta destination

    lda #1

    jsr effectStart

    jsr updateSprites

    rts

pickupNext:

    inx

    cpx total

    bne pickupLoop

    rts

tryDeliver:

    ldx destination

    lda playerX

    sec

    sbc doorX,x

    clc

    adc #17

    cmp #35

    bcs actionDone

    lda playerY

    sec

    sbc doorY,x

    clc

    adc #16

    cmp #33

    bcs actionDone

    lda #0

    sta carried

    inc delivered

    jsr addHundred

    lda #2

    jsr effectStart

    lda delivered

    cmp total

    bne actionDone

    jsr levelComplete

actionDone:

    rts



updateSprites:

    lda $d01e

    lda $d01f

    lda playerX

    sta $d000

    lda playerY

    sta $d001

    lda #$e0

    ldx carried

    beq normalDino

    lda #$e1

normalDino:

    sta $07f8

    lda #1

    sta spriteMask

    ldx #0

spriteLoop:

    txa

    asl

    tay

    lda giftX,x

    sta $d002,y

    lda giftY,x

    sta $d003,y

    lda #$e2

    sta $07f9,x

    lda giftColors,x

    sta $d028,x

    cpx total

    bcs spriteNext

    lda presentState,x

    bne spriteNext

    lda spriteMask

    ora spriteBits,x

    sta spriteMask

spriteNext:

    inx

    cpx #7

    bne spriteLoop

    lda spriteMask

    sta $d015

    rts



// Six decimal score digits, little-endian packed BCD, capped at 999999.

addHundred:

    sed

    clc

    lda score+1

    adc #1

    sta score+1

    lda score+2

    adc #0

    sta score+2

    cld

    rts

addTen:

    sed

    clc

    lda score

    adc #$10

    sta score

    lda score+1

    adc #0

    sta score+1

    lda score+2

    adc #0

    sta score+2

    cld

    rts

levelComplete:

    ldx #10

bonusThousand:

    jsr addHundred

    dex

    bne bonusThousand

    ldx seconds

timeBonus:

    jsr addTen

    dex

    bne timeBonus

    lda #2

    sta state

    lda #3

    jsr effectStart

    jsr clearScreen

    :Print(completeText, 12, 5, 1)

    :Print(levelDoneText, 11, 8, 7)

    :Print(scoreText, 12, 12, 1)

    jsr finalScore

    lda level

    cmp #2

    beq allDone

    :Print(continueText, 7, 18, 3)

    rts

allDone:

    :Print(wonText, 5, 15, 7)

    :Print(againText, 7, 18, 3)

    rts

gameOver:

    lda #3

    sta state

    lda #4

    jsr effectStart

    jsr clearScreen

    :Print(overText, 15, 6, 10)

    :Print(scoreText, 12, 12, 1)

    jsr finalScore

    :Print(againText, 7, 18, 3)

    rts

finalScore:

    lda #<(SCREEN+12*40+19)

    sta PTR

    lda #>(SCREEN+12*40+19)

    sta PTR+1

    jsr printScore

    rts



clearScreen:

    lda #0

    sta $d015

    ldx #0

clearLoop:

    lda #32

    sta SCREEN,x

    sta SCREEN+250,x

    sta SCREEN+500,x

    sta SCREEN+750,x

    lda #1

    sta COLOR,x

    sta COLOR+250,x

    sta COLOR+500,x

    sta COLOR+750,x

    inx

    cpx #250

    bne clearLoop

    rts

villageScreen:

    jsr clearScreen

    ldx #0

copyVillage:

    lda villageMap,x

    sta SCREEN,x

    lda villageMap+250,x

    sta SCREEN+250,x

    lda villageMap+500,x

    sta SCREEN+500,x

    lda villageMap+750,x

    sta SCREEN+750,x

    lda villageColors,x

    sta COLOR,x

    lda villageColors+250,x

    sta COLOR+250,x

    lda villageColors+500,x

    sta COLOR+500,x

    lda villageColors+750,x

    sta COLOR+750,x

    inx

    cpx #250

    bne copyVillage

    :Print(workshopText, 25, 21, 2)

    :Print(hudText, 1, 0, 1)

    :Print(helpText, 1, 24, 1)

    // Inactive houses are still decorative; active door numbers are gold.

    ldx #0

doorLabels:

    lda doorScreenLo,x

    sta PTR

    sta CPTR

    lda doorScreenHi,x

    sta PTR+1

    clc

    adc #$d4

    sta CPTR+1

    txa

    clc

    adc #49

    ldy #0

    sta (PTR),y

    lda #11

    cpx houseCount

    bcs labelColor

    lda #7

labelColor:

    sta (CPTR),y

    inx

    cpx #5

    bne doorLabels

    rts

titleScreen:

    jsr clearScreen

    ldx #0

copyTitle:

    lda titleMap,x

    sta SCREEN,x

    lda titleMap+250,x

    sta SCREEN+250,x

    lda titleMap+500,x

    sta SCREEN+500,x

    lda titleMap+750,x

    sta SCREEN+750,x

    lda titleColors,x

    sta COLOR,x

    lda titleColors+250,x

    sta COLOR+250,x

    lda titleColors+500,x

    sta COLOR+500,x

    lda titleColors+750,x

    sta COLOR+750,x

    inx

    cpx #250

    bne copyTitle

    :Print(titleText, 9, 2, 7)

    :Print(subtitleText, 7, 4, 1)

    :Print(startText, 10, 16, 7)

    :Print(instruction1, 6, 19, 1)

    :Print(instruction2, 6, 20, 1)

    :Print(instruction3, 8, 21, 1)

    lda #1

    sta $d015

    sta $d01c

    sta $d01d

    sta $d017

    lda #$e0

    sta $07f8

    lda #156

    sta $d000

    lda #94

    sta $d001

    lda #10

    sta $d027

    lda #5

    sta $d025

    lda #1

    sta $d026

    lda #1

    sta musicOn

    lda #0

    sta musicPos

    lda #1

    sta musicClock

    rts



drawHud:

    lda #<(SCREEN+41)

    sta PTR

    lda #>(SCREEN+41)

    sta PTR+1

    jsr printScore

    lda #<(SCREEN+52)

    sta PTR

    lda seconds

    jsr printThree

    lda delivered

    clc

    adc #48

    sta SCREEN+63

    lda #47

    sta SCREEN+64

    lda total

    clc

    adc #48

    sta SCREEN+65

    lda level

    clc

    adc #49

    sta SCREEN+78

    lda #45

    ldx carried

    beq hudTarget

    lda destination

    clc

    adc #49

hudTarget:

    sta SCREEN+70

    rts

printScore:

    ldy #0

    ldx #2

scoreDigit:

    lda score,x

    lsr

    lsr

    lsr

    lsr

    ora #48

    sta (PTR),y

    iny

    lda score,x

    and #15

    ora #48

    sta (PTR),y

    iny

    dex

    bpl scoreDigit

    rts

printThree:

    ldy #0

    ldx #48

hundreds:

    cmp #100

    bcc putHundreds

    sbc #100

    inx

    bne hundreds

putHundreds:

    sta TMP

    txa

    sta (PTR),y

    iny

    lda TMP

    ldx #48

tens:

    cmp #10

    bcc putTens

    sbc #10

    inx

    bne tens

putTens:

    sta TMP

    txa

    sta (PTR),y

    iny

    lda TMP

    ora #48

    sta (PTR),y

    rts



.macro Print(label, col, row, color) {

    lda #<label

    sta TEXT

    lda #>label

    sta TEXT+1

    lda #<(SCREEN+row*40+col)

    sta PTR

    lda #>(SCREEN+row*40+col)

    sta PTR+1

    lda #<(COLOR+row*40+col)

    sta CPTR

    lda #>(COLOR+row*40+col)

    sta CPTR+1

    lda #color

    sta textColor

    jsr printText

}

printText:

    ldy #0

textLoop:

    lda (TEXT),y

    beq textDone

    sta (PTR),y

    lda textColor

    sta (CPTR),y

    iny

    bne textLoop

textDone:

    rts



#import "sound.asm"



titleText: .text "DINO CHRISTMAS VILLAGE"; .byte 0

subtitleText: .text "A LITTLE ROAR. A LOT OF JOY."; .byte 0

startText: .text "PRESS FIRE TO START"; .byte 0

instruction1: .text "PORT 2: MOVE / FIRE: PICK UP"; .byte 0

instruction2: .text "CARRY TO THE NUMBERED HOUSE"; .byte 0

instruction3: .text "FIRE AT DOOR TO DELIVER"; .byte 0

workshopText: .text "SANTA WORKSHOP"; .byte 0

hudText: .text "SCORE      TIME     DELIVERED TO  LEVEL"; .byte 0

helpText: .text "FIRE: PICK UP / DELIVER TO GOLD DOOR"; .byte 0

completeText: .text "MERRY CHRISTMAS!"; .byte 0

levelDoneText: .text "DELIVERIES COMPLETE"; .byte 0

scoreText: .text "SCORE:"; .byte 0

continueText: .text "PRESS FIRE FOR NEXT LEVEL"; .byte 0

againText: .text "PRESS FIRE TO PLAY AGAIN"; .byte 0

wonText: .text "YOU SAVED CHRISTMAS, LITTLE DINO!"; .byte 0

overText: .text "GAME OVER"; .byte 0



videoHz: .byte 50

ratePhase: .byte 0

state: .byte 0

level: .byte 0

score: .byte 0,0,0

seconds: .byte 0

secondsTick: .byte 50

total: .byte 5

houseCount: .byte 3

delivered: .byte 0

carried: .byte 0

destination: .byte 0

playerX: .byte 128

playerY: .byte 180

joystick: .byte $ff

fireEdge: .byte 0

fireHeld: .byte 0

spriteMask: .byte 0

textColor: .byte 1

presentState: .fill 7,0

levelTime: .byte 120,100,85

levelCount: .byte 5,6,7

levelHouses: .byte 3,4,5

giftX: .byte 64,128,216,88,196,152,44

giftY: .byte 142,166,142,204,206,126,184

giftColors: .byte 2,4,6,8,2,4,6

spriteBits: .byte 2,4,8,16,32,64,128

// VIC sprite origin is screen origin + (24,50).

doorX: .byte 56,120,184,56,216

doorY: .byte 100,100,100,204,204

doorScreenLo: .byte <(SCREEN+6*40+5),<(SCREEN+6*40+13),<(SCREEN+6*40+21),<(SCREEN+19*40+5),<(SCREEN+19*40+25)

doorScreenHi: .byte >(SCREEN+6*40+5),>(SCREEN+6*40+13),>(SCREEN+6*40+21),>(SCREEN+19*40+5),>(SCREEN+19*40+25)

.assert "Code fits below title map", * <= $2000, true



* = $2000 "Title screen map"

#import "title.asm"



* = $2800 "Village screen map"

#import "screen.asm"

* = $3000 "Custom charset"

#import "charset.asm"

* = $3800 "Hardware sprites"

#import "sprites.asm"

screen.asm
// Complete 40x25 village screen and matching color RAM.

villageMap:

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$4d,$20,$20,$20,$20,$41,$20,$20,$4d,$20,$20,$20,$20,$41

.byte $20,$20,$20,$20,$20,$20,$20,$41,$20,$4d,$20,$20,$20,$4d,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$42,$42,$42,$43,$43

.byte $43,$20,$20,$42,$42,$42,$43,$43,$43,$20,$4d,$42,$42,$42,$43,$43

.byte $43,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$40,$40,$40,$40,$40,$40,$20,$20,$40,$40,$40,$40,$40

.byte $40,$20,$20,$40,$40,$40,$40,$40,$40,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$4d,$20,$20,$20,$4d,$20,$41,$44,$41,$41,$44

.byte $41,$20,$20,$41,$44,$41,$41,$44,$41,$20,$20,$41,$44,$41,$41,$44

.byte $41,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$41,$41,$45,$45,$41,$41,$20,$20,$41,$41,$45,$45,$41

.byte $41,$20,$20,$41,$41,$45,$45,$41,$41,$20,$20,$20,$20,$48,$20,$20

.byte $20,$20,$4d,$20,$20,$20,$20,$20,$48,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$49,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $49,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$47,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$48,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$47,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$49,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$48,$40,$40,$40,$40,$40,$40,$40,$40,$47,$40,$40,$40,$40,$40

.byte $40,$40,$48,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$49,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$49,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$48,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$49

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$41

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$41,$47,$40,$40,$40,$40,$40,$40,$40,$41,$40,$40,$40

.byte $40,$40,$40,$42,$42,$42,$43,$43,$43,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$42,$42,$42,$43,$43,$43,$40,$42,$42

.byte $42,$42,$43,$43,$43,$43,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$41,$44,$41,$41,$44,$41,$40,$40,$40,$40,$40,$47,$40

.byte $40,$40,$40,$40,$40,$40,$40,$41,$44,$41,$41,$44,$41,$40,$41,$44

.byte $41,$41,$41,$41,$44,$41,$40,$40,$40,$40,$40,$41,$41,$45,$45,$41

.byte $41,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$41

.byte $41,$45,$45,$41,$41,$40,$41,$13,$01,$0e,$14,$01,$41,$41,$40,$40

.byte $40,$48,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$48,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$49,$40,$40,$40,$40,$40,$40

.byte $47,$40,$40,$40,$40,$40,$40,$40,$40,$40,$49,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$4a,$4b,$4a,$4b,$4a

.byte $4b,$4a,$4b,$4a,$4b,$4a,$4b,$4a,$4b,$4a,$4b,$4a,$40,$40,$40,$40

.byte $40,$47,$40,$40,$40,$48,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$49,$40,$40

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20

villageColors:

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1

.byte 1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,2,7,2,2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,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,4,7,4,4,7,4,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,2,7,2,2,7,2,1,2,7,2,2,2,2,7,2,1,1

.byte 1,1,1,4,4,0,0,4,4,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,2,2,0,0,2,2,1,2,7,7,7,7,7,2,2,1,1

.byte 1,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,8,8,8,8,8,8,8,8,8

.byte 8,8,8,8,8,8,8,8,1,1,1,1,1,1,1,1,1,13,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

sound.asm
// SID voices 1+2: original title melody and harmony. Voice 3: effects.

soundInit:

    ldx #24

    lda #0

sidClear:

    sta $d400,x

    dex

    bpl sidClear

    lda #15

    sta $d418

    lda #$09

    sta $d405

    sta $d40c

    lda #$a8

    sta $d406

    sta $d40d

    lda #0

    sta effectClock

    sta musicOn

    rts

soundTick:

    lda effectClock

    beq musicTick

    dec effectClock

    beq effectStop

    lda effectClock

    and #3

    bne musicTick

    clc

    lda effectFreqHi

    adc effectSweep

    sta effectFreqHi

    sta $d40f

    jmp musicTick

effectStop:

    lda #0

    sta $d412

musicTick:

    lda musicOn

    beq soundDone

    dec musicClock

    bne soundDone

    lda #15

    sta musicClock

    ldx musicPos

    lda #$20

    sta $d404

    sta $d40b

    lda tuneLo,x

    sta $d400

    sta $d407

    lda tuneHi,x

    sta $d401

    lsr

    sta $d408

    lda #$21

    sta $d404

    lda #$11

    sta $d40b

    inc musicPos

    lda musicPos

    and #31

    sta musicPos

soundDone:

    rts

effectStart:

    tax

    lda #0

    sta $d412

    lda effectDurations-1,x

    sta effectClock

    lda effectSweeps-1,x

    sta effectSweep

    lda effectLow-1,x

    sta $d40e

    lda effectHigh-1,x

    sta effectFreqHi

    sta $d40f

    lda #$04

    sta $d413

    lda #$a7

    sta $d414

    lda #$11

    sta $d412

    rts

musicOn: .byte 0

musicPos: .byte 0

musicClock: .byte 1

effectClock: .byte 0

effectSweep: .byte 0

effectFreqHi: .byte 0

effectDurations: .byte 12,24,90,80

effectSweeps: .byte 2,1,1,$ff

effectLow: .byte $40,$80,$00,$00

effectHigh: .byte $18,$20,$10,$28

// 32-note original winter waltz, PAL SID values; NTSC runs at matched tempo.

tuneLo: .byte $25,$25,$9a,$b1,$9a,$25,$47,$47,$25,$4b,$4b,$9a,$b1,$9a,$25,$47

        .byte $25,$25,$9a,$b1,$c8,$b1,$9a,$25,$47,$47,$4b,$9a,$25,$47,$25,$25

tuneHi: .byte $11,$11,$15,$19,$15,$11,$13,$13,$11,$22,$22,$15,$19,$15,$11,$13

        .byte $11,$11,$15,$19,$1c,$19,$15,$11,$13,$13,$22,$15,$11,$13,$11,$11

sprites.asm
// $e0 dinosaur, $e1 carrying dinosaur, $e2 present. Each 64 bytes.

.byte $00,$03,$c0,$00,$0a,$a0,$00,$0a,$ac,$00,$15,$54,$00,$17,$54,$00

.byte $15,$55,$00,$15,$55,$00,$15,$50,$00,$55,$00,$10,$55,$00,$15,$55

.byte $50,$05,$55,$50,$05,$55,$50,$01,$55,$40,$01,$55,$40,$01,$45,$00

.byte $01,$45,$00,$05,$45,$40,$0f,$cf,$c0,$00,$00,$00,$00,$00,$00,$00

.byte $00,$03,$c0,$00,$0a,$a0,$00,$0a,$ac,$00,$15,$54,$00,$17,$54,$00

.byte $15,$55,$00,$15,$55,$00,$15,$50,$00,$55,$00,$10,$55,$00,$15,$55

.byte $b8,$05,$55,$b8,$05,$55,$fc,$01,$55,$b8,$01,$55,$b8,$01,$45,$00

.byte $01,$45,$00,$05,$45,$40,$0f,$cf,$c0,$00,$00,$00,$00,$00,$00,$00

.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$b6,$c0,$01,$b6,$c0,$03

.byte $ff,$e0,$02,$08,$20,$02,$08,$20,$02,$08,$20,$02,$08,$20,$03,$ff

.byte $e0,$02,$08,$20,$02,$08,$20,$02,$08,$20,$02,$08,$20,$02,$08,$20

.byte $03,$ff,$e0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

title.asm
// Complete dedicated 40x25 title village.

titleMap:

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$4d,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$4d,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$4d,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $4d,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$4d,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$4d,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$4d,$20,$20,$20,$41,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$41,$20,$4d,$20,$20,$20,$20,$20,$20,$42,$42,$42,$43,$43

.byte $43,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$42,$42,$42,$42,$43,$43,$43,$43,$20,$20,$20,$20

.byte $48,$20,$20,$40,$40,$40,$40,$40,$40,$20,$20,$20,$20,$20,$20,$20

.byte $20,$20,$20,$20,$20,$20,$20,$20,$48,$20,$20,$20,$40,$40,$40,$40

.byte $40,$40,$40,$40,$20,$20,$20,$20,$49,$40,$40,$41,$44,$41,$41,$44

.byte $41,$40,$40,$48,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $49,$40,$40,$40,$41,$44,$41,$41,$41,$41,$44,$41,$40,$40,$48,$40

.byte $40,$40,$40,$41,$41,$45,$45,$41,$41,$40,$40,$49,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$41,$13,$01,$0e

.byte $14,$01,$41,$41,$40,$40,$49,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40,$40

.byte $40,$40,$40,$40,$40,$40,$40,$40

titleColors:

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

.byte 1,1,1,1,1,1,1,1,1,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