; A simple example of how to use tables in ; 6809 for Vectrex (by Manu/PKP - man@sci.fi) ; Public domain for all the VecFreaks ; Thanks again to Marq WAITRECAL equ $f192 MOVEPEN equ $f2fc MOVEDRAW equ $f3b7 INTENSITY equ $f2ab RESET0REF equ $f354 ; ### Variables location equ $c881 ; A variable for location time equ $c882 ; A variable for time ; ### The basic init block org 0 fcb $67,$20 fcc "GCE MANU" fcb $80 fdb musa,$f850,$30b8 fcc "TABLE" fcb $80,$0 ; ### Actual program clra ; Reset time sta location ; and location sta time ; just to make sure. frame1 jsr WAITRECAL ; Resets the BIOS jsr RESET0REF ; lda #100 ; Set intensity jsr INTENSITY ; as 100 (pretty bright) ldx #table ; Table into x lda location ; Location into a lda a,x ; Get Y-coordinate ; from location a in table ldb #0 ; Set X-coordinate jsr MOVEPEN ; Move pen to Y,X ldx #viiva ; Gets the coordinates lda #4 ; Number of vector lines ldb #100 ; Scale jsr MOVEDRAW ; Draw the vectors. inc time ; Increase time by 1 lda time ; Check what time is now. cmpa #50 ; If it's not 50, then bne frame1 ; draw again, otherwise ; continue. inc location ; Increase location by 1 clra ; Clear A sta time ; Reset time lda location ; Check what location is now. cmpa #5 ; If it's not 5, then bne frame1 ; jump back to start. clra ; But if it is 5, then sta location ; reset it bra frame1 ; jump back to start. table ; The Y-coordinates fcb 120,60,0,-120,-60 viiva ; Vectorlist for the little box fcb -10,-10,20,0,0,20,-20,0,0,-20 musa ; Silent music fdb $fee8,$fbe6 fcb $28,$08,$0,$80