News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Chrono Trigger FMV's (SNES/MSU-1)  (Read 5213 times)

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 183
    • View Profile
Chrono Trigger FMV's (SNES/MSU-1)
« on: October 18, 2016, 03:21:10 pm »
I've started work on getting all 10 FMV's running in Chrono Trigger on the SNES via the MSU-1.  There is already a hack by smkdan and Ramsis to play just the intro video, but I couldn't make much sense of it because I had never done any video or DMA code before.  So, I figured by the time I had learned enough to make sense of that code or one of the other existing video players, it was just simpler (and more educational) to write my own, which I have done.

https://www.youtube.com/watch?v=kJ7CT6bFPlw (is there a youtube embed tag I'm not finding?)

Now, comes the harder part, getting this code into the game.  I'm looking for any documentation, or anybody with knowledge of the event and dialog systems, so I can find good hook points to insert the video playback.  I also need to find the video buffers in main RAM so I can clean up after myself and reset the display after playback has finished.  The latter probably isn't too hard to figure out with some code tracing on the DMA registers, but if anybody already happens to know where they are, it would save me the trouble.  I should be able to manage this myself, but if the documentation exists, there's no point in me reinventing the wheel.

Also, I'll eventually look into doing some more work on the video files themselves to improve the quality.  There's a lot of room for improvement with some better size/color reduction algorithms, as well as a more suitable positional dithering algorithm, but I'll have to implement those myself, so I'm putting that off for now.

ThegreatBen

  • Sr. Member
  • ****
  • Posts: 496
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #1 on: October 18, 2016, 04:21:13 pm »
Other msu-1 stuff doesn't seem to work on Roms edited by temporal flux so if you could make them compatible that'd be great, cause I'd love to add the videos and symphony soundtrack to the CT hack I'm working on.

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 183
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #2 on: October 18, 2016, 04:25:40 pm »
I'm working on reverse-engineering the SPC engine in the hopes of rewriting DarkShock's MSU-1 audio patch a bit more cleanly.  I'm not sure if that will help, but it might.

ThegreatBen

  • Sr. Member
  • ****
  • Posts: 496
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #3 on: October 18, 2016, 04:34:17 pm »
Well I wish you luck and I'll give it a try once it's ready.

julayla

  • Full Member
  • ***
  • Posts: 165
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #4 on: October 19, 2016, 12:50:09 am »
Good luck on your project. To me, this is how Square should've done their PS1 release of Chrono Trigger in the first place: With the CD quality music used during the 2D gaming.

Mauron

  • Sr. Member
  • ****
  • Posts: 476
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #5 on: October 19, 2016, 03:50:54 am »
You might be able to replace event command 01 (Unknown Command/Color Crash) with custom code to play the FMV's. Assignment/Value-to-Mem can handle setting the video index and whatever else is needed. I'm not sure what's needed for playback. Calls from the overworld could be done with the Function/External Function command.
Mauron wuz here.

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 183
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #6 on: October 25, 2016, 02:11:19 pm »
You might be able to replace event command 01 (Unknown Command/Color Crash) with custom code to play the FMV's. Assignment/Value-to-Mem can handle setting the video index and whatever else is needed. I'm not sure what's needed for playback. Calls from the overworld could be done with the Function/External Function command.

This is the kind of stuff I'm asking about.  I don't know what those commands are or how they are invoked.  I'm looking for some kind of documentation on that kind of thing (if it exists).  So far, what I have is a fully working video player, the videos are converted (though there's still a lot of work to do there quality-wise, at least for now I have a video that plays and once I manage to increase the quality, I can just swap out the data file without any code changes), the audio code works (though there are still a couple of audio commands like fading that I need to implement), and I have the intro video inserted.  Basically, what I have is the ability to simply call PLAY_VIDEO(x) and the video plays, for all 10 of them.  I just need to figure out *where* to make that call, and how to clean up afterward.

Chronosplit

  • Hero Member
  • *****
  • Posts: 1275
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #7 on: October 25, 2016, 03:03:53 pm »
Good luck on your project. To me, this is how Square should've done their PS1 release of Chrono Trigger in the first place: With the CD quality music used during the 2D gaming.
I can imagine it as both text fix patches+racing fix+this.  I'm 89% sure that the other three would work with this as combined they're almost completely text based with a light "footprint" as not much if any freespace is really used (if it doesn't I'll see about making a text fix version from scratch that will be compatible once the FMVs are done).

Either way it'd be almost like the PS1 version never happened.  I'll be keeping an eye on this.
« Last Edit: October 26, 2016, 12:20:23 am by Chronosplit »

Mauron

  • Sr. Member
  • ****
  • Posts: 476
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #8 on: October 25, 2016, 04:29:14 pm »
Event command 01 is a dummy command that screws up the screen and crashes the game. It's only one byte, so you'll need to store your video index beforehand in the event code. 0x7FFFFF should be safe.

Event command 01 is at 0x005F6E-0x005F73 - enough for a JSL YOURCODE and RTS.

Temporal Flux can handle inserting the events. In any location, you can click on the events link to show that location's events. Typically Object 0 will be setup, with Objects 1-7 being the PCs, and further objects being something else. Sometimes Object 1 is tile manipulation, and the PCs are pushed backwards.

I don't think there's a very good tutorial for events at the moment. There's a heavily outdated version for an old version of Temporal Flux, that may help some.

Will 7E5E2D-7E63AC give you enough RAM to work with? That's battle data, and is cleared at the start of a battle.

I don't think any videos are called from the overworld - if they are, I may need to find different RAM addresses to play with.
Mauron wuz here.

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 183
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #9 on: October 26, 2016, 06:14:40 pm »
I need a handful of variables for audio playback state for MSU-1 BGM replacement, but those I can fit at 7E1EE0.  For the video playback, I only need a single byte to tell the subroutine what video to play, and everything else is handled on the stack.  I'll have to try and figure out event insertion in Temporal Flux.

Mauron

  • Sr. Member
  • ****
  • Posts: 476
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #10 on: October 27, 2016, 02:53:19 am »
That 7E1EE0 address sounds familiar, but I can't find any notes on what it's for.

Events will jump between objects as needed. If talking to an NPC causes the lead party member to do something, that NPC will call code on one of the PC objects. For Frog's cutscene opening the mountain, you can probably insert the necessary command at the end of one of Frog's events.
Mauron wuz here.

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 183
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #11 on: November 08, 2016, 11:02:59 pm »
Well, looks like I have it working! :D

https://www.youtube.com/watch?v=vGkFO0C14-o

It's not done, by a fair bit (I need to re-upload the BG tiles into VRAM after playing the video, hence the black screen immediately after), but the rest at this point pretty much comes down to just doing the work that I know how to do, and then the inevitable debugging.  The hard part is done!

ThegreatBen

  • Sr. Member
  • ****
  • Posts: 496
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #12 on: November 09, 2016, 12:13:57 pm »
Can't wait

GHANMI

  • Hero Member
  • *****
  • Posts: 706
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #13 on: November 09, 2016, 03:30:46 pm »
Congratulations :)

It would be lovely if you kept the old intro though, I think it plays twice with two variations (only major difference is the camera angle in the racing minigame) and there's a variable in the RAM keeping track of it, so maybe the FMV playback routine could check for it so that the first variation could be used for the FMV and the second one for the normal retro one?

And considering you're likely having a mode for playing the old soundtrack (the one the MSU-1 hacks have when the emulator doesn't support MSU-1), modding the Stereo/Mono configuration in the menu to be "No BGM/Old BGM (Mono)/Old BGM (Stereo)/Arranged BGM" would be nice to have too. Well, I wish the Japanese-only ending pic got added too, but that's outside of the scope of this hack.

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 183
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #14 on: November 09, 2016, 07:17:48 pm »
It would be lovely if you kept the old intro though
I've thought about it.  We'll see.

Quote
And considering you're likely having a mode for playing the old soundtrack (the one the MSU-1 hacks have when the emulator doesn't support MSU-1), modding the Stereo/Mono configuration in the menu to be "No BGM/Old BGM (Mono)/Old BGM (Stereo)/Arranged BGM" would be nice to have too.
No point.  If you want the original SPC music, just don't install the .pcm files.

Quote
Well, I wish the Japanese-only ending pic got added too, but that's outside of the scope of this hack.
You'd have to show me, I've never seen it.

GHANMI

  • Hero Member
  • *****
  • Posts: 706
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #15 on: November 09, 2016, 08:46:03 pm »
You'd have to show me, I've never seen it.

This:




It's also in the DS version but in higher res, and one of the official artbooks probably has it in its full glory (it would look much better in 8BPP rather than the extra dithered low color depth variant the JP SNES version and DS versions went with, and with MSU-1 the size wouldn't be a concern).

Also thanks for the fast reply.

One last thing. The transition after the message box closed to the FMV seems a bit awkward (too fast). Would you mind adding a slight delay of like one second before the FMV?

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 183
    • View Profile
Re: Chrono Trigger FMV\'s (SNES/MSU-1)
« Reply #16 on: November 09, 2016, 10:10:04 pm »
(it would look much better in 8BPP rather than the extra dithered low color depth variant the JP SNES version and DS versions went with, and with MSU-1 the size wouldn't be a concern).

I'm still limited to the SNES frame size and color depth (RGB555, 256 colors)

November 12, 2016, 10:19:26 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Still have to figure out the end credits, but...  :woot!:

https://www.youtube.com/watch?v=f6ajZEQm1_U
« Last Edit: November 12, 2016, 10:19:26 pm by qwertymodo »

Mugi

  • Sr. Member
  • ****
  • Posts: 288
  • Personal text
    • View Profile
    • Blacklabel-translations
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #17 on: November 14, 2016, 02:58:48 pm »
Im really liking what im seeing in this project so far, good job !

I saw this though: https://www.youtube.com/watch?v=f6ajZEQm1_U&feature=youtu.be&t=591
and what instantly came into my mind as an improvement suggestion (since judging by this thread you're really set out on perfecting this), was the notion that for example the frog's masamune fmw,
basically the game-engine scripted part after the video simply repeats what happens on the video itself, maybe those could be cut out ?
In PSP we trust.

ThegreatBen

  • Sr. Member
  • ****
  • Posts: 496
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #18 on: November 14, 2016, 04:07:06 pm »
As long as this project is compatible with temporal flux it would be fairly simple.

Chronosplit

  • Hero Member
  • *****
  • Posts: 1275
    • View Profile
Re: Chrono Trigger FMV's (SNES/MSU-1)
« Reply #19 on: November 14, 2016, 04:28:04 pm »
This was even in the DS version (because FMVs are optional), but yeah the scripts involved are extremely editable under Temporal Flux with some testing.