Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Soo.. this is basicly the same scoring system Marq helped with me
- ; but this time, instead of using the sloooow text routine built-in
- ; the Vectrex, we're using my own vector-numbers - cool, eh!
- ; Some things here might be not easy for beginners to understand,
- ; but don't worry, just cut&paste it into your code and hope it
- ; works :) Thanks again to Marq
- ; Coding and commenting by Manu / Pelikonepeijoonit
- ; Freeware for all VecFreaks (tm) :)
- WAITRECAL equ $f192 ; BIOS recalibration
- MOVEPEN equ $f2fc
- MOVEDRAW equ $f3b7
- INTENSITY equ $f2ab
- RESET0REF equ $f354
- pojot equ $c880 ; Score variable, needs 2 bytes of RAM.
- org 0
- fcb $67,$20
- fcc "GCE MANU"
- fcb $80
- fdb musa,$f850,$30b8
- fcc "SCOREFONT"
- fcb $80,$0
- ldd #0 ; Set score to 0
- std pojot
- displayscore
- jsr WAITRECAL
- lda #70 ; Set intensity
- jsr INTENSITY ; as 70 (pretty bright)
- ;----------Thousands
- jsr RESET0REF
- lda #0 ; Set Y-coordinate
- ldb #0 ; Set X-coordinate
- jsr MOVEPEN ; Move pen to Y,X
- lda pojot ; High byte of the word
- tfr a,b ; b=a
- lsra ; High nibble of the byte
- lsra ; Logical shift right (divide by 2)
- lsra
- lsra ; 4*lsra shifts a nibble to right
- lsla ; Double the A to get a word.
- ldx #table ; Loads the
- ldx a,x ; vector list for this frame.
- lda #5 ; Number of vectors.
- ldb #20 ; Set the scale.
- jsr MOVEDRAW ; Draw the vectors.
- ; ---------Hundreds
- jsr RESET0REF
- lda #0 ; Set Y-coordinate
- ldb #10 ; Set X-coordinate
- jsr MOVEPEN ; Move pen to Y,X
- lda pojot ; High byte of the word
- tfr a,b ; b=a
- anda #15 ; Low nibble
- lsla ; Double the A to get a word.
- ldx #table ; Loads the
- ldx a,x ; vector list for this frame.
- lda #5 ; Number of vectors.
- ldb #20 ; Set the scale.
- jsr MOVEDRAW ; Draw the vectors.
- ; ---------Tens
- jsr RESET0REF
- lda #0 ; Set Y-coordinate
- ldb #20 ; Set X-coordinate
- jsr MOVEPEN ; Move pen to Y,X
- lda pojot+1 ; Low byte of the word
- tfr a,b
- lsra ; High nibble of the byte
- lsra
- lsra
- lsra
- lsla ; Double the A to get a word.
- ldx #table ; Loads the
- ldx a,x ; vector list for this frame.
- lda #5 ; Number of vectors.
- ldb #20 ; Set the scale.
- jsr MOVEDRAW ; Draw the vectors.
- ; ---------Ones
- jsr RESET0REF
- lda #0 ; Set Y-coordinate
- ldb #30 ; Set X-coordinate
- jsr MOVEPEN ; Move pen to Y,X
- lda pojot+1 ; Low byte of the word
- tfr a,b
- anda #15 ; Low nibble
- lsla ; Double the A to get a word.
- ldx #table ; Loads the
- ldx a,x ; vector list for this frame.
- lda #5 ; Number of vectors.
- ldb #20 ; Set the scale.
- jsr MOVEDRAW ; Draw the vectors.
- ; ---------
- lda pojot+1
- adda #$1 ; Add a point
- daa
- tfr a,b
- lda pojot
- adca #0
- daa
- std pojot
- ; ---------
- bra displayscore
- ; ---------
- ; Pointers
- table fcw nolla,yksi,kaksi,kolme,nelja,viisi,kuusi,seits,kahde,yhdek
- ; Vectorlists
- ; All these have 5 vectors, though with all they wouldn't be necessary
- ; It was just a shortcut so I wouldn't need to make another table to
- ; determine how many vectors there is in each number... not that difficult
- ; to do, but this was just meant to be a simple thing, so..
- nolla fcb 0,0,40,0,0,40,-40,0,0,-40,40,40 ; 5ok
- yksi fcb 0,40,8,0,8,0,8,0,16,0,-8,-8 ; 5ok
- kaksi fcb 40,0,0,40,-20,0,0,-40,-20,0,0,40 ; 5ok
- kolme fcb 0,0,0,40,20,-20,20,20,0,-20,0,-20 ; 5ok
- nelja fcb 0,24,40,0,-24,-24,0,16,0,16,0,8 ; 5ok
- viisi fcb 0,0,0,40,20,0,0,-40,20,0,0,40 ; 5ok
- kuusi fcb 40,40,0,-40,-40,0,0,40,20,0,0,-40 ; 5ok
- seits fcb 32,0,8,0,0,8,0,12,0,20,-40,-40 ; 5ok
- kahde fcb 0,0,0,20,0,20,40,-40,0,40,-40,-40 ; 5ok
- yhdek fcb 0,0,0,40,40,0,0,-40,-20,0,0,40 ; 5ok
- musa fdb $fee8,$fbe6 ; Silent music
- fcb $0,$80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement