--- previous/src/cpu/hatari-glue.c 2018/04/24 19:25:47 1.1 +++ previous/src/cpu/hatari-glue.c 2018/04/24 19:27:48 1.1.1.2 @@ -56,20 +56,50 @@ void customreset(void) int intlev(void) { /* There are only VBL and HBL autovector interrupts in the ST... */ - assert((pendingInterrupts & ~((1<<4)|(1<<2))) == 0); +// assert((pendingInterrupts & ~((1<<4)|(1<<2))) == 0); - if (pendingInterrupts & (1 << 4)) /* VBL interrupt? */ + if (pendingInterrupts & (1 << 7)) + { + if (regs.intmask < 7) + pendingInterrupts &= ~(1 << 7); + return 7; + } + else if (pendingInterrupts & (1 << 6)) + { + if (regs.intmask < 6) + pendingInterrupts &= ~(1 << 6); + return 6; + } + else if (pendingInterrupts & (1 << 5)) + { + if (regs.intmask < 5) + pendingInterrupts &= ~(1 << 5); + return 5; + } + else if (pendingInterrupts & (1 << 4)) { if (regs.intmask < 4) pendingInterrupts &= ~(1 << 4); return 4; } - else if (pendingInterrupts & (1 << 2)) /* HBL interrupt? */ + else if (pendingInterrupts & (1 << 3)) + { + if (regs.intmask < 3) + pendingInterrupts &= ~(1 << 3); + return 3; + } + else if (pendingInterrupts & (1 << 2)) { if (regs.intmask < 2) pendingInterrupts &= ~(1 << 2); return 2; } + else if (pendingInterrupts & (1 << 1)) + { + if (regs.intmask < 1) + pendingInterrupts &= ~(1 << 1); + return 1; + } return -1; } @@ -97,6 +127,7 @@ int Init680x0(void) currprefs.fpu_model = changed_prefs.fpu_model = ConfigureParams.System.n_FPUType; currprefs.fpu_strict = changed_prefs.fpu_strict = ConfigureParams.System.bCompatibleFPU; currprefs.mmu_model = changed_prefs.mmu_model = ConfigureParams.System.bMMU; + write_log("Init680x0() called\n"); init_m68k();