README.ds
author Sam Lantinga <slouken@libsdl.org>
Wed, 26 Sep 2012 20:14:37 -0700
changeset 6464 ab55284b389f
parent 6285 f12649068adb
permissions -rw-r--r--
Fixed bug 1573 - SDL does not support system clipboard on Android. Philipp Wiesemann 2012-08-18 14:09:47 PDT there is currently no way in SDL to interact with the system clipboard on Android. I attached a patch which tries to implement the three clipboard functions for Android. It does not add the CLIPBOARDUPDATE event because this seems to require Android API 11 or polling.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5289
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
================================================================================
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     2
Simple DirectMedia Layer for Nintendo DS
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     3
================================================================================
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     5
-Requirements-
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
     6
* The devkitpro SDK available at http://devkitpro.org.
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
     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
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    11
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
-Building SDL-
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    13
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    14
After setting the devkitpro environment, cd into your SDL directory and type:
5289
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    15
  make -f Makefile.ds
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    16
5515
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    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
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
  desmume test/nds-test-progs/general/general.nds
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    26
-Notes-
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    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
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    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
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    33
     See USE_HW_RENDERER in Makefile.ds.
5515
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    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
1916a9e9714d Frank Zago to SDL
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    37
-Limitations-
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    38
* in hardware renderer mode, don't load too many textures. The internal format is
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    39
  2 bytes per pixel. And there is only 256KB reserved for the textures. For instance,
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    40
  testscale won't display sample.bmp, unless it's resized to a smaller picture.
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    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
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    43
5515
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    44
-Joystick mapping-
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    45
The Joystick presented to SDL has 2 axes and 8 buttons
5423
b69fa50e80d7 a Nintendo ds update
Sam Lantinga <slouken@libsdl.org>
parents: 5289
diff changeset
    46
5515
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    47
 KEY      | Code
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    48
  A       |   0
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    49
  B       |   1
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    50
  X       |   2
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    51
  Y       |   3
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    52
  L       |   4
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    53
  R       |   5
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    54
  select  |   6
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    55
  start   |   7
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    56
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    57
 Left-right is axe 0.
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    58
 Up-down is axe 1.
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    59
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    60
-Mouse mapping-
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    61
todo
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    62
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    63
-Examples-
0fcf231a6e74 NDS update
Sam Lantinga <slouken@libsdl.org>
parents: 5430
diff changeset
    64
Due to memory limitations, to be able to successfully run the testscale example, sample.bmp must be resized to 256x105.