# HG changeset patch # User Paul Boddie # Date 1466346800 -7200 # Node ID 1f4007ddc332fb0a5770c598a13648a6b921f80b # Parent 5cd431fd023356f68cc319c1077aab24bd46c9e3 Renamed reset methods and tidied slightly. diff -r 5cd431fd0233 -r 1f4007ddc332 ula.py --- a/ula.py Sun Jun 19 16:18:57 2016 +0200 +++ b/ula.py Sun Jun 19 16:33:20 2016 +0200 @@ -227,7 +227,7 @@ self.cycle.shift() self.cycle.set_input(0) # reset the input since only one state output will be active - self.reset_vertical() + self.next_frame() def set_mode(self, mode): @@ -285,7 +285,7 @@ self.hs = value self.video.set_hs(value) - def reset_vertical(self): + def next_frame(self): "Signal the start of a frame." @@ -295,7 +295,14 @@ self.y = 0 self.x = 0 - def reset_horizontal(self): + def next_horizontal(self): + + "Visit the next horizontal position." + + self.address += LINES_PER_ROW + self.wrap_address() + + def next_vertical(self): "Reset horizontal state within the active region of the frame." @@ -352,12 +359,12 @@ # Detect the end of the scanline. if self.x == MAX_SCANPOS: - self.reset_horizontal() + self.next_vertical() # Detect the end of the frame. if self.y == MAX_SCANLINE: - self.reset_vertical() + self.next_frame() @@ -455,8 +462,7 @@ # Advance to the next column even if an NMI is asserted. if would_access_ram: - self.address += LINES_PER_ROW - self.wrap_address() + self.next_horizontal() # Reset addresses.