Skip to content

Adding K007232 support to libvgm. (and other soundchips too)

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Hey guys!

So, few weeks prior. I've made my own K007232 soundchip support on libvgm, with the help of cam900 (MATRIX) as well as DeepSeek. Yeah, deepseek, cuz I'm still learning at coding things.

Things are not going well when implementing the chip, because some of the samples we're not playing properly. The only known K007232 games that barely playing the sample well, but playing incorrectly are Hot Chase, and Chequered Flag. Some games like Gradius III and other games we're silent when testing the chip itself. It only plays the FM chip and not any sign of K007232 sample playing on the VGM.

I haven't figured it out on what's caused this, so if anyone wanted to help with the soundchip implementation. I'd be happy to see that we're getting somewhere.

And another discovery that I've found during my K007232 support implementation. I was scrolling around Furnace discord server, where I saw this one guy by the name of Goldia (skaphantom) who implement the actual K007232 chip on libvgm, and it sounds perfectly fine. For now, it seems that the guy was offline a year ago and I've message him if he could contribute to this project that I've coded so far. As for now, I'm still waiting for his response. Update: He didn't respond.



Update: K007232 and K005289 is now on the official libvgm repo, and MSM5205, ICS2115, MSM5232, and BSMT2000 is still in review.



Oh, and speaking of soundchip implementation. I've also added 2 soundchips support on libvgm that doesn't make any sound at all.

MSM5205 based on eito's MSM5205 old vgmplay build. I've mailed eito for this if he wanted to contribute his MSM5205 build into a much newer libvgm build, and still. I'm waiting for his response. We've been working on this soundchip by communicating thru e-mail and it's almost done. To make sure that it's working perfectly, we need a few more tests to make sure that it's working.

and BSMT2000 based on M1 and PinMAME's source code. So it might be difficult to adapt this to libvgm because on how lack the documentation is. and newer MAME build uses program ROM pretty much to run games that has BSMT2000 soundchip in it. So it's pretty much useless to use newer MAME source code of the BSMT2000 chip as a reference. Done, thanks cam900!.


ES5505/06 chip later to implement since I have the draft code.


Another soundchips I wanted to implement (might be) in the future (if VGM format added extra header):
  • Gaelco GAE1
  • RF5C400
  • Jerry
  • Namco 15XX/CUS30
  • MMC5
  • VRC6
Here's my own fork of libvgm if you wanted to check it out, and contribute something.

For the ICS2115's implementation thread, check out cam900 (MATRIX)'s post.

For tools, here's my another fork of vgmtools that includes k007232 support. But you have to compile it by yourself. I'll later release the binary package of that tool for further logging.
Known working tools: vgm_sro, vgm_cmp, vgmlpfnd, vgm2txt, vgm_ptch, vgm_trim, and vgmmerge (that software has a bug that turns the k007232 clock off, to fix this. load the vgm in any hex editor, then locate the K007232 clock (particularly 0xE8), and then change the clock to 99 9E 36 00 in order to work).

For MAME logging, here's another fork of MAME k007232 vgm mod.



Thank you very much. Move this topic if I post this on a wrong forum.
Attachments
test_samples.7z
Compiled player.exe and other files to test on some of the logged vgms i've made.
(8.9 MiB) Downloaded 245 times
Last edited by Mao (RN22) on 2025-06-01, 7:53:36, edited 16 times in total.
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.
  • fever500 Offline
  • Posts: 79
  • Joined: 2022-06-12, 17:08:56
  • Location: FRANCE

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by fever500 »

Hi Mao,
I don't think I can help you with that but I wish you good luck !
  • User avatar
  • Dario011 Offline
  • Posts: 130
  • Joined: 2019-12-23, 0:24:21

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Dario011 »

I know this is going to sound weird, but when I try to run player.exe, it basically gives me the best definition of DLL hell.

And no matter how hard I look for the said dlls, I get the infamous 0xc000007b error (which of the times it has happened to me, with other things and a long time ago in my experience, I have never been able to fix).

In addition to some of the DLLs they ask for like the (obvious) zlib1.dll, I get that it asks for a zlib1__.dll.

I don't know if it is a Windows error (knowing how it is when this kind of thing happens) or if it is an oversight.

And it is not the only file it asks for, it asks for two more dlls.
Trying to get back on track with VGM Ripping.
My Packs Log in VGMRips (Last Updated: 2025-05-04)

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Here if it doesn't work.
Attachments
zlib1.rar
(51.27 KiB) Downloaded 170 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Update: MSM5205 is working now, thanks to eito. The only problem I need to fix is the volume control of that chip. Hope it goes well.
Attachments
msm5205.rar
testing
(715.65 KiB) Downloaded 53 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

K007232 update: Now it plays the correct samples properly, kinda. however. Only 2 games were able to log on this chip. Hot Chase and Chequered Flag. And yes, the hot chase sample issue where muting is not working exists. I wonder if there's something wrong with the VGM logging on my MAME VGM build? or the libvgm's player itself!
Attachments
bin.rar
(1.53 MiB) Downloaded 78 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Update: Hot chase plays the samples and mutes accurately, thanks to cam900. I haven't figured it out the volume nibble until cam900 add up the registers 0x10 to 0x13 for each channel that adjusts volume automatically.

0xC volume is splitted as nibble for most games as cam900 stated.

the downside is Chequered flag still having problems logging accurately since MAME labeled the games' sound as unimplemented.
Attachments
bin.rar
(2.32 MiB) Downloaded 63 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Good news everyone! We got a fully working K007232 chip! Special thanks to cam900 and DeepSeek for the help. This wouldn't be possible without seeking help from them. One thing left to do is to adjust panning for this.

This'll be the next soundchip to be added in the official libvgm next to Mikey.
Attachments
bin.rar
(5.16 MiB) Downloaded 124 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Here's some tests that I logged for the K007232 chip.

one with Special Project Y attract mode,
one with full Gradius 3 gameplay (yeah, the K007232 on this one is louder than YM2151. I'll fix that later on.)

So far. That concludes the K007232 core from libvgm itself is working now.

I'll later edit the VGM spec and delete the K007232 from the unsupported soundchip wiki.
Attachments
bin.rar
(9.12 MiB) Downloaded 118 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

K007232 channel configurations for reference.

Code: Select all

Mono configuration:
- Low nibble for channel 0, Hi nibble for channel 1:
  - aliens
  - crimfght
- Hi nibble for channel 0, Low nibble for channel 1:
  - ajax (chip #0)
  - bottom9
  - chqflag (chip #1)
  - fastlane
  - flkatck
  - gradius3
  - hcastle
  - mainevt.cpp
    - mainevt
    - devstors
  - nemesis.cpp
    - salamand
    - blkpnthr
    - citybomb
    - nyanpani
    - hcrash
  - spy
  - thunderx.cpp
    - scontra
    - gbusters
  - tmnt.cpp
    - mia
    - tmnt
  - twin16.cpp
    - devilw
    - vulcan
    - fround
    - miaj
    - cuebrickj
  - wecleman.cpp
    - wecleman
Stereo configuration:
- ajax (chip #1 (channel 0 is mono, channel 1 is stereo))
- chqflag (chip #0)
- wecleman.cpp
  - hotchase
First K007232 chip that I wrote without bankswitching feature works on Hot Chase (with weird samples played without muting), but no samples played on Gradius 3, Super Contra, etc.
Second K007232 chip that I wrote with bankswitching feature also works on Hot Chase (with weird samples played without muting), Chequered Flag (plays fine), but no samples played on Gradius 3, Super Contra, etc.
Third K007232 chip that I wrote with added volume callbacks on each channel finally works on Hot Chase, Chequered Flag, but no samples played on Gradius 3, Super Contra, etc.
Last K007232 chip that I wrote alongside with cam900 with fixed wreg on the core works perfectly fine on all games, as well as fixed mame source code for k007232.cpp vgm log support.
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Haunted Castle raw log (for testing only).
Attachments
hcastle_0.vgm
(8.77 MiB) Downloaded 142 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Update: K007232 is now added to libvgm! Thanks to ValleyBell, cam900 for making this happen!
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

So, a last couple of weeks, spending days tweaking the code with ValleyBell. Here's some final k007232 vgm logs. the vgmplay itself is straight out of the official k007232 core!

vgms included,
S.P.Y. 3d stage and 2d stage.

Lemme know what you've think.
Attachments
k007232-vgms-test.rar
(776.45 KiB) Downloaded 93 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Mao (RN22) »

Meanwhile, I'm happy to report that the MSM5205 core is working perfectly, thanks to eito for helping me out. Even his old logs of Darius VGMs works (warning, the volume of that vgm pack is loud). Don't believe me? try it out.
Attachments
msmtest.rar
(9.16 MiB) Downloaded 92 times
To-Do list:
?

Current Status: Implementing soundchips.
Tempo: 105.95%
Pitch: +1.00

Better Call Mao!

Image

Please, check my WIP list for more updates.

Re: Adding K007232 support to libvgm. (and other soundchips too)

Post by Kaminari »

That's great to here about Oki 5205 support. Hopefully some PC Engine rips will benefit from it.
Post Reply