ripxplore 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ripxplore.rb +103 -95
- data/doc/classes/AppleDos.html +20 -22
- data/doc/classes/AppleDos.src/M000036.html +18 -0
- data/doc/classes/AppleDos.src/M000037.html +18 -0
- data/doc/classes/AppleDos.src/M000038.html +18 -0
- data/doc/classes/AppleDos.src/M000039.html +73 -0
- data/doc/classes/AppleDosPic.html +20 -20
- data/doc/classes/AppleDosPic.src/M000051.html +20 -0
- data/doc/classes/AppleDosPic.src/M000052.html +18 -0
- data/doc/classes/AppleDosPic.src/M000053.html +18 -0
- data/doc/classes/AppleDosPic.src/M000054.html +18 -0
- data/doc/classes/AppleHiResPic.html +32 -38
- data/doc/classes/AppleHiResPic.src/M000012.html +18 -0
- data/doc/classes/AppleHiResPic.src/M000013.html +18 -0
- data/doc/classes/AppleHiResPic.src/M000014.html +53 -0
- data/doc/classes/AppleHiResPic.src/M000015.html +18 -0
- data/doc/classes/AppleHiResPic.src/M000016.html +18 -0
- data/doc/classes/AppleHiResPic.src/M000017.html +18 -0
- data/doc/classes/AxePackedAppleDosPic.html +145 -0
- data/doc/classes/AxePackedAppleDosPic.src/M000010.html +59 -0
- data/doc/classes/ImageSniffing.html +8 -8
- data/doc/classes/ImageSniffing.src/M000008.html +121 -0
- data/doc/classes/NADOLPic.html +10 -10
- data/doc/classes/NADOLPic.src/M000049.html +20 -0
- data/doc/classes/NADOLPic.src/M000050.html +18 -0
- data/doc/classes/NativeFileType.html +91 -91
- data/doc/classes/NativeFileType.src/M000018.html +22 -0
- data/doc/classes/NativeFileType.src/M000019.html +18 -0
- data/doc/classes/NativeFileType.src/M000020.html +18 -0
- data/doc/classes/NativeFileType.src/M000021.html +18 -0
- data/doc/classes/NativeFileType.src/M000022.html +18 -0
- data/doc/classes/NativeFileType.src/M000023.html +18 -0
- data/doc/classes/NativeFileType.src/M000024.html +18 -0
- data/doc/classes/NativeFileType.src/M000025.html +23 -0
- data/doc/classes/NativeFileType.src/M000026.html +18 -0
- data/doc/classes/NativeFileType.src/M000027.html +18 -0
- data/doc/classes/NativeFileType.src/M000028.html +24 -0
- data/doc/classes/NativeFileType.src/M000029.html +41 -0
- data/doc/classes/NativeFileType.src/M000030.html +24 -0
- data/doc/classes/NativeFileType.src/M000031.html +18 -0
- data/doc/classes/NativeFileType.src/M000032.html +18 -0
- data/doc/classes/NativeFileType.src/M000033.html +18 -0
- data/doc/classes/NativeFileType.src/M000034.html +20 -0
- data/doc/classes/NativeFileType.src/M000035.html +28 -0
- data/doc/classes/PackedAppleDosPic.html +9 -8
- data/doc/classes/PackedAppleDosPic.src/M000009.html +40 -0
- data/doc/classes/PackedProDosPic.html +145 -0
- data/doc/classes/PackedProDosPic.src/M000011.html +40 -0
- data/doc/classes/PascalPic.html +10 -10
- data/doc/classes/PascalPic.src/M000047.html +20 -0
- data/doc/classes/PascalPic.src/M000048.html +18 -0
- data/doc/classes/ProDosBINFile.html +186 -0
- data/doc/classes/ProDosBINFile.src/M000040.html +20 -0
- data/doc/classes/ProDosBINFile.src/M000041.html +18 -0
- data/doc/classes/ProDosBINFile.src/M000042.html +18 -0
- data/doc/classes/ProDosBINFile.src/M000043.html +18 -0
- data/doc/classes/ProDosBinPic.html +15 -15
- data/doc/classes/ProDosBinPic.src/M000044.html +20 -0
- data/doc/classes/ProDosBinPic.src/M000045.html +18 -0
- data/doc/classes/ProDosBinPic.src/M000046.html +18 -0
- data/doc/classes/ProDosFile.html +15 -15
- data/doc/classes/ProDosFile.src/M000005.html +20 -0
- data/doc/classes/ProDosFile.src/M000006.html +18 -0
- data/doc/classes/ProDosFile.src/M000007.html +19 -0
- data/doc/classes/RipXplore.html +1 -1
- data/doc/classes/ScrunchedAppleDosPic.html +139 -0
- data/doc/classes/ScrunchedAppleDosPic.src/M000004.html +37 -0
- data/doc/created.rid +1 -1
- data/doc/files/bin/ripxplore_rb.html +1 -1
- data/doc/files/lib/NativeFileType_rb.html +3 -3
- data/doc/files/lib/RipXplore_rb.html +2 -2
- data/doc/files/lib/file_systems/AppleDos_rb.html +2 -2
- data/doc/files/lib/native_file_types/apple2/AppleHiResPic_rb.html +1 -1
- data/doc/files/lib/native_file_types/apple2/PackedHiResPicFormats_rb.html +101 -0
- data/doc/files/lib/native_file_types/apple2/ProDosFile_rb.html +1 -1
- data/doc/files/test/tc_apple_2_rb.html +1 -1
- data/doc/files/test/testhelper_rb.html +17 -17
- data/doc/files/test/testhelper_rb.src/M000001.html +21 -0
- data/doc/files/test/testhelper_rb.src/M000002.html +18 -0
- data/doc/files/test/testhelper_rb.src/M000003.html +50 -8
- data/doc/fr_class_index.html +14 -0
- data/doc/fr_file_index.html +8 -0
- data/doc/fr_method_index.html +54 -0
- data/doc/index.html +1 -1
- data/lib/NativeFileType.rb +3 -2
- data/lib/RipXplore.rb +1 -1
- data/lib/file_systems/AppleDos.rb +16 -29
- data/lib/native_file_types/apple2/AppleHiResPic.rb +11 -10
- data/lib/native_file_types/apple2/PackedHiResPicFormats.rb +207 -0
- data/lib/native_file_types/apple2/ProDosFile.rb +21 -0
- data/test/native_files/30026e5208f55f2cbae4fc591f51de4a-5.png +0 -0
- data/test/native_files/f05d95201b4e736216448ba9f9902db6-11.png +0 -0
- data/test/native_files/f8819465c0c0eb1e74fa88c7e1e59405-7.png +0 -0
- data/test/tc_apple_2.rb +23 -4
- data/test/testhelper.rb +2 -0
- data/test/testlog.txt +56809 -119242
- metadata +68 -3
- 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
|
-
#
|
37
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
95
|
-
|
96
|
-
|
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
|
-
|
100
|
-
|
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
|
-
|
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
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
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
|
-
|
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
|
#
|
data/doc/classes/AppleDos.html
CHANGED
@@ -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="#
|
183
|
-
<a href="#
|
184
|
-
<a href="#
|
185
|
-
<a href="#
|
180
|
+
<a href="#M000039">files</a>
|
181
|
+
<a href="#M000036">host_system</a>
|
182
|
+
<a href="#M000038">vtoc_sector_no</a>
|
183
|
+
<a href="#M000037">vtoc_track_no</a>
|
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-
|
208
|
-
<a name="
|
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/
|
212
|
-
onclick="popupCode('AppleDos.src/
|
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-
|
222
|
-
<a name="
|
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/
|
226
|
-
onclick="popupCode('AppleDos.src/
|
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-
|
236
|
-
<a name="
|
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/
|
240
|
-
onclick="popupCode('AppleDos.src/
|
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-
|
250
|
-
<a name="
|
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/
|
254
|
-
onclick="popupCode('AppleDos.src/
|
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">""</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">""</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">"\x00-\x1f"</span>,<span class="ruby-value str">"\x40-\x5f"</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">>=</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 "filename #{filename} sector count #{sector_count}"</span>
|
35
|
+
<span class="ruby-identifier">contents</span>=<span class="ruby-value str">""</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">></span><span class="ruby-value">0</span>) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">ts_list_track_no</span><span class="ruby-operator"><=</span><span class="ruby-value">0</span><span class="ruby-constant">X22</span>) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">ts_list_sector_no</span><span class="ruby-operator"><=</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">></span><span class="ruby-value">0</span>) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">data_track_no</span><span class="ruby-operator"><=</span><span class="ruby-value">0</span><span class="ruby-constant">X22</span>) <span class="ruby-operator">&&</span> (<span class="ruby-identifier">data_sector_no</span><span class="ruby-operator"><=</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">></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"><<</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">&&</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">"#{next_track}/#{next_sector}"</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="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
91
|
+
<a href="#M000051">file_system_file_types</a>
|
92
|
+
<a href="#M000053">header_length</a>
|
93
|
+
<a href="#M000052">load_address</a>
|
94
|
+
<a href="#M000054">unpacked_picture_bytes</a>
|
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-
|
117
|
-
<a name="
|
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/
|
121
|
-
onclick="popupCode('AppleDosPic.src/
|
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-
|
131
|
-
<a name="
|
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/
|
135
|
-
onclick="popupCode('AppleDosPic.src/
|
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-
|
147
|
-
<a name="
|
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/
|
151
|
-
onclick="popupCode('AppleDosPic.src/
|
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-
|
161
|
-
<a name="
|
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/
|
165
|
-
onclick="popupCode('AppleDosPic.src/
|
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">></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>
|