[A83] Re: Official H**s Replacement Commands (OT)


[Prev][Next][Index][Thread]

[A83] Re: Official H**s Replacement Commands (OT)




The hays site has been down for a week or so actually.

Hmm, I was thinking more along the lines of recursion to clear the screen.
Maybe something like this. I got a bit lazy in the clear loop though.

	ld	a,plotsscreen >> 8
	call	SetHtoA
	ld	a,plotsscreen & 255
	call	SetLtoA
	ld	a,3
	call	SetBtoA
	call	SetAto0
	ld	a,0
	call	SetCtoA
	call	SetIXtoHL
@clr	res	7,[ix]
	res	6,[ix]
	res	5,[ix]
	res	4,[ix]
	res	3,[ix]
	res	2,[ix]
	res	1,[ix]
	res	0,[ix]
	ld	a,ixl
	add	a,1
	ld	ixl,a
	ld	a,ixh
	adc	a,0
	ld	ixh,a
	ld	a,c
	sub	1
	ld	c,a
	ld	a,b
	sbc	a,0
	ld	b,a
	bit	7,b
	jr	nz,@skip
	bit	6,b
	jr	nz,@skip
	bit	5,b
	jr	nz,@skip
	bit	4,b
	jr	nz,@skip
	bit	3,b
	jr	nz,@skip
	bit	2,b
	jr	nz,@skip
	bit	1,b
	jr	nz,@skip
	bit	0,b
	jr	nz,@skip
	bit	7,c
	jr	nz,@skip
	bit	6,c
	jr	nz,@skip
	bit	5,c
	jr	nz,@skip
	bit	4,c
	jr	nz,@skip
	bit	3,c
	jr	nz,@skip
	bit	2,c
	jr	nz,@skip
	bit	1,c
	jr	nz,@skip
	bit	0,c
	jr	nz,@skip
	pop	ix
	jp	[ix]
@skip	call	@clr
	jp	[ix]

SetIXtoHL:
	call	SetAto0
	ld	ixh,a
	ld	ixl,a
@loop	add	ix,ix
	add	hl,hl
	jp	c,@skip
	inc	ix
	inc	a
@skip	bit	7,a
	jp	nz,@loop
	bit	6,a
	jp	nz,@loop
	bit	5,a
	jp	nz,@loop
	bit	4,a
	jp	z,@loop
	bit	3,a
	jp	nz,@loop
	bit	2,a
	jp	nz,@loop
	bit	1,a
	jp	nz,@loop
	bit	0,a
	jp	nz,@loop
	pop	hl
	jp	[hl]

SetAto0:
	res	7,a
	res	6,a
	res	5,a
	res	4,a
	res	3,a
	res	2,a
	res	1,a
	res	0,a
	pop	ix
	jp	[ix]

SetBtoA:
	res	7,b
	res	6,b
	res	5,b
	res	4,b
	res	3,b
	res	2,b
	res	1,b
	res	0,b
@loop	inc	b
	dec	a
	jp	nz,@skip
	pop	ix
	jp	[ix]
@skip	call	@loop
	pop	ix
	jp	[ix]

SetCtoA:
	res	7,c
	res	6,c
	res	5,c
	res	4,c
	res	3,c
	res	2,c
	res	1,c
	res	0,c
@loop	inc	c
	dec	a
	jp	nz,@skip
	pop	ix
	jp	[ix]
@skip	call	@loop
	pop	ix
	jp	[ix]

SetHtoA:
	res	7,h
	res	6,h
	res	5,h
	res	4,h
	res	3,h
	res	2,h
	res	1,h
	res	0,h
@loop	inc	h
	dec	a
	jp	nz,@skip
	pop	ix
	jp	[ix]
@skip	call	@loop
	pop	ix
	jp	[ix]

SetLtoA:
	res	7,l
	res	6,l
	res	5,l
	res	4,l
	res	3,l
	res	2,l
	res	1,l
	res	0,l
@loop	inc	l
	dec	a
	jp	nz,@skip
	pop	ix
	jp	[ix]
@skip	call	@loop
	pop	ix
	jp	[ix]

-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of Hyperbyte
Sent: Tuesday, July 03, 2001 10:05 AM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: Official H**s Replacement Commands & Questions &
PulseWidthModulation




Follow-Ups: