From: "Cyrille de Brebisson" <cyrille.de-brebisson@capway.com>
Newsgroups: comp.sys.hp48
References: <6qvadb$g2i$1@nnrp1.dejanews.com>
Subject: Re: BOX routine in ML
Date: Mon, 17 Aug 1998 09:41:37 +1000
Lines: 63
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
NNTP-Posting-Host: hpiw0285.aus.hp.com
Message-ID: <35d76e5b.0@isoit370.bbn.hp.com>
X-Trace: 17 Aug 1998 01:42:19 +0100, hpiw0285.aus.hp.com
X-Disclaimer: All opinions expressed herein are of personal nature and do not reflect the opinion of third parties.
Xref: republic.btigate.com comp.sys.hp48:14640



>This time, I need to know if there's an entrie for a routine
>that draws a box in ML, and how it's used. Is there a way to
>draw filled boxes too?


I do not think so. HP use line command to draw boxes.

But you can do someting like that.
It's an ASM routine that takes as an entry the folowing parameters. and draw
a fill box on a $22h nible screen (Standard size)

(Compiled, including $CCD20: 127.5 bytes, # 57B2h)

*FillBox
% D0: @Screen
% Da: NbLines to fill
% Aa: X begining
% Ca: Y Begining
% Ba: NbPixels

?B=0.A RTY D-1.A RTNC % Fast Return on Nothing to do

AD0EX C+C.A A+C.A CSL.A A+C.A    % @ of the first line of the box
CD0EX P=C.0 CSRB.A CSRB.A A+C.A D0=A    % D0: @ of the first pixel of the
box, P: X mod 16
C=0.A CPEX.0 CBIT=0.3 CBIT=0.2    % Ca: Shift of the first pixel

% Calculation of the first Mask (For the first pixels
% Ds: 4 black pixels if B>=4 else B black pixels
D=0.S LA 04 ?B>A.B { A=B.B } A-1.B { D+1.S D+D.S A-1.B UPNC }
{ ?P=0 EXIT D+D.S UPC }    % shifting of the mask

% Calculation of the number of full black nibles (in Ba) and the final mask
(Bs)
B-C.A SKNC { B=0.A } C=B.A BSRB.A BSRB.A CBIT=0.3 CBIT=0.2   % C: Nb of
final pixels
B=0.S C-1.A SKNC { B+1.S B+B.S C-1.A UPNC }

% Now, let's work!
A=0.W A-1.W    % Plenty of black pixels
{ C=DAT0.S C!D.S DAT0=C.S D0+1    % First pack of colums
  C=B.A P=C.0 CSR.A    % Prepar to fill full nibles
  C-1.A { DAT0=A.W D0+16 C-1.A UPNC }    % Do It
  DAT0=A.WP CD0EX C+P+1 CD0EX P=0    % Finish it
  C=DAT0.S C!B.S DAT0=C.S    % Last pack of nible
  CD0EX C-B.A CD0EX D0+33    % point to Next line
  D-1.A UPNC    % And loop
}
RTN    % Back Home


PS: I just write it like that, without testing, so, be carful (Normaly, the
too critical loops are good, the initialization may be wrong.
ps2: giving big value for Ba or Da (Over the size of the screen will corrupt
your memory
PS3: if you wat it for a non standard screen, just change the D0+3 into the
with of your screen -1 and the time 22h multiplication

bye

