;I am releasing this source code under 1 condition: please don't
;distribute modified copies of this game!! Thanks!!!!!

;oh yeah, this game is horribly un-commented, and un-optimised, but may
;help out beginner programmers...



;JOUST 2.0

;(c) Tim FitzRandolph, 1996


;This is much like the old Atari/apple ][e game.  Run around trying to spear
;your opponets!  What fun!!!


#INCLUDE "TI-85.H"

.org 0
.db "ZJoust 2.0 (ZShell)",0               ;ZShell menu text


;-------------------------------------------------------------------;
;                               VARIABLES                           ;
;-------------------------------------------------------------------;


player1x        = $80DF         ;player 1's x position
player1y        = $80E0         ;player 1's y position
player1d        = $80E1         ;player 1's direction (1=left,2=right)
player1j        = $80E2         ;player jumping? (1=yes,0=no)
player1jc       = $80E3         ;player jump counter (to set position)



oldcont         = $80E4
counter         = $80E6         ;
level           = $80E7         ;current level

Data    = $80F0                  ;for ZCP
Count   = $80F1                  ;for ZCP

OverallScore = $80F2

Score1  = $80F5
Score2  = $80F6
Score3  = $80F7
Score4  = $80F8
Score5  = $80F9

Overalllevel = $80FB

Level1  = $80FD
Level2  = $80FE
Level3  = $80FF
Level4  = $8101
Level5  = $8102


enemy1x = $8104
enemy1y = $8105
enemy1d = $8106
enemy2x = $8107
enemy2y = $8108
enemy2d = $8109
enemy3x = $810A
enemy3y = $810B
enemy3d = $810C
en1s    = $810D
en2s    = $810E
en3s    = $810F


totalkilled = $8112
;-------------------------------------------------------------------;
;                       INITIALIZE VARIABLES                        ;
;-------------------------------------------------------------------;
Init:

	ld hl, $8C40
        set 0, (hl)             ;tell zshell to recalc checksum

        ld a,4
        out (5),a                       ;set to graphics mode

        ld a,11
        ld (player1x),a
        ld (player1y),a
        ld a,2
        ld (player1d),a
        ld a,0
        ld (player1j),a
        ld a,1
        ld (counter),a

        ld a,(CONTRAST)
        ld (oldcont),a

        ld a,1
        ld (Overalllevel),a

        ld a,1
        ld (OverallScore),a

        ld a,13
        ld (enemy1x),a
        ld a,21
        ld (enemy1y),a
        
        ld a,77
        ld (enemy2x),a
        ld a,23
        ld (enemy2y),a

        ld a,39
        ld (enemy3x),a
        ld a,41
        ld (enemy3y),a

        ld a,1
        ld (enemy3d),a

        ld a,1
        ld (enemy1d),a

        ld a,2
        ld (enemy2d),a

        ld a,1
        ld (en1s),a
        ld (en2s),a
        ld (en3s),a


        ld a,0
        ld (totalkilled),a
;-------------------------------------------------------------------;
;                       TITLE SCREEN (ZCP)                          ;
;-------------------------------------------------------------------;
TitleScreen:

        CALL_(FadeUpBig)                ;fade screen to white
        ROM_CALL(CLEARLCD)
        JUMP_(TitleStart)                    ;Decode ZCP STUFF
AfterStart:
        CALL_(ShowVersion)
        CALL_(FadeBackDown)             ;fade down to old contrast setting
        CALL_(WaitEnter)                ;wait for ENTER key to be pressed
        CALL_(FadeUpBig)                ;fade screen to white
        ROM_CALL(CLEARLCD)              ;clear the screen
        CALL_(ResetContrast)            ;reset the contrast
        JUMP_(StartGame)                ;begin!


ShowVersion:
        ld hl, $3A05
        ld ($8333), hl
        ld hl, (PROGRAM_ADDR)
        ld de,joustversion
        add hl,de
        ROM_CALL(D_ZM_STR)
        ret

ResetContrast:
        ld a,(oldcont)
        ld (CONTRAST),a
        out (2),a
        ret

FadeUpBig:
        ld a,(CONTRAST)
        dec a
        cp $08
        ret z
        ld (CONTRAST),a
        out (2),a
        CALL_(contdelay)
        JUMP_(FadeUpBig)


FadeBackDown:
        ld a,(oldcont)
        ld b,a
        ld a,(CONTRAST)
        cp b
        ret z

        inc a
        ld (CONTRAST),a
        out (2),a
        CALL_(contdelay)
        JUMP_(FadeBackDown)


contdelay:
        ld a,$7F
        ld b,$0F
contdelayloop:
        dec a
        jr nz,contdelayloop
        dec b
        jr nz,contdelayloop
        ret

;-----------------------------------------------------------------------;
;               GAME BEGINS HERE        GAME BEGINS HERE                ;
;-----------------------------------------------------------------------;
StartGame:
                JUMP_(TheGame)




;---GAME LOOP--GAME LOOP--GAME LOOP--GAME LOOP--GAME LOOP--GAME LOOP--;
;XXX----X----XX----X----XX----X----XX----X----XX----X----XX----X----XX;

TheGame:
        CALL_(DrawPlayfield)    ;draw platforms

        CALL_(ErasePlayer)      ;erase the player
        JUMP_(KeyTest)          ;check for keypresses
AfterKeys:
        CALL_(DrawPlayer)       ;redraw the player
        CALL_(CheckPlat)
        CALL_(HandleEnemies)    ;handle enemies here!
        JUMP_(KillDeath)
AfterKD:
        JUMP_(CheckWin)         ;all guys dead?
AfterWinCheck:
        CALL_(DrawInfo)          ;print score & stuff

        JUMP_(TheGame)          ;loop back to top
        

DrawPlayfield:

                ld a,(Overalllevel)
                cp 1
                JUMP_Z(Drawlev1)
                cp 2
                JUMP_Z(Drawlev2)
                cp 3
                JUMP_Z(Drawlev3)
AfterLevelDraw:

                ret



Drawlev1:
                ld c,9
                ld b,1
                CALL_(Hline)        ;line across screen
                inc C
                CALL_(Hline)            ;another line

                ld B,13
                ld C,20
loop11:
                CALL_(PlotPixel)
                inc B

                ld a,52
                cp B
                JUMP_Z(next1)

                JUMP_(loop11)

next1:
                ld B,15
                ld C,19

loop12:
                CALL_(PlotPixel)
                inc B

                ld a,50
                cp B
                JUMP_Z(next12)

                JUMP_(loop12)

next12:
                ld B,77
                ld C,22

loop13:
                CALL_(PlotPixel)
                inc B

                ld a,105
                cp B
                JUMP_Z(next13)
                           
                JUMP_(loop13)

next13:
                ld B,81
                ld C,21

loop14:
                CALL_(PlotPixel)
                inc B

                ld a,104
                cp B
                JUMP_Z(next14)

                JUMP_(loop14)

next14:
                ld B,38
                ld C,40

loop15:
                CALL_(PlotPixel)
                inc B

                ld a,84
                cp B
                JUMP_Z(last1)

                JUMP_(loop15)

last1:
                ld B,41
                ld C,39

lastloop1:
                CALL_(PlotPixel)
                inc B

                ld a,68
                cp B
                JUMP_Z(AfterLevelDraw)

                JUMP_(lastloop1)

Drawlev2:
                CALL_(DrawLava)

                ld B,0
                ld C,9

lev21:
                CALL_(PlotPixel)
                inc B

                ld a,70
                cp B
                JUMP_Z(init22)

                JUMP_(lev21)

init22:
                ld B,87
                ld C,9

lev22:
                CALL_(PlotPixel)
                inc B

                ld a,127
                cp B
                JUMP_Z(init23)

                JUMP_(lev22)

init23:
                ld B,0
                ld C,10

lev23:
                CALL_(PlotPixel)
                inc B

                ld a,67
                cp B
                JUMP_Z(init24)

                JUMP_(lev23)

init24:
                ld B,89
                ld C,10

lev24:
                CALL_(PlotPixel)
                inc B

                ld a,127
                cp B
                JUMP_Z(init25)

                JUMP_(lev24)

init25:
                ld B,77
                ld C,27

lev25:
                CALL_(PlotPixel)
                inc B

                ld a,115
                cp B
                JUMP_Z(init26)

                JUMP_(lev25)

init26:
                ld B,79
                LD C,26

lev26:
                CALL_(PlotPixel)
                inc B

                ld a,113
                cp B
                JUMP_Z(init27)

                JUMP_(lev26)

init27:
                ld B,10
                ld C,51

lev27:
                CALL_(PlotPixel)
                inc B

                ld a,52
                cp B
                JUMP_Z(init28)

                JUMP_(lev27)

init28:
                ld B,13
                ld C,50

lev28:
                CALL_(PlotPixel)
                inc B

                ld a,54
                cp B
                JUMP_Z(AfterLevelDraw)

                JUMP_(lev28)


Drawlev3:
                CALL_(DrawLava)

                ld B,0
                ld C,9

lev31:
                CALL_(PlotPixel)
                inc B

                ld a,50
                cp B
                JUMP_Z(init32)

                JUMP_(lev31)

init32:
                ld B,87
                ld C,9

lev32:
                CALL_(PlotPixel)
                inc B

                ld a,127
                cp B
                JUMP_Z(init33)

                JUMP_(lev32)

init33:
                ld B,0
                ld C,10

lev33:
                CALL_(PlotPixel)
                inc B

                ld a,47
                cp B
                JUMP_Z(init34)

                JUMP_(lev33)

init34:
                ld B,89
                ld C,10

lev34:
                CALL_(PlotPixel)
                inc B

                ld a,127
                cp B
                JUMP_Z(init35)

                JUMP_(lev34)

init35:
                ld B,71
                ld C,31

lev35:
                CALL_(PlotPixel)
                inc B

                ld a,103
                cp B
                JUMP_Z(init36)

                JUMP_(lev35)

init36:
                ld B,74
                LD C,30

lev36:
                CALL_(PlotPixel)
                inc B

                ld a,107
                cp B
                JUMP_Z(init37)

                JUMP_(lev36)

init37:
                ld B,35
                ld C,35

lev37:
                CALL_(PlotPixel)
                inc B

                ld a,56
                cp B
                JUMP_Z(init38)

                JUMP_(lev37)

init38:
                ld B,37
                ld C,34

lev38:
                CALL_(PlotPixel)
                inc B

                ld a,50
                cp B
                JUMP_Z(AfterLevelDraw)

                JUMP_(lev38)




DrawLava:
        ld B,0
        ld C,8
LavaLoop1:
        CALL_(PlotPixel)
        inc b
        inc b
        CALL_(PlotPixel)

        ld a,127
        cp B
        JUMP_Z(LavaLoop2)
        inc a
        cp B
        JUMP_Z(LavaLoop2)

        JUMP_(LavaLoop1)

LavaLoop2:
        ld B,1
        ld C,7
LavaLoop3:
        CALL_(PlotPixel)
        inc b
        inc b

        ld a,126
        cp B
        ret z
        inc a
        cp B
        ret z

        JUMP_(LavaLoop3)

DrawInfo:
        CALL_(DrawScore)
        CALL_(DrawLevel)
        ret

DrawScore:
        ld hl,$3905
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,ScoreStr
        add hl,de
        ROM_CALL(D_ZM_STR)

        ld hl, (OverallScore)
	ld de, Score1+4
	ld b, 5
SCORELOOP:
	call UNPACK_HL
	add a, '0'                      
	ld (de), a                      
	dec de
	djnz SCORELOOP
	
        ld hl, $391E
	ld ($8333), hl
	ld hl, Score1
	ld b, 5
	ROM_CALL(D_LM_STR)
	ret

DrawLevel:
        ld hl,$3945
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,LevelStr
        add hl,de
        ROM_CALL(D_ZM_STR)

        ld hl, (Overalllevel)
        ld de, Level1+4
	ld b, 5
LEVELLOOP:
	call UNPACK_HL
	add a, '0'                      
	ld (de), a                      
	dec de
        djnz LEVELLOOP
	
        ld hl, $395E
	ld ($8333), hl
        ld hl, Level1
	ld b, 5
	ROM_CALL(D_LM_STR)
	ret
        

;-----------------------------------------------;
;            CHECK FOR KEYPRESSES               ;
;-----------------------------------------------;
KeyTest:

        ld a,0
        out (1),a
        in a,(1)
        cp 0
        JUMP_Z(AfterKeys)
        bit 4,a
        push af
        CALL_Z(PauseIt)
        pop af
        bit 1,a
        push af
        CALL_Z(moveleft)
        pop af
        bit 2,a
        push af
        CALL_Z(moveright)
        pop af
        bit 5,a
        push af
        CALL_Z(movejump)
        pop af

        call GET_KEY
        cp $37
        JUMP_Z(QuitScreen)
        cp $38
        JUMP_Z(NextLevel)

        JUMP_(AfterKeys)        ;back to game!

PauseIt:
        ld hl,$FC00
        ld de,GRAPH_MEM
        ld bc,1024
        ldir
        CALL_(WaitEnter)
        ret


moveleft:
        ld a,1
        ld (player1d),a         ;set direction to left

        ld a,(player1x)         ;load X position
        dec a
        dec a
        dec a
        ld (player1x),a         ;store NEW position

        ret                     ;back to game!


moveright:
        ld a,2
        ld (player1d),a         ;set direction to Right

        ld a,(player1x)         ;load X position
        inc a
        inc a
        inc a
        ld (player1x),a         ;store NEW position

        ret                     ;back to game!


movejump:
        ld a,(player1d)
        cp 2                    ;jump right
        JUMP_Z(JumpLoop1)
        cp 1                    ;jump left
        JUMP_Z(JumpLoop2)


JumpLoop1:
        CALL_(ErasePlayer)
        JUMP_(jump11)           ;jump position1
aj11:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump12)           ;jump pos2...
aj12:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump13)           ;etc...
aj13:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump14)
aj14:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump15)
aj15:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump16)
aj16:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump17)
aj17:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump18)
aj18:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump19)
aj19:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        ret                           ;back to game!


jump11:
        ld a,(player1y)
        inc a
        inc a
        inc a
        ld (player1y),a

        ld a,(player1x)
        inc a
        ld (player1x),a

        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop1)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj11)
        ret

jump12:
        ld a,(player1y)
        inc a
        inc a
        ld (player1y),a

        ld a,(player1x)
        inc a
        inc a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop1)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj12)
        ret

jump13:
        ld a,(player1y)
        inc a
        inc a
        ld (player1y),a

        ld a,(player1x)
        inc a
        inc a
        inc a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop)1
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj13)
        ret

jump14:
        ld a,(player1y)
        inc a
        ld (player1y),a

        ld a,(player1x)
        inc a
        inc a
        inc a
        inc a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop1)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj14)
        ret

jump15:
        ld a,(player1x)
        inc a
        inc a
        inc a
        inc a
        inc a
        inc a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop1)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj15)
        ret

jump16:
        ld a,(player1y)
        dec a
        ld (player1y),a

        ld a,(player1x)
        inc a
        inc a
        inc a
        inc a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop1)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj16)
        ret

jump17:
        ld a,(player1y)
        dec a
        dec a
        ld (player1y),a

        ld a,(player1x)
        inc a
        inc a
        inc a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop)1
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj17)
        ret

jump18:
        ld a,(player1y)
        dec a
        dec a
        ld (player1y),a

        ld a,(player1x)
        inc a
        inc a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop1)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj18)
        ret

jump19:
        ld a,(player1y)
        dec a
        dec a
        dec a
        ld (player1y),a

        ld a,(player1x)
        inc a
        ld (player1x),a

        ld a,0
        ld (player1j),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop1)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj19)
        ret

JumpLoop2:
        CALL_(ErasePlayer)
        JUMP_(jump21)           ;jump position1
aj21:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump22)           ;jump pos2...
aj22:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump23)           ;etc...
aj23:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump24)
aj24:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump25)
aj25:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump26)
aj26:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump27)
aj27:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump28)
aj28:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        CALL_(HandleEnemies)
        CALL_(ErasePlayer)
        JUMP_(jump29)
aj29:
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        ret                                  ;back to game!


jump21:
        ld a,(player1y)
        inc a
        inc a
        inc a
        ld (player1y),a

        ld a,(player1x)
        dec a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)

        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj21)
        ret

jump22:
        ld a,(player1y)
        inc a
        inc a
        ld (player1y),a

        ld a,(player1x)
        dec a
        dec a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj22)
        ret

jump23:
        ld a,(player1y)
        inc a
        inc a
        ld (player1y),a

        ld a,(player1x)
        dec a
        dec a
        dec a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj23)
        ret

jump24:
        ld a,(player1y)
        inc a
        ld (player1y),a

        ld a,(player1x)
        dec a
        dec a
        dec a
        dec a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj24)
        ret

jump25:
        ld a,(player1x)
        dec a
        dec a
        dec a
        dec a
        dec a
        dec a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj25)
        ret

jump26:
        ld a,(player1y)
        dec a
        ld (player1y),a

        ld a,(player1x)
        dec a
        dec a
        dec a
        dec a
        ld (player1x),a
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj26)
        ret

jump27:
        ld a,(player1y)
        dec a
        dec a
        ld (player1y),a

        ld a,(player1x)
        dec a
        dec a
        dec a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj27)
        ret

jump28:
        ld a,(player1y)
        dec a
        dec a
        ld (player1y),a

        ld a,(player1x)
        dec a
        dec a
        ld (player1x),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj28)
        ret

jump29:
        ld a,(player1y)
        dec a
        dec a
        dec a
        ld (player1y),a

        ld a,(player1x)
        dec a
        ld (player1x),a

        ld a,0
        ld (player1j),a
        call GET_KEY
        cp $36
        JUMP_Z(JumpLoop2)
        ld a,(player1x)
        ld b,a
        ld a,(player1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(aj29)
        ret



KillDeath:
        ld a,(player1x)
        inc a
        inc a
        ld b,a
        ld a,(player1y)
        inc a
        ld c,a

        CALL_(GetPixel)
        or 0
        JUMP_NZ(ApparentDoom)
        dec b
        dec b
        CALL_(GetPixel)
        or 0
        JUMP_NZ(ApparentDoom)

        JUMP_(AfterKD)


ApparentDoom:
        ld a,(enemy1y)
        ld b,a
        ld a,(player1y)
        cp B
        JUMP_Z(maybedead1)
        inc B
        cp B
        JUMP_Z(Killed1)
        inc B
        cp B
        JUMP_Z(Killed1)
        inc B
        cp B
        JUMP_Z(Killed1)

        ld a,(enemy2y)
        ld b,a
        ld a,(player1y)
        cp B
        JUMP_Z(maybedead2)
        inc B
        cp B
        JUMP_Z(Killed2)
        inc B
        cp B
        JUMP_Z(Killed2)
        inc B
        cp B
        JUMP_Z(Killed2)

        ld a,(enemy3y)
        ld b,a
        ld a,(player1y)
        cp B
        JUMP_Z(maybedead3)
        inc B
        cp B
        JUMP_Z(Killed3)
        inc B
        cp B
        JUMP_Z(Killed3)
        inc B
        cp B
        JUMP_Z(Killed3)


        JUMP_(AfterKD)

maybedead1:
        ld a,(en1s)
        cp 1
        JUMP_NZ(LoserScreen)

        JUMP_(AfterKD)

maybedead2:
        ld a,(en2s)
        cp 1
        JUMP_NZ(LoserScreen)

        JUMP_(AfterKD)

maybedead3:
        ld a,(en3s)
        cp 1
        JUMP_NZ(LoserScreen)

        JUMP_(AfterKD)

Killed1:
        ld a,(totalkilled)
        inc a
        ld (totalkilled),a

        ld a,2
        ld (en1s),a

        ld a,(OverallScore)
        inc a
        ld (OverallScore),a
        
        JUMP_(AfterKD)        ;DEAD!

Killed2:
        ld a,(totalkilled)
        inc a
        ld (totalkilled),a

        ld a,2
        ld (en2s),a

        ld a,(OverallScore)
        inc a
        ld (OverallScore),a

        JUMP_(AfterKD)

Killed3:
        ld a,(totalkilled)
        inc a
        ld (totalkilled),a

        ld a,2
        ld (en3s),a

        ld a,(OverallScore)
        inc a
        ld (OverallScore),a

        JUMP_(AfterKD)


NextLevel:
        ld a,(Overalllevel)
        cp 1
        JUMP_Z(setup2)
        cp 2
        JUMP_Z(setup3)
        cp 3
        JUMP_Z(WinnerScreen)

postsetup:
        ld a,(Overalllevel)
        inc a
        ld (Overalllevel),a

        ld a,0
        ld (totalkilled),a

        ROM_CALL(CLEARLCD)

        ld hl,$202A
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,NewLevel
        add hl,de
        ROM_CALL(D_ZM_STR)

        CALL_(WaitEnter)
        ROM_CALL(CLEARLCD)

        ld a,11
        ld (player1x),a
        ld a,11
        ld (player1y),a

        JUMP_(TheGame)

setup2:
        ld a,90
        ld (enemy1x),a
        ld a,11
        ld (enemy1y),a

        ld a,78
        ld (enemy2x),a
        ld a,28
        ld (enemy2y),a

        ld a,14
        ld (enemy3x),a
        ld a,52
        ld (enemy3y),a

        ld a,1
        ld (en1s),a
        ld a,1
        ld (en2s),a
        ld a,1
        ld (en3s),a

        ld a,0
        ld (totalkilled),a

        JUMP_(postsetup)


setup3:
        ld a,88
        ld (enemy1x),a
        ld a,11
        ld (enemy1y),a

        ld a,72
        ld (enemy2x),a
        ld a,32
        ld (enemy2y),a

        ld a,36
        ld (enemy3x),a
        ld a,36
        ld (enemy3y),a

        ld a,1
        ld (en1s),a
        ld a,1
        ld (en2s),a
        ld a,1
        ld (en3s),a

        ld a,0
        ld (totalkilled),a

        JUMP_(postsetup)



CheckPlat:
        ld a,(player1x)
        ld B,a
        ld a,(player1y)
        ld C,a

        dec C
        CALL_(GetPixel)
        or 0
        CALL_Z(FallLoop)

        ret


FallLoop:
Floop:
        CALL_(ErasePlayer)
        ld a,(player1y)
        dec a
        ld (player1y),a
        CALL_(DrawPlayer)
        CALL_(DrawPlayfield)
        ld a,(player1x)
        ld B,a
        ld a,(player1y)
        ld C,a
        CALL_(GetPixel)
        or 0
        JUMP_Z(Floop)

        ld a,b
        ld (player1x),a
        ld a,c
        ld (player1y),a
        ret






;-----------------------------------------------;
;               DRAW THE PLAYER                 ;
;-----------------------------------------------;

DrawPlayer:
                
        ld a,(player1d)
        cp 2                    ;moving right
        JUMP_Z(drawdir1)        ;yep.
        cp 1                    ;moving left
        JUMP_Z(drawdir2)        ;yep.
donedrawing:
        ret                     ;back to loop!

drawdir1:
        ld a,(player1x)
        ld B,a                  ;load x position
        ld a,(player1y)
        ld C,a                  ;load y position

        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        dec B
        inc C
        CALL_(PlotPixel)
        inc C
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc C
        inc B
        inc B
        inc B
        inc B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        inc C
        dec B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc C
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        dec B
        inc C
        CALL_(PlotPixel)
        dec B
        dec B
        dec B
        CALL_(PlotPixel)
        dec C
        CALL_(PlotPixel)

        JUMP_(donedrawing)      ;whooh.  we're done!


drawdir2:
        ld a,(player1x)
        ld B,a                  ;load x position
        ld a,(player1y)
        ld C,a                  ;load y position

        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        inc B
        inc C
        CALL_(PlotPixel)
        inc C
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        inc C
        dec B
        dec B
        dec B
        dec B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc C
        inc B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        inc C
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        inc B
        inc C
        CALL_(PlotPixel)
        inc B
        inc B
        inc B
        CALL_(PlotPixel)
        dec C
        CALL_(PlotPixel)

        JUMP_(donedrawing)      ;whooh.  we're done!




;-----------------------------------------------;
;              ERASE THE PLAYER                 ;
;-----------------------------------------------;

ErasePlayer:
        ld a,(player1d)
        cp 2                    ;moving right?
        JUMP_Z(erasedir1)       ;yep.
        cp 1                    ;moving left?
        JUMP_Z(erasedir2)       ;yep.
doneeraseing:
        ret                     ;back to loop!

erasedir1:
        ld a,(player1x)
        ld B,a                  ;load x position
        ld a,(player1y)
        ld C,a                  ;load y position

        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        dec B
        inc C
        CALL_(ErasePixel)
        inc C
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc C
        inc B
        inc B
        inc B
        inc B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        inc C
        dec B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc C
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        dec B
        inc C
        CALL_(ErasePixel)
        dec B
        dec B
        dec B
        CALL_(ErasePixel)
        dec C
        CALL_(ErasePixel)

        JUMP_(doneeraseing)      ;whooh.  we're done!


erasedir2:
        ld a,(player1x)
        ld B,a                  ;load x position
        ld a,(player1y)
        ld C,a                  ;load y position

        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        inc B
        inc C
        CALL_(ErasePixel)
        inc C
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        inc C
        dec B
        dec B
        dec B
        dec B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc C
        inc B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        inc C
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        inc B
        inc C
        CALL_(ErasePixel)
        inc B
        inc B
        inc B
        CALL_(ErasePixel)
        dec C
        CALL_(ErasePixel)

        JUMP_(doneeraseing)      ;whooh.  we're done!





CheckWin:
        ld a,(totalkilled)
        cp 3
        JUMP_Z(passed1)
        cp 4
        JUMP_Z(passed1)
        cp 5
        JUMP_Z(passed1)
        cp 6
        JUMP_Z(passed1)
        cp 7
        JUMP_Z(passed1)
        cp 8
        JUMP_Z(passed1)
        cp 9
        JUMP_Z(passed1)

        JUMP_(AfterWinCheck)

passed1:
        ld a,(en1s)
        cp 1
        JUMP_NZ(passed2)

        JUMP_(AfterWinCheck)

passed2:
        ld a,(en2s)
        cp 1
        JUMP_NZ(passed3)

        JUMP_(AfterWinCheck)

passed3:
        ld a,(en3s)
        cp 1
        JUMP_NZ(NextLevel)

        JUMP_(AfterWinCheck)
HandleEnemies:

        ld a,(en1s)
        cp 1
        CALL_Z(doen1)

        ld a,(en2s)
        cp 1
        CALL_Z(doen2)

        ld a,(en3s)
        cp 1
        CALL_Z(doen3)

        ret

doen1:
        ld a,(enemy1x)
        ld b,a
        ld a,(enemy1y)
        ld c,a
        CALL_(EraseEnemy)

        CALL_(MoveEnemy1)

        ld a,(enemy1x)
        ld b,a
        ld a,(enemy1y)
        ld c,a
        CALL_(DrawEnemy)
        ret

doen2:
        ld a,(enemy2x)
        ld b,a
        ld a,(enemy2y)
        ld c,a
        CALL_(EraseEnemy)

        CALL_(MoveEnemy2)

        ld a,(enemy2x)
        ld b,a
        ld a,(enemy2y)
        ld c,a
        CALL_(DrawEnemy)
        ret

doen3:
        ld a,(enemy3x)
        ld b,a
        ld a,(enemy3y)
        ld c,a
        CALL_(EraseEnemy)

        CALL_(MoveEnemy3)

        ld a,(enemy3x)
        ld b,a
        ld a,(enemy3y)
        ld c,a
        CALL_(DrawEnemy)
        ret
        
DrawEnemy:
        

        CALL_(PlotPixel)
        inc C
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        inc B
        CALL_(PlotPixel)
        dec C
        inc B
        CALL_(PlotPixel)
        inc C
        inc C
        CALL_(PlotPixel)
        inc C
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec B
        CALL_(PlotPixel)
        dec C
        dec B
        CALL_(PlotPixel)

        ret

EraseEnemy:

        CALL_(ErasePixel)
        inc C
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        inc B
        CALL_(ErasePixel)
        dec C
        inc B
        CALL_(ErasePixel)
        inc C
        inc C
        CALL_(ErasePixel)
        inc C
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec B
        CALL_(ErasePixel)
        dec C
        dec B
        CALL_(ErasePixel)

        ret


MoveEnemy1:
        ld a,(enemy1x)
        ld b,a
        ld a,(enemy1y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(turnaround1)
at1:
        ld a,(enemy1d)
        cp 1
        JUMP_Z(mright1)
        cp 2
        JUMP_Z(mleft1)

afterturn1:
        ret

mleft1:
        ld a,(enemy1x)
        dec a
        ld (enemy1x),a
        JUMP_(afterturn1)

mright1:
        ld a,(enemy1x)
        inc a
        ld (enemy1x),a
        JUMP_(afterturn1)

turnaround1:
        ld a,(enemy1d)
        cp 1
        JUMP_Z(enemy1d12)
        cp 2
        JUMP_Z(enemy1d11)

enemy1d12:
        ld a,2
        ld (enemy1d),a
        JUMP_(at1)

enemy1d11:
        ld a,1
        ld (enemy1d),a
        JUMP_(at1)


MoveEnemy2:
        ld a,(enemy2x)
        ld b,a
        ld a,(enemy2y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(turnaround2)
at2:
        ld a,(enemy2d)
        cp 1
        JUMP_Z(mright2)
        cp 2
        JUMP_Z(mleft2)

afterturn2:
        ret

mleft2:
        ld a,(enemy2x)
        dec a
        ld (enemy2x),a
        JUMP_(afterturn2)

mright2:
        ld a,(enemy2x)
        inc a
        ld (enemy2x),a
        JUMP_(afterturn2)

turnaround2:
        ld a,(enemy2d)
        cp 1
        JUMP_Z(enemy2d22)
        cp 2
        JUMP_Z(enemy2d21)

enemy2d22:
        ld a,2
        ld (enemy2d),a
        JUMP_(at2)

enemy2d21:
        ld a,1
        ld (enemy2d),a
        JUMP_(at2)


MoveEnemy3:
        ld a,(enemy3x)
        ld b,a
        ld a,(enemy3y)
        ld c,a
        dec C
        CALL_(GetPixel)
        or 0
        JUMP_Z(turnaround3)
at3:
        ld a,(enemy3d)
        cp 1
        JUMP_Z(mright3)
        cp 2
        JUMP_Z(mleft3)

afterturn3:
        ret

mleft3:
        ld a,(enemy3x)
        dec a
        ld (enemy3x),a
        JUMP_(afterturn3)

mright3:
        ld a,(enemy3x)
        inc a
        ld (enemy3x),a
        JUMP_(afterturn3)

turnaround3:
        ld a,(enemy3d)
        cp 1
        JUMP_Z(enemy3d32)
        cp 2
        JUMP_Z(enemy3d31)

enemy3d32:
        ld a,2
        ld (enemy3d),a
        JUMP_(at3)

enemy3d31:
        ld a,1
        ld (enemy3d),a
        JUMP_(at3)


Delay:
        push af
        push bc
        ld a,$FF
        ld b,$7F
delayloop:
        dec a
        jr nz,delayloop
        dec b
        jr nz,delayloop
        pop af
        pop bc
        ret




Hline:
        CALL_(PlotPixel)
        inc B

        ld a,127
        cp B
        ret z

        JUMP_(Hline)

;PlotPixel, ErasePixel, GetPixel all written by Magnus Hagander...


PlotPixel:
        ROM_CALL(FIND_PIXEL)
        ld de,$FC00
        add hl,de
        or (HL)
        ld (HL),a
        ret


ErasePixel:
        ROM_CALL(FIND_PIXEL)
        ld de,$FC00
        add hl,de
        xor 255
        and (HL)
        ld (HL),a
        ret

GetPixel:
   push bc
   ROM_CALL(FIND_PIXEL)
   ld   de,$FC00
   add  hl,de
   and  (hl)    ;ACC is ACC AND the memory, meaning 0 if not correct...
   pop  bc
   ret

QuitScreen:
        ROM_CALL(CLEARLCD)
        ld hl,$092E
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,thanks1
        add hl,de
        ROM_CALL(D_ZM_STR)
        ld hl,$302A
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,thanks2
        add hl,de
        ROM_CALL(D_ZM_STR)
        ld hl,$3A20
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,thanks3
        add hl,de
        ROM_CALL(D_ZM_STR)

quitkeyloop:
        call GET_KEY
        cp $37
        JUMP_Z(WarpOut)
        cp $9
        JUMP_Z(TheEnd)
        JUMP_(quitkeyloop)



LoserScreen:
        ROM_CALL(CLEARLCD)
        ld hl,$192F
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,loserstr
        add hl,de
        ROM_CALL(D_ZM_STR)
        CALL_(WaitEnter)
        JUMP_(QuitScreen)

WinnerScreen:
        ROM_CALL(CLEARLCD)
        ld hl,$192F
        ld ($8333),hl
        ld hl,(PROGRAM_ADDR)
        ld de,winnerstr
        add hl,de
        ROM_CALL(D_ZM_STR)
        CALL_(WaitEnter)
        JUMP_(QuitScreen)

;ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP ZCP 
TitleStart:
        ld      HL,(PROGRAM_ADDR)
        ld      DE,TitleZCP
        add     HL,DE
        push    HL
        ROM_CALL(CLEARLCD)
        ld      B,$00
        ld      C,$3F
Loop:
        pop     HL
        ld      DE,$0001
        add     HL,DE
        push    HL
        ld      A,(HL)
        cp      $00
        jr      Z,EndDecode             
        ld      (Data),A
        bit     7,A
        jr      NZ,Copy
Stream:
        ld      A,(Data)
        and     $3F
        ld      (Count),A
StreamLoop:
        ld      A,(Data)
        bit     6,A
        CALL_NZ(PointOn)
        CALL_(ChangeBC)
        ld      A,(Count)
        dec     A
        jr      Z,Loop
        ld      (Count),A
        jr      StreamLoop
Copy:
        ld      A,$07
        ld      (Count),A
CopyLoop:
        ld      A,(Data)
        rla
        ld      (Data),A
        bit     7,A
        CALL_NZ(PointOn)
        CALL_(ChangeBC)
        ld      A,(Count)
        dec     A
        jr      Z,Loop
        ld      (Count),A
        jr      CopyLoop
EndDecode:
        pop HL
        JUMP_(AfterStart)

ChangeBC:
        inc     B
        ld      A,B
        cp      $80
        ret     NZ
        ld      B,$00
        dec     C
        ret

PointOn:                             
        ROM_CALL(FIND_PIXEL)
        ld      DE,$FC00
        add     HL,DE
        or      (HL)
        ld      (HL),A
        ret



WaitEnter:
        call GET_KEY
        cp $9
        ret z
        JUMP_(WaitEnter)


TheEnd:
	ld hl, $8C40
        set 0, (hl)             ;tell zshell to recalc checksum
        ret 

WarpOut:
	ld hl, $8C40
        set 0, (hl)             ;tell zshell to recalc checksum
        ld   hl,ZS_BITS
        SET  1,(hl)             ;Tell ZShell to warp out...
                
        ret 


        



;--- ZCP encoder - Stephane JANTZEN - 12/95
;--- Beginning of ZCP data stream
TitleZCP:
        .db     $00  
ZCP:                                    
;--- ZCP encoder - Stephane JANTZEN - 12/95
;--- Beginning of ZCP data stream

      .db    $3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F,$3C,$D7,$0B,$EA,$3F,$25,$49,$0D
      .db    $49,$3F,$12,$C0,$0A,$48,$0D,$48,$0E,$D0,$38,$48,$0D,$48,$0E,$49
      .db    $0A,$4B,$2A,$C0,$87,$49,$0B,$49,$0E,$48,$0A,$4C,$A0,$F4,$16,$FE
      .db    $80,$4F,$09,$49,$0F,$49,$08,$50,$87,$4F,$0B,$FC,$81,$4F,$09,$48
      .db    $10,$49,$08,$FF,$BF,$F1,$51,$0B,$FC,$83,$F0,$BF,$C0,$9F,$FC,$0E
      .db    $49,$08,$FE,$83,$E1,$50,$0B,$F8,$87,$E0,$9F,$C0,$9F,$F8,$0D,$4A
      .db    $08,$FE,$08,$E2,$97,$48,$0B,$F8,$8F,$C0,$BF,$C0,$BF,$F8,$0E,$49
      .db    $09,$FE,$12,$FC,$88,$08,$F8,$8F,$09,$FE,$81,$48,$13,$49,$09,$49
      .db    $0F,$FC,$0E,$FC,$8F,$C0,$8F,$C0,$9F,$F8,$10,$49,$0A,$49,$A0,$08
      .db    $F8,$0D,$FC,$9F,$09,$FE,$81,$49,$13,$4A,$09,$4D,$0B,$F8,$0D,$F8
      .db    $9E,$09,$FE,$81,$48,$14,$4A,$0C,$4C,$09,$F8,$0D,$F8,$9E,$09,$FC
      .db    $83,$49,$13,$4A,$0C,$4D,$08,$F8,$0D,$F8,$9E,$09,$FC,$81,$48,$15
      .db    $4A,$10,$48,$08,$FC,$0D,$F8,$9E,$08,$FE,$81,$49,$14,$4A,$12,$DF
      .db    $C0,$BC,$0E,$F8,$9E,$08,$FE,$81,$49,$15,$4A,$14,$FC,$83,$F0,$82
      .db    $87,$C0,$F8,$83,$F0,$87,$FF,$15,$4A,$09,$C0,$87,$E0,$9E,$09,$C1
      .db    $F0,$BF,$81,$FC,$81,$4A,$A0,$0D,$49,$0A,$E0,$83,$E0,$9F,$08,$F9
      .db    $F8,$8F,$C1,$FE,$08,$4B,$12,$4B,$09,$F0,$87,$E0,$9E,$08,$4B,$80
      .db    $FC,$9F,$C0,$8F,$49,$0F,$CF,$FC,$80,$FE,$8B,$E0,$8F,$09,$4B,$80
      .db    $4F,$0A,$4D,$0C,$4E,$09,$50,$08,$F8,$83,$49,$09,$4E,$0B,$4E,$09
      .db    $DF,$FF,$09,$50,$09,$F8,$09,$FE,$0B,$4B,$0D,$63,$0A,$4E,$0A,$FE
      .db    $1D,$49,$0F,$61,$0A,$DF,$FE,$30,$DE,$11,$5E,$0B,$D5,$FD,$3F,$0E
      .db    $59,$3F,$28,$DF,$4D,$A0,$3F,$2A,$4F,$3F,$3F,$3F,$3F,$3F,$3F,$3F
      .db    $3F,$3F,$3F,$3F,$8F,$5C,$BF,$C3,$FE,$AB,$52,$BE,$FD,$7F,$FC,$EB
      .db    $A8,$BB,$A4,$A7,$B3,$CD,$D3,$9F,$7F,$AA,$EA,$D6,$EB,$EA,$D5,$AA
      .db    $D5,$AB,$7C,$BD,$AB,$AA,$D9,$AE,$EB,$95,$AA,$D5,$AF,$51,$BF,$67
      .db    $AD,$EA,$D6,$EB,$DB,$D5,$AA,$D5,$AB,$7F,$EB,$BA,$D5,$DA,$EE,$F5
      .db    $AA,$D5,$AA,$7F,$F9,$EE,$D5,$B6,$E8,$DE,$AB,$9B,$A6,$DF,$7F,$F3
      .db    $6E,$BF,$63,$3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F
      .db    $3F,$3F,$3F,$3F,$3F,$3F,$3D,$FA,$DF,$B3,$3F,$16,$E6,$91,$88,$A9
      .db    $A5,$94,$C0,$3F,$10,$D5,$AA,$D4,$A9,$A5,$94,$C0,$3F,$10,$D5,$BB
      .db    $98,$AD,$E5,$D8,$C0,$3F,$10,$D4,$A0,$C4,$A9,$A5,$94,$C0,$3F,$10
      .db    $D4,$AA,$D4,$A9,$A5,$94,$C0,$3F,$10,$E4,$91,$88,$BD,$A5,$D5,$C0
      .db    $00

;--- Data stream size : 512 bytes.


joustversion:   .db "version 2.0",0
thanks1:        .db "GAME OVER",0
thanks2:        .db "EXIT - warp out",0
thanks3:        .db "ENTER - back to Zshell",0

ScoreStr:       .db "Score:",0
LevelStr:       .db "Level:",0

NewLevel:      .db "NEXT LEVEL",0


loserstr:       .db "YOU LOSE!",0
winnerstr:      .db "YOU W I N !!",0



.end


