dsktool 0.1.2 → 0.1.3
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.
- data/bin/dsktool.rb +14 -7
- data/doc/classes/AppleSoftFile.html +19 -18
- data/doc/classes/AppleSoftFile.src/M000011.html +4 -4
- data/doc/classes/AppleSoftFile.src/M000012.html +4 -4
- data/doc/classes/AppleSoftFile.src/M000013.html +18 -0
- data/doc/classes/AppleSoftFile.src/M000014.html +18 -0
- data/doc/classes/BinaryFile.html +19 -18
- data/doc/classes/BinaryFile.src/M000024.html +4 -4
- data/doc/classes/BinaryFile.src/M000025.html +4 -5
- data/doc/classes/BinaryFile.src/M000026.html +19 -0
- data/doc/classes/BinaryFile.src/M000029.html +18 -0
- data/doc/classes/BinaryFile.src/M000030.html +18 -0
- data/doc/classes/BinaryFile.src/M000031.html +19 -0
- data/doc/classes/D65.html +10 -10
- data/doc/classes/D65.src/M000009.html +4 -50
- data/doc/classes/D65.src/M000010.html +18 -0
- data/doc/classes/D65.src/M000011.html +64 -0
- data/doc/classes/DOSDisk.html +15 -15
- data/doc/classes/DOSDisk.src/M000014.html +6 -5
- data/doc/classes/DOSDisk.src/M000015.html +6 -62
- data/doc/classes/DOSDisk.src/M000016.html +19 -0
- data/doc/classes/DOSDisk.src/M000017.html +76 -0
- data/doc/classes/DOSFile.html +19 -18
- data/doc/classes/DOSFile.src/M000027.html +8 -3
- data/doc/classes/DOSFile.src/M000028.html +3 -4
- data/doc/classes/DOSFile.src/M000029.html +18 -0
- data/doc/classes/DOSFile.src/M000032.html +22 -0
- data/doc/classes/DOSFile.src/M000033.html +17 -0
- data/doc/classes/DOSFile.src/M000034.html +18 -0
- data/doc/classes/DSK.html +35 -35
- data/doc/classes/DSK.src/M000017.html +8 -8
- data/doc/classes/DSK.src/M000018.html +8 -13
- data/doc/classes/DSK.src/M000019.html +8 -5
- data/doc/classes/DSK.src/M000020.html +20 -4
- data/doc/classes/DSK.src/M000021.html +4 -25
- data/doc/classes/DSK.src/M000022.html +4 -9
- data/doc/classes/DSK.src/M000023.html +40 -0
- data/doc/classes/DSK.src/M000024.html +23 -0
- data/doc/classes/IntegerBasicFile.html +19 -18
- data/doc/classes/IntegerBasicFile.src/M000005.html +4 -4
- data/doc/classes/IntegerBasicFile.src/M000006.html +4 -4
- data/doc/classes/IntegerBasicFile.src/M000007.html +18 -0
- data/doc/classes/IntegerBasicFile.src/M000008.html +18 -0
- data/doc/classes/RDoc.html +5 -5
- data/doc/classes/RDoc.src/M000033.html +40 -0
- data/doc/classes/RDoc.src/M000038.html +40 -0
- data/doc/classes/SCAsmFile.html +226 -0
- data/doc/classes/SCAsmFile.src/M000025.html +18 -0
- data/doc/classes/SCAsmFile.src/M000026.html +18 -0
- data/doc/classes/SCAsmFile.src/M000027.html +18 -0
- data/doc/classes/SCAsmFile.src/M000028.html +36 -0
- data/doc/classes/TestDOSDisks.html +31 -1
- data/doc/classes/TestDOSDisks.src/M000003.html +3 -21
- data/doc/classes/TestDOSDisks.src/M000004.html +41 -0
- data/doc/classes/TestDOSDisks.src/M000005.html +27 -0
- data/doc/classes/TestDisassembly.html +5 -5
- data/doc/classes/TestDisassembly.src/M000008.html +19 -0
- data/doc/classes/TestDisassembly.src/M000009.html +19 -0
- data/doc/classes/TextFile.html +19 -18
- data/doc/classes/TextFile.src/M000030.html +4 -4
- data/doc/classes/TextFile.src/M000031.html +4 -6
- data/doc/classes/TextFile.src/M000032.html +20 -0
- data/doc/classes/TextFile.src/M000035.html +18 -0
- data/doc/classes/TextFile.src/M000036.html +18 -0
- data/doc/classes/TextFile.src/M000037.html +20 -0
- data/doc/created.rid +1 -1
- data/doc/dot/f_3.dot +13 -0
- data/doc/dot/f_3.png +0 -0
- data/doc/files/bin/dsktool_rb.html +32 -22
- data/doc/files/lib/DOSDisk_rb.html +1 -1
- data/doc/files/lib/DOSFile_rb.html +5 -4
- data/doc/files/lib/DSK_rb.html +3 -1
- data/doc/files/test/tc_dos_disks_rb.html +1 -1
- data/doc/fr_class_index.html +1 -0
- data/doc/fr_method_index.html +36 -30
- data/lib/CHANGES.txt +5 -0
- data/lib/DOSDisk.rb +1 -1
- data/lib/DOSFile.rb +91 -0
- data/lib/DSK.rb +10 -2
- data/test/AAL_1.DSK +0 -0
- data/test/tc_dos_disks.rb +25 -3
- metadata +37 -1
|
@@ -5,13 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (DOSFile)</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 lib/DOSFile.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DOSFile.rb, line 10</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">filename</span>,<span class="ruby-identifier">locked</span>,<span class="ruby-identifier">sector_count</span>,<span class="ruby-identifier">contents</span>)
|
|
15
|
+
<span class="ruby-ivar">@filename</span>=<span class="ruby-identifier">filename</span>
|
|
16
|
+
<span class="ruby-ivar">@locked</span>=<span class="ruby-identifier">locked</span>
|
|
17
|
+
<span class="ruby-ivar">@sector_count</span>=<span class="ruby-identifier">sector_count</span>
|
|
18
|
+
<span class="ruby-ivar">@file_type</span>=<span class="ruby-value str">"?"</span>
|
|
19
|
+
<span class="ruby-ivar">@contents</span>=<span class="ruby-identifier">contents</span>
|
|
15
20
|
<span class="ruby-keyword kw">end</span></pre>
|
|
16
21
|
</body>
|
|
17
22
|
</html>
|
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>file_type (DOSFile)</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 lib/DOSFile.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-ivar">@contents</span>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DOSFile.rb, line 19</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_type</span>
|
|
16
15
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
16
|
</body>
|
|
18
17
|
</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>to_s (DOSFile)</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/DOSFile.rb, line 22</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
|
15
|
+
<span class="ruby-ivar">@contents</span>
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
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>new (DOSFile)</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/DOSFile.rb, line 10</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">filename</span>,<span class="ruby-identifier">locked</span>,<span class="ruby-identifier">sector_count</span>,<span class="ruby-identifier">contents</span>)
|
|
15
|
+
<span class="ruby-ivar">@filename</span>=<span class="ruby-identifier">filename</span>
|
|
16
|
+
<span class="ruby-ivar">@locked</span>=<span class="ruby-identifier">locked</span>
|
|
17
|
+
<span class="ruby-ivar">@sector_count</span>=<span class="ruby-identifier">sector_count</span>
|
|
18
|
+
<span class="ruby-ivar">@file_type</span>=<span class="ruby-value str">"?"</span>
|
|
19
|
+
<span class="ruby-ivar">@contents</span>=<span class="ruby-identifier">contents</span>
|
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
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_type (DOSFile)</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/DOSFile.rb, line 19</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_type</span>
|
|
15
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
16
|
+
</body>
|
|
17
|
+
</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>to_s (DOSFile)</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/DOSFile.rb, line 22</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
|
15
|
+
<span class="ruby-ivar">@contents</span>
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
data/doc/classes/DSK.html
CHANGED
|
@@ -101,13 +101,13 @@ many Apple 2 emulators.
|
|
|
101
101
|
<h3 class="section-bar">Methods</h3>
|
|
102
102
|
|
|
103
103
|
<div class="name-list">
|
|
104
|
-
<a href="#
|
|
105
|
-
<a href="#
|
|
106
|
-
<a href="#
|
|
107
|
-
<a href="#
|
|
108
|
-
<a href="#
|
|
109
|
-
<a href="#
|
|
110
|
-
<a href="#
|
|
104
|
+
<a href="#M000024">dump_disk</a>
|
|
105
|
+
<a href="#M000023">dump_sector</a>
|
|
106
|
+
<a href="#M000022">files</a>
|
|
107
|
+
<a href="#M000021">get_sector</a>
|
|
108
|
+
<a href="#M000018">is_dos33?</a>
|
|
109
|
+
<a href="#M000019">new</a>
|
|
110
|
+
<a href="#M000020">read</a>
|
|
111
111
|
</div>
|
|
112
112
|
</div>
|
|
113
113
|
|
|
@@ -155,12 +155,12 @@ many Apple 2 emulators.
|
|
|
155
155
|
<div id="methods">
|
|
156
156
|
<h3 class="section-bar">Public Class methods</h3>
|
|
157
157
|
|
|
158
|
-
<div id="method-
|
|
159
|
-
<a name="
|
|
158
|
+
<div id="method-M000019" class="method-detail">
|
|
159
|
+
<a name="M000019"></a>
|
|
160
160
|
|
|
161
161
|
<div class="method-heading">
|
|
162
|
-
<a href="DSK.src/
|
|
163
|
-
onclick="popupCode('DSK.src/
|
|
162
|
+
<a href="DSK.src/M000019.html" target="Code" class="method-signature"
|
|
163
|
+
onclick="popupCode('DSK.src/M000019.html');return false;">
|
|
164
164
|
<span class="method-name">new</span><span class="method-args">(file_bytes="\0"*DSK_FILE_LENGTH)</span>
|
|
165
165
|
</a>
|
|
166
166
|
</div>
|
|
@@ -172,12 +172,12 @@ create a new <a href="DSK.html">DSK</a> structure (in memory, not on disk)
|
|
|
172
172
|
</div>
|
|
173
173
|
</div>
|
|
174
174
|
|
|
175
|
-
<div id="method-
|
|
176
|
-
<a name="
|
|
175
|
+
<div id="method-M000020" class="method-detail">
|
|
176
|
+
<a name="M000020"></a>
|
|
177
177
|
|
|
178
178
|
<div class="method-heading">
|
|
179
|
-
<a href="DSK.src/
|
|
180
|
-
onclick="popupCode('DSK.src/
|
|
179
|
+
<a href="DSK.src/M000020.html" target="Code" class="method-signature"
|
|
180
|
+
onclick="popupCode('DSK.src/M000020.html');return false;">
|
|
181
181
|
<span class="method-name">read</span><span class="method-args">(filename)</span>
|
|
182
182
|
</a>
|
|
183
183
|
</div>
|
|
@@ -191,12 +191,12 @@ read in an existing <a href="DSK.html">DSK</a> file (must exist)
|
|
|
191
191
|
|
|
192
192
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
193
193
|
|
|
194
|
-
<div id="method-
|
|
195
|
-
<a name="
|
|
194
|
+
<div id="method-M000024" class="method-detail">
|
|
195
|
+
<a name="M000024"></a>
|
|
196
196
|
|
|
197
197
|
<div class="method-heading">
|
|
198
|
-
<a href="DSK.src/
|
|
199
|
-
onclick="popupCode('DSK.src/
|
|
198
|
+
<a href="DSK.src/M000024.html" target="Code" class="method-signature"
|
|
199
|
+
onclick="popupCode('DSK.src/M000024.html');return false;">
|
|
200
200
|
<span class="method-name">dump_disk</span><span class="method-args">()</span>
|
|
201
201
|
</a>
|
|
202
202
|
</div>
|
|
@@ -208,12 +208,12 @@ print to stdout a formatted hex dump of all sectors on all tracks
|
|
|
208
208
|
</div>
|
|
209
209
|
</div>
|
|
210
210
|
|
|
211
|
-
<div id="method-
|
|
212
|
-
<a name="
|
|
211
|
+
<div id="method-M000023" class="method-detail">
|
|
212
|
+
<a name="M000023"></a>
|
|
213
213
|
|
|
214
214
|
<div class="method-heading">
|
|
215
|
-
<a href="DSK.src/
|
|
216
|
-
onclick="popupCode('DSK.src/
|
|
215
|
+
<a href="DSK.src/M000023.html" target="Code" class="method-signature"
|
|
216
|
+
onclick="popupCode('DSK.src/M000023.html');return false;">
|
|
217
217
|
<span class="method-name">dump_sector</span><span class="method-args">(track,sector)</span>
|
|
218
218
|
</a>
|
|
219
219
|
</div>
|
|
@@ -225,12 +225,12 @@ print to stdout a formatted hex dump of a single 256 byte sector
|
|
|
225
225
|
</div>
|
|
226
226
|
</div>
|
|
227
227
|
|
|
228
|
-
<div id="method-
|
|
229
|
-
<a name="
|
|
228
|
+
<div id="method-M000022" class="method-detail">
|
|
229
|
+
<a name="M000022"></a>
|
|
230
230
|
|
|
231
231
|
<div class="method-heading">
|
|
232
|
-
<a href="DSK.src/
|
|
233
|
-
onclick="popupCode('DSK.src/
|
|
232
|
+
<a href="DSK.src/M000022.html" target="Code" class="method-signature"
|
|
233
|
+
onclick="popupCode('DSK.src/M000022.html');return false;">
|
|
234
234
|
<span class="method-name">files</span><span class="method-args">()</span>
|
|
235
235
|
</a>
|
|
236
236
|
</div>
|
|
@@ -239,12 +239,12 @@ print to stdout a formatted hex dump of a single 256 byte sector
|
|
|
239
239
|
</div>
|
|
240
240
|
</div>
|
|
241
241
|
|
|
242
|
-
<div id="method-
|
|
243
|
-
<a name="
|
|
242
|
+
<div id="method-M000021" class="method-detail">
|
|
243
|
+
<a name="M000021"></a>
|
|
244
244
|
|
|
245
245
|
<div class="method-heading">
|
|
246
|
-
<a href="DSK.src/
|
|
247
|
-
onclick="popupCode('DSK.src/
|
|
246
|
+
<a href="DSK.src/M000021.html" target="Code" class="method-signature"
|
|
247
|
+
onclick="popupCode('DSK.src/M000021.html');return false;">
|
|
248
248
|
<span class="method-name">get_sector</span><span class="method-args">(track,sector)</span>
|
|
249
249
|
</a>
|
|
250
250
|
</div>
|
|
@@ -253,12 +253,12 @@ print to stdout a formatted hex dump of a single 256 byte sector
|
|
|
253
253
|
</div>
|
|
254
254
|
</div>
|
|
255
255
|
|
|
256
|
-
<div id="method-
|
|
257
|
-
<a name="
|
|
256
|
+
<div id="method-M000018" class="method-detail">
|
|
257
|
+
<a name="M000018"></a>
|
|
258
258
|
|
|
259
259
|
<div class="method-heading">
|
|
260
|
-
<a href="DSK.src/
|
|
261
|
-
onclick="popupCode('DSK.src/
|
|
260
|
+
<a href="DSK.src/M000018.html" target="Code" class="method-signature"
|
|
261
|
+
onclick="popupCode('DSK.src/M000018.html');return false;">
|
|
262
262
|
<span class="method-name">is_dos33?</span><span class="method-args">()</span>
|
|
263
263
|
</a>
|
|
264
264
|
</div>
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>is_dos33? (DSK)</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 lib/DSK.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span>
|
|
15
|
-
<span class="ruby-
|
|
16
|
-
|
|
17
|
-
<span class="ruby-
|
|
18
|
-
|
|
19
|
-
<span class="ruby-ivar">@
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DSK.rb, line 13</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_dos33?</span>
|
|
15
|
+
<span class="ruby-comment cmt"># VTOC is at offset 0x11000</span>
|
|
16
|
+
<span class="ruby-comment cmt"># bytes 1/2/3 are a track number, sector number and DOS version number</span>
|
|
17
|
+
<span class="ruby-comment cmt"># see if these are reasonable values</span>
|
|
18
|
+
|
|
19
|
+
(<span class="ruby-ivar">@file_bytes</span>[<span class="ruby-value">0x11001</span>]<span class="ruby-operator"><=</span><span class="ruby-value">34</span>) <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@file_bytes</span>[<span class="ruby-value">0x11002</span>]<span class="ruby-operator"><=</span><span class="ruby-value">15</span>) <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@file_bytes</span>[<span class="ruby-value">0x11003</span>]<span class="ruby-operator">==</span><span class="ruby-value">3</span>)
|
|
20
20
|
<span class="ruby-keyword kw">end</span></pre>
|
|
21
21
|
</body>
|
|
22
22
|
</html>
|
|
@@ -5,23 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>is_dos33? (DSK)</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 lib/DSK.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span>
|
|
15
|
-
<span class="ruby-
|
|
16
|
-
<span class="ruby-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<span class="ruby-
|
|
20
|
-
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">dsk</span>.<span class="ruby-identifier">is_dos33?</span>)
|
|
21
|
-
<span class="ruby-identifier">require</span> <span class="ruby-value str">'DOSDisk'</span>
|
|
22
|
-
<span class="ruby-identifier">dsk</span>=<span class="ruby-constant">DOSDisk</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file_bytes</span>)
|
|
23
|
-
<span class="ruby-keyword kw">end</span>
|
|
24
|
-
<span class="ruby-identifier">dsk</span>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DSK.rb, line 14</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_dos33?</span>
|
|
15
|
+
<span class="ruby-comment cmt"># VTOC is at offset 0x11000</span>
|
|
16
|
+
<span class="ruby-comment cmt"># bytes 1/2/3 are a track number, sector number and DOS version number</span>
|
|
17
|
+
<span class="ruby-comment cmt"># see if these are reasonable values</span>
|
|
18
|
+
|
|
19
|
+
(<span class="ruby-ivar">@file_bytes</span>[<span class="ruby-value">0x11001</span>]<span class="ruby-operator"><=</span><span class="ruby-value">34</span>) <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@file_bytes</span>[<span class="ruby-value">0x11002</span>]<span class="ruby-operator"><=</span><span class="ruby-value">15</span>) <span class="ruby-operator">&&</span> (<span class="ruby-ivar">@file_bytes</span>[<span class="ruby-value">0x11003</span>]<span class="ruby-operator">==</span><span class="ruby-value">3</span>)
|
|
25
20
|
<span class="ruby-keyword kw">end</span></pre>
|
|
26
21
|
</body>
|
|
27
22
|
</html>
|
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (DSK)</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 lib/DSK.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
16
|
-
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DSK.rb, line 23</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">file_bytes</span>=<span class="ruby-value str">"\0"</span><span class="ruby-operator">*</span><span class="ruby-constant">DSK_FILE_LENGTH</span>)
|
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">file_bytes</span>.<span class="ruby-identifier">length!</span>=<span class="ruby-constant">DSK_FILE_LENGTH</span>) <span class="ruby-keyword kw">then</span>
|
|
16
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"DSK files must be #{DSK_FILE_LENGTH} bytes long (was #{file_bytes.length} bytes)"</span>
|
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
|
18
|
+
<span class="ruby-ivar">@file_bytes</span>=<span class="ruby-identifier">file_bytes</span>
|
|
19
|
+
<span class="ruby-ivar">@files</span>={}
|
|
17
20
|
<span class="ruby-keyword kw">end</span></pre>
|
|
18
21
|
</body>
|
|
19
22
|
</html>
|
|
@@ -5,14 +5,30 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>read (DSK)</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 lib/DSK.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DSK.rb, line 32</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">DSK</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>)
|
|
15
|
+
<span class="ruby-comment cmt">#is the file extension .gz?</span>
|
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">filename</span><span class="ruby-operator">=~</span><span class="ruby-regexp re">/\.gz$/</span>).<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
|
|
17
|
+
<span class="ruby-identifier">require</span> <span class="ruby-value str">'zlib'</span>
|
|
18
|
+
<span class="ruby-identifier">file_bytes</span>=<span class="ruby-constant">Zlib</span><span class="ruby-operator">::</span><span class="ruby-constant">GzipReader</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>,<span class="ruby-value str">"rb"</span>)).<span class="ruby-identifier">read</span>
|
|
19
|
+
<span class="ruby-keyword kw">else</span>
|
|
20
|
+
<span class="ruby-identifier">file_bytes</span>=<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>,<span class="ruby-value str">"rb"</span>).<span class="ruby-identifier">read</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
|
22
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">file_bytes</span>.<span class="ruby-identifier">length!</span>=<span class="ruby-constant">DSK_FILE_LENGTH</span>) <span class="ruby-keyword kw">then</span>
|
|
23
|
+
<span class="ruby-identifier">abort</span>(<span class="ruby-node">"#{filename} is not a valid DSK format file"</span>)
|
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
|
25
|
+
|
|
26
|
+
<span class="ruby-identifier">dsk</span>=<span class="ruby-constant">DSK</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file_bytes</span>)
|
|
27
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">dsk</span>.<span class="ruby-identifier">is_dos33?</span>)
|
|
28
|
+
<span class="ruby-identifier">require</span> <span class="ruby-value str">'DOSDisk'</span>
|
|
29
|
+
<span class="ruby-identifier">dsk</span>=<span class="ruby-constant">DOSDisk</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file_bytes</span>)
|
|
30
|
+
<span class="ruby-keyword kw">end</span>
|
|
31
|
+
<span class="ruby-identifier">dsk</span>
|
|
16
32
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
33
|
</body>
|
|
18
34
|
</html>
|
|
@@ -5,36 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>get_sector (DSK)</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 lib/DSK.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DSK.rb, line 52</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">track</span>,<span class="ruby-identifier">sector</span>)
|
|
16
15
|
<span class="ruby-identifier">start_byte</span>=<span class="ruby-identifier">track</span><span class="ruby-operator">*</span><span class="ruby-value">16</span><span class="ruby-operator">*</span><span class="ruby-value">256</span><span class="ruby-operator">+</span><span class="ruby-identifier">sector</span><span class="ruby-operator">*</span><span class="ruby-value">256</span>
|
|
17
|
-
<span class="ruby-
|
|
18
|
-
|
|
19
|
-
<span class="ruby-identifier">print_hline</span>
|
|
20
|
-
<span class="ruby-identifier">printf</span>(<span class="ruby-value str">"TRACK: $%02X SECTOR $%02X\ OFFSET $%04X\n"</span>,<span class="ruby-identifier">track</span>,<span class="ruby-identifier">sector</span>,<span class="ruby-identifier">start_byte</span>)
|
|
21
|
-
<span class="ruby-identifier">printf</span> <span class="ruby-value str">"\t"</span>
|
|
22
|
-
|
|
23
|
-
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">15</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">printf</span>(<span class="ruby-value str">"%02X "</span>,<span class="ruby-identifier">x</span>) }
|
|
24
|
-
<span class="ruby-identifier">puts</span>
|
|
25
|
-
<span class="ruby-identifier">print_hline</span>
|
|
26
|
-
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">15</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">line_number</span><span class="ruby-operator">|</span>
|
|
27
|
-
<span class="ruby-identifier">lhs</span>=<span class="ruby-value str">""</span>
|
|
28
|
-
<span class="ruby-identifier">rhs</span>=<span class="ruby-value str">""</span>
|
|
29
|
-
<span class="ruby-identifier">start_byte</span>=<span class="ruby-identifier">line_number</span><span class="ruby-operator">*</span><span class="ruby-value">16</span>
|
|
30
|
-
<span class="ruby-identifier">line</span>=<span class="ruby-identifier">s</span>[<span class="ruby-identifier">start_byte</span><span class="ruby-operator">..</span><span class="ruby-identifier">start_byte</span><span class="ruby-operator">+</span><span class="ruby-value">15</span>]
|
|
31
|
-
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">each_byte</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">byte</span><span class="ruby-operator">|</span>
|
|
32
|
-
<span class="ruby-identifier">lhs</span><span class="ruby-operator">+=</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"%02X "</span>, <span class="ruby-identifier">byte</span>)
|
|
33
|
-
<span class="ruby-identifier">rhs</span><span class="ruby-operator">+=</span> (<span class="ruby-identifier">byte</span><span class="ruby-operator">%</span><span class="ruby-value">128</span>).<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/[\x00-\x1f]/</span>,<span class="ruby-value str">'.'</span>)
|
|
34
|
-
}
|
|
35
|
-
<span class="ruby-identifier">printf</span>(<span class="ruby-value str">"%02X\t%s %s\n"</span>,<span class="ruby-identifier">start_byte</span>,<span class="ruby-identifier">lhs</span>,<span class="ruby-identifier">rhs</span>)
|
|
36
|
-
}
|
|
37
|
-
|
|
16
|
+
<span class="ruby-ivar">@file_bytes</span>[<span class="ruby-identifier">start_byte</span><span class="ruby-operator">..</span><span class="ruby-identifier">start_byte</span><span class="ruby-operator">+</span><span class="ruby-value">255</span>]
|
|
38
17
|
<span class="ruby-keyword kw">end</span></pre>
|
|
39
18
|
</body>
|
|
40
19
|
</html>
|
|
@@ -5,19 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>files (DSK)</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 lib/DSK.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
|
|
16
|
-
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">34</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">track</span><span class="ruby-operator">|</span>
|
|
17
|
-
(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">15</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">sector</span><span class="ruby-operator">|</span>
|
|
18
|
-
<span class="ruby-identifier">dump_sector</span>(<span class="ruby-identifier">track</span>,<span class="ruby-identifier">sector</span>)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/DSK.rb, line 57</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">files</span>
|
|
15
|
+
<span class="ruby-ivar">@files</span>
|
|
21
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
22
17
|
</body>
|
|
23
18
|
</html>
|