Class: Zemu::Config::ROM

Inherits:
Memory show all
Defined in:
lib/zemu/config.rb

Overview

Read-Only Memory object

Represents a block of memory which is read-only.

Instance Method Summary collapse

Methods inherited from Memory

#contents, #from_binary, #mem_read, #memory, #params

Methods inherited from BusDevice

#clock, #functions, #interrupt, #interrupt?, #io_read, #io_write, #mem_read, #memory, #nmi, #nmi?, #params, #when_setup

Methods inherited from Zemu::ConfigObject

#method_missing

Constructor Details

#initializeROM

Constructor.

Takes a block in which the parameters of the memory block can be initialized.

All parameters can be set within this block. They become readonly as soon as the block completes.

Examples:


Zemu::Config::ROM.new do
    address 0x8000
    size 256
end

316
317
318
# File 'lib/zemu/config.rb', line 316

def initialize
    super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zemu::ConfigObject

Instance Method Details

#mem_write(addr, port) ⇒ Object

Memory write handler.


326
327
328
# File 'lib/zemu/config.rb', line 326

def mem_write(addr, port)
    # Does nothing - cannot write to read-only memory.
end

#readonly?Boolean

Is this memory block readonly?

Returns:

  • (Boolean)

321
322
323
# File 'lib/zemu/config.rb', line 321

def readonly?
    true
end