SMEG 68k sound driver

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Post Reply
GenesisFan64
Newbie
Posts: 7
Joined: Tue May 07, 2013 7:03 pm
Location: Mexico
Contact:

SMEG 68k sound driver

Post by GenesisFan64 » Wed Jun 12, 2013 4:37 am

Hello everyone, it's me again.

Here's the first release: https://docs.google.com/file/d/0BzL0dkM ... sp=sharing
the .zip file contains the source code for making a test rom, the folder /sound is the main thing.

please, PLEASE only use this driver on homebrew games and not for other purposes

how to find the pattern data:
first i recommend removing all the instruments/samples to save (a lot) of filesize, OpenMPT can do it.

Open your .it file in any hex editor, find $81, you may find a lot of $81's on the file, if in the $81 has 5 zeros ($00's) on the left, you found the pattern data
in where you found the $81, count 8 bytes backwards, save the address, now in the incbin file put the address where the pattern starts:

Code: Select all

incbin "your_file",0xthe_address
this version is still primitive, it lacks stuff like a separate stopbgm/stopsfx routine (SMEG_StopSnd stops both, for now)

[note: ASM68k.exe not incl.... nevermind]
Last edited by GenesisFan64 on Wed Jun 12, 2013 4:45 pm, edited 1 time in total.
RAN RAN RUU!

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 12, 2013 2:38 pm

GenesisFan64 wrote:[note: ASM68k.exe not included]
You're wrong.

I have tested ROM. 3.62 M with one song, with duration = 26 sec. Are you kidding me?
No info about features found. I even readed core.asm.
build.bin shows nothing, except playing one, not realy good song.
It seams useless... Because, if I want to make one song in one 4MB ROM, then I will choose DPCM and It will achieve 13888 Hz with duration = 10 minutes, like "Gabriel & Dresden Pavement Cracks featuring Annie Lennox". :D Or less duration with more quality.

"Matrix Soundtrack - Mona Lisa Overdrive" duration 10:09 :)
Hmmm, good idea make such test :).
Image

sega16
Very interested
Posts: 251
Joined: Sat Jan 29, 2011 3:16 pm
Location: U.S.A.

Post by sega16 » Wed Jun 12, 2013 3:59 pm

That idea of supporting a common format is good idea as it saves lots of time on writing tools however I think it would be a good idea to remove the pcm samples from the IT module since this driver appears replaces the samples with psg and fm voice so there is no need to store the unused samples other that awesome driver. Also it appears as though you did include ASM68k.exe

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 12, 2013 4:15 pm

For one, who don't know anything about *.it format, this demo shows nothing.
Image

sega16
Very interested
Posts: 251
Joined: Sat Jan 29, 2011 3:16 pm
Location: U.S.A.

Post by sega16 » Wed Jun 12, 2013 6:01 pm

r57shell wrote:For one, who don't know anything about *.it format, this demo shows nothing.
Here is the format is uses http://en.wikipedia.org/wiki/Impulse_Tracker
http://openmpt.org/ OpenModPlug tracker can create and edit .it files.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Jun 12, 2013 6:12 pm

Having worked on a variety of different tracker formats on the SEGA MD/CD/32X, I think I stand on good authority in stating that anything beyond 8-track MOD is overkill. I would love to see 8-track MOD adopted as the "official" music format for homebrew on the SEGA 16-bit systems. It's easy to play on the SCD and 32X, so seeing some tools to allow its playback on the MD would be cool.

Basically, a MOD for MD tool would strip the instruments, and preprocess the pitch values like I do on the SCD. It could probably stick instrument ID values in the sample headers based on info from the user... which instruments to map the samples to. 8 tracks also allows for covering the PSG.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 12, 2013 6:36 pm

sega16 wrote:Here is the format is uses http://en.wikipedia.org/wiki/Impulse_Tracker
I said all what I have... Don't force me to explore that thing...
Image

GenesisFan64
Newbie
Posts: 7
Joined: Tue May 07, 2013 7:03 pm
Location: Mexico
Contact:

Post by GenesisFan64 » Wed Jun 12, 2013 8:49 pm

Here's more explanation:

Again: SMEG reads .it files, ONLY the patterns, the rest of the module is ignored
FM voices and DAC samples are separated, FM Voices are in SMPS format

this driver can read some .it effects like panning and portametro up/down
the Zxx effects are used for features like DAC on/off and set Noise type

the .it files ALWAYS loop, the only way to disable looping is: in OpenMPT, make a new pattern, leave it blank
in ASM, set the number of that blank pattern as the one to loop to

the tempo MUST be 150, Ticks/row can be controlled in SMEG.

hope you guys finally understand how this actually works...
RAN RAN RUU!

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 12, 2013 9:14 pm

You have left unanswered the question: why ROM with one track has size 3.6 MBytes.
And, how about restrictions? What can it play?
One song + 2 dac? Or other way? May be... It can play any count of songs if total channels count not exceed 16?
I don't want to know answers, I just want to show you lack of info.
Image

sega16
Very interested
Posts: 251
Joined: Sat Jan 29, 2011 3:16 pm
Location: U.S.A.

Post by sega16 » Wed Jun 12, 2013 9:22 pm

r57shell wrote:You have left unanswered the question: why ROM with one track has size 3.6 MBytes.
GenesisFan64 just explained it.
GenesisFan64 wrote:Here's more explanation:
Again: SMEG reads .it files, ONLY the patterns, the rest of the module is ignored
The extra data that SMEG ignores is not removed it is just left in. SMEG is a great idea the extra unused data just needs to be removed.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Jun 12, 2013 9:49 pm

sega16 wrote:The extra data that SMEG ignores is not removed it is just left in.
GenesisFan64 did not say it. I'm not a mind reader, and don't want to make guesses.
Image

GenesisFan64
Newbie
Posts: 7
Joined: Tue May 07, 2013 7:03 pm
Location: Mexico
Contact:

Post by GenesisFan64 » Wed Jun 12, 2013 10:09 pm

r57shell wrote:One song + 2 dac? Or other way? May be... It can play any count of songs if total channels count not exceed 16?
I don't want to know answers, I just want to show you lack of info.
It supports up to 10 channels
FM1-6, using DAC disables FM6 (obviously), all PSG with clock Noise, using Tone3 Noise mode will disable PSG3

Warning: if the .it file uses more than 10 channels it may crash the driver, if the .it channels lower than 10, it works fine

sorry for the lack of info, i'm so busy
:(
RAN RAN RUU!

Post Reply