19.06.2013 Views

Amiga Computing - Commodore Is Awesome

Amiga Computing - Commodore Is Awesome

Amiga Computing - Commodore Is Awesome

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• 8 •<br />

• • • 18<br />

• • •<br />

8 8 O<br />

•<br />

Plcome back. Let's hope you have<br />

the rest of the program typed in by<br />

now, as we are going to give you<br />

the rest of the Screen Info program by Graham<br />

Moody. All set? Right let's get going.<br />

As we said last month this is a screen into<br />

program which loads a screen and gives you<br />

info about it The author describes its usage<br />

thus:<br />

'Here is a routine that will give you information<br />

on the current screen, from the screen number<br />

to the amount of memory the screen is using.<br />

There are two modes of operation.<br />

illt _SCREE/LIM/11<br />

<strong>Is</strong> the silent mode, where by the information is<br />

returned from the procedure in a string.<br />

_SCREENNUNISEI=Vat(Left$01,1)/<br />

1<br />

, ImhattlfidltILD,4))<br />

A<br />

a<br />

NUI8EIDICOLOORS.Dat(lid$(1S,23,4)f<br />

l<br />

lUMBEIDIBITPLUESIatflidl(16,21„1/7<br />

( AMOUNTOFSEREENNENDIInlatflidlffl,30,7)1<br />

l<br />

this is i how we get the information, that is<br />

6 returned t from the procedure<br />

d<br />

1<br />

_SCREEN_IIFOIO)<br />

(<br />

is non silent mode where by the information is<br />

1<br />

displayed directly on screen '<br />

8<br />

Okay, here's the second part of tne code.<br />

,<br />

Don't try to run this on its own as tt is not<br />

3<br />

complete! , Okay, here we go with part 2.<br />

First<br />

4<br />

we open a screen:<br />

1<br />

)<br />

Screen Dpen I<br />

6,eires<br />

Screen 11<br />

1A„<br />

spIr<br />

We grab the - Palette of the current screen.<br />

Then we fade In<br />

Net Palette<br />

Fidel F,S/FO,SfaCi,SCCI,SAAC,177A,Sf00<br />

$11%. 11 • ;18F,83,SIC<br />

,M<br />

Curs Off : RIO Off : Paper 5<br />

r • I I ; 1.0 : WIDIR.640 : IIIIIII.120 .<br />

l1<br />

• Ocisub UW3<br />

i 1 • 1 4 0 : 1.13 : 011111.560 : NEINDIell'<br />

d : Rosa LINNT31<br />

e<br />

: We then GOSUB to the routine that onnts the<br />

linformation.<br />

a<br />

i Nosub INFOPIINT<br />

t i Nait Wbt<br />

lI<br />

Ink 3 : Paint <strong>Is</strong>4,Y+4,0 : lea p<br />

, of screen, in tabour 3<br />

b<br />

a<br />

Piper 3 : Pen 5 : locate ,2 : Centre<br />

t<br />

i 'Screen<br />

infortation"<br />

n<br />

for Ii4 Ti ISO Step 16 Scren Display I511,128,N„<br />

t<br />

Wait Vbt 4 111 1<br />

Hut V<br />

1<br />

For 11.150 To 100 Step 1-4<br />

Screen Display ISN,128,11„ 1<br />

Veit lbt<br />

Neat N<br />

1<br />

iFor 116100 To 150 Step 2 1<br />

Screen Display I51,121,11,, 1<br />

Veit VIA<br />

lOst I<br />

;Timer<br />

Having done all that we set timer to zero and<br />

then we go into a lade repeat/until loop:<br />

111110 g0e5 •1<br />

there?<br />

11<br />

Part B<br />

lepeat<br />

'<br />

InIfmer/50<br />

If T.m110<br />

If 111.<br />

- sina41<br />

.0 If 110150 : UPI 1 fad If<br />

If this is the case we will move screen down.<br />

N=11-1<br />

1If 11.c6° :UPO End If<br />

1 1<br />

2<br />

if this is the case we will move screen up.<br />

Sows Ols014I<br />

o l l e . 1 1 1 . 6<br />

.<br />

Here's where<br />

1<br />

the decisions we made earlier<br />

about moving the screen up/down come into<br />

effect<br />

End If<br />

Halt Vbf<br />

Wait for the next vertical blank and then set up<br />

a mouse key sensor, so if a mouse key is<br />

pressed we will continue, like so:<br />

5INtif Noose Me "4111111111111111<br />

Next we have a FOR/NEXT loop, which shows<br />

us the into screen:<br />

For NI Ti -IDO Step -16<br />

Screen Display IS1,121,11„<br />

Wait Dbt<br />

Next<br />

Then<br />

.•<br />

we close the information screen and exit<br />

the procedure<br />

ose IS :<br />

1 1<br />

Pop Proc<br />

! itif Screen it Cl<br />

ioto REPORT<br />

I I<br />

Right now we enter the tight3D area of the<br />

program, Try this proc on its own to see what<br />

happens. X and Y hold the x<br />

box. . WIDTH and HEIGHT hold the width and<br />

height y position<br />

of the box. Simple and effective huh?<br />

o f<br />

LIGHT3a:<br />

t h e<br />

Ink : Bar t,1 To IWO I N T<br />

Ir<br />

j<br />

This clears the middle with the background<br />

colour<br />

11111or<br />

Write stuff<br />

it you nave ,<br />

,<br />

i House Arlington Park Macclesfield 910 4NP<br />

to Phil South, Amos Cokimn Amcy Cceopoong Medi<br />

nitr<br />

e<br />

y a<br />

Ink 6<br />

Dram 1411110 To ItilIDTIGIOEINNT<br />

Dram To 1,10EI5NI<br />

Ink 4<br />

Iran Ti 1,1<br />

Orem To IrMIDI,I<br />

Ink 6<br />

Paw PWIDTW-1,10 To 1.1110IN-1,YelEIGNI-I<br />

Draw To 1141,YmMEINIII-1<br />

Ink 4<br />

frau To I41,141<br />

Iran To X+WIDIN-1,10<br />

Ink 6<br />

Draw leklIDTH-2,Y+2 To 10110TM-2,TOEIGNI-2<br />

Paw To its.2,1<br />

. Ink 4<br />

0EINNT-2<br />

Pfau To I.2,Y.2<br />

Dray To 14111DIM-2,M2<br />

'glum<br />

And finally we have the INFORPRINT label we<br />

referred to earlier:<br />

1<br />

. INFOPRIIT:<br />

Pen 12<br />

Locate ,4<br />

Centre • The screen numbern"<br />

,<br />

DEC<br />

iSt•SC_SEREEI_Ntill-<br />

Locate ,5<br />

Centre • The screen midth.".Strlf_SCREEI_VIDIlf<br />

Locate ,6<br />

Centre • The screen<br />

Locate ,7<br />

Centre "Tte maxima /weber of<br />

cotourin'eStrl(_MAXIUR_NUMIER_OF_COLOORS)<br />

Locate ,8<br />

, Centre "The number of Planta<br />

meillebtees5trl(110Pal<br />

, Locate ,9<br />

Centre "The tefthend side of the screen <strong>Is</strong> displayed<br />

it".tstrsnotSPLAYI<br />

Locate ,I0<br />

, Centre 'The top of tie screen is displayed<br />

et"*Stri(IESPLAY)<br />

Locate pit<br />

tee "Ti. totat memory requirement for tbfm<br />

•<br />

rlITSI/1024)elflOOITE5<br />

e<br />

Locate m,12<br />

Centre<br />

S<br />

'Mtn the double buffer system is ift<br />

,us, time by 2f*<br />

t<br />

k<br />

Locate<br />

r<br />

4ii.<br />

,I3<br />

Pen D : Centre "Press souse key to um-<br />

Return I<br />

REPORT: f<br />

End ProcEISI<br />

I<br />

l<br />

l<br />

And there you have rt. All the information you<br />

/<br />

could wish<br />

e<br />

for about a screen Handy to be able<br />

to do this<br />

b<br />

kind of thing on the fly lf, for<br />

example, y you had an image processing<br />

program, t and you wanted to sense the<br />

parameters e of an incoming screen file so you<br />

could casually s pop them up on the screen after<br />

a menu, ' for example. then this is the routine for<br />

you. Ft . is a veritable Swiss Anry Knife of a<br />

routine, ' so keep it handy.<br />

Back oto<br />

normal, whatever that is, next month,<br />

and keep<br />

r<br />

those routines and letters coming.<br />

<strong>Amiga</strong> <strong>Computing</strong><br />

OCTOBER 1995<br />

• • • ••<br />

•<br />

g a n<br />

• g • •• •<br />

Phil South<br />

look5 at part<br />

two of the<br />

WPM info<br />

program

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!