--- np2/i286c/i286c_mn.c 2003/11/30 11:20:55 1.16 +++ np2/i286c/i286c_mn.c 2003/12/01 18:25:03 1.20 @@ -10,10 +10,6 @@ #define MAX_PREFIX 8 -#define EXISTINTR (isI286EI) && (!pic.ext_irq) && \ - ((pic.pi[0].irr & (~pic.pi[0].imr)) || \ - (pic.pi[1].irr & (~pic.pi[1].imr))) - #define NEXT_OPCODE \ if (I286_REMCLOCK < 1) { \ @@ -627,13 +623,13 @@ I286FN _segprefix_es(void) { // 26: SS_FIX = ES_BASE; DS_FIX = ES_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -773,13 +769,13 @@ I286FN _segprefix_cs(void) { // 2e: SS_FIX = CS_BASE; DS_FIX = CS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -914,13 +910,13 @@ I286FN _segprefix_ss(void) { // 36: SS_FIX = SS_BASE; DS_FIX = SS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -1030,13 +1026,13 @@ I286FN _segprefix_ds(void) { // 3e: SS_FIX = DS_BASE; DS_FIX = DS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -1090,7 +1086,7 @@ I286FN _pop_bp(void) REGPOP(I286_BP, 5) I286FN _pop_si(void) REGPOP(I286_SI, 5) // 5E: pop si I286FN _pop_di(void) REGPOP(I286_DI, 5) // 5F: pop di -#if defined(ARM) && defined(BYTESEX_LITTLE) +#if (defined(ARM) || defined(X11)) && defined(BYTESEX_LITTLE) I286FN _pusha(void) { // 60: pusha @@ -1817,13 +1813,13 @@ I286FN _popf(void) { // 9D: popf UINT flag; - I286_WORKCLOCK(5); REGPOP0(flag) I286_OV = flag & O_FLAG; I286_FLAG = flag & (0xfff ^ O_FLAG); I286_TRAP = ((flag & 0x300) == 0x300); + I286_WORKCLOCK(5); #if defined(INTR_FAST) - if (EXISTINTR) { + if ((flag & I_FLAG) && (PICEXISTINTR)) { I286IRQCHECKTERM } #else @@ -2276,7 +2272,6 @@ I286FN _iret(void) { // CF: iret UINT flag; extirq_pop(); - I286_WORKCLOCK(31); REGPOP0(I286_IP) REGPOP0(I286_CS) REGPOP0(flag) @@ -2284,8 +2279,9 @@ I286FN _iret(void) { // CF: iret I286_FLAG = flag & (0xfff ^ O_FLAG); I286_TRAP = ((flag & 0x300) == 0x300); CS_BASE = I286_CS << 4; + I286_WORKCLOCK(31); #if defined(INTR_FAST) - if (EXISTINTR) { + if ((flag & I_FLAG) && (PICEXISTINTR)) { I286IRQCHECKTERM } #else @@ -2478,9 +2474,9 @@ I286FN _in_al_data8(void) { // E4: i I286_WORKCLOCK(5); GET_PCBYTE(port) - i286reg.inport = CS_BASE + I286_IP; + i286core.s.inport = CS_BASE + I286_IP; I286_AL = iocore_inp8(port); - i286reg.inport = 0; + i286core.s.inport = 0; } I286FN _in_ax_data8(void) { // E5: in ax, DATA8 @@ -2580,12 +2576,12 @@ I286FN _lock(void) { // F0: lock I286FN _repne(void) { // F2: repne - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repne[op](); - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -2594,12 +2590,12 @@ I286FN _repne(void) { // F2: repne I286FN _repe(void) { // F3: repe - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repe[op](); - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -2658,13 +2654,17 @@ I286FN _sti(void) { // FB: sti I286_WORKCLOCK(2); #if defined(INTR_FAST) if (I286_FLAG & I_FLAG) { + NEXT_OPCODE; return; // 更新の意味なし } #endif I286_FLAG |= I_FLAG; I286_TRAP = (I286_FLAG & T_FLAG) >> 8; #if defined(INTR_FAST) - if (EXISTINTR) { + if (!PICEXISTINTR) { + NEXT_OPCODE; + } + else { REMAIN_ADJUST(1) } #else @@ -2984,13 +2984,13 @@ I286FN _repe_segprefix_es(void) { DS_FIX = ES_BASE; SS_FIX = ES_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3001,13 +3001,13 @@ I286FN _repe_segprefix_cs(void) { DS_FIX = CS_BASE; SS_FIX = CS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3018,13 +3018,13 @@ I286FN _repe_segprefix_ss(void) { DS_FIX = SS_BASE; SS_FIX = SS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3035,13 +3035,13 @@ I286FN _repe_segprefix_ds(void) { DS_FIX = DS_BASE; SS_FIX = DS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3329,13 +3329,13 @@ I286FN _repne_segprefix_es(void) { DS_FIX = ES_BASE; SS_FIX = ES_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3346,13 +3346,13 @@ I286FN _repne_segprefix_cs(void) { DS_FIX = CS_BASE; SS_FIX = CS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3363,13 +3363,13 @@ I286FN _repne_segprefix_ss(void) { DS_FIX = SS_BASE; SS_FIX = SS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3380,13 +3380,13 @@ I286FN _repne_segprefix_ds(void) { DS_FIX = DS_BASE; SS_FIX = DS_BASE; - i286reg.prefix++; - if (i286reg.prefix < MAX_PREFIX) { + i286core.s.prefix++; + if (i286core.s.prefix < MAX_PREFIX) { UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286reg.prefix = 0; + i286core.s.prefix = 0; } else { INT_NUM(6, I286_IP);