Skip to content

Commit

Permalink
added to docs, still deciding on style
Browse files Browse the repository at this point in the history
  • Loading branch information
29th-Day committed Dec 29, 2023
1 parent e093368 commit 0d14bba
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .vscode/retropy.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"cSpell.words": [
"frontends",
"libretro",
"retropy"
"retropy",
"Savestate"
]
}
}
5 changes: 4 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Installation

Supported python versions: ...
Supported OS: ...

## pip

```
Expand Down Expand Up @@ -27,4 +30,4 @@ The current development version can be download via
git clone https://github.com/29th-Day/retropy.git
```

[^1]: `ModuleNotFoundError` will be raised if unavailable feature is called
[^1]: `FeatureNotAvailable` will be raised if unavailable feature is called
4 changes: 2 additions & 2 deletions docs/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Tutorials

This section is intendet to get the user going with retropy.
This section is intended to get the user going with retropy.

Throughout this section, the two variables are assumned to be present and valid.
Throughout this section, the two variables are assumed to be present and valid.

``` py
dll_path = "path/to/core.*" # path to libretro core
Expand Down
12 changes: 7 additions & 5 deletions src/retropy/core/retro.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@


class RetroPy:
"""Python(ic) frontend for libretro"""
"""
Python(ic) frontend for libretro
Attributes:
pixel_format (PixelFormat): Pixel format
memory (RAM): memory
"""

pixel_format: PixelFormat
core_variables: dict[bytes, dict[str, bytes | Sequence[bytes]]] = {}
Expand Down Expand Up @@ -208,10 +214,6 @@ def __init__(self, path: str, numpy: bool = True) -> None:
EnvironmentCommand.GET_DEVICE_POWER: self.env_GET_DEVICE_POWER,
EnvironmentCommand.SET_NETPACKET_INTERFACE: self.env_SET_NETPACKET_INTERFACE,
}
"""Handles all libretro environment commands.
Can be overwritten or expanded to modify behaviour.
"""

# Create callback objects (and keep them in scope)
self.__cb_env = cb.environment_t(self.environment)
Expand Down
10 changes: 8 additions & 2 deletions src/retropy/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class GameCannotBeLoaded(RuntimeError):
pass


class UnkownEnvironmentCommand(RuntimeError):
"""Envrionment command used by core is not recognized."""
class UnknownEnvironmentCommand(RuntimeError):
"""Environment command used by core is not recognized."""

pass

Expand All @@ -39,3 +39,9 @@ class SavestateError(RuntimeError):
"""Savestate could not be handled."""

pass


class FeatureNotAvailable(ModuleNotFoundError):
"""A requested feature is not currently available."""

pass
2 changes: 0 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def pygame():
core.cheats["9 Lives"] = b"AATOZE"
core.cheats.pop("9 Lives")

# core.cheats["9 Lives"].enabled = False

core.run()


Expand Down

0 comments on commit 0d14bba

Please sign in to comment.