From: Krogg
Subject: drawing in a screen buffer:help
I am still trying to make my self a graphics library for
mode 13h(for powerbasic 3.5).Here i am at a snag again,i hope someone can
help here.
I have a inline asm circle routine about a mile long and have debugged
it for the last 2 nites.It works great and blazingly fast.Now i am trying
make it in to a seperate sub that will draw the circle to a screen buffer.I
bet some of you allready know what my problem is,huh?
ok.
here is the pixel putting part of the circle routine(there are 8 of them):
asm db %pusha
asm mov ax,&ha000 ;<--screen segment(I want it to be buffer seg)
asm mov es,ax
asm mov bx,dx
asm mov di,bx
asm xchg bh,bl
asm push cx
asm mov cl,6
asm shl di,cl
asm add di,bx
asm pop cx
asm add di,cx
asm mov al,colr[0]
asm Mov es:[di], al
asm db %popa
(%pusha=&h60:%popa=&h61,these are 286 op codes for push and pop all)
I have included the following to provide for a screen buffer:
DIM HUGE SCRNBUFF(319,199)as byte '320 x 200x256(Mode 13h)
DIM SCRNBUFFPTR AS BYTE PTR
dim scrnbuffadd as shared dword
SCRNBUFFPTR=VARPTR32(SCRNBUFF(0,0))
SCRNBUFFADD=SCRNBUFFPTR
dim video_segment as shared word
I got this from a message in the powerbasic bbs along with routines
for clearing the buffer and coppying it to the screen.They work soooo
good and fast.
Can anyone show me how to modify the pixel putting routine to make
it draw in the screen buffer?
mythoughts:
1.)
if i could somehow force "dim huge scrnbuff(319,199)as byte" to
make scrnbuff(0,0) be offset 0 at some segment then the line
asm mov ax,&ha000
could be changed to
asm mov ax,scrnbuffseg
with the addition of:
dim scrnbuffseg as shared word
scrnbuffseg=varseg(scrnbuff(0,0))
2.)if i used "dim absolute scrnbuff(319,199)as byte at some-segment"
then it would be solved BUT,where would "some-segment" be?Is there
some way to find a safe segment to use at runtime,with win95 and such
running how could that happen?
3.)Im screwed.
anyway,ive crashed my computer about 8 times trying to make it work
so at last resort i come here,I hope someone knows how to do this.
Thanks,
Krogg
--
THE
/\ \\ // /\
/ \ \\ // / \
/ /\/ /""""""\ \/\ \
/ / SEE HIS ( / \ \ SEE HIS \ \
\ \ FACE \/ \/ SMILE / /
\ \ / W \ / /
\ \ /\_|||||_/\ / /
/ \ // ||| \\ / \
/ /\ \ // ' \\ / /\ \
/ / / / \ \ \ \
\ \/ \_______________________/ \/ /
\_________________________________/
krogg.no.to.spam@inspace.net
Remove no.to.spam to reply
http://www.inspace.net/~carcher/krogg/aani.htm
Gory javascript animations for your enjoyment
*** QwkNews (tm) v2.1
* [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|