Previous 15994 Revisions Next

r11630 Monday 23rd May, 2011 at 08:24:06 UTC by Miodrag Milanović
pic8259 and i286 core change enabling win 3.1 to boot done by Carl (no whatsnew, credited in MAME)
[src/emu/cpu/i86]ea.h
[src/emu/machine]pic8259.c

src/emu/cpu/i86/ea.h
r11629r11630
1919static unsigned EA_200(i8086_state *cpustate) { cpustate->icount-=11; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[BX]+cpustate->regs.w[SI]; cpustate->ea_seg=DefaultSeg(DS); cpustate->ea=DefaultBase(DS)+(WORD)cpustate->eo; return cpustate->ea; }
2020static unsigned EA_201(i8086_state *cpustate) { cpustate->icount-=12; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[BX]+cpustate->regs.w[DI]; cpustate->ea_seg=DefaultSeg(DS); cpustate->ea=DefaultBase(DS)+(WORD)cpustate->eo; return cpustate->ea; }
2121static unsigned EA_202(i8086_state *cpustate) { cpustate->icount-=12; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[BP]+cpustate->regs.w[SI]; cpustate->ea_seg=DefaultSeg(SS); cpustate->ea=DefaultBase(SS)+(WORD)cpustate->eo; return cpustate->ea; }
22static unsigned EA_203(i8086_state *cpustate) { cpustate->icount-=11; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[BP]+cpustate->regs.w[DI]; cpustate->ea_seg=DefaultSeg(DS); cpustate->ea=DefaultBase(SS)+(WORD)cpustate->eo; return cpustate->ea; }
22static unsigned EA_203(i8086_state *cpustate) { cpustate->icount-=11; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[BP]+cpustate->regs.w[DI]; cpustate->ea_seg=DefaultSeg(SS); cpustate->ea=DefaultBase(SS)+(WORD)cpustate->eo; return cpustate->ea; }
2323static unsigned EA_204(i8086_state *cpustate) { cpustate->icount-=9; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[SI]; cpustate->ea_seg=DefaultSeg(DS); cpustate->ea=DefaultBase(DS)+(WORD)cpustate->eo; return cpustate->ea; }
2424static unsigned EA_205(i8086_state *cpustate) { cpustate->icount-=9; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[DI]; cpustate->ea_seg=DefaultSeg(DS); cpustate->ea=DefaultBase(DS)+(WORD)cpustate->eo; return cpustate->ea; }
2525static unsigned EA_206(i8086_state *cpustate) { cpustate->icount-=9; cpustate->eo=FETCHOP; cpustate->eo+=FETCHOP<<8; cpustate->eo+=cpustate->regs.w[BP]; cpustate->ea_seg=DefaultSeg(SS); cpustate->ea=DefaultBase(SS)+(WORD)cpustate->eo; return cpustate->ea; }
src/emu/machine/pic8259.c
r11629r11630
4343
4444   pic8259_state_t state;
4545
46   UINT8 irq_lines;
47   UINT8 esr;
4846   UINT8 isr;
4947   UINT8 irr;
5048   UINT8 prio;
r11629r11630
126124static void pic8259_set_irq_line(device_t *device, int irq, int state)
127125{
128126   pic8259_t   *pic8259 = get_safe_token(device);
129   UINT8      old_irq_lines = pic8259->irq_lines;
130127
131128   if (state)
132129   {
r11629r11630
134131      if (LOG_GENERAL)
135132         logerror("pic8259_set_irq_line(): PIC set IRQ line #%d\n", irq);
136133
137      pic8259->irq_lines |= 1 << irq;
138
139      /* Set ESR bit if we see a 0 -> 1 transition */
140      if ( ! ( old_irq_lines & ( 1 << irq ) ) )
141         pic8259->esr |= ( 1 << irq );
134      pic8259->irr |= 1 << irq;
142135   }
143136   else
144137   {
r11629r11630
146139      if (LOG_GENERAL)
147140         logerror("pic8259_set_irq_line(): PIC cleared IRQ line #%d\n", irq);
148141
149      pic8259->irq_lines &= ~(1 << irq);
142      pic8259->irr &= ~(1 << irq);
150143   }
151144
152   pic8259->irr = ( pic8259->level_trig_mode ) ? pic8259->esr & pic8259->irq_lines : pic8259->irq_lines;
153145   pic8259_set_timer(pic8259);
154146}
155147
r11629r11630
177169      {
178170         if (LOG_GENERAL)
179171            logerror("pic8259_acknowledge(): PIC acknowledge IRQ #%d\n", irq);
180         pic8259->irr &= ~mask;
181         pic8259->esr &= ~mask;
172         if (!pic8259->level_trig_mode)
173            pic8259->irr &= ~mask;
182174
183175         if (!pic8259->auto_eoi)
184176            pic8259->isr |= mask;
177
185178         pic8259_set_timer(pic8259);
186179
187180         if ((pic8259->cascade!=0) && (pic8259->master!=0) && (mask & pic8259->slave)) {
r11629r11630
272265               logerror("pic8259_w(): ICW1; data=0x%02X\n", data);
273266
274267            pic8259->imr            = 0x00;
275            pic8259->esr            = 0x00;
276268            pic8259->isr            = 0x00;
277269            pic8259->irr            = 0x00;
278270            pic8259->level_trig_mode   = (data & 0x08) ? 1 : 0;
r11629r11630
281273            pic8259->icw4_needed      = (data & 0x01) ? 1 : 0;
282274            pic8259->vector_addr_low   = (data & 0xe0);
283275            pic8259->state         = STATE_ICW2;
284            pic8259->irq_lines          = 0x00;
285276         }
286277         else if (pic8259->state == STATE_READY)
287278         {
r11629r11630
430421   pic8259_t   *pic8259 = get_safe_token(device);
431422
432423   pic8259->state = STATE_READY;
433   pic8259->irq_lines = 0;
434424   pic8259->isr = 0;
435   pic8259->esr = 0;
436425   pic8259->irr = 0;
437426   pic8259->prio = 0;
438427   pic8259->imr = 0;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team