It is currently Sat Apr 21, 2018 12:31 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
PostPosted: Sat Dec 16, 2017 12:07 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 363
Location: FL
As far as I'm aware Lost Vikings is one of a small number of games that preload all the samples into audio RAM like normal, but stream note events etc. to the chip on a per-frame basis. I don't think there's any real-time sample streaming or anything like that happening.


Top
 Profile  
 
PostPosted: Sat Dec 16, 2017 1:14 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2603
I'm surprised more games didn't use that because it simplifies music programming a lot.


Top
 Profile  
 
PostPosted: Sat Dec 16, 2017 1:27 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19924
Location: NE Indiana, USA (NTSC)
Running the music engine on the S-SMP instead of the S-CPU has several advantages.

  1. The S-SMP has access to fine time bases, from 125 Hz on up. The S-CPU would normally be limited to the S-PPU's 60.1 or 50.0 Hz time base unless it uses VTIME, and VTIME is usually in use anyway for graphics. This means more precise tempo.
  2. Because the time base is independent of the S-PPU, the program running on the S-SMP does not need adjustment for NTSC or PAL-M on the one hand vs. PAL on the other.
  3. Running audio on the S-SMP frees up the S-CPU for game logic rather than music logic and waiting for the S-SMP to acknowledge every note, program change, pitch bend, and control change.
  4. Linear-pitch portamento and vibrato need multiplication, as does volume adjustment. The SPC700 has a multiplier, but the 65816 relies on an interrupt-unsafe MMIO for multiplication.

There isn't even the drawback of a drastically different programming model, as there is with the Z80 and 68000 on the Genesis or contemporary arcade system boards. The 65816 is a 65C02 with 16-bit registers, and the SPC700 is approximately a 65C02 with rearranged opcode numbers.

The one drawback is that you lose maybe 8K of audio RAM for the player and the current song's order table and pattern data.


Top
 Profile  
 
PostPosted: Sat Dec 16, 2017 1:31 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3246
Location: Nacogdoches, Texas
@psychopathicteen I've wondered the same thing. However, with how much most early SNES game slow down, the music would fall apart.

tepples wrote:
Running the music engine on the S-SMP instead of the S-CPU has several advantages.

Running the code on the S-CPU does free up some more space in audio ram though. However, I don't know how much space is normally taken by this.


Top
 Profile  
 
PostPosted: Sat Dec 16, 2017 1:46 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19924
Location: NE Indiana, USA (NTSC)
I don't know how much space is normally taken in commercial games because I haven't traced into them. But extrapolating from music code that I wrote for another 6502 family CPU (and am off and on porting to the SPC700), I guess a player might fit in 2K and each song in maybe 3K at most. At that size, a game could load each song's order and pattern data in a matter of a few frames.


Top
 Profile  
 
PostPosted: Sat Dec 16, 2017 2:03 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7416
Location: Chexbres, VD, Switzerland
Espozo wrote:
@psychopathicteen I've wondered the same thing. However, with how much most early SNES game slow down, the music would fall apart.

Not necessarly, NES games have the CPU handling the music and they can slow down without the music falling apart if interputs are handled properly.

Quote:
Running the music engine on the S-SMP instead of the S-CPU has several advantages.

Indeed, the only "advantage" of not doing it is freeing up RAM.

Quote:
Linear-pitch portamento and vibrato need multiplication, as does volume adjustment.

They don't necessarly need multiplication, and from reverse-engineering them I can assert that at least some engines by Squaresoft only supports non-linear pitch portamento. :)


Top
 Profile  
 
PostPosted: Sat Dec 16, 2017 3:29 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2603
You could save a lot of CPU speed with HDMA. Even without HDMA, you can still have the CPU get everything ready while it's waiting for the SPC700. I also find the SPC700 way more frustrating than the 65816 to work with.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group