1.1 --- a/ula.py Sun Jun 19 16:18:57 2016 +0200
1.2 +++ b/ula.py Sun Jun 19 16:33:20 2016 +0200
1.3 @@ -227,7 +227,7 @@
1.4 self.cycle.shift()
1.5 self.cycle.set_input(0) # reset the input since only one state output will be active
1.6
1.7 - self.reset_vertical()
1.8 + self.next_frame()
1.9
1.10 def set_mode(self, mode):
1.11
1.12 @@ -285,7 +285,7 @@
1.13 self.hs = value
1.14 self.video.set_hs(value)
1.15
1.16 - def reset_vertical(self):
1.17 + def next_frame(self):
1.18
1.19 "Signal the start of a frame."
1.20
1.21 @@ -295,7 +295,14 @@
1.22 self.y = 0
1.23 self.x = 0
1.24
1.25 - def reset_horizontal(self):
1.26 + def next_horizontal(self):
1.27 +
1.28 + "Visit the next horizontal position."
1.29 +
1.30 + self.address += LINES_PER_ROW
1.31 + self.wrap_address()
1.32 +
1.33 + def next_vertical(self):
1.34
1.35 "Reset horizontal state within the active region of the frame."
1.36
1.37 @@ -352,12 +359,12 @@
1.38 # Detect the end of the scanline.
1.39
1.40 if self.x == MAX_SCANPOS:
1.41 - self.reset_horizontal()
1.42 + self.next_vertical()
1.43
1.44 # Detect the end of the frame.
1.45
1.46 if self.y == MAX_SCANLINE:
1.47 - self.reset_vertical()
1.48 + self.next_frame()
1.49
1.50
1.51
1.52 @@ -455,8 +462,7 @@
1.53 # Advance to the next column even if an NMI is asserted.
1.54
1.55 if would_access_ram:
1.56 - self.address += LINES_PER_ROW
1.57 - self.wrap_address()
1.58 + self.next_horizontal()
1.59
1.60 # Reset addresses.
1.61