1.1 --- a/ula.py Mon Jun 20 23:17:48 2016 +0200
1.2 +++ b/ula.py Mon Jun 20 23:40:11 2016 +0200
1.3 @@ -270,7 +270,7 @@
1.4
1.5 "Signal the start of a frame."
1.6
1.7 - self.line_start = self.address = self.screen_start
1.8 + self.line_start = self.pixel_address = self.screen_start
1.9 self.line = self.line_start % LINES_PER_ROW
1.10 self.y = 0
1.11 self.x = 0
1.12 @@ -279,7 +279,7 @@
1.13
1.14 "Visit the next horizontal position."
1.15
1.16 - self.address += LINES_PER_ROW
1.17 + self.pixel_address += LINES_PER_ROW
1.18 self.wrap_address()
1.19
1.20 def next_vertical(self):
1.21 @@ -299,13 +299,13 @@
1.22 # After the end of the last line in a row, the address should already
1.23 # have been positioned on the last line of the next column.
1.24
1.25 - self.address -= LINES_PER_ROW - 1
1.26 + self.pixel_address -= LINES_PER_ROW - 1
1.27 self.wrap_address()
1.28 self.line = 0
1.29
1.30 # Record the position of the start of the pixel row.
1.31
1.32 - self.line_start = self.address
1.33 + self.line_start = self.pixel_address
1.34
1.35 # Before any spacing between character rows...
1.36
1.37 @@ -314,12 +314,12 @@
1.38 # If not on a row boundary, move to the next line. Here, the address
1.39 # needs bringing back to the previous character row.
1.40
1.41 - self.address = self.line_start + 1
1.42 + self.pixel_address = self.line_start + 1
1.43 self.wrap_address()
1.44
1.45 # Record the position of the start of the pixel row.
1.46
1.47 - self.line_start = self.address
1.48 + self.line_start = self.pixel_address
1.49
1.50 def in_line(self): return self.line < LINES_PER_ROW
1.51 def in_frame(self): return MIN_PIXELLINE <= self.y < (MIN_PIXELLINE + self.display_height)
1.52 @@ -383,7 +383,7 @@
1.53 # Either assert a required address or propagate the CPU address.
1.54
1.55 if access_ram:
1.56 - self.init_row_address(self.address)
1.57 + self.init_row_address(self.pixel_address)
1.58 else:
1.59 self.init_row_address(self.cpu_address)
1.60
1.61 @@ -398,7 +398,7 @@
1.62 # Either assert a required address or propagate the CPU address.
1.63
1.64 if access_ram:
1.65 - self.init_column_address(self.address, 0)
1.66 + self.init_column_address(self.pixel_address, 0)
1.67 else:
1.68 self.init_column_address(self.cpu_address, 0)
1.69
1.70 @@ -436,7 +436,7 @@
1.71 # Either assert a required address or propagate the CPU address.
1.72
1.73 if access_ram:
1.74 - self.init_column_address(self.address, 1)
1.75 + self.init_column_address(self.pixel_address, 1)
1.76 else:
1.77 self.init_column_address(self.cpu_address, 1)
1.78
1.79 @@ -532,8 +532,8 @@
1.80 self.pcycle = rotate(self.pcycle, self.depth, zero=True)
1.81
1.82 def wrap_address(self):
1.83 - if self.address >= SCREEN_LIMIT:
1.84 - self.address -= self.screen_size
1.85 + if self.pixel_address >= SCREEN_LIMIT:
1.86 + self.pixel_address -= self.screen_size
1.87
1.88 def init_row_address(self, address):
1.89 self.ram_address = (address & 0xff80) >> 7