skawo |
Posted on 02-17-16, 09:29 pm (rev. 5 by skawo on 05-21-19, 11:40 pm)
|
Karma: 19757 Posts: 260/1100 Since: 04-02-13 |
This is something I've finished working on a couple days ago. It's a video and audio player that will replace the regular NSMBDS cutscene. Messy, half-working code ahead, because I don't know what the fuck I'm doing. The video player portion is a version of Dirbaio's fireworlds video player, modified to compile and work in NSMBDS: https://github.com/Dirbaio/Fireworlds/blob/master/fireworlds-game/arm9/source/video.itcm.cpp The audio player portion is a version of Dirabio's WavPlayer code from the now-dead NSMBCR: https://github.com/Dirbaio/NSMBCR/blob/master/source/wavplayer.cpp 1. Usage 1. Set up the ASM Hacks template using DevkitARM v41. 2. Copy the "IntroCode.cpp" and "IntroCode.h" files from /source in the downloaded RAR into the template's /source folder. You also need the "nsmb.h" file that's included with the template, but may skip the others. 3. Put a ROM in the template folder and open it in NSMBe. 4. Insert the code into the ROM by pressing "Run make and insert" on the "Tools/Options" tab in NSMBe. 5. Replace ARCHIVE/vs_wrecking_crew.narc with "SampleVideo.vds" and replace ARCHIVE/wrecking_crew.narc with "SampleMusic.raw" 2. Making your own video: 1. Render an avi video at the DS resolution (256x192) 2. Install VLC Media Player 3. Go into Tools -> Preferences. At the bottom-left corner, select "All" in "Show settings" 4. Click on "Video/Filters" and check "Scene video filter" 5. Expand the "Video/Filters" list and select "Scene filter" 6. Create a directory somewhere and enter a path to said directory under "Directory path prefix" 7. Change image format to jpg. 8. Change recording ratio to 1. 9. Press save. Close VLC Media Player. 10. Reopen VLC and open the rendered avi video with it. Let it play all the way through. 11. The directory you made earlier should now have images in it. Now, run VideoMake.jar and point it to said directory. After a while, it'll create an "out.vds" file in the same folder. You're done. 3. Making your own sound clip: 1. Open a sound file in Audacity 2. If the track is stereo, split it to Mono by opening a drop-down list next to individual track's delete button (top-left corner of the track listing). 3. From that same drop-down list, select "Set rate -> other" and put it at 32768. 4. Input the same rate at the bottom in "Project Rate" field. 5. Go to File->Export audio. Save as type "Other uncompressed types". Click "options" and select "RAW (headerless) as the header and "Signed 8bit PCM" as the encoding. Confirm. You're done. 4. Problems 1. Couldn't get any timers working, so the video plays significantly faster than it does on a flashcart. By modifying line 246, you can even make it run 60fps on an emulator. 2. If you "Go back to titlescreen" and try to open a new file, no sound will play. 3. The video/audio player is picky with files and may crash if it dislikes one. 5. Download https://www.dropbox.com/s/9vnl1cf6f7ffs1j/VideoIntro.rar?dl=0 |
RicBent |
Posted on 02-17-16, 09:31 pm
|
Mariomaster
Karma: 8528 Posts: 537/1681 Since: 06-09-12 |
MarioFanatic64 |
Posted on 02-18-16, 03:57 am (rev. 1 by MarioFanatic64 on 02-18-16, 08:51 am)
|
Roy Koopa
The guy who does things. Karma: 12694 Posts: 1974/2796 Since: 07-01-11 |
I'll have to try this out, it's the perfect way to convey the plot of a hack, which I've been trying to do for years. I hope the game can handle longer length intros... Do you suppose it's possible to make an outro when the final boss is beaten? New Super Mario Bros.: Clone Tag Team 1+2 / New Super Mario Advance + Take 2 / Super Mario: Endless Earth My two greatest assets have been mental stability and being, like, really smart. |
skawo |
Posted on 02-18-16, 10:27 am (rev. 1 by skawo on 02-18-16, 12:41 pm)
|
Karma: 19757 Posts: 261/1100 Since: 04-02-13 |
It would be, sure. Just add a hook there and change the videoStart() and wavPlayer::playFile() functions to take an int FileID instead of it being hardcoded.
|
Sherry_ |
Posted on 02-25-16, 05:32 pm
|
Karma: 1430 Posts: 38/355 Since: 05-26-15 |
Sorry, but this problem thing means?
|
shibboleet |
Posted on 02-25-16, 08:36 pm
|
Mole
Normal user Karma: 2013 Posts: 147/359 Since: 07-08-12 |
read the error, maybe?
nsmb.h doesn't exist |
TheKoopaKingdom |
Posted on 02-25-16, 09:15 pm (rev. 1 by ImageBot on 11-21-16, 03:19 am)
|
Shyguy
Karma: 463 Posts: 37/83 Since: 02-12-15 |
IIRC it's in the ASM Hacking Project Template.
_________________________ Website | Twitter MK8 Modding Central |
MarioFanatic64 |
Posted on 02-26-16, 08:38 am (rev. 2 by MarioFanatic64 on 02-26-16, 09:58 am)
|
Roy Koopa
The guy who does things. Karma: 12694 Posts: 1978/2796 Since: 07-01-11 |
So my intro video has 10,989 frames. This won't end well. EDIT: Getting an error inserting the ASM hack. "'make' is not recognized as an internal or external command, operable program or batch file." No idea what to do, because as per usual I am completely useless. EDIT*2: I just realized I didn't have devkitPro. New Super Mario Bros.: Clone Tag Team 1+2 / New Super Mario Advance + Take 2 / Super Mario: Endless Earth My two greatest assets have been mental stability and being, like, really smart. |
KingYoshi |
Posted on 02-26-16, 09:59 am (rev. 1 by KingYoshi on 02-26-16, 10:00 am)
|
Fire Brother
Eugene Karma: 3646 Posts: 638/1120 Since: 11-29-11 |
Posted by MarioFanatic64 So my intro video has 10,989 frames. This won't end well. EDIT: Getting an error inserting the ASM hack. "'make' is not recognized as an internal or external command, operable program or batch file." No idea what to do, because as per usual I am completely useless. Weird. Is this the first time you're trying to insert an ASM Hack? EDIT*2: I just realized I didn't have devkitPro. Nevermind. |
MarioFanatic64 |
Posted on 02-26-16, 10:01 am (rev. 1 by MarioFanatic64 on 02-26-16, 10:01 am)
|
Roy Koopa
The guy who does things. Karma: 12694 Posts: 1979/2796 Since: 07-01-11 |
New Super Mario Bros.: Clone Tag Team 1+2 / New Super Mario Advance + Take 2 / Super Mario: Endless Earth My two greatest assets have been mental stability and being, like, really smart. |
KingYoshi |
Posted on 02-26-16, 10:59 am
|
Fire Brother
Eugene Karma: 3646 Posts: 639/1120 Since: 11-29-11 |
Ah okay. Well, to prevent that you might not get it to work, here are things that I had to do to get inserting ASM Hacks to work.
1.) The path from your hard disk to the ASM Hacking Template on your computer shouldn't have any folders with spaces in their names. Otherwise, 'make' and insert won't work. For example: Wrong: G:\NSMB Stuff\ASM_Hacking_New Right: G:\NSMB_Stuff\ASM_Hacking_New 2.) Remove '-lgcc' in the 'Makefile' file. (Don't do this if 'make' and insert works without removing '-lgcc') |
skawo |
Posted on 02-26-16, 12:41 pm
|
Karma: 19757 Posts: 267/1100 Since: 04-02-13 |
Well, did your intro work? ~11000 frames does seem like it mightn't.
|
MarioFanatic64 |
Posted on 02-26-16, 02:31 pm
|
Roy Koopa
The guy who does things. Karma: 12694 Posts: 1980/2796 Since: 07-01-11 |
Haven't tested it yet. Have to stretch out my data usage over a month so devkitPro will have to wait a little. The output file for the video was 68MB though. XD New Super Mario Bros.: Clone Tag Team 1+2 / New Super Mario Advance + Take 2 / Super Mario: Endless Earth My two greatest assets have been mental stability and being, like, really smart. |
Sherry_ |
Posted on 02-26-16, 02:34 pm
|
Karma: 1430 Posts: 39/355 Since: 05-26-15 |
Oh... Thanks, but, this problem?
|
skawo |
Posted on 02-26-16, 02:51 pm (rev. 2 by skawo on 02-26-16, 03:03 pm)
|
Karma: 19757 Posts: 268/1100 Since: 04-02-13 |
Huh. Which version of Devkit Pro did you install?
|
Sherry_ |
Posted on 02-26-16, 02:59 pm
|
Karma: 1430 Posts: 40/355 Since: 05-26-15 |
I think the 1.6.0
|
skawo |
Posted on 02-26-16, 03:03 pm (rev. 1 by skawo on 02-26-16, 03:04 pm)
|
Karma: 19757 Posts: 269/1100 Since: 04-02-13 |
...Oh. Right. You NEED -lgcc in the makefile to compile this. I think devkitARM rev41 has it setup right.
|
MarioFanatic64 |
Posted on 02-28-16, 08:49 am (rev. 2 by MarioFanatic64 on 02-28-16, 09:21 am)
|
Roy Koopa
The guy who does things. Karma: 12694 Posts: 1983/2796 Since: 07-01-11 |
So yeah. Long intros aren't a good idea. The game crashed when trying to play the intro. Just to be sure, I'll try re-compiling the video file. If I can't get it working (and if you'll be so kind) could you see about getting videos to run at 15fps? EDIT: It's almost working. It'll play the first twenty seconds or so (no music) then skip straight to World 1. New Super Mario Bros.: Clone Tag Team 1+2 / New Super Mario Advance + Take 2 / Super Mario: Endless Earth My two greatest assets have been mental stability and being, like, really smart. |
KingYoshi |
Posted on 02-28-16, 09:06 am (rev. 2 by KingYoshi on 02-28-16, 09:37 am)
|
Fire Brother
Eugene Karma: 3646 Posts: 640/1120 Since: 11-29-11 |
Well, maybe, someday, we'll be able to change the movements of Mario, Peach and Bowser Jr in the original video.
EDIT: But I wouldn't know how that intro exactly works. All animations of the 3D models are stored in the NSBCAs. But there has to be some file (I think) which arranges when each 3D model has to make which animation and determines the coordinates of each model on each moment. EDIT2: Now I'm thinking about it, I think it would be kinda the same as sprites work. |
skawo |
Posted on 02-28-16, 10:31 am
|
Karma: 19757 Posts: 272/1100 Since: 04-02-13 |
Posted by MarioFanatic64 EDIT: It's almost working. It'll play the first twenty seconds or so (no music) then skip straight to World 1. Edit the for loop in PlayOutIntro() function. |