Hello to All...
With the joystick, I move a pixel all over the screen.
X=0/319; y=0/199. Everything is working fine.
Rather than test screen outputs X0 & X>319; Y0 & Y>199
I decide to draw a frame in 0,0/319,199 and test if the X,Y coordinate is already an active pixel.
In basic I used this formula:
10 l=1:fori=0to7:ma%(i)=l:l=l*2:next
20 d%=320*int(y%/8)+(y%and7)
30 e%=8*int(x%/8)
40 g%=ma%(7-(x%and7))
50 if peek(ECRAN+d%+e%) and g% then... ; Pixel is ON
60 poke ECRAN+d%+e%, peek(ECRAN+d%+e%) or g% ; activation du pixel.
----
In LM y use a graphic routine that uses tables.
.Affiche_Pixel
!byte $80,$40,$20,$10,$08,$04,$02,$01
SetPixel
ldx x1
ldy y1
Adr...
Addr...
... ; Calculation of address with tables...
sty Tmp0
PixOn; active le pixel
ldy Tmp0
lda .Affiche_Pixel,y
ldy Adr
ora (Addr),y
sta (Addr),y
rts
-----
So before I display the pixel I test if the bit is already active.
ldy Tmp0
lda .Affiche_Pixel,y
sta Tmp1
ldy Adr
lda (Addr),y
and #Tmp1 ;(????)
bne PixOn
...
rts
PixOn
...
rts
-----
I’ve made several variations, but I can’t do anything.
If someone could give me a little help... Thank you.