Advertisement
Guest User

Vectrex Score Font

a guest
Apr 27th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Soo.. this is basicly the same scoring system Marq helped with me
  2. ; but this time, instead of using the sloooow text routine built-in
  3. ; the Vectrex, we're using my own vector-numbers - cool, eh!
  4. ; Some things here might be not easy for beginners to understand,
  5. ; but don't worry, just cut&paste it into your code and hope it
  6. ; works :) Thanks again to Marq
  7. ; Coding and commenting by Manu / Pelikonepeijoonit
  8. ; Freeware for all VecFreaks (tm) :)
  9.  
  10.  
  11. WAITRECAL   equ $f192   ; BIOS recalibration
  12. MOVEPEN     equ $f2fc
  13. MOVEDRAW    equ $f3b7
  14. INTENSITY   equ $f2ab
  15. RESET0REF   equ $f354
  16.  
  17. pojot       equ $c880   ; Score variable, needs 2 bytes of RAM.
  18.  
  19.     org 0
  20.     fcb $67,$20
  21.     fcc "GCE MANU"
  22.     fcb $80
  23.     fdb musa,$f850,$30b8
  24.     fcc "SCOREFONT"
  25.     fcb $80,$0    
  26.  
  27.     ldd #0          ; Set score to 0
  28.     std pojot
  29.  
  30. displayscore
  31.  
  32.     jsr WAITRECAL
  33.     lda #70         ; Set intensity
  34.     jsr INTENSITY       ; as 70 (pretty bright)
  35.  
  36. ;----------Thousands
  37.  
  38.     jsr RESET0REF
  39.     lda #0          ; Set Y-coordinate
  40.     ldb #0          ; Set X-coordinate
  41.     jsr MOVEPEN         ; Move pen to Y,X
  42.  
  43.     lda pojot       ; High byte of the word
  44.     tfr a,b         ; b=a
  45.     lsra            ; High nibble of the byte
  46.     lsra            ; Logical shift right (divide by 2)
  47.     lsra
  48.     lsra            ; 4*lsra shifts a nibble to right
  49.  
  50.     lsla            ; Double the A to get a word.
  51.     ldx #table      ; Loads the
  52.     ldx a,x         ; vector list for this frame.
  53.  
  54.     lda #5          ; Number of vectors.
  55.     ldb #20         ; Set the scale.
  56.     jsr MOVEDRAW        ; Draw the vectors.
  57.  
  58. ; ---------Hundreds
  59.  
  60.     jsr RESET0REF
  61.     lda #0          ; Set Y-coordinate
  62.     ldb #10         ; Set X-coordinate
  63.     jsr MOVEPEN         ; Move pen to Y,X
  64.  
  65.     lda pojot       ; High byte of the word
  66.     tfr a,b         ; b=a
  67.  
  68.     anda #15        ; Low nibble
  69.  
  70.     lsla            ; Double the A to get a word.
  71.     ldx #table      ; Loads the
  72.     ldx a,x         ; vector list for this frame.
  73.  
  74.     lda #5          ; Number of vectors.
  75.     ldb #20         ; Set the scale.
  76.     jsr MOVEDRAW        ; Draw the vectors.
  77.  
  78. ; ---------Tens
  79.  
  80.     jsr RESET0REF
  81.     lda #0          ; Set Y-coordinate
  82.     ldb #20         ; Set X-coordinate
  83.     jsr MOVEPEN         ; Move pen to Y,X
  84.  
  85.     lda pojot+1         ; Low byte of the word
  86.     tfr a,b
  87.     lsra            ; High nibble of the byte
  88.     lsra
  89.     lsra
  90.     lsra
  91.  
  92.     lsla            ; Double the A to get a word.
  93.     ldx #table      ; Loads the
  94.     ldx a,x         ; vector list for this frame.
  95.  
  96.     lda #5          ; Number of vectors.
  97.     ldb #20         ; Set the scale.
  98.     jsr MOVEDRAW        ; Draw the vectors.
  99.  
  100. ; ---------Ones
  101.  
  102.     jsr RESET0REF
  103.     lda #0          ; Set Y-coordinate
  104.     ldb #30         ; Set X-coordinate
  105.     jsr MOVEPEN         ; Move pen to Y,X
  106.  
  107.     lda pojot+1         ; Low byte of the word
  108.     tfr a,b
  109.  
  110.     anda #15        ; Low nibble
  111.  
  112.     lsla            ; Double the A to get a word.
  113.     ldx #table      ; Loads the
  114.     ldx a,x         ; vector list for this frame.
  115.  
  116.     lda #5          ; Number of vectors.
  117.     ldb #20         ; Set the scale.
  118.     jsr MOVEDRAW        ; Draw the vectors.
  119.  
  120. ; ---------
  121.  
  122.     lda pojot+1
  123.     adda #$1        ; Add a point
  124.     daa
  125.     tfr a,b
  126.     lda pojot
  127.     adca #0
  128.     daa
  129.     std pojot
  130.  
  131. ; ---------
  132.  
  133.     bra displayscore
  134.  
  135. ; ---------
  136.  
  137. ; Pointers
  138.  
  139. table   fcw     nolla,yksi,kaksi,kolme,nelja,viisi,kuusi,seits,kahde,yhdek
  140.  
  141. ; Vectorlists
  142. ; All these have 5 vectors, though with all they wouldn't be necessary
  143. ; It was just a shortcut so I wouldn't need to make another table to
  144. ; determine how many vectors there is in each number... not that difficult
  145. ; to do, but this was just meant to be a simple thing, so..
  146.  
  147. nolla   fcb 0,0,40,0,0,40,-40,0,0,-40,40,40     ; 5ok
  148. yksi    fcb 0,40,8,0,8,0,8,0,16,0,-8,-8         ; 5ok
  149. kaksi   fcb 40,0,0,40,-20,0,0,-40,-20,0,0,40    ; 5ok
  150. kolme   fcb 0,0,0,40,20,-20,20,20,0,-20,0,-20   ; 5ok
  151. nelja   fcb     0,24,40,0,-24,-24,0,16,0,16,0,8     ; 5ok
  152. viisi   fcb     0,0,0,40,20,0,0,-40,20,0,0,40       ; 5ok
  153. kuusi   fcb     40,40,0,-40,-40,0,0,40,20,0,0,-40   ; 5ok
  154. seits   fcb     32,0,8,0,0,8,0,12,0,20,-40,-40      ; 5ok
  155. kahde   fcb     0,0,0,20,0,20,40,-40,0,40,-40,-40   ; 5ok
  156. yhdek   fcb     0,0,0,40,40,0,0,-40,-20,0,0,40      ; 5ok
  157.  
  158.  
  159. musa    fdb     $fee8,$fbe6                 ; Silent music
  160.     fcb     $0,$80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement