Skip to content

Instantly share code, notes, and snippets.

@andrea-calligaris
Last active January 26, 2023 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrea-calligaris/a9b80b055ca669ce3e22862e12d548f2 to your computer and use it in GitHub Desktop.
Save andrea-calligaris/a9b80b055ca669ce3e22862e12d548f2 to your computer and use it in GitHub Desktop.
[FF8:R] disable victory fanfare
/*
* nofanfare.c
*
* Edits "scene.out" from "battle.fs" in order to disable the victory fanfare
* for every encounter in the game.
*
* Distributed under WTFPL.
*/
#include <stdio.h>
int
main(void)
{
unsigned char encounters[1024][128];
FILE *file_in;
FILE *file_out;
printf("No fanfare v0.0\n");
file_in = fopen("scene.out", "rb");
for (int i = 0; i < 1024; i++) {
/* Read next encounter block. */
fread(encounters[i], 128, 1, file_in);
/* Change the correct bit in the battle flags. */
encounters[i][1] |= 0x02;
}
fclose(file_in);
printf("Saving the file...\n");
file_out = fopen("scene.out", "wb");
fwrite(encounters, sizeof(unsigned char), 1024 * 128, file_out);
fclose(file_out);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment