Pinball Fantasies PC-speaker intro

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ • 20

  • @Roxor128
    @Roxor128 4 роки тому +31

    For anyone wondering how you can get sound this good out of the PC Speaker, it's down to making clever use of the timer chip that drives the speaker to implement pulse-width modulation.
    The timer chip has two modes that are useful for making sound: square waves and a single-shot mode that makes the output high until the timer runs out, then turns it low until reset by a software command. Square wave mode is cheap and what's used for most PC Speaker sound effects, as you only need to write to the chip when you want the frequency changed.
    PWM is very different. In this case, you use the single-shot mode and change the value used every time you reset it, and you reset it very frequently. How frequently? Well, that depends on your output sample-rate. 16kHz is pretty typical. Contrast it to square-wave mode usage where 140Hz is a common frequency to change settings. Not even 1% of the PWM rate.
    The catch with implementing PWM is that you need to be precise about your timing, and that ends up being very CPU-intensive. You have no DMA, so you have to do the timing yourself. Coming up with a way to do both PWM and running a game is really impressive.

    • @tubestos
      @tubestos 3 роки тому +7

      Whoa, I've been wondering about this for almost 30 years now. Finnally an answear! Thank you.

  • @justanotheryoutubechannel
    @justanotheryoutubechannel 4 роки тому +11

    THIS IS PC SPEAKER!? HOLY CRAP

    • @adraacg
      @adraacg 4 роки тому

      Yep.

    • @Roxor128
      @Roxor128 4 роки тому +2

      Yep. PWM by the sounds of it. I'm impressed the developers were able to find enough CPU to do it and still run a game.

    • @LOveERDos
      @LOveERDos 3 роки тому

      To in the sinclair spectrum i remaber Game with realistic sound effects

  • @gurujoe75
    @gurujoe75 Рік тому +2

    This is a technique commonly used on the 8 bit ZX spectrum, which in the base had no audio HW, only a 1 bit "PC speaker" fully controlled by the CPU. If the entire 3.5Mhz CPU power was used for PCM audio, something similar to the Pinball on the i386 was created.
    ua-cam.com/video/1eW39C1hQgU/v-deo.html
    ua-cam.com/video/yJy45MHrPjc/v-deo.html
    Let's say the 3.5Mhz Spectrum is equivalent to about 2Mhz of that i386. In ASM code, this is a manageable audio technique even during gameplay. CPU at 33Mhz can handle it.

  • @robertbecskei4561
    @robertbecskei4561 2 роки тому +2

    Pure Magic it was ... Pure Magic

  • @Zodroo_Tint
    @Zodroo_Tint 3 роки тому

    Thank you for not shakily handholding a stupidphone in an angle while making the video.

  • @pycur
    @pycur 5 років тому +4

    Some other games and software also could use the speaker like this. Pinball Illusions' intro music was my favorite track, that also played through the speaker. And the popular impulse tracker also played many tracked music. Do you know gasmask chapter 2? Or church of house? That was the sound at that times... :) You may find them on the modarchive.

  • @LOveERDos
    @LOveERDos 3 роки тому

    To alone in the dark was impressive sound effect Just with pc speaker

  • @SeñorDossierOficial
    @SeñorDossierOficial 6 років тому +11

    Sounds amazing for a pc speaker owo

    • @Roxor128
      @Roxor128 4 роки тому +3

      More amazing is that they were able to have the game playable while playing back PWM audio. It's amazing because the technique requires precise timing of writing to the timer chip that runs the speaker, and that tends to be really heavy on the CPU, yet somehow they managed to not only mix a 4-channel MOD file, but take user inputs and draw full-screen graphics for the game as well. When I say it's heavy on the CPU, I mean it. The famous 8088MPH demo uses it in the closing credits (the rest of the music being cheap beeps), and after mixing the music and playing it through the speaker, only has enough CPU time left over on an 8088 to put a few text-mode characters on the screen.

  • @LOveERDos
    @LOveERDos 3 роки тому +1

    Why all games don’t use this Technology at the time . No adlib or sound blaster needed

    • @agevenisse3252
      @agevenisse3252  3 роки тому +4

      It required good programming skills since the PC speaker has no DMA (direct memory access). It usually stalls the CPU while playing back PCM audio. Also, the sound quality and loudness is very limited in a PC-speaker. But it was impressive at the time. I played the game on my first PC, a 40 MHz AMD 386, and it was very smooth even with the highest audio quality selected.

  • @El_Ucca
    @El_Ucca 3 роки тому +2

    I never understood how this was possible. And why no one else was able to pull it off.

    • @eng3d
      @eng3d 3 роки тому

      It is because it used so much CPU. You should check the game Mach 3.

  • @JohnGames-gz7ue
    @JohnGames-gz7ue 2 роки тому +1

    Are you sure you didn’t select a sound card on accident? This sounds fuckin amazing

    • @agevenisse3252
      @agevenisse3252  2 роки тому

      Yep, I'm using a standard PC-speaker (0,5w). The sound was recorded using the built-in camera mic.
      I have a newer video (gameplay) with better sound. The mic was placed next to the PC speaker this time.

  • @losspol_3466
    @losspol_3466 3 роки тому

    I am shocked this is a PC Speaker doing all this