Skip to content

Commit

Permalink
Correct rtc_lock_experimental docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed May 27, 2024
1 parent c34fc2e commit 6519a40
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
23 changes: 13 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1324,8 +1324,9 @@ <h2 id="kwargs">Kwargs</h2>
an AI in games that use it to change behavior (i.e. day and night).

The first time the game is turned on, an `.rtc` file is created with the current time. This is the epoch for the
RTC. When using `rtc_lock_experimental`, the RTC will always report this point in time. If you let the game progress first,
before using `rtc_lock_experimental`, the internal clock will move backwards and might corrupt the game.
RTC. When using `rtc_lock_experimental`, the RTC will always report this point in time. If you let the game
progress first, before using `rtc_lock_experimental`, the internal clock will move backwards and might corrupt
the game.

Example:
```python
Expand All @@ -1336,7 +1337,7 @@ <h2 id="kwargs">Kwargs</h2>
**WARN: This is an experimental API and is subject to change.**

Args:
enable (float): Point in time to lock RTC to
enable (bool): True to lock RTC, False to operate normally
&#34;&#34;&#34;
if self.mb.cartridge.rtc_enabled:
self.mb.cartridge.rtc.timelock = enable
Expand Down Expand Up @@ -2774,17 +2775,18 @@ <h2 id="returns">Returns</h2>
<p>Lock the Real Time Clock (RTC) of a supporting cartridge. It might be advantageous to lock the RTC when training
an AI in games that use it to change behavior (i.e. day and night).</p>
<p>The first time the game is turned on, an <code>.rtc</code> file is created with the current time. This is the epoch for the
RTC. When using <code>rtc_lock_experimental</code>, the RTC will always report this point in time. If you let the game progress first,
before using <code>rtc_lock_experimental</code>, the internal clock will move backwards and might corrupt the game.</p>
RTC. When using <code>rtc_lock_experimental</code>, the RTC will always report this point in time. If you let the game
progress first, before using <code>rtc_lock_experimental</code>, the internal clock will move backwards and might corrupt
the game.</p>
<p>Example:</p>
<pre><code class="language-python">&gt;&gt;&gt; pyboy = PyBoy('game_rom.gb')
&gt;&gt;&gt; pyboy.rtc_lock_experimental(True) # RTC will not progress
</code></pre>
<p><strong>WARN: This is an experimental API and is subject to change.</strong></p>
<h2 id="args">Args</h2>
<dl>
<dt><strong><code>enable</code></strong> :&ensp;<code>float</code></dt>
<dd>Point in time to lock RTC to</dd>
<dt><strong><code>enable</code></strong> :&ensp;<code>bool</code></dt>
<dd>True to lock RTC, False to operate normally</dd>
</dl></section>
<details class="source">
<summary>
Expand All @@ -2798,8 +2800,9 @@ <h2 id="args">Args</h2>
an AI in games that use it to change behavior (i.e. day and night).

The first time the game is turned on, an `.rtc` file is created with the current time. This is the epoch for the
RTC. When using `rtc_lock_experimental`, the RTC will always report this point in time. If you let the game progress first,
before using `rtc_lock_experimental`, the internal clock will move backwards and might corrupt the game.
RTC. When using `rtc_lock_experimental`, the RTC will always report this point in time. If you let the game
progress first, before using `rtc_lock_experimental`, the internal clock will move backwards and might corrupt
the game.

Example:
```python
Expand All @@ -2810,7 +2813,7 @@ <h2 id="args">Args</h2>
**WARN: This is an experimental API and is subject to change.**

Args:
enable (float): Point in time to lock RTC to
enable (bool): True to lock RTC, False to operate normally
&#34;&#34;&#34;
if self.mb.cartridge.rtc_enabled:
self.mb.cartridge.rtc.timelock = enable
Expand Down
7 changes: 4 additions & 3 deletions pyboy/pyboy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,9 @@ def rtc_lock_experimental(self, enable):
an AI in games that use it to change behavior (i.e. day and night).
The first time the game is turned on, an `.rtc` file is created with the current time. This is the epoch for the
RTC. When using `rtc_lock_experimental`, the RTC will always report this point in time. If you let the game progress first,
before using `rtc_lock_experimental`, the internal clock will move backwards and might corrupt the game.
RTC. When using `rtc_lock_experimental`, the RTC will always report this point in time. If you let the game
progress first, before using `rtc_lock_experimental`, the internal clock will move backwards and might corrupt
the game.
Example:
```python
Expand All @@ -1265,7 +1266,7 @@ def rtc_lock_experimental(self, enable):
**WARN: This is an experimental API and is subject to change.**
Args:
enable (float): Point in time to lock RTC to
enable (bool): True to lock RTC, False to operate normally
"""
if self.mb.cartridge.rtc_enabled:
self.mb.cartridge.rtc.timelock = enable
Expand Down

0 comments on commit 6519a40

Please sign in to comment.