home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 157 / 157.d81 / t.infra < prev    next >
Text File  |  2022-08-26  |  6KB  |  215 lines

  1.  
  2.         THE MIGHTY LOADSTAR
  3.  
  4.      C-64 INFRASTRUCTURE GUIDE
  5.  
  6.     According to Knees Calhoon
  7.  
  8.    Hex    Dec  Page
  9.  ---------------------------------
  10.   $0000    0     0
  11.  
  12.  This area is filled with registers
  13. you can POKE or PEEK. The best list
  14. is found in Sheldon Leemon's MAPPING
  15. THE C-64. The Programmer's Reference
  16. Guide has a concise list on pages
  17. 310-320.
  18.  
  19.  ---------------------------------
  20.   $0400   1024    4
  21.  
  22.  These 1000 bytes are the default
  23. screen if you are in bank 0, the
  24. default bank. 1024 is the top, left
  25. cell of the screen and 2047 is the
  26. bottom right cell. You can POKE these
  27. locations and characters will appear
  28. on the screen but for compatibility
  29. with old, old C-64s, you should also
  30. POKE the corresponding color map at
  31. $D800. I do this by making C = 54272
  32. then for every POKExxxx to the screen
  33. I do a POKExxxx+C. You may also PEEK
  34. these bytes to find out what's in a
  35. cell. In general, PRINTing to the
  36. screen is better than POKEing to the
  37. screen.
  38.  
  39.  ---------------------------------
  40.   $07F8     2040    7
  41.  
  42.  These eight bytes are the sprite
  43. pointers. They tell the VIC chip
  44. where the sprite definition data for
  45. each sprite is found. Since each
  46. sprite uses 64 bytes (technically,
  47. 63) there's room in bank 0 for 256
  48. sprite definitions. Safe locations
  49. are 11, 13-15, 32-63 (if BASIC has
  50. been raised to at least page 64), and
  51. 128-255. See SPRITE SEMINAR on THE
  52. COMPLEAT PROGRAMMER for details on
  53. using sprites.
  54.  
  55.  ---------------------------------
  56.   $0800     2048    8
  57.  
  58.  (POKE this with 0 if you get a
  59. "syntax error" when using normal
  60. immediate mode BASIC commands)
  61.  
  62.   $0801     2049    8
  63.  
  64.  This is the start of your BASIC
  65. program text. If you want to have a
  66. custom font and your program is
  67. larger than 30 or so blocks, then a
  68. good place to put the 2048 bytes of
  69. font data is from $0800 to $1000. To
  70. do this you must use a boot program
  71. that does this: POKE44,16:CLR then
  72. loads and runs your BASIC program
  73. (which will then be at $1000.)
  74.  
  75.    $1000   4096    16
  76.  
  77.  These 4096 bytes are where the VIC
  78. chip keeps an "image" of the font
  79. data for bank 0. This means that you
  80. can use this area for BASIC text or
  81. ML routines but you CAN'T use it for
  82. sprite or font data. Because of this,
  83. $1000 is a great place for putting ML
  84. routines or toolboxes. Just POKE44
  85. with a page number right above where
  86. your ML toolbox ends. If the toolbox
  87. is 16 blocks long and starts at
  88. $1000, then POKE44,32 in your boot
  89. program and your BASIC program will
  90. start above the toolbox at $2000.
  91.  
  92.    $1800   6144    24
  93.  
  94.  The rest of the bank 0 BASIC text
  95. area. If you move the start of the
  96. BASIC text to $4000 (with POKE44,64
  97. in a boot program) then this area can
  98. be used for sprite or font data. If
  99. your program is less than 20 or so
  100. blocks you can use this area for
  101. sprites or fonts WITHOUT moving the
  102. start of BASIC in a boot. Just lower
  103. the top of BASIC with POKE56,page:CLR
  104. at the beginning of your program.
  105. POKE56,32 will allow you to use pages
  106. 32-64 ($2000-$4000) for sprite or
  107. font data, while restricting your
  108. BASIC program (and variables) to
  109. pages 8-31.
  110.  
  111.    $4000    16384   64
  112.  
  113.  This is bank 1 and one fourth of
  114. bank 2. It's for BASIC text and
  115. variables (unless you change the
  116. range of this area by POKEing 44 or
  117. 56 as described above). Unless you
  118. change banks, you can't put sprite or
  119. font data here. However, if you use a
  120. ML memory copy routine (COPYMEM) you
  121. can store lots of data here (after
  122. POKEing 56) and copy it down into
  123. bank 0 as needed.
  124.  
  125.   --------------------------------
  126.    $9000   40960   160
  127.  
  128.  This is where the C-64's BASIC ROM
  129. is seen. Ordinarily you can't use
  130. this area for anything but many ML
  131. routines (especially toolboxes) allow
  132. you to store any kind of data here.
  133. This is the recommended place for
  134. screen data because it doesn't take
  135. away any BASIC text area and can't be
  136. used for anything other than data. ML
  137. routines generally won't work here.
  138.  
  139.   --------------------------------
  140.    $C000   49152   192
  141.  
  142.  The famous "C-thousand area". You
  143. can put any kind of data or ML
  144. routines here. Since it's the
  145. location of so many ML routines, many
  146. programmers don't use it for their
  147. routines, saving it for routines that
  148. other people wrote and MUST be here.
  149.  
  150.   --------------------------------
  151.    $D000   53248   208
  152.  
  153.  The Input/Output area, in one sense.
  154. You can't put ML routines here if
  155. there's going to be any normal disk
  156. access. In another sense, this is
  157. where the CPU sees the VIC chip, so
  158. here is where all the sprite
  159. registers are (from $D000 to $D02E).
  160. The best way to handle sprites in
  161. your program is to make V=53248 and
  162. then POKEV+x where x is a number from
  163. 0 to 46. See PRG pages 321-323 for a
  164. list of the registers. You POKE these
  165. to change sprite colors, locations,
  166. size, etc.
  167.  
  168.    $D400   54272   212
  169.  
  170.  This is the SID chip. You POKE these
  171. to make sounds, although it's better
  172. to let RACKETMEISTER or SFX GENERATOR
  173. do the POKEing for you. There's only
  174. 28 registers but don't use the rest
  175. of this area for anything by maybe
  176. stored screens.
  177.  
  178.    $D800   55296   216
  179.  
  180.  The first 1000 bytes are the COLOR
  181. RAM map. It corresponds with the 1000
  182. bytes of the screen down at $0400.
  183. You can POKE or PEEK these bytes but
  184. you should AND the value with 15
  185. since the upper nybble of each cell
  186. is either not used, or used for
  187. something else. For instance, use
  188. PEEK(1024+C)AND15 to find the color
  189. of the top, left cell (if C is
  190. defined as 54272).
  191.  
  192.    $DC00   56320   220
  193.  
  194.  This is the CIA area. It has lots of
  195. important registers you can POKE or
  196. PEEK if you know what they do. The
  197. PRG has a list on pages 328-334 but
  198. MAPPING explains them all in detail.
  199.  
  200.   -------------------------------
  201.    $E000   57344   224
  202.  
  203.  This is the Kernal ROM, full of
  204. handy routines that were designed to
  205. be called from ML but can be called
  206. from BASIC if you know how. The PRG
  207. has a quick listing on pages 272-273
  208. with more detailed explanations on
  209. pages 274-306. MAPPING is packed with
  210. details on using these canned
  211. routines.
  212.  
  213.   --------------------------------
  214.  
  215.