home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / atari / 8bit / 5850 < prev    next >
Encoding:
Text File  |  1993-01-12  |  7.3 KB  |  198 lines

  1. Newsgroups: comp.sys.atari.8bit
  2. Path: sparky!uunet!caen!mtu.edu!jjmcwill
  3. From: jjmcwill@mtu.edu (Jeff McWilliams)
  4. Subject: Re: Anyone added memory to a 65XE?
  5. Message-ID: <1993Jan12.181003.8144@mtu.edu>
  6. Organization: Michigan Technological University
  7. References: <TROYER.93Jan12101714@finmark.nynexst.com>
  8. Date: Tue, 12 Jan 1993 18:10:03 GMT
  9. Lines: 187
  10.  
  11. In article <TROYER.93Jan12101714@finmark.nynexst.com> troyer@nynexst.com (Tom Royer) writes:
  12. >Hello,
  13. >
  14. >   I am interested in adding some ram to my 65XE.  Has anyone done this?  I assume that it would
  15. >be a pretty easy "piggy-back" style hack.  There is ADDMEM[AB].ARC in the archive, but it
  16. >doesn't mention the 65XE in the abstract (it does mention the 130XE).  If anyone could explain
  17. >exactly how bank switched memory works on these machines, it would be greatly appreciated.
  18. >
  19. >-Tom Royer
  20. > troyer@nynexst.com
  21.  
  22. How the XE's do banking.
  23.  
  24. In the 130XE, there and all the XL/XE series, there is a register 
  25. located at $D301 which is part of the internal Peripheral Interface
  26. Adapter chip.  This register is 8 bits wide, and on the 130XE, the 
  27. bits are laid out as follows:
  28.  
  29.  
  30. 0    BASIC ROM enable
  31. 1    OS ROM    enable
  32. 2    XE bank bit
  33. 3    CPU bank enable
  34. 4    ANTIC bank enable
  35. 5    XE bank bit
  36. 6    unused
  37. 7    diagnostic ROM enable
  38.  
  39. Well, that's the gist of it anyway, I might have got the bit numbers wrong,
  40. but the labels are pretty much correct.
  41.  
  42. The Atari memory map can be divided into four chunks, labelled like this:
  43.  
  44. $0000              -------------------
  45.                    |                 |
  46.                    |                 |
  47.                    |                 |
  48. $4000              -------------------
  49.                    |                 |
  50.                    |                 |
  51.                    |                 |
  52. $8000              -------------------
  53.                    |                 |
  54.                    |                 |
  55.                    |                 |
  56. $C000              -------------------
  57.                    |                 |
  58.                    |                 |
  59.                    |                 |
  60. $FFFF              -------------------
  61.  
  62. That's the 64K memory space of the 6502 chip.  
  63.  
  64. When divided into 4 pieces, each piece is 16K in length.
  65. The banked RAM, of which there is another 64K of this in the 130XE, 
  66. is also divided into 4 pieces, each 16K in length.
  67.  
  68. When you set, say, bit 3 high, the CPU will now see banked memory.
  69. Where does the CPU see it?  The area of main RAM, between $4000 and
  70. $8000 gets swapped out, and one of the banks gets swapped in.
  71. Thus, any reads or writes to the $4000 to $7FFF area now writes to 
  72. BANKED RAM, and doesn't touch the main memory.
  73. You tell which of the 4 banks are available in this memory "WINDOW"
  74. by the values of bits 5 and 2.
  75.  
  76. So, it you could number the banks like this:
  77.  
  78. bit 5  bit 2   bank number
  79.  
  80. 0       0          0
  81. 0       1          1
  82. 1       0          2
  83. 1       1          3
  84.  
  85.  
  86.  
  87. ANTIC BANKING
  88.  
  89.  
  90.  
  91. There is another microprocessor inside your Atari, besides the main CPU, 
  92. called the 6502.  The other processor is called the Antic chip. 
  93. Antic is contstantly telling the 6502 to stop what it's doing, so that
  94. the Antic can take over the computer, and handle the graphics display.
  95. That's what Antic is designed for, graphics.  The Antic has its own 
  96. programming language, and a program written in it is called the display list.
  97. A display list tells the Antic CPU what sort of graphics mode is to be 
  98. displayed on the screen, and where in memory the screen data is to be found.
  99.  
  100. What if you did the following?
  101.  
  102. Set the banking bits, #s 5 and 2, to zero, to access bank zero.
  103. Set bit 3 to 1, allowing the CPU to see the banked RAM.
  104. load a graphics 8 picture into the $4000-$7FFF area.
  105. clear bit 3 (set it to 0), and set bit 4, allowing the Antic to see the
  106. bank.  Now tell Antic's to look for display data at $4000, and 
  107. that it's a graphics 8 mode.
  108.  
  109. What have you done?  Well, now, Antic sees the picture that is stored in
  110. BANKED RAM, but the CPU which looks in the same area, still sees main RAM!
  111. That's one of the things I think is really neat about 130XE banking.
  112. Usually, a graphics 8 screen consumes 8K of memory.  In a computer
  113. without extended RAM, like a stock 65XE, if you set up a graphics 8 
  114. display for a game or an application or something, that's 8K less room
  115. you have to store your program. 
  116. With the 130XE, you could "hide" the 8K of display in a bank of extended
  117. memory, and thus freeing 8K of memory in main memory to store your program 
  118. code.  Of course, when you want to make changes to the display, you would
  119. have to allow the CPU to see the memory bank as well, modify the display
  120. data, and then switch off the CPU bank enable.
  121.  
  122. Concersely, you could do the just opposite, and have only the CPU see banked
  123. RAM, and the Antic sees main RAM.  That way you could load in an extra 64K
  124. of code, in modules each 16k long, and as your program needs to access
  125. the different modules, you would just switch in the appropriate bank.
  126.  
  127. How is this possible?  Because the extended RAM circuitry knows how to
  128. differentiate between when the Antic is in control of the computer, and 
  129. when the 6502 CPU is in control.  Depending on which is in control,  
  130. and trying to read/write to the $4000-$7FFF area, the extended memory
  131. controller can look at the settings of $D301, and allow the CPU or Antic
  132. chip "see" the RAM they are supposed to see.
  133.  
  134.  
  135.  
  136. How is a 256K upgrade set up?  Look again at the table just below.
  137.  
  138.  
  139. 0    BASIC ROM enable
  140. 1    OS ROM    enable
  141. 2    XE bank bit
  142. 3    CPU bank enable
  143. 4    ANTIC bank enable
  144. 5    XE bank bit
  145. 6    unused
  146. 7    diagnostic ROM enable
  147.  
  148. And now we'll modify it so it looks like this.
  149.  
  150. 1    OS ROM    enable
  151. 2    XE bank bit
  152. 3    CPU bank enable
  153. 4    bank bit          
  154. 5    XE bank bit
  155. 6    bank bit
  156. 7    diagnostic ROM enable
  157.  
  158. As you see, bit 4 is no longer an Antic enable bit, it's used for 
  159. banking.  Likewise, bit 6, which was previously unused, it now used for
  160. banking as well.
  161.  
  162. This gives you 2^4, or 16 possible banks.  Of those, only 12 are used
  163. in a 256K upgrade, giving 192K of banked RAM available.
  164. Well, what happens to the Antic access to banked RAM.
  165. Well, depending on which 256K upgrade you've done, on some, Antic will
  166. always see just main memory, it will never see banked RAM.
  167. On others, if the CPU sees banked RAM, then so does the Antic chip.
  168. This can be somewhat limiting, but it's about the only way to
  169. make bigger memory modifications, without say, disabling the BASIC
  170. ROM enable bit, and using it as a banking bit instead.
  171. 320K upgrades actually use all 16 possible combinations of the 4
  172. banking bits... anything beyond that will start using bit 0
  173. and maybe even bit 7.  The Newell 1088K memory upgrade disables
  174. BASIC on/off switching, and uses bit 0 for banking.  It also
  175. uses bit 7.  When bit 3 is set, bit 7 is a banking bit.
  176. WHen bit 3 is clear, bit 7 is a diagnositic ROM enable bit.
  177.  
  178. Well, I hope that helps you to understand a little more about memory
  179. banking.  I think I've covered everything, and haven't made any
  180. mistakes.  If I have, I'm sure somebody will point them out in a following
  181. post.  :)
  182.  
  183.  
  184.  
  185. As far as 65XE upgrades go, I think Innovative Concepts might have 
  186. one.  I'm not sure they're still in business though, and I don't have
  187. the address handy.
  188.  
  189. Jeff McWilliams
  190.  
  191.  
  192.  
  193. -- 
  194. Jeff McWilliams  jjmcwill@mathlab.mtu.edu  EE Engineer --> Michigan Tech. 
  195. The Minstrel Boy to the war is gone,
  196.       In the ranks of death you'll find him;
  197. His father's sword he has girded on,
  198.