Page 2 of 3

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 11:09 am
by lidnariq
Rahsennor wrote:Some of them crash my SPC player (Game_Music_Emu 0.5.2) though. Not entirely sure why, and probably not your fault, but I can't listen to them.
Trying playing track 2 via gst123 yields this amazing error message:
gst123: /build/game-music-emu-0.6.2/gme/Spc_Cpu.cpp:496: int Snes_Spc::cpu_read(int, Snes_Spc::rel_time_t): Assertion `reg + (r_t0out + 0xF0 - 0x10000) < 0x100' failed.

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 11:45 am
by tssf
Hooray for bug testing! I'm blaming the revised snesmod for this. It was modified by someone else who added all the crazy cool features. That being said I'm glad they did, just sad they seem to make some other SPC players not react properly.

I did an FF7 SPC that was supposed to disable echo writes essentially cutting the reverb so that there was nothing left but silence. Spcplay and that other Japanese SPC player handles it right, but DDB and zxtune on Android kind of blow up when it happens and causes a feedback to occur so I had to throw in an extra command to mute the echo so you can't hear when it does that.

Here's that SPC if you want to throw it against your player too, hopefully it doesn't make it explode either XD

http://tssf.gamemusic.ca/Remakes/FF7Stuff/ff7pizza.spc

This is why my name is in the credits for WinAmp, Jake Stine used to use my mods for testing since I used to do crazy shit to break his MikMod player haha

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 12:39 pm
by lidnariq
Same crash.

... having now installed debug symbols, I have absolutely no idea why it's trying to read from address 0x10003, but that apparently causes this crash.

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 12:55 pm
by Kingizor

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 1:07 pm
by lidnariq
Greeeaat. Rather than actually fixing the bug they just chose to assert and crash instead.

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 1:07 pm
by kulor
Sup guys! Long time lurker, first time poster. I just wanted to make a minor correction real quick 'cuz this stuff tends to proliferate:
Espozo wrote:Perhaps the most surprising thing to me though, is that he said it only took 22KB, because the instruments were very small.
After messing with the track again, I saw that I had misremembered what the console said, and actually have 22KB -remaining-. So the track is roughly double what I thought it was, ~42-some KB.

The biggest reason I wanted to do this was because people seem to have this idea that the SNES is locked into mock-orchestra sounds, and that the SNES can't sound crisp because of interpolation, and that the SNES can't do this-and-that etc...
Attached a few conversions of various Amiga/PC game music that I made using snesmod, I was thinking of using these for a video explaining what exactly the limits are for SNES audio, why songs tend to sound muffled, what sort of sounds you can do, that sort of thing. Maybe someday I'll be able to find the time...

Anyway, I've done some NES homebrew soundtracks, and I'd love to do SNES homebrew soundtracks too if anyone's looking for a musician...!

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 7:30 pm
by Rahsennor
lidnariq wrote:Greeeaat. Rather than actually fixing the bug they just chose to assert and crash instead.
If I facepalm any harder I'm going to do myself an injury. I might just have to write an SPC player to go with my NSF player...
kulor wrote:Sup guys! Long time lurker, first time poster.
Welcome! I enjoyed your Famicompo entries and found your Adlib stuff on http://opl.wafflenet.com/, but somehow never tracked down your site before now. Keep up the good work!

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 8:44 pm
by lidnariq
Rahsennor wrote:If I facepalm any harder I'm going to do myself an injury. I might just have to write an SPC player to go with my NSF player...
I'm certain Blargg had some reason to make the cpu_read function the bizarre chain of logic that it is ... maybe pentium 4 predictor failures?

It's literally just
* Read from RAM regardless; the RAM array is actually 0x10100 bytes long to avoid having to do bounds checking
* Is the memory address 0xF0 or above?
* Is the memory address - 0x100, parsed as an unsigned number equal to 0xFF00 or above? (why???)
* Is the memory address 0xFD, 0xFE, or 0xFF?
* Is the memory address 0xF0-0xFC?
* Is it neither of the last two? (because it's actually 0x10000 or above)

I think whatever compiler he tested against treated the enums as signed, because the math there ( (r_t0out + 0xF0 - 0x10000) seems to work correctly if that expression is treated as a signed number. Apparently the signed-ness of an enum is officially undefined, so ... naughty naughty? Makes you wonder on which compilers the original CVE wouldn't happen because this expression was treated as signed.

I'm just bewildered by an ISA implementation where bitmasks are expensive and subtraction+comparison+branching is cheap.

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Thu Mar 15, 2018 11:51 pm
by Oziphantom
Whenever somebody starts with the "but the megadrive has better sound" I play this https://www.youtube.com/watch?v=6MVMcAl ... D88F5B0565 then ask if they herd the sloshing water and the stereo drums... usually shuts them up pretty quick...

follow ups https://www.youtube.com/watch?v=ht7YJptvt_w https://www.youtube.com/watch?v=5gyu_KobenE
https://www.youtube.com/watch?v=W3SA9LuqQgA (shsssh about the extra chip though ;) )

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Fri Mar 16, 2018 1:43 am
by 93143
What extra chip? Star Ocean used an S-DD1 because it was enormous, but Tales of Phantasia is just an unusually large FastROM game. Pretty sure neither of the others uses special chips either.

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Fri Mar 16, 2018 2:22 am
by Oziphantom
I remember their being some extra chip that assisted with the Audio, which was hard to emulate at the time. This enabled the fancy music player with the cross fade part in the town. And explained why the "opening song" was just random garbage when played in the emulators... but looking at the board, nothing special at all...

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Fri Mar 16, 2018 2:37 am
by 93143
The opening song was pulled off using a streaming technique to switch out vocal snippets on the fly. Early emulators probably bodged up the timing or something. And obviously it's undumpable in SPC format...

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Fri Mar 16, 2018 6:29 am
by tssf
There was no extra chip to help tales of phantasia. All it did was dynamically stream samples in and out of memory. Just the good ol' spc700.

The compression chips were for graphics. All SNES music samples are BRR compressed regardless.

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Fri Mar 16, 2018 7:51 am
by kulor
Say, since we're talking about Tales of Phantasia and dynamic sample swapping...
Anyone ever messed with doing this themselves? I'd love to somehow make an SNES ROM wrapper that plays an snesmod tune back while swapping out samples at certain intervals. I imagine if you use certain samples as buffers of a certain length, so long as you know the address of the sample on the SPC700 side it wouldn't be too hard...

Re: Chemical Plant Zone SNES (Sampling FM Instruments)

Posted: Fri Mar 16, 2018 1:47 pm
by 93143
Augustus Blackheart and KungFuFurby's fork of SNESMOD has a streaming feature: http://battleofthebits.org/arena/Entry/ ... ber/27464/

N-Warp Daisakusen by d4s uses HDMA for streaming. The source code is available.

I myself have attempted to design a high-bandwidth HDMA streaming technique using self-modifying code, but I haven't tested it. Gotta get on that one of these days - I want it for my game...