Jump to content
IGNORED

Dragon's Lair full motion video for the ColecoVision


opcode

Recommended Posts

Btw, there is another problem: I had said that the original movie was 12 frames/s. That isn't completely true. Most the time animation is indeed 12 frames/s, but during some segments it is 24 frames/s. So probably I would also need a tool to blend frames together.

Can't you just skip every odd frame?

Link to comment
Share on other sites

Btw, there is another problem: I had said that the original movie was 12 frames/s. That isn't completely true. Most the time animation is indeed 12 frames/s, but during some segments it is 24 frames/s. So probably I would also need a tool to blend frames together.

Can't you just skip every odd frame?

 

That's what I am doing with the gif files, but I am afraid that animation quality could suffer...

Link to comment
Share on other sites

Ok, time for some very heavy technical stuff... :)

 

Lets start with a NTSC ColecoVision (60Hz):

Z80 Frequency: 3,579,545

Scanlines per frame: 262.5

Active scanlines: 192

VBlank scanlines: 70.5

Z80 cycles per frame: ~59,671

Z80 cycles per scanline: ~227

Necessary delay between VDP accesses during active display: 28 cycles

Maximum number of VDP accesses during active scanline: 227/28 = 8 -> 1.5KB for all 192 active scanlines (worst case for 262 scanlies -> 2KB)

 

Sound:

1 sample/scanline -> 262 lines x 60 frames = 15.35kHz

 

So, total transfer rate from CF:

- video: 9KB/movie frame x 12 movie frames = 108KB/s

- sound: 15.35KB/s

- Total: 123.35KB/s

 

All would be fine if it wasn't for the game logic. The movie format is 256x144, which needs to be loaded during 5 frames. That means 28~29 movie lines per frame. A movie line is 64 bytes long (32 bytes pattern, 32 bytes color), so we need 1856 VDP transfer per frame, plus 262 audio transfers per frame, for a total of 2118 transfer. Now supposing that each transfer takes 28 cycles (which isn't always true), we get 59,304 CPU cycles per frames. Very close to the total available cycles per frame. Now, if I can get 9 transfers per scanline (8 bytes for video and a byte for sound), then I would reduce the number of used cycles to: 232 scanlines worth of video/audio * 227 cycles/scanline + 30 scanlines worth of audio only * 28 cycles (worst case) = 53504 cycles.

That gives us 6,000 free cycles per frame. If the code is broken into 5 pieces (because we need 5 frames for each movie frame), that would give us 30,000 free cycles per movie frame for game logic. That is basically half of the total CPU cycles we normally get per frame, which is reasonable for a simple game like DL.

While I believe the video player would be fairly simple to implement, integrating the player with game logic and still keeping everything in sync would be quite a challenge, though an interesting one... :)

Link to comment
Share on other sites

I think the toughest challenge here would actually be the sound transfer, which should occur in exactly even intervals (i.e. once per scanline, as you wrote), or else the sound would be horribly distorted. One problem here is that, to my knowledge, the Colecovision VDP has no scanline counter... it only generates one interrupt per frame. Or is there a timer in the Colecovision which would be able to generate interrupts that often? If not, you're in for some serious cycle counting...

Where did you get the 28 cycle count between VDP accesses? I've written a demo for the Creativision, which uses the same VDP, and the first version of it overloaded the VDP with data, that is, it wrote data faster than the VDP could handle it, so the VDP dropped some of those writes which occured outside of the vertical blanking interval. However, I managed to solve that problem by blanking the VDP output while the picture gets drawn. This, however, obviously isn't an option here.

The Creativision uses a 6502 CPU, I think running at 2 MHz (or was it 1 Mhz? I'm not exactly sure...), and for all you cycle counters out there, the code overloading the VDP in the active display area, but not in the blanking area, ran as follows (note: VDP_Data_Write is not a zeropage address, but GraphicsPointer is):

	LDX #$00
LDY #$03	;3 x 256 bytes
VDP_Write_Outer_Loop	
STX VDP_Data_Write
INX
BNE VDP_Write_Outer_Loop
DEY
BNE VDP_Write_Outer_Loop

 

(This writes the pattern name table)

 

However, the VDP was not overloaded by the following code, which copies the pattern and color tables:

	LDX #$18		;prepare loop - we have to write $1800 bytes of data (that is, 6K for each loop)
LDY #$00
GraphicsCopy1
LDA (GraphicsPointer),Y
STA VDP_Data_Write
INY
BNE GraphicsCopy1	;end of inner loop
INC GraphicsPointer+1
DEX
BNE GraphicsCopy1
RTS			;end outer loop

Link to comment
Share on other sites

I think the toughest challenge here would actually be the sound transfer, which should occur in exactly even intervals (i.e. once per scanline, as you wrote), or else the sound would be horribly distorted. One problem here is that, to my knowledge, the Colecovision VDP has no scanline counter... it only generates one interrupt per frame. Or is there a timer in the Colecovision which would be able to generate interrupts that often? If not, you're in for some serious cycle counting...

 

Yep, no timer. It would be all cycle counting.

 

Where did you get the 28 cycle count between VDP accesses?

 

The TMS9918 datasheet says that VDP access window in Graphics II is 8us during active display. The CV Z80 runs at 3,579,545Hz. That means that a CPU cycle takes 0.279us. If you divide 8us by 0.279us, you get 28~29 cycles. However the CV Z80 adds a wait state per instruction byte (or M1 cycle), so you can take that into account when doing the math.

Link to comment
Share on other sites

Hm, interesting... The TMS9918 also says that 8us is the worst case time, and happens when sprites are being used.

Since DL doesn't need sprites, I would disable them and see how fast I can go.... :ponder:

Anyway the fastest I could go is:

 

IN A,(IDE_DATA_LOW)	  ;11 cycles + 2 wait states
OUT (VDPDTA),A			   ;11 cycles + 2 wait states
IN A,(IDE_DATA_HIGH)	 ;11 cycles + 2 wait states
OUT (VDPDTA),A			  ;11 cycles + 2 wait states

 

So in the end I need 52 cycles for two transfers, or 26 cycles per transfer. Since we have 227 cycles per scanline, I would transfer almost 9 bytes per scanline, which sounds bad at first...

Ok, I need to send 1856 bytes of video per frame. That are 48,256 cycles. If I transfer a sound byte every 8 video bytes, I get 234 cycles per A/V block transfer. That means that I can transfer 255 of those blocks per frame, which in turn means that sound will be exactly 15kHz, not 15.35kHz as I said before.

Now, with 255 data blocks per frame I just need to use 232 of them to get the video transfer rate I mentioned. So 23 of them would be used for general game logic, for a total of 23,920 cycles every movie frame. I still think it's ok for a simple game like this.

And moving the data blocks and logic blocks around I can also minimize video tearing... Maybe I could use NMIs every 5th frame to keep things in perfect sync...

Link to comment
Share on other sites

  • 1 month later...

So your doing is basically what they did with the Gameboy color as for the

 

Intro of Rayman

Lufia animations

 

Removing colors

Shrinking each individual frame

having a separate program run the video

alternating sounds with mods or alike sounds

 

 

Dragon Slayer sounds cool but what about that other FMV game. The one where the guy loses his muscles, where he's in space fighting to get back his "man hood"

 

If that ever releases. I will be there to enjoy as long as it is a single cart :roll:

 

You will make heads roll if you could get it to look like the Sega CD animation from the get go.

 

Or maybe the entire animation could be sprites :cool: then all you would have to worry about is adding the extra hardware.

Link to comment
Share on other sites

Dragon Slayer sounds cool but what about that other FMV game. The one where the guy loses his muscles, where he's in space fighting to get back his "man hood"

 

I think you mean Dragon's Lair!

 

I'm not trying to be some anal retentive tool here just so you know! I just wanted to point it out in a friendly manner.

 

The other FMV game where the guy tries to get back his manhood is Space Ace; it was developed by Don Bluth, the same person that also developed Dragon's Lair (the same game this thread is about).

Edited by STGuy1040
Link to comment
Share on other sites

  • 9 months later...
I think the MSX Dragon's Lair had the same approach as you probably have in mind; converting every frame with its own tileset. Looking at the screenshots, it looks like you also changed the palette (v99x8?).

 

Another interesting approach is done by Arturo Ragozini. He created a video encoder that does a search for the optimum tileset for a couple of frames, rather than an optimum tileset for a single frame of video. You don't really require that if you take the flashcard as a medium, but it can provide you more cpu time during playback (and dedicate that to eg. sound).

 

Interesting reads about his approach;

 

http://www.msx.org/forumtopic7309.html

http://ragozini.googlepages.com/vdpenc

 

Thanks a lot, joyrex. I am going to check that. In the meantime, I created this animated gif, just to see how the final video would look. It's just 5s, but probably enough to show the quality of the video (which isn't that great, btw). I suggest to watch it full screen, from some distance. Perhaps I should try to increase error diffusion, from .25 to .43... More dithering but better colors...

 

Wow, that was quite impressive. Definitely a good project for the future!

Link to comment
Share on other sites

I just saw this thread and i didn't read it totally as it is a old one, so may be it has been already stated previously , if it is the case : sorry.

 

But speaking of D.L on Coleco , i read somewhere that the project has been started and some prototype existed. But not a version as we can see on ADAM.

 

The prototype was a Expension Module that allowed to plug a Lazer Disc Device. The Arcade Game was on the Lazer Disc , and the coleco was just here to manage input and control the video sequence to display.

 

the video was displayed on screen via the coleco thanks to the Color #15 (Transparent color) the VDC behaving as a Genlock. Additionnal information and graphism can be displayed above the video using other colors.

 

I have found this project very interresting . It is pity it has been canceled and only the Adam version (hower quite good) appeared.

 

Nowadays , it could be funny to do that same thing but using a DVD reader and it is really easy to find Dragon's lair edition on DVD.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...