This C++ program will read a FMV file and output a FMV file that has at least two active controllers.
Warning: Untested. I don't know which order the bytes are in the FMV (fds, p1,p2 or p2,p1,fds or something else).
#include <cstdio>
using namespace std;
typedef unsigned long uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;
int main(void)
{
FILE *i = fopen("gradius.fmv", "rb"); /* put here your input file /
FILE *o = fopen("gradius.fmv-fixed", "wb"); /* put here your output file */
uint8 Header[144];
fseek(i,0,SEEK_END);
unsigned LENGTH = (ftell(i) - sizeof(Header));
rewind(i);
fread(Header,144,1,i);
uint8 oldmask = Header[5];
const uint8 newmask = oldmask | 0xC0;
Header[5] = newmask;
unsigned bytes_per_frame = 0;
if(oldmask & 0x20) ++bytes_per_frame;//fds
if(oldmask & 0x40) ++bytes_per_frame;//p2
if(oldmask & 0x80) ++bytes_per_frame;//p1
uint32 nframes = LENGTH / bytes_per_frame;
fwrite(Header,144,1,o);
for(uint32 f=0; f<nframes; ++f)
{
uint8 d;
// p1
d=0;
if(oldmask & 0x80) fread(&d, 1, 1, i);
if(newmask & 0x80) fwrite(&d, 1, 1, o);
// p2
d=0;
if(oldmask & 0x40) fread(&d, 1, 1, i);
if(newmask & 0x40) fwrite(&d, 1, 1, o);
// fds
d=0;
if(oldmask & 0x20) fread(&d, 1, 1, i);
if(newmask & 0x20) fwrite(&d, 1, 1, o);
}
fclose(i);
fclose(o);
}
EDIT: Of course it must fwrite to output (o), not input (i).