]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Cputester update.
authorToni Wilen <twilen@winuae.net>
Sat, 28 May 2022 18:33:34 +0000 (21:33 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 28 May 2022 18:33:34 +0000 (21:33 +0300)
cputest.cpp
cputest/main.c

index eca0e7906bc942106527f058ca150692c67ef626..18c9442fbfd4b2adbfad258229427f9fb12096a3 100644 (file)
@@ -857,7 +857,7 @@ uae_u32(*x_cp_next_ilong)(void);
 
 uae_u32(*x_next_iword)(void);
 uae_u32(*x_next_ilong)(void);
-void (*x_do_cycles)(uae_u32);
+void (*x_do_cycles)(int);
 
 uae_u32(REGPARAM3 *x_cp_get_disp_ea_020)(uae_u32 base, int idx) REGPARAM;
 
@@ -1009,6 +1009,10 @@ void REGPARAM2 MakeFromSR_intmask(uae_u16 oldsr, uae_u16 newsr)
 {
 }
 
+void intlev_load(void)
+{
+}
+
 void cpu_halt(int halt)
 {
        cpu_halted = halt;
@@ -3048,6 +3052,8 @@ static int create_ea_random(uae_u16 *opcodep, uaecptr pc, int mode, int reg, str
                                        if (dp->mnemo == i_STOP && feature_interrupts > 0) {
                                                // STOP hack to keep STOP test size smaller.
                                                imm16_cnt += 0x0100;
+                                       } else {
+                                               imm16_cnt += 0x0001;
                                        }
                                        if (imm16_cnt == 0)
                                                *isconstant = 0; 
@@ -4006,13 +4012,20 @@ static void execute_ins(uaecptr endpc, uaecptr targetpc, struct instr *dp, bool
                }
 
                if (cpu_stopped) {
-                       if (!interrupt_cycle_cnt) {
+                       if (feature_interrupts && !interrupt_cycle_cnt) {
                                test_exception = -1;
                                break;
                        }
-                       do_cycles_test(2);
                        ipl_fetch();
-                       do_cycles_test(2);
+                       do_cycles_test(4);
+                       if (!SPCFLAG_DOTRACE && regs.s == 0 && currprefs.cpu_model <= 68010) {
+                               // 68000/68010 undocumented special case:
+                               // if STOP clears S-bit and T was not set:
+                               // cause privilege violation exception, PC pointing to following instruction.
+                               // If T was set before STOP: STOP works as documented.
+                               cpu_stopped = 0;
+                               Exception(8);
+                       }
                } else {
                        (*cpufunctbl[opc])(opc);
                }
@@ -4067,34 +4080,15 @@ static void execute_ins(uaecptr endpc, uaecptr targetpc, struct instr *dp, bool
                        break;
                }
 
-               if (!SPCFLAG_DOTRACE && cpu_stopped && regs.s == 0 && currprefs.cpu_model <= 68010) {
-                       // 68000/68010 undocumented special case:
-                       // if STOP clears S-bit and T was not set:
-                       // cause privilege violation exception, PC pointing to following instruction.
-                       // If T was set before STOP: STOP works as documented.
-                       cpu_stopped = 0;
-                       Exception(8);
-               }
-
                // Amiga Chip ram does not support TAS or MOVE16
                if ((dp->mnemo == i_TAS || dp->mnemo == i_MOVE16) && low_memory_accessed) {
                        test_exception = -1;
                        break;
                }
 
-               if (feature_interrupts >= 2) {
-                       if (!test_exception && regs.ipl > regs.intmask) {
-                               if (cpu_stopped) {
-                                       do_cycles_test(4);
-                               }
-                               Exception(24 + regs.ipl);
-                               break;
-                       }
-               } else {
-                       if (!test_exception && regs.ipl_pin > regs.intmask) {
-                               Exception(24 + regs.ipl_pin);
-                               break;
-                       }
+               if (!test_exception && regs.ipl > regs.intmask) {
+                       Exception(24 + regs.ipl);
+                       break;
                }
 
                if ((regs.pc == endpc || regs.pc == targetpc) && !cpu_stopped) {
index bc60e243d50036d8b97aebc4907d0ff67c52be00..b608c30fdb24d13ee69c7c19e7d525401ab0f796 100644 (file)
@@ -2126,10 +2126,10 @@ static int get_cycles_amiga(void)
        }
 
        // hpos 0-1: vertical count hasn't been increased yet
-       if (hstart <= 0) {
+       if (hstart <= 1) {
                vstart++;
        }
-       if (hend <= 0) {
+       if (hend <= 1) {
                vend++;
        }
 
@@ -3967,7 +3967,6 @@ int main(int argc, char *argv[])
                                int d = isdir(path, dr->d_name);
                                if (d && dr->d_name[0] != '.') {
                                        strcpy(dirs + diroff, dr->d_name);
-                                       printf("%s\n", dr->d_name);
                                        dircnt++;
                                        diroff += MAX_FILE_LEN;
                                        if (dircnt >= MAX_FILES) {