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


Groups > comp.sys.apple2.programmer > #4560

Re: calling HPLOT from assembly language

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From awanderin <awanderin@gmail.com>
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 <yubzi0lwr1w.fsf@gmail.com> (permalink)
References <slrnpgkabk.hch.vince@pianoman.cluster.toy>
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

Show key headers only | View raw


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

Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

calling HPLOT from assembly language vince@pianoman.cluster.toy - 2018-05-27 03:43 +0000
  Re: calling HPLOT from assembly language awanderin <awanderin@gmail.com> - 2018-05-27 00:28 -0600
    Re: calling HPLOT from assembly language vince@pianoman.cluster.toy - 2018-05-27 14:35 +0000
    Re: calling HPLOT from assembly language Antoine Vignau <antoine.vignau@laposte.net> - 2018-05-27 12:12 -0700

csiph-web