![]() |
#1 |
CD audio quickfix for JonoF\'s port
Hello all!
I wrote a quick'n'dirty CD audio support for windows version of JonoF's port. CD support is implemented using windows Multimedia Control Interface and Mixer APIs. This meant to be a temporary solution until JonoF gets next version of his port ready. Download JFSW_CDA.zip from http://www.angelfire.com/alt/arkion . Sorry about the horrible quality of the web page, but angelfire makes it a real mess with those ads an all. Aforementioned zip contains the pre-compiled Debug build executable (hence the 2+ MB size) and relevant source code files (cd.c is modified, cd_mx.c and cd_mx.h are new), so you can alternatively compile it yourself by merging these files with JFSW sources. Unfortunately save games are still not functional - coming up with a portable solution seems to be very tricky and will take some time. |
|
![]() |
![]() |
#2 |
|
Re: CD audio quickfix for JonoF\'s port
Thank you, I'm about to give it a shot
|
![]() |
![]() |
#3 |
Re: CD audio quickfix for JonoF\'s port
Nice. Makes Shadow Warrior that much more playable. Saving would be nice but the shoddy mouse aim is my primary concern.
Frustrating though that I could only get it to play CD audio with the CD in my DVD±RW drive (E ![]() ![]() |
|
![]() |
![]() |
#4 |
Re: CD audio quickfix for JonoF\'s port
Yep - with many of the old cd audio games you can only have cd audio playing if the cd is in the cdrom with the highest letter - some games only accept letter D. ( So if you were to change the letters of your cd roms you could easily get the game to play from the one you like )
Nice fix tho - works a treat - Even better when ogg support comes in. - Don't suppose you can make a quick fix for this? |
|
![]() |
![]() |
#5 |
Re: CD audio quickfix for JonoF\'s port
Thank you... It works like a charm.
I wonder however, why your build of sw.exe is so much smaller then JonoF's. Did you rip out a lot of code?
__________________
"A Smith & Wesson beats four aces." |
|
![]() |
![]() |
#6 |
Re: CD audio quickfix for JonoF\'s port
You're welcome.
If I remember correctly, exe from my build was bigger than JonoF's. Main reason for this is that mine is a debug build and no optimizations are enabled. Also, I combined the engine and game codebases into single project and made it a Visual Studio Solution, instead of using the old makefile-only project. Thus, some settings could differ from the makefile ones. MCI probably automatically picks the CD drive with lowest drive letter in case there are multiple drives installed, so that's the reason why only one of them works. |
|
![]() |
![]() |
#7 |
Re: CD audio quickfix for JonoF\'s port
On my machine with two physical drives (I:, J
![]() ![]() Code:
MCI_OPEN_PARMS mop; CHAR drive[4] = "K:"; memset(&mop, 0, sizeof(mop)); mop.lpstrDeviceType = (LPCSTR)MCI_DEVTYPE_CD_AUDIO; mop.lpstrElementName = drive; if (mciSendCommand(0, MCI_OPEN, MCI_WAIT|MCI_OPEN_SHAREABLE|MCI_OPEN_TYPE| MCI_OPEN_TYPE_ID|MCI_OPEN_ELEMENT, (DWORD)&mop)) /* error */; PS. Savegames are the next item on my "to-tackle" list right after I sort out the input problem that I'm working on at the moment. After that's done, I'm pretty much in a position for the next release. Jonathon |
|
![]() |
![]() |
#8 |
Re: CD audio quickfix for JonoF\'s port
I hope the Crash Bomb bug is fixed, it's kinda stupid to have a Sticky Bomb that crashes the game, not explodes. XD;;
|
|
![]() |
![]() |
#9 | |
Re: CD audio quickfix for JonoF\'s port
Quote:
![]() ![]() ![]()
__________________
Humanas actiones non ridere, non lugere, neque detestari; sed intellegere curavi. |
||
![]() |
![]() |
#10 |
|
Re: CD audio quickfix for JonoF\'s port
Just reporting it's working flawlessy here.
|
![]() |
![]() |
#11 | ||
Re: CD audio quickfix for JonoF\'s port
Quote:
Quote:
I'm going to tackle on the savegame problem as well and see what can be done. Having no savegame functionality is extremely frustrating, especially on higher skill levels. I must admit that it's really difficult stay alive for long in SW |
|||
![]() |
![]() |
#12 |
Re: CD audio quickfix for JonoF\'s port
My solution to the savegame problem appears to hold water, so the next release definitely will have working savegame support.
Jonathon |
|
![]() |
![]() |
#13 |
Re: CD audio quickfix for JonoF\'s port
Any idea when we can expect that? (Please don't let this be another WID!)
/me wants.... :P |
|
![]() |
![]() |
#14 | |
Re: CD audio quickfix for JonoF\'s port
Quote:
-- 1 minute later -- Well, with a few minor changes to the source (slightly misplaced #ifdef RENDERTYPEWIN in cd.c, missing include "baselayer.h" in rts.c) it builds and runs on Linux, but keyboard input seems to be messed up. No testing for me, I guess. |
||
![]() |
![]() |
#15 | |
Re: CD audio quickfix for JonoF\'s port
Quote:
How'd you manage to store pointers in a file and make sure they are still valid when loaded from the file, possibly after restarting the application, is beyond me. Isn't that what the symbol table is all about? Oh well... |
||
![]() |
![]() |
#16 |
Re: CD audio quickfix for JonoF\'s port
The method I'm using is to bring the symbol table into the program itself by constructing tables of saveable code and data in each module of the game. The new symbol lookup code then searches the saveable code/data tables of each module for a match and converts that into a "module, ordinal" pair for code and a "module, ordinal, offset" triplet for data. The downside of this is the tables for each module need to be constructed and maintained by hand but thankfully that job is made easier with a text editor capable of regular expressions and only some bits of the game really need to be saved. Basically, wherever in the SaveGame function you see a SaveSymDataInfo or SaveSymCodeInfo call, the data it could potentially point to is what goes into the saveable tables. My tests so far have indicated saving is quite feasible which makes loading then similarly straightforward since it's just a reversal of the process.
Jonathon |
|
![]() |
![]() |
#17 |
Re: CD audio quickfix for JonoF\'s port
Will the new version have a way to choose which CD drive to use from the menu? Thanks for getting the saves working. Can't wait.
|
|
![]() |
![]() |
#18 |
Re: CD audio quickfix for JonoF\'s port
I've got three things in the works at the moment which when they're complete will signal the release being ready:
Jonathon |
|
![]() |
![]() |
#19 |
Re: CD audio quickfix for JonoF\'s port
Thanks! I really look forward to it.
|
|
![]() |
![]() |
#20 |
Re: CD audio quickfix for JonoF\'s port
Just one question: "Failed setting buffering: DI_POLLEDEVICE", related to joystick misconfiguration, that led to disabled mouse & keyboard in game, is that now being fixed?
Thank you for all your great effort!! Really looking forward to the new JFSW!
__________________
アーティスト |
|
![]() |
![]() |
#21 |
Re: CD audio quickfix for JonoF\'s port
Yeah, that's taken care of. DI_POLLEDDEVICE isn't a failure code but my daft use of DirectInput forgot that.
Jonathon |
|
![]() |
![]() |
#22 |
Re: CD audio quickfix for JonoF\'s port
Saved games now work.
Jonathon |
|
![]() |
![]() |
#23 | |
Re: CD audio quickfix for JonoF\'s port
Quote:
|
||
![]() |
![]() |
#24 | ||
Re: CD audio quickfix for JonoF\'s port
Quote:
|
|||
![]() |
![]() |
#25 |
Re: CD audio quickfix for JonoF\'s port
I don't get how you can compile the files in the cd audio zip with the jwshadow warrior source code?
__________________
You don't know what death is? let me show you! |
|
![]() |
![]() |
#26 | |
Re: CD audio quickfix for JonoF\'s port
Quote:
|
||
![]() |
![]() |
#27 |
Re: CD audio quickfix for JonoF\'s port
Speaking of joystick, does joystick finally work on Linux now? And does it support all 8 buttons and 4 axes, like the config file claims? (cause i could never get more than 4 buttons and 2 axes to work on the dos version). It's kinda pointless using a joystick in a 3d shooter with only 2 axes, cause you need at least 4 to be able to turn around and look at the same time.
[edit:] and how about ignoring the setting for ControllerType and have it use everything at the same time, like all modern games? I don't know if it's possible within the code though, its just a suggestion, but modern games let you use joystick and mouse at the same time. [edit2:] just curious though, whats that with music during games? i personally turn off *all* music in every game because it gets repetative quickly and distracts from the real game, and certainly doesnt belong in "reality games" (like those army shooters), cause you dont hear any music on a *real* battlefield. I know, shadow warrior has nothing to do with reality, but in SW its even worse: you have to put a CD in. I always use no-cd cracks because i dont want to put no CD in. Oh well, it seems to be getting more like a rant now though, so i'll just quit before i start on copy protections and the uselessness of that.
__________________
"Fatal Error: Windows not found: (C)heer (P)arty (D)ance ?" |
|
![]() |
![]() |
#28 | ||
Re: CD audio quickfix for JonoF\'s port
Quote:
Quote:
Jonathon |
|||
![]() |
![]() |
#29 |
Re: CD audio quickfix for JonoF\'s port
By the way, how's the JFDuke3d port coming along? Or is that delayed until JFSW is working properly again?
|
|
![]() |
Bookmarks |
|
|