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
data/bin/ripxplore.rb CHANGED
@@ -33,115 +33,123 @@
33
33
  #
34
34
 
35
35
 
36
- #make sure the relevant folder with our libraries is in the require path
37
- lib_path=File.expand_path(File.dirname(__FILE__)+"//..//lib")
38
- $:.unshift(lib_path) unless $:.include?(lib_path)
39
- require 'rubygems'
40
- require 'optparse'
41
- require 'rdoc_patch' #RDoc::usage patched to work under gem executables
42
-
36
+ #pull in the RipXplore lib - we need to give the specific path to it since otherwise on case insensitive OSes (e.g. windows) this file
37
+ #will get pulled in instead
43
38
  require File.expand_path(File.dirname(__FILE__)+"//..//lib")+'//RipXplore'
44
39
 
45
- catalog=false
46
- diskdump=false
47
- show_trace=false
48
- output_filename=nil
49
- extract_filename=nil
50
- debug_logging=false
51
- extract_mode=:default
52
- opts=OptionParser.new
53
- opts.on("-h","--help") {RDoc::usage_from_file(__FILE__)}
54
- opts.on("-v","--version") do
55
- puts File.basename($0)+" "+RipXplore::VERSION
56
- exit
57
- end
58
- opts.on("-r","--raw") {extract_mode=:raw}
59
- opts.on("-c","--catalog") {catalog=true}
60
- opts.on("-D","--diskdump") {diskdump=true}
61
- opts.on("-l","--list FILENAME",String) do |val|
62
- extract_filename=val.upcase
63
- extract_mode=:list
64
- end
65
-
66
- opts.on("-S","--showtrace") {show_trace=true}
67
-
68
- opts.on("-d","--dump FILENAME",String) do |val|
69
- extract_filename=val.upcase
70
- extract_mode=:hex
71
- end
72
- opts.on("-e","--extract FILENAME",String) {|val| extract_filename=val.upcase}
73
- opts.on("-o","--output FILENAME",String) {|val| output_filename=val}
74
- opts.on("-t","--filetype FILETYPE",String) {|val| add_file_options[:filetype]=val}
75
- opts.on("-V","--verbose") {debug_logging=true}
76
-
77
- filename=opts.parse(ARGV)[0] rescue RDoc::usage_from_file(__FILE__,'Usage')
78
- RDoc::usage_from_file(__FILE__,'Usage') if (filename.nil?)
79
-
80
-
81
-
82
- RipXploreLog.debug_logging if debug_logging
83
- begin #to wrap a rescue clause
84
-
85
- begin
86
- fsimage=RipXplore.best_fit_from_filename(filename)
87
- rescue
88
- #if we run dsktool.rb in a batch or shell file iterating over a bunch of dsk files, we may not know what file
89
- #has the error
90
- STDERR << "error while parsing #{filename}\n"
91
- raise
92
- end
40
+ #only do this next bit if this file was specifically executed, if not then it was probably loaded by a 'require RipXplore' on a
41
+ #case insenstive OS
42
+ if __FILE__ == $0 then
43
+
44
+ #make sure the relevant folder with our libraries is in the require path
45
+ lib_path=File.expand_path(File.dirname(__FILE__)+"//..//lib")
46
+ $:.unshift(lib_path) unless $:.include?(lib_path)
47
+ require 'rubygems'
48
+ require 'optparse'
49
+ require 'rdoc_patch' #RDoc::usage patched to work under gem executables
93
50
 
94
- output_file= case
95
- when (output_filename.nil?) then STDOUT
96
- else File.open(output_filename,"wb")
51
+
52
+ catalog=false
53
+ diskdump=false
54
+ show_trace=false
55
+ output_filename=nil
56
+ extract_filename=nil
57
+ debug_logging=false
58
+ extract_mode=:default
59
+ opts=OptionParser.new
60
+ opts.on("-h","--help") {RDoc::usage_from_file(__FILE__)}
61
+ opts.on("-v","--version") do
62
+ puts File.basename($0)+" "+RipXplore::VERSION
63
+ exit
64
+ end
65
+ opts.on("-r","--raw") {extract_mode=:raw}
66
+ opts.on("-c","--catalog") {catalog=true}
67
+ opts.on("-D","--diskdump") {diskdump=true}
68
+ opts.on("-l","--list FILENAME",String) do |val|
69
+ extract_filename=val.upcase
70
+ extract_mode=:list
97
71
  end
98
72
 
99
- if (diskdump) then
100
- puts fsimage.to_hex_dump
73
+ opts.on("-S","--showtrace") {show_trace=true}
74
+
75
+ opts.on("-d","--dump FILENAME",String) do |val|
76
+ extract_filename=val.upcase
77
+ extract_mode=:hex
101
78
  end
79
+ opts.on("-e","--extract FILENAME",String) {|val| extract_filename=val.upcase}
80
+ opts.on("-o","--output FILENAME",String) {|val| output_filename=val}
81
+ opts.on("-t","--filetype FILETYPE",String) {|val| add_file_options[:filetype]=val}
82
+ opts.on("-V","--verbose") {debug_logging=true}
102
83
 
103
- if(catalog) then
84
+ filename=opts.parse(ARGV)[0] rescue RDoc::usage_from_file(__FILE__,'Usage')
85
+ RDoc::usage_from_file(__FILE__,'Usage') if (filename.nil?)
104
86
 
105
- [:host_system,:image_format,:file_system].each do |att|
106
- if (fsimage.respond_to?(att)) then
107
- puts "#{att.to_s}:\t#{fsimage.send(att)}"
108
- end
87
+
88
+
89
+ RipXploreLog.debug_logging if debug_logging
90
+ begin #to wrap a rescue clause
91
+
92
+ begin
93
+ fsimage=RipXplore.best_fit_from_filename(filename)
94
+ rescue
95
+ #if we run dsktool.rb in a batch or shell file iterating over a bunch of dsk files, we may not know what file
96
+ #has the error
97
+ STDERR << "error while parsing #{filename}\n"
98
+ raise
99
+ end
100
+
101
+ output_file= case
102
+ when (output_filename.nil?) then STDOUT
103
+ else File.open(output_filename,"wb")
104
+ end
105
+
106
+ if (diskdump) then
107
+ puts fsimage.to_hex_dump
108
+ end
109
+
110
+ if(catalog) then
111
+
112
+ [:host_system,:image_format,:file_system].each do |att|
113
+ if (fsimage.respond_to?(att)) then
114
+ puts "#{att.to_s}:\t#{fsimage.send(att)}"
115
+ end
116
+ end
117
+ puts fsimage.catalog
109
118
  end
110
- puts fsimage.catalog
111
- end
112
119
 
113
120
 
114
- if (!extract_filename.nil?) then
115
- file=fsimage.files[extract_filename]
116
- if file.nil? then
117
- puts "'#{extract_filename}' not found in #{filename}"
118
- else
119
- output_file<< case extract_mode
120
- when :raw then file.contents
121
- when :hex then file.to_hex_dump
122
- when :ascii then file.to_ascii
123
- when :list then
124
- if file.respond_to?(:to_listing)
125
- file.to_listing
126
- elsif file.respond_to?(:to_disassembly)
127
- file.to_disassembly
128
- else
129
- puts "'#{extract_filename}' can't be listed"
130
- exit
131
- end
132
- else
133
- if file.respond_to?(:to_text)
134
- file.to_text
135
- else
136
- file.contents
137
- end
121
+ if (!extract_filename.nil?) then
122
+ file=fsimage.files[extract_filename]
123
+ if file.nil? then
124
+ puts "'#{extract_filename}' not found in #{filename}"
125
+ else
126
+ output_file<< case extract_mode
127
+ when :raw then file.contents
128
+ when :hex then file.to_hex_dump
129
+ when :ascii then file.to_ascii
130
+ when :list then
131
+ if file.respond_to?(:to_listing)
132
+ file.to_listing
133
+ elsif file.respond_to?(:to_disassembly)
134
+ file.to_disassembly
135
+ else
136
+ puts "'#{extract_filename}' can't be listed"
137
+ exit
138
+ end
139
+ else
140
+ if file.respond_to?(:to_text)
141
+ file.to_text
142
+ else
143
+ file.contents
144
+ end
145
+ end
138
146
  end
139
147
  end
148
+ rescue
149
+ puts $!
150
+ raise if show_trace
140
151
  end
141
- rescue
142
- puts $!
143
- raise if show_trace
144
- end
152
+ end #if run from command line
145
153
  # == Author
146
154
  # Jonno Downes (jonno@jamtronix.com)
147
155
  #
@@ -65,9 +65,7 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- <a href="FileSystem.html">
69
68
  FileSystem
70
- </a>
71
69
  </td>
72
70
  </tr>
73
71
  </table>
@@ -179,10 +177,10 @@ TRACK/SECTOR LIST FORMAT (from Beneath Apple DOS p 4-6)
179
177
  <h3 class="section-bar">Methods</h3>
180
178
 
181
179
  <div class="name-list">
182
- <a href="#M000210">files</a>&nbsp;&nbsp;
183
- <a href="#M000207">host_system</a>&nbsp;&nbsp;
184
- <a href="#M000209">vtoc_sector_no</a>&nbsp;&nbsp;
185
- <a href="#M000208">vtoc_track_no</a>&nbsp;&nbsp;
180
+ <a href="#M000039">files</a>&nbsp;&nbsp;
181
+ <a href="#M000036">host_system</a>&nbsp;&nbsp;
182
+ <a href="#M000038">vtoc_sector_no</a>&nbsp;&nbsp;
183
+ <a href="#M000037">vtoc_track_no</a>&nbsp;&nbsp;
186
184
  </div>
187
185
  </div>
188
186
 
@@ -204,12 +202,12 @@ TRACK/SECTOR LIST FORMAT (from Beneath Apple DOS p 4-6)
204
202
  <div id="methods">
205
203
  <h3 class="section-bar">Public Class methods</h3>
206
204
 
207
- <div id="method-M000210" class="method-detail">
208
- <a name="M000210"></a>
205
+ <div id="method-M000039" class="method-detail">
206
+ <a name="M000039"></a>
209
207
 
210
208
  <div class="method-heading">
211
- <a href="AppleDos.src/M000210.html" target="Code" class="method-signature"
212
- onclick="popupCode('AppleDos.src/M000210.html');return false;">
209
+ <a href="AppleDos.src/M000039.html" target="Code" class="method-signature"
210
+ onclick="popupCode('AppleDos.src/M000039.html');return false;">
213
211
  <span class="method-name">files</span><span class="method-args">(file_system_image)</span>
214
212
  </a>
215
213
  </div>
@@ -218,12 +216,12 @@ TRACK/SECTOR LIST FORMAT (from Beneath Apple DOS p 4-6)
218
216
  </div>
219
217
  </div>
220
218
 
221
- <div id="method-M000207" class="method-detail">
222
- <a name="M000207"></a>
219
+ <div id="method-M000036" class="method-detail">
220
+ <a name="M000036"></a>
223
221
 
224
222
  <div class="method-heading">
225
- <a href="AppleDos.src/M000207.html" target="Code" class="method-signature"
226
- onclick="popupCode('AppleDos.src/M000207.html');return false;">
223
+ <a href="AppleDos.src/M000036.html" target="Code" class="method-signature"
224
+ onclick="popupCode('AppleDos.src/M000036.html');return false;">
227
225
  <span class="method-name">host_system</span><span class="method-args">()</span>
228
226
  </a>
229
227
  </div>
@@ -232,12 +230,12 @@ TRACK/SECTOR LIST FORMAT (from Beneath Apple DOS p 4-6)
232
230
  </div>
233
231
  </div>
234
232
 
235
- <div id="method-M000209" class="method-detail">
236
- <a name="M000209"></a>
233
+ <div id="method-M000038" class="method-detail">
234
+ <a name="M000038"></a>
237
235
 
238
236
  <div class="method-heading">
239
- <a href="AppleDos.src/M000209.html" target="Code" class="method-signature"
240
- onclick="popupCode('AppleDos.src/M000209.html');return false;">
237
+ <a href="AppleDos.src/M000038.html" target="Code" class="method-signature"
238
+ onclick="popupCode('AppleDos.src/M000038.html');return false;">
241
239
  <span class="method-name">vtoc_sector_no</span><span class="method-args">()</span>
242
240
  </a>
243
241
  </div>
@@ -246,12 +244,12 @@ TRACK/SECTOR LIST FORMAT (from Beneath Apple DOS p 4-6)
246
244
  </div>
247
245
  </div>
248
246
 
249
- <div id="method-M000208" class="method-detail">
250
- <a name="M000208"></a>
247
+ <div id="method-M000037" class="method-detail">
248
+ <a name="M000037"></a>
251
249
 
252
250
  <div class="method-heading">
253
- <a href="AppleDos.src/M000208.html" target="Code" class="method-signature"
254
- onclick="popupCode('AppleDos.src/M000208.html');return false;">
251
+ <a href="AppleDos.src/M000037.html" target="Code" class="method-signature"
252
+ onclick="popupCode('AppleDos.src/M000037.html');return false;">
255
253
  <span class="method-name">vtoc_track_no</span><span class="method-args">()</span>
256
254
  </a>
257
255
  </div>
@@ -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>host_system (AppleDos)</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 lib/file_systems/AppleDos.rb, line 88</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host_system</span>
15
+ <span class="ruby-constant">Apple2</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -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>vtoc_track_no (AppleDos)</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 lib/file_systems/AppleDos.rb, line 106</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">vtoc_track_no</span>
15
+ <span class="ruby-value">0x11</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -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>vtoc_sector_no (AppleDos)</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 lib/file_systems/AppleDos.rb, line 110</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">vtoc_sector_no</span>
15
+ <span class="ruby-value">0</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,73 @@
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>files (AppleDos)</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 lib/file_systems/AppleDos.rb, line 114</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">files</span>(<span class="ruby-identifier">file_system_image</span>)
15
+ <span class="ruby-identifier">files</span>=<span class="ruby-constant">FileContainer</span>.<span class="ruby-identifier">new</span>
16
+ <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>)
17
+ <span class="ruby-identifier">catalog_sector</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">vtoc_sector</span>[<span class="ruby-value">01</span>],<span class="ruby-identifier">vtoc_sector</span>[<span class="ruby-value">02</span>])
18
+ <span class="ruby-identifier">done</span>=<span class="ruby-keyword kw">false</span>
19
+ <span class="ruby-identifier">visited_sectors</span>={}
20
+ <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span><span class="ruby-identifier">done</span>
21
+ <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">catalog_sector</span>.<span class="ruby-identifier">nil?</span>
22
+ (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">6</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">file_number</span><span class="ruby-operator">|</span>
23
+ <span class="ruby-identifier">file_descriptive_entry_start</span>=<span class="ruby-value">11</span><span class="ruby-operator">+</span><span class="ruby-identifier">file_number</span><span class="ruby-operator">*</span><span class="ruby-value">35</span>
24
+ <span class="ruby-identifier">file_descriptive_entry</span>=<span class="ruby-identifier">catalog_sector</span>[<span class="ruby-identifier">file_descriptive_entry_start</span>,<span class="ruby-value">36</span>]
25
+ <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">==</span><span class="ruby-value">0x</span><span class="ruby-constant">FF</span>) <span class="ruby-comment cmt"># skip deleted files</span>
26
+ <span class="ruby-identifier">filename</span>=<span class="ruby-value str">&quot;&quot;</span>
27
+ <span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">3</span><span class="ruby-operator">..</span><span class="ruby-value">32</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">each_byte</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">filename</span><span class="ruby-operator">+=</span>(<span class="ruby-identifier">b</span>.<span class="ruby-operator">%</span><span class="ruby-value">128</span>).<span class="ruby-identifier">chr</span>}
28
+ <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/ *$/</span>,<span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-comment cmt">#strip off trailing spaces</span>
29
+ <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">tr!</span>(<span class="ruby-value str">&quot;\x00-\x1f&quot;</span>,<span class="ruby-value str">&quot;\x40-\x5f&quot;</span>) <span class="ruby-comment cmt">#convert non-printable chars to corresponding uppercase letter</span>
30
+ <span class="ruby-identifier">locked</span>=(<span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">2</span>]<span class="ruby-operator">&gt;=</span><span class="ruby-value">0x80</span>)
31
+ <span class="ruby-identifier">sector_count</span>=<span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">0x21</span>]<span class="ruby-operator">+</span><span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">0x22</span>]<span class="ruby-operator">*</span><span class="ruby-value">256</span>
32
+
33
+ <span class="ruby-identifier">file_type_code</span>=<span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">2</span>]<span class="ruby-operator">%</span><span class="ruby-value">0x80</span>
34
+ <span class="ruby-comment cmt"># puts &quot;filename #{filename} sector count #{sector_count}&quot;</span>
35
+ <span class="ruby-identifier">contents</span>=<span class="ruby-value str">&quot;&quot;</span>
36
+ <span class="ruby-identifier">ts_list_track_no</span>=<span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">0</span>]
37
+ <span class="ruby-identifier">ts_list_sector_no</span>=<span class="ruby-identifier">file_descriptive_entry</span>[<span class="ruby-value">1</span>]
38
+ <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">ts_list_track_no</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">ts_list_track_no</span><span class="ruby-operator">&lt;=</span><span class="ruby-value">0</span><span class="ruby-constant">X22</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">ts_list_sector_no</span><span class="ruby-operator">&lt;=</span><span class="ruby-value">0x0f</span>)
39
+ <span class="ruby-identifier">ts_list_sector</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">ts_list_track_no</span>,<span class="ruby-identifier">ts_list_sector_no</span>)
40
+ <span class="ruby-identifier">ts_list_track_no</span>=<span class="ruby-identifier">ts_list_sector</span>[<span class="ruby-value">1</span>]
41
+ <span class="ruby-identifier">ts_list_sector_no</span>=<span class="ruby-identifier">ts_list_sector</span>[<span class="ruby-value">2</span>]
42
+
43
+ <span class="ruby-value">0x0</span><span class="ruby-constant">C</span>.<span class="ruby-identifier">step</span>(<span class="ruby-value">0xff</span>,<span class="ruby-value">2</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
44
+ <span class="ruby-identifier">data_track_no</span>=<span class="ruby-identifier">ts_list_sector</span>[<span class="ruby-identifier">i</span>]
45
+ <span class="ruby-identifier">data_sector_no</span>=<span class="ruby-identifier">ts_list_sector</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>]
46
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">data_track_no</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">data_track_no</span><span class="ruby-operator">&lt;=</span><span class="ruby-value">0</span><span class="ruby-constant">X22</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">data_sector_no</span><span class="ruby-operator">&lt;=</span><span class="ruby-value">0x0f</span>) <span class="ruby-keyword kw">then</span>
47
+ <span class="ruby-identifier">contents</span><span class="ruby-operator">+=</span><span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">data_track_no</span>,<span class="ruby-identifier">data_sector_no</span>)
48
+ <span class="ruby-keyword kw">end</span>
49
+ }
50
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span> <span class="ruby-keyword kw">then</span>
51
+ <span class="ruby-identifier">files</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-constant">NativeFileType</span>.<span class="ruby-identifier">best_fit</span>(<span class="ruby-identifier">file_system_image</span>,<span class="ruby-identifier">filename</span>,<span class="ruby-identifier">contents</span>,<span class="ruby-identifier">file_type_code</span>)
52
+ <span class="ruby-keyword kw">end</span>
53
+ <span class="ruby-keyword kw">end</span>
54
+ }
55
+ <span class="ruby-identifier">next_track</span>=<span class="ruby-identifier">catalog_sector</span>[<span class="ruby-value">1</span>]
56
+ <span class="ruby-identifier">next_sector</span>=<span class="ruby-identifier">catalog_sector</span>[<span class="ruby-value">2</span>]<span class="ruby-operator">%</span><span class="ruby-value">0x10</span>
57
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">next_track</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>) <span class="ruby-operator">&amp;&amp;</span>( <span class="ruby-identifier">next_sector</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>) <span class="ruby-keyword kw">then</span>
58
+ <span class="ruby-identifier">done</span>=<span class="ruby-keyword kw">true</span>
59
+ <span class="ruby-keyword kw">else</span>
60
+ <span class="ruby-comment cmt">#check we haven't got into an endless loop</span>
61
+ <span class="ruby-identifier">s</span>=<span class="ruby-node">&quot;#{next_track}/#{next_sector}&quot;</span>
62
+ <span class="ruby-comment cmt"># puts s</span>
63
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">visited_sectors</span>[<span class="ruby-identifier">s</span>].<span class="ruby-identifier">nil?</span>) <span class="ruby-keyword kw">then</span>
64
+ <span class="ruby-identifier">done</span>=<span class="ruby-keyword kw">true</span>
65
+ <span class="ruby-keyword kw">end</span>
66
+ <span class="ruby-identifier">visited_sectors</span>[<span class="ruby-identifier">s</span>]=<span class="ruby-keyword kw">true</span>
67
+ <span class="ruby-identifier">catalog_sector</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">next_track</span>,<span class="ruby-identifier">next_sector</span>)
68
+ <span class="ruby-keyword kw">end</span>
69
+ <span class="ruby-keyword kw">end</span>
70
+ <span class="ruby-identifier">files</span>
71
+ <span class="ruby-keyword kw">end</span></pre>
72
+ </body>
73
+ </html>
@@ -88,10 +88,10 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000194">file_system_file_types</a>&nbsp;&nbsp;
92
- <a href="#M000196">header_length</a>&nbsp;&nbsp;
93
- <a href="#M000195">load_address</a>&nbsp;&nbsp;
94
- <a href="#M000197">unpacked_picture_bytes</a>&nbsp;&nbsp;
91
+ <a href="#M000051">file_system_file_types</a>&nbsp;&nbsp;
92
+ <a href="#M000053">header_length</a>&nbsp;&nbsp;
93
+ <a href="#M000052">load_address</a>&nbsp;&nbsp;
94
+ <a href="#M000054">unpacked_picture_bytes</a>&nbsp;&nbsp;
95
95
  </div>
96
96
  </div>
97
97
 
@@ -113,12 +113,12 @@
113
113
  <div id="methods">
114
114
  <h3 class="section-bar">Public Class methods</h3>
115
115
 
116
- <div id="method-M000194" class="method-detail">
117
- <a name="M000194"></a>
116
+ <div id="method-M000051" class="method-detail">
117
+ <a name="M000051"></a>
118
118
 
119
119
  <div class="method-heading">
120
- <a href="AppleDosPic.src/M000194.html" target="Code" class="method-signature"
121
- onclick="popupCode('AppleDosPic.src/M000194.html');return false;">
120
+ <a href="AppleDosPic.src/M000051.html" target="Code" class="method-signature"
121
+ onclick="popupCode('AppleDosPic.src/M000051.html');return false;">
122
122
  <span class="method-name">file_system_file_types</span><span class="method-args">()</span>
123
123
  </a>
124
124
  </div>
@@ -127,12 +127,12 @@
127
127
  </div>
128
128
  </div>
129
129
 
130
- <div id="method-M000195" class="method-detail">
131
- <a name="M000195"></a>
130
+ <div id="method-M000052" class="method-detail">
131
+ <a name="M000052"></a>
132
132
 
133
133
  <div class="method-heading">
134
- <a href="AppleDosPic.src/M000195.html" target="Code" class="method-signature"
135
- onclick="popupCode('AppleDosPic.src/M000195.html');return false;">
134
+ <a href="AppleDosPic.src/M000052.html" target="Code" class="method-signature"
135
+ onclick="popupCode('AppleDosPic.src/M000052.html');return false;">
136
136
  <span class="method-name">load_address</span><span class="method-args">(contents)</span>
137
137
  </a>
138
138
  </div>
@@ -143,12 +143,12 @@
143
143
 
144
144
  <h3 class="section-bar">Public Instance methods</h3>
145
145
 
146
- <div id="method-M000196" class="method-detail">
147
- <a name="M000196"></a>
146
+ <div id="method-M000053" class="method-detail">
147
+ <a name="M000053"></a>
148
148
 
149
149
  <div class="method-heading">
150
- <a href="AppleDosPic.src/M000196.html" target="Code" class="method-signature"
151
- onclick="popupCode('AppleDosPic.src/M000196.html');return false;">
150
+ <a href="AppleDosPic.src/M000053.html" target="Code" class="method-signature"
151
+ onclick="popupCode('AppleDosPic.src/M000053.html');return false;">
152
152
  <span class="method-name">header_length</span><span class="method-args">()</span>
153
153
  </a>
154
154
  </div>
@@ -157,12 +157,12 @@
157
157
  </div>
158
158
  </div>
159
159
 
160
- <div id="method-M000197" class="method-detail">
161
- <a name="M000197"></a>
160
+ <div id="method-M000054" class="method-detail">
161
+ <a name="M000054"></a>
162
162
 
163
163
  <div class="method-heading">
164
- <a href="AppleDosPic.src/M000197.html" target="Code" class="method-signature"
165
- onclick="popupCode('AppleDosPic.src/M000197.html');return false;">
164
+ <a href="AppleDosPic.src/M000054.html" target="Code" class="method-signature"
165
+ onclick="popupCode('AppleDosPic.src/M000054.html');return false;">
166
166
  <span class="method-name">unpacked_picture_bytes</span><span class="method-args">()</span>
167
167
  </a>
168
168
  </div>
@@ -0,0 +1,20 @@
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_system_file_types (AppleDosPic)</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 lib/native_file_types/apple2/AppleHiResPic.rb, line 115</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">file_system_file_types</span>
15
+ {
16
+ <span class="ruby-constant">AppleDos</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">0x04</span>
17
+ }
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -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>load_address (AppleDosPic)</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 lib/native_file_types/apple2/AppleHiResPic.rb, line 121</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_address</span>(<span class="ruby-identifier">contents</span>)
15
+ <span class="ruby-identifier">contents</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-identifier">contents</span>[<span class="ruby-value">1</span>]<span class="ruby-operator">*</span><span class="ruby-value">256</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -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>header_length (AppleDosPic)</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 lib/native_file_types/apple2/AppleHiResPic.rb, line 125</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">header_length</span>
15
+ <span class="ruby-value">4</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -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>unpacked_picture_bytes (AppleDosPic)</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 lib/native_file_types/apple2/AppleHiResPic.rb, line 128</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unpacked_picture_bytes</span>
15
+ <span class="ruby-identifier">data_without_header</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>