--- previous/src/cpu/hatari-glue.c 2018/04/24 19:25:47 1.1 +++ previous/src/cpu/hatari-glue.c 2018/04/24 19:30:09 1.1.1.3 @@ -14,11 +14,8 @@ const char HatariGlue_fileid[] = "Hatari #include "main.h" #include "configuration.h" -#include "cycInt.h" -#include "cart.h" -#include "nextMemory.h" -#include "screen.h" #include "video.h" +#include "sysReg.h" #include "sysdeps.h" #include "maccess.h" @@ -49,29 +46,16 @@ void customreset(void) /** - * Return interrupt number (1 - 7), -1 means no interrupt. + * Return interrupt number (1 - 7), 0 means no interrupt. * Note that the interrupt stays pending if it can't be executed yet * due to the interrupt level field in the SR. */ int intlev(void) { - /* There are only VBL and HBL autovector interrupts in the ST... */ - assert((pendingInterrupts & ~((1<<4)|(1<<2))) == 0); - - if (pendingInterrupts & (1 << 4)) /* VBL interrupt? */ - { - if (regs.intmask < 4) - pendingInterrupts &= ~(1 << 4); - return 4; - } - else if (pendingInterrupts & (1 << 2)) /* HBL interrupt? */ - { - if (regs.intmask < 2) - pendingInterrupts &= ~(1 << 2); - return 2; - } - - return -1; + /* Poll interrupt level from interrupt status and mask registers + * --> see sysReg.c + */ + return get_interrupt_level(); } /** @@ -90,13 +74,27 @@ int Init680x0(void) case 5 : currprefs.cpu_model = 68060; break; default: fprintf (stderr, "Init680x0() : Error, cpu_level unknown\n"); } + + currprefs.fpu_model = changed_prefs.fpu_model = ConfigureParams.System.n_FPUType; + switch (currprefs.fpu_model) { + case 68881: currprefs.fpu_revision = 0x1f; break; + case 68882: currprefs.fpu_revision = 0x20; break; + case 68040: + if (ConfigureParams.System.bTurbo) + currprefs.fpu_revision = 0x41; + else + currprefs.fpu_revision = 0x40; + break; + default: fprintf (stderr, "Init680x0() : Error, fpu_model unknown\n"); + } currprefs.cpu_compatible = changed_prefs.cpu_compatible = ConfigureParams.System.bCompatibleCpu; currprefs.address_space_24 = changed_prefs.address_space_24 = ConfigureParams.System.bAddressSpace24; currprefs.cpu_cycle_exact = changed_prefs.cpu_cycle_exact = ConfigureParams.System.bCycleExactCpu; - 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; + currprefs.mmu_model = changed_prefs.mmu_model = ConfigureParams.System.bMMU?changed_prefs.cpu_model:0; + + write_log("Init680x0() called\n"); init_m68k();