Previous 15994 Revisions Next

r1485 Friday 4th January, 2008 at 22:16:01 UTC by Wilbert Pol
[GAMEBOY] Fixed re-triggering of lyc irqs during vblank.
[src/mess/video]gb.c

src/mess/video/gb.c
r1484r1485
14331433         if ( CURLINE == CMPLINE ) {
14341434            LCDSTAT |= 0x04;
14351435         }
1436         if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
1437            cpunum_set_input_line( 0, LCD_INT, HOLD_LINE );
1438         }
14361439         timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(452,0), GB_LCD_STATE_LY9X_M1_INC, attotime_never );
14371440         break;
14381441      case GB_LCD_STATE_LY9X_M1_INC:      /* Increment scanline counter */
14391442         gb_increment_scanline();
14401443         gb_lcd.delayed_line_irq = gb_lcd.line_irq;
1441         gb_lcd.line_irq = ( ( CMPLINE == CURLINE ) && ( LCDSTAT & 0x40 ) ) ? 1 : 0;
1442         if ( ! gb_lcd.delayed_line_irq && gb_lcd.line_irq ) {
1444         gb_lcd.triggering_line_irq = ( ( CMPLINE == CURLINE ) && ( LCDSTAT & 0x40 ) ) ? 1 : 0;
1445         gb_lcd.line_irq = 0;
1446         if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) {
1447            gb_lcd.line_irq = gb_lcd.triggering_line_irq;
14431448            cpunum_set_input_line( 0, LCD_INT, HOLD_LINE );
14441449         }
14451450         /* Reset LY==LYC STAT bit */
r1484r1485
14531458      case GB_LCD_STATE_LY00_M1:      /* we stay in VBlank but current line counter should already be incremented */
14541459         /* Check LY=LYC for line #153 */
14551460         if ( gb_lcd.delayed_line_irq ) {
1456            if ( gb_lcd.line_irq ) {
1461            if ( gb_lcd.triggering_line_irq ) {
14571462               cpunum_set_input_line( 0, LCD_INT, HOLD_LINE );
14581463            }
14591464         }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team