Now you're playing with gauss!

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Drag
Posts: 1638
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Now you're playing with gauss!

Post by Drag »

Zoop sounds glitched, like the melody is dropping notes. I know the sound engine in Zoop is a really crazy MIDI-style round-robin allocator, so that means the channels are allocated and initialized as notes are needed, meaning each channel is frequently switching samples and envelopes and properties, versus other engines that have channels organized by instrument or sequence.
User avatar
jwdonal
Posts: 719
Joined: Sat Jun 27, 2009 11:05 pm
Location: New Mexico, USA
Contact:

Re: Now you're playing with gauss!

Post by jwdonal »

Okay, so I _definitely_ did not get an email notification for Drag's post. Wtf? I unsubscribed and re-subscribed to this thread. Maybe that will help...
Drag wrote:Zoop sounds glitched
If it actually is then it's most likely due to one of the features I'm missing. Either way, Blargg's SPC emulator output wave file for the same SPC sounds identical to mine (I've modified his emulator to have the same missing features as mine). In either case if it is glitchy it'll all be fixed in the near future.
Drag wrote:I know the sound engine in Zoop is a really crazy MIDI-style round-robin allocator
This is almost certainly irrelevant as far as the hardware is concerned. The hardware doesn't become more/less complicated just because some developer made the SPC-700 software driver "really crazy". The hardware is always the same regardless of the sound engine driving it. The sound engine could be trying to determine if P=NP for all I care. ;)
lidnariq
Site Admin
Posts: 11584
Joined: Sun Apr 13, 2008 11:12 am

Re: Now you're playing with gauss!

Post by lidnariq »

jwdonal wrote:Okay, so I _definitely_ did not get an email notification for Drag's post. Wtf? I unsubscribed and re-subscribed to this thread. Maybe that will help...
(off topic) I stopped getting email notifications of PM arrivals about 30 hours ago (last one that arrived was at 19h29 EDT). And I know I'm not running any kind of filtering at all.
KungFuFurby
Posts: 283
Joined: Wed Jul 09, 2008 8:46 pm

Re: Now you're playing with gauss!

Post by KungFuFurby »

User avatar
jwdonal
Posts: 719
Joined: Sat Jun 27, 2009 11:05 pm
Location: New Mexico, USA
Contact:

Re: Now you're playing with gauss!

Post by jwdonal »

Sure. I'd be happy to make some recordings. But I don't have time to record all the tracks from all of those sets. (At least not until I get some automation set up.) If you want to suggest 1 particular track from each set I can do that.

And I definitely appreciate suggestions for "challenging" SPCs! Any other suggestions are welcome.
KungFuFurby
Posts: 283
Joined: Wed Jul 09, 2008 8:46 pm

Re: Now you're playing with gauss!

Post by KungFuFurby »

Here's my selection for each one...

Clay Fighter 2 ~ Main Menu

Mickeys Playtown Adventure ~ Title Screen

Shin Togenkyo ~ Main Menu

We're Back! A Dinosaur's Story ~ Title Screen
Drag
Posts: 1638
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Now you're playing with gauss!

Post by Drag »

If Zoop dropping notes is caused by a missing feature, let me know which feature it is since I have no idea what would cause it. Claymates has a similar round-robin allocator for its music engine, so if that's dropping notes too then it's the same glitch.

I only mention it because round-robin allocators are quite different from what most SNES soundtracks use. For instance, if you solo a channel in SMW, you get a single instrument playing a single sequence. If you solo a channel from Zoop or Claymates, you get a bunch of random notes from all instruments.
tepples
Posts: 22796
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Now you're playing with gauss!

Post by tepples »

Drag wrote:Zoop sounds glitched, like the melody is dropping notes. I know the sound engine in Zoop is a really crazy MIDI-style round-robin allocator
Aladdin is glitched as well, but it's always the bass because Aladdin doesn't use round-robin allocation. Your mixer might be missing a channel. Try finding which channel Aladdin plays the bass on, then mute that channel in Zoop and see if it produces the same pattern of missing notes.

The comparison to Claymates is apt because one of the unused samples buried in Zoop sings "Clay Fighter". (This sample isn't even used in the hidden track in Zoop that sounds vaguely like "Blister in the Sun".) This leads me to believe it uses an engine similar to Interplay's ARDI (Advanced Realtime Dynamic Interplay) engine, and a Nintendo Power story heavily implied that ARDI is MIDI-based. (The article might have used the name ARDISS for ARDI Sound System.) So did an article in SNES Force.
User avatar
jwdonal
Posts: 719
Joined: Sat Jun 27, 2009 11:05 pm
Location: New Mexico, USA
Contact:

Re: Now you're playing with gauss!

Post by jwdonal »

Welp, attempting to play KungFuFurby's track selections was...umm...far less than what one would call "successful". LOL. Each of the tracks (except for Togenkyo) played for a few seconds each and then died a very horrible death. Togenkyo didn't even play a single note. :) Haha.

Ironically, I am incredibly excited about this! It's fantastic to have these difficult tracks available to test with. I will keep working on my player and adding the rest of the features and squashing more bugs and will keep trying these (and Aladdin and Zoop) until they work flawlessly.

I love this community. Thanks all!
KungFuFurby
Posts: 283
Joined: Wed Jul 09, 2008 8:46 pm

Re: Now you're playing with gauss!

Post by KungFuFurby »

You've run into the same killer that SNESAmp ran into. Shin Togenkyo is especially noteworthy for me, because it also failed in some of my more current SPC players (an older version of Audio Overload was successful in playing this song), although it usually fails after a few seconds rather than right off the bat (or after a single note). I didn't expect Shin Togenkyo to fail so horribly, though.

My instincts are as following...

- ENDX may be used for individual samples. Failure to emulate this might be what is causing channel allocation to fail on the Visual Concept games. Plus, these might not even keyed off, meaning allocation is really dependent on those samples stopping.

- For Shin Togenkyo, make sure you're emulating both memory wraparound and register wraparound correctly. Memory should be 16 bits, not 32+ bits (and thus should wrap around to zero rather than overflow), and registers should be 8 bits (and thus should also wrap around). There may also be an opcode that you failed to implement (almost all opcodes don't outright crash the SPC700... unless it's SLEEP or HALT).
User avatar
jwdonal
Posts: 719
Joined: Sat Jun 27, 2009 11:05 pm
Location: New Mexico, USA
Contact:

Re: Now you're playing with gauss!

Post by jwdonal »

Ok, so I spent all of 5 seconds looking at the CPU execution debug output of the Togenkyo track (before I had to run to work) and found something very strange... (Again, I haven't delved into this yet, this is just my cursory 5 second assessment of this one track.)

The thing I noticed is that the SPC file's restore state value for the SPC-700's stack pointer register is 0x00. And almost immediately after starting execution the code executes the CALL instruction which pushes the high and low program counters to the stack. So the reason that it didn't play a single note on my emulator was because the program is pushing to a full stack which causes my emulator to report and error message and lock up permanently (by design).

Any thoughts on this?

Also, thank you for your thoughts on what you think the issues were with these tracks I'm sure they will be very helpful in my debugging efforts.
tepples
Posts: 22796
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Now you're playing with gauss!

Post by tepples »

SPC700 is largely a 65C02 clone. Does it work if you let the stack pointer wrap around from $00 to $FF, as it does on the 65C02?
User avatar
jwdonal
Posts: 719
Joined: Sat Jun 27, 2009 11:05 pm
Location: New Mexico, USA
Contact:

Re: Now you're playing with gauss!

Post by jwdonal »

I will definitely test that out once I get home.

But...am I wrong or isn't the more important question why the program is pushing to a full stack in the first place? That would seem like either a coding error or possibly a dumping error (i.e. incorrect restore state)? I'm just throwing out ideas.
tepples
Posts: 22796
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Now you're playing with gauss!

Post by tepples »

The stack on a 6502 processor is empty descending, meaning a push decrements the stack pointer ("descending") and the stack pointer points to the first address past the valid data ("empty"). Apparently the stack pointer on the SPC700 behaves the same way as that of the 6502. If the SPC700 stack were full descending instead of empty descending, $00 would mean an empty stack.

Perhaps it was just sloppy programming by someone who came from a platform with a full descending stack, in which the stack pointer is decremented before the pushed value is written. Both major 8080 descendant families, including Z80 and x86, use a full descending stack. The vaguely x86-like Sony syntax used by "standard" SPC700 assembly language might have helped with this confusion, which I guess is part of why I prefer 65C02 syntax. ARM also uses a full descending stack, where PUSH is a synonym for STMDB (STore Multiple, Decrease Before) or STMFD (STore Multiple to Full Descending stack), and POP is a synonym for LDMIA (LoaD Multiple, Increase After) or LDMFD (LoaD Multiple from Full Descending stack). This is merely by convention in ARM, but Thumb is hardwired to full descending.
KungFuFurby
Posts: 283
Joined: Wed Jul 09, 2008 8:46 pm

Re: Now you're playing with gauss!

Post by KungFuFurby »

Native SPC700 syntax is Z80-like to my eyes, actually.

The IPL boot routine by default initializes the stack pointer to $EF. I also think the stack pointer should have wraparound implemented.
Post Reply