vbe0201 / 3DS.py

Python on your Nintendo 3DS
Apache License 2.0
134 stars 7 forks source link

Is the 3DS hardware accessible from this? #11

Open cr8ivecodesmith opened 4 years ago

cr8ivecodesmith commented 4 years ago

Like capturing input from the buttons, drawing graphics, access to storage, etc?

vbe0201 commented 3 years ago

Yes and no. It is a planned feature to extend the Python standard library that ships with 3DS.py releases by a ctru module which wraps the libctru APIs into a more idiomatic, higher-level Python API. This will allow you to do all the things you're looking for. It is designed to build upon a C module called _ctru which provides lower-level abstractions with a similar goal

However, that part of the project is currently in a very early state where only a barebones _ctru module is fleshed out. https://github.com/vbe0201/3DS.py/blob/master/python_patches/_ctru/_ctrumodule.c#L471 is a list of functions that are currently functional within Python.

If you don't consider it a problem to eventually have to read the code of the _ctru module and the libctru docs, you could always use that as well:

import _ctru

# Bitmasks of all the keys.
A = 1 << 0
B = 1 << 1

while True:
    input = _ctru.hid_keys_down()
    if input & A == A:
        print("A pressed!")