1. spencercw
  2. gb_emulator

Commits

spencercw  committed 2eb63d7

#38 Fix the frequency of the Game Boy timers.

  • Participants
  • Parent commits f6db33d
  • Branches default

Comments (0)

Files changed (1)

File gb_emulator/include/gb_emulator/constants.hpp

View file
 
 /* Interesting durations */
 const unsigned CPU_CLOCK                = 4194304;   /* CPU clock frequency */
-const unsigned CYCLES_PER_FRAME         = 70224;     /* Number of clock cycles per frame */
+const unsigned CYCLES_PER_FRAME         = 70224;     /* Number of clock cycles per frame */
 const double   FRAME_DURATION           = static_cast<double>(CYCLES_PER_FRAME) / CPU_CLOCK;  /* Frame duration in seconds */
 const unsigned SAMPLE_RATE              = 48000;     /* Audio sample rate */
 const double   SAMPLE_CYCLES            = CPU_CLOCK / 4. / SAMPLE_RATE;  /* Number of CPU cycles per audio sample */
 const double   COLOUR_RATIO             = 255. / 31.;    /* Ratio between GBC and standard colours */
 
 /* Timers */
-const int DIVIDER_CYCLES                = 256;
-const int TIMER0_CYCLES                 = 1024;
-const int TIMER1_CYCLES                 = 16;
-const int TIMER2_CYCLES                 = 64;
-const int TIMER3_CYCLES                 = 256;
+const int DIVIDER_CYCLES                = 64;
+const int TIMER0_CYCLES                 = 256;
+const int TIMER1_CYCLES                 = 4;
+const int TIMER2_CYCLES                 = 16;
+const int TIMER3_CYCLES                 = 64;
 
 #endif