Class: Badline::Cartridge::MagicDesk

Inherits:
Badline::Cartridge show all
Defined in:
lib/badline/cartridge/magic_desk.rb

Constant Summary

Constants inherited from Badline::Cartridge

BANK_SIZE, HARDWARE_TYPES, ROMH_START, ROML_START, ULTIMAX_ROMH_START

Instance Attribute Summary

Attributes inherited from Badline::Cartridge

#exrom, #game, #name, #romh, #roml

Instance Method Summary collapse

Methods inherited from Badline::Cartridge

from_crt, from_file, #initialize, #on_change, #peek, #ultimax?

Constructor Details

This class inherits a constructor from Badline::Cartridge

Instance Method Details

#poke(addr, value) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/badline/cartridge/magic_desk.rb', line 6

def poke(addr, value)
  return if addr > 0xdeff

  @exrom = value.anybits?(0x80) ? 1 : 0
  @roml = @banks[(value & 0x3f) % @banks.length]
  changed!
end