Music for Ghost, Xak and others to convert?

Page 1/2
| 2

By Mr.Mouse

Rookie (18)

Mr.Mouse's picture

22-11-2019, 23:29

Hi guys,

I was wondering if any of you have some info on the music source for Mr. Ghost.
https://www.youtube.com/watch?v=m28k2AyNYc8
I love Manabu Saito's music and I think this is the one MSX release he did. I'd like to cover/convert this for the C64 (sorry) as a tribute and a way to inspire. Any help is appreciated.

Also, I have an interest in Xak, is there any code of the music driver ? Since I created the FM-YAM cartridge for the C64,
http://c64.xentax.com/index.php/fm-yam
I have always wished to bring the awesome MSX music to the C64 platform. :) FM-YAM has an OPL2 chip, for your reference.
Would love a collaboration with you to expand the MSX music to the C64 :D

Anyway, thanks for reading.
:)

Login or register to post comments

By ToriHino

Champion (383)

ToriHino's picture

26-11-2019, 19:50

For Mr. Ghost i'm not sure if it has been captured yet, but for Xak (as well as Xak II and a lot of others) the music is already captured in the VGM format (see for example this thread).
So the vgm player from 4-Mat should already be able to replay this on the C64 as well (or it can be created fairly easy, the VGM format is quite similar to the DRO format).

By Grauw

Ascended (8508)

Grauw's picture

26-11-2019, 22:40

https://vgmrips.net/packs/pack/yuurei-kun-msx2
https://vgmrips.net/packs/pack/xak-the-art-of-visual-stage-msx2

The VGM format is a recording of the I/O from the CPU to the sound chip(s), which the player then re-plays on either the original chip with VGMPlay MSX or on an emulated chip with VGMPlay PC. (Those two are not made by the same author btw.)

These soundtracks also exist in KSS format which contains original sound driver code + music data extracted from the ROM, which the player then executes on an emulated Z80 with sound chips.

By Mr.Mouse

Rookie (18)

Mr.Mouse's picture

28-11-2019, 09:48

Thanks for the replies, guys. Smile

Yes, I know of VGM, the issue there is that these files
A. take way too much memory (i.e. Town of Fearless track is over 64K already) and
B. If going for the .GZ versions (.VGZ) the decompression time needed is limiting playback on the 1 Mhz C64.

So what I am really after is the original player source code to try and adapt to 6502 assembly. I'm sure that will lead to smaller files, better understanding of the player routine and more insights that I can use for a SID+FM player/editor.

By Parn

Champion (424)

Parn's picture

28-11-2019, 16:04

Perhaps you'd like to take a look at the KSS instead. It wouldn't be trivial but I don't expect it to be overwhelmingly difficult to analyze it just to extract music data and the player itself.

By ToriHino

Champion (383)

ToriHino's picture

28-11-2019, 19:19

Indeed the KSS format is than probably the most helpful format. It already contains the isolated player code, much like the SID format on the C64.

Look for a list of files over here, and the format description can be found here

By Mr.Mouse

Rookie (18)

Mr.Mouse's picture

28-11-2019, 22:52

That is very interesting indeed, those KSS files. The format seems pretty straightforward. This seems intended to play on the MSX? Is there a program that can separate the data from the player by the way? I can look around, otherwise I'll use a hex editor.

By Grauw

Ascended (8508)

Grauw's picture

29-11-2019, 00:08

KSS files are intended to play on the PC, it is difficult and slow to play them on the MSX because it involves a Z80 emulator running on the Z80. Nyyrikki made a player but it is recommended to run it on a turboR with R800 CPU. In that regard, VGM is a more suitable format for playback on MSX.

NYYRIKKI wrote:

KSSPLAY is a tool to play MSX musics. KSS format is quite a near to C64 SID format, so the file it self includes the player routines. KSSPLAY has a build in Z80 emulator (Made By: NYYRIKKI) that runs the code, so fast CPU is needed to get perfect result. Most of the songs can be played on MSX tR without speed problems.

By Mr.Mouse

Rookie (18)

Mr.Mouse's picture

29-11-2019, 14:22

Ok, so in order to start reverse engineering the player code, it would be best to use an emulator with a sufficient debug/assembly monitor functionality on the KSS files. Were any of the original editors released by f.e. Microcabin that you know of?

By Grauw

Ascended (8508)

Grauw's picture

29-11-2019, 14:52

Not that I know of.

By Mr.Mouse

Rookie (18)

Mr.Mouse's picture

04-12-2019, 17:07

Looking at the OPLL code in Xak 3, I notice that they do not force a wait of cycles after the registry is set? Yes, they add a nop (5 cycles?) and and inc c that will also cause 5 cycles of extra waiting, when setting the registry. But when they set the value (data) for the registry they seem to just go back to the caller without forcing a wait of a number of cycles.
I see code out there that force to wait, but I guess it is not really needed if the program is doing other stuff anyway that takes long enough in cycles before a call to the OPLL-register set function is again being made. Smile

CEA3:   push   af         		// push af 												*** change PSG value of register B to A
CEA4:   ld     a,b        		// store b in a
CEA5:   out    (#a0),a    		// select register a in PSG
CEA7:   pop    af         		// get af back 
CEA8:   out    (#a1),a    		// store a (value for register to change to)
CEAA:   ret     				// done, return to caller           
CEAB:   ld     a,b        		// switch register number in b to a to select it		*** read register value of PSG register B and store it in A
CEAC:   out    (#a0),a    		// select register a of PSG
CEAE:   in     a,(#a2)    		// read the value of the register select through A2
CEB0:   ret      				// done, return to caller          
CEB1:   push   bc         		// store BC												*** change MSX-MUSIC (OPLL) register B to value in A
CEB2:   push   af         		// store AF
CEB3:   ld     a,b        		// store 
CEB4:   ld     bc,(#cec1) 		// port 7C is stored at $cec1 (OPLL register select)
CEB8:   out    (c),a      		// select OPLL register (now in A)
CEBA:   nop               		// wait 5 cycles
CEBB:   inc    c          		// increase c (another 5 cycles)
CEBC:   pop    af         		// get af value back 
CEBD:   out    (c),a      		// set OPLL register to value now in A
CEBF:   pop    bc      			// get bc back    
CEC0:   ret               		// return to caller 
Page 1/2
| 2