Dragon's Lair for MSX2 - introdemo

by NYYRIKKI on 04-05-2006, 13:55
Topic: Software
Languages:

Out of the blue, the Finnish MSX developer NYYRIKKI sent us some very interesting news on a new project he has been working on: a port of the classic interactive animation movie game Dragon's Lair to MSX2. Due to the massive amount of data needed, the game requires CD-ROM, Harddisk or CompactFlash media to be run from, but for that you get an amazing full-screen animation experience. With that in mind, an MSX2 with 64kB VRAM and MSX-Audio/MSX-MUSIC are surprisingly low system requirements.

On the Dragon's Lair for MSX2 website you can now download a 5.5MB preview of the game, which shows the introdemo to the game. As MSX-MUSIC support is still experimental, running the demo with an MSX-Audio cartridge is highly recommended.

Relevant link: Dragon's Lair for MSX2 website

Comments (72)

By only_69

Hero (565)

only_69's picture

04-05-2006, 14:00

Just to say Congratulations!!! Terrific!!

By snout

Ascended (15187)

snout's picture

04-05-2006, 14:20

omfg... this engine eats EVA for breakfast! How on earth did you do that?!

By Morg

Master (142)

Morg's picture

04-05-2006, 15:41

I have an SCSI interface, and I can't load the Demo. Anyway to do it?

Regards,
AlexCryingCrying

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 15:53

I just took EVA source and deleted 50% of the code Tongue

Actually it is not that different from EVA. It is just used in another way... Actually it is possible to go even faster to get better fps, but the original Dragon's Lair does not actually have more frames. Big smile I was also so lazy, that I didn't want to start adjusting the sample timing again...

However... maybe next version will have triple buffering, that will improve framerate and sound quality a bit...

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 15:58

Sorry Morg, I don't think, that I'm going to implement SCSI support. It would require too much work :-(

By msd

Paragon (1532)

msd's picture

04-05-2006, 16:03

What extra work does it require?

By Sonic_aka_T

Enlighted (4130)

Sonic_aka_T's picture

04-05-2006, 16:09

Once you come up with a 'final version', perhaps it would be possible to make a standard file-format for it? If you'd give me the specs it would be nice to have another video-format to support in ViewMSX. Wink I had also been looking into slightly modifying/updating the EVA format, but the lack of hardware makes it a tad tedious. So, if you're going to do it; even better! Tongue If I may be so bold as to make a few suggestions: Try to include some file and frame headers, it shouldn't be too hard, and can make life at lot easier for file-type detection. Also (if you want ofcoz) try to make a replayer that can be easily used in games, with options such as preffered sound-chip, no mode-change, no cls, and maybe a variable DX/DY (iirc it uses HMMC, right?). It should be nice for people to be able to replay a small 'eva' file without actually having to code stuff themselves.

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 16:09

Triple buffering does not need much extra work, SCSI support means writing direct access functions to most used devices such as CD-ROM and HD. This version already has 8 different optimized disk reading routines. Big smile

By Randam

Paragon (1431)

Randam's picture

04-05-2006, 16:23

A pity you're not planning scsi support... would be nice to see. Is there possibly an emulator which supports IDE interface emulation?

By snout

Ascended (15187)

snout's picture

04-05-2006, 16:29

openMSX does!

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 16:50

I think, this "How did you do it" feeling is not gonna last whole day. Tongue

To Sonic_aka_T:

I already have a player that supports both of the "EVA formats" In this version HMMC was thrown to trashcan and direct VDP access was used instead, but you are right... EVA originally uses HMMC. File header is quite a hard to implement, when you play with direct sector access. This means, that whole data moves and sector reading routines need to be changed to different locations in the code.

I also don't see any point for making PC replayer, when there is no tools to convert data to this format. As I'm not a PC coder, there is no much I can do... This conversion was pretty much made by hand. Frames were converted with BMP2MSX and sample was edited with GoldWave. The thing was put together with really crappy and slow VBScript, that read the files 1 byte at a time as text file Smile

If you really want to make a replayer, just take your EVA replayer routine switch to "Hi resolution mode" Wink take the picture data and put first 6KB to address 0, next 6KB to #2000 use next bytes to initialize pallette and trow rest of the bytes away. That's all folks. No magic inside, magic is in the data. Smile Sample timing has not been altered.

Ps. I have tested, that this works with OpenMSX (at least with MSX tR config)

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 19:31

NYYRIKKI: indeed it does, but with the Boosted MSX2 config, I seem to have no sound at all... Is that normal?

By Latok

msx guru (3960)

Latok's picture

04-05-2006, 19:41

Watching and listening full screen movie on my MSX right now in complete disbelief.....Smile

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 19:42

I just uploaded some screenshots to the download page, just in case everyone does not have the required hardware Tongue

manuel: I don't know... Is there anyone, who has tried this on real MSX2?

By mars2000you

Enlighted (6568)

mars2000you's picture

04-05-2006, 19:43

Seems the same in blueMSX 2.5 beta : no sound in boosted MSX2, but I have sound on boosted Turbo-R (I don't have yet tried a non-boosted machine)

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 19:48

Hmm... Have you tried to force the sound with commandline parameters?

By mars2000you

Enlighted (6568)

mars2000you's picture

04-05-2006, 20:02

Here some blueMSX screenshots :

www.msxblue.com/dragon1.png

www.msxblue.com/dragon2.png

www.msxblue.com/dragon3.png

www.msxblue.com/dragon4.png

www.msxblue.com/dragon5.png

www.msxblue.com/dragon6.png

www.msxblue.com/dragon7.png

www.msxblue.com/dragon8.png

www.msxblue.com/dragon9.png

www.msxblue.com/dragon10.png

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 20:04

Hmm, your video settings are a bit dark...

What kind of parameters do you mean, NYYRIKKI? The MSX-AUDIO is there... really!

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 20:12

To use MSX-AUDIO in for example MSX tR, you have to use /A parameter. For full list of parameters, just write DEMO to commandline.

By mars2000you

Enlighted (6568)

mars2000you's picture

04-05-2006, 20:17

Ah .. Ok .. it was not in the readme.txt file. I understand now why I hear PCM on the Turbo-R machine in blueMSX !

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 20:21

On turboR nor on MSX2 do I get any sound with the /a parameter...

By mars2000you

Enlighted (6568)

mars2000you's picture

04-05-2006, 20:22

the same with the /a parameter on blueMSX beta

By mars2000you

Enlighted (6568)

mars2000you's picture

04-05-2006, 20:29

the other parameters work very good (manuel, try /c !) .... the /m parameter is indeed experimental Smile

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 20:30

This is the code I use to activate MSX-AUDIO:

	ld	a, #18	;Activate PCM in Music Module.
	out	(#C0), a
	ld	a, 1
	out	(#C1), a
	ld	a, #19
	out	(#C0), a
	ld	a, 1
	out	(#C1), a
	ld	a, #0A
	ld	c, a	; DAC port.

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 20:43

Any tips on how to initialize MSX-Music correctly for playing samples is more than wellcome. I know it can be done... At the moment either I get really low volume or then there is some strange noice in the backround...

By KNM

Master (172)

KNM's picture

04-05-2006, 20:48

Testing now on my ST....And this is BREATHTAKING!!!If this could be improved....wooooooooowwwwww!AMAZING JOB,dude !!LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!LOL!

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 21:24

I just know this:

Procedure PcmPlay(SourceAddr,SampleLength,SampleFrequency:Integer;
                  Volume:Byte); {REM Volume 0..7}
  Var SampleRate :Integer;
      Temp       :Integer;
  Begin
    Temp := Trunc(SampleFrequency/1000);
    SampleRate := Trunc(3600/Temp);

    Inline(
           $F3/
           $3E/$18/$D3/$C0/$3E/$FF/$D3/$C1/$3E/$19/$D3/$C0/$3E/$08/$D3/$C1/
           $3E/$04/$D3/$C0/$3E/$08/$D3/$C1/$3E/$04/$D3/$C0/$3E/$80/$D3/$C1/
           $3E/$0D/$D3/$C0/$3a/SampleRate  /$D3/$C1/
           $3E/$0E/$D3/$C0/$3a/SampleRate+1/$D3/$C1/
           $3E/$08/$D3/$C0/$3E/$0C/$D3/$C1/
           $3E/$17/$D3/$C0/$3a/Volume     /$D3/$C1/
           $2a/SourceAddr/$ed/$4b/SampleLength/
           $3E/$16/$D3/$C0/$3E/$C0/$D3/$C1/$3E/$15/$D3/$C0/$7E/$D3/$C1/
           $23/$0B/$78/$B1/$28/$10/$DB/$C0/$CB/$67/$28/$FA/$3E/$04/$D3/$C0/
           $3E/$80/$D3/$C1/$18/$E3/$3E/$04/$D3/$C0/$3E/$78/$D3/$C1/$3E/$04/
           $D3/$C0/$3E/$80/$D3/$C1/$3E/$08/$D3/$C0/$3E/$00/$D3/$C1/
           $3E/$18/$D3/$C0/$3E/$FF/$D3/$C1/$3E/$19/$D3/$C0/$3E/$00/$D3/$C1/
           $FB
            );
   End;   { PcmPlay }

Tongue (code by Kari Lammassaari)

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 21:46

I did not actually read that, but by first look, that seems to be ADPCM play routine for MSX-Audio. In this demo I use DAC to produce PCM sound out of MSX-Audio, so it is completely different part of the chip.

What I'm interested about is playing PCM sample trough MSX-Music aka. FM-PAC, FM-PAK, OPLL, YM-2413... just to make things clear. Smile

By enribar

Paragon (1224)

enribar's picture

04-05-2006, 21:59

On my MSX2+... Great!!!
One request: can you make a DSK floppy image to use immediatly with openMSX?
Thank you.

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 22:18

No, it's the PCM routine. The ADPCM routine is another one, in the same file.

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 22:19

And indeed, it's for MSX-AUDIO. But that's what you asked.

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 22:20

enribar: 9MB doesn't fit on a floppy.... but t00b can tell you how to put it on an openMSX IDE disk Tongue

By wolf_

Ambassador_ (10135)

wolf_'s picture

04-05-2006, 22:36

nyyyyriiiiiki.. do you use compression on each videoframe? Or is it just the raw 12304 bytes per frame?

By Whizzy

Master (213)

Whizzy's picture

04-05-2006, 22:40

! A M A Z I N G !

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

04-05-2006, 23:05

nyyyyriiiiiki.. do you use compression on each videoframe? Or is it just the raw 12304 bytes per frame?
The video part of the frame is 12320 bytes of raw data. Sound data is about 1312 bytes / frame and the routine reads 15360 bytes / frame, so actually there is about 1728 bytes / frame, that are currently not in use!´

From this it is possible to calculate, that there is currently MUCH to improve, but as I said before there are no more frames in original Dragon's Lair, so I did not find it usefull to start modifying those 8 already optimized disk / sample play routines at this point. When you ZIP the file the size difference is not much...

By mars2000you

Enlighted (6568)

mars2000you's picture

04-05-2006, 23:05

enribar : I can send you the file that I've created ... It works also very good in openMSX (just tested it), but the blueMSX interface is really more handful and you don't need to edit a file or to put the harddisk image in a very special directory.

By Manuel

Ascended (19691)

Manuel's picture

04-05-2006, 23:24

By the way (also to mars2000you): the openMSX Teams welcomes programmers who are interested in GUI development. Send us a mail. Also Windows developers are still welcome, as we get about 0 response.

By wolf_

Ambassador_ (10135)

wolf_'s picture

04-05-2006, 23:37

The video part of the frame is 12320 bytes of raw data

ahyes, mixed-up 16 colors with 32 bytes data Tongue

Anyway, would playing 24-channels o' moonsound be possible with all this? (with the standard or a somewhat optimized mbwave player)

By mars2000you

Enlighted (6568)

mars2000you's picture

04-05-2006, 23:41

The harddisk image is now online :

http://www.msxblue.com/Dragontest.zip

To use it in openMSX, the unzipped file (Dragontest.dsk) must be placed in a special directory (see the user's manual).
You also need to edit the hardwareconfig.xml file in share/extensions/ide as following :
- name of the file : Dragontest.dsk (in stead of ide.dsk)
- size of the file : 16 (in stead of 100)

By wolf_

Ambassador_ (10135)

wolf_'s picture

05-05-2006, 00:01

hmm... at 30fps, a 5 minute video (without audio) would be 110.880.000 bytes.. that's uhm.. a lot.. Tongue

Anyway, the image-quality is rather good, as long as things are moving at film- or video-framerate, the color-spill is hardly of an issue..

By Maggoo

Paragon (1218)

Maggoo's picture

05-05-2006, 00:28

Extremely cool ! Never thought I'd see that kind of video on a MSX2. BTW, I only get sound when I use TR emulation. Nothing no with MSX2, be it with Audio or fmpac.

Kuddos ! Big smile

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

05-05-2006, 00:30

wolf: I don't know MBWave replayer very well (my MoonSound has been out of order for years) but AFAIK it needs quite a lot of time and it really can't be splitted to small parts.

In case of MBWave I would propably try to modify the routine so, that it would "play" the data to OpenMSX debug device, then I would take the RAW MoonSound data and try to interleave it to the video. This way it would need less CPU time, than current solution, but sound quality would be same as in real MBWave replayer.

When it comes to video speed, 30fps is way out of MSX possibilitys... Half of it (15fps) might be just possible, but I'm not sure about that either... At lest that would need some more optimization....

By Edwin

Paragon (1182)

Edwin's picture

05-05-2006, 00:39

Considering that just the number of OUTI's a z80 can do a second gives you an upper limit of 16FPS. I think 15 fps will be a bit much when loading and sound is included.

It looks impressive though! And I think prodatron will want to have a word with you about low level disk drivers Wink

By iamweasel2

Paladin (722)

iamweasel2's picture

05-05-2006, 04:53

Nice work! About the sound, you could consider using CD audio instead of FM or MSX Audio. That way, besides having CD quality music, you would have all the cpu time only to deal with the video.

By BiFi

Enlighted (4348)

BiFi's picture

05-05-2006, 08:18

A pity you're not planning scsi support... would be nice to see. Is there possibly an emulator which supports IDE interface emulation?
The next version of blueMSX will most likely have IDE support as well.

By BiFi

Enlighted (4348)

BiFi's picture

05-05-2006, 08:40

This is the code I use to activate MSX-AUDIO:

	ld	a, #18	;Activate PCM in Music Module.
	out	(#C0), a
	ld	a, 1
	out	(#C1), a
	ld	a, #19
	out	(#C0), a
	ld	a, 1
	out	(#C1), a
	ld	a, #0A
	ld	c, a	; DAC port.


This is NOT for MSX-AUDIO... This is only for the Philips Music Module.

	ld	b,5
	ld	hl,.table
.loop:	ld	a,(hl)
	out	($c0),a
	inc	hl
	ld	a,(hl)
	out	($c1),a
	inc	hl
	djnz	.loop
	ld	a,$15
	out	($c0),a
	ld	a,$c1
	ld	c,a
	ret
		;reg data
.table:	db	$04,$00
	db	$04,$80
	db	$16,$00
	db	$17,$07
	db	$08,$04

This is for MSX-AUDIO.

By viejo_archivero

Paragon (1395)

viejo_archivero's picture

05-05-2006, 10:53

NYYRIKKI: No MSX1 version? Sad. Nah, just jokin' LOL!, awesome work!. Well done, NYYRIKKI! Wink

By Sousuke

Master (177)

Sousuke's picture

05-05-2006, 11:38

This is just awesome, NYYRIKKI! Big smile
Can't wait to test it on my real machine Wink

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

05-05-2006, 12:02

Thank you for all these good reactions, it is great to see, that you like this demo!

BiFi: Thank you for this code. The only MSX-Audio I've ever had was Phillips Music-Module, so my knowledge was not accurate. I'll fix this to next version.

iamweasel2: If I would use CD for audio playing, I would need to put the data some other device. Although CD-drives are quite advanced today, you can't play music and read data at the same time AFAIK. CD data troughput is high, but seek times are slow.

Edwin: These low level disk routines are not made by me, but ofcource I'll help Prodatron in all possible ways I can. It seems, that direct I/O to IDE is not very difficult... If you look at EVA sources and documentation in Sunrise www-page, you should be able to make your own routines in no time.

By sunrise

Paragon (1091)

sunrise's picture

05-05-2006, 13:37

Nyrikki, what is exactly wrong with your moonsound. Maybe time to let repair it, we have spareparts !

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

05-05-2006, 14:32

I think the OPL4 is damaged... I connected it to PC sound input and it went dead... I think this is relatively common problem... I hear something with really low volume and the sound is broken.

By BiFi

Enlighted (4348)

BiFi's picture

05-05-2006, 14:35

sounds to me the end-trap is busted because of the lacking short-circuit protection when inserting/deleting the jack connector?

By iamweasel2

Paladin (722)

iamweasel2's picture

05-05-2006, 15:05

NYYRIKKI: Yes, the game would need to be in HD and the songs would be played by the CD, and the z80 would be free to work with the video only. About the delay, it is possible to make your code wait until CD is ready (I know it sucks, but that's how things are). I know it is not the perfect solution, but if you want to get the best result possible, you could try using CD. I believe it can make the MSX version of Dragon's Lair even better than already is. Smile

By iamweasel2

Paladin (722)

iamweasel2's picture

05-05-2006, 15:07

About BlueMSX, the next version will suport CD-ROM as well? I'm looking for develop/play audio CD games in an emulator. Smile

By spl

Paragon (1470)

spl's picture

05-05-2006, 16:04

Why my IDE+RS232 is crashed!!!!! CryingCrying

But only wathing the screenshots, reactions and readme I can say... this is absolutelly AMAZING!!! TOTALLY GREAT!

By mars2000you

Enlighted (6568)

mars2000you's picture

05-05-2006, 18:00

Probably not CD-ROM support in blueMSX 2.5, but it will be though a great version with many new features and improvements !

By [D-Tail]

Ascended (8263)

[D-Tail]'s picture

05-05-2006, 19:32

NYYRIKKI: I just watched your demo... It's amazing Big smile I like it very much! Samples are of crystal clear quality and the video is superb! Thanks man!

By Ivan

Ascended (9373)

Ivan's picture

05-05-2006, 21:16

NYYRIKKI: Talk with Matra and release the game on cartridge! Copyright issues? Rename the game to Dragon's Liar Tongue Tongue

By mars2000you

Enlighted (6568)

mars2000you's picture

06-05-2006, 18:01

http://koti.mbnet.fi/asukkaat/dragon/dragonupdate.zip

Nyyrikki has just uploaded an update ... I guess that MSX-AUDIO must work now :)

By sunrise

Paragon (1091)

sunrise's picture

07-05-2006, 20:48

Nyrikki, the spareparts includes the opl4 , 10 copies according my stock

By ARTRAG

Enlighted (6980)

ARTRAG's picture

09-05-2006, 16:03

@NYYRIKKI

few questions

what is the format of the original video?
what is the frame size?
how many colors it has ?

apart bmp2msx, what processing have you done?

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

09-05-2006, 23:04

I started the conversion from 720x480 interlaced MPEG video. I used AVIedit (??? not sure anymore) to extract frames, remove interlace and resize the pictures. I think original video was digitized with 16777216 colors.

By dvik

Prophet (2200)

dvik's picture

10-05-2006, 00:52

Very impressive. This is one of the coolest thing I've ever seen on an MSX2.

By ARTRAG

Enlighted (6980)

ARTRAG's picture

10-05-2006, 16:52

@ NYYRIKKI
What is the sampling frequency of your original audio? Is it PCM at 8bit?
What is the frame rate of your 720x480 interlaced original MPEG video?

@dvik
What about to develop an ad hoc PC encoder able to encode the MPEG video to scr2 across the frames in order to optimise palette transitions and colorclash and to encode the audio using PCMENC in order to use the PSG?

By dvik

Prophet (2200)

dvik's picture

10-05-2006, 18:38

@ARTRAG

I think that the quality of the video could be improved a bit by looking at several frames, similar to the PSG sample player. But at 12 fps I wonder how much can be done to improve the quality, but I'm sure it can be improved a bit at least.

When it comes to audio, the biggest problem is that its not that much CPU left for the audio. Assuming that each video frame requires the whole screen to be updated (12320 bytes), its only 44200 CPU cycles per second for audio which isn't enough for a 8kHz PSG sample player.

So to get enough CPU cycles for decent PSG audio, the video frames needs to be rendered, so that not the entire screen is updated each frame. This is most likely not too hard, but certanly not trivial.
I updated the waves demo to use the new PSG sample player and with 8kHz audio, about 50% of the CPU is free for other things.

@NYYRIKKI, What frequency does you audio replayer have?

By ARTRAG

Enlighted (6980)

ARTRAG's picture

10-05-2006, 19:07

"I updated the waves demo to use the new PSG sample player and with 8kHz audio, about 50% of the CPU is free for other things."

How many psg trasition per sample you use ?

About the video, palette and colorclash could both improve even at 12fps.

I see that any colorclash reduction could imply a sort of lowpass in time,
but also interlaced videos are more or less (perceptually) filtered in time.

At lest it is possible to force smooth palette transitions between frames

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

10-05-2006, 22:19

Original sample is 44KHz 16bit stereo, ogg encoded @ about 120kbps. The MPEG framerate is 30fps, but as I said, all animation frames are included in the MSX version.

I think, that PCM could use PSG in theory... There is still 1.7KB empty data in each frame, that is now just sent to unused I/O port... maybe that could be used to make the sample play less CPU intensive. Now the sample plays @ about 15KHz

By Manuel

Ascended (19691)

Manuel's picture

21-04-2007, 11:47

For those who still haven't seen it: http://video.google.nl/videoplay?docid=8499169208337423408

Note that I recorded it on turboR, because the sound quality is a lot better than when using MSX-AUDIO.

By NYYRIKKI

Enlighted (6095)

NYYRIKKI's picture

07-05-2007, 01:24

Hey, that's nice... Thank you!

By sd_snatcher

Prophet (3677)

sd_snatcher's picture

22-09-2007, 21:08

NYYRIKKI:

Is it possible to make an SCR12 version? Theoretically the code would be the same for both versions, just the video stream would be different.

By Edwin

Paragon (1182)

Edwin's picture

22-09-2007, 23:24

Actually, this demo is SC2/4. So not quite the same as you might think. Especially considering the amount of data.

By Salamander2

Expert (124)

Salamander2's picture

24-09-2008, 12:20

discovered this thing only now. WHAT AN ABSURD!!!
oO

it's too much GOOD!