doc/classes/AppleDos.src/M000250.html in ripxplore-0.11.0 vs doc/classes/AppleDos.src/M000250.html in ripxplore-0.12.0

- old
+ new

@@ -3,35 +3,29 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>find_catalog_slot (AppleDos)</title> + <title>set_sector (AppleDos)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> - <pre><span class="ruby-comment cmt"># File lib/file_systems/AppleDos.rb, line 295</span> -<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_catalog_slot</span>(<span class="ruby-identifier">file_system_image</span>,<span class="ruby-identifier">filename</span>) - <span class="ruby-identifier">vtoc_sector</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">vtoc_track_no</span>,<span class="ruby-identifier">vtoc_sector_no</span>) - <span class="ruby-identifier">catalog_filename</span>=<span class="ruby-identifier">catalog_filename</span>(<span class="ruby-identifier">filename</span>.<span class="ruby-identifier">upcase</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">nil?</span> - <span class="ruby-identifier">catalog_track_no</span>=<span class="ruby-identifier">vtoc_sector</span>[<span class="ruby-value">01</span>] - <span class="ruby-identifier">catalog_sector_no</span>=<span class="ruby-identifier">vtoc_sector</span>[<span class="ruby-value">02</span>] + <pre><span class="ruby-comment cmt"># File lib/file_systems/AppleDos.rb, line 318</span> +<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set_sector</span>(<span class="ruby-identifier">file_system_image</span>,<span class="ruby-identifier">track</span>,<span class="ruby-identifier">sector</span>,<span class="ruby-identifier">contents</span>) + <span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">set_sector</span>(<span class="ruby-identifier">track</span>,<span class="ruby-identifier">sector</span>,<span class="ruby-identifier">contents</span>) - <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">catalog_track_no</span><span class="ruby-operator">+</span><span class="ruby-identifier">catalog_sector_no</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>) <span class="ruby-keyword kw">do</span> - <span class="ruby-identifier">catalog</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">catalog_track_no</span>,<span class="ruby-identifier">catalog_sector_no</span>) - (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">7</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">slot_no</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">slot_start</span>=<span class="ruby-identifier">slot_no</span><span class="ruby-operator">*</span><span class="ruby-value">0x23</span><span class="ruby-operator">+</span><span class="ruby-value">0x0</span><span class="ruby-constant">B</span> - <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">catalog</span>[<span class="ruby-identifier">slot_start</span>]<span class="ruby-operator">==</span><span class="ruby-value">0x00</span>)<span class="ruby-operator">||</span> (<span class="ruby-identifier">catalog</span>[<span class="ruby-identifier">slot_start</span>]<span class="ruby-operator">==</span><span class="ruby-value">0x</span><span class="ruby-constant">FF</span>) <span class="ruby-keyword kw">then</span> - <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">catalog_track_no</span>,<span class="ruby-identifier">catalog_sector_no</span>,<span class="ruby-identifier">slot_start</span>] - <span class="ruby-keyword kw">end</span> - <span class="ruby-keyword kw">if</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">filename</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">catalog</span>[<span class="ruby-identifier">slot_start</span><span class="ruby-operator">+</span><span class="ruby-value">0x03</span><span class="ruby-operator">..</span><span class="ruby-identifier">slot_start</span><span class="ruby-operator">+</span><span class="ruby-value">0x20</span>]<span class="ruby-operator">==</span><span class="ruby-identifier">catalog_filename</span>) <span class="ruby-keyword kw">then</span> - <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">catalog_track_no</span>,<span class="ruby-identifier">catalog_sector_no</span>,<span class="ruby-identifier">slot_start</span>] - <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt">#now mark sector as used in sector usage list </span> + <span class="ruby-keyword kw">if</span> ((<span class="ruby-identifier">track!</span>=<span class="ruby-identifier">vtoc_track_no</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">sector!</span>=<span class="ruby-identifier">vtoc_sector_no</span>)) <span class="ruby-keyword kw">then</span> <span class="ruby-comment cmt">#don't bother marking the VTOC sectors used </span> + <span class="ruby-identifier">sector_usage_bitmap_sector</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">vtoc_track_no</span>,<span class="ruby-identifier">vtoc_sector_no</span>) + <span class="ruby-identifier">offset_of_byte_containing_this_sector</span>=<span class="ruby-value">0x38</span><span class="ruby-operator">+</span>(<span class="ruby-identifier">track</span><span class="ruby-operator">*</span><span class="ruby-value">4</span>) + <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sector</span><span class="ruby-operator">&lt;</span><span class="ruby-value">8</span> <span class="ruby-keyword kw">then</span> + <span class="ruby-identifier">offset_of_byte_containing_this_sector</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span> <span class="ruby-keyword kw">end</span> - <span class="ruby-identifier">catalog_track_no</span>=<span class="ruby-identifier">catalog</span>[<span class="ruby-value">01</span>] - <span class="ruby-identifier">catalog_sector_no</span>=<span class="ruby-identifier">catalog</span>[<span class="ruby-value">02</span>] + <span class="ruby-identifier">byte_containing_this_sector</span>=<span class="ruby-identifier">sector_usage_bitmap_sector</span>[<span class="ruby-identifier">offset_of_byte_containing_this_sector</span>] + <span class="ruby-identifier">byte_containing_this_sector</span>=<span class="ruby-identifier">byte_containing_this_sector</span><span class="ruby-operator">&amp;</span>(<span class="ruby-value">0xff</span><span class="ruby-operator">-</span>(<span class="ruby-value">2</span><span class="ruby-operator">**</span>(<span class="ruby-identifier">sector</span><span class="ruby-operator">%</span><span class="ruby-value">8</span>))) + <span class="ruby-identifier">sector_usage_bitmap_sector</span>[<span class="ruby-identifier">offset_of_byte_containing_this_sector</span>]=<span class="ruby-identifier">byte_containing_this_sector</span> + <span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">set_sector</span>(<span class="ruby-identifier">vtoc_track_no</span>,<span class="ruby-identifier">vtoc_sector_no</span>,<span class="ruby-identifier">sector_usage_bitmap_sector</span>) <span class="ruby-keyword kw">end</span> - <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file