vgmrips

The forum about vgm files
It is currently 2018-09-25, 3:54:44

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: 2014-12-14, 12:47:17 

Musicians Musicians
Contributors Contributors
Offline

Joined: 2012-09-29, 11:45:48
Posts: 215
Location: Australia
I've been thinking lately. Given there hasn't been any rips for FM Towns games (or ports rather :P) uploaded as of yet due to a number of reasons including experimental emulation, a few things did not make sense to me.

Some points:
  • UNZ is currently the best emulator (albeit not open source) for playing games on this platform.
  • Sound emulation appears to be correct (at least as far as clock frequency is concerned) in UNZ
  • Other than flaky compatibility, MESS sound emulation for this platform is played at a slower clock speed

On closer investigation, we know YM2612 (and by extension YM3438) is commonly associated with the Sega MegaDrive/Genesis, which uses the chip at a clock speed of ~7.67MHz. But it's been noted that other systems supposedly used this and related chips on other platforms at a clock speed of ~8MHz (or ~7.97MHz, apparently this has been the case for PC-88 and PC-98 platforms.)

With this thought, seeing MESS VGM Mod log FMTowns chip registers at 7.67MHz seemed peculiar to me, yet everything seemed to play OK. (still not sure about speed stability but that's to be investigated further, comparing with UNZ due to lack of an actual physical unit).

2 minutes in a hex editor later, changed the YM2612 clock to 7987200Hz (~8MHz), and we get the following:

Before: https://dl.dropboxusercontent.com/u/128 ... arty_0.vgm (using ~7.67MHz)
After: https://dl.dropboxusercontent.com/u/128 ... xclock.vgm (using ~8MHz)

Other than the fact that many FMTowns games share the same music data as their PC98 counterparts (they ARE using very similar architecture IIRC. Some hoot entries even re-use PC-98 sound drivers to play the FM-TOWNS music data at 8MHz clock, which sounds largely correct), I'm just wondering if there are any other issues besides playability that is stopping FMTowns games from being uploaded here.

Any thoughts? Please contribute!

Thanks

_________________
-dj.tuBIG/MaliceX


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-14, 19:56:49 

Contributors Contributors
Offline
User avatar

Joined: 2012-01-03, 2:10:28
Posts: 280
I changed the clock of MESS of FM Towns.
MESS 0.156 FM Towns clock 8Mhz (Not vgm mod, I don't know how to vgm mod)
https://www.dropbox.com/s/j0fpcjymaloimv2/mess.7z

Example:
Unz recording Asuka 120% opening
https://www.dropbox.com/s/me8elhjvrlk0vo1/asukaunz.wav

Mess (8Mhz) recording Asuka 120% opening (Maybe correct clock and tempo)
https://www.dropbox.com/s/0hlkmiwm3awsdz4/asukamess.wav

Mess (7.67MHz) recording Asuka 120% opening (The wrong clock, slow tempo)
https://www.dropbox.com/s/pkcr77aaw8ljy ... amesso.wav

I think 8Mhz is correct.

Source Changes
mame\misc\mame\src\mess\drivers\fmtowns.c
Code:
   /* sound hardware */
   MCFG_SPEAKER_STANDARD_MONO("mono")
   MCFG_SOUND_ADD("fm", YM3438, 56000000 / 7) // actual clock speed unknown
   MCFG_YM2612_IRQ_HANDLER(WRITELINE(towns_state, towns_fm_irq))
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)

   MCFG_RF5C68_ADD("pcm", 56000000 / 7)  // actual clock speed unknown
   MCFG_RF5C68_SAMPLE_END_CB(towns_state, towns_pcm_irq)
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50)
   MCFG_SOUND_ADD("cdda",CDDA,0)
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND,0)
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)


I changed the "53693100 / 7" to "56000000 / 7".


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-15, 6:15:38 

Musicians Musicians
Contributors Contributors
Offline

Joined: 2012-09-29, 11:45:48
Posts: 215
Location: Australia
2ch-H wrote:
I think 8Mhz is correct.

Source Changes
mame\misc\mame\src\mess\drivers\fmtowns.c
Code:
   /* sound hardware */
   MCFG_SPEAKER_STANDARD_MONO("mono")
   MCFG_SOUND_ADD("fm", YM3438, 56000000 / 7) // actual clock speed unknown
   MCFG_YM2612_IRQ_HANDLER(WRITELINE(towns_state, towns_fm_irq))
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)

   MCFG_RF5C68_ADD("pcm", 56000000 / 7)  // actual clock speed unknown
   MCFG_RF5C68_SAMPLE_END_CB(towns_state, towns_pcm_irq)
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50)
   MCFG_SOUND_ADD("cdda",CDDA,0)
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND,0)
   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)


I changed the "53693100 / 7" to "56000000 / 7".


Ha. "actual clock speed unknown". No wonder it's wrong! That means they just ported over the Sega MegaDrive init routines for ym2612, which explains why the clock was ~7.67MHz.

By the way, the tempo DOES sound like it's fixed with those changes in the code. :O That might be the best alternative we have actually! Nice.

_________________
-dj.tuBIG/MaliceX


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-15, 14:00:44 

Contributors Contributors
Bug catchers Bug catchers
Offline
User avatar

Joined: 2011-12-28, 19:52:40
Posts: 206
Location: Paris, France
For reference :

Asuka 120% Opening (PC Engine)

The speed and tempo is nearly identical to MESS 8 MHz.

_________________

Sega PCM [1985/1989] | Namco C140 [1987/1990] | Hudson HuC6280 [1987/1995] | Yamaha YM2608 [1988/1996] | Oki MSM6295 [1988/1998]


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-15, 18:36:15 

Musicians Musicians
Contributors Contributors
Offline

Joined: 2012-09-29, 11:45:48
Posts: 215
Location: Australia
Until there's someone out there can confirm technical clock details about the FM Towns sound hardware, it's still a better guesstimate than what's currently there, and I'm inclined to believe Japanese contributors more than anything on this topic. So far, searches on the topic are correlating the CPU clock speed which would make sense if sound chip was synchronized in some way with the main CPU. (MESS source also currently uses 16MHz which nicely fits with 8MHz by a factor of two cycles).

It just doesn't make sense if the clocks are not in sync by design.

_________________
-dj.tuBIG/MaliceX


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-16, 19:12:43 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 620
Luke Morse has an FM towns machine (or more?), I'll ask him on his facebook what the frequency on the crystal is.

Edit: he says it's packed and it's hard to get at for now.

_________________
Support me on patreon!.
Follow me on twitter.

If you like this post, give it a big thumbs up and hit that subscribe button down below! And as always, thanks for reading, and see you next post.


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-30, 1:41:48 
Offline

Joined: 2014-12-30, 1:38:48
Posts: 81
The BGM is in the wrong places.


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-30, 10:29:32 

Musicians Musicians
Contributors Contributors
Offline

Joined: 2012-09-29, 11:45:48
Posts: 215
Location: Australia
1983parrothead wrote:
The BGM is in the wrong places.


Please elaborate on what you mean.

Also just for an FYI for anyone that doesn't read the IRC, ValleyBell's recent vgm mod release for MAME/MESS 0.156 incorporates the 8MHz fix for FMTowns YM2612/3438. Some games would rely on the chip timer commands, so tempo should be fixed as well as pitch.

_________________
-dj.tuBIG/MaliceX


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-30, 13:33:55 
Offline

Joined: 2014-12-30, 1:38:48
Posts: 81
For instance, Megumi's Theme plays during Kumi's stage.


Top
 Profile  
 
 Post subject:
PostPosted: 2014-12-30, 20:27:27 

Contributors Contributors
Bug catchers Bug catchers
Offline
User avatar

Joined: 2011-12-28, 19:52:40
Posts: 206
Location: Paris, France
What version are you talking about? I checked the X68000 and FM-Towns packs with my PC Engine version, and all themes have their proper names.

Check the official soundtrack at Project Egg.

[Edit] Ah yeah, I just saw your post at Tokugawa. Well, the themes are in the right places -- it's the FM-Towns port that is wrong ;)

_________________

Sega PCM [1985/1989] | Namco C140 [1987/1990] | Hudson HuC6280 [1987/1995] | Yamaha YM2608 [1988/1996] | Oki MSM6295 [1988/1998]


Top
 Profile  
 
 Post subject:
PostPosted: 2015-01-07, 23:42:02 
Offline

Joined: 2014-12-30, 1:38:48
Posts: 81
FM Towns version is the initially released version, not a port. For some reason, it's probably been rushed out, but quietly cancelled for the sometimes-superior Sharp X68000 port.

Hacking it and tweaking it is the only way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


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