Class: Badline::ROM

Inherits:
Memory show all
Defined in:
lib/badline/rom.rb

Instance Attribute Summary

Attributes included from Addressable

#end, #length, #start

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Memory

#initialize, #peek, #read, #write

Methods included from Addressable

#[], #addressable_at, #in_range?, #peek, #peek16, #poke16, #range

Methods included from IntegerHelper

#bcd, #bcd_to_i, #format16, #format8, #high_byte, #low_byte, #signed_int8, #uint16

Constructor Details

This class inherits a constructor from Badline::Memory

Class Method Details

.load(filename, start = 0x0) ⇒ Object



6
7
8
9
# File 'lib/badline/rom.rb', line 6

def load(filename, start = 0x0)
  data = File.read(file_path(filename)).bytes
  new(data, length: data.length, start: start)
end

Instance Method Details

#poke(_addr, _value) ⇒ Object Also known as: []=



18
19
20
# File 'lib/badline/rom.rb', line 18

def poke(_addr, _value)
  raise ReadOnlyMemoryError
end