How to use viDSnips in your DSGM project.
=========================================

DSGM does not allow the inclusion of libraries (such as viDSnips) in the build process. So when you are ready to include such a library you must copy the DSGM project files and manually edit certain files.

Step-bystep instructions:

1. Ensure the DSGM project is setup with a suitable filesystem such as NitroFS.

2. Ensure the DSGM project is setup with MP3 audio support.

3. In the DSGM project, add the viDSnips.h and IceDaddy-Reg.h include files to the project.

4. Create a C script with the relevant calls to viDSnips, e.g.:

	viDSnips_Init(1, false);
	viDSnips_Play("myVideo.vDS");
	return 0;

5. Setup an object event to call this C Script.

6. Save the project. Compile the project - this will fail with errors for the viDSnips function calls since the library is not yet included.

7. Find the project build files in some funny named directory in the root. This is the actual C source, ect. for your DSGM project.

8. Copy the project build files to some sensible place e.g. \dev\myDSproject

9. Now close DSGM. You will not be able to use DSGM again with this project so make sure you have done all you need to do with it.

10. Familiarise yourself with the source and build files and do the following checks:

	- Open GameWorks.h (in the include directory) and ensure it has the following lines near the top:
		#include "viDSnips.h"
		#include "IceDaddy-Reg.h"

	- Ensure these files (viDSnips.h and IceDaddy-Reg.h) are in the .\include directory with the GameWorks.h file

11. Create a directory (in the project root) called .\libs. Copy the viDSnips.a file into this .\libs directory.

12. Open the Makefile and add the following line to the end:
	LIBS := <full-path-to-your-project>\viDSnips.a $(LIBS)

13. Double click build.bat to build the project. It should build fine and you should have an .nds file created (or updates).

14. Run the .nds file and it should all work well.

15. Don't forget to mention viDSnips and IceDaddy in your game credits.



The demo project.
=================

Included with the viDSnips library is an example project Example_DSGM_viDSnips.rar. UnRAR the project to a suitable location. There is a DSGM project file to show what can be setup through DSGM (as outlined above).

To build the project you will first need to edit the Makefile and change the path in the last line for the LIBS := directive. Change this path to reflect your project directory so the compiler can fine the viDSnips library (viDSnips.a). Now you can run build.bat and make the demo .nds file.



Troubleshooting.
================

 - Video plays but no sound: Edit main.c (in .\source) and add the following line below Reset_Alarms():
	DSGM_Init_Sound();

 - No video, just black screen: This indicates the video file could not be loaded for some reason. Ensure the filename is correct and the case matches. I have also seen an issue with using NitroFS. To fix this a modified PALib Makefile is needed. Copy the PA_Makefile2 file to devKitPro\PAlib\lib and then edit your projects Makefile to call refer to this PA_Makefile2.


Converting video files to .vDS format.
======================================

The converter (viDSnips.exe) uses the excellent FFmpeg, under the LGPLv2.1. I have not included this here so you will need to download it yourself from ffmpeg.org. Copy ffmpeg.exe to the converter directory.

Run viDSnips.exe to select and convert your video files to .vDS format.



Enjoy.
IceDaddy

www.icedaddy.net