dsktool 0.1.3 → 0.1.4

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 CHANGED
@@ -1,164 +1,177 @@
1
- #
2
- # dsktool.rb
3
- #
4
- # == Synopsis
5
- #
6
- # Manipulate DSK format files (as used by Apple 2 emulators)
7
- #
8
- # == Usage
9
- #
10
- # dsktool.rb [switches] <filename.dsk>
11
- # -c | --log display catalog
12
- # -e | --extract FILENAME extract file by name (either to stdout,
13
- # or file specified by --output)
14
- # -h | --help display this message
15
- # -l | --list FILENAME monitor style listing (disassembles 65C02 opcodes)
16
- # -o | --output FILENAME specify name to save extracted file as
17
- # -x | --explode extract all files
18
- # -v | --version show version number
19
- #
20
- # Currently only works with DOS 3.3 format
21
- # DSK images can be
22
- #
23
- # examples:
24
- # dsktool.rb -c DOS3MASTR.dsk.gz
25
- # dsktool.rb -l FID DOS3MASTR.dsk
26
- # dsktool.rb --list fid -o fid.asm DOS3MASTR.dsk
27
- # dsktool.rb --extract "COLOR DEMOSOFT" DOS3MASTR.dsk
28
- # dsktool.rb -e HELLO -o HELLO.bas DOS3MASTR.dsk
29
- # dsktool.rb -x DOS3MASTR.dsk.gz
30
- #
31
-
32
- DSKTOOL_VERSION="0.1.3"
33
-
34
- require 'optparse'
35
- require 'rdoc/usage'
36
-
37
- #due to a bug in rdoc, tghe Usage won't work correctly when run from a gem executable
38
- # see http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/211297
39
- # Display usage from the given file
40
- def RDoc.usage_from_file(input_file, *args)
41
- comment = File.open(input_file) do |file|
42
- RDoc.find_comment(file)
43
- end
44
- comment = comment.gsub(/^\s*#/, '')
45
-
46
- markup = SM::SimpleMarkup.new
47
- flow_convertor = SM::ToFlow.new
48
-
49
- flow = markup.convert(comment, flow_convertor)
50
-
51
- format = "plain"
52
-
53
- unless args.empty?
54
- flow = extract_sections(flow, args)
55
- end
56
-
57
- options = RI::Options.instance
58
- if args = ENV["RI"]
59
- options.parse(args.split)
60
- end
61
- formatter = options.formatter.new(options, "")
62
- formatter.display_flow(flow)
63
- exit
64
- end
65
-
66
-
67
- catalog=false
68
- explode=false
69
- output_filename=nil
70
- extract_filename=nil
71
- list_filename=nil
72
- explode_directory=nil
73
- opts=OptionParser.new
74
- opts.on("-h","--help") {RDoc::usage_from_file(__FILE__)}
75
- opts.on("-v","--version") do
76
- puts "dsktool.rb "+DSKTOOL_VERSION
77
- exit
78
- end
79
- opts.on("-c","--catalog") {catalog=true}
80
- opts.on("-x","--explode") {explode=true}
81
- opts.on("-l","--list FILENAME",String) {|val| list_filename=val.upcase}
82
- opts.on("-e","--extract FILENAME",String) {|val| extract_filename=val.upcase}
83
- opts.on("-o","--output FILENAME",String) {|val| output_filename=val}
84
- filename=opts.parse(ARGV)[0] rescue RDoc::usage_from_file(__FILE__,'Usage')
85
- RDoc::usage_from_file(__FILE__,'Usage') if (filename.nil?)
86
-
87
- #make sure the relevant folder with our libraries is in the require path
88
- lib_path=File.expand_path(File.dirname(__FILE__)+"//..//lib")
89
- $:.unshift(lib_path) unless $:.include?(lib_path)
90
-
91
- require 'DSK'
92
- dsk=DSK.read(filename)
93
- output_file= case
94
- when (output_filename.nil?) then STDOUT
95
- else File.open(output_filename,"wb")
96
- end
97
-
98
- if(catalog) then
99
- if (dsk.is_dos33?) then
100
- dsk.dump_catalog
101
- else
102
- puts "#{filename} is not in DOS 3.3 format"
103
- end
104
- end
105
-
106
- if(explode) then
107
- output_dir=File.basename(filename,".*")
108
- if !(File.exists?(output_dir)) then
109
- Dir.mkdir(output_dir)
110
- end
111
-
112
- dsk.files.each_value do |f|
113
- output_filename=output_dir+"/"+f.filename+f.file_extension
114
- File.open(output_filename,"wb") <<f
115
- end
116
- end
117
-
118
-
119
- if (!extract_filename.nil?) then
120
- file=dsk.files[extract_filename]
121
- if file.nil? then
122
- puts "'#{extract_filename}' not found in #{filename}"
123
- else
124
- output_file<<file
125
- end
126
- end
127
-
128
- if (!list_filename.nil?) then
129
- file=dsk.files[list_filename]
130
- if file.nil? then
131
- puts "'#{list_filename}' not found in #{filename}"
132
- else
133
- if file.instance_of?(BinaryFile)
134
- output_file<<file.disassembly
135
- else
136
- puts "'#{list_filename}' is not a binary file"
137
- end
138
- end
139
- end
140
-
141
- # == Author
142
- # Jonno Downes (jonno@jamtronix.com)
143
- #
144
- # == Copyright
145
- # Copyright (c) 2007 Jonno Downes (jonno@jamtronix.com)
146
- #
147
- #Permission is hereby granted, free of charge, to any person obtaining
148
- #a copy of this software and associated documentation files (the
149
- #"Software"), to deal in the Software without restriction, including
150
- #without limitation the rights to use, copy, modify, merge, publish,
151
- #distribute, sublicense, and/or sell copies of the Software, and to
152
- #permit persons to whom the Software is furnished to do so, subject to
153
- #the following conditions:
154
- #
155
- # The above copyright notice and this permission notice shall be
156
- # included in all copies or substantial portions of the Software.
157
- #
158
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
159
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
160
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
161
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
162
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
163
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
164
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ #!/usr/bin/ruby
2
+ # dsktool.rb
3
+ #
4
+ # == Synopsis
5
+ #
6
+ # Manipulate DSK format files (as used by Apple 2 emulators)
7
+ #
8
+ # == Usage
9
+ #
10
+ # dsktool.rb [switches] <filename.dsk>
11
+ # -c | --catalog display catalog
12
+ # -e | --extract FILENAME extract file by name (either to stdout,
13
+ # or file specified by --output)
14
+ # -h | --help display this message
15
+ # -l | --list FILENAME monitor style listing (disassembles 65C02 opcodes)
16
+ # -o | --output FILENAME specify name to save extracted file as
17
+ # -r | --raw don't convert basic files to ASCII
18
+ # -x | --explode extract all files
19
+ # -v | --version show version number
20
+ #
21
+ # Currently only works with DOS 3.3 format DSK images
22
+ # Will uncompress gzipped files (with extension .gz)
23
+ # input files can be URLs
24
+ #
25
+ # examples:
26
+ # dsktool.rb -c DOS3MASTR.dsk.gz
27
+ # dsktool.rb -l FID DOS3MASTR.dsk
28
+ # dsktool.rb --list fid -o fid.lst DOS3MASTR.dsk
29
+ # dsktool.rb --extract "COLOR DEMOSOFT" DOS3MASTR.dsk
30
+ # dsktool.rb -e HELLO -o HELLO.bas DOS3MASTR.dsk
31
+ # dsktool.rb -x DOS3MASTR.dsk.gz
32
+ # dsktool.rb -c http://jamtronix.com/dsks/apshai.dsk.gz
33
+
34
+ DSKTOOL_VERSION="0.1.4"
35
+
36
+ require 'optparse'
37
+ require 'rdoc/usage'
38
+
39
+ #due to a bug in rdoc, RDoc.usage won't work correctly when run from a gem executable
40
+ # see http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/211297
41
+ # Display usage from the given file
42
+ def RDoc.usage_from_file(input_file, *args)
43
+ comment = File.open(input_file) do |file|
44
+ RDoc.find_comment(file)
45
+ end
46
+ comment = comment.gsub(/^\s*#/, '')
47
+
48
+ markup = SM::SimpleMarkup.new
49
+ flow_convertor = SM::ToFlow.new
50
+
51
+ flow = markup.convert(comment, flow_convertor)
52
+
53
+ format = "plain"
54
+
55
+ unless args.empty?
56
+ flow = extract_sections(flow, args)
57
+ end
58
+
59
+ options = RI::Options.instance
60
+ if args = ENV["RI"]
61
+ options.parse(args.split)
62
+ end
63
+ formatter = options.formatter.new(options, "")
64
+ formatter.display_flow(flow)
65
+ exit
66
+ end
67
+
68
+
69
+ catalog=false
70
+ explode=false
71
+ raw_mode=false
72
+ output_filename=nil
73
+ extract_filename=nil
74
+ list_filename=nil
75
+ explode_directory=nil
76
+ opts=OptionParser.new
77
+ opts.on("-h","--help") {RDoc::usage_from_file(__FILE__)}
78
+ opts.on("-v","--version") do
79
+ puts "dsktool.rb "+DSKTOOL_VERSION
80
+ exit
81
+ end
82
+ opts.on("-r","--raw") {raw_mode=true}
83
+ opts.on("-c","--catalog") {catalog=true}
84
+ opts.on("-x","--explode") {explode=true}
85
+ opts.on("-l","--list FILENAME",String) {|val| list_filename=val.upcase}
86
+ opts.on("-e","--extract FILENAME",String) {|val| extract_filename=val.upcase}
87
+ opts.on("-o","--output FILENAME",String) {|val| output_filename=val}
88
+ filename=opts.parse(ARGV)[0] rescue RDoc::usage_from_file(__FILE__,'Usage')
89
+ RDoc::usage_from_file(__FILE__,'Usage') if (filename.nil?)
90
+
91
+ #make sure the relevant folder with our libraries is in the require path
92
+ lib_path=File.expand_path(File.dirname(__FILE__)+"//..//lib")
93
+ $:.unshift(lib_path) unless $:.include?(lib_path)
94
+
95
+ require 'DSK'
96
+ dsk=DSK.read(filename)
97
+ output_file= case
98
+ when (output_filename.nil?) then STDOUT
99
+ else File.open(output_filename,"wb")
100
+ end
101
+
102
+ if(catalog) then
103
+ if (dsk.is_dos33?) then
104
+ dsk.dump_catalog
105
+ else
106
+ puts "#{filename} is not in DOS 3.3 format"
107
+ end
108
+ end
109
+
110
+ if(explode) then
111
+ output_dir=File.basename(filename,".*")
112
+ if !(File.exists?(output_dir)) then
113
+ Dir.mkdir(output_dir)
114
+ end
115
+
116
+ dsk.files.each_value do |f|
117
+ if (raw_mode) then
118
+ output_filename=output_dir+"/"+f.filename+".raw"
119
+ File.open(output_filename,"wb") <<f.contents
120
+ else
121
+ output_filename=output_dir+"/"+f.filename+f.file_extension
122
+ File.open(output_filename,"wb") <<f
123
+ end
124
+ end
125
+ end
126
+
127
+
128
+ if (!extract_filename.nil?) then
129
+ file=dsk.files[extract_filename]
130
+ if file.nil? then
131
+ puts "'#{extract_filename}' not found in #{filename}"
132
+ else
133
+ if (raw_mode) then
134
+ output_file<<file.contents
135
+ else
136
+ output_file<<file
137
+ end
138
+ end
139
+ end
140
+
141
+ if (!list_filename.nil?) then
142
+ file=dsk.files[list_filename]
143
+ if file.nil? then
144
+ puts "'#{list_filename}' not found in #{filename}"
145
+ else
146
+ if file.instance_of?(BinaryFile)
147
+ output_file<<file.disassembly
148
+ else
149
+ puts "'#{list_filename}' is not a binary file"
150
+ end
151
+ end
152
+ end
153
+
154
+ # == Author
155
+ # Jonno Downes (jonno@jamtronix.com)
156
+ #
157
+ # == Copyright
158
+ # Copyright (c) 2007 Jonno Downes (jonno@jamtronix.com)
159
+ #
160
+ #Permission is hereby granted, free of charge, to any person obtaining
161
+ #a copy of this software and associated documentation files (the
162
+ #"Software"), to deal in the Software without restriction, including
163
+ #without limitation the rights to use, copy, modify, merge, publish,
164
+ #distribute, sublicense, and/or sell copies of the Software, and to
165
+ #permit persons to whom the Software is furnished to do so, subject to
166
+ #the following conditions:
167
+ #
168
+ # The above copyright notice and this permission notice shall be
169
+ # included in all copies or substantial portions of the Software.
170
+ #
171
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
172
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
173
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
174
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
175
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
176
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
177
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -116,7 +116,7 @@
116
116
 
117
117
  <div class="method-description">
118
118
  <p>
119
- due to a bug in rdoc, tghe Usage won&#8217;t work correctly when run from a
119
+ due to a bug in rdoc, RDoc.usage won&#8217;t work correctly when run from a
120
120
  gem executable
121
121
  </p>
122
122
  <pre>
@@ -10,7 +10,7 @@
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 bin/dsktool.rb, line 40</span>
13
+ <pre><span class="ruby-comment cmt"># File bin/dsktool.rb, line 42</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">RDoc</span>.<span class="ruby-identifier">usage_from_file</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
15
15
  <span class="ruby-identifier">comment</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">input_file</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
16
16
  <span class="ruby-constant">RDoc</span>.<span class="ruby-identifier">find_comment</span>(<span class="ruby-identifier">file</span>)
@@ -10,7 +10,7 @@
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 355</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/DOSFile.rb, line 361</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_type</span>
15
15
  <span class="ruby-value str">&quot;I&quot;</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
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 359</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/DOSFile.rb, line 365</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
15
15
  <span class="ruby-constant">SCAsmFile</span>.<span class="ruby-identifier">buffer_as_scasm_file</span>(<span class="ruby-ivar">@contents</span>)
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
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 363</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/DOSFile.rb, line 369</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file_extension</span>
15
15
  <span class="ruby-value str">&quot;.asm&quot;</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
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 367</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/DOSFile.rb, line 373</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">SCAsmFile</span>.<span class="ruby-identifier">can_be_scasm_file</span>(<span class="ruby-identifier">buffer</span>)
15
15
  <span class="ruby-identifier">length</span>=<span class="ruby-identifier">buffer</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-identifier">buffer</span>[<span class="ruby-value">1</span>]<span class="ruby-operator">*</span><span class="ruby-value">256</span>
16
16
  <span class="ruby-identifier">index</span>=<span class="ruby-value">2</span>
data/doc/created.rid CHANGED
@@ -1 +1 @@
1
- Sat Jun 16 20:50:35 AUS Eastern Standard Time 2007
1
+ Sun Jun 17 11:26:44 AUS Eastern Standard Time 2007
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sat Jun 16 20:39:01 AUS Eastern Standard Time 2007</td>
59
+ <td>Sun Jun 17 11:22:55 AUS Eastern Standard Time 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -88,29 +88,31 @@ by Apple 2 emulators)
88
88
  dsktool.rb [switches] &lt;filename.dsk&gt;
89
89
  </p>
90
90
  <pre>
91
- -c | --log display catalog
91
+ -c | --catalog display catalog
92
92
  -e | --extract FILENAME extract file by name (either to stdout,
93
93
  or file specified by --output)
94
94
  -h | --help display this message
95
95
  -l | --list FILENAME monitor style listing (disassembles 65C02 opcodes)
96
96
  -o | --output FILENAME specify name to save extracted file as
97
+ -r | --raw don't convert basic files to ASCII
97
98
  -x | --explode extract all files
98
99
  -v | --version show version number
100
+
101
+ Currently only works with DOS 3.3 format DSK images
102
+ Will uncompress gzipped files (with extension .gz)
103
+ input files can be URLs
99
104
  </pre>
100
105
  <p>
101
- Currently only works with DOS 3.3 format <a
102
- href="../../classes/DSK.html">DSK</a> images can be
103
- </p>
104
- <p>
105
106
  examples:
106
107
  </p>
107
108
  <pre>
108
109
  dsktool.rb -c DOS3MASTR.dsk.gz
109
110
  dsktool.rb -l FID DOS3MASTR.dsk
110
- dsktool.rb --list fid -o fid.asm DOS3MASTR.dsk
111
+ dsktool.rb --list fid -o fid.lst DOS3MASTR.dsk
111
112
  dsktool.rb --extract &quot;COLOR DEMOSOFT&quot; DOS3MASTR.dsk
112
113
  dsktool.rb -e HELLO -o HELLO.bas DOS3MASTR.dsk
113
114
  dsktool.rb -x DOS3MASTR.dsk.gz
115
+ dsktool.rb -c http://jamtronix.com/dsks/apshai.dsk.gz
114
116
  </pre>
115
117
 
116
118
  </div>
@@ -144,7 +146,7 @@ examples:
144
146
  <tr class="top-aligned-row context-row">
145
147
  <td class="context-item-name">DSKTOOL_VERSION</td>
146
148
  <td>=</td>
147
- <td class="context-item-value">&quot;0.1.3&quot;</td>
149
+ <td class="context-item-value">&quot;0.1.4&quot;</td>
148
150
  <td width="3em">&nbsp;</td>
149
151
  <td class="context-item-desc">
150
152
  dsktool.rb
@@ -159,29 +161,31 @@ by Apple 2 emulators)
159
161
  dsktool.rb [switches] &lt;filename.dsk&gt;
160
162
  </p>
161
163
  <pre>
162
- -c | --log display catalog
164
+ -c | --catalog display catalog
163
165
  -e | --extract FILENAME extract file by name (either to stdout,
164
166
  or file specified by --output)
165
167
  -h | --help display this message
166
168
  -l | --list FILENAME monitor style listing (disassembles 65C02 opcodes)
167
169
  -o | --output FILENAME specify name to save extracted file as
170
+ -r | --raw don't convert basic files to ASCII
168
171
  -x | --explode extract all files
169
172
  -v | --version show version number
173
+
174
+ Currently only works with DOS 3.3 format DSK images
175
+ Will uncompress gzipped files (with extension .gz)
176
+ input files can be URLs
170
177
  </pre>
171
178
  <p>
172
- Currently only works with DOS 3.3 format <a
173
- href="../../classes/DSK.html">DSK</a> images can be
174
- </p>
175
- <p>
176
179
  examples:
177
180
  </p>
178
181
  <pre>
179
182
  dsktool.rb -c DOS3MASTR.dsk.gz
180
183
  dsktool.rb -l FID DOS3MASTR.dsk
181
- dsktool.rb --list fid -o fid.asm DOS3MASTR.dsk
184
+ dsktool.rb --list fid -o fid.lst DOS3MASTR.dsk
182
185
  dsktool.rb --extract &quot;COLOR DEMOSOFT&quot; DOS3MASTR.dsk
183
186
  dsktool.rb -e HELLO -o HELLO.bas DOS3MASTR.dsk
184
187
  dsktool.rb -x DOS3MASTR.dsk.gz
188
+ dsktool.rb -c http://jamtronix.com/dsks/apshai.dsk.gz
185
189
  </pre>
186
190
  </td>
187
191
  </tr>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sat Jun 16 13:07:38 AUS Eastern Standard Time 2007</td>
59
+ <td>Sun Jun 17 10:42:36 AUS Eastern Standard Time 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -79,7 +79,7 @@
79
79
  <h3 class="section-bar">Required files</h3>
80
80
 
81
81
  <div class="name-list">
82
- YAML&nbsp;&nbsp;
82
+ yaml&nbsp;&nbsp;
83
83
  </div>
84
84
  </div>
85
85
 
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sat Jun 16 20:21:05 AUS Eastern Standard Time 2007</td>
59
+ <td>Sun Jun 17 01:20:08 AUS Eastern Standard Time 2007</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
data/lib/D65.rb CHANGED
@@ -91,7 +91,7 @@ OPCODE_SIZE={
91
91
  }
92
92
 
93
93
  end
94
- require 'YAML' unless defined? YAML
94
+ require 'yaml' unless defined? YAML
95
95
  @@annotations=YAML::load(File.open(File.dirname(__FILE__)+"/a2_symbols.yaml"))
96
96
 
97
97
  #map of memory locations and annotations
data/lib/DOSFile.rb CHANGED
@@ -311,14 +311,20 @@ private
311
311
  index+=2 #skip over the "next address" field
312
312
  line_no=buffer[index]+buffer[index+1]*256
313
313
  index+=2 #skip over the "line number" field
314
- s+=sprintf("%u ",line_no)
314
+ s+=sprintf("%u",line_no)
315
315
  done_line=false
316
- while (!done_line)
316
+ last_char_space=false
317
+ while (!done_line)
317
318
  b=buffer[index]
318
319
  if b>=0x80 then
320
+ if !last_char_space then
321
+ s+=" "
322
+ end
319
323
  s+=APPLESOFT_TOKENS[b-0x80]+" "
324
+ last_char_space=true
320
325
  else
321
326
  s+=b.chr
327
+ last_char_space=false
322
328
  end
323
329
  index+=1
324
330
  done_line=(index>=length)||(buffer[index]==0)
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: dsktool
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.3
7
- date: 2007-06-16 00:00:00 +10:00
6
+ version: 0.1.4
7
+ date: 2007-06-17 00:00:00 +10:00
8
8
  summary: a command line tool + libraries for manipulating DSK format images as used by Apple 2 emulators
9
9
  require_paths:
10
10
  - lib
@@ -199,7 +199,6 @@ files:
199
199
  - doc/files/test/test_dos_disks_rb.html
200
200
  - doc/files/test/ts_test_all_rb.html
201
201
  - lib/a2_symbols.yaml
202
- - lib/CHANGES.txt
203
202
  - lib/D65.rb
204
203
  - lib/DOSDisk.rb
205
204
  - lib/DOSFile.rb
data/lib/CHANGES.txt DELETED
@@ -1,5 +0,0 @@
1
- V0.1.3
2
-
3
- 2007-07-16 Added support for gzipped files (assumes .gz extension)
4
- 2007-07-16 Added support for S-C Assembler files
5
- 2007-07-16 Added support for opening URIs