Class: Amaterasu::GameBoy::Ppu::Modes::Disabled
- Inherits:
-
Object
- Object
- Amaterasu::GameBoy::Ppu::Modes::Disabled
- Defined in:
- lib/amaterasu/game_boy/ppu/modes/disabled.rb
Overview
Defines the behavior of the PPU when LCD Control Bit 7 is 0.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(ppu) ⇒ Disabled
constructor
A new instance of Disabled.
- #tick ⇒ Object
Constructor Details
#initialize(ppu) ⇒ Disabled
Returns a new instance of Disabled.
11 12 13 14 15 16 17 |
# File 'lib/amaterasu/game_boy/ppu/modes/disabled.rb', line 11 def initialize(ppu) @ppu = ppu @lcd_control = @ppu.registers.lcdc @name = 'DISABLED' @number = 0 end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/amaterasu/game_boy/ppu/modes/disabled.rb', line 9 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
9 10 11 |
# File 'lib/amaterasu/game_boy/ppu/modes/disabled.rb', line 9 def number @number end |
Instance Method Details
#tick ⇒ Object
19 20 21 22 23 24 |
# File 'lib/amaterasu/game_boy/ppu/modes/disabled.rb', line 19 def tick return unless @lcd_control.lcd_enabled? @ppu.reset_states @ppu.set_mode(:oam_scan) end |