diff --git a/lib/n65.rb b/lib/n65.rb index 188257e..8c1181c 100644 --- a/lib/n65.rb +++ b/lib/n65.rb @@ -50,7 +50,7 @@ module N65 #end #puts "Done." - ## For right now, let's just emit the first prog bank + ## Emit the complete binary ROM File.open(outfile, 'w') do |fp| fp.write(assembler.emit_binary_rom) end diff --git a/lib/n65/directives/ascii.rb b/lib/n65/directives/ascii.rb index d65228e..a4f1019 100644 --- a/lib/n65/directives/ascii.rb +++ b/lib/n65/directives/ascii.rb @@ -9,7 +9,7 @@ module N65 #### - ## Try to parse an incbin directive + ## Try to parse a .ascii directive def self.parse(line) match_data = line.match(/^\.ascii\s+"([^"]+)"$/) return nil if match_data.nil? @@ -18,7 +18,7 @@ module N65 #### - ## Initialize with filename + ## Initialize with a string def initialize(string) @string = string end diff --git a/lib/n65/front_end.rb b/lib/n65/front_end.rb index 3f5199f..40aa28d 100644 --- a/lib/n65/front_end.rb +++ b/lib/n65/front_end.rb @@ -54,16 +54,7 @@ module N65 exit(1) end - #begin - N65::Assembler.from_file(input_file, @options[:output_file]) - #rescue StandardError => error - #STDERR.puts("Assemble Failed!") - #STDERR.puts(error.class) - #if error.message - #STDERR.puts(error.message) - #end - #exit(1) - #end + N65::Assembler.from_file(input_file, @options[:output_file]) end private diff --git a/lib/n65/symbol_table.rb b/lib/n65/symbol_table.rb index b8afb7b..95e1369 100644 --- a/lib/n65/symbol_table.rb +++ b/lib/n65/symbol_table.rb @@ -55,41 +55,6 @@ module N65 end -=begin - #### - ## Resolve symbol to a value, for example: - ## scope1.scope2.variable - ## It is not nessessary to specify the root scope :global - ## You can just address anything by name in the current scope - ## To go backwards in scope you need to write the full path - ## like global.sprite.x or whatever - def resolve_symbol_old(name) - - value = if name.include?('.') - path_ary = name.split('.').map(&:to_sym) - symbol = path_ary.pop - path_ary.shift if path_ary.first == :global - scope = retreive_scope(path_ary) - ## We also try to look up the address associated with the scope - root = "-#{symbol}".to_sym - v = scope[symbol] - v.kind_of?(Hash) ? v[root] : v - else - root = "-#{name}".to_sym - scope = current_scope - ## We also try to look up the address associated with the scope - v = scope[name.to_sym] || scope[root] - v.kind_of?(Hash) ? v[root] : v - end - - if value.nil? - fail(UndefinedSymbol, name) - end - value - end -=end - - #### ## def resolve_symbol(name)