~ubuntu-branches/ubuntu/precise/mame/precise-proposed

« back to all changes in this revision

Viewing changes to src/emu/cpu/h83002/h8_8.c

  • Committer: Package Import Robot
  • Author(s): Cesare Falco
  • Date: 2011-11-30 18:50:10 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111130185010-02hcxybht1mn082w
Tags: 0.144-0ubuntu1
* New upstream release (LP: #913550)
* mame.install:
  - Added artwork/ images to be used with -effect switch
  - Be more selective with hash/ contents
* contrib/mame.ini: added /usr/share/games/mame/artwork/ to artpath

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
 
75
75
/* implementation */
76
76
 
77
 
static void h8_300_InterruptRequest(h83xx_state *h8, UINT8 source, UINT8 mode)
 
77
static void h8_300_InterruptRequest(h83xx_state *h8, UINT8 source, UINT8 state)
78
78
{
79
 
        if (source>31)
 
79
        int request = source / 32;
 
80
        int bit = source % 32;
 
81
 
 
82
        if (state)
80
83
        {
81
 
                if (mode)
82
 
                {
83
 
                        h8->h8_IRQrequestH |= (1<<(source-32));
84
 
                }
85
 
                else
86
 
                {
87
 
                        h8->h8_IRQrequestH &= ~(1<<(source-32));
88
 
                }
 
84
                h8->irq_req[request] |= (1<<bit);
89
85
        }
90
86
        else
91
87
        {
92
 
                if (mode)
93
 
                {
94
 
                        h8->h8_IRQrequestL |= (1<<source);
95
 
                }
96
 
                else
97
 
                {
98
 
                        h8->h8_IRQrequestL &= ~(1<<source);
99
 
                }
 
88
                h8->irq_req[request] &= ~(1<<bit);
100
89
        }
101
90
}
102
91
 
248
237
        device->save_item(NAME(h8->regs));
249
238
        device->save_item(NAME(h8->pc));
250
239
        device->save_item(NAME(h8->ppc));
251
 
        device->save_item(NAME(h8->h8_IRQrequestH));
252
 
        device->save_item(NAME(h8->h8_IRQrequestL));
 
240
        device->save_item(NAME(h8->irq_req));
253
241
        device->save_item(NAME(h8->ccr));
254
242
        device->save_item(NAME(h8->mode_8bit));
255
243
 
277
265
        h8->TCORA[0] = h8->TCORB[0] = 0;
278
266
        h8->TCORA[1] = h8->TCORB[1] = 0;
279
267
        h8->TCNT[0] = h8->TCNT[1] = 0;
 
268
 
 
269
        h8->has_h8speriphs = false;
280
270
}
281
271
 
282
272
static void h8_GenException(h83xx_state *h8, UINT8 vectornr)
350
340
        }
351
341
 
352
342
        // any interrupts wanted and can accept ?
353
 
        if(((h8->h8_IRQrequestH != 0) || (h8->h8_IRQrequestL != 0)) && (lv >= 0))
 
343
        if(((h8->irq_req[0] != 0) || (h8->irq_req[1]!= 0) || (h8->irq_req[2] != 0)) && (lv >= 0))
354
344
        {
355
345
                UINT8 bit, source;
356
346
                // which one ?
357
347
                for(bit = 0, source = 0xff; source == 0xff && bit < 32; bit++)
358
348
                {
359
 
                        if( h8->h8_IRQrequestL & (1<<bit) )
 
349
                        if( h8->irq_req[0] & (1<<bit) )
360
350
                        {
361
351
                                if (h8_get_priority(h8, bit) >= lv)
362
352
                                {
368
358
                // which one ?
369
359
                for(bit = 0; source == 0xff && bit < 32; bit++)
370
360
                {
371
 
                        if( h8->h8_IRQrequestH & (1<<bit) )
 
361
                        if( h8->irq_req[1] & (1<<bit) )
372
362
                        {
373
363
                                if (h8_get_priority(h8, bit + 32) >= lv)
374
364
                                {
438
428
        // check for interrupts
439
429
        if (h8->TCR[t] & (0x40<<sel))
440
430
        {
441
 
                h8->h8_IRQrequestL |= (1 << (irqbase[t] + sel));
 
431
                h8->irq_req[0] |= (1 << (irqbase[t] + sel));
442
432
        }
443
433
 
444
434
        switch ((h8->TCR[t]>>3) & 3)
666
656
                break;
667
657
        case 0xc9:
668
658
                h8->TCSR[0] = data;
669
 
                h8->h8_IRQrequestL &= ~(1 << 19);
670
 
                h8->h8_IRQrequestL &= ~(1 << 20);
671
 
                h8->h8_IRQrequestL &= ~(1 << 21);
 
659
                h8->irq_req[0] &= ~(1 << 19);
 
660
                h8->irq_req[0] &= ~(1 << 20);
 
661
                h8->irq_req[0] &= ~(1 << 21);
672
662
                recalc_8bit_timer(h8, 0);
673
663
                break;
674
664
        case 0xca:
696
686
                break;
697
687
        case 0xd1:
698
688
                h8->TCSR[1] = data;
699
 
                h8->h8_IRQrequestL &= ~(1 << 22);
700
 
                h8->h8_IRQrequestL &= ~(1 << 23);
701
 
                h8->h8_IRQrequestL &= ~(1 << 24);
 
689
                h8->irq_req[0] &= ~(1 << 22);
 
690
                h8->irq_req[0] &= ~(1 << 23);
 
691
                h8->irq_req[0] &= ~(1 << 24);
702
692
                recalc_8bit_timer(h8, 1);
703
693
                break;
704
694
        case 0xd2: