Improving APU code

I was working on improving the APU side of the nes2pce projects (audio emulation). I’ve kinda neglected this for a while, so it’s time to sit down and get it more up to speed with the rest of the backend code.

In the process, I decided that I wanted to do some stereo separation of the channels. But I couldn’t quite figured out what sounded best. Sometimes it sounds best when all channels have hard left/right separation and somethings it sound better when only  the lead channels do. And at that, the volume levels sound better at times – louder when hard panned left/right. As I have it right now, most of the channels are not full volume. Only the triangle is (because it’s a soft sound). The leads are set at ~66% volume, triangle at %100, and noise at ~45%.

What I’ve decided, is that I’m gonna let you guys decided. In other words, I’m gonna do a menu at start up that lefts you configure it for the game (for that instance). I’ll add a few quick preset modes, classic mode, and a fully customize mode.

For games that don’t use DPCM (which I’m probably not going to emulation per se, but I will hack support for those samples into each game individually. Jackal and Castlevania are two that need it), I’m going to add the option of allowing ‘echo’ of the two pulse channels – on the two spare PCE channels. I’ll have presets for this as well, and custom control for it. For games that support it, I’ll add an option to sync the echo to the tempo of the current playing song.

I have some other ideas as well. One is to allow sound FX to play on the spare channels, rather than interrupting the main music channels. Some people have thought this was the case already, lol – but it’s not. I have improved nothing in any of the nes2pce releases – as far as PSG sounds go. If you think they sound better, couldn’t tell ya why. Anyway, this is also highly game dependent, but from what I’ve done with Megaman 1 (redbook hack with PSG sound FX)- I think it would be fairly easy to do with other games.

I’m still working on the echo code. So I don’t know exactly how it will sound, but I will put in the option of how long the delay is for the echo channels and what volume they should play at. Right now, I have the max delay available at about 1 second (60 frames), with the minimum at one frame. 1 second is kind of overkill, so I might shorten that to 30frames as the longest (half a second).

Not exactly APU related, but I had also thought of an idea to let players control a ‘slowdown’ option. Aka, introduce fake additional overhead back into the game. These nes2pce conversions tend to run much faster than the NES counter parts, simple because the processor on the PCE that’s running the NES code (literally) is running full 7.16mhz. Even with the backend emulation code overhead, it still comes out faster in the end. I first noticed this in the Megaman games; no slowdown. Jackal also has a lot of slowdown on the NES that’s absent from the PCE conversion – actually making the game harder – lol. Of course, this isn’t a high priority for me right now. Flicker of course, is an entirely different matter all together. The flicker is.. in a way, artificial. But I don’t have any real control over this. Both SAT (sprite attribute table) length and scanline pixel limit. To emulate NES sprites, I waste a lot of PCE sprite bandwidth. While it doesn’t introduce ‘more’ flicker, sometimes (like Megaman games) – there’s no benefit. Games that use NES 8×16 sprites get a nice benefit – but it’s not full PCE bandwidth. Of course, if you guys really cared about this – you could just play the roms on a PC emulator and turn off the sprite limit.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: