Post by pierreboberg on Oct 17, 2019 3:17:35 GMT -5
Hi,
Iam a bit new of programming to Vectrex, but Ima trying to do an easy program to move a dot with the buttons, check out my attachment, where em I thingking wrong?
;***************************************************************************
; DEFINE SECTION
;***************************************************************************
include "VECTREX.I" ; vectrex function includes
Doty equ $c880
Dotx equ $c881
; start of vectrex memory with cartridge name...
org 0
;***************************************************************************
; HEADER SECTION
;***************************************************************************
db "g GCE 2016", $80 ; 'g' is copyright sign
dw music1 ; music from the rom
db $F8, $50, $20, -$70 ; height, width, rel y, rel x
; (from 0,0)
db "TEST",$80 ; some game information,
; ending with $80
db 0 ; end of game header
;***************************************************************************
; CODE SECTION
;***************************************************************************
; here the cartridge program starts off
lda #$00
sta Doty
sta Dotx
jsr Wait_Recal ; Vectrex BIOS recalibration
lda #$10 ; scaling factor of $80 to A
sta VIA_t1_cnt_lo ; move to time 1 lo, this
; means scaling
main:
jsr Read_Btns ; get one status first, for
; the difference
lda Doty ; Load (y)
ldb Dotx ; Load (x)
jsr Moveto_d ; move the vector beam the
; relative position
jsr Intensity_5F ; Sets the intensity of the
; vector beam to $5f
ldx #line_list ; load the address of the to be
; drawn vector list to X
jsr Draw_VLc ; draw the line now
jsr Read_Btns ; get button status
cmpa #$00 ; is a button pressed?
beq no_button ; no, than go on
bita #$01 ; test for button 1 1
beq button_1_1_not ; if not pressed jump
lda Doty
deca
sta Doty
button_1_1_not:
bita #$01 ; test for button 1 2
beq button_1_2_not ; if not pressed jump
ldb Doty
incb
stb Doty
button_1_2_not:
bra main
no_button:
bra main ; and repeat forever
;***************************************************************************
SPRITE_BLOW_UP equ 25
line_list:
db 5 ; number of vectors - 1
db 2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
db 0*SPRITE_BLOW_UP, 4*SPRITE_BLOW_UP
db -2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
db -2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
db 0*SPRITE_BLOW_UP, -4*SPRITE_BLOW_UP
db 2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
;***************************************************************************
end main
;***************************************************************************
Iam a bit new of programming to Vectrex, but Ima trying to do an easy program to move a dot with the buttons, check out my attachment, where em I thingking wrong?
;***************************************************************************
; DEFINE SECTION
;***************************************************************************
include "VECTREX.I" ; vectrex function includes
Doty equ $c880
Dotx equ $c881
; start of vectrex memory with cartridge name...
org 0
;***************************************************************************
; HEADER SECTION
;***************************************************************************
db "g GCE 2016", $80 ; 'g' is copyright sign
dw music1 ; music from the rom
db $F8, $50, $20, -$70 ; height, width, rel y, rel x
; (from 0,0)
db "TEST",$80 ; some game information,
; ending with $80
db 0 ; end of game header
;***************************************************************************
; CODE SECTION
;***************************************************************************
; here the cartridge program starts off
lda #$00
sta Doty
sta Dotx
jsr Wait_Recal ; Vectrex BIOS recalibration
lda #$10 ; scaling factor of $80 to A
sta VIA_t1_cnt_lo ; move to time 1 lo, this
; means scaling
main:
jsr Read_Btns ; get one status first, for
; the difference
lda Doty ; Load (y)
ldb Dotx ; Load (x)
jsr Moveto_d ; move the vector beam the
; relative position
jsr Intensity_5F ; Sets the intensity of the
; vector beam to $5f
ldx #line_list ; load the address of the to be
; drawn vector list to X
jsr Draw_VLc ; draw the line now
jsr Read_Btns ; get button status
cmpa #$00 ; is a button pressed?
beq no_button ; no, than go on
bita #$01 ; test for button 1 1
beq button_1_1_not ; if not pressed jump
lda Doty
deca
sta Doty
button_1_1_not:
bita #$01 ; test for button 1 2
beq button_1_2_not ; if not pressed jump
ldb Doty
incb
stb Doty
button_1_2_not:
bra main
no_button:
bra main ; and repeat forever
;***************************************************************************
SPRITE_BLOW_UP equ 25
line_list:
db 5 ; number of vectors - 1
db 2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
db 0*SPRITE_BLOW_UP, 4*SPRITE_BLOW_UP
db -2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
db -2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
db 0*SPRITE_BLOW_UP, -4*SPRITE_BLOW_UP
db 2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
;***************************************************************************
end main
;***************************************************************************