--------------------------
3]THE BIG PICTURE: Technique
3]Program by J. E. Charlsen
--------------------------

3]IT WILL WORK!
     You may have gotten an OUT OF MEMORY or OUT OF HEAP SPACE error message
when you tried to run the COVER program. The program will work on a 512K
system with up to one external drive. Here's how:
     1. Boot the system and make the following steps the first operation.
     2. Insert JUMPDISK and open main J window.
     3. Put the mouse pointer over COVER icon.
     4. Click and hold down left mouse button.
     5. Roll mouse leftward to take COVER icon outside J window.
     6. Release left mouse button.
     7. Close J window by clicking left mouse button in northwest corner.
     8. Double-click cover icon to see program.
     9. Don't worry because the COVER icon is outside the J window. You can
move it back in. Even if you don't, it will be back in place on rebooting.

3]JUMPDISK NOTE
     This month's JUMPDISK cover art is a four-screen scroller that goes on
and on from left to right.
     In reality, it's one high-resolution screen that is subjected to a
clever Amiga Basic technique by programmer J. E. Charlsen. Slivers of the
original screen are GETed in one resolution, PUTed in a lower resolution on
the current screen, the whole screen is SCROLLed leftward a pixel or so, and
the whole process is repeated. In effect, four screens are created.
     With your own pictures, you can use this technique to create panoramic
scenes, though only one part will be visible as the scrolling continues.
     The required support file INTUITION.BMAP is in the BIGPIX drawer on
this disk. However, Amiga Basic is also required, but is not in the drawer.
Also, Charles Vassallo's ILBM.CODE is required but not in the drawer. After
(but not before) copying the drawer to another disk, copy ILBM.CODE into the drawer with the
following command from the CLI:

copy j:ilbm.code to NEWDISKNAMEj:bigpix/ilbm.code   <and press Return key>

     In the above command, NEWDISKNAME refers to the name of the disk to
which the drawer will be copied.
     At the end of this article are four program listings that produce
screens of various sizes.
     We now turn things over to programmer J. E. Charlsen:

     If the scrolling is slow and jerky, your chip ram is fragmented by a
previous program. Try closing the other windows and tasks. If that fails,
reboot.
     The programs were written using the Workbench environment with icons
to run them. They also need the following support files with them in the
root directory of their disk: Amiga Basic, intuition.bmap and ILBM.code
     As there are about 749 different ways to store and run these programs, I
won't even try to anticipate all those ways that won't work.
     The principle is the same in all four programs. First, load a picture
or two. Then GET the picture in graphic arrays. Then march (PUT) the arrays
across the display screen from right to left in one pixel increments. 
     There is no real need for four programs, as most of the listings are
identical. I chose this format primarily as a demonstration device and to
save typing by listing the programs in such a way that each could be
incorporated into another program with little or no editting.
     The first thing you may notice is that the maximum number of colors
used in any of the programs is four. That is done primarily to avoid
running out of chip RAM. By careful conservation of RAM, I'm sure eight
or 16 colors could be used. I chose not to try it on programs which would be
widely distributed to users who may only have 512K machines. When the
one-meg chip ram chips become available, there should be no problems with
more colors.
     The programs are extremely straightforward and should be easy to
understand by examining the listings.
    The only "tricks" used are:
      1. Charles Vassallo's assembly IFF loader/saver code.
      2. Two POKEs which change the border color.
      3. The use of a quasi-overscan screen on the lo-res display screens
      All three are, if not self-explanatory, at least accessible by
incorporating the pertinent portions of the programs into your work.
     Did I hear someone snivelling, "Yeah, but how do I make a 2560*200
pitcher 'cuz I ain't got a paint program what goes that big?"?
     Gee, I hate it when they do that.
     Where was I? Oh, first get out your DPaint II and set the screen size
to 640*400 and the colors to 2 (or 4). Then make a screen (or two) where the
top half of the screen (1,1)-(631,195) blends smoothly into the bottom half
(1,196)-(631,390).
     This requires turning on the COORDS option and picking up brushes of
the transition (edge) areas and plunking them down to see if things match.
You'll have to experiment a bit and duplicate screens and "J"ump back and
forth a lot, but it's worth it. Oh, you'll have to change that part of the
programs that says FileName$="Whatever" to FileName$="TheNameofYourPic"
     One last thing: If you can't figure out something terrific to do with
these programs at least make a scrolling mural that looks better than a
blank screen while you're having dinner. If the colors are subdued and the
patterns are well distributed over the whole screen it'll do your phosphors
no harm. And anything moving looks better than most static screenblankers.

     Enjoy.
     Jim Charlsen, 3300 Thatcher Ave. #15, Marina del Rey, CA 90292.

     Here are the four listings, separated by dashed lines:

-------------------------------------------------------------------------

' 1280 by 400 one bit plane
 CLEAR,25000
 CLEAR,70000&
  DEFINT a-y 
  DIM B1%(16000),B2%(16000)
  ON BREAK GOSUB Ender
  BREAK ON
  WINDOW 1,,(20,20)-(300,70),23
  PRINT "working
  DECLARE FUNCTION ViewPortAddress&() LIBRARY
  LIBRARY "intuition.library"
  GOSUB InitILBM
  
  SCREEN 2,640,400,1,4
  WINDOW 2,"",,0,2
  WINDOW 1
  COLOR 1,3:CLS:PRINT " Still working ....
  WINDOW OUTPUT 2
  
  FileName$="FIRST PICTURE"
  GOSUB ILBMloading      
  GET(0,0)-(632,390),B1%

GetPaletteFromFirstScreen:
  Nc=1
  DIM Zal(4,3)  
  vpa&=ViewPortAddress&(WINDOW(7))
  ColorTable&=PEEKL(PEEKL(vpa&+4)+4)
  FOR I=0 TO Nc
    zB.G=PEEK(ColorTable&+2*I+1)
    zR=PEEK(ColorTable&+2*I)*.0625
    zG=(zB.G*.0625)*.0625  
    zB=(zB.G MOD 16)*.0625   
    Zal(I,0)=zR:Zal(I,1)=zG: Zal(I,2)=zB 
  NEXT I
  
  FileName$="SECOND PICTURE"
  GOSUB ILBMloading 
  GET(0,0)-(632,390),B2%
   
  WINDOW 2
  CLS

SetPalette:  
  FOR I=0 TO Nc
    PALETTE I,Zal(I,0),Zal(I,1),Zal(I,2)
  NEXT  

  MyWindow&=WINDOW(7)
  BlockPen&=MyWindow&+99
  POKE BlockPen&,0
  RefreshWindowFrame&(MyWindow&)

Main:
 WHILE 1
  FOR I=0 TO 631
    PUT(-I,0),B1%,PSET
    PUT(-I+632,0),B2%,PSET
  NEXT
  FOR I=0 TO 631
    PUT(-I,0),B2%,PSET
    PUT(-I+632,0),B1%,PSET
  NEXT
 WEND 

Ender:
  WINDOW 1,,(20,20)-(300,70),23
  COLOR 1,3:CLS
  '** Set text & border color to red
  MyWindow&=WINDOW(7)
  TextPen&=MyWindow&+98
  POKE TextPen&,1
  BlockPen&=MyWindow&+99
  POKE BlockPen&,3
  RefreshWindowFrame&(MyWindow&)
  LIBRARY CLOSE
  CLEAR,25000
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  SYSTEM
  END
  
InitILBM:
   DIM Code%(1220)    
   OPEN "ILBM.code" FOR INPUT AS #1
   I=0  
   WHILE NOT EOF(1)
     INPUT#1,Code%(I) : I=I+1 
   WEND
   CLOSE #1
   OpenFlag=0   
  RETURN

ILBMloading:
   file0$=FileName$+CHR$(0)
   ILBMload&=VARPTR(Code%(0))          
   CALL ILBMload&(SADD(file0$))       
  RETURN

---------------------------------------------------------------------------

' 1280-by-200, one bit plane
 CLEAR,25000
 CLEAR,38000&
  DEFINT a-y 
  DIM B1%(8000),B2%(8000)
  ON BREAK GOSUB Ender
  BREAK ON
  WINDOW 1,,(20,20)-(300,70),23
  PRINT "working
  DECLARE FUNCTION ViewPortAddress&() LIBRARY
  LIBRARY "intuition.library"
  GOSUB InitILBM
  
  SCREEN 2,640,400,1,4
  WINDOW 2,"",,0,2
  WINDOW 1
  COLOR 1,3:CLS:PRINT " Still working ....
  WINDOW OUTPUT 2
  
  FileName$="FIRST PICTURE"
  GOSUB ILBMloading 
  Nc=1
  DIM Zal(4,3)
GetPalette:  
  vpa&=ViewPortAddress&(WINDOW(7))
  ColorTable&=PEEKL(PEEKL(vpa&+4)+4)
  FOR I=0 TO Nc
    zB.G=PEEK(ColorTable&+2*I+1)
    zR=PEEK(ColorTable&+2*I)*.0625
    zG=(zB.G*.0625)*.0625  
    zB=(zB.G MOD 16)*.0625   
    Zal(I,0)=zR:Zal(I,1)=zG: Zal(I,2)=zB 
  NEXT I
     
  GET(0,0)-(632,195),B1%
  GET(0,196)-(632,390),B2%
  
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  
  SCREEN 2,640,400,1,1
  WINDOW 2,,(0,0)-(331,205),0,2
  FOR I=0 TO Nc
    PALETTE I,Zal(I,0),Zal(I,1),Zal(I,2)
  NEXT  

  MyWindow&=WINDOW(7)
  BlockPen&=MyWindow&+99
  POKE BlockPen&,0
  RefreshWindowFrame&(MyWindow&)

Main:
 WHILE 1
  FOR I=0 TO 957
    PUT(-I,0),B1%,PSET
    PUT(-I+632,0),B2%,PSET
  NEXT
  
  FOR I=326 TO 632
    PUT(-I,0),B2%,PSET
    PUT(-I+632,0),B1%,PSET
  NEXT
 WEND 

Ender:
  WINDOW 1,,(20,20)-(300,70),23
  COLOR 1,3:CLS
  MyWindow&=WINDOW(7)
  TextPen&=MyWindow&+98
  POKE TextPen&,1
  BlockPen&=MyWindow&+99
  POKE BlockPen&,3
  RefreshWindowFrame&(MyWindow&)
  LIBRARY CLOSE
  CLEAR,25000
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  SYSTEM
  END
  
InitILBM:
   DIM Code%(1220)    
   OPEN "ILBM.code" FOR INPUT AS #1
   I=0  
   WHILE NOT EOF(1)
     INPUT#1,Code%(I) : I=I+1 
   WEND
   CLOSE #1
   OpenFlag=0   
  RETURN

ILBMloading:
   file0$=FileName$+CHR$(0)
   ILBMload&=VARPTR(Code%(0))          
   CALL ILBMload&(SADD(file0$))       
  RETURN

----------------------------------------------------------------------------

' 1280-by-200, two bit planes
 CLEAR,25000
 CLEAR,72000&
  DEFINT a-Y 
  DIM B1%(16000),B2%(16000)
  ON BREAK GOSUB Ender
  BREAK ON
  WINDOW 1,,(20,20)-(300,70),7
  PRINT "working   
  DECLARE FUNCTION ViewPortAddress&() LIBRARY    
  LIBRARY "intuition.library"
  GOSUB InitILBM
  
  SCREEN 2,640,400,2,4
  WINDOW 2,"",,0,2
  WINDOW 1
  COLOR 1,3:CLS
  PRINT "  Still working
  WINDOW OUTPUT 2
  FileName$="FIRST PICTURE"
  GOSUB ILBMloading
   
GetPalette:
  Nc=3
  DIM Zal(4,3)  
  vpa&=ViewPortAddress&(WINDOW(7))
  ColorTable&=PEEKL(PEEKL(vpa&+4)+4)
  FOR I=0 TO Nc
    zB.G=PEEK(ColorTable&+2*I+1)
    zR=PEEK(ColorTable&+2*I)*.0625
    zG=(zB.G*.0625)*.0625  
    zB=(zB.G MOD 16)*.0625   
    Zal(I,0)=zR:Zal(I,1)=zG: Zal(I,2)=zB 
  NEXT I
  
  GET(0,0)-(632,195),B1%
  GET(0,196)-(632,390),B2%
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  
  SCREEN 2,640,400,2,1
  WINDOW 2,,(0,0)-(331,205),0,2

SetPalette:
  FOR I=0 TO Nc
    PALETTE I,Zal(I,0),Zal(I,1),Zal(I,2)
  NEXT  

RedrawBorderWithBackgroundColor:
  '** uses intuition.bmap
  MyWindow&=WINDOW(7)
  BlockPen&=MyWindow&+99
  POKE BlockPen&,0
  RefreshWindowFrame&(MyWindow&)

Main:
 WHILE 1
  FOR I=0 TO 957
    PUT(-I,0),B1%,PSET
    PUT(-I+632,0),B2%,PSET
  NEXT
  
  FOR I=326 TO 632
    PUT(-I,0),B2%,PSET
    PUT(-I+632,0),B1%,PSET
  NEXT
 WEND 

Ender:
  WINDOW 1,,(20,20)-(300,70),23
  COLOR 1,3:CLS
  MyWindow&=WINDOW(7)
  TextPen&=MyWindow&+98
  POKE TextPen&,1
  BlockPen&=MyWindow&+99
  POKE BlockPen&,3
  RefreshWindowFrame&(MyWindow&)
  LIBRARY CLOSE
  CLEAR,25000
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  SYSTEM
  END
  
InitILBM:
   DIM Code%(1220)    
   OPEN "ILBM.code" FOR INPUT AS #1
   I=0  
   WHILE NOT EOF(1)
     INPUT#1,Code%(I) : I=I+1 
   WEND
   CLOSE #1
   OpenFlag=0   
  RETURN

ILBMloading:
   file0$=FileName$+CHR$(0)
   ILBMload&=VARPTR(Code%(0))          
   CALL ILBMload&(SADD(file0$))       
  RETURN

----------------------------------------------------------------------------

' 2560-by-200, one bit plane
 CLEAR,25000
 CLEAR,70000&
  DEFINT a-y 
  DIM B1%(8000),B2%(8000)
  DIM B3%(8000),B4%(8000)
  ON BREAK GOSUB Ender
  BREAK ON
  WINDOW 1,,(20,20)-(300,70),23
  PRINT "working
  DECLARE FUNCTION ViewPortAddress&() LIBRARY
  LIBRARY "intuition.library"
  GOSUB InitILBM
  
  SCREEN 2,640,400,1,4
  WINDOW 2,"",,0,2
  WINDOW 1
  COLOR 1,3:CLS:PRINT " Still working ....
  WINDOW OUTPUT 2
  
  FileName$="FIRST PICTURE"
  
  GOSUB ILBMloading 

'**** Read palette from first picture
  Nc=1
  DIM Zal(4,3)  
GetPalette:  
  vpa&=ViewPortAddress&(WINDOW(7))
  ColorTable&=PEEKL(PEEKL(vpa&+4)+4)
  FOR I=0 TO Nc
    zB.G=PEEK(ColorTable&+2*I+1)
    zR=PEEK(ColorTable&+2*I)*.0625
    zG=(zB.G*.0625)*.0625  
    zB=(zB.G MOD 16)*.0625   
    Zal(I,0)=zR:Zal(I,1)=zG: Zal(I,2)=zB 
  NEXT I
     
  GET(0,0)-(632,195),B1%
  GET(0,196)-(632,390),B2%

'**** get second pic
 
  FileName$="SECOND PICTURE"
  GOSUB ILBMloading 
  GET(0,0)-(632,195),B3%
  GET(0,196)-(632,390),B4%
  
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  
  SCREEN 2,640,400,1,1
  WINDOW 2,,(0,0)-(331,205),0,2
  FOR I=0 TO Nc
    PALETTE I,Zal(I,0),Zal(I,1),Zal(I,2)
  NEXT  

  MyWindow&=WINDOW(7)
  BlockPen&=MyWindow&+99
  POKE BlockPen&,0
  RefreshWindowFrame&(MyWindow&)

Main:
 WHILE 1
  FOR I=0 TO 957
    PUT(-I,0),B1%,PSET
    PUT(-I+632,0),B2%,PSET
  NEXT
  
  FOR I=326 TO 632
    PUT(-I,0),B2%,PSET
    PUT(-I+632,0),B3%,PSET
  NEXT
  
  FOR I=0 TO 957
    PUT(-I,0),B3%,PSET
    PUT(-I+632,0),B4%,PSET
  NEXT
  
  FOR I=326 TO 632
    PUT(-I,0),B4%,PSET
    PUT(-I+632,0),B1%,PSET
  NEXT
 WEND 

Ender:
  WINDOW 1,,(20,20)-(300,70),23
  COLOR 1,3:CLS
  MyWindow&=WINDOW(7)
  TextPen&=MyWindow&+98
  POKE TextPen&,1
  BlockPen&=MyWindow&+99
  POKE BlockPen&,3
  RefreshWindowFrame&(MyWindow&)
  LIBRARY CLOSE
  CLEAR,25000
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  SYSTEM
  END
  
InitILBM:
   DIM Code%(1220)    
   OPEN "ILBM.code" FOR INPUT AS #1
   I=0  
   WHILE NOT EOF(1)
     INPUT#1,Code%(I) : I=I+1 
   WEND
   CLOSE #1
   OpenFlag=0   
  RETURN

ILBMloading:
   file0$=FileName$+CHR$(0)
   ILBMload&=VARPTR(Code%(0))          
   CALL ILBMload&(SADD(file0$))       
  RETURN

3]END OF PROGRAM LISTINGS AND END OF TEXT
