wrote: > In article <395A6B1A.69F3106F@dcnet2000.com>, > Phoenyx wrote: > > It isn't possible to run Applesoft from bank 1 ram. > > Could you explain why? Lots of reasons. Off the top of my head: 1. Auxiliary page 2 is reserved by the operating system. If you tried to run Applesoft with auxiliary memory active, then Applesoft would use this area as an input buffer, overwriting the /RAM driver in the process. 2. With auxiliary memory switched in, page 3 no longer contains the vectors used by the monitor, BASIC, BASIC.SYSTEM and ProDOS (interrupt, etc.). The corresponding area ($3D0-$3FF) is reserved by the system. 3. The text screen won't work, unless you are running in 80-column mode (or possibly in 40-column mode with the 80-column firmware active), since you can't access the correct memory area. 4. BASIC.SYSTEM won't run in auxiliary memory. 5. ProDOS cannot be called from auxiliary memory, and the ProDOS global page ($BF00-$BFFF) would be missing. Running an Applesoft program in auxiliary memory under DOS 3.3 might be feasible, as long as nothing in the monitor firmware plays with the RDMAIN, RDAUX, WRMAIN and WRAUX soft switches. You would have to use the main memory zero page, stack and language card areas, and copy some data from the end of main page 3 into auxiliary page 3. DOS 3.3 itself would also have to be copied into auxiliary memory. Trying to run a "loaded into the language card" version like DiversiDOS might be risky. Trying to use 80-column mode and/or double hi-res graphics is likely to cause problems. > Which areas are switched when you change banks? Ignoring the 80-column mode bank switching (potentially $0400-$07FF and $2000-$3FFF), there are two main sets of soft switches for controlling main/auxiliary bank switching. One set controls the area from $0200-$BFFF (with the possible exception of page 1 of the video buffers). There are separate switches to select the bank for reading and the bank for writing, so it is possible to copy data from one bank to the other. The 80-column firmware provides a routine that copies data between the banks, and another one to transfer execution control between the banks. The other set controls the zero page, stack and language card areas ($0000-$01FF and $D000-$FFFF). Both read and write access are switched at the same time. Note that the language card area ($D000 to $FFFF) also has its own set of soft switches (dating back to the original Language Card in the Apple ][ or ][+) which operate independently of the main/auxiliary selection. If ROM is active for read and language card write is disabled, then the MAINZP/AUXZP switches will effectively only cause the $0000-$01FF area to be switched (but the language card has switched banks, and this will "take effect" when the language card soft switches are changed to allow reading or writing into its RAM). > Which areas stay the same? The I/O space at $C000-$CFFF is the only memory area which is unaffected by the auxiliary memory soft switches. Potentially the ROM can remain available, as I mention above. > I assume the zero page remains the same, but what about the Hires > pages? Text pages? The 40-column mode text, GR and HGR pages only exist in main memory. If you switch the $0200-$BFFF area to auxiliary memory and are not running with the 80-column firmware active, then you will not be able to access the video buffers. The computer will still display the data that was on the screen before. The 80-column modes (text, double lo-res and double hi-res) use mirrored buffers in main and auxiliary memory, occupying the same range of addresses. For 80-column text mode, alternating bytes are taken from auxiliary and main memory at the same location (even columns are auxiliary, odd columns are main, numbering from zero). Thus: Aux $0400 is row 0 col 0 Main $0400 is row 0 col 1 Aux $0401 is row 0 col 2 Main $0402 is row 0 col 3 etc. A similar technique is used for hi-res mode, with interleaved bytes and seven pixels coming from each byte (assuming a monochrome display). The 80-column hardware uses four pairs of soft switches: 80VID determines whether the system is displaying 80-column video (ON) or 40-column video (OFF). For double hi-res to be displayed, the Annunciator 3 soft switch must also be in the correct state, and both GR (not TEXT) and HGR must be active. The PAGE1/PAGE2 switch can sometimes be used to toggle between displaying 80-column or doube hi-res text pages 1 and 2. (80-column text page 2 is never used, and double hi-res page 2 is rarely used.) 80STORE controls memory mapping for the video buffers. If 80STORE is OFF, then the $0400-$07FF and $2000-$3FFF areas are controlled by the main/auxiliary soft switches, and will be switched along with $0200-$BFFF, with separate read/write control, as described earlier. If 80STORE is ON, then the $0400-$07FF and possibly the $2000-$3FFF areas are isolated from the main/auxiliary switches and are instead controlled by the PAGE1/PAGE2 switch that is normally used to select the displayed video page. It is not possible to display video page 2 while 80STORE is ON. With 80STORE ON and PAGE1 selected, the $0400-$07FF area accesses main memory (the 40-column text mode buffer, or the odd numbered columns of 80-column text mode). With 80STORE ON and PAGE2 selected, the $0400-$07FF area accesses auxiliary memory (the even numbered columns of 80-column text mode). I'm not entirely clear on how double hi-res switching works without referring to the manual, but if I remember right then $2000-$3FFF will switch in the same manner _if_ the annunciator 3 soft switch is in the correct state, otherwise this area is not affected by the 80STORE switch. > What happens to Applesoft? It is in ROM, so it is not affected at all by switching the $0200-$BFFF area, apart from any data it needs to access in those areas (including the input buffer, part of page 3, the text screen, and anything which is hooked into it, such as DOS 3.3 or BASIC.SYSTEM). Switching zero page, the stack and the language card is more likely to cause problems, but Applesoft itself will still be accessible as long as the language card area is set to read from ROM. -- David Empson dempson@actrix.gen.nz Snail mail: P O Box 27-103, Wellington, New Zealand