Wolf4sdl For Gp2x


Pickle

Mega GP Mania
Joined
May 30, 2006
Messages
5,527
Location
Detroit, Michigan
Website
Visit site
This is a wolf3d port by Chaos Software (Ripper) that uses SDL and SDL_mixer.

Many thanks goes to the author Ripper for making the port work with the GP2X. For about 3 weeks or more I have been working back forth with him to make it ARM compatible.

Ive added controls for the GP2X and applied the MMU hack. The resource requirement is greater than gp2xwolf3d, but I think it has some benefits. One is the fullscreen option, this will use the border and statusbar space for the viewable area. You can see a screen shot below.
Second I think the sound is better, fuller.

There are 2 binary's one for WOLF3D and one for SOD. Ive also provided gmenu2x entries. If you dont use gmenu2x you should create a script. I havnt provided those (in other words you should be using gmenu2x by now)

Please look through the README, there a lot of info on this port in there.

Fullscreen mode: (note the statusbar was shown as an example normally it isnt there)
screenshot0hl4.png


Normal Mode:
http://img238.imageshack.us/img238/4546/screenshot1iq5.png

I look forward to any opinions and/or remarks about this port.

Heres the link
http://www.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,20,2479
 
After some more testing I highly recommend changing the samplerate to 11025. It doesnt some any worse and the game can be run at 200 Mhz. If you gmenu2x you can just edit it from within gmenu2x.
 
Thanks a lot, I am enjoying it! Works great.

Only problem I've noticed is the volume controls could use some finessing (going all the way down loops back around to max vol). It would also be nice to have finer-grained control at lower levels for F200 users w/ headphones.
 
Senor Quack said:
Thanks a lot, I am enjoying it! Works great.

Only problem I've noticed is the volume controls could use some finessing (going all the way down loops back around to max vol). It would also be nice to have finer-grained control at lower levels for F200 users w/ headphones.
When will people finally abandon linear volume controls for logarithmic ones just like on iTunes... oh well I'm sure it's too complicated for most devs who are mathematically impaired.
 
Last edited by a moderator:
A_SN said:
Senor Quack said:
Thanks a lot, I am enjoying it! Works great.

Only problem I've noticed is the volume controls could use some finessing (going all the way down loops back around to max vol). It would also be nice to have finer-grained control at lower levels for F200 users w/ headphones.
When will people finally abandon linear volume controls for logarithmic ones just like on iTunes... oh well I'm sure it's too complicated for most devs who are mathematically impaired.

So whats that supposed to mean, you saying I cant add? :(

Ive have a fix Senor Quack has volunteered to test. I think the real issue is the accuracy of the mixer io write itself. Its an integer value so the smallest change possible is a 1. The logarithmic effect you want I think would only effect the higher values.
The fine tuning I added many not work, either you have 0 = sound off or 1 = sound on with lowest setting. Theres no inbetween.
 
Last edited by a moderator:
Pickle said:
I think the real issue is the accuracy of the mixer io write itself. Its an integer value so the smallest change possible is a 1.
No shit ;) that doesn't say anything about the range. Are you using 8-bits (and therefore have 256 possible mixing values) or something else?
 
Last edited by a moderator:
A_SN said:
Pickle said:
I think the real issue is the accuracy of the mixer io write itself. Its an integer value so the smallest change possible is a 1.
No shit ;) that doesn't say anything about the range. Are you using 8-bits (and therefore have 256 possible mixing values) or something else?


Yes its 2 channels with 8 bits for each, but im caping the max value at 100.
The area of concern was fine tuning with headphones at low volume levels, and the volume is pretty loud at very low values. I was changing the value by 2, which might not have allowed the volume value to hit 1, which would be the lowest value before turning the sounds completley off. So I check if the sound level was below 10 to do 1 increments, otherwise its still 2.
 
Last edited by a moderator:
I will test it when I get home from work :)

Please excuse A_SN, he has the tact of a rock.
 
Senor Quack said:
I will test it when I get home from work :)

Please excuse A_SN, he has the tact of a rock.
Thanks, I might do that as well. By the way im using your example for the volume control. If you have any other ideas im open. I dont think theres much else that can be done since like I said the volume only has the resolution of a integer.

I dont have any problem's with A_SN. He said I couldnt add, so I said he didnt know what a integer was apparently. :p
 
Last edited by a moderator:
Pickle said:
I dont have any problem's with A_SN. He said I couldnt add, so I said he didnt know what a integer was apparently. :p
Yeah, ha ha ha very funny, as if I said you couldn't add. I said most devs were mathematically impaired. That didn't necessarily target you (I like to let people decide whether they're part of the group I'm targeting or not), and that didn't mean not being able to add but more like unable to apply any more or less advanced mathematical concept to their problem at hand without the help of a tutorial from gamedev.net.

As for your problem, well, if your mixer values thing only goes up to 100 (why 100? sounds retarded..), then yeah, at a value of 1 (out of 100) you're at -40 dB, and at 2 you're at -34 dB, that's why it sounds pretty loud. Why don't you use a much larger range for your mixer? Anyways you could still try logarithmic incrementation of your volumes with that, it would work, well that's if you think your addition skills will be enough.

Pickle said:
he didnt know what a integer was apparently. :p
Excuse me, I didn't quite catch that gratuitous insult to my intelligence. Care to elaborate?
 
Last edited by a moderator:
I didn't get it to work. I'm using the 1wolf14.zip v1.4 shareware episode from 3DRealms website. Does this support the demo? The ReadmeGP2X.txt doesn't mention anything about it.

Here's the console output from a telnet session :-

CODE

[root@gp2x wolf3d]$./Wolf4SDL_WL6.gpe --audiobuffer 256 --samplerate 22050
Using mmuhack.o
SDL_GP2X: CreateDevice
SDL_GP2X: VideoInit
SDL_GP2X: Physical screen = 320x240 (ilace = 0)
SDL_GP2X: Looking for a mouse
SDL_GP2X: No mice found
SDL_GP2X: Creating cursor 16x16
SDL_GP2X: Allocated WMcursor @ 0x271828 (32)
SDL_GP2X: SurfaceManager allocating 256 bytes
SDL_SYS_JoystickInit
SDL_GP2X: ListModes
SDL_GP2X: Setting video mode 320x240 8 bpp, flags=A0000000
SDL_GP2X: FreeHWSurfaces
SDL_GP2X: InitHWSurfaces 0x40012c00, 5161984
SDL_GP2X: Screen bucket 0x270dac
SDL_GP2X: First free bucket 0x271d40 (size = 5161984)
SDL_GP2X: Creating cursor 16x16
SDL_GP2X: Allocated WMcursor @ 0x271d58 (32)
SDL_GP2X: SurfaceManager allocating 256 bytes
SDL_GP2X: SurfaceManager adding new free bucket of 5161728 bytes @ 0x271d70
SDL_GP2X: SurfaceManager allocated 256 bytes at 0x40012c00
MMU hack loaded
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
SDL_GP2X: Freeing cursor 0x271d58
SDL_GP2X: SurfaceManager freeing 256 bytes @ 0x40012c00 from bucket 0x271d40
SDL_GP2X: merging with next bucket (0x271d70) making 5161984 bytes
SDL_GP2X: VideoQuit
SDL_GP2X: FreeHWSurfaces
SDL_GP2X: Freeing bucket 0x271d40 (size 5161984)
SDL_GP2X: FreeHWSurface 0x270ee8
SDL_GP2X: SurfaceManager freeing 76800 bytes @ 0x40000000 from bucket 0x270dac
SDL_GP2X: DeleteDevice
[root@gp2x wolf3d]$exitConnection closed by foreign host.



It seg faulted when I got past the id credits page.

Cheers
 
I have tried a lot of ways to make this port work, but the result is always the same, i can´t make it work :(
 
Sorry Ive didnt see these posts, my response emails stopped. So I didnt know anyone replied.

hmm, i forgot what I was really coming to this thread to post..the volume argument made me forget. I have a version that puts the status bar in the blank bar at the bottom. It works pretty good, expect that when you the in the menu you get whatever was in that area from a previous blit. In other words, if you start a game and it draws the menu down there and you go back to the menu you still see the status bar. It deosnt effect gameplay or the game, its just a graphical impurity. If anyone really wants it I can provide it.

To Thunor:
I didnt test the shareware version. I might have to compile a different version. Ill look into it

To Rivroner:
Which version are you trying to run? If you can give me a telnet like Thunor if might help. Basically I need more info if you want help.

To A_SN:
ok, ok. I didnt really you to take this that seriously. Insults/joking aside...you seem to want to help with the problem, so here you go:

CODE

void GP2X_AdjustVolume( int direction )
{
if( volume <= 10 )
{
if( direction == VOLUME_UP ) volume += VOLUME_CHANGE_RATE/2;
if( direction == VOLUME_DOWN ) volume -= VOLUME_CHANGE_RATE/2;
}
else
{
if( direction == VOLUME_UP ) volume += VOLUME_CHANGE_RATE;
if( direction == VOLUME_DOWN ) volume -= VOLUME_CHANGE_RATE;
}

if( volume < VOLUME_MIN ) volume = VOLUME_MIN;
if( volume > VOLUME_MAX ) volume = VOLUME_MAX;

printf( "Volume Change: %i\n", volume );

unsigned long soundDev = open("/dev/mixer", O_RDWR);
if(soundDev)
{
int vol = ((volume << 8) | volume);
ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol);
close(soundDev);
}
}



The original problem was that there was loud sound using headphones, (note if you dont use headphones the gp2x speaker volume isnt too loud.)

The volume is an integer value, it could be 0-255. Capping it at 100 is irrevelant to the problem.
The important lines are these:
CODE

int vol = ((volume << 8) | volume);
ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol);



So say I send the number 10 in hex its 0A. Shift it right you get 0A00 then OR it with 0A gives you a final answer of 0A0A.
That tells me that the upper 8 bits is for one channel and the lower 8 is for the other channel.
Then you just write it to the device.
The lowest volume possible would be , but its still too loud using headphones. Thats the problem.

Using 100 all I did was limit how loud the volume can get, if I use 255 all i will do is make it possible to make the sound louder. It has no effect on the how low/quiet I can make the volume go.

And your logarithmic stuff, doesnt have anything to do with the problem, all it would do is make it quicker to get from a low volume to a high volume.

Let me know if you can give me any insight in how /dev/mixer really works.
 
Rivroner said:
I don´t know how to give you a telnet.I have no craddle, i am launching the game with Gemnu2x in a F200.

This is a capture of the game version i am using:

[img=http://img443.imageshack.us/img443/2865/wolf3dqm2.th.png]


First I hope that its only the data files that you are using there (wolf3d.exe??)... if so I think I might know what the problem could be, delete the config.wl6. If you use one from somewhere else like a pc version it will crash the program.
 
Last edited by a moderator:
Ok, i will try erasing config.wl6 :)

I was not using Wolf3D.exe ;)

Thank you :)
 
Great job once again man. And thanks for you help getting it going. I only have one thing that is bugging me as of now. And that is when you use the open funtion for doors I get a crackling sound. Is this fixable by me changing something or is this just a bug that still needs to be worked out? All the other sounds are superb though. I am using a sample rate of 22050 if it matters. But I get the sound in all sound modes. Also do you know if blakestone will run with this enterperater? Thanks again man you rock!! :D
 
Back
Top