So i hate admitting my own failures, but i'd also love to play wolf3d on my psp. Really I was just hoping to inspire someone with a little more expertise.... And I know about wolf3d on the SNES, almost threw up...
Must admit havent coded anything significant in c in the last 5 years or so, but after finding a Wolf3d linux/SDL port (and gp2x) I thought I'd give it ago. Heres how it went.
1. Its always good to start off with something working, so went to building it on my pc - cygwin style. After building SDL it compiled and ran quite easily, albiet without sound (sound method implementations were deleted by the previous author).
2. On to the PSP. Already had the pspsdk up and running, all the samples compiled and ran ok well. All in all as far as c API's go, i was very impressed. The psp SDL implementation also complied quite nicely. Wolf3d had a few dependancies that weren't implemented in the pspsdk (glob.h!), so hacked the source up a bit (hardcoded loading of shareware versoin, ect). No big deal really. Merged one of the sample makefiles with the one that came with wolf3d and made my very first original eboot. Copied it to my psp...
3. Beginners luck? Never expected it to work first time and it didnt, would of been nice though! Had to run it a couple times just to be sure (i'm running on 2.6, yeah ouch). Each time i was confronted with you typical black screen of death.
4. Debuging, sigh! By the addition of many, many pspdebugprintf calls i was able to ascertain that it was bombing out at a call the the SDL video initialisation. After inspecting the SDL code i figured out that it returned null if i had HW buffering on and specified a non-std screen res (wolf was 320x200). Easy fix, just removed the hardware buffering flag. Recompiled and copied across. Started up again, my printf calls told me that it successfully initialised wolf3d - yet more black screen, sigh.
5. Glimmer of hope. Left it alone for a while, in fact didnt touch the code for a week. Was drinking and playing SNES (on psp of course!), got tired and in my drunken state though it a good idea to see if my wolf3d port had magically started working. Loaded up first time (can tell due to excessive printf statements), but after that - just black, or so I thought! Put the psp down to get another beer - came back to see the wolf3d demo playing through! Sound good? wait for the details. The screen was a lil messed up, how messed up - heaps. Basically it was drawing pixels, from the next line on the current line. See Fig.1
Should be like this But looked like this
5. Simple fix! Obviously i though this was just due to wolf3d being 320x200 and the psp being 480x272. Changed the SDL init call to the psp's res, hoping for the best - only to see even more of a mess!
6. PSP to PC port. Figured that i may have messed something up in all the hacking (wont say coding as I wasnt real nice to the source), so I figured I'd port my code to the PC, sounds sort of stupid - but seemed like the right thing to do. After removing all psp references (debug printf's, callbacks, etc), i got it to compile and run fine. In 480x272 res aswell! This lead me to believe there are some discrepancies between the psp and pc SDL implementation, to be expected really - nothings really cross platform now is it.
6. Quiting. Well i've now spent many hours on this - to no avail. The psp is not the best env for debugging, and it take about 10min to test each build on the psp (2.6 remember), usb copy -> reset -> load gta -> load loader -> load wolf3d -> hope for the best. I mean there's also the fact that it may never be able to run on a 2.6 psp, due to well know instabilities. Bottom line is i lack the exprience, hopefully someone else out there thinks this is a worthy project!
-EBOOT, well I cant upload it (too large), but if anyone wants it pm your email and i'll send it over next week.
-Source package, contains only files that differ from when i picked it up (all was too large), the rest of the source can be obtained from
-You'll need all the *.WL1 files too, shouldn't be too hard to find a SW ver of wolf3d. Try apogee I think - or get me to send them to you. They need to be placed in the same dir as the EBOOT
8. Anyway, I've certainly learnt alot - hope its useful for others out there too, yeah feel free to have a laugh. If all goes according to plan i'll check here on mon and someone will have released a nice wolf3d port. BTW given the half arsed attempt, please dont feel obliged to give me any credit.