Re: A86: Re: findpixel


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

Re: A86: Re: findpixel




Actually, find pixel does exist in the 86's ROM on page 4,
to run find pixel on rom 1.2, use this

ld a,$4
out (5),a
call $6FF0
ld a,$D
out (5),a

I strongly encourage you NOT to use this routine,
There is no way to call it from page $D,
and there is no way to tell if this will work on future ROM versions!
If you are interested, here is find pixel disassembled off of the rom:

 PUSH DE  ; 6FF0   0A   .
 PUSH BC  ; 6FF1   0A   .
 LD HL,07012H ; 6FF2   0E   .
 LD D,000H  ; 6FF5   0C   .
 LD A,B  ; 6FF7   09   .
 AND 007H  ; 6FF8   0B   .
 LD E,A  ; 6FFA   09   .
 ADD HL,DE  ; 6FFB   0C   .
 LD E,(HL)  ; 6FFC   0C   .
 LD H,D  ; 6FFD   09   .
 SRL B  ; 6FFE   08   .
 SRL B  ; 7000   08   .
 SRL B  ; 7002   08   .
 LD A,03FH  ; 7004   0C   .    ;note: this inverses the
 SUB C  ; 7006   08   .            ;y coordinate
 ADD A,A  ; 7007   0A   .
 ADD A,A  ; 7008   0A   .
 LD L,A  ; 7009   09   .
 ADD HL,HL  ; 700A   0C   .
 ADD HL,HL  ; 700B   0C   .
 LD A,E  ; 700C   09   .
 LD E,B  ; 700D   09   .
 ADD HL,DE  ; 700E   0C   .
 POP BC  ; 700F   09   .
 POP DE  ; 7010   09   .
 RET   ; 7011   07   .

Bill N.


References: