ripxplore 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. data/bin/ripxplore.rb +103 -95
  2. data/doc/classes/AppleDos.html +20 -22
  3. data/doc/classes/AppleDos.src/M000036.html +18 -0
  4. data/doc/classes/AppleDos.src/M000037.html +18 -0
  5. data/doc/classes/AppleDos.src/M000038.html +18 -0
  6. data/doc/classes/AppleDos.src/M000039.html +73 -0
  7. data/doc/classes/AppleDosPic.html +20 -20
  8. data/doc/classes/AppleDosPic.src/M000051.html +20 -0
  9. data/doc/classes/AppleDosPic.src/M000052.html +18 -0
  10. data/doc/classes/AppleDosPic.src/M000053.html +18 -0
  11. data/doc/classes/AppleDosPic.src/M000054.html +18 -0
  12. data/doc/classes/AppleHiResPic.html +32 -38
  13. data/doc/classes/AppleHiResPic.src/M000012.html +18 -0
  14. data/doc/classes/AppleHiResPic.src/M000013.html +18 -0
  15. data/doc/classes/AppleHiResPic.src/M000014.html +53 -0
  16. data/doc/classes/AppleHiResPic.src/M000015.html +18 -0
  17. data/doc/classes/AppleHiResPic.src/M000016.html +18 -0
  18. data/doc/classes/AppleHiResPic.src/M000017.html +18 -0
  19. data/doc/classes/AxePackedAppleDosPic.html +145 -0
  20. data/doc/classes/AxePackedAppleDosPic.src/M000010.html +59 -0
  21. data/doc/classes/ImageSniffing.html +8 -8
  22. data/doc/classes/ImageSniffing.src/M000008.html +121 -0
  23. data/doc/classes/NADOLPic.html +10 -10
  24. data/doc/classes/NADOLPic.src/M000049.html +20 -0
  25. data/doc/classes/NADOLPic.src/M000050.html +18 -0
  26. data/doc/classes/NativeFileType.html +91 -91
  27. data/doc/classes/NativeFileType.src/M000018.html +22 -0
  28. data/doc/classes/NativeFileType.src/M000019.html +18 -0
  29. data/doc/classes/NativeFileType.src/M000020.html +18 -0
  30. data/doc/classes/NativeFileType.src/M000021.html +18 -0
  31. data/doc/classes/NativeFileType.src/M000022.html +18 -0
  32. data/doc/classes/NativeFileType.src/M000023.html +18 -0
  33. data/doc/classes/NativeFileType.src/M000024.html +18 -0
  34. data/doc/classes/NativeFileType.src/M000025.html +23 -0
  35. data/doc/classes/NativeFileType.src/M000026.html +18 -0
  36. data/doc/classes/NativeFileType.src/M000027.html +18 -0
  37. data/doc/classes/NativeFileType.src/M000028.html +24 -0
  38. data/doc/classes/NativeFileType.src/M000029.html +41 -0
  39. data/doc/classes/NativeFileType.src/M000030.html +24 -0
  40. data/doc/classes/NativeFileType.src/M000031.html +18 -0
  41. data/doc/classes/NativeFileType.src/M000032.html +18 -0
  42. data/doc/classes/NativeFileType.src/M000033.html +18 -0
  43. data/doc/classes/NativeFileType.src/M000034.html +20 -0
  44. data/doc/classes/NativeFileType.src/M000035.html +28 -0
  45. data/doc/classes/PackedAppleDosPic.html +9 -8
  46. data/doc/classes/PackedAppleDosPic.src/M000009.html +40 -0
  47. data/doc/classes/PackedProDosPic.html +145 -0
  48. data/doc/classes/PackedProDosPic.src/M000011.html +40 -0
  49. data/doc/classes/PascalPic.html +10 -10
  50. data/doc/classes/PascalPic.src/M000047.html +20 -0
  51. data/doc/classes/PascalPic.src/M000048.html +18 -0
  52. data/doc/classes/ProDosBINFile.html +186 -0
  53. data/doc/classes/ProDosBINFile.src/M000040.html +20 -0
  54. data/doc/classes/ProDosBINFile.src/M000041.html +18 -0
  55. data/doc/classes/ProDosBINFile.src/M000042.html +18 -0
  56. data/doc/classes/ProDosBINFile.src/M000043.html +18 -0
  57. data/doc/classes/ProDosBinPic.html +15 -15
  58. data/doc/classes/ProDosBinPic.src/M000044.html +20 -0
  59. data/doc/classes/ProDosBinPic.src/M000045.html +18 -0
  60. data/doc/classes/ProDosBinPic.src/M000046.html +18 -0
  61. data/doc/classes/ProDosFile.html +15 -15
  62. data/doc/classes/ProDosFile.src/M000005.html +20 -0
  63. data/doc/classes/ProDosFile.src/M000006.html +18 -0
  64. data/doc/classes/ProDosFile.src/M000007.html +19 -0
  65. data/doc/classes/RipXplore.html +1 -1
  66. data/doc/classes/ScrunchedAppleDosPic.html +139 -0
  67. data/doc/classes/ScrunchedAppleDosPic.src/M000004.html +37 -0
  68. data/doc/created.rid +1 -1
  69. data/doc/files/bin/ripxplore_rb.html +1 -1
  70. data/doc/files/lib/NativeFileType_rb.html +3 -3
  71. data/doc/files/lib/RipXplore_rb.html +2 -2
  72. data/doc/files/lib/file_systems/AppleDos_rb.html +2 -2
  73. data/doc/files/lib/native_file_types/apple2/AppleHiResPic_rb.html +1 -1
  74. data/doc/files/lib/native_file_types/apple2/PackedHiResPicFormats_rb.html +101 -0
  75. data/doc/files/lib/native_file_types/apple2/ProDosFile_rb.html +1 -1
  76. data/doc/files/test/tc_apple_2_rb.html +1 -1
  77. data/doc/files/test/testhelper_rb.html +17 -17
  78. data/doc/files/test/testhelper_rb.src/M000001.html +21 -0
  79. data/doc/files/test/testhelper_rb.src/M000002.html +18 -0
  80. data/doc/files/test/testhelper_rb.src/M000003.html +50 -8
  81. data/doc/fr_class_index.html +14 -0
  82. data/doc/fr_file_index.html +8 -0
  83. data/doc/fr_method_index.html +54 -0
  84. data/doc/index.html +1 -1
  85. data/lib/NativeFileType.rb +3 -2
  86. data/lib/RipXplore.rb +1 -1
  87. data/lib/file_systems/AppleDos.rb +16 -29
  88. data/lib/native_file_types/apple2/AppleHiResPic.rb +11 -10
  89. data/lib/native_file_types/apple2/PackedHiResPicFormats.rb +207 -0
  90. data/lib/native_file_types/apple2/ProDosFile.rb +21 -0
  91. data/test/native_files/30026e5208f55f2cbae4fc591f51de4a-5.png +0 -0
  92. data/test/native_files/f05d95201b4e736216448ba9f9902db6-11.png +0 -0
  93. data/test/native_files/f8819465c0c0eb1e74fa88c7e1e59405-7.png +0 -0
  94. data/test/tc_apple_2.rb +23 -4
  95. data/test/testhelper.rb +2 -0
  96. data/test/testlog.txt +56809 -119242
  97. metadata +68 -3
  98. data/lib/native_file_types/apple2/PackedAppleDosPic.rb +0 -85
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>file_cache (test/testhelper.rb)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File test/testhelper.rb, line 23</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_cache</span>
15
+ <span class="ruby-ivar">@@filecache</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -5,17 +5,59 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>image_has_collection_of (test/testhelper.rb)</title>
8
+ <title>sniff_url (test/testhelper.rb)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File test/testhelper.rb, line 16</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">image_has_collection_of</span>(<span class="ruby-identifier">url</span>,<span class="ruby-identifier">collection_type</span>)
15
- <span class="ruby-identifier">image</span>=<span class="ruby-ivar">@@filecache</span>.<span class="ruby-identifier">get_file_system_image</span>(<span class="ruby-identifier">url</span>)
16
- <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">image</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">collection_type</span>),<span class="ruby-node">&quot;#{url} should contain a collection of #{collection_type}&quot;</span>)
17
- <span class="ruby-identifier">collection</span>=<span class="ruby-identifier">image</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">collection_type</span>)
18
- <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">collection</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>,<span class="ruby-node">&quot;#{url} should contain more than zero #{collection_type}&quot;</span>)
19
- <span class="ruby-keyword kw">end</span></pre>
13
+ <pre><span class="ruby-comment cmt"># File test/testhelper.rb, line 27</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sniff_url</span>(<span class="ruby-identifier">url</span>,<span class="ruby-identifier">expected_image_format</span>,<span class="ruby-identifier">expected_file_system</span>,<span class="ruby-identifier">expected_files</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">assert</span>(<span class="ruby-constant">FileSystemImage</span>.<span class="ruby-identifier">is_file_system_image_filename?</span>(<span class="ruby-identifier">url</span>),<span class="ruby-node">&quot;#{url} should have a known file system image extension&quot;</span>)
16
+ <span class="ruby-identifier">image</span>=<span class="ruby-ivar">@@filecache</span>.<span class="ruby-identifier">get_file_system_image</span>(<span class="ruby-identifier">url</span>)
17
+ <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">expected_file_system</span>,<span class="ruby-identifier">image</span>.<span class="ruby-identifier">file_system</span>,<span class="ruby-node">&quot;validation of file system for #{url}&quot;</span>)
18
+ <span class="ruby-identifier">assert_kind_of</span>(<span class="ruby-identifier">expected_image_format</span>,<span class="ruby-identifier">image</span>.<span class="ruby-identifier">image_format</span>,<span class="ruby-node">&quot;validation of image format for #{url}&quot;</span>)
19
+ <span class="ruby-identifier">assert_not_nil</span>(<span class="ruby-identifier">image</span>.<span class="ruby-identifier">image_format</span>.<span class="ruby-identifier">host_system</span>.<span class="ruby-identifier">full_name</span>,<span class="ruby-value str">&quot;all host systems should implement :full_name&quot;</span>)
20
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expected_files</span>.<span class="ruby-identifier">nil?</span>
21
+ <span class="ruby-identifier">expected_files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">expected_file</span><span class="ruby-operator">|</span>
22
+ <span class="ruby-identifier">expected_file_filename</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:filename</span>]
23
+ <span class="ruby-constant">RipXploreLog</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;validating #{expected_file_filename}&quot;</span>)
24
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;no native files identified in image&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>
25
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;image.files should of type FileContainer but was #{image.files.class} (file system=#{image.file_system})&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">FileContainer</span>)
26
+ <span class="ruby-identifier">native_file</span>=<span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>[<span class="ruby-identifier">expected_file_filename</span>]
27
+ <span class="ruby-identifier">assert_not_nil</span>(<span class="ruby-identifier">native_file</span>,<span class="ruby-node">&quot;#{expected_file_filename} should exist in #{url} - files found: #{image.catalog}&quot;</span>)
28
+ <span class="ruby-identifier">expected_native_file_type</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:expected_native_file_type</span>]
29
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_native_file_type</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
30
+ <span class="ruby-identifier">assert_kind_of</span>(<span class="ruby-identifier">expected_native_file_type</span>,<span class="ruby-identifier">native_file</span>,<span class="ruby-node">&quot;native file type of #{expected_file_filename} should be as specified&quot;</span>)
31
+ <span class="ruby-keyword kw">end</span>
32
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:load_address</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
33
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:load_address</span>]<span class="ruby-operator">==</span><span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">load_address</span>,<span class="ruby-node">&quot;load address of #{expected_file_filename} should be $#{&quot;%04x&quot; % expected_file[:load_address]} but was $#{&quot;%04X&quot; % native_file.load_address}&quot;</span>)
34
+ <span class="ruby-keyword kw">end</span>
35
+
36
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:can_execute</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
37
+ <span class="ruby-identifier">method_to_call</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:can_execute</span>]
38
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_to_call</span>),<span class="ruby-node">&quot;#{expected_file_filename} [#{native_file.class}] should respond to :#{method_to_call}&quot;</span>)
39
+ <span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method_to_call</span>)
40
+ <span class="ruby-keyword kw">end</span>
41
+
42
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:save_output</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
43
+ (<span class="ruby-identifier">method_to_call</span>,<span class="ruby-identifier">extension</span>)=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:save_output</span>]
44
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_to_call</span>),<span class="ruby-node">&quot;#{expected_file_filename} [#{native_file.class}] should respond to :#{method_to_call}&quot;</span>)
45
+ <span class="ruby-identifier">file_cache</span>.<span class="ruby-identifier">purge_native_file_from_cache</span>(<span class="ruby-identifier">native_file</span>)
46
+ <span class="ruby-identifier">file_cache</span>.<span class="ruby-identifier">force_native_file_to_cache</span>(<span class="ruby-identifier">native_file</span>,<span class="ruby-identifier">method_to_call</span>,<span class="ruby-identifier">extension</span>)
47
+ <span class="ruby-keyword kw">end</span>
48
+ <span class="ruby-identifier">expected_file_text_starts_with</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:text_starts_with</span>]
49
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file_text_starts_with</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
50
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_text</span>),<span class="ruby-node">&quot;#{expected_file_filename} should respond to :to_text&quot;</span>)
51
+ <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">expected_file_text_starts_with</span>,<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">to_text</span>[<span class="ruby-value">0</span>,<span class="ruby-identifier">expected_file_text_starts_with</span>.<span class="ruby-identifier">length</span>],<span class="ruby-node">&quot;start of #{expected_file_filename} should be as specified&quot;</span>)
52
+ <span class="ruby-keyword kw">end</span>
53
+
54
+ <span class="ruby-identifier">expected_file_listing_starts_with</span>=<span class="ruby-identifier">expected_file</span>[<span class="ruby-identifier">:listing_starts_with</span>]
55
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expected_file_listing_starts_with</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
56
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_listing</span>),<span class="ruby-node">&quot;#{expected_file_filename} should respond to :to_listing&quot;</span>)
57
+ <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">expected_file_listing_starts_with</span>,<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">to_listing</span>[<span class="ruby-value">0</span>,<span class="ruby-identifier">expected_file_listing_starts_with</span>.<span class="ruby-identifier">length</span>],<span class="ruby-node">&quot;start of #{expected_file_filename} should be as specified&quot;</span>)
58
+ <span class="ruby-keyword kw">end</span>
59
+
60
+ <span class="ruby-keyword kw">end</span>
61
+ <span class="ruby-keyword kw">end</span></pre>
20
62
  </body>
21
63
  </html>
@@ -20,7 +20,21 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Classes</h1>
22
22
  <div id="index-entries">
23
+ <a href="classes/AppleDos.html">AppleDos</a><br />
24
+ <a href="classes/AppleDosPic.html">AppleDosPic</a><br />
25
+ <a href="classes/AppleHiResPic.html">AppleHiResPic</a><br />
26
+ <a href="classes/AxePackedAppleDosPic.html">AxePackedAppleDosPic</a><br />
27
+ <a href="classes/ImageSniffing.html">ImageSniffing</a><br />
28
+ <a href="classes/NADOLPic.html">NADOLPic</a><br />
29
+ <a href="classes/NativeFileType.html">NativeFileType</a><br />
30
+ <a href="classes/PackedAppleDosPic.html">PackedAppleDosPic</a><br />
31
+ <a href="classes/PackedProDosPic.html">PackedProDosPic</a><br />
32
+ <a href="classes/PascalPic.html">PascalPic</a><br />
33
+ <a href="classes/ProDosBINFile.html">ProDosBINFile</a><br />
34
+ <a href="classes/ProDosBinPic.html">ProDosBinPic</a><br />
35
+ <a href="classes/ProDosFile.html">ProDosFile</a><br />
23
36
  <a href="classes/RipXplore.html">RipXplore</a><br />
37
+ <a href="classes/ScrunchedAppleDosPic.html">ScrunchedAppleDosPic</a><br />
24
38
  </div>
25
39
  </div>
26
40
  </body>
@@ -20,7 +20,15 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Files</h1>
22
22
  <div id="index-entries">
23
+ <a href="files/bin/ripxplore_rb.html">bin/ripxplore.rb</a><br />
24
+ <a href="files/lib/NativeFileType_rb.html">lib/NativeFileType.rb</a><br />
23
25
  <a href="files/lib/RipXplore_rb.html">lib/RipXplore.rb</a><br />
26
+ <a href="files/lib/file_systems/AppleDos_rb.html">lib/file_systems/AppleDos.rb</a><br />
27
+ <a href="files/lib/native_file_types/apple2/AppleHiResPic_rb.html">lib/native_file_types/apple2/AppleHiResPic.rb</a><br />
28
+ <a href="files/lib/native_file_types/apple2/PackedHiResPicFormats_rb.html">lib/native_file_types/apple2/PackedHiResPicFormats.rb</a><br />
29
+ <a href="files/lib/native_file_types/apple2/ProDosFile_rb.html">lib/native_file_types/apple2/ProDosFile.rb</a><br />
30
+ <a href="files/test/tc_apple_2_rb.html">test/tc_apple_2.rb</a><br />
31
+ <a href="files/test/testhelper_rb.html">test/testhelper.rb</a><br />
24
32
  </div>
25
33
  </div>
26
34
  </body>
@@ -20,6 +20,60 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
+ <a href="classes/NativeFileType.html#M000025"><=> (NativeFileType)</a><br />
24
+ <a href="classes/NativeFileType.html#M000028">== (NativeFileType)</a><br />
25
+ <a href="classes/NativeFileType.html#M000021">all_native_file_types (NativeFileType)</a><br />
26
+ <a href="classes/NativeFileType.html#M000029">best_fit (NativeFileType)</a><br />
27
+ <a href="classes/NativeFileType.html#M000033">code_for_tests (NativeFileType)</a><br />
28
+ <a href="classes/NativeFileType.html#M000035">compatability_score (NativeFileType)</a><br />
29
+ <a href="classes/NativeFileType.html#M000032">data_without_header (NativeFileType)</a><br />
30
+ <a href="files/test/testhelper_rb.html#M000002">file_cache (test/testhelper.rb)</a><br />
31
+ <a href="classes/AppleDosPic.html#M000051">file_system_file_types (AppleDosPic)</a><br />
32
+ <a href="classes/PascalPic.html#M000047">file_system_file_types (PascalPic)</a><br />
33
+ <a href="classes/NADOLPic.html#M000049">file_system_file_types (NADOLPic)</a><br />
34
+ <a href="classes/AppleHiResPic.html#M000012">file_system_file_types (AppleHiResPic)</a><br />
35
+ <a href="classes/ProDosFile.html#M000005">file_system_file_types (ProDosFile)</a><br />
36
+ <a href="classes/ProDosBinPic.html#M000044">file_system_file_types (ProDosBinPic)</a><br />
37
+ <a href="classes/ProDosBINFile.html#M000040">file_system_file_types (ProDosBINFile)</a><br />
38
+ <a href="classes/NativeFileType.html#M000030">file_type_matches? (NativeFileType)</a><br />
39
+ <a href="classes/AppleDos.html#M000039">files (AppleDos)</a><br />
40
+ <a href="classes/NativeFileType.html#M000027">full_filename (NativeFileType)</a><br />
41
+ <a href="classes/AppleDosPic.html#M000053">header_length (AppleDosPic)</a><br />
42
+ <a href="classes/NativeFileType.html#M000031">header_length (NativeFileType)</a><br />
43
+ <a href="classes/AppleDos.html#M000036">host_system (AppleDos)</a><br />
44
+ <a href="files/test/testhelper_rb.html#M000001">image_has_collection_of (test/testhelper.rb)</a><br />
45
+ <a href="classes/NativeFileType.html#M000034">is_valid_file_if (NativeFileType)</a><br />
46
+ <a href="classes/NativeFileType.html#M000023">load_address (NativeFileType)</a><br />
47
+ <a href="classes/NativeFileType.html#M000024">load_address (NativeFileType)</a><br />
48
+ <a href="classes/ProDosBINFile.html#M000042">load_address (ProDosBINFile)</a><br />
49
+ <a href="classes/ProDosBinPic.html#M000046">load_address (ProDosBinPic)</a><br />
50
+ <a href="classes/AppleDosPic.html#M000052">load_address (AppleDosPic)</a><br />
51
+ <a href="classes/ProDosBINFile.html#M000041">matching_score (ProDosBINFile)</a><br />
52
+ <a href="classes/NativeFileType.html#M000019">matching_score (NativeFileType)</a><br />
53
+ <a href="classes/ProDosFile.html#M000006">matching_score (ProDosFile)</a><br />
54
+ <a href="classes/AppleHiResPic.html#M000013">matching_score (AppleHiResPic)</a><br />
55
+ <a href="classes/NativeFileType.html#M000018">new (NativeFileType)</a><br />
56
+ <a href="classes/NativeFileType.html#M000020">non_matching_score (NativeFileType)</a><br />
57
+ <a href="classes/AppleHiResPic.html#M000017">picture_format (AppleHiResPic)</a><br />
58
+ <a href="classes/AppleHiResPic.html#M000016">picture_height (AppleHiResPic)</a><br />
59
+ <a href="classes/AppleHiResPic.html#M000015">picture_width (AppleHiResPic)</a><br />
60
+ <a href="files/test/testhelper_rb.html#M000003">sniff_url (test/testhelper.rb)</a><br />
61
+ <a href="classes/ImageSniffing.html#M000008">test_apple_2_images (ImageSniffing)</a><br />
62
+ <a href="classes/ProDosBINFile.html#M000043">to_disassembly (ProDosBINFile)</a><br />
63
+ <a href="classes/NativeFileType.html#M000026">to_hex_dump (NativeFileType)</a><br />
64
+ <a href="classes/AppleHiResPic.html#M000014">to_picture (AppleHiResPic)</a><br />
65
+ <a href="classes/NativeFileType.html#M000022">type_description (NativeFileType)</a><br />
66
+ <a href="classes/ProDosFile.html#M000007">type_description (ProDosFile)</a><br />
67
+ <a href="classes/AxePackedAppleDosPic.html#M000010">unpacked_picture_bytes (AxePackedAppleDosPic)</a><br />
68
+ <a href="classes/PackedAppleDosPic.html#M000009">unpacked_picture_bytes (PackedAppleDosPic)</a><br />
69
+ <a href="classes/ProDosBinPic.html#M000045">unpacked_picture_bytes (ProDosBinPic)</a><br />
70
+ <a href="classes/PascalPic.html#M000048">unpacked_picture_bytes (PascalPic)</a><br />
71
+ <a href="classes/AppleDosPic.html#M000054">unpacked_picture_bytes (AppleDosPic)</a><br />
72
+ <a href="classes/PackedProDosPic.html#M000011">unpacked_picture_bytes (PackedProDosPic)</a><br />
73
+ <a href="classes/ScrunchedAppleDosPic.html#M000004">unpacked_picture_bytes (ScrunchedAppleDosPic)</a><br />
74
+ <a href="classes/NADOLPic.html#M000050">unpacked_picture_bytes (NADOLPic)</a><br />
75
+ <a href="classes/AppleDos.html#M000038">vtoc_sector_no (AppleDos)</a><br />
76
+ <a href="classes/AppleDos.html#M000037">vtoc_track_no (AppleDos)</a><br />
23
77
  </div>
24
78
  </div>
25
79
  </body>
data/doc/index.html CHANGED
@@ -19,6 +19,6 @@
19
19
  <frame src="fr_class_index.html" name="Classes" />
20
20
  <frame src="fr_method_index.html" name="Methods" />
21
21
  </frameset>
22
- <frame src="files/lib/RipXplore_rb.html" name="docwin" />
22
+ <frame src="files/bin/ripxplore_rb.html" name="docwin" />
23
23
  </frameset>
24
24
  </html>
@@ -126,7 +126,7 @@ def self.code_for_tests
126
126
  end
127
127
 
128
128
  def self.is_valid_file_if(code_for_test)
129
- #puts "adding test for #{self}: #{code_for_test.source}"
129
+ #RipXploreLog.debug "adding test for #{self}: #{code_for_test.source}"
130
130
  @@code_for_tests[self] ||=[]
131
131
  @@code_for_tests[self]<<code_for_test.source
132
132
  end
@@ -136,8 +136,9 @@ def self.compatability_score(file_system_image,filename,contents,file_type,aux_c
136
136
  load_address=self.load_address(contents)
137
137
  passed_tests=0
138
138
  code_for_tests.each do |code_for_test|
139
+ RipXploreLog.debug "test for #{self} : #{code_for_test}"
139
140
  result = eval code_for_test,binding
140
- RipXploreLog.debug "test for #{self} : #{code_for_test} : #{result}"
141
+ RipXploreLog.debug "RESULT: #{result}"
141
142
  return non_matching_score unless (result)
142
143
  passed_tests+=1
143
144
  end
data/lib/RipXplore.rb CHANGED
@@ -4,7 +4,7 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require 'open-uri'
5
5
  class RipXplore
6
6
 
7
- VERSION="0.4.0"
7
+ VERSION="0.5.0"
8
8
 
9
9
  private
10
10
  def RipXplore.require_files_in_subdir(dirname)
@@ -131,38 +131,24 @@ def self.files(file_system_image)
131
131
  sector_count=file_descriptive_entry[0x21]+file_descriptive_entry[0x22]*256
132
132
 
133
133
  file_type_code=file_descriptive_entry[2]%0x80
134
-
135
-
136
- if (sector_count>0) then
137
- contents=""
138
- ts_list_track_no=file_descriptive_entry[0]
139
- ts_list_sector_no=file_descriptive_entry[1]
140
- while (ts_list_track_no>0) && (ts_list_track_no<=0X22) && (ts_list_sector_no<=0x0f)
141
- ts_list_sector=file_system_image.get_sector(ts_list_track_no,ts_list_sector_no)
142
- ts_list_track_no=ts_list_sector[1]
143
- ts_list_sector_no=ts_list_sector[2]
134
+ # puts "filename #{filename} sector count #{sector_count}"
135
+ contents=""
136
+ ts_list_track_no=file_descriptive_entry[0]
137
+ ts_list_sector_no=file_descriptive_entry[1]
138
+ while (ts_list_track_no>0) && (ts_list_track_no<=0X22) && (ts_list_sector_no<=0x0f)
139
+ ts_list_sector=file_system_image.get_sector(ts_list_track_no,ts_list_sector_no)
140
+ ts_list_track_no=ts_list_sector[1]
141
+ ts_list_sector_no=ts_list_sector[2]
144
142
 
145
- 0x0C.step(0xff,2) {|i|
146
- data_track_no=ts_list_sector[i]
147
- data_sector_no=ts_list_sector[i+1]
148
- if (data_track_no>0) && (data_track_no<=0X22) && (data_sector_no<=0x0f) then
149
- contents+=file_system_image.get_sector(data_track_no,data_sector_no)
150
- end
151
- }
152
- end
143
+ 0x0C.step(0xff,2) {|i|
144
+ data_track_no=ts_list_sector[i]
145
+ data_sector_no=ts_list_sector[i+1]
146
+ if (data_track_no>0) && (data_track_no<=0X22) && (data_sector_no<=0x0f) then
147
+ contents+=file_system_image.get_sector(data_track_no,data_sector_no)
148
+ end
149
+ }
153
150
  if contents.length>0 then
154
151
  files<<NativeFileType.best_fit(file_system_image,filename,contents,file_type_code)
155
- # @files<< case file_type_code
156
- # when 0x00 then TextFile.new(filename,contents,locked)
157
- # when 0x01 then SCAsmFile.can_be_scasm_file?(contents)? SCAsmFile.new(filename,contents,locked): IntegerBasicFile.new(filename,contents,locked)
158
- # when 0x02 then AppleSoftFile.new(filename,contents,locked)
159
- # when 0x04 then MusiCompFile.can_be_musicomp_file?(filename,contents)? MusiCompFile.new(filename,contents,locked): BinaryFile.new(filename,contents,locked)
160
- # when 0x08 then "S" #S type file
161
- # when 0x10 then "R" #RELOCATABLE object module file
162
- # when 0x20 then "a" #??
163
- # when 0x40 then "b" #??
164
- # else DOSFile.new(filename,contents,locked,file_type_code)
165
- # end
166
152
  end
167
153
  end
168
154
  }
@@ -173,6 +159,7 @@ def self.files(file_system_image)
173
159
  else
174
160
  #check we haven't got into an endless loop
175
161
  s="#{next_track}/#{next_sector}"
162
+ # puts s
176
163
  if (!visited_sectors[s].nil?) then
177
164
  done=true
178
165
  end
@@ -14,16 +14,17 @@ class AppleHiResPic<NativeFileType
14
14
  end
15
15
 
16
16
  #colours cribbed from http://groups.google.com.au/group/comp.sys.apple2/browse_thread/thread/b9aa36ead6935c42/faa0f4df3e89060f
17
- HGR_BLACK=PNG::Color::Black #color=0,4
18
- HGR_GREEN=PNG::Color.new(0x2F,0xB8,0x1F,0xFF) #color=1
19
- HGR_VIOLET=PNG::Color.new(0xC8,0x47,0xE4,0xFF) #color=2
20
- HGR_WHITE=PNG::Color::White #color=3,7
21
- HGR_ORANGE=PNG::Color.new(0xC7,0x70,0x28,0xFF) #color=5
22
- HGR_BLUE=PNG::Color.new(0x30,0x8F,0xE3,0xFF) #color=6
23
-
24
- HGR_COLS=40*7
25
- HGR_ROWS=8*8*3
26
-
17
+ if ! defined?(HGR_ROWS) then
18
+ HGR_BLACK=PNG::Color::Black #color=0,4
19
+ HGR_GREEN=PNG::Color.new(0x2F,0xB8,0x1F,0xFF) #color=1
20
+ HGR_VIOLET=PNG::Color.new(0xC8,0x47,0xE4,0xFF) #color=2
21
+ HGR_WHITE=PNG::Color::White #color=3,7
22
+ HGR_ORANGE=PNG::Color.new(0xC7,0x70,0x28,0xFF) #color=5
23
+ HGR_BLUE=PNG::Color.new(0x30,0x8F,0xE3,0xFF) #color=6
24
+
25
+ HGR_COLS=40*7
26
+ HGR_ROWS=8*8*3
27
+ end
27
28
 
28
29
  #per Apple // Reference Manual for //e chapter 2, pages 22-35
29
30
  #also TechNote - Apple IIe #3 Double High-Resolution Graphics - http://web.pdx.edu/~heiss/technotes/aiie/tn.aiie.03.html
@@ -0,0 +1,207 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ #picture packed with "The Axe Packer"
5
+ class AxePackedAppleDosPic<AppleDosPic
6
+
7
+ is_valid_file_if lambda {
8
+ load_address=AppleBinary.load_address(contents)
9
+ (contents.length<=9000) && (load_address==0x60FF)
10
+ }
11
+
12
+ def unpacked_picture_bytes
13
+
14
+ # puts @@scanline_offsets.length
15
+ packed_buffer=data_without_header
16
+ unpacked_buffer="\000"*8192
17
+ p=0
18
+ parity=1
19
+ row=1
20
+ column=0
21
+ done=false
22
+ while !done do
23
+ b=packed_buffer[p]
24
+ if b==0 then
25
+ run_length=packed_buffer[p+1]
26
+ colour=packed_buffer[p+2]
27
+ p+=2
28
+ else
29
+ run_length=1
30
+ colour=b
31
+ end
32
+ run_length.times do |i|
33
+ destination_offset=@@scanline_offsets[row]+column
34
+ unpacked_buffer[destination_offset]=colour
35
+ row+=2
36
+ if row>=192 then
37
+ row=parity
38
+ column+=1
39
+ if column>=40 then
40
+ if parity==0 then
41
+ done=true
42
+ else
43
+ row=0
44
+ column=0
45
+ parity=0
46
+ end
47
+ end
48
+ end
49
+ end
50
+ p+=1
51
+ done=true if p==packed_buffer.length
52
+ end
53
+
54
+ unpacked_buffer
55
+ end
56
+
57
+
58
+ end
59
+
60
+
61
+
62
+ #picture packed in format first seen (by jonno) on a disk cracked by "Association Of Broadcasting Crackers"
63
+ class PackedAppleDosPic<AppleDosPic
64
+
65
+ is_valid_file_if lambda {
66
+ load_address=AppleBinary.load_address(contents)
67
+ (contents.length<=9000) && (load_address==0x7000)
68
+ }
69
+ is_valid_file_if lambda {
70
+ filename[0,3]=="PI."
71
+ }
72
+
73
+
74
+ def unpacked_picture_bytes
75
+ packed_buffer=data_without_header
76
+ unpacked_buffer="\000"*8192
77
+ in_p=0
78
+ out_p=0
79
+ while out_p<=8192 && in_p<packed_buffer.length do
80
+ count_byte=packed_buffer[in_p]
81
+ in_p+=1
82
+ if (count_byte>=0x80) then
83
+ (1+(count_byte & 0x7F)).times do
84
+ unpacked_buffer[out_p]=packed_buffer[in_p] unless out_p>=8192
85
+ in_p+=1
86
+ out_p+=1
87
+ end
88
+ else
89
+ src_byte=packed_buffer[in_p]
90
+ in_p+=1
91
+ (1+count_byte).times do
92
+ unpacked_buffer[out_p]=src_byte unless out_p>=8192
93
+ out_p+=1
94
+ end
95
+ end
96
+ end
97
+ unpacked_buffer
98
+ end
99
+
100
+
101
+ end
102
+
103
+
104
+ #picture packed in format first seen (by jonno) on an EAMON graphics disk
105
+ class PackedProDosPic<ProDosBinPic
106
+
107
+ is_valid_file_if lambda {
108
+ load_address=aux_code
109
+ (contents.length<=9000) && (load_address==0x4000)
110
+ }
111
+ is_valid_file_if lambda {
112
+ filename=~/\.PIC$/
113
+ }
114
+
115
+ is_valid_file_if lambda {
116
+ contents[0]==1
117
+ }
118
+
119
+ def unpacked_picture_bytes
120
+ packed_buffer=data_without_header
121
+ unpacked_buffer="\000"*8192
122
+ in_p=1
123
+ out_p=0
124
+ while out_p<=8192 && in_p<packed_buffer.length do
125
+ count_byte=packed_buffer[in_p]
126
+ in_p+=1
127
+ if (count_byte>=0x80) then
128
+ (1+(count_byte & 0x7F)).times do
129
+ unpacked_buffer[out_p]=packed_buffer[in_p] unless out_p>=8192
130
+ in_p+=1
131
+ out_p+=1
132
+ end
133
+ else
134
+ src_byte=packed_buffer[in_p]
135
+ in_p+=1
136
+ (1+count_byte).times do
137
+ unpacked_buffer[out_p]=src_byte unless out_p>=8192
138
+ out_p+=1
139
+ end
140
+ end
141
+ end
142
+ unpacked_buffer
143
+ end
144
+
145
+ end
146
+
147
+
148
+ class ScrunchedAppleDosPic<AppleDosPic
149
+ # - if a byte is $80, then the next byte is the length of a run of $00 bytes
150
+ #- elsif a byte is $FF, then the next byte is the length of a run of $7F bytes
151
+ #- else output the byte directly
152
+
153
+ is_valid_file_if lambda {
154
+ load_address=AppleBinary.load_address(contents)
155
+ (contents.length<=9000) && (load_address==0x7000)
156
+ }
157
+
158
+ def unpacked_picture_bytes
159
+ packed_buffer=data_without_header
160
+ unpacked_buffer="\000"*8192
161
+ in_p=0
162
+ out_p=0
163
+ while out_p<8192 && in_p<packed_buffer.length do
164
+ colour_byte=packed_buffer[in_p]
165
+ if (colour_byte==0x80) || (colour_byte==0xFF) then
166
+ in_p+=1
167
+ run_length=packed_buffer[in_p]
168
+ colour_byte&=0x7F
169
+ else
170
+ run_length=1
171
+ end
172
+ in_p+=1
173
+ run_length.times do
174
+ unpacked_buffer[out_p]=colour_byte unless out_p>=8192
175
+ out_p+=1
176
+ end
177
+ end
178
+ unpacked_buffer
179
+ end
180
+
181
+ end
182
+
183
+
184
+ # == Author
185
+ # Jonno Downes (jonno@jamtronix.com)
186
+ #
187
+ # == Copyright
188
+ # Copyright (c) 2008 Jonno Downes (jonno@jamtronix.com)
189
+ #
190
+ #Permission is hereby granted, free of charge, to any person obtaining
191
+ #a copy of this software and associated documentation files (the
192
+ #"Software"), to deal in the Software without restriction, including
193
+ #without limitation the rights to use, copy, modify, merge, publish,
194
+ #distribute, sublicense, and/or sell copies of the Software, and to
195
+ #permit persons to whom the Software is furnished to do so, subject to
196
+ #the following conditions:
197
+
198
+ # The above copyright notice and this permission notice shall be
199
+ # included in all copies or substantial portions of the Software.
200
+
201
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
202
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
203
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
204
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
205
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
206
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
207
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -85,6 +85,27 @@ end
85
85
 
86
86
  end
87
87
 
88
+ class ProDosBINFile < ProDosFile
89
+ def self.file_system_file_types
90
+ {
91
+ ProDos=>0x06
92
+ }
93
+ end
94
+
95
+ def self.matching_score
96
+ ProDosFile.matching_score+0.1
97
+ end
98
+
99
+ def load_address
100
+ aux_code
101
+ end
102
+
103
+ def to_disassembly
104
+ return Apple2.disassemble(data_without_header,load_address)
105
+ end
106
+
107
+ end
108
+
88
109
  # == Author
89
110
  # Jonno Downes (jonno@jamtronix.com)
90
111
  #
data/test/tc_apple_2.rb CHANGED
@@ -5,10 +5,29 @@ class ImageSniffing < Test::Unit::TestCase
5
5
 
6
6
  def test_apple_2_images
7
7
 
8
+
9
+ sniff_url("http://mirrors.apple2.org.za/landover.no-ip.com/Applications/Slide%20Show%20(19xx)(Nut%20Cracker)%5ba%5d(disk%202%20of%202).dsk",A2Dsk,AppleDos,
10
+ [
11
+ {:filename=>"P32",:save_output=>[:to_picture,"png"],:expected_native_file_type=>ScrunchedAppleDosPic},
12
+ ]
13
+ )
14
+
15
+ sniff_url("http://mirrors.apple2.org.za/landover.no-ip.com/Applications/Eamon%20Graphics%20Main%20Hall%20(1989)(-)%5BNo%20Boot%5D.dsk",A2Dsk,ProDos,
16
+ [
17
+ {:filename=>"EAMON.PIC",:save_output=>[:to_picture,"png"],:expected_native_file_type=>PackedProDosPic},
18
+ ]
19
+ )
20
+
21
+ sniff_url("http://disk-images.jamtronix.com/apple2/HOLDUP1A.DSK.gz",A2Dsk,AppleDos,
22
+ [
23
+ {:filename=>"PI.COPYART",:save_output=>[:to_picture,"png"],:expected_native_file_type=>PackedAppleDosPic},
24
+ ]
25
+ )
26
+
8
27
  sniff_url("http://mirrors.apple2.org.za/ftp.apple.asimov.net/images/productivity/word_processing/graph2.dsk.gz",A2Dsk,ProDos,
9
28
  [
10
- {:filename=>"PICS/PIC.GEORGE",:can_execute=>:to_picture},
11
- {:filename=>"PICS/PIC.BBROS",:can_execute=>:to_picture},
29
+ {:filename=>"PICS/PIC.GEORGE",:can_execute=>:to_picture,:expected_native_file_type=>ProDosPrintShopMiniPix},
30
+ {:filename=>"PICS/PIC.BBROS",:can_execute=>:to_picture,:expected_native_file_type=>ProDosBinPic},
12
31
  ])
13
32
 
14
33
  sniff_url("http://mirrors.apple2.org.za/ftp.apple.asimov.net/images/graphics/view_gif.dsk.gz",A2Dsk,ProDos,
@@ -67,11 +86,11 @@ class ImageSniffing < Test::Unit::TestCase
67
86
 
68
87
 
69
88
  sniff_url("http://mirrors.apple2.org.za/landover.no-ip.com/Applications/Flying%20Colors%20(1983)(Jandel%20Corporation).dsk",A2Dsk,AppleDos,
70
- [{:filename=>"LOGO4",:can_execute=>:to_picture},
89
+ [{:filename=>"LOGO4",:can_execute=>:to_picture,:expected_native_file_type=>AppleHiResPic},
71
90
  ])
72
91
 
73
92
  sniff_url("http://mirrors.apple2.org.za/landover.no-ip.com/Applications/Pic%20Pac%20I%20(19xx)(Copycatter).dsk",A2Dsk,AppleDos,
74
- [{:filename=>"ZZ TOP",:can_execute=>:to_picture},
93
+ [{:filename=>"ZZ TOP",:can_execute=>:to_picture,:expected_native_file_type=>AxePackedAppleDosPic},
75
94
  ])
76
95
 
77
96
  sniff_url("http://mirrors.apple2.org.za/landover.no-ip.com/Applications/Algebra%20Mentor%20(19xx)(John%20C.%20Miller)(Disk%206%20of%207%20Side%20A)(Student%20Disk%206).dsk",A2DskDosOrder,PascalDos,