Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: awanderin Newsgroups: comp.sys.apple2.programmer Subject: Re: calling HPLOT from assembly language Date: Sun, 27 May 2018 00:28:27 -0600 Organization: A noiseless patient Spider Lines: 58 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: h2725194.stratoserver.net; posting-host="b513a1a02c8beb28b57f1ff0f0b9d0df"; logging-data="24188"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182tl06wqner57hT4/ccB5iR+V19Beo3ZU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:LC7wcSPkE4wrNbUDneu4MOGX6xM= sha1:QZqHR47VHBjHAD3fSIZteZhGyqQ= Xref: csiph.com comp.sys.apple2.programmer:4560 vince@pianoman.cluster.toy writes: > So I was trying to quickly get some HGR lines drawn from assembly language > by calling directly into the Applesoft ROM. > > From what I can tell the following code *should* work and draw a white > line from 100,100 to 150,150. Instead what it does is draw a solid white > box from X 0 to 280 from Y 100 to 150. > > Is there something obvious I am doing wrong here? F457 (HPLOT0) takes y-coord in A, x-coord in X(lo), Y(hi). F53A (HGLIN) takes y-coord in Y, x-coord in A(lo), X(hi). See http://www.txbobsc.com/scsc/scdocumentor/F49C.html and http://www.txbobsc.com/scsc/scdocumentor/F3D8.html for the source. > > Thanks, > > Vince > > > 000000r 1 2C 50 C0 bit SET_GR ; graphics mode > 000003r 1 2C 57 C0 bit HIRES ; hires mode > 000006r 1 2C 53 C0 bit TEXTGR ; mixed text/graphics > 000009r 1 2C 54 C0 bit PAGE0 ; first graphics page > 00000Cr 1 20 58 FC jsr HOME > 00000Fr 1 > 00000Fr 1 A9 20 lda #$20 > 000011r 1 85 E6 sta HGR_PAGE > 000013r 1 > 000013r 1 20 F2 F3 jsr HCLR ; clear screen > 000016r 1 > 000016r 1 ; HCOLOR=3 > 000016r 1 A2 03 ldx #3 > 000018r 1 BD F6 F6 lda COLORTBL,X ; get color pattern from table > 00001Br 1 85 E4 sta HGR_COLOR > 00001Dr 1 > 00001Dr 1 ; HPLOT 100,100 to 150,150 > 00001Dr 1 ; X= (y,x), Y=a > 00001Dr 1 A0 00 ldy #0 > 00001Fr 1 A9 64 lda #100 > 000021r 1 A2 64 ldx #100 > 000023r 1 20 57 F4 jsr HPLOT0 > 000026r 1 > 000026r 1 ; X=(a,x), y=Y > 000026r 1 A9 00 lda #0 > 000028r 1 A2 96 ldx #150 > 00002Ar 1 A0 96 ldy #150 > 00002Cr 1 20 3A F5 jsr HGLIN > -- -- Jerry awanderin at gmail dot com