Re: A86: Re: TI-86 ASM HELP!


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

Re: A86: Re: TI-86 ASM HELP!



On Wed, 3 Dec 1997, Stephen Hicks wrote:

> to call findpixel on the 86, you need to include the routine in your source (the
> Eble-Yopp-&c one is good) and "call Findpixel".

And, in case you don't want to search the list archives for the source,
here it is.  I have posted it on my web page for future reference.

James,
did you ever make any progress on optimizing the non-aligned sprite 
routine?  I haven't done any more work on the line routine.  Shall I put
those on my page as well? 

;--------------------------------------------------------------------
; The Eble-Yopp-Yopp-Eble-Eble-Eble-Yopp Fast FindPixel Routine :)
; 36 bytes / 121 t-states not counting ret or possible push/pop of BC
;--------------------------------------------------------------------
; Input:  D = y
;         E = x
; Output: HL= address of byte in video memory
;         A = bitmask (bit corresponding to pixel is set)
;         C is modified
;
; +-----------+
; |(0,0)      |  <- Screen layout
; |           |
; |   (127,63)|
; +-----------+
;
;--------------------------------------------------------------------
FindPixel:
        ld hl,FP_Bits
        ld a,e
        and $07         ; a = bit offset
        add a,l
        ld l,a
        adc a,h
        sub l
        ld h,a
        ld c,(hl)       ; c = bitmask for (hl)
;48 t-states up to this point
        ld hl,FP_RLD
        ld (hl),d
        ld a,e          ; a = x/8 (byte offset within row)
        rrca
        rrca
        rrca
        rld
        or $FC
        ld l,(hl)
        ld h,a          ; hl -> byte in vid mem
        ld a,c          ; now a = bitmask for (hl)
;121 t-states up to this point
        ret

FP_RLD:  .db $00
FP_Bits: .db $80,$40,$20,$10,$08,$04,$02,$01

.end
;--------------------------------------------------------------------

--------
Dan Eble <eble@cis.ohio-state.edu>
         (http://www.cis.ohio-state.edu/~eble)

"Behold, how great a matter a little fire kindleth!" - James 3:5


References: