Skip to content

Commit

Permalink
Merge pull request #20 from ogamespec/master
Browse files Browse the repository at this point in the history
cleanup
  • Loading branch information
ogamespec authored Jul 17, 2024
2 parents 77ff639 + 081697c commit 8dc18bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions gb.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ extern unsigned long gb_divbase;
extern unsigned long gb_timbase;
extern uint8_t gb_timshift;

#define BENCHMARK 0

extern unsigned benchmark_sound, benchmark_gfx;
extern int sound_enabled;
10 changes: 8 additions & 2 deletions misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ void load_game(char *name)
return;
}

fread(cart.data, 1, size, f);
int readed = fread(cart.data, 1, size, f);
if (readed != size) {
__log ("Did not read as many bytes as specified!");
}
fclose(f);
}

Expand Down Expand Up @@ -110,7 +113,10 @@ void load_SRAM(uint8_t* ram_ptr, long size)
return;
}

fread(ram_ptr, 1, size, f);
int readed = fread(ram_ptr, 1, size, f);
if (readed != size) {
__log ("Did not read as many bytes as specified!");
}
fclose(f);
}

Expand Down
13 changes: 6 additions & 7 deletions ppu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ void ppu_vsync()
{
TimerInit();
Timer();
//fps_time = oldtime = GetTickCount();
first = 0;
}

Expand Down Expand Up @@ -267,13 +266,13 @@ void ppu_vsync()
bm_g/=8;
bm_s/=8;
bm_o=time-bm_s-bm_g;
//if(time)
// sprintf(title, "GameBoy-%15s [%u fps]O:%02dG:%02dS:%02d", cart.title,
// 1000000/time,(bm_o*100)/time,(bm_g*100)/time,(bm_s*100)/time);
//else
#if BENCHMARK
if(time)
sprintf(title, "GameBoy - %15s [%u fps]O:%02dG:%02dS:%02d", cart.title,
1000000/time,(bm_o*100)/time,(bm_g*100)/time,(bm_s*100)/time);
else
#endif
sprintf(title, "GameBoy - %s [%u fps]", cart.title, 1000000/time);
sdl_win_update_title(title);
}

//oldtime = GetTickCount();
}

0 comments on commit 8dc18bb

Please sign in to comment.