Communication protocol with S-SMP over $2140

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
User avatar
rainwarrior
Posts: 7669
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Communication protocol with S-SMP over $2140

Post by rainwarrior » Wed Jul 26, 2017 9:59 am

SNSF does sound like it's heading in that direction.

I was thinking also of how using the Winamp plugin API works by filling out a table of function pointers. You might look at it for reference as to what a music player might need:
https://github.com/bbbradsmith/nsfplay/ ... /sdk/IN2.H

The thought was just that specifying an interface layer directly as S-SMP communication is too deep; you've got a lot more constraints down there than at the CPU level, where you have a ton of flexibility.

You could write the CPU side player protocol on top of any existing engine (this is what I was comparing the NSF INIT stub to), and that player interface code doesn't have to be directly part of the engine or its code, so it's not an encumbrance to it.

As far as IPL recovery, it seems to me that any engine that can upload arbitrary data should be able to get back to that, shouldn't it? (How do SPC players on the SD2NES/PowerPak manage to switch tracks without a reset?)

lidnariq
Posts: 8776
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Communication protocol with S-SMP over $2140

Post by lidnariq » Wed Jul 26, 2017 10:58 am

rainwarrior wrote:How do SPC players on the SD2NES/PowerPak manage to switch tracks without a reset?
Super PowerPak has the ability to drive /RESET.

Revenant
Posts: 440
Joined: Sat Apr 25, 2015 1:47 pm
Location: FL

Re: Communication protocol with S-SMP over $2140

Post by Revenant » Wed Jul 26, 2017 11:41 am

That's what the sd2snes does, as well.

tepples
Posts: 21748
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Communication protocol with S-SMP over $2140

Post by tepples » Wed Jul 26, 2017 11:59 am

But a production Game Pak does not.

I was referring to something at roughly this level:

Command: No operation
(Must be performed between operations with the same ID number)
write NO_OPERATION to $2140
wait for $2140 to equal NO_OPERATION

Command: Start track
write track number to $2141
write START_TRACK to $2140
wait for $2140 to equal START_TRACK

Command: Play sound effect
write sound effect ID to $2141
write volume to $2142
write pan to $2143
write PLAY_SOUND_EFFECT to $2140
wait for $2140 to equal PLAY_SOUND_EFFECT
read the voice number from $2141 for later use, such as to stop a looping effect

Command: Exit to IPL
write EXIT_TO_IPL ($AA) to $2140
wait for $2140=$AA

Post Reply