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

Comparing BasiliskII/src/uae_cpu/basilisk_glue.cpp (file contents):
Revision 1.11 by cebix, 2001-06-28T21:20:01Z vs.
Revision 1.18 by gbeauche, 2006-04-30T21:16:48Z

# Line 1 | Line 1
1   /*
2   *  basilisk_glue.cpp - Glue UAE CPU to Basilisk II CPU engine interface
3   *
4 < *  Basilisk II (C) 1997-2001 Christian Bauer
4 > *  Basilisk II (C) 1997-2005 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 22 | Line 22
22  
23   #include "cpu_emulation.h"
24   #include "main.h"
25 + #include "prefs.h"
26   #include "emul_op.h"
27   #include "rom_patches.h"
28 + #include "timer.h"
29   #include "m68k.h"
30   #include "memory.h"
31   #include "readcpu.h"
32   #include "newcpu.h"
33 + #include "compiler/compemu.h"
34  
35  
36   // RAM and ROM pointers
37 < uint32 RAMBaseMac = 0;          // RAM base (Mac address space) gb-- init is important
37 > uint32 RAMBaseMac = 0;          // RAM base (Mac address space) gb-- initializer is important
38   uint8 *RAMBaseHost;                     // RAM base (host address space)
39   uint32 RAMSize;                         // Size of RAM
40   uint32 ROMBaseMac;                      // ROM base (Mac address space)
# Line 49 | Line 52 | int MacFrameLayout;                    // Frame buffer la
52   uintptr MEMBaseDiff;            // Global offset between a Mac address and its Host equivalent
53   #endif
54  
55 + #if USE_JIT
56 + bool UseJIT = false;
57 + #endif
58 +
59   // From newcpu.cpp
60 < extern int quit_program;
60 > extern bool quit_program;
61  
62  
63   /*
# Line 65 | Line 72 | bool Init680x0(void)
72          ROMBaseMac = (uint32)ROMBaseHost;
73   #elif DIRECT_ADDRESSING
74          // Mac address space = host address space minus constant offset (MEMBaseDiff)
75 <        // NOTE: MEMBaseDiff is set in main_unix.cpp/main()
75 >        // NOTE: MEMBaseDiff is set up in main_unix.cpp/main()
76          RAMBaseMac = 0;
77          ROMBaseMac = Host2MacAddr(ROMBaseHost);
78   #else
# Line 90 | Line 97 | bool Init680x0(void)
97   #endif
98  
99          init_m68k();
100 + #if USE_JIT
101 +        UseJIT = compiler_use_jit();
102 +        if (UseJIT)
103 +            compiler_init();
104 + #endif
105          return true;
106   }
107  
# Line 100 | Line 112 | bool Init680x0(void)
112  
113   void Exit680x0(void)
114   {
115 + #if USE_JIT
116 +    if (UseJIT)
117 +        compiler_exit();
118 + #endif
119          exit_m68k();
120   }
121  
# Line 122 | Line 138 | void InitFrameBufferMapping(void)
138   void Start680x0(void)
139   {
140          m68k_reset();
141 <        m68k_go(true);
141 > #if USE_JIT
142 >    if (UseJIT)
143 >        m68k_compile_execute();
144 >    else
145 > #endif
146 >        m68k_execute();
147   }
148  
149  
# Line 132 | Line 153 | void Start680x0(void)
153  
154   void TriggerInterrupt(void)
155   {
156 <        regs.spcflags |= SPCFLAG_INT;
156 >        idle_resume();
157 >        SPCFLAGS_SET( SPCFLAG_INT );
158   }
159  
160   void TriggerNMI(void)
# Line 178 | Line 200 | void Execute68kTrap(uint16 trap, struct
200          // Execute trap
201          m68k_setpc(m68k_areg(regs, 7));
202          fill_prefetch_0();
203 <        quit_program = 0;
204 <        m68k_go(true);
203 >        quit_program = false;
204 >        m68k_execute();
205  
206          // Clean up stack
207          m68k_areg(regs, 7) += 4;
# Line 193 | Line 215 | void Execute68kTrap(uint16 trap, struct
215                  r->d[i] = m68k_dreg(regs, i);
216          for (i=0; i<7; i++)
217                  r->a[i] = m68k_areg(regs, i);
218 <        quit_program = 0;
218 >        quit_program = false;
219   }
220  
221  
# Line 225 | Line 247 | void Execute68k(uint32 addr, struct M68k
247          // Execute routine
248          m68k_setpc(addr);
249          fill_prefetch_0();
250 <        quit_program = 0;
251 <        m68k_go(true);
250 >        quit_program = false;
251 >        m68k_execute();
252  
253          // Clean up stack
254          m68k_areg(regs, 7) += 2;
# Line 240 | Line 262 | void Execute68k(uint32 addr, struct M68k
262                  r->d[i] = m68k_dreg(regs, i);
263          for (i=0; i<7; i++)
264                  r->a[i] = m68k_areg(regs, i);
265 <        quit_program = 0;
265 >        quit_program = false;
266   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines