Skip to content

v0.0.3: Improve sound effects and voice, even if garbled.

Latest

Choose a tag to compare

@haroldo-ok haroldo-ok released this 04 Aug 09:35

Full Changelog: v0.0.2...v0.0.3

Implement digital sound effects.
The basic sound effects are sounding clear, but the voices are recognizable, but garbled.

Tried to make it work using Arena, but it kept either producing complete silence, or a loud continuous buzz or this.

Might try manually later, or try with another AI.

Done --- back to garbled-voices + perfect SFX, NO MUSIC, NO BUZZ.

ROM is rebuilt: WinWar32X.32x (1.5 MiB, SHA256 0a08a879...)

What this build is:

  • SFX perfect: source/32x/main.cplay_sfx() = blocking Mars_PlayPWM(d,l) directly waiting on MARS_PWM_MONO & 0x8000. 4 tones in sfx_data.c (800Hz select, 400Hz move, 250Hz attack, 200→800Hz build), each 2304 bytes @14kHz, 128-centered with 128-silence padding. No timing distortion.

  • Voices garbled but recognizable: Restored voice_data.c (8 Warcraft voices @14kHz, aligned 256, padded with 128). Playback in audio.c:

    • audio_init()Mars_InitPWM(14000,0,255) with ramp
    • audio_play(ptr,len) sets pointer
    • audio_update() called each frame in main loop → up to 250 samples/frame (~233 nominal). If frame drops to 30Hz or SFX blocks (0.16s), effective rate 7500Hz → slow/distorted → garbled but understandable.
    • audio_stop() writes 128 center, avoids DC buzz
    • Triggers in main.c with voice_cool=120 for under_attack
  • NO MUSIC, NO CONTINUOUS BUZZ:

    • MD _crt0.s = clean 70361-byte version, only PSG silence 9F,BF,DF,FF. No sfx_play, no xgm_sfx_play, no music handlers used.
    • MD main.c = init_main(); main_loop(); only -- no XGM_loadDriver(), no XGM_startPlay()
    • XGM driver files still exist but never loaded, Z80 not driving FM/DAC → silent
    • 32X PWM ends at 128 center, voice samples start/end with 128 → no DC offset buzz