A83: Re: Direct output to the display
[Prev][Next][Index][Thread]
A83: Re: Direct output to the display
Here is a routine that will do the trick...
add all of this inside your prog
------------------------------
ipoint: ; change the x and y from b/c to e/d
ld a,e
and %111 ; we want it < 8, for a bitmask
ld b,a
ld a,1
ipLOP:
rla
djnz ipLOP
push af
call findpixel
pop af
ld (hl),a
ret
;--------------------------------------------------------------------
; 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
; | |
; | (95,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
ld l,(hl)
ld h,a ; hl -> byte in vid mem
ld a,c ; now a = bitmask for (hl)
ld de,plotsscreen ; CHANGED FOR 83
add hl,de
;121 t-states up to this point
ret
FP_RLD: .db $00
FP_Bits: .db $80,$40,$20,$10,$08,$04,$02,$01
-------------------------
-Harper Maddox
jerky@ebicom.net
IRC nick: Geori
ICQ: 1214597
-----Original Message-----
From: Anders Jensen <a_h_jensen@hotmail.com>
To: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
Date: Friday, June 05, 1998 3:17 PM
Subject: A83: Direct output to the display
>
>Does anybody know how to show pixels on the display without using the
>system routine IPoint? I could imagine that it is considerably quicker
>to do it directly.
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
ipoint.z80