Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed Jul 13, 2024
1 parent 316d065 commit 991fbde
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
24 changes: 12 additions & 12 deletions docs/api/screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ <h1 class="title">Module <code>pyboy.api.screen</code></h1>
list:
Nested list of SCX, SCY, WX and WY for each scanline (144x4). Returns (0, 0, 0, 0) when LCD is off.
&#34;&#34;&#34;
# self.tilemap_position_list = np.asarray(self.mb.lcd.renderer._scanlineparameters, dtype=np.uint8).reshape(144, 5)[:, :4]
# self.tilemap_position_list = self.mb.lcd.renderer._scanlineparameters
# self.tilemap_position_list = np.asarray(self.mb.lcd._scanlineparameters, dtype=np.uint8).reshape(144, 5)[:, :4]
# self.tilemap_position_list = self.mb.lcd._scanlineparameters

# # return self.mb.lcd.renderer._scanlineparameters
# # return self.mb.lcd._scanlineparameters
if self.mb.lcd._LCDC.lcd_enable:
return [[line[0], line[1], line[2], line[3]] for line in self.mb.lcd.renderer._scanlineparameters]
return [[line[0], line[1], line[2], line[3]] for line in self.mb.lcd._scanlineparameters]
else:
return [[0, 0, 0, 0] for line in range(144)]

Expand Down Expand Up @@ -467,12 +467,12 @@ <h2 class="section-title" id="header-classes">Classes</h2>
list:
Nested list of SCX, SCY, WX and WY for each scanline (144x4). Returns (0, 0, 0, 0) when LCD is off.
&#34;&#34;&#34;
# self.tilemap_position_list = np.asarray(self.mb.lcd.renderer._scanlineparameters, dtype=np.uint8).reshape(144, 5)[:, :4]
# self.tilemap_position_list = self.mb.lcd.renderer._scanlineparameters
# self.tilemap_position_list = np.asarray(self.mb.lcd._scanlineparameters, dtype=np.uint8).reshape(144, 5)[:, :4]
# self.tilemap_position_list = self.mb.lcd._scanlineparameters

# # return self.mb.lcd.renderer._scanlineparameters
# # return self.mb.lcd._scanlineparameters
if self.mb.lcd._LCDC.lcd_enable:
return [[line[0], line[1], line[2], line[3]] for line in self.mb.lcd.renderer._scanlineparameters]
return [[line[0], line[1], line[2], line[3]] for line in self.mb.lcd._scanlineparameters]
else:
return [[0, 0, 0, 0] for line in range(144)]

Expand Down Expand Up @@ -569,12 +569,12 @@ <h2 id="returns">Returns</h2>
list:
Nested list of SCX, SCY, WX and WY for each scanline (144x4). Returns (0, 0, 0, 0) when LCD is off.
&#34;&#34;&#34;
# self.tilemap_position_list = np.asarray(self.mb.lcd.renderer._scanlineparameters, dtype=np.uint8).reshape(144, 5)[:, :4]
# self.tilemap_position_list = self.mb.lcd.renderer._scanlineparameters
# self.tilemap_position_list = np.asarray(self.mb.lcd._scanlineparameters, dtype=np.uint8).reshape(144, 5)[:, :4]
# self.tilemap_position_list = self.mb.lcd._scanlineparameters

# # return self.mb.lcd.renderer._scanlineparameters
# # return self.mb.lcd._scanlineparameters
if self.mb.lcd._LCDC.lcd_enable:
return [[line[0], line[1], line[2], line[3]] for line in self.mb.lcd.renderer._scanlineparameters]
return [[line[0], line[1], line[2], line[3]] for line in self.mb.lcd._scanlineparameters]
else:
return [[0, 0, 0, 0] for line in range(144)]</code></pre>
</details>
Expand Down
8 changes: 4 additions & 4 deletions docs/api/tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ <h1 class="title">Module <code>pyboy.api.tile</code></h1>
byte1 = self.mb.lcd.VRAM1[self.data_address + k - VRAM_OFFSET]
byte2 = self.mb.lcd.VRAM1[self.data_address + k + 1 - VRAM_OFFSET]

colorcode = self.mb.lcd.renderer.colorcode(byte1, byte2)
for x in range(8):
colorcode = utils.color_code(byte1, byte2, 7 - x)
self.data[k // 2][x] = self.mb.lcd.BGP.getcolor(colorcode)
self.data[k // 2][x] = self.mb.lcd.BGP.getcolor((colorcode &gt;&gt; x * 8) &amp; 0xFF)
return self.data

def __eq__(self, other):
Expand Down Expand Up @@ -419,9 +419,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
byte1 = self.mb.lcd.VRAM1[self.data_address + k - VRAM_OFFSET]
byte2 = self.mb.lcd.VRAM1[self.data_address + k + 1 - VRAM_OFFSET]

colorcode = self.mb.lcd.renderer.colorcode(byte1, byte2)
for x in range(8):
colorcode = utils.color_code(byte1, byte2, 7 - x)
self.data[k // 2][x] = self.mb.lcd.BGP.getcolor(colorcode)
self.data[k // 2][x] = self.mb.lcd.BGP.getcolor((colorcode &gt;&gt; x * 8) &amp; 0xFF)
return self.data

def __eq__(self, other):
Expand Down
7 changes: 2 additions & 5 deletions docs/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1 class="title">Module <code>pyboy.utils</code></h1>

__all__ = [&#34;WindowEvent&#34;, &#34;dec_to_bcd&#34;, &#34;bcd_to_dec&#34;]

STATE_VERSION = 10
STATE_VERSION = 11

##############################################################
# Buffer classes
Expand Down Expand Up @@ -143,10 +143,7 @@ <h1 class="title">Module <code>pyboy.utils</code></h1>
# Misc


# TODO: Would a lookup-table increase performance? For example a lookup table of each 4-bit nibble?
# That&#39;s 16**2 = 256 values. Index calculated as: (byte1 &amp; 0xF0) | ((byte2 &amp; 0xF0) &gt;&gt; 4)
# and then: (byte1 &amp; 0x0F) | ((byte2 &amp; 0x0F) &gt;&gt; 4)
# Then could even be preloaded for each color palette
# NOTE: Legacy function. Use look-up table in Renderer
def color_code(byte1, byte2, offset):
&#34;&#34;&#34;Convert 2 bytes into color code at a given offset.

Expand Down

0 comments on commit 991fbde

Please sign in to comment.