CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/develersrl/dspython/master/README.old
accept-ranges: bytes
age: 0
date: Mon, 28 Jul 2025 03:53:52 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210094-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753674832.750420,VS0,VE1234
vary: Accept-Encoding
x-fastly-request-id: 13ec3c946d35b2355353e98088d9b04803a09835
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"a0d1ed751c2289b718852d169331f54e1014c0a2fef8a48ed7ceaeff7bbeeb73"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: 6B88:1E5C64:2A6CFC:71DF3B:6886F450
content-encoding: gzip
accept-ranges: bytes
date: Mon, 28 Jul 2025 03:53:53 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210030-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753674833.060692,VS0,VE293
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 19c396a30bed649e60574bddc250427a4c68c1a3
expires: Mon, 28 Jul 2025 03:58:53 GMT
source-age: 0
content-length: 2236
This is the source code and complete instructions for building Python 2.5 for
the Nintendo DS.
Author: Richard Tew.
Date: 28th January 2007
Email: richard.m.tew@gmail.com
Website: https://www.disinterest.org/NDS/Python25.html
Credits
-------
Python requires little work for it to run on other platforms. If standard
output is supported so that things like printf work and there is some
method of input so that Python code can be entered and executed then most
of the work is done. The rest is binding Python to the method of input
and also filesystem. Most of the work was done already and the process of
making this port involved linking that work together. These are the
people to thank for that work:
The cross-compiling environment devkitPro/devkitArm.
https://sourceforge.net/projects/devkitpro
Wntrmute
The patches to Python 2.5 so that it can be cross-compiled.
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1597850&group_id=5470
Han-Wen Nienhuys & Jan Nieuwenhuizen
The keyboard interface and console for the Nintendo DS.
https://headkaze.webpal.info/
Headspin.
The filesystem support for homebrew devices.
https://chishm.drunkencoders.com/gba_nds_fat/index.html
Chishm
Compiling
---------
1. Install the latest version of devkitPro. This should include:
[ https://sourceforge.net/projects/devkitpro ]
- devkitARM
- msys
- libnds
- libfat (not used at this time)
- dswifi (not used at this time)
The devkitpro installer should download and install these for you.
2. Go to the MinGW web site and download and install in this order:
[ https://mingw.sourceforge.net/download.shtml ]
- msysDTK
- MinGW
- msys-autoconf (at least version 2.59)
- msys-automake (at least version 1.8.2)
You may need to take some initiative getting msys and mingw
working. It didn't configure properly for me and I had to
copy 'msys/1.0' over 'msys/' in order to get automake and autoconf
into the path (the other folders in 'msys/1.0' are required to be
on the same level as the binaries so it is not possible to add
the 'bin' directories into the path). Then I had to install the
updated versions manually.
3. Compile the zlib static library.
a) cd NDSPython
cd zlib-1.2.3
make
This should build 'libz.a' then it will error when it tries to
link something else. But that is not important as the static
library is what we wanted.
4. Compile the Python static library.
You need to have Python installed and to know the path to it
in order to be able to cross-compile it. For me it is installed
in '/c/Program\ Files/Python25' so replace that with your path
to it.
If your python is installed in the same location as mine, and
all your settings are the same, then you should be able to use
the same prebuilt 'configure' and 'Makefile'.
a) cd ..
cd NDSPython
cd slp-250
export BASECFLAGS="-ffast-math -mthumb -mthumb-interwork -DARM9 -DNDS"
export CFLAGS="-ffast-math -mthumb -mthumb-interwork -DARM9 -DNDS"
export LDFLAGS="-specs=ds_arm9.specs -g -mthumb -mthumb-interwork"
export CC_FOR_BUILD=gcc
export PYTHON_FOR_BUILD=/c/Program\ Files/Python25/python
sh configure --host=arm-eabi --config-cache
b) make
This should build 'libpython2.5.a' then it will complain about not
finding 'getcwd' and error when linking something after that. But
that is not important as you have the static library and 'getcwd' is
provided by the NDSPython source code.
5. Compile the NDSPython rom.
a) Alter low level linker settings so that Python gets enough stack
on the Nintendo DS device to run. Edit this file:
devkitPro\devkitARM\arm-eabi\lib\ds_arm9.ld
Replace this altered section:
MEMORY {
/* original settings
rom : ORIGIN = 0x08000000, LENGTH = 32M
ewram : ORIGIN = 0x02000000, LENGTH = 4M - 4k
dtcm : ORIGIN = 0x0b000000, LENGTH = 16K
itcm : ORIGIN = 0x01000000, LENGTH = 32K
*/
rom : ORIGIN = 0x08000000, LENGTH = 32M
ewram : ORIGIN = 0x02000000, LENGTH = 4M - 260k
dtcm : ORIGIN = 0x023bf000, LENGTH = 260K - 4k
itcm : ORIGIN = 0x01000000, LENGTH = 32K
}
b) cd ..
cd NDSPython
make
c) Install support for your homebrew device using dlditool.
For instance for the compact flash Supercard:
dlditool sccf.dldi NDSPython.nds
d) If your homebrew device is one which uses the 'ds.gba' roms,
then you need to type 'make' again, which will take the 'nds' rom
with your homebrew support and build another 'ds.gba' rom with
that support.
This should give you a usable compiled rom.
6. Install it on the Nintendo DS.
a) Copy the NDSPython rom which works on your device somewhere on it.
b) Copy 'NDSPython/NDSPython/python' to the root of your homebrew media.
That is, the python directory found there should be placed directly
in the root of your homebrew media. This is where NDS Python looks
for it. You can test it works when you run NDS Python on your
Nintendo DS by executing 'import slptest'.