Skip to content

Instantly share code, notes, and snippets.

@taddeimania
Last active October 6, 2015 19:06
Show Gist options
  • Save taddeimania/86803eb10d10b3e0ae44 to your computer and use it in GitHub Desktop.
Save taddeimania/86803eb10d10b3e0ae44 to your computer and use it in GitHub Desktop.
Reading Home / Away team from Tecmo Super Bowl savestate in C
include<stdio.h>
int main()
{
unsigned char buffer[10000];
char home[2];
FILE *ptr;
ptr = fopen("1.nst","rb");
fseek(ptr, 0, SEEK_CUR);
fread(buffer, sizeof(buffer), 1, ptr);
/* home team name */
for(int i = 0; i <= sizeof(home) ; i++) {
home[i] = buffer[3087 + i];
}
printf("Home: %s\n", home);
/* away team name */
char away[2];
for(int i = 0; i <= sizeof(away) ; i++) {
away[i] = buffer[3087 + 32 + i];
}
printf("Away: %s\n", away);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment