Archived from groups: rec.games.vectrex (More info?)
Hello!
The past week I've been carefully going through Chris Saloman's great
Vectrex programming tutorial (thanks for doing that, Chris!). I've been
having a blast trying out the bios functions, etc. I'm having trouble
understanding the bios rotating function:
Rot_VL_ab ($F610)
I basically took Chris's Vector List turtle example and tried to rotate
it in a continuous clockwise circle. Could one of you programming aces
please give this a once-over and see if there is something obvious that
I'm doing wrong? You'll notice at one point, the turtle vector is seen
fine, but gets garbled as it rotates. Perhaps the angle that I'm
storing in the A register prior to the BIOS rotate call is not as
trivial as I thought it is?
Thanks!
Scott
;***************************************************************************
; DEFINE SECTION
;***************************************************************************
INCLUDE "VECTREX.I"
xpos EQU $C800
ypos EQU $C801
ctr EQU $C802
rotate_bios_ab EQU $f610 ; this is the rotating BIOS
function
buffer EQU $C950 ; transformation buffer (the
results of the rotation on the turtle vector will go in here)
; start of vectrex memory with cartridge name...
ORG 0
;***************************************************************************
; HEADER SECTION
;***************************************************************************
DB "g GCE 1998", $80 ; 'g' is copyright sign
DW music1 ; music from the rom
DB $F8, $50, $20, -$55 ; height, width, rel y,
rel x
; (from 0,0)
DB "VECTOR LIST TEST",$80 ; some game
information,
; ending with $80
DB 0 ; end of game header
;***************************************************************************
; CODE SECTION
;***************************************************************************
; here the cartridge program starts off
LDA #0
STA xpos
STA ypos
main:
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
LDA 0
LDB 0
JSR Moveto_d ; move the vector beam
to
; 0,0
JSR Intensity_5F ; Sets the intensity of
the
; vector beam to $5f
LDX #buffer ; this is the
transformation buffer
; drawn vector list to
X
JSR Draw_VLc ; draw the Vector List
INC ctr
LDA ctr
CMPA #$03 ; once every four loops,
rotate the turtle vector list
BNE back
lda xpos ; get rotation
ldb #23 ; number of points
ldx #turtle_line_list ; address of the TURTLE
vector list
ldu #buffer ; transform buffer
jsr rotate_bios_ab ; transfer to the BIOS
rotate function
INC xpos ; increase the ANGLE to
rotate (on the next rotate call)
LDA #$00
STA ctr
back: BRA main ; and repeat forever
;***************************************************************************
SPRITE_BLOW_UP EQU 20
turtle_line_list:
DB 23 ; number of vectors - 1
DB 2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, 1*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB 0*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 1*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, 3*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 4*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 1*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -3*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB -3*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -1*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -4*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, -3*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -1*SPRITE_BLOW_UP
DB 0*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, -1*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
;***************************************************************************
END main
;***************************************************************************
Hello!
The past week I've been carefully going through Chris Saloman's great
Vectrex programming tutorial (thanks for doing that, Chris!). I've been
having a blast trying out the bios functions, etc. I'm having trouble
understanding the bios rotating function:
Rot_VL_ab ($F610)
I basically took Chris's Vector List turtle example and tried to rotate
it in a continuous clockwise circle. Could one of you programming aces
please give this a once-over and see if there is something obvious that
I'm doing wrong? You'll notice at one point, the turtle vector is seen
fine, but gets garbled as it rotates. Perhaps the angle that I'm
storing in the A register prior to the BIOS rotate call is not as
trivial as I thought it is?
Thanks!
Scott
;***************************************************************************
; DEFINE SECTION
;***************************************************************************
INCLUDE "VECTREX.I"
xpos EQU $C800
ypos EQU $C801
ctr EQU $C802
rotate_bios_ab EQU $f610 ; this is the rotating BIOS
function
buffer EQU $C950 ; transformation buffer (the
results of the rotation on the turtle vector will go in here)
; start of vectrex memory with cartridge name...
ORG 0
;***************************************************************************
; HEADER SECTION
;***************************************************************************
DB "g GCE 1998", $80 ; 'g' is copyright sign
DW music1 ; music from the rom
DB $F8, $50, $20, -$55 ; height, width, rel y,
rel x
; (from 0,0)
DB "VECTOR LIST TEST",$80 ; some game
information,
; ending with $80
DB 0 ; end of game header
;***************************************************************************
; CODE SECTION
;***************************************************************************
; here the cartridge program starts off
LDA #0
STA xpos
STA ypos
main:
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
LDA 0
LDB 0
JSR Moveto_d ; move the vector beam
to
; 0,0
JSR Intensity_5F ; Sets the intensity of
the
; vector beam to $5f
LDX #buffer ; this is the
transformation buffer
; drawn vector list to
X
JSR Draw_VLc ; draw the Vector List
INC ctr
LDA ctr
CMPA #$03 ; once every four loops,
rotate the turtle vector list
BNE back
lda xpos ; get rotation
ldb #23 ; number of points
ldx #turtle_line_list ; address of the TURTLE
vector list
ldu #buffer ; transform buffer
jsr rotate_bios_ab ; transfer to the BIOS
rotate function
INC xpos ; increase the ANGLE to
rotate (on the next rotate call)
LDA #$00
STA ctr
back: BRA main ; and repeat forever
;***************************************************************************
SPRITE_BLOW_UP EQU 20
turtle_line_list:
DB 23 ; number of vectors - 1
DB 2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, 1*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB 0*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 1*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, 3*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 4*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 1*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -3*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB -3*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -1*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, 0*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -4*SPRITE_BLOW_UP
DB 1*SPRITE_BLOW_UP, -3*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -1*SPRITE_BLOW_UP
DB 0*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, 2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, -1*SPRITE_BLOW_UP
DB -1*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
DB 2*SPRITE_BLOW_UP, -2*SPRITE_BLOW_UP
;***************************************************************************
END main
;***************************************************************************