A83: pixeltest


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

A83: pixeltest




Hi.. its me again.
who wanted a pixeltester?
I modified my pixelplotter..  you remember that?  its in ASMGuru...

I have no idea if this will even compile...  It uses selfmodifying code..
then it was almost no change needed in the code :)
most of the old is left as comments..

try it please.
it should return Z as the state of the pixel.. (Z=1 pixel set, Z=0 pixel clear)
(no.. I didnt even care to change the name...)

//Olle

;+-----+-----------------------------------------------------------------------+
;| ALH |       > PIX <    Test a pixel in Graph Backup ³        a=x e=y        |
;+-----+-----------------------------------------------------------------------+
;/-----------| PIX |-----------------------------------------------------------\

PIX
;	push	af		; Uncomment these to save regs..  
;	push	de

	ld	d,0		; Do y*12
	sla	e
	sla	e
	ld	hl,0
	add	hl,de
	add	hl,de
	add	hl,de

        ld      d,0             ; Do x/8
        ld      e,a
        srl     e
        srl     e
        srl     e
        add     hl,de

        ld      de,8e29h
        add     hl,de           ; Add address to graphbuf

        ld      de,0007h     	; Get the remainder of x/8
        and     e
	ld	e,a
	ld	IX,pixtable  	; Look up in table witch pixel to be set
	add	IX,de		
	ld	a,(IX+0)  	; and load this
	ld	(bittst),a
				
	
bittst	.db	$00,$CB


;	or	(HL)		; xor to toggle pixel, and to clear
;	ld	(HL),a		

;	pop	de
;	pop	af

	ret

pixtable
	.db	$7e
	.db	$76
	.db	$6e
	.db	$66
	.db	$5e
	.db	$56
	.db	$4e
	.db	$46

;\-----------| PIX |-----------------------------------------------------------/