FS#6467 - New control scheme for Doom on Sansa e200

Attached to Project: Rockbox
Opened by Piotr Jafiszow (yossa) - Thursday, 21 December 2006, 23:52 GMT
Last edited by Steve Bavin (pondlife) - Wednesday, 10 October 2007, 10:43 GMT
Task Type Patches
Category Games
Status Unconfirmed
Assigned To No-one
Operating System Another
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Patch changes controls for Doom:

Forward: rec/up
Left/Right: scrollwheel (it needs a lot of scrolls for large turns, but hopefully it can be modified to work better in the future)
Back: down
Shoot/Enter (menu): select
Change weapon: left
Open: right
Esc: power
This task depends upon

Comment by Piotr Jafiszow (yossa) - Saturday, 30 December 2006, 20:34 GMT
No success as of yet with modifying the turn code in Doom source. A dirty hack is to bind key_left and key_right in g_game.c to 180 degrees turn function but lowering the actual degrees of turn. Effectively, by scrolling the wheel player view jumps a predefined number of degrees. Playing in such a way is jerky and generally not pleasant but works.

Example code of such a hack:

#define QUICKREVERSE (short)3072 // 180 degree reverse
if (gamekeydown[key_left])
cmd->angleturn += QUICKREVERSE;
gamekeydown[key_left] = false;
if (gamekeydown[key_right])
cmd->angleturn -= QUICKREVERSE;
gamekeydown[key_right] = false;

More skilled coders should probably be able to fix the problem in a much more elegant way. But since the scrollwheel code for sansa is to be modified to interrupt based when possible, this should probably be put off to a later date.
Comment by Piotr Jafiszow (yossa) - Sunday, 25 March 2007, 13:08 GMT
With the introduction of 90 degrees screen rotation in Doom, I tried to create a more useful method of controlling it. Changes introduced by the attached patch are as follows:

Forward: rec
Left/Right: up/down (suits rotated display)
Back: left
Shoot: select
Open: right
Change weapon: scroll up
confirm (menu): scroll down
Esc: power

The REC button for moving forward allows to move and turn at once without much strain, creating a more true to the original controls feel.

PS. Before first use you will likely have to remove the default.dfg file from your WAD directory, especially if you tried to set up your own controls via the plugin menu.
Comment by Marty Carlton (martonius1978) - Tuesday, 04 September 2007, 17:01 GMT
i know you've probably been done trying to figure out this problem for a while, but i can't seem to figure out how to apply this patch to my rockbox...
if you could be of any help, i'd be very grateful
Comment by Piotr Jafiszow (yossa) - Tuesday, 04 September 2007, 17:09 GMT
I'm sorry, I've neglected my patches for a long while due to lack of time. It's entirely possible that there were changes to the codebase which prohibit this patch from working correctly. I will try to update its status in the comming days, I don't promise anything though.
Comment by Marty Carlton (martonius1978) - Tuesday, 04 September 2007, 17:33 GMT
i know all the people posting patches and bug fixes on this site must have other much higher priorities, so i thank you very much for posting anything up here at all!
i have one more question though..
would this patch, if working, be the thing that provides the coding for the scrolling in Doom to work both directions?...i've gotten it to scroll right using the "key on" key setting for the "right" control key, though the "key off" doesn't work the opposite way(left)....
i'm just trying to figure out if this would be the patch i'd need, if it were to work as it was programmed to.