Extract Gobliiins content

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

User avatar
DrMcCoy
ScummVM Developer
Posts: 595
Joined: Sat Dec 17, 2005 1:33 pm
Location: Braunschweig, Germany
Contact:

Post by DrMcCoy »

gomtuu wrote:AdPlug won't play the files
Would have surprised me if it had, actually. ;)
gomtuu wrote:Has someone already written a utility like that, for instance?
Not that I know of, at least.
gomtuu wrote:I know I could use DOSBox to dump the OPL instructions to a DRO file
Well, the player in ScummVM plugs into our AdLib emulator which takes OPL instructions anyway. You'd "just" have to rewrite AdLib::writeOPL() to produce a dump in the format AdPlug understands (if you're familiar with one, that is).
deadagain wrote:So, any hints on the recent compress_gob.exe (and its somewhat cryptic <Conf file> input)
It's no program for compressing data files further. It's just the opposite to extract_gob_stk. I.e. it recreated extracted STK files. Nothing more, nothing less.

You could produce files marginally (read: a few KB) smaller than the input files, if you set all files to compressed instead of only some like in the original STK files.

Anyway, currently the compression function is broken and produces, so you can't even do that. The only thing it does is creating bigger files. :)
gomtuu
Posts: 5
Joined: Mon Jun 15, 2009 2:11 am

Post by gomtuu »

DrMcCoy wrote:Would have surprised me if it had, actually. ;)
Me too, but I figured it was worth a shot. :)
DrMcCoy wrote:Well, the player in ScummVM plugs into our AdLib emulator which takes OPL instructions anyway. You'd "just" have to rewrite AdLib::writeOPL() to produce a dump in the format AdPlug understands (if you're familiar with one, that is).
That had occured to me, but dumping the OPL instructions that way would have the same disadvantages as capturing from DOSBox. Unless I figured out how to have it stop recording and start a new file when a new music file was loaded. I guess that could work... Incidentally, it looks like the older DOSBox DRO format is pretty simple, so I'm not too worried about that part.

I'm confused about the AdLib::setVoice function in adlib.cpp. It looks like it's supposed to read two separate 26-byte sub-records (because the dataPtr assignment includes "+ i * 0x1A") within a 56-byte instrument record ("+ instr * 0x38"), but then it goes on to read 26 uint16s. Won't that cause it to read bytes 0-52 when i == 0 and then bytes 26-78 when i == 1? Or am I just misreading it?

Thanks for replying!
-gomtuu
User avatar
Strangerke
ScummVM Developer
Posts: 335
Joined: Wed Sep 06, 2006 8:39 am
Location: Belgium

Post by Strangerke »

Additional info concerning extract_gob_stk : the "cryptic Conf file" used is the one created by extract_gob_stk. In summary, it contains the file format (the latest STK21 file format is not yet handled, but foreseen) then a list of files to be included in the STK, with a flag (1 : compressed, 0 : uncompressed). As DrMcCoy told, there's a problem in the compression algorithm that causes some files to have 'some bytes' different after a re-extraction.
User avatar
DrMcCoy
ScummVM Developer
Posts: 595
Joined: Sat Dec 17, 2005 1:33 pm
Location: Braunschweig, Germany
Contact:

Post by DrMcCoy »

gomtuu wrote:Unless I figured out how to have it stop recording and start a new file when a new music file was loaded. I guess that could work...
You can even hook into the song end check to have it stop recording when it loops the song from the beginning.
gomtuu wrote:I'm confused about the AdLib::setVoice function
Can't tell you much about why the AdLib player works, I'm afraid. Only that it works. :P

Basically, it's based on a standalone player by Patrick Combet (aka Dorian Gray). Dunno if he understood why it works. :)
gomtuu
Posts: 5
Joined: Mon Jun 15, 2009 2:11 am

Post by gomtuu »

DrMcCoy wrote:Basically, it's based on a standalone player by Patrick Combet (aka Dorian Gray). Dunno if he understood why it works. :)
If there's a standalone player, I'd be interested in looking at it. Adapting that to output its OPL commands to a file would probably be easier than hacking ScummVM to do it. Do you know if it's still available? I couldn't find anything with a quick Google search.

Thanks,
gomtuu
User avatar
DrMcCoy
ScummVM Developer
Posts: 595
Joined: Sat Dec 17, 2005 1:33 pm
Location: Braunschweig, Germany
Contact:

Post by DrMcCoy »

gomtuu wrote:If there's a standalone player, I'd be interested in looking at it.
I'm afraid I can't do that. Sorry.
gomtuu wrote:Adapting that to output its OPL commands to a file would probably be easier than hacking ScummVM to do it.
Not really. Especially since everything is in French ;).

Anyway, hacking ScummVM to do what you want is really quite easy. Just hook into AdLib::writeOPL() for the OPL stuff, AdLib::startPlay() for starting recording and the end check in AdLib::readBuffer() for ending it again.


EDIT: Taking out a paragraph about the AdLib files in Ween being mainly numbered resources in EXT files instead of "normal" files, since you apparently already ripped them. :)
gomtuu
Posts: 5
Joined: Mon Jun 15, 2009 2:11 am

Post by gomtuu »

DrMcCoy wrote:Anyway, hacking ScummVM to do what you want is really quite easy. Just hook into AdLib::writeOPL() for the OPL stuff, AdLib::startPlay() for starting recording and the end check in AdLib::readBuffer() for ending it again.
Success!

Well, sort of. I still have to figure out the timing. In addition to the hooks you mentioned, I also had to add a hook to output a delay between each note. I put that at the end of AdLib::pollMusic() and used "tempo" as the delay length, which works okay but doesn't sound quite as good as ScummVM itself.

Something I haven't mentioned yet is that ScummVM (0.13.1) doesn't quite play the music correctly either. There are a few notes that get dropped or sound wrong in ScummVM. I think that might have to do with timing, too, because before I put my delay at the end of AdLib::pollMusic(), I was outputting a uniform delay after every note as a test. It sounded wrong, of course, because the delays weren't the right length, but I think it was playing all the right notes. I'll need to experiment some more.
User avatar
DrMcCoy
ScummVM Developer
Posts: 595
Joined: Sat Dec 17, 2005 1:33 pm
Location: Braunschweig, Germany
Contact:

Post by DrMcCoy »

gomtuu wrote:I also had to add a hook to output a delay between each note.
You could also use g_system->getMillis(), which gives you ScummVM's running time in milliseconds, as a base for delay calculations.
gomtuu wrote:Something I haven't mentioned yet is that ScummVM (0.13.1) doesn't quite play the music correctly either. There are a few notes that get dropped or sound wrong in ScummVM. I think that might have to do with timing, too
Actually, that's a bug in the AdLib emulator we use. The code in the SVN repository lets you choose a different one, courtesy of DosBox. With this, the percussion in Gob2's title screen's music isn't broken, for example.
Hexacorde
Posts: 2
Joined: Mon Oct 06, 2008 1:09 am

Post by Hexacorde »

gomtuu wrote:If there's a standalone player, I'd be interested in looking at it.
Actually, there is this one that understands the new DRO format, and can output it to WAV.
ZakMcKracken
Posts: 3
Joined: Sat Sep 04, 2010 8:09 am

Re: Extract Gobliiins content

Post by ZakMcKracken »

Hi everyone,
I have extracted all the files from the WOODRUFF.ITK file, using the scummvm-tools-cli .
The result is a bunch of VMD and SND files.
Altough the SND files are easy to listen to (raw data), the other resources are hard to extract from the VMD files.

I wanted to rip all the sprites from the game.

Does anyone knows how to do it?

Thank you.
Collector
Posts: 549
Joined: Sun Oct 30, 2005 6:58 pm
Contact:

Re: Extract Gobliiins content

Post by Collector »

Aren't the VMDs just video files like the ones used in the SCI32 games? Try playing them with ffmpeg or even just VLC.
Post Reply