Page 1 of 2 1 2 LastLast
Results 1 to 30 of 37

Thread: DEBUG: sucess with the sound! :)

  1. #1
    jonwil
    Settler
    Join Date
    03 Nov 2003
    Posts
    12
    Country
    This is jonwil's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20

    sucess with the sound! :)

    grab these:
    http://users.tpgi.com.au/jonwil/mss32.lib
    http://users.tpgi.com.au/jonwil/mss.h

    and put them somewhere that the ctp2 build process can find them.

    Neither of these contain anything thats (C) Rad Game Tools (I dont have the official MSS SDK to copy from even if I did want to

    These files sucessfully compile an unmodified copy of the CTP2 tree (assuming you have the other build things like the SDKs that is)

    Next step is for someone good at CTP2 to completly excercise the changes in-game and see if there are any problems.

    If you get crashes, it probobly means the definition of one or more of the MSS32.dll functions is wrong (and will need to be fixed) which is in turn causing e.g. an int to be passed when a float is expected and give wrong results)

  2. #2
    Fromafar
    Prince
    Join Date
    25 May 2003
    Posts
    622
    Country
    This is Fromafar's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20
    The parameter and return types should be correct, except for the WINAPI AIL_redbook_track function. I expect that the return type will not be bool, but rather something like S32 or U32. You may have to remove the const qualifiers with the parameters (unlikely for an extern "C" interface).

    The main issue will be finding the actual code values for the names in the enums. These are unlikely to be correct.

  3. #3
    jonwil
    Settler
    Join Date
    03 Nov 2003
    Posts
    12
    Country
    This is jonwil's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20

    if you have donwloaded the files before

    go do it again, turns out that it wasnt compiling properly after all.
    Now it should compile (using the *.lib I just uploaded)

    Still havent been able to test it though (PC problems)

    Somehow, it seems like the methods I was using to generate the Import Library werent working properly so I had to try a different method (which basicly involved creating a "mss32.dll" that only had the functions we know about and did absolutly nothing and using the resulting *.lib file)

    Any problems with this, let me know

  4. #4
    Asmodean
    Emperor Asmodean's Avatar
    Join Date
    22 Aug 1999
    Location
    Aarhus, Denmark
    Posts
    3,644
    Country
    This is Asmodean's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    17:20
    If this works, then you are bleedin' awesome, jonwil

    Asmodean
    Im not sure what Baruk Khazad is , but if they speak Judeo-Dwarvish, that would be "blessed are the dwarves" - lord of the mark

  5. #5
    jonwil
    Settler
    Join Date
    03 Nov 2003
    Posts
    12
    Country
    This is jonwil's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    BTW, this doesnt use anything that could be considered as (C) Rad Game Tools.
    I didnt even do e.g. dumps on mss32.dll.
    So there is no way they can claim that I am voilating their copyright

  6. #6
    The Big Mc
    King The Big Mc's Avatar
    Join Date
    15 Oct 2001
    Location
    Of the universe / England
    Posts
    2,061
    Country
    This is The Big Mc's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    kiking
    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
    The BIG MC making ctp2 a much unsafer place.
    Visit the big mc’s website

  7. #7
    DDowell
    Chieftain
    Join Date
    29 Nov 2001
    Location
    Västerås, Sweden
    Posts
    42
    Country
    This is DDowell's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    17:20
    Great work! Feels nice to have sound again
    So much to do in so little time...

  8. #8
    jonwil
    Settler
    Join Date
    03 Nov 2003
    Posts
    12
    Country
    This is jonwil's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20

    I assume that means...

    That its actually working without crashes or problems?

  9. #9
    DDowell
    Chieftain
    Join Date
    29 Nov 2001
    Location
    Västerås, Sweden
    Posts
    42
    Country
    This is DDowell's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    17:20

    Re: I assume that means...

    Originally posted by jonwil
    That its actually working without crashes or problems?
    It does for me at least. Thanks again man!
    So much to do in so little time...

  10. #10
    Martin Gühmann
    Administrator Martin Gühmann's Avatar
    Join Date
    02 Mar 2001
    Location
    Tübingen, Germany
    Posts
    7,246
    Country
    This is Martin Gühmann's Country Flag
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20

    Post Re: I assume that means...

    Originally posted by jonwil
    That its actually working without crashes or problems?
    I don't encounter any problems that weren't there before. But it works. By the way is there a linux version of the mss32.dll?

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

  11. #11
    J Bytheway
    Emperor J Bytheway's Avatar
    Join Date
    02 Jul 2001
    Location
    England
    Posts
    3,826
    Country
    This is J Bytheway's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    17:20
    Excellent. Will test soon.

  12. #12
    centrifuge
    Prince centrifuge's Avatar
    Join Date
    09 Apr 2002
    Location
    USA
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    09:20
    Good work

  13. #13
    jonwil
    Settler
    Join Date
    03 Nov 2003
    Posts
    12
    Country
    This is jonwil's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    dont know if there is a linux version of mss32.dll or not.
    But if there is, I dont have it

  14. #14
    Locutus
    Deity Locutus's Avatar
    Join Date
    23 Nov 1999
    Location
    De Hel van Enschede
    Posts
    11,706
    Country
    This is Locutus's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20
    So far seems to work okay. Brilliant work, jonwil
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

  15. #15
    J Bytheway
    Emperor J Bytheway's Avatar
    Join Date
    02 Jul 2001
    Location
    England
    Posts
    3,826
    Country
    This is J Bytheway's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    17:20
    Seems to work just fine. I still have that ever-repeating track 1 bug, but that's not new...

  16. #16
    kaan
    Prince
    Join Date
    07 Mar 2001
    Location
    Aarhus
    Posts
    333
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    Originally posted by J Bytheway
    Seems to work just fine. I still have that ever-repeating track 1 bug, but that's not new...
    The solution to that one is in a clear text file called something akin to "playlist" somewhere in the gamedir as far as i can recall

  17. #17
    Solver
    Deity Solver's Avatar
    Join Date
    24 Sep 2000
    Location
    Latvia, Riga
    Posts
    18,354
    Country
    This is Solver's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    19:20
    So... why am I getting the mss32.dll not found with this fix? Do I need to compile the DLL myself, or what?
    Solver, WePlayCiv Co-Administrator
    Contact: solver-at-weplayciv-dot-com
    I can kill you whenever I please... but not today. - The Cigarette Smoking Man

  18. #18
    MrBaggins
    King MrBaggins's Avatar
    Join Date
    03 May 1999
    Posts
    1,528
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    where are you running the ctp2.exe from? that dll is in the regular game directory (along with mss16.dll)

  19. #19
    Solver
    Deity Solver's Avatar
    Join Date
    24 Sep 2000
    Location
    Latvia, Riga
    Posts
    18,354
    Country
    This is Solver's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    19:20
    Bah, never figured I could look there...
    Solver, WePlayCiv Co-Administrator
    Contact: solver-at-weplayciv-dot-com
    I can kill you whenever I please... but not today. - The Cigarette Smoking Man

  20. #20
    rheinig
    Settler
    Join Date
    06 Nov 2003
    Posts
    1
    Country
    This is rheinig's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20

    const's

    Beautiful. But I need to reiterate: some of the const declarations are obviously wrong and might damage optimized builds, namely:
    AIL_quick_handles
    AIL_quick_load_mem (I'd be unsure about a_Dataptr)
    AIL_redbook_track_info

    Just dropping a few const keywords should suffice.

    Seeing someone confirmed this actually works - I'm dead curious how you found the correct values for the constants, especially the 4 redbook ones. lucky guess?

    have phun...

  21. #21
    Fromafar
    Prince
    Join Date
    25 May 2003
    Posts
    622
    Country
    This is Fromafar's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20
    Noone has claimed that these values are correct. Actually, I think it is pretty unlikely they are. From personal investigation with the debugger, I can confirm that at least the ..._ERROR values (first enum value = 0) are correct.

    But I definitely would like to see someone with a working sound card confirm the values for QSTAT_DONE and REDBOOK_STOPPED. The other ones (REDBOOK_PLAYING and REDBOOK_PAUSED) are not that relevant. These are mentioned in the code (SoundManager.cpp), but do not trigger any action.

  22. #22
    MrBaggins
    King MrBaggins's Avatar
    Join Date
    03 May 1999
    Posts
    1,528
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    Right... but if these aren't working, why is it working?

  23. #23
    Fromafar
    Prince
    Join Date
    25 May 2003
    Posts
    622
    Country
    This is Fromafar's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20
    Maybe it is working only most of the time, for not everyone?

    The AIL_redbook_status will be checked every 4 seconds, so you may have all kinds of timing related issues that are difficult to trace.

  24. #24
    ahenobarb
    Prince ahenobarb's Avatar
    Join Date
    26 Nov 2001
    Posts
    437
    Country
    This is ahenobarb's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    Originally posted by J Bytheway
    Seems to work just fine. I still have that ever-repeating track 1 bug, but that's not new...
    The problem is that everytime you start the game, Auto Repeat is always set to on unless you go into the options menu and change every time. (If you change it in the options menu before you start the game, the songs will cycle).

    I looked through the code and the problem is a line in Soundmanager.cpp A variable there is always set to TRUE.

    line 84 is:
    Code:
     
    m_autoRepeat = TRUE;
    change it to:
    Code:
     
    m_autoRepeat = FALSE;
    That should ensure that the default setting for auto repeat when the game starts is FALSE. My copy of VC++ hasn't arrived yet, so I can't test it, but it should fix the problem.
    Last edited by ahenobarb; November 8, 2003 at 14:44.

  25. #25
    ahenobarb
    Prince ahenobarb's Avatar
    Join Date
    26 Nov 2001
    Posts
    437
    Country
    This is ahenobarb's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    Finally got my compiler and compiled the code. The change I suggested above fixes the problem. You don't have to manually set auto repeat to "off" everytime you start a game. What an annoyance!!

  26. #26
    ahenobarb
    Prince ahenobarb's Avatar
    Join Date
    26 Nov 2001
    Posts
    437
    Country
    This is ahenobarb's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    Here's something else cool that I did. It's more of a GUI modification, but it pertains to the sound.

    While I was tracking down why the game always seemed to play the same song, it occurred to me that there is no way to access the music options from the Options drop down on the menu bar. I thought It would be useful to be able to access the music options from the game, so I added it to the list of choices, just under “Sound”.

    To do this, you must:

    1) open keymap.h This file enumerates a type called KEY_FUNCTION. We need to added Music as an enumerator in this type.

    Line 74 reads:
    Code:
    KEY_FUNCTION_SOUND_OPTIONS,
    add:
    Code:
    KEY_FUNCTION_SOUND_OPTIONS,
    // MUSIC added by ahenobarb
    KEY_FUNCTION_MUSIC_OPTIONS,
    2) open keymap.cpp This file is linked to keypress.cpp, which controls what function is executed when the item in the list is clicked. The name within the quotes is that name of the string (ommitting “str_ldl” – I don’t know why) in “ldl_str.txt” to print on the screen [see below].

    on line 54, add:
    Code:
    // MUSIC added by ahenobarb
    { 0, KEY_FUNCTION_MUSIC_OPTIONS, "MUSIC_OPTIONS"},
    3) open keypress.cpp This file tell CTP2 what functions to execute when a key is pressed.

    You need to include the header file for the musicsreen, so on line 90, add:
    Code:
    // music added by ahenobarb
    #include "musicscreen.h"
    musicscreen_displayMyWindow(); is the actual function that causes the music options screen to be displayed. On line 1162, add:
    Code:
    // MUSIC added by ahenobarb
    	case KEY_FUNCTION_MUSIC_OPTIONS:
    		if(!g_modalWindow) {
    			musicscreen_displayMyWindow();
    		}
    	break;
    4) Open controlpanelwindow.cpp, which control the items listed in the drop down menu on the menubar.

    You need to include the header file for the musicsreen, so on line 37, add:
    Code:
    // music added by ahenobarb
    #include "musicscreen.h"
    You need to add music to the list of choices in the menu bar. [It should be noted that line 100 of controlwindowpanel.h enumerates the CP_MENU_ITEM type and limits the menu bar drop down lists to 15 items, if you need more than 15 items, you need to add them to CP_MENU_ITEM.] So in the OptionsMenuCallback function, we need to add “music” as a choice. The switch statement for the “Options” menu begins on line 858. On line 915, add:
    Code:
    	case	CP_MENU_ITEM_12:	
    		musicscreen_displayMyWindow(); 
    		break;
    **** It is not clear whether the function call to “musicscreen_displayMyWindow();” in keypress.cpp or controlpanelwindow.cpp actually calls the music options screen ***

    Further down in the file on line 1063 is a ControlPanelWindow class member named RebuildMenus. The purpose of this function is to print the list items here on the screen, so the user can select them. This class member however is not used in the Debug build of the game, but it may be used in other builds. Therefore, you should add music to the list just in case. On line 1146, add:
    Code:
    // MUSIC added by ahenobarb
    mb->AddMenuItem(menu,(char*)g_theStringDB->GetNameStr("str_ldl_Music"),
    		KeyListItem::GetKeyFromKMScreen(theKeyMap->get_keycode(KEY_FUNCTION_MUSIC_OPTIONS)),(void *)CP_MENU_ITEM_12);
    On line 1355 is a ControlPanelWindow class member named BuildOptionsMenu. This member has the same function as the RebuildMenus member, but it is the one that is actually used in the Debug version of the game. On line 1384, add:
    Code:
    // MUSIC added by ahenobarb
    m_mainMenuBar->AddMenuItem(menu,(char*)g_theStringDB->GetNameStr("str_ldl_Music"),
    		KeyListItem::GetKeyFromKMScreen(theKeyMap->get_keycode(KEY_FUNCTION_MUSIC_OPTIONS)),(void *)CP_MENU_ITEM_12);
    5) The rest is just a matter of adding strings to text files.

    In the “C:…\ctp2_code\ctp” directory open “userkeymap.txt” and add “^m Music” to the bottom of the list

    In the GAME directory “C:…\Call To Power 2\ctp2_data\english\gamedata” not the source code directory, open “Add_str.txt” and add “Str_ldl_MusicHotKey “Ctl+m”” after “…SoundHotKey”

    In “ldl_str.txt” under “#Options Menu Strings”, add “str_ldl_Music “Music”” then search for “str_ldl_SOUND” and underneath “..SOUND” and “..SOUND_OPTIONS” add similar entries for “..Music” – Do not put the text within the quotes in all caps, this is the text that will appear on the screen.

    In “keymap.txt” add at the bottom “^m MUSIC_OPTIONS”

    **** It is important to note that if the string names listed in the .txt files do not agree in case with the string names list in the functions, the game will crash. That means that “ldl_str_MUSIC” listed in the .txt files will cause a crash if the string name is “ldl_str_Music” in the function

    I compiled it and there are no problems. I attached a how-to file for downloading. Good luck!!
    Attached Files Attached Files
    Last edited by ahenobarb; November 9, 2003 at 13:24.

  27. #27
    Martin Gühmann
    Administrator Martin Gühmann's Avatar
    Join Date
    02 Mar 2001
    Location
    Tübingen, Germany
    Posts
    7,246
    Country
    This is Martin Gühmann's Country Flag
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20

    Post

    To be precise there is a way to access the sound window from within the game, just press escape. But of course it has also to be on the drop down menue. And another tip ahenobarb, it is much easier to add your modification if you can provide edited files instaed of plain code.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

  28. #28
    ahenobarb
    Prince ahenobarb's Avatar
    Join Date
    26 Nov 2001
    Posts
    437
    Country
    This is ahenobarb's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    Yes, but what fun would that be?

    At anyrate, I learned how the menu bar is coded, so I can add stuff there later, if I want.

    Attached is a .zip file with the modified code.
    Attached Files Attached Files

  29. #29
    Martin Gühmann
    Administrator Martin Gühmann's Avatar
    Join Date
    02 Mar 2001
    Location
    Tübingen, Germany
    Posts
    7,246
    Country
    This is Martin Gühmann's Country Flag
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20

    Post

    Thank you very much, looks like I can't include it into the nect version of the altered source files pack to many files.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

  30. #30
    ahenobarb
    Prince ahenobarb's Avatar
    Join Date
    26 Nov 2001
    Posts
    437
    Country
    This is ahenobarb's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    16:20
    Huh? Just copy these files over the originals in the Source Directories and recompile (It only takes a minute) then take add_str.txt, ldl_str.txt, and keymap.txt and put them in the game directories. It should work. Of course, if you have added your own strings to these .txt files you can cut and paste them in.

    Of course, I may not be understanding your problem correctly. Let me know if I can help.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 7
    Last Post: May 12, 2009, 15:01
  2. Replies: 13
    Last Post: March 12, 2008, 13:54
  3. Replies: 31
    Last Post: May 8, 2005, 12:10
  4. DEBUG: about the sound...
    By jonwil in forum CtP2 Source Code Project
    Replies: 4
    Last Post: November 3, 2003, 23:39
  5. debug.txt
    By VetLegion in forum Civilization I and Civilization II
    Replies: 2
    Last Post: May 14, 2000, 07:18

Visitors found this page by searching for:

civilization 5 mss32.dll

mss32 civilization 5 gods & kings

civ 5 mss32.dll

mss32.dll civ 5

sucess sound

mss32.dll civ v

Dsound mss32

Dsound ve mss32

mss32.dll civ

mss32 rad game tool source code

mss32.dll civilization

_inmm.dll call to power 2

issues with forum.phun.org

mss32.dll civilization 5 gods kings

mss32.dll galciv

mss32.dll knight online pvp

code debugging using sound

civilization v mss32.dll

mss32.dll civ5

sound mss32.lib

civilization 5 mss.dll

mss32 civ 5

hanhonghee

civ 5 debug

_inmm repeat

Bookmarks

Posting Permissions