[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Assembly routine to tell if a hires pixel is currently set?
Rich J. wrote:
mjmahon@aol.com (Michael J. Mahon) wrote in message news:<20040112174003.21847.00001619@mb-m19.aol.com>...
From Applesoft, you can code a 1-move shape table and XPLOT to the
location, then check the collision detect flag.
I have often used this method, and it is fast and simple.
There are many interesting uses for the one-move shape!
Can someone describe this method in more detail, and perhaps
include source code?
Rich
http://rich12345.tripod.com
aiiadict AT hotmail DOT com
I just tried this out, courtesy of KEGS on linux... :)
(Thanks Kent!)
] CALL -151
* 6000: 1 0 4 0 4 0
* e8: 0 60
* <Control>-C
] HGR
] HCOLOR=3
] SCALE=1
] ROT=0
] DRAW 1 AT 139,79
you will see a pixel in the middle of the screen
] XDRAW 1 AT 139,79
now the screen is all black again
] PRINT PEEK(234)
0
] XDRAW 1 AT 139,79
the dot is there again
] PRINT PEEK(234)
1
If you set the scale higher, say to 10, and ten pixels were filled
in, you'd get 10 returned by PRINT PEEK(234).
So, you see that the contents of 234, the collision counter, are
the number of pixels that were lit, or something like that. Play
with it a bit with some more complex shapes.
To do the scrn() function, simply XDRAW the one-pixel shape table
given here twice in the same place, and check memory location 234
after the second time. If it's 1, the pixel was set, and if it's
0, the pixel was not set.
Jerry (awanderin at yahoo dot ca)