Re: [stella] 2600 Sound, that time of year..

Subject: Re: [stella] 2600 Sound, that time of year..
From: "Andy Mucho" <andy@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 1 Aug 2003 19:07:13 +0100
Eckhard Stolberg wrote:
> z26 does emulate digitized sound properly. The reason why your program
> still fails is because you don't do any VSYNC yet. There is a small
> oversight in the way how we calculate the frame rate. If the emulator
> has to interrupt the frame on it's own, because the game doesn't do
> a VSYNC in time, we forgot to update the line number counter. Therefore
> z26 creates sound buffers for a frame with 320 scanlines in your
> demo, but doesn't wait long enough to have them fully played.

Oh I see, that kind of makes sense now..

> This will be fixed in the next version of z26. Until then you can use
> the -r49 command line switch. This will force the correct frame rate
> for your demo. Additionally you can try to adjust the sample buffer
> size, if you still have problems on your system.

Yup, that certianly seems to work a bit better now :)

> If you find any other bugs in z26, it would be nice, if you could
> provide us with source code as well as a binary of the program that
> doesn't work properly.

I didn't realise this was a bug.. After deciding to have a hunt through the
Z26 source i saw how the Pitfall2 stuff was hooked in, and assumed that
since PF2s own read from the DPC and stuff onto AUDV was worked around by
overirding the output of that channel with the DPCs music channel result,
that this was because sampled sound simply didn't/wouldn't work properly..
My mistake..

So I'm curious now, if with a correct frame time and VSYNC at the right
time, why does Pitfall2 still require a special work around ?

> your current demo you don't seem to initialize anything. You just
> rely on the default state of the VCS. While this properly set for
> sample playback in the emulators and the CC/SC, that might not be
> the case with a normal cartridge on a real system.

My bad.. It was only a quick little test rig to test this code on...

> If the trace feature in z26 doesn't help you to find your bug, you
> could try PCAE. It has a simple debugger that provides most of the
> features from your withlist.

The z26 trace isn't exactly what I had in mind, though it has been useful at

But, PCAE, I'm grabbing that now, looks promising, but I think in the
immediate future I'm going to implement it into my own sound emu, just so I
can add more music/sound specific features as well as a 2600 triggered write
debug output into a debugger window, jsut so I can debug somewat sensibly,
and you know what ? It'll be fun to write as well :)

thanks a lot for the help here Eckhard, hopefully one day I can contribute
something back to the community, but for now it's back to a world of SID
tunes, and dreams of making the 2600 sound a bit like that, whilst doing
something useful(ish) on-screen :)

back to the programming now :)

thanks a lot..


Archives (includes files) at
Unsub & more at

Current Thread