Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #4543 > unrolled thread

Retrieve hires pixel value

Started byZellyn <zellyn@gmail.com>
First post2018-05-23 10:56 -0700
Last post2018-05-29 19:46 +0000
Articles 12 — 6 participants

Back to article view | Back to comp.sys.apple2.programmer


Contents

  Retrieve hires pixel value Zellyn <zellyn@gmail.com> - 2018-05-23 10:56 -0700
    Re: Retrieve hires pixel value D Finnigan <dog_cow@macgui.com> - 2018-05-23 18:41 +0000
    Re: Retrieve hires pixel value Michael J. Mahon <mjmahon@aol.com> - 2018-05-23 18:56 -0500
      Re: Retrieve hires pixel value Zellyn <zellyn@gmail.com> - 2018-05-23 20:52 -0700
      Re: Retrieve hires pixel value Michael Pohoreski <michael.pohoreski@gmail.com> - 2018-05-26 11:07 -0700
        Re: Retrieve hires pixel value Michael J. Mahon <mjmahon@aol.com> - 2018-05-26 16:53 -0500
          Re: Retrieve hires pixel value D Finnigan <dog_cow@macgui.com> - 2018-05-28 22:55 +0000
            Re: Retrieve hires pixel value Andy McFadden <thefadden@gmail.com> - 2018-05-29 07:59 -0700
              Re: Retrieve hires pixel value Antoine Vignau <antoine.vignau@laposte.net> - 2018-05-29 11:46 -0700
            Re: Retrieve hires pixel value Michael J. Mahon <mjmahon@aol.com> - 2018-05-29 10:47 -0500
            Re: Retrieve hires pixel value Antoine Vignau <antoine.vignau@laposte.net> - 2018-05-29 11:48 -0700
              Re: Retrieve hires pixel value D Finnigan <dog_cow@macgui.com> - 2018-05-29 19:46 +0000

#4543 — Retrieve hires pixel value

FromZellyn <zellyn@gmail.com>
Date2018-05-23 10:56 -0700
SubjectRetrieve hires pixel value
Message-ID<6c787972-9997-4811-8814-718b4f01297e@googlegroups.com>
Is there a generally accepted way of retrieving a hires pixel value (on/off) by x,y coordinates from BASIC? I assume someone posted a simple BASIC or poked-assembly routine to do it back in the day. I feel like I probably knew how to do it in the 80s :-)

(I understand the screen layout pretty well… just looking for the code snippet to do it.)

Zellyn

[toc] | [next] | [standalone]


#4544

FromD Finnigan <dog_cow@macgui.com>
Date2018-05-23 18:41 +0000
Message-ID<dog_cow-1527100915@macgui.com>
In reply to#4543
Zellyn wrote:
> Is there a generally accepted way of retrieving a hires pixel value
> (on/off) by x,y coordinates from BASIC? I assume someone posted a simple
> BASIC or poked-assembly routine to do it back in the day. I feel like I
> probably knew how to do it in the 80s :-)
> 

Beagle BASIC will give you an HSCRN command which I think will do what you
want.

-- 
]DF$
The New Apple II User's Guide:
https://macgui.com/newa2guide/

[toc] | [prev] | [next] | [standalone]


#4546

FromMichael J. Mahon <mjmahon@aol.com>
Date2018-05-23 18:56 -0500
Message-ID<T6CdnWahY-UuYpjGnZ2dnUU7-R_NnZ2d@giganews.com>
In reply to#4543
Zellyn <zellyn@gmail.com> wrote:
> Is there a generally accepted way of retrieving a hires pixel value
> (on/off) by x,y coordinates from BASIC? I assume someone posted a simple
> BASIC or poked-assembly routine to do it back in the day. I feel like I
> probably knew how to do it in the 80s :-)
> 
> (I understand the screen layout pretty well… just looking for the code snippet to do it.)
> 
> Zellyn
> 

I always used a single-point shape table. 

Just XDRAW the shape and check the collision counter, then XDRAW it again
to restore the pixel. 

The momentary change in the pixel is visible, but that “sparkle” shows
which pixels are being interrogated, which is sometimes interesting. 

-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#4547

FromZellyn <zellyn@gmail.com>
Date2018-05-23 20:52 -0700
Message-ID<798c41aa-dc3a-44c6-a352-ef5b84ae99ce@googlegroups.com>
In reply to#4546
On Wednesday, May 23, 2018 at 7:56:40 PM UTC-4, mjm...@aol.com wrote:
> I always used a single-point shape table. 
> 
> Just XDRAW the shape and check the collision counter, then XDRAW it again
> to restore the pixel. 

That's exactly what I was looking for! Thanks!

Zellyn

[toc] | [prev] | [next] | [standalone]


#4555

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2018-05-26 11:07 -0700
Message-ID<23b2f0fd-f262-4e4d-a915-3069d250a621@googlegroups.com>
In reply to#4546
If you don't want the flickering, and want something faster, it is rather trivial to piggy-back upon Applesoft's HPOSN @ $F411.  Any non zero values means the pixel is on.

Treating the screen as monochrome 280x192 image here is a demo program: HGR.PIXEL

1 GOTO 10
2 X0=X:X1=X>255:IF X1 THEN X0=X-256
3 POKE 769,Y:POKE 771,X0:POKE 773,X1:CALL 768:P=PEEK(785)
4 PRINT "X=";X;" Y=";Y;" P=";P:GET A$:RETURN
10 FOR I=0 TO 16:READ B:POKE 768+I,B:NEXT
20 HGR
30 POKE  8192, 1:X=  0:Y=  0:GOSUB 2
40 POKE  8231,64:X=279:Y=  0:GOSUB 2
50 POKE 15824, 1:X=  0:Y=159:GOSUB 2
60 POKE 15863,64:X=279:Y=159:GOSUB 2 
99 DATA 169,0,162,0,160,0,32,17,244,177,38,37,48,141,17,3,96


The corresponding Merlin HGR pixel test assembly and ML code @ $300:

                ; === Applesoft ROM ===
                GBASL   EQU $26
                COLOR   EQU $30
                HPOSN   EQU $F411  ; A=row, X=low  byte column, Y=high byte column

                ; Variables
                y       EQU 0
                x       EQU 279
                x0      EQU x&255
                x1      EQU x/256

                        ORG $300
300:A9 00               LDA #y
302:A2 17               LDX #x0
304:A0 01               LDY #x1
306:20 11 F4            JSR HPOSN
308:B1 26               LDA (GBASL),Y
30B:25 30               AND COLOR
30D:8D 11 03            STA Results
310:60                  RTS
311:00          Results DB 00

It's a pity Bill Gates couldn't shoe-horn this into Applesoft.  I guess he would rather waste bytes with an encrypted reverse "MICROSOFT!" signature at $F094 and unused HLINRL @ $F530. :-/
i.e.
http://www.txbobsc.com/scsc/scdocumentor/F49C.html
http://www.txbobsc.com/scsc/scdocumentor/EFEA.html

Cheers
Michael

[toc] | [prev] | [next] | [standalone]


#4557

FromMichael J. Mahon <mjmahon@aol.com>
Date2018-05-26 16:53 -0500
Message-ID<rr6dnbJBmNLbSpTGnZ2dnUU7-RVQAAAA@giganews.com>
In reply to#4555
Michael Pohoreski <michael.pohoreski@gmail.com> wrote:
> If you don't want the flickering, and want something faster, it is rather
> trivial to piggy-back upon Applesoft's HPOSN @ $F411.  Any non zero
> values means the pixel is on.
> 
> Treating the screen as monochrome 280x192 image here is a demo program: HGR.PIXEL
> 
> 1 GOTO 10
> 2 X0=X:X1=X>255:IF X1 THEN X0=X-256
> 3 POKE 769,Y:POKE 771,X0:POKE 773,X1:CALL 768:P=PEEK(785)
> 4 PRINT "X=";X;" Y=";Y;" P=";P:GET A$:RETURN
> 10 FOR I=0 TO 16:READ B:POKE 768+I,B:NEXT
> 20 HGR
> 30 POKE  8192, 1:X=  0:Y=  0:GOSUB 2
> 40 POKE  8231,64:X=279:Y=  0:GOSUB 2
> 50 POKE 15824, 1:X=  0:Y=159:GOSUB 2
> 60 POKE 15863,64:X=279:Y=159:GOSUB 2 
> 99 DATA 169,0,162,0,160,0,32,17,244,177,38,37,48,141,17,3,96
> 
> 
> The corresponding Merlin HGR pixel test assembly and ML code @ $300:
> 
>                 ; === Applesoft ROM ===
>                 GBASL   EQU $26
>                 COLOR   EQU $30
>                 HPOSN   EQU $F411  ; A=row, X=low  byte column, Y=high byte column
> 
>                 ; Variables
>                 y       EQU 0
>                 x       EQU 279
>                 x0      EQU x&255
>                 x1      EQU x/256
> 
>                         ORG $300
> 300:A9 00               LDA #y
> 302:A2 17               LDX #x0
> 304:A0 01               LDY #x1
> 306:20 11 F4            JSR HPOSN
> 308:B1 26               LDA (GBASL),Y
> 30B:25 30               AND COLOR
> 30D:8D 11 03            STA Results
> 310:60                  RTS
> 311:00          Results DB 00
> 
> It's a pity Bill Gates couldn't shoe-horn this into Applesoft.  I guess
> he would rather waste bytes with an encrypted reverse "MICROSOFT!"
> signature at $F094 and unused HLINRL @ $F530. :-/
> i.e.
> http://www.txbobsc.com/scsc/scdocumentor/F49C.html
> http://www.txbobsc.com/scsc/scdocumentor/EFEA.html
> 
> Cheers
> Michael
> 
> 
> 

As I understand it, Bill Gates (or Microsoft) didn’t have anything to do
with the hi-res graphics extensions—that was Apple’s (mostly Woz’s)
contribution. 

-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#4569

FromD Finnigan <dog_cow@macgui.com>
Date2018-05-28 22:55 +0000
Message-ID<dog_cow-1527548103@macgui.com>
In reply to#4557
Michael J. Mahon wrote:
> 
> As I understand it, Bill Gates (or Microsoft) didn’t have anything to do
> with the hi-res graphics extensions—that was Apple’s (mostly Woz’s)
> contribution. 
>

Randy Wigginton addd the hi-res commands to Applesoft.

[toc] | [prev] | [next] | [standalone]


#4570

FromAndy McFadden <thefadden@gmail.com>
Date2018-05-29 07:59 -0700
Message-ID<0a2dbd11-95a1-47eb-956f-c263070b51d2@googlegroups.com>
In reply to#4569
On Monday, May 28, 2018 at 3:55:07 PM UTC-7, D Finnigan wrote:
> Randy Wigginton addd the hi-res commands to Applesoft.

F7FD- CB D2 D7 4930        .AS -/KRW/   SOMEONE'S INITIALS?

[toc] | [prev] | [next] | [standalone]


#4572

FromAntoine Vignau <antoine.vignau@laposte.net>
Date2018-05-29 11:46 -0700
Message-ID<f6692561-a0e1-478c-9f15-7ae62248398e@googlegroups.com>
In reply to#4570
On Tuesday, May 29, 2018 at 4:59:10 PM UTC+2, Andy McFadden wrote:
> On Monday, May 28, 2018 at 3:55:07 PM UTC-7, D Finnigan wrote:
> > Randy Wigginton addd the hi-res commands to Applesoft.
> 
> F7FD- CB D2 D7 4930        .AS -/KRW/   SOMEONE'S INITIALS?

 DEX
 TXA
HTAB1: CMP #40
 BCC HTDONE
 SBC #40
 PHA
 JSR CRDO
 PLA
 JMP HTAB1
HTDONE: STA $24 ;CURSOR HORIZONTAL.
 RTS
 ASC "KRW" ;In Honor of Kenneth Randal Wigginton 
 FIN

from the ROMSOFTJ file, the resurrected Applesoft source code from Apple,
av

[toc] | [prev] | [next] | [standalone]


#4571

FromMichael J. Mahon <mjmahon@aol.com>
Date2018-05-29 10:47 -0500
Message-ID<qJKdnamxCsaG65DGnZ2dnUU7-QvNnZ2d@giganews.com>
In reply to#4569
D Finnigan <dog_cow@macgui.com> wrote:
> Michael J. Mahon wrote:
>> 
>> As I understand it, Bill Gates (or Microsoft) didn’t have anything to do
>> with the hi-res graphics extensions—that was Apple’s (mostly Woz’s)
>> contribution. 
>> 
> 
> Randy Wigginton addd the hi-res commands to Applesoft.
> 
But much of the code is from the Red Book, which Randy integrated into
Applesoft...

-- 
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com

[toc] | [prev] | [next] | [standalone]


#4573

FromAntoine Vignau <antoine.vignau@laposte.net>
Date2018-05-29 11:48 -0700
Message-ID<03685a8c-8ec1-4a70-9285-172f4c8a91c9@googlegroups.com>
In reply to#4569
On Tuesday, May 29, 2018 at 12:55:07 AM UTC+2, D Finnigan wrote:
> Michael J. Mahon wrote:
> > 
> > As I understand it, Bill Gates (or Microsoft) didn’t have anything to do
> > with the hi-res graphics extensions—that was Apple’s (mostly Woz’s)
> > contribution. 
> >
> 
> Randy Wigginton addd the hi-res commands to Applesoft.

*****************************
*                           *
*       APPLESOFT:          *
* FLOATING POINT BASIC FOR  *
*      THE APPLE-][         *
*                           *
*  COPYRIGHT 1978 BY        *
*  APPLE COMPUTER INC.      *
*   ALL RIGHTS RESERVED     *
*                           *
*  WRITTEN BY MICROSOFT     *
*                           *
* EXTENDED BY R. WIGGINTON  *
*                           *
*****************************

and...

;TITLE "APPLE II HI-RES GRAPHICS ROUTINES"
**************************
*                        *
* APPLE-II HI-RESOLUTION * 
*  GRAPHICS SUBROUTINES  * 
*                        * 
*    BY WOZ   9/13/77    * 
*                        *
*  ALL RIGHTS RESERVED   *
*                        * 
**************************

[toc] | [prev] | [next] | [standalone]


#4574

FromD Finnigan <dog_cow@macgui.com>
Date2018-05-29 19:46 +0000
Message-ID<dog_cow-1527623162@macgui.com>
In reply to#4573
Antoine Vignau wrote:
> On Tuesday, May 29, 2018 at 12:55:07 AM UTC+2, D Finnigan wrote:
>> Michael J. Mahon wrote:
>> > 
>> > As I understand it, Bill Gates (or Microsoft) didn’t have anything to
>> > do
>> > with the hi-res graphics extensions—that was Apple’s (mostly Woz’s)
>> > contribution. 
>> >
>> 
>> Randy Wigginton addd the hi-res commands to Applesoft.
> 
> *****************************
> *                           *
> *       APPLESOFT:          *
> * FLOATING POINT BASIC FOR  *
> *      THE APPLE-][         *
> *                           *
> *  COPYRIGHT 1978 BY        *
> *  APPLE COMPUTER INC.      *
> *   ALL RIGHTS RESERVED     *
> *                           *
> *  WRITTEN BY MICROSOFT     *
> *                           *
> * EXTENDED BY R. WIGGINTON  *
> *                           *
> *****************************
> 
> and...
> 
> ;TITLE "APPLE II HI-RES GRAPHICS ROUTINES"
> **************************
> *                        *
> * APPLE-II HI-RESOLUTION * 
> *  GRAPHICS SUBROUTINES  * 
> *                        * 
> *    BY WOZ   9/13/77    * 
> *                        *
> *  ALL RIGHTS RESERVED   *
> *                        * 
> **************************
>

Right. Woz wrote the hi-res routines for Programmer's Aid #1, and Wigginton
added them to Applesoft.

-- 
]DF$
The New Apple II User's Guide:
https://macgui.com/newa2guide/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.apple2.programmer


csiph-web