From: moon!cyberden!phbill@well.sf.ca.us
Newsgroups: comp.sys.atari.8bit
Subject: Action! problem.
Date: Mon, 07 Sep 92 12:43:40 PDT
Organization: Indescribable Creations

Remember APACSET2, that little LIST I made (I didnt upload it to the 
archives yet, did I?!?!?).  Anyways, I loaded it into Action! and edited 
it as best as I know how, but it just won't work! (it crashes, luckily 
[RESET] saves it (usually)).  I believe my problem may be in my "PROC 
CALL=$0600()" or my attempt to fill up page 6 with data...

Here's what I've got:
;  apacset v3.0 bill kendrick 9-7-92 
 
Module
  Card DL  ; DL is global
 
Proc Call=$0600() ;  aka U=USR(1536)
 
Proc APAC()
 Byte Pos
 Card SC,TempCard,Counter
  Byte Array MLRtn="<ML routine to turn on APAC mode..it's 79 bytes long>"
  Graphics(11)
  DL=(Peek(106)-40)*256 ; find room for DL
  TempCard=PeekC(560)   ; copy some of old DL
  MoveBlock(DL,TempCard,3) ; into new DL
  TempCard==+198
  MoveBlock(DL+572,TempCard,10)
  SC=PeekC(88)
  For Counter=3 TO 570 Step 6
  Do
    Poke(DL+Counter,207)      ; write new DL data
    PokeC(DL+Counter+1,SC+Pos)
    Poke(DL+Counter+3,79)
    PokeC(DL+Counter+4,SC+Pos+3840)
    Pos==+40
  OD
  PokeC(560,DL)  ; set display list pointer to DL
  MoveBlock(1536,MLRtn,79) ; copies ML routine into Page 6
  Poke(204,0)
  Call()  ; call APAC routine at page 6
Return
 
Proc ScreenOn(Byte Dither,Lum)
  Graphics(43)
  PokeC(560,DL)    ; point display list to APAC2 DL
  Poke(54286,192)  ; turn on DLI
  Poke(204,Dither)
  Poke(712,Lum)
Return
 
Proc Off()
  Graphics(41)
Return
 
Proc Demo()
 Byte Col,Lum,X,Y,XDir,YDir
  APAC()
  ScreenOn(1,4)
  Do
    Lum=Lum+1
    If Lum=16 Then
      Lum=0
      Col=Col+1
      If Col=16 Then
        Col=0
      Fi
    Fi
    Color=Col ; color
    Plot(X,Y)
    Color=Lum ; luminence
    Plot(X,Y+96)
    X=X+XDir
    If X=79 Then
      XDir=-1
    Fi
    If X=0 Then
      XDir=1
    Fi
    X=Y+YDir
    If Y=95 Then
      YDir=-1
    Fi
    If Y=0 Then
      YDir=1
    Fi
  Od
Return
 
Here's a quick rundown.  CALL is just the equivalent to "USR", but in 
Action! you've got to make it a PROCedure and tell it where to point to.  
PROCedure APAC is the routine that stores the APAC mode ML routine into 
page 6 memory (or at least TRIES to) and sets up the APAC2 display list.  
SCREENON simply turns on the graphics mode, points to the new display 
list (for APAC2) and sets the DLI, dither mode and screen luminence.  OFF 
just turns off dither and sets the screen to normal (not APAC2).  
Finally, DEMO calls APAC and SCREENON to set it up, then just bounces a 
dot around on the screen (leaving a trail of 256 different colors).  If 
you were to add a GRAPHICS(11) or (9) command right after the SCREENON(), 
it will at least get to the drawing routine, but I think there might be 
some sort of problem drawing onto the APACscreen.  Duh, I guess I could 
attempt loading a screen into memory, then setting up the APAC mode...  
Anyways, that's not JUST what I want it to do, so I still need this 
little ditty fixed!!  Any help would be MUCH appreciated.  I haven't read 
through the ENTIRE Action! manual, but I read (over and over!) bits about 
arrays and routine calls and stuff.  

Again, my best guesses is either 1) didnt do the page 6 setup right
                                 2) didnt copy data from MLRtn to page 6
                                    properly.
                                 3) don't have the memory set up right 
                                    for the graphics mode or DL free RAM
                                    (I'm assuming Graphics() calls alloc-
                                    ate free RAM, but maybe pointing DL 
                                    to RAMtop-40 was a stupid idea by me)
anyways....  thanx in advance.....(grumble grumble.. I need to read that
                                  book AGAIN!)

PhBill: Bill Kendrick               |||  1200 Cyberden BBS (+1 415 472-5527)
Moon!Cyberden!PhBill@Well.SF.CA.US / | \ 2600 North of San Francisco California

Newsgroups: comp.sys.atari.8bit