ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/uae_cpu/newcpu.cpp
(Generate patch)

Comparing BasiliskII/src/uae_cpu/newcpu.cpp (file contents):
Revision 1.16 by gbeauche, 2002-09-17T16:05:39Z vs.
Revision 1.19 by gbeauche, 2004-11-01T16:01:51Z

# Line 34 | Line 34 | B2_mutex *spcflags_lock = NULL;
34   #include "mon_disass.h"
35   #endif
36  
37 < int quit_program = 0;
38 < const int debugging = 0;
37 > bool quit_program = false;
38   struct flag_struct regflags;
39  
40   /* Opcode of faulting instruction */
# Line 164 | Line 163 | static __inline__ unsigned int cft_map (
163   #endif
164   }
165  
166 < cpuop_rettype REGPARAM2 op_illg_1 (uae_u32 opcode) REGPARAM;
166 > void REGPARAM2 op_illg_1 (uae_u32 opcode) REGPARAM;
167  
168 < cpuop_rettype REGPARAM2 op_illg_1 (uae_u32 opcode)
168 > void REGPARAM2 op_illg_1 (uae_u32 opcode)
169   {
170 <    cpuop_return( op_illg (cft_map (opcode)) );
170 >    op_illg (cft_map (opcode));
171   }
172  
173   static void build_cpufunctbl (void)
# Line 1167 | Line 1166 | void m68k_reset (void)
1166   void m68k_emulop_return(void)
1167   {
1168          SPCFLAGS_SET( SPCFLAG_BRK );
1169 <        quit_program = 1;
1169 >        quit_program = true;
1170   }
1171  
1172   void m68k_emulop(uae_u32 opcode)
# Line 1190 | Line 1189 | void m68k_emulop(uae_u32 opcode)
1189                  MakeFromSR();
1190   }
1191  
1192 < cpuop_rettype REGPARAM2 op_illg (uae_u32 opcode)
1192 > void REGPARAM2 op_illg (uae_u32 opcode)
1193   {
1194          uaecptr pc = m68k_getpc ();
1195  
1196      if ((opcode & 0xF000) == 0xA000) {
1197          Exception(0xA,0);
1198 <        cpuop_return(CFLOW_TRAP);
1198 >        return;
1199      }
1200  
1201      if ((opcode & 0xF000) == 0xF000) {
1202          Exception(0xB,0);
1203 <        cpuop_return(CFLOW_TRAP);
1203 >        return;
1204      }
1205  
1206      write_log ("Illegal instruction: %04x at %08lx\n", opcode, pc);
# Line 1210 | Line 1209 | cpuop_rettype REGPARAM2 op_illg (uae_u32
1209   #endif
1210  
1211      Exception (4,0);
1212 <        cpuop_return(CFLOW_TRAP);
1212 >        return;
1213   }
1214  
1215   void mmu_op(uae_u32 opcode, uae_u16 extra)
# Line 1308 | Line 1307 | int m68k_do_specialties (void)
1307      }
1308      if (SPCFLAGS_TEST( SPCFLAG_BRK )) {
1309          SPCFLAGS_CLEAR( SPCFLAG_BRK );
1310 <        return CFLOW_EXEC_RETURN;
1310 >        return 1;
1311      }
1312      return 0;
1313   }
# Line 1320 | Line 1319 | void m68k_do_execute (void)
1319   #if FLIGHT_RECORDER
1320                  m68k_record_step(m68k_getpc());
1321   #endif
1323 #ifdef X86_ASSEMBLY
1324                __asm__ __volatile__("\tpushl %%ebp\n\tcall *%%ebx\n\tpopl %%ebp" /* FIXME */
1325                                                         : : "b" (cpufunctbl[opcode]), "a" (opcode)
1326                                                         : "%edx", "%ecx", "%esi", "%edi",  "%ebp", "memory", "cc");
1327 #else
1322                  (*cpufunctbl[opcode])(opcode);
1323 < #endif
1324 <        if (SPCFLAGS_TEST(SPCFLAG_ALL_BUT_EXEC_RETURN)) {
1331 <            if (m68k_do_specialties())
1323 >                if (SPCFLAGS_TEST(SPCFLAG_ALL_BUT_EXEC_RETURN)) {
1324 >                        if (m68k_do_specialties())
1325                                  return;
1326                  }
1327          }
1328   }
1329  
1330 < #if USE_JIT
1330 > #if USE_JIT && !(defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY))
1331   void m68k_compile_execute (void)
1332   {
1333      for (;;) {
1334 <        if (quit_program > 0) {
1342 <            if (quit_program == 1)
1334 >          if (quit_program)
1335                  break;
1336 <            quit_program = 0;
1345 <            m68k_reset ();
1346 <        }
1347 <        m68k_do_compile_execute();
1348 <    }
1349 <    if (debugging) {
1350 <        uaecptr nextpc;
1351 <        m68k_dumpstate(&nextpc);
1352 <        exit(1);
1336 >          m68k_do_compile_execute();
1337      }
1338   }
1339   #endif
# Line 1359 | Line 1343 | void m68k_execute (void)
1343   #if USE_JIT
1344      ++m68k_execute_depth;
1345   #endif
1362        
1346      for (;;) {
1347 <        if (quit_program > 0) {
1365 <            if (quit_program == 1)
1347 >          if (quit_program)
1348                  break;
1349 <            quit_program = 0;
1368 <            m68k_reset ();
1369 <        }
1370 <        m68k_do_execute();
1349 >          m68k_do_execute();
1350      }
1372        if (debugging) {
1373                uaecptr nextpc;
1374                m68k_dumpstate(&nextpc);
1375                exit(1);
1376        }
1377        
1351   #if USE_JIT
1352      --m68k_execute_depth;
1353   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines