Pstros NDS is a MIDP implementation running on the CLDC java machine
compiled for the Nintendo DS. It allows you to run some java programs
and games written for the mobile phones on your NDS.

To achieve this goal one needs a java machine for processing the
bytecode and a program library that implements the MIDP api. In this case
the Sun's KVM java machine was used (thanks to Torlus and davr for porting
it for the NDS and providing the source) and an altered version of the
Pstros
was used as the MIDP library. Both parts were built into the single binary to
simplify the execution of the java code on the NDS.

How to run...

The program is a homebrewed application so you have to have one of the
cards that allows you to run a custom software on the NDS. Just copy the content
of the archive to the card and run the kvm.nds file (dont forget to patch
the program if your card requires it). Then select a .class or .jad file
and run it by pressing the (A) button. Hopefully the java program will run.

The MIDP screen size is set to 176x192 resolution to get the best compatibility
and visual output. I've tried the HW scaled resolution of 176x208 but
it was visually inacceptable (the NDS roto scaller simply discards
some lines instead of making the pixel interpolation).

The heap memory of the JVM is set to 2 Mbytes to leave a reserve for
the library growth (libraries are bundled in the kvm binary) and for the
needs of the native methods (and for the memory leeks I made :-) and jar
loader.

Key codes are set to the standard of Nokia and SonyEricsson phones.

The overall speed of the JVM is rather slow, although still usable. According the
JBenchmark2 test it ranges around the speed of the Nokia 6600 phone
(some operations are slightly slower some of them are faster).
It might be interesting to compare the performance with the PhoneMe JVM as it should
be technically more advanced than the KVM.

Note that class files must be preverified before it can be run on the KVM.
Use the preverifier supplied by the J2ME WTK.

NDS-key-Start: keySoftLeft
this line will remap NDS button Start to press of the Left soft key of the phone

2008.06.24: version 0.7.1 - R5 build

- added HttpConnection class to satisfy dependencies of some applications
- implemented drawing of the ellipses (note: draw/fillArc is not fully functional yet)

2008.06.20: version 0.7.0 - R4 build

- Nokia UI api partially implemented: drawPixels and getPixels implemented
for the 4444,444,8888 and 888 pixel formats with the full manipulation support
(mirroring and rotation).
- bug fixes (JBenchamrkPro works now)

2008.05.31: version 0.6.0 - initial R3 build

- fixed the CLDC implementation (timer, memory size, system properties)
- added support for reading of the PNG images (code taken from the PhoneMe project)
- implemented native functions for rendering the basic graphics primitives on the screen
(lines, rectangles, triangles, images)
- added support for accepting the JAD files in the application browser
- ported the core part of the Pstros MIDP library to use CLDC java machine instead of the
fully featured j2se java machine.

Credits:

Several people and their resources contributed directly or indirectly to the project. Here is the list:

- The CLDC reference implementation source code from Sun.
- Torlus and davr ported the CLDC to GBA and NDS.
- Ole added the MIDP support .
- The DevkitPro compiler and libraries (excelent tools, I was really surprised that everything
was set up correctly right from the start and worked like a charm!).
- DeSmuME NDS emulator, 90% of the development and code testing was inspected in this great
emulator.
- NDS development tutorial web pages - invaluable source of information.