author | Sam Lantinga <slouken@libsdl.org> |
Sun, 12 Feb 2012 21:04:01 -0500 | |
changeset 6285 | f12649068adb |
parent 6251 | 3e8c673cad58 |
permissions | -rw-r--r-- |
5289 | 1 |
================================================================================ |
2 |
Simple DirectMedia Layer for Nintendo DS |
|
3 |
================================================================================ |
|
4 |
||
5 |
-Requirements- |
|
5423 | 6 |
* The devkitpro SDK available at http://devkitpro.org. |
7 |
Read the information at http://devkitpro.org/wiki/Getting_Started/devkitARM |
|
5430
1b318d81c85f
You need libfat for the filesystem code.
Sam Lantinga <slouken@libsdl.org>
parents:
5423
diff
changeset
|
8 |
The necessary packages are devkitARM, libnds, libfat and default arm7. |
6285
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
9 |
* Optionally, use a DS emulator, such as desmume (http://desmume.org/) |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
10 |
to program and debug. |
5289 | 11 |
|
12 |
-Building SDL- |
|
5423 | 13 |
|
14 |
After setting the devkitpro environment, cd into your SDL directory and type: |
|
5289 | 15 |
make -f Makefile.ds |
16 |
||
5515 | 17 |
This will compile and install the library and headers into the |
6285
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
18 |
devkitpro's portlibs directory (../portlibs/arm/lib/ and |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
19 |
../portlibs/arm/include/). Additionally it will compile several tests |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
20 |
that you can run either on the DS or with desmume. For instance: |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
21 |
desmume --cflash-path=test/ test/nds-test-progs/testsprite2/testsprite2.nds |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
22 |
desmume --cflash-path=test/ test/nds-test-progs/testspriteminimal/testspriteminimal.nds |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
23 |
desmume --cflash-path=test/ test/nds-test-progs/testscale/testscale.nds |
5289 | 24 |
desmume test/nds-test-progs/general/general.nds |
25 |
||
5423 | 26 |
-Notes- |
27 |
* The renderer code is based on the gl like engine. It's not using the sprite engine. |
|
6285
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
28 |
* The hardware renderer is using the parts of the libgl2d abstraction library that can be found at: |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
29 |
http://rel.phatcode.net/junk.php?id=117 |
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
30 |
Used with the author's permission. |
5423 | 31 |
* The port is very basic and incomplete: |
6285
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
32 |
- SDL currently has to be compiled for either framebuffer mode or renderer mode. |
5423 | 33 |
See USE_HW_RENDERER in Makefile.ds. |
5515 | 34 |
- some optional renderer functions are not implemented. |
6285
f12649068adb
Updated Nintendo DS support
Sam Lantinga <slouken@libsdl.org>
parents:
6251
diff
changeset
|
35 |
- no sound |
5289 | 36 |
|
5423 | 37 |
-Limitations- |
38 |
* in hardware renderer mode, don't load too many textures. The internal format is |
|
39 |
2 bytes per pixel. And there is only 256KB reserved for the textures. For instance, |
|
40 |
testscale won't display sample.bmp, unless it's resized to a smaller picture. |
|
41 |
* the screen size is 256 x 384. Anything else won't work. |
|
6251
3e8c673cad58
Removing some more references to SDL 1.3
Sam Lantinga <slouken@libsdl.org>
parents:
5515
diff
changeset
|
42 |
* there is no 8 bits/pixel mode because SDL 2.0 doesn't support palettes. |
5423 | 43 |
|
5515 | 44 |
-Joystick mapping- |
45 |
The Joystick presented to SDL has 2 axes and 8 buttons |
|
5423 | 46 |
|
5515 | 47 |
KEY | Code |
48 |
A | 0 |
|
49 |
B | 1 |
|
50 |
X | 2 |
|
51 |
Y | 3 |
|
52 |
L | 4 |
|
53 |
R | 5 |
|
54 |
select | 6 |
|
55 |
start | 7 |
|
56 |
||
57 |
Left-right is axe 0. |
|
58 |
Up-down is axe 1. |
|
59 |
||
60 |
-Mouse mapping- |
|
61 |
todo |
|
62 |
||
63 |
-Examples- |
|
64 |
Due to memory limitations, to be able to successfully run the testscale example, sample.bmp must be resized to 256x105. |