Last active
January 26, 2023 03:13
-
-
Save andrea-calligaris/a9b80b055ca669ce3e22862e12d548f2 to your computer and use it in GitHub Desktop.
[FF8:R] disable victory fanfare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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