|
Post by pierreboberg on Nov 12, 2020 2:53:53 GMT -5
Hi, trying to do a simple rutine to print 4 dotes using Indexed addressing. 1 dot on 0,0 1 dot on 2,2 1 dot on 4,4 and 1 dot on 8,8. And I need to reset the "pen" . Where am I thinking wrong? :-) (Print Hello is only to check the branch i working)
Regards Pierre
; here the cartridge program starts off
LDA #0
STA $C900
STA $C910
LDA #2
STA $C901
STA $C911
LDA #4
STA $C902
STA $C912
LDA #8
STA $C903
STA $C913
LDA $FE
STA $C904
main:
JSR Wait_Recal ; Vectrex BIOS recalibration
JSR Intensity_5F ; Sets the intensity of the
; vector beam to $5f
LDY $C900
LDX $C910
draw:
JSR Reset0Ref
LDA ,Y+
CMPA $FE
BEQ done
LDB ,X+
JSR Dot_d
BRA draw
done:
LDU #hello ; address of string
LDA #$10 ; Text position relative Y
LDB #-$50 ; Text position relative X
JSR Print_Str_d ; Vectrex BIOS print routine
BRA main ; and repeat forever
hello:
DB "HELLO"
DB $80
|
|
|
Post by kokovec on Nov 13, 2020 16:45:55 GMT -5
It's been a while since I've drawn dots but from what I remember.. First you have to set the scale factor.
LDB #$[scale] STB <VIA_t1_cnt_lo ;Set scale factor
After Reset0Ref I believe you need to move the pen with something like
ldd #00 jsr Moveto_d
You may also need to add a short delay after calling Reset0Ref to allow the integrators to "settle".
|
|
|
Post by D-Type on Nov 13, 2020 19:20:57 GMT -5
Here's a Forth test word I wrote to display dots using all the different dot drawing BIOS functions.
It might look unfamiliar, but the first 5 or 7 lines will give you the basic idea of what works for me.
\ Dot drawing tests. : dots \ -- ; begin _Wait_Recal $40 VIA_t1_cnt_lo c! \ Set scaling factor _Intensity_5F \ Set intensity, works with default dwell value
\ Display four dots, starting from centre, moving in a line right and up _Dot_here \ Dot in centre of screen
$10 8 _Dot_d \ Dot $10 right, $8 up from previous dot
$1020 pad ! \ Setup yx co-ord parameter in pad pad _Dot_ix \ Dot $20 right, $10 up from previous dot
$2040 pad ! \ Setup yx co-ord parameter in pad 5 pad _Dot_ix_b \ Dot $40 right, $20 up, with dwell 5
\ Displays an approximate mirrored version of Ursa Major _Reset0Ref DOTS_LIST_PACKET _Dot_List_Reset \ Display dot list, using terminator
\ Displays an approximate mirrored version of Ursa Major, 2nd time _Reset0Ref 6 Vec_Misc_Count c! \ 7 dots total, starting from 0 DOTS_LIST _Dot_List \ Display dot list, using counter
key? until key drop ;
|
|
|
Post by Malban on Nov 15, 2020 12:10:06 GMT -5
Simple answer:
The loading of the x/y registers is "extended" not "immediate"...
LDY $C900 LDX $C910
must be
LDY #$C900 LDX #$C910
Cheers
|
|
|
Post by kokovec on Nov 15, 2020 13:40:56 GMT -5
I wonder if Malban could hear the sound of my hand slapping my forehead from Germany?
|
|
|
Post by pierreboberg on Nov 16, 2020 3:21:48 GMT -5
Malban thank you :-) that solved the problem.
|
|