💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › MiscInfo › Applesoft … captured on 2024-07-09 at 05:00:50.
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Path: blue.weeg.uiowa.edu!news.uiowa.edu!uunet!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!vixen.cso.uiuc.edu!news.uoregon.edu!cie-2.uoregon.edu!nparker From: nparker@cie-2.uoregon.edu (Neil Parker) Newsgroups: comp.sys.apple2.programmer Subject: Re: AppleSoft BASIC SCRN function from HiRes? Date: 2 Sep 1994 09:28:53 GMT Organization: University of Oregon Campus Information Exchange Lines: 43 Message-ID: <346r8l$g4v@pith.uoregon.edu> References: <344peo$1ma@panix2.panix.com> <345bsv$llh@crcnis1.unl.edu> NNTP-Posting-Host: cie-2.uoregon.edu In article <345bsv$llh@crcnis1.unl.edu> gberigan@cse.unl.edu (Greg Berigan) writes: >moxie@panix.com (Mark Mentovai) writes: > >>Does anyone know of a SCRN function that I can use in HiRes mode from >>Applesoft? I don't know ML programming, but if you have a tiny ML >>routine that I can call, that would be useful too, just as long as I can >>find out if a pixel is on or off. Thanks! > >There is a zero page address that might work for you. If you take a >small shape table like 1 0 4 0 4 0 and xdraw 1 at x,y:xdraw 1 at x,y, >you can peek a memory location which will tell if that pixel was on >or off (1 if on, 0 if off). >[...] >Unfortunately, I don't have this memory location on hard copy and I >am reasonably certain I don't have it on any of the disks I have with me >here. The collision counter is at location 234. The following lines will probably do what you want: 10 FOR X = 768 TO 773: READ B: POKE X,B: NEXT: DATA 1,0,4,0,20,0 20 POKE 232,0: POKE 233,3: ROT= 0: SCALE= 1 ... 100 XDRAW 1 AT X,Y: XDRAW 1:P = PEEK (234) (I changed the shape table slightly, so that the plot-and-move-up is followed immediately by a move-down-without-plotting. This makes the shape return to its starting point, eliminating the need to specify coordinates for the second XDRAW.) Line 100 will return P=0 if the point at X,Y is off, and P=1 if it's on. If you want to know not only whether or not the dot was off or on, but also what color it is, that's harder, since you also have to inspect the neighboring dots and the high bit of the dot's byte. This is probably best done in machine language...the above routine could certainly be used to do the necessary tests, but it would be painfully slow. - Neil Parker -- Neil Parker No cute ASCII art...no cute quote...no cute nparker@cie-2.uoregon.edu disclaimer...no deposit, no return... nparker@cie.uoregon.edu (This space intentionally left blank: )