|
|
| version 1.6, 2003/12/04 06:41:23 | version 1.11, 2003/12/25 19:26:55 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "i286.h" | #include "cpucore.h" |
| #include "i286x.h" | #include "i286x.h" |
| #include "i286xadr.h" | #include "i286xadr.h" |
| #include "i286xs.h" | #include "i286xs.h" |
| #include "i286xrep.h" | #include "i286xrep.h" |
| #include "i286xcts.h" | #include "i286xcts.h" |
| #include "memory.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "i286x.mcr" | #include "i286x.mcr" |
| Line 52 const BYTE iflags[256] = { // Z_FLAG | Line 51 const BYTE iflags[256] = { // Z_FLAG |
| 0x80, 0x84, 0x84, 0x80, 0x84, 0x80, 0x80, 0x84}; | 0x80, 0x84, 0x84, 0x80, 0x84, 0x80, 0x80, 0x84}; |
| void i286_initialize(void) { | void i286x_initialize(void) { |
| i286xadr_init(); | i286xadr_init(); |
| v30init(); | v30xinit(); |
| } | } |
| void i286_reset(void) { | void i286x_reset(void) { |
| ZeroMemory(&i286core.s, sizeof(i286core.s)); | ZeroMemory(&i286core.s, sizeof(i286core.s)); |
| I286_CS = 0x1fc0; | I286_CS = 0xffff; |
| CS_BASE = 0x1fc00; | CS_BASE = 0xffff0; |
| i286core.s.adrsmask = 0xfffff; | i286core.s.adrsmask = 0xfffff; |
| } | } |
| void i286x_shut(void) { | |
| LABEL void i286_resetprefetch(void) { | CPU_CS = 0xffff; |
| CS_BASE = 0xffff0; | |
| CPU_IP = 0; | |
| CPU_ADRSMASK = 0xfffff; | |
| i286x_resetprefetch(); | |
| } | |
| LABEL void i286x_resetprefetch(void) { | |
| __asm { | __asm { |
| pushad | pushad |
| Line 79 LABEL void i286_resetprefetch(void) { | Line 87 LABEL void i286_resetprefetch(void) { |
| } | } |
| } | } |
| LABEL void __fastcall i286_interrupt(BYTE vect) { | LABEL void __fastcall i286x_interrupt(BYTE vect) { |
| __asm { | __asm { |
| pushad | pushad |
| Line 169 LABEL void __fastcall i286x_localint(voi | Line 177 LABEL void __fastcall i286x_localint(voi |
| LABEL void i286(void) { | LABEL void i286x(void) { |
| __asm { | __asm { |
| pushad | pushad |
| Line 217 i286notrap: mov dword ptr (i286core.s. | Line 225 i286notrap: mov dword ptr (i286core.s. |
| LABEL void i286_step(void) { | LABEL void i286x_step(void) { |
| __asm { | __asm { |
| pushad | pushad |
| Line 2668 I286 _popf(void) { // 9D: popf | Line 2676 I286 _popf(void) { // 9D: popf |
| cmp ah, 3 | cmp ah, 3 |
| sete I286_TRAP | sete I286_TRAP |
| test ah, 2 // fast_intr | je irqcheck // fast_intr |
| test ah, 2 | |
| je nextop | je nextop |
| cmp pic.ext_irq, 0 | cmp pic.ext_irq, 0 |
| jne nextop | jne nextop |
| Line 2677 I286 _popf(void) { // 9D: popf | Line 2686 I286 _popf(void) { // 9D: popf |
| not ax | not ax |
| test al, pic.pi[0].irr | test al, pic.pi[0].irr |
| jne irqcheck | jne irqcheck |
| test al, pic.pi[1].irr | test ah, pic.pi[1].irr |
| jne irqcheck | jne irqcheck |
| nextop: ret | nextop: ret |
| Line 3596 I286 _iret(void) { // CF: iret | Line 3605 I286 _iret(void) { // CF: iret |
| sete I286_TRAP | sete I286_TRAP |
| RESET_XPREFETCH | RESET_XPREFETCH |
| test I286_FLAG, I_FLAG // fast_intr | cmp I286_TRAP, 0 // fast_intr |
| jne irqcheck | |
| test I286_FLAG, I_FLAG | |
| je nextop | je nextop |
| cmp pic.ext_irq, 0 | cmp pic.ext_irq, 0 |
| jne nextop | jne nextop |
| Line 3605 I286 _iret(void) { // CF: iret | Line 3616 I286 _iret(void) { // CF: iret |
| not ax | not ax |
| test al, pic.pi[0].irr | test al, pic.pi[0].irr |
| jne irqcheck | jne irqcheck |
| test al, pic.pi[1].irr | test ah, pic.pi[1].irr |
| jne irqcheck | jne irqcheck |
| nextop: ret | nextop: ret |
| Line 4201 I286 _sti(void) { // FB: sti | Line 4212 I286 _sti(void) { // FB: sti |
| test I286_FLAG, T_FLAG | test I286_FLAG, T_FLAG |
| setne I286_TRAP | setne I286_TRAP |
| cmp pic.ext_irq, 0 // fast_intr | jne nextopandexit // fast_intr |
| cmp pic.ext_irq, 0 | |
| jne jmp_nextop | jne jmp_nextop |
| mov al, pic.pi[0].imr | mov al, pic.pi[0].imr |
| mov ah, pic.pi[1].imr | mov ah, pic.pi[1].imr |
| not ax | not ax |
| test al, pic.pi[0].irr | test al, pic.pi[0].irr |
| jne nextopandexit | jne nextopandexit |
| test al, pic.pi[1].irr | test ah, pic.pi[1].irr |
| jne nextopandexit | jne nextopandexit |
| jmp_nextop: jmp i286op[ebp*4] | jmp_nextop: jmp i286op[ebp*4] |