[comp.sys.apple2] 8 bit screen blanking

max.pendragon@pro-lep.cts.com (Max Pendragon) (10/13/90)

Andy,

 On your 8-bit screen blanker, check the Apple //c reference manual, vol 1,
pages 26-47 for more info on the soft switches.  You can read the state of all
(?) of the soft switches, including the state of memory, which you will need
if you run in an alternate bank.  here's a quicky run-down
The first column is the type of instruction required to activate the switch. 
R= read, W = Write, RR = read twice in a row, R7 = read bit 7 for status.

Action      Addr      Name         Function
 
R           $c080                 read ram, no write, $d000 bank 2
RR          $c081                 read rom, write ram, $d000 bank 2
R           $c082                 read rom, no write, $d000 bank 2
RR          $c083                 read/write RAM, $d000 bank 2
R           $c088                 read ram, no write, use $d000 bank 1
RR          $c089                 read rom, write RAM use $d000 bank 1
R           $c08a                 read rom, no write  use $d000 bank 1
RR          $c08b                 read/write RAM use $d000 bank 1
R7          $c011   RDBNK2        state of $d000  (0=bank 1, 1=bank2)
R7          $c012   RDLCRAM       rreading RAM (1) or ROM (0)
W           $c008   ALTZP         aux zpage off (pages 0,1, and lang card?)
W           $c009   ALTZP         aux zpage on (pages 0,1, and lang card?)
R7          $c016   RDALTZP       using aux(1) or main(0) zpage
W           $c002   RAMRD         read main 48K ram
W           $c003   RAMRD         "on"  read aux 48K ram
R7          $c013   RDRAMRD       using main (0) or aux(1) main 48K
W           $c004   RAMWRT        write to main 48K ram
W           $c005   RAMWRT        "on"  write to aux 48K ram
R7          $c014   RDRAMWRT      using main(o) or aux (1) main 48K ram
R           $c050                 use graphics screen
R           $c051                 use text screen
R           $c054                 use page 1 (txt or graphics)
R           $c055                 use page 2 (txt or graphics)
R           $c056                 hi-res off (txt or low-res on)
R           $c057                 hi-res on
R7          $c01d   RDHIRES       read hires is off (0) or on (1)
R7          $c01c   RDPAGE2       read using page 1(0) or page2(1)
W           $c000   80STORE       "off" RAMRD/RAMWRT (see above) control
                                  RAM condition.
W           $c001   80STORE       "on" PAGE2 ($c054/$c055) switches between
                                  page1 main and page1 aux (?)
W           $c07e   IOUDIS        disables IOU access for $c058-$c05F
                                  (so you can use the Dbl-Res swtiches)
W           $c07f   IOUDIS        "off" iou $c058-$c05f off (no dblres switch)
R7          $c07e   RDIOUDIS      read IOUDIS 0=on 1=off
R/W         $c05e   DHIRES        on (turn on dbl-res) (see IOUDIS)
R/W         $c05f   DHIRES        off (turn dbl-res off) (see IOUDIS)
R7          $c07f   RDDHIRES      double-res is off(o) or on (1)
W           $c00e   ALTCHAR       "off" use main char set
W           $c00f   ALTChAR       "on" use aux (mouse) char set
R7          $c01e   RDALTCHAR     using main(0) or aux(1) char set
W           $c00c   80COL         "off" display 40 columns
W           $c00d   80COLl        "on"  display 80 columns
R7          $c01f   RD80COL       using 40 (0) or 80 (1) columns
W           $c000   80STORE       "off" makes PAGE2 switch aux ram
W           $c001   80STORE       "on"  makes PAGE2 switch main ram
R7          $c018   RD80STORE     80STORE is off(0) or on (1)
R7          $C01A   RDTEXT        text switch is off(0) or on (1)
R/W         $c053   MIXED         "off" text only or graphics only
R/W         $c054   MIXED         "on" text/graphics
R7          $c01B   RDMIXED       mixed flag is off(0) or on (1)
R/W         $c057   HIRES         "off" display lo-res graphics
R/W         $c058   HIRES         "on" hires or double-hires
R7          $c01D   RDHIRES       hires is off (0) or on (1)


Well, that is the most complete list I have seen, hope it helps. I tried to
make the explainations for the switches a little more english than some of the
cryptic discriptions I see in the manuals.

Also, a suggestion for blanking the screen.  Don't try and save the time for
each keypress, they may not have a clock.  Use a "tick" counter.  Have a two
or three byte counter that is incremented each time the interupt is called
(VBL, or whatever).  If a key is pressed you reset the counter.  If the
counter reaches a certain value (3 minutes would be hex $2A30 using the VBL)
then you execute the blanking function.  using the above switches you can tell
what mode the apple was in, and save it (compact the status bits to one byte)
for restoring at the next keypress.

If you are going to try to make the application run with other applications,
it is going to have to intercept the interupts, and applications will change
this value.  An install utility could be created, or you could "legally"
install an interupt routine into ProDOS if you can find a "safe" spot in
memory.

Good luck

----------------------------------------------------------------------------
Mark R Hamner "Max Pendragon"    pro-lep!max.pendragon
1801 S. Lakeshore #276 Austin Tx   78741
----------------------------------------------------------------------------
_____

UUCP: crash!pro-lep!max.pendragon
ARPA: crash!pro-lep!max.pendragon@nosc.mil
INET: max.pendragon@pro-lep.cts.com