Previous 15994 Revisions Next

r1410 Saturday 15th December, 2007 at 17:31:33 UTC by Wilbert Pol
[GAMEBOY] Fixed a bug in the handling of 256 and 1024 cycle timers.
[docs]messnew.txt
[src/mess/machine]gb.c

src/mess/machine/gb.c
r1409r1410
107107UINT8 gbLastTama5Command;
108108/* Timer related globals */
109109UINT16   gb_divcount;
110UINT8 gb_timer_count;
111110UINT8 gb_timer_shift;
112111/* Serial I/O related */
113112static UINT32 SIOCount;         /* Serial I/O counter                          */
r1409r1410
236235   gb_serial_timer = timer_alloc( gb_serial_timer_proc , NULL);
237236   timer_enable( gb_serial_timer, 0 );
238237
238   gb_divcount = 0;
239239}
240240
241241MACHINE_START( gb )
r1409r1410
705705   case 0x07:                  /* TAC - Timer control */
706706      data |= 0xF8;
707707      gb_timer_shift = timer_shifts[data & 0x03];
708      gb_timer_count = 1 << gb_timer_shift;
709708      /* Check if timer is just enabled */
710709      if ( ( data & 0x04 ) && ! ( TIMEFRQ & 0x04 ) ) {
711710         TIMECNT = TIMEMOD;
r1409r1410
17621761   if ( TIMEFRQ & 0x04 ) {
17631762      UINT16 old_count = old_gb_divcount >> gb_timer_shift;
17641763      UINT16 new_count = gb_divcount >> gb_timer_shift;
1765      if ( cycles > gb_timer_count ) {
1764      if ( cycles > ( 1 << gb_timer_shift ) ) {
17661765         gb_timer_increment();
1767         old_gb_divcount += gb_timer_count;
1766         old_gb_divcount += ( 1 << gb_timer_shift );
17681767         old_count++;
17691768      }
17701769      if ( new_count != old_count ) {
docs/messnew.txt
r1409r1410
1414
1515- [GAMEBOY] Several fixes to the video timing.  [Wilbert Pol]
1616
17- [GAMEBOY] Fixed a bug in the handling of 256 and 1024 cycle timers.  [Wilbert Pol]
18
1719- [QL] Added sound. [Curt Coder]
1820
1921- [SG1000] Fixed keyboard/joystick detection. (bug #1444) [Curt Coder]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team