include "vectrex.i" VIA_port_B_data_IO_reg EQU $D000 ; DP accessed VIA_port_A_data_IO_reg EQU $D001 ; DP accessed VIA_port_B_data_dir_reg EQU $D002 ; DP accessed VIA_port_A_data_dir_reg EQU $D003 ; DP accessed VIA_timer_1_count_reg EQU $D004 ; DP accessed VIA_timer_1_count_reg_hi EQU $D005 ; DP accessed VIA_timer_1_latch_reg_lo EQU $D006 ; DP accessed VIA_timer_1_latch_reg_hi EQU $D007 ; DP accessed VIA_timer_2_count_lreg_lo EQU $D008 ; DP accessed VIA_timer_2_count_lreg_hi EQU $D009 ; DP accessed VIA_shift_reg EQU $D00A ; DP accessed VIA_auxiliary_control_reg EQU $D00B ; DP accessed VIA_control_reg EQU $D00C ; DP accessed VIA_interrupt_flags_reg EQU $D00D ; DP accessed VIA_interrupt_enable_reg EQU $D00E ; DP accessed VIA_port_A_data_IO_reg_nh EQU $D00F ; DP accessed ;############################################# ;############################################# ;############################################# buffer EQU $c888 ; drawMazeVectorSpeedYX EQU buffer mazeVectorSize EQU drawMazeVectorSpeedYX+2 ;############################################# ;############################################# ;############################################# ORG $0000 ; start address of all vectrex progs -> 0 ; Magic Init Block FCB $67,$20 ; copyright sign and space FCC "GCE XXXX" ; copyright text, must start with copyright sign space GCE FCB $80 ; end of text marker FDB music1 ; music address to be played on title screen FDB $f850 ; text size for following text height, width (A,B) FDB $30b8 ; position of following text y,x (A,B) FCC "MAZE TEST" ; text FCB $80,$0 ; text end ($80) and header end (0) direct $d0 ; vectrex starts with dp set to $d0 init: ; start of program ; * ; * Vertical outer Walls ; * JSR Wait_Recal jsr Intensity_5F ; brightness to $5f ldd #$AB00 ; y,x speed of vector draw in maze std >drawMazeVectorSpeedYX lda #$13 ; y size of maze vector lists sta >mazeVectorSize * OUTER VERTICAL Maze is positioned with Scale $80, speed #56 * see subroutine "DrawVerticalOuterWall" * ldb #$A9 ; Starting Right X position of outer Maze (far right) jsr >DrawVerticalOuterWall ; Draw first (right) vertical outer wall jsr >Delay_0 ; Delay 12 Cycles ldb #$56 ; Starting Left X position of outer Maze (far left) jsr >DrawVerticalOuterWall ; Draw second (left) vertical outer wall ; * ; * Horizontal maze stripes ; * ldy #StartYPosForHorizontalInnerMaze ; X Position (left) of first "inner" vertical wall ldd #$00AB ; y,x speed of vector draw in maze std >drawMazeVectorSpeedYX lda #$0F ; x size of maze vector list sta >mazeVectorSize DrawNextHorizontalMaze: lda #$78 ; scale of MoveTo position sta DrawMazeVector bra DrawNextHorizontalMaze FinishedMazeDraw: jmp init ;############################################# ;############################################# ;############################################# DrawVerticalOuterWall: lda #$80 ; scale of "MoveTo" sta DrawMazeVector rts ; In $c8C9 length of vector Data ; in D position to move to ; resets to Zero after work ; In X Pointer to Vector Data (Shift Update data) DrawMazeVector: sta Delay_1 ; Warte (20 cycles), after timer finished, RAMP is disabled! ldd >drawMazeVectorSpeedYX ; load next vector to draw sta mazeVectorSize ; [5]load size y of maze ($13) _005E: lda ,x+ ; [6]load maze byte sta Reset0Ref ; Got to zero jsr >Delay_0 ; Delay 12 Cycles rts MazeOuterVerticalWall: DB $07 ; Left and right side are equal, this shiftreg value setup willl be reused DB $FF ; 2 DB $FF ; 3 DB $FF ; 4 DB $FF ; 5 DB $FF ; 6 DB $FF ; 7 DB $FF ; 8 DB $F8 ; 9 DB $00 ; 10 DB $07 ; 11 DB $FF ; 12 DB $FF ; 13 DB $FF ; 14 DB $FF ; 15 DB $FF ; 16 DB $FF ; 17 DB $FF ; 18 DB $F8 ; 19 StartYPosForHorizontalInnerMaze: DB $76 ; Vertical position 1 DW horizontalLine1 ; definition of Shift-Values for horizontal maze line DB $5B ; Vertical position 2 DW horizontalLine2 ; definition of Shift-Values for horizontal maze line DB $41 ; Vertical position 3 DW horizontalLine3 ; definition of Shift-Values for horizontal maze line DB $27 ; Vertical position 4 DW horizontalLine4 ; definition of Shift-Values for horizontal maze line DB $D8 ; Vertical position 5 DW horizontalLine4 ; definition of Shift-Values for horizontal maze line DB $BE ; Vertical position 6 DW horizontalLine1 ; definition of Shift-Values for horizontal maze line DB $A4 ; Vertical position 7 DW horizontalLine4 ; Ram location because of "doors" DB $89 ; Vertical position 8 DW horizontalLine1 ; definition of Shift-Values for horizontal maze line DB $00 DW $0000 ; end Pointer (0000) horizontalLine1: DB $07 DB $FF DB $FF DB $FF DB $FF DB $FF DB $F8 DB $00 DB $07 DB $FF DB $FF DB $FF DB $FF DB $FF DB $FC horizontalLine2: DB $07 DB $FF DB $F8 DB $00 DB $07 DB $FF DB $FF DB $FF DB $FF DB $FF DB $F8 DB $00 DB $07 DB $FF DB $F8 horizontalLine3: DB $00 DB $00 DB $07 DB $FF DB $FF DB $F8 DB $00 DB $00 DB $00 DB $07 DB $FF DB $FF DB $F8 DB $00 DB $00 horizontalLine4: DB $07 DB $FF DB $F8 DB $00 DB $00 DB $00 DB $07 DB $FF DB $FC DB $00 DB $00 DB $00 DB $07 DB $FF DB $F8 horizontalLine5: DB $07 DB $00 DB $F8 DB $00 DB $07 DB $FF DB $FF DB $FF DB $FF DB $FF DB $F8 DB $00 DB $07 DB $00 DB $F8 horizontalLine6: DB $B8 DB $EF DB $00 DB $A8 DB $A8 DB $00 DB $EE DB $BF DB $03 DB $2A DB $A2 DB $02 DB $EA DB $BF DB $02 DB $3A DB $E0 DB $02 DB $12 DB $20 DB $02 DB $3A DB $E0 _0FEC: DB $02 DB $EA DB $BF DB $02 DB $2A DB $A2 DB $02 DB $EE DB $BF DB $03 DB $A8 DB $A8 DB $00 DB $B8 DB $EF DB $00 DB $4D DB $49 DB $43 DB $45