Class: Badline::SID
Instance Attribute Summary
Attributes included from Addressable
Instance Method Summary collapse
-
#initialize ⇒ SID
constructor
A new instance of SID.
- #peek(addr) ⇒ Object
- #poke(addr, value) ⇒ Object
Methods included from Addressable
#[], #[]=, #addressable_at, #in_range?, #peek16, #poke16, #range
Methods included from IntegerHelper
#bcd, #bcd_to_i, #format16, #format8, #high_byte, #low_byte, #signed_int8, #uint16
Constructor Details
Instance Method Details
#peek(addr) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/badline/sid.rb', line 12 def peek(addr) i = index(addr) % (2**5) case i when 0x1d..0x1f then 0xff # Unused memory else @registers.peek(i) end end |
#poke(addr, value) ⇒ Object
20 21 22 23 |
# File 'lib/badline/sid.rb', line 20 def poke(addr, value) i = index(addr) % (2**5) @registers.poke(i, value) end |