Class: Badline::VIC::DisplayState
- Inherits:
-
Object
- Object
- Badline::VIC::DisplayState
- Defined in:
- lib/badline/vic/display_state.rb
Constant Summary collapse
- FIRST_LINE =
48: bad lines and the DEN-at-$30 latch begin here
0x30- LAST_LINE =
247
0xf7- COLUMNS_PER_ROW =
40
Instance Attribute Summary collapse
-
#rc ⇒ Object
readonly
Returns the value of attribute rc.
-
#vc_base ⇒ Object
readonly
Returns the value of attribute vc_base.
Instance Method Summary collapse
- #bad_line? ⇒ Boolean
- #cycle(rasterline, column) ⇒ Object
- #display? ⇒ Boolean
- #idle? ⇒ Boolean
-
#initialize(registers) ⇒ DisplayState
constructor
A new instance of DisplayState.
- #new_frame ⇒ Object
- #new_line ⇒ Object
Constructor Details
#initialize(registers) ⇒ DisplayState
Returns a new instance of DisplayState.
12 13 14 15 16 17 18 19 |
# File 'lib/badline/vic/display_state.rb', line 12 def initialize(registers) @registers = registers @vc_base = 0 @rc = 0 @display = false @bad_lines_enabled = false @bad_line = false end |
Instance Attribute Details
#rc ⇒ Object (readonly)
Returns the value of attribute rc.
10 11 12 |
# File 'lib/badline/vic/display_state.rb', line 10 def rc @rc end |
#vc_base ⇒ Object (readonly)
Returns the value of attribute vc_base.
10 11 12 |
# File 'lib/badline/vic/display_state.rb', line 10 def vc_base @vc_base end |
Instance Method Details
#bad_line? ⇒ Boolean
23 |
# File 'lib/badline/vic/display_state.rb', line 23 def bad_line? = @bad_line |
#cycle(rasterline, column) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/badline/vic/display_state.rb', line 34 def cycle(rasterline, column) @bad_lines_enabled = true if rasterline == FIRST_LINE && @registers.display_enabled? load_vc(rasterline) if column == 14 trigger_bad_line(rasterline) if column.between?(12, 54) check_row_counter if column == 58 end |
#display? ⇒ Boolean
21 |
# File 'lib/badline/vic/display_state.rb', line 21 def display? = @display |
#idle? ⇒ Boolean
22 |
# File 'lib/badline/vic/display_state.rb', line 22 def idle? = !@display |
#new_frame ⇒ Object
25 26 27 28 |
# File 'lib/badline/vic/display_state.rb', line 25 def new_frame @vc_base = 0 @bad_lines_enabled = false end |
#new_line ⇒ Object
30 31 32 |
# File 'lib/badline/vic/display_state.rb', line 30 def new_line @bad_line = false end |