Posted By
rudis on 2012-04-20 14:43:37
| Re: plot a dot at x,y
found a formula to calculate the byte in wich the dot plots
xh * 256 + ( xl and 248 ) + ( y and 7 ) + ( 40 * ( y and 248 ) )
edit 19.04. 20:22.. edit 20.04..
wrote something so far. calculate byte-adress of dot to print at.
zeilenlaenge = 352 wspalte = (zeilenlaenge/2)-20
.setcpu "6502" .org $1001-2 .word $1001 .word link .word 2012 ; Zeilennummer .byte $9e ; sys-token .byte "4109" ; adresse .byte $00 ; zeilenende link: .byte $00,$00
lda #00 sta ylow lda #$20 sta yhigh ldy #0
loopy: ldx #8 iloopy: lda ylow,y clc adc #$1 sta ylow+1,y lda yhigh,y adc #0 sta yhigh+1,y iny dex cpx #0 bne iloopy
clc lda ylow,y adc #<$138 sta ylow,y lda yhigh,y adc #>$138 sta yhigh,y cpy #200 bne loopy
; Merke: Zeilen und Spalten beginnen mit 0 !!
clc ; lda xcord+1 ;\ ror ; \ lda xcord ; | ror ; |> X geteilt durch 8 ohne rest *g* lsr ; | lsr ; / sta temp1 ;/
ldy ycord ; 199 lda ylow,y clc adc temp1 sta temp2
lda yhigh,y sta temp2+1
brk
xcord: .word 319 ycord: .byte 199
temp1: .word $0000
temp2: .word $0000
xybasis: .word $2000
ylow: .repeat 200 .byte $0 .endrep
yhigh: .repeat 200 .byte $0 .endrep
|