Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

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


    Wolf4SDL with PC speaker sound emulation

    Share

    ljbade
    Wolf3d n00b
    Wolf3d n00b

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

    Wolf4SDL with PC speaker sound emulation

    Post by ljbade on 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
    avatar
    stathmk
    Veteran
    Veteran

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

    I've found the files

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

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

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

    Zophar.net

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

    Leith, should we submit these files to http://www.zophar.net/windos.html for emulation? Ill give credit to Leith Bade & Chocolate Doom.

    ljbade
    Wolf3d n00b
    Wolf3d n00b

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

    Re: Wolf4SDL with PC speaker sound emulation

    Post by ljbade on 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
    Princess Peach
    Can I Play, Daddy?
    Can I Play, Daddy?

    Female
    Number of posts : 30
    Age : 13
    Location : Canada
    Registration date : 2017-01-28

    Re: Wolf4SDL with PC speaker sound emulation

    Post by Princess Peach on 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
    avatar
    stathmk
    Veteran
    Veteran

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

    Thanks for the video.

    Post by stathmk on 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
    Princess Peach
    Can I Play, Daddy?
    Can I Play, Daddy?

    Female
    Number of posts : 30
    Age : 13
    Location : Canada
    Registration date : 2017-01-28

    Re: Wolf4SDL with PC speaker sound emulation

    Post by Princess Peach on 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;
    avatar
    stathmk
    Veteran
    Veteran

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

    Thanks for the videos.

    Post by stathmk on 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

    Re: Wolf4SDL with PC speaker sound emulation

    Post by Sponsored content


      Current date/time is Tue Jun 19, 2018 2:59 pm