diff --git a/docs/index.html b/docs/index.html index 5870ae750..e772a6ee7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1314,7 +1314,34 @@
+def rtc_lock_experimental(self, enable)
+
WARN: This is an experimental API and is subject to change.
+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).
+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.
Example:
+>>> pyboy = PyBoy('game_rom.gb')
+>>> pyboy.rtc_lock_experimental(True) # RTC will not progress
+
+WARN: This is an experimental API and is subject to change.
+enable
: float
def rtc_lock_experimental(self, enable):
+ """
+ **WARN: This is an experimental API and is subject to change.**
+
+ 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).
+
+ 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.
+
+ Example:
+ ```python
+ >>> pyboy = PyBoy('game_rom.gb')
+ >>> pyboy.rtc_lock_experimental(True) # RTC will not progress
+ ```
+
+ **WARN: This is an experimental API and is subject to change.**
+
+ Args:
+ enable (float): Point in time to lock RTC to
+ """
+ if self.mb.cartridge.rtc_enabled:
+ self.mb.cartridge.rtc.timelock = enable
+ else:
+ raise Exception("There's no RTC for this cartridge type")
+
@@ -3251,6 +3330,7 @@ PyBoy
get_sprite
get_sprite_by_tile_identifier
get_tile
+rtc_lock_experimental
screen
memory
memory_scanner