mirror of
https://github.com/safiire/n65.git
synced 2024-12-12 15:29:12 +00:00
A few little updates, comment cleanup, removal of commented code
This commit is contained in:
parent
1013280f9e
commit
d6a9f7ac7d
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user