Skip to content

Commit f997297

Browse files
committed
1 parent 6bcd5cc commit f997297

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

src/devices/cpu/tlcs900/tmp94c241.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,11 +1396,6 @@ void tmp94c241_device::tlcs900_check_hdma()
13961396

13971397
void tmp94c241_device::tlcs900_check_irqs()
13981398
{
1399-
int irq_vectors[8] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1400-
int level = 0;
1401-
int irq = -1;
1402-
int i;
1403-
14041399
/* Check for NMI */
14051400
if ( m_nmi_state == ASSERT_LINE )
14061401
{
@@ -1416,9 +1411,10 @@ void tmp94c241_device::tlcs900_check_irqs()
14161411
return;
14171412
}
14181413

1419-
/* Check regular irqs */
1420-
// the smaller the vector value, the higher the priority
1421-
for( i = NUM_MASKABLE_IRQS - 1; i >= 0; i-- )
1414+
/* Check regular irqs
1415+
The smaller the vector value, the higher the priority. */
1416+
int irq_vectors[8] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1417+
for( int i = NUM_MASKABLE_IRQS - 1; i >= 0; i-- )
14221418
{
14231419
if ( m_int_reg[tmp94c241_irq_vector_map[i].reg] & tmp94c241_irq_vector_map[i].iff )
14241420
{
@@ -1435,7 +1431,9 @@ void tmp94c241_device::tlcs900_check_irqs()
14351431
}
14361432

14371433
/* Check highest allowed priority irq */
1438-
for( i = std::max( 1, ( ( m_sr.b.h & 0x70 ) >> 4 ) ); i < 7; i++ )
1434+
int irq = -1;
1435+
int level = 0;
1436+
for( int i = std::max( 1, ( ( m_sr.b.h & 0x70 ) >> 4 ) ); i < 7; i++ )
14391437
{
14401438
if ( irq_vectors[i] >= 0 )
14411439
{

src/devices/cpu/tlcs900/tmp95c061.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,6 @@ void tmp95c061_device::tlcs900_check_hdma()
492492

493493
void tmp95c061_device::tlcs900_check_irqs()
494494
{
495-
int irq_vectors[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1 };
496-
int level = 0;
497-
int irq = -1;
498-
int i;
499-
500495
/* Check for NMI */
501496
if ( m_nmi_state == ASSERT_LINE )
502497
{
@@ -516,7 +511,8 @@ void tmp95c061_device::tlcs900_check_irqs()
516511
}
517512

518513
/* Check regular irqs */
519-
for( i = 0; i < NUM_MASKABLE_IRQS; i++ )
514+
int irq_vectors[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1 };
515+
for( int i = 0; i < NUM_MASKABLE_IRQS; i++ )
520516
{
521517
if ( m_int_reg[tmp95c061_irq_vector_map[i].reg] & tmp95c061_irq_vector_map[i].iff )
522518
{
@@ -533,7 +529,9 @@ void tmp95c061_device::tlcs900_check_irqs()
533529
}
534530

535531
/* Check highest allowed priority irq */
536-
for ( i = std::max( 1, ( ( m_sr.b.h & 0x70 ) >> 4 ) ); i < 7; i++ )
532+
int irq = -1;
533+
int level = 0;
534+
for ( int i = std::max( 1, ( ( m_sr.b.h & 0x70 ) >> 4 ) ); i < 7; i++ )
537535
{
538536
if ( irq_vectors[i] >= 0 )
539537
{

src/devices/cpu/tlcs900/tmp95c063.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,6 @@ void tmp95c063_device::tlcs900_check_hdma()
416416

417417
void tmp95c063_device::tlcs900_check_irqs()
418418
{
419-
int irq_vectors[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1 };
420-
int level = 0;
421-
int irq = -1;
422-
int i;
423-
424419
/* Check for NMI */
425420
if ( m_nmi_state == ASSERT_LINE )
426421
{
@@ -440,7 +435,8 @@ void tmp95c063_device::tlcs900_check_irqs()
440435
}
441436

442437
/* Check regular irqs */
443-
for( i = 0; i < NUM_MASKABLE_IRQS; i++ )
438+
int irq_vectors[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1 };
439+
for( int i = 0; i < NUM_MASKABLE_IRQS; i++ )
444440
{
445441
if ( m_int_reg[tmp95c063_irq_vector_map[i].reg] & tmp95c063_irq_vector_map[i].iff )
446442
{
@@ -457,7 +453,9 @@ void tmp95c063_device::tlcs900_check_irqs()
457453
}
458454

459455
/* Check highest allowed priority irq */
460-
for ( i = std::max( 1, ( ( m_sr.b.h & 0x70 ) >> 4 ) ); i < 7; i++ )
456+
int irq = -1;
457+
int level = 0;
458+
for ( int i = std::max( 1, ( ( m_sr.b.h & 0x70 ) >> 4 ) ); i < 7; i++ )
461459
{
462460
if ( irq_vectors[i] >= 0 )
463461
{

0 commit comments

Comments
 (0)