Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PSG library port
#1
Hi,

Here is a new sound library for ngpc, it's a free port of the PSGLIB (https://github.com/sverx/PSGlib)
It works a bit like the official one from snk: load driver and load music to z80 ram then play.
No SFX.
sources & demo rom attached.

thanks to WinterIsComing for help/comments/...

Edited: PCM playback added for SFX (8bit unsigned stereo PCM), thanks to mic_
09/04: z80 minimized

Thor


Attached Files
.zip   psglib_test.zip (Size: 100.23 KB / Downloads: 5)
Reply
#2
To add new songs: use psg tools (https://github.com/sverx/PSGlib/tree/master/tools)
vgm2psg (to transform vgm files to psg) and psgcomp (to compress a bit, because driver + songs must be less than 4k), then your favorite bin2c.

SMS songs are available here (for example): https://www.zophar.net/music/sega-master-system-vgm
or create your own with deflemask (https://deflemask.com/), target SMS.
Reply
#3
Cool! Thanks, Thor!
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply
#4
Thanks for sharing and thanks for all the PMs as I was trying to figure some of this stuff out on my end.

The one thing I think is missing here is a tuner for SMS to NGPC.  They're clocked at different rates, so an SMS-tuned PSG note will be out of tune on the NGPC's z80.  I've got a script that can pre-process these and I can post here when I get to the point of releasing it.

There are normal tone commands that have to be tuned one way, and then third channel tone commands that affect periodic noise on the noise channel.  These have to be tuned and then adjusted from a 16 bit LFSR to 15 bit.  *Big thanks to mic_ for explaining this to me.


Conversion info as I have implemented it based on my understanding:

Normal tone tuning example:
SMS register value for tone channel 1023
SMS input clock 3580000

frequency 109.3597263
NGPC input clock 3070000
NGPC register val = input clock/frequency/32 877.2653631

Periodic noise tuning example:
SMS register value for tone channel 1023
SMS input clock 3580000
frequency 109.3597263
SMS periodic noise freq = freq/16 6.834982893
NGPC frequency = periodic noise freq*15 102.5247434
NGPC input clock 3070000
NGPC register val = input clock/frequency/32 935.7497207
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)