Wolf3d Haven Forum

Please log in or register. Smile

Join the forum, it's quick and easy

Wolf3d Haven Forum

Please log in or register. Smile

Wolf3d Haven Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


5 posters

    Wolf4SDL with PC speaker sound emulation

    avatar
    ljbade
    Wolf3d n00b
    Wolf3d n00b


    Number of posts : 9
    Age : 34
    Registration date : 2010-04-10

    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Wolf4SDL with PC speaker sound emulation

    Post by ljbade Sat Apr 10, 2010 5:53 pm

    First topic message reminder :

    Hi,

    I have created a version of Wolf4SDL that now has PC speaker emulation based on the code in Chocolate Doom.

    Could people please test it and tell me what you think (bugs/issues/suggestions etc.)!

    If it works OK I will see if I can submit it to the Wolf4SDL author (as this feature is on his TODO list).
    Also anyone know if the Wolf4SDL guy is still around? No updates to his website since 20008...

    Otherwise I might create a fork on Google Code where people can implement any bug fixes/tweaks/features etc that they want in the codebase...

    Here is the compiled file: (built for Activision Wolf3D)
    http://www.leithalweapon.geek.nz/Wolf4SDL-1.6-PC-speaker.zip

    Leith
    stathmk
    stathmk
    Veteran
    Veteran


    Male
    Number of posts : 1780
    Age : 43
    Location : Indiana, United States
    Job : fast food worker & wolfensteingoodies.com webmaster
    Hobbie : old games & young dames
    Registration date : 2008-04-08

    Wolf4SDL with PC speaker sound emulation - Page 1 Empty I've found the files

    Post by stathmk Sat Feb 11, 2017 9:12 am

    I did a scan of my computer & external hard drives overnight & found the files.
    Attachments
    Wolf4SDL with PC speaker sound emulation - Page 1 AttachmentWolf4SDL-1.6-PC-speaker.zip
    Wolf4SDL-1.6-PC-speaker.zip
    You don't have permission to download attachments.
    (384 Kb) Downloaded 3 times
    Wolf4SDL with PC speaker sound emulation - Page 1 AttachmentWolf4SDL-1.6-apogee-pc-speaker.zip
    Wolf4SDL-1.6-apogee-pc-speaker.zip
    You don't have permission to download attachments.
    (385 Kb) Downloaded 3 times
    Wolf4SDL with PC speaker sound emulation - Page 1 Attachmentpc-speaker.zip
    pc-speaker.zip
    You don't have permission to download attachments.
    (3 Kb) Downloaded 3 times
    stathmk
    stathmk
    Veteran
    Veteran


    Male
    Number of posts : 1780
    Age : 43
    Location : Indiana, United States
    Job : fast food worker & wolfensteingoodies.com webmaster
    Hobbie : old games & young dames
    Registration date : 2008-04-08

    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Zophar.net

    Post by stathmk Sat Feb 11, 2017 9:30 am

    Leith, should we submit these files to http://www.zophar.net/windos.html for emulation?  I’ll give credit to Leith Bade & Chocolate Doom.
    avatar
    ljbade
    Wolf3d n00b
    Wolf3d n00b


    Number of posts : 9
    Age : 34
    Registration date : 2010-04-10

    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Re: Wolf4SDL with PC speaker sound emulation

    Post by ljbade Sat Feb 11, 2017 10:45 am

    Yes that is fine. Next week I'll see if I can submit a PR to that GitHub repository.
    avatar
    Guest
    Guest


    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Re: Wolf4SDL with PC speaker sound emulation

    Post by Guest Fri Feb 24, 2017 8:47 am

    Thanks stathmk for the 1.6 exe. From what I can tell, the higher pitched PC Speaker sounds in it play a rate that is too fast, which makes for an interestingly unique experience.



    https://youtu.be/oNOfRM3HZOA

    Has any updates been made on the code since? Maybe I'll try to slow them down later and see what they sound like Smile
    stathmk
    stathmk
    Veteran
    Veteran


    Male
    Number of posts : 1780
    Age : 43
    Location : Indiana, United States
    Job : fast food worker & wolfensteingoodies.com webmaster
    Hobbie : old games & young dames
    Registration date : 2008-04-08

    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Thanks for the video.

    Post by stathmk Fri Feb 24, 2017 11:50 am

    Princess Peach wrote:Thanks stathmk for the 1.6 exe. From what I can tell, the higher pitched PC Speaker sounds in it play a rate that is too fast, which makes for an interestingly unique experience.



    https://youtu.be/oNOfRM3HZOA

    Has any updates been made on the code since? Maybe I'll try to slow them down later and see what they sound like Smile
    Thanks for the video.  I don't know if any updates have been made to the code since.
    avatar
    Guest
    Guest


    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Re: Wolf4SDL with PC speaker sound emulation

    Post by Guest Fri Feb 24, 2017 4:27 pm

    Thanks. I fixed the speed issue by moving "current_remaining" outside the if statement (otherwise it skips the pauses).

    Before:
                if(pcSound)
                {
                    if(*pcSound!=pcLastSample)
                    {
                        pcLastSample=*pcSound;

                        if(pcLastSample)
                            // The PC PIC counts down at 1.193180MHz
                            // So pwm_freq = counter_freq / reload_value
                            // reload_value = pcLastSample * 60 (see SDL_DoFX)
                            current_freq = 1193180 / (pcLastSample * 60);
                        else
                            current_freq = 0;

                        // The PC speaker sample rate is 140Hz (see SDL_t0SlowAsmService)
                        current_remaining = param_samplerate / 140;

                    }

    After:
                if(pcSound)
                {
                    // The PC speaker sample rate is 140Hz (see SDL_t0SlowAsmService)
                    current_remaining = param_samplerate / 140;


                    if(*pcSound!=pcLastSample)
                    {
                        pcLastSample=*pcSound;

                        if(pcLastSample)
                            // The PC PIC counts down at 1.193180MHz
                            // So pwm_freq = counter_freq / reload_value
                            // reload_value = pcLastSample * 60 (see SDL_DoFX)
                            current_freq = 1193180 / (pcLastSample * 60);
                        else
                            current_freq = 0;
                    }

    I also got rid of the "phase smoothing" because it sounds less cheezy and more authentic without it.  Smile

    Before:
                if (current_freq != 0)
                {
                    // Adjust phase to match to the new frequency.
                    // This gives us a smooth transition between different tones,
                    // with no impulse changes.

                    phase_offset = (phase_offset * oldfreq) / current_freq;
                }

    After:
                    phase_offset = 0;



    https://www.youtube.com/watch?v=oac-tZHHzes


    edit: Barry also found out that removing the last NOTYET wasn't a good idea because Digi doors stop making sounds
             }
             else
             {
    -#ifdef NOTYET

                 if (s->priority < DigiPriority)
                     return(false);
    -#endif
     
                 int channel = SD_PlayDigitized(DigiMap[sound], lp, rp);
                 SoundPositioned = ispos;
    stathmk
    stathmk
    Veteran
    Veteran


    Male
    Number of posts : 1780
    Age : 43
    Location : Indiana, United States
    Job : fast food worker & wolfensteingoodies.com webmaster
    Hobbie : old games & young dames
    Registration date : 2008-04-08

    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Thanks for the videos.

    Post by stathmk Sat Feb 25, 2017 11:07 am

    Princess Peach wrote:Thanks. I fixed the speed issue by moving "current_remaining" outside the if statement (otherwise it skips the pauses).

    Before:
                if(pcSound)
                {
                    if(*pcSound!=pcLastSample)
                    {
                        pcLastSample=*pcSound;

                        if(pcLastSample)
                            // The PC PIC counts down at 1.193180MHz
                            // So pwm_freq = counter_freq / reload_value
                            // reload_value = pcLastSample * 60 (see SDL_DoFX)
                            current_freq = 1193180 / (pcLastSample * 60);
                        else
                            current_freq = 0;

                        // The PC speaker sample rate is 140Hz (see SDL_t0SlowAsmService)
                        current_remaining = param_samplerate / 140;

                    }

    After:
                if(pcSound)
                {
                    // The PC speaker sample rate is 140Hz (see SDL_t0SlowAsmService)
                    current_remaining = param_samplerate / 140;


                    if(*pcSound!=pcLastSample)
                    {
                        pcLastSample=*pcSound;

                        if(pcLastSample)
                            // The PC PIC counts down at 1.193180MHz
                            // So pwm_freq = counter_freq / reload_value
                            // reload_value = pcLastSample * 60 (see SDL_DoFX)
                            current_freq = 1193180 / (pcLastSample * 60);
                        else
                            current_freq = 0;
                    }

    I also got rid of the "phase smoothing" because it sounds less cheezy and more authentic without it.  Smile

    Before:
                if (current_freq != 0)
                {
                    // Adjust phase to match to the new frequency.
                    // This gives us a smooth transition between different tones,
                    // with no impulse changes.

                    phase_offset = (phase_offset * oldfreq) / current_freq;
                }

    After:
                    phase_offset = 0;



    https://www.youtube.com/watch?v=oac-tZHHzes


    edit: Barry also found out that removing the last NOTYET wasn't a good idea because Digi doors stop making sounds
             }
             else
             {
    -#ifdef NOTYET

                 if (s->priority < DigiPriority)
                     return(false);
    -#endif
     
                 int channel = SD_PlayDigitized(DigiMap[sound], lp, rp);
                 SoundPositioned = ispos;
    Thanks for the videos.  The sounds brought back memories from 1992 & 1993.  What did you do to show the maps on the screen in the first video?

    Sponsored content


    Wolf4SDL with PC speaker sound emulation - Page 1 Empty Re: Wolf4SDL with PC speaker sound emulation

    Post by Sponsored content


      Current date/time is Fri Apr 19, 2024 12:31 am