Created
April 17, 2018 11:20
-
-
Save ivand58/7ded2493051a45303fc3838a74c9ca3c to your computer and use it in GitHub Desktop.
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
#ifdef __GNUC__ | |
#define INLINE inline __attribute__((always_inline)) | |
#else | |
#define INLINE | |
#endif | |
{ | |
FILE *fp; | |
memset(ram,0xFF,sizeof(ram)); | |
memset(rom,0xFF,sizeof(rom)); | |
if (argc != 2) | |
{ | |
fprintf(stderr, "Usage:\nthumbulator-stm32f103 ROM.bin\n"); | |
return -1; | |
} | |
else | |
{ | |
fp=fopen(argv[1],"rb"); | |
if( fp == NULL ) { | |
perror("Error: "); | |
} | |
else | |
{ | |
unsigned int ra; | |
ra=fread(rom,1,sizeof(rom),fp); | |
if (ra < 1 ) | |
{ | |
fprintf(stderr, "The size of %s is zero!\n", argv[1]); | |
return -1; | |
} | |
fclose(fp); | |
} | |
} | |
reset(); | |
run(); | |
return(0); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment