nametable serves to bridge the gap between
Nintendo Entertainment System's
Picture Processing Unit's
nametables and Python.
Its main goal is to create an Object Oriented approach to represent a nametable on the NES.
It provides the ability to create instances of Pattern and Block directly from memory and inserts them into PatternTable and Nametable, respectively.
>>> import nametable
>>> pattern = nametable.PatternMeta(bytes.fromhex("41 C2 44 48 10 20 40 80 01 02 04 08 16 21 42 87"))
>>> pattern.numpy_array
array(
[
[0, 1, 0, 0, 0, 0, 0, 3],
[1, 1, 0, 0, 0, 0, 3, 0],
[0, 1, 0, 0, 0, 3, 0, 0],
[0, 1, 0, 0, 3, 0, 0, 0],
[0, 0, 0, 3, 0, 2, 2, 0],
[0, 0, 3, 0, 0, 0, 0, 2],
[0, 3, 0, 0, 0, 0, 2, 0],
[3, 0, 0, 0, 0, 2, 2, 2],
],
dtype=ubyte,
)
>>> pattern_table = nametable.PatternTable((nametable.Pattern(pattern),))
>>> block = nametable.Block(pattern_table, (0, 0, 0, 0))
>>> block.numpy_array
array(
[
[0, 1, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 3],
[1, 1, 0, 0, 0, 0, 3, 0, 1, 1, 0, 0, 0, 0, 3, 0],
[0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0],
[0, 1, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, 0],
[0, 0, 0, 3, 0, 2, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0],
[0, 0, 3, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0, 0, 2],
[0, 3, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0, 0, 2, 0],
[3, 0, 0, 0, 0, 2, 2, 2, 3, 0, 0, 0, 0, 2, 2, 2],
[0, 1, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 3],
[1, 1, 0, 0, 0, 0, 3, 0, 1, 1, 0, 0, 0, 0, 3, 0],
[0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0],
[0, 1, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, 0],
[0, 0, 0, 3, 0, 2, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0],
[0, 0, 3, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0, 0, 2],
[0, 3, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0, 0, 2, 0],
[3, 0, 0, 0, 0, 2, 2, 2, 3, 0, 0, 0, 0, 2, 2, 2],
],
dtype=ubyte,
)
>>> nametable.Nametable((block,))
Nametable(Block(PatternTable((Pattern(PatternMeta(...)),)), (0, 0, 0, 0)),)
Getting Help
Please use the python-nametable tag on
StackOverflow to get help.
Aiding others and answers questions is a fantastic way to help!
Project Information
nametable is released under the
GPL3 license.
Its documentation is hosted on Github and the
repository is hosted on Github. The latest release
is hosted on PyPI.
Release files for nametable 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nametable-0.2.0.tar.gz | 24.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nametable-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.5 kB
Release files / nametable-0.2.0.tar.gz
| Download URL | nametable-0.2.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6ddf64f04835faccc4941d8f15e049cbd56fe23c9cc04da40d66ea5509ead54
|
|
BLAKE2b-256 checksum How to use checksums |
a809076021a2d5e8ea6483529bcbc164eadde4049d4620bad3a0bb9cd5aa1407
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.13
|
Release files / nametable-0.2.0-py3-none-any.whl
| Download URL | nametable-0.2.0-py3-none-any.whl |
|---|---|
| Size | 29.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa7712156c44b22adce0e37c72850f4cd486c10878f8dd112ff93ba2cc1c3d88
|
|
BLAKE2b-256 checksum How to use checksums |
c405dd2e28ddcb91758dcf84f9bdd4c7dc74efdae7e36c1703a96a5b05a08bbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.13
|