Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!not-for-mail From: Jerry Newsgroups: comp.sys.apple2.programmer Subject: Re: detect character at HTAB, VTAB ( a SCRN(x,y) function for text screen) ?? Date: Fri, 29 Jun 2012 21:49:21 -0600 Organization: bbs-scene usenet news Lines: 30 Message-ID: References: <94a9d08e-dc6e-4269-8fb5-83437fb0f188@googlegroups.com> NNTP-Posting-Host: d198-53-38-88.abhsia.telus.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: technocratmedia-w1.news.bbs-scene.org 1341028161 18776 198.53.38.88 (30 Jun 2012 03:49:21 GMT) X-Complaints-To: abuse@bbs-scene.org NNTP-Posting-Date: Sat, 30 Jun 2012 03:49:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:mq2cNLbOVThamQV1N+bXld9UvKc= Xref: csiph.com comp.sys.apple2.programmer:319 aiiadict@gmail.com writes: > I didn't know what search terms to type in. > > I'd like an all applesoft (I have 6502 code) program > that will output the ascii value of the character stored > in 40 column mode X,Y position. > > > 10 vtab 10:htab 20:print "X"; > 20 y=10:x=20:gosub 1000:rem get char value > 30 print asc(g) > > X > > > 1000 rem use X and Y to determine ascii value, and > 1010 rem return in variable G You kind of had the answer in your question title: G = SCRN( X-1, (Y-1)*2 ) + 16 * SCRN( X-1, (Y-1)*2 + 1) HTAB and VTAB start counting at 1 whereas the LoRES stuff starts counting at 0, hence the "- 1" terms above. -- -- Jerry awanderin at yahoo dot ca