Moved stderr debug info into stdout

Things that needed to be printed to stdout were being printed to stderr. This was moved so only errs are printed to stderr.
main
RenDev 3 years ago
parent 436d726feb
commit e00b5d4844
  1. 2
      bus.c
  2. 8
      cartridge.c

@ -171,7 +171,7 @@ int main(int argc, char * argv[]){
debug_print_instruction(cpu, busRead8(cpu->PC));
printRegisters(cpu);
printCpu(cpu);
fprintf(stderr, "\n\n----\n%i\n-----", iterations);
printf("\n\n----\n%i\n-----", iterations);
#endif
if(activateCpuNmiBool){

@ -10,7 +10,11 @@ word not_handling_this = 0x100; //0xFF + 1
void loadRomfileHeader(FILE * romfile){
byte verificationToken[3] = "NES";
for(byte i = 0; i < 3; i++)
if(verificationToken[i] != getc(romfile)) return;
if(verificationToken[i] != getc(romfile)){
fprintf(stderr, "ERR: This is not a NES Rom!!!\n");
exit(EXIT_FAILURE);
return;
}
getc(romfile); //get over the DOS EOF byte
Header.PRG_BANKS = getc(romfile);
Header.CHR_BANKS = getc(romfile);
@ -22,7 +26,7 @@ void loadRomfileHeader(FILE * romfile){
void initBanks(char name[]){
FILE * romfile;
romfile = fopen(name, "r");
romfile = fopen(name, "rb");
#ifdef DEBUG
if(romfile == NULL){

Loading…
Cancel
Save