release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Search | Go
Wiki > Main > PluginDuke3D

Duke3D?

This is a port of Duke Nukem 3D, derived from Fabien Sanglard's Chocolate Duke. It is available for most ARM devices with a color screen.

Installation

The .GRP and .CON files from an original installation of the game must be placed in the /.rockbox/duke3d/ on your device. The demo version works well.

Music

In-game music will not work by default. For it to work, you must install a modified Timidity patchset in the /.rockbox/timidity/ directory on your device. There should be a /.rockbox/timidity/timidity.cfg file located in this directory, along with the instrument files. You must edit the .cfg file so that all the path names are absolute (i.e. in the form /.rockbox/timidity/instruments/*.cfg).

There is a patchset available (limited to non-commercial use) available here. Download and extract to /.rockbox/ (not /.rockbox/duke3d or /.rockbox/timidity/!). Music should then work.

Video

Rotation of the video output is possible by choosing the correct video option in the in-game menu. If your device's display is normally 320x240, for example, choosing the 240x320 option will rotate the screen 90 degrees. The keymap will be updated as well to reflect the rotation.

Caveats

Sound effects, enabled by default, could have a detrimental effect on playability on some devices. If you notice excessive lag, try disabling sound.

The default button mapping may not be optimal for gameplay. Set a different mapping in the ``Keyboard'' section of the game setup. Note that not all keys are mappable on all devices.

Some devices will low memory or large GRP files will prevent the game from completely caching the GRP file in RAM, which could lead to disk reads during gameplay. This might cause the game to lag slightly when it happens, which is normal. The game should resume in a second or so.

Gory Technical Details

SDL

The game runs on a port of the Simple DirectMedia? Library (SDL), version 1.2. The sources for both SDL and Duke3D? are located in the source tree under rockbox/apps/plugins/sdl/.

The SDL port is not specific to Duke3D?. Other games, namely Wolfenstein: 3-D and Quake, have been ported and run using the Rockbox SDL runtime with varying degrees of success. However, the only game currently in the main tree is Duke3D?.

An SDL program can be added by the following steps (some are possibly missing; ask __builtin in IRC for help):

1. Copy your program's sources into its own directory under apps/plugins/sdl/progs/.

2. Create apps/plugins/sdl/SOURCES., modeled after SOURCES.duke

3. Edit sdl.make by duplicating all lines referring to "DUKE3D" and editing them to refer to your program. You will need duplicate build rules as well

4. Rename your prorgam's main() to be my_main(int argc, char *argv[])

5. Add your program to apps/plugins/CATEGORIES

6. Compile and fix errors (see below)

Things to note:

1. ARM cannot do unaligned loads correctly. Reading an unaligned value will give undefined behavior. SDL currently builds with -Wcast-align to catch these errors -- fix them.

2. The UI sim does not play well with the default settings. It is still possible to run Duke (and other SDL programs) under the UI simulator, by enabling it in SUBDIRS, using SDL threads (pass --sdl-threads to tools/configure), and compiling for 32-bit (add -m32 to CFLAGS and LDOPTS in tools/configure).

Execution begins in main.c:plugin_start(), which spawns a new Rockbox thread in which your program's my_main() is run (for more stack space).

-- FranklinWei - 24 Dec 2017

CategoryPlugin: Duke Nukem 3D []
r3 - 05 Nov 2018 - 02:05:01 - FranklinWei

Copyright by the contributing authors.