Quote:
|
>>
i have:
vpoke yy*128+xx/2,&Hf0
but, when i do :
pset (xx+1,yy),13
i see that the purple dot is not always x+1 relative to the vpoke.
there are occasions where i need to use &h0f instead of &hf0.
that's the problem now.
|
Seems like you know the answer!
It's the &HF0 and &H0F that make the difference..
&HF0 puts a pixel on offset+0
&H0F puts a pixel on offset+1
remember with vpoke you will address 2(!) positions at once
that's why you've gotta READ the original value first to keep save one of them
pixels. you need to check the X position for which nibble to use
(if X=even, vpoke &HF0 else if X=odd, vpoke &H0F)
example: to put a pixel on position (10,10) using the vpoke trick in pseudo code
<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="mrc-small">Code:</font><HR></TD></TR><TR><TD><FONT class="mrc-small"><PRE>
x=10
y=10
adr = 128xY+ x/2
org = vpeek (adr) ; here you read the original value
if (X AND 1)=0 -> vpoke (adr), (org AND &H0F) OR &HF0 ; even
else
if (X AND 1)=1 -> vpoke (adr), (org AND &HF0) or &H0F ; odd
</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>
with the (X AND 1) you can check if it's even or odd (using bit 0 of the X pos)
hope you get it. good luck