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.7 by gbeauche, 2000-09-22T17:18:15Z vs.
Revision 1.15 by gbeauche, 2002-10-01T09:39:55Z

# Line 1 | Line 1
1   /*
2   *  basilisk_glue.cpp - Glue UAE CPU to Basilisk II CPU engine interface
3   *
4 < *  Basilisk II (C) 1997-2000 Christian Bauer
4 > *  Basilisk II (C) 1997-2002 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 "m68k.h"
29   #include "memory.h"
30   #include "readcpu.h"
31   #include "newcpu.h"
32 < #include "compiler.h"
32 > #include "compiler/compemu.h"
33  
34  
35   // RAM and ROM pointers
36 < uint32 RAMBaseMac = 0;          // RAM base (Mac address space) gb-- init is important
36 > uint32 RAMBaseMac = 0;          // RAM base (Mac address space) gb-- initializer is important
37   uint8 *RAMBaseHost;                     // RAM base (host address space)
38   uint32 RAMSize;                         // Size of RAM
39   uint32 ROMBaseMac;                      // ROM base (Mac address space)
# Line 50 | Line 51 | int MacFrameLayout;                    // Frame buffer la
51   uintptr MEMBaseDiff;            // Global offset between a Mac address and its Host equivalent
52   #endif
53  
54 + #if USE_JIT
55 + bool UseJIT = false;
56 + #endif
57 +
58   // From newcpu.cpp
59 < extern int quit_program;
59 > extern bool quit_program;
60  
61  
62   /*
# Line 65 | Line 70 | bool Init680x0(void)
70          RAMBaseMac = (uint32)RAMBaseHost;
71          ROMBaseMac = (uint32)ROMBaseHost;
72   #elif DIRECT_ADDRESSING
73 <        InitMEMBaseDiff(RAMBaseHost, RAMBaseMac);
73 >        // Mac address space = host address space minus constant offset (MEMBaseDiff)
74 >        // NOTE: MEMBaseDiff is set up in main_unix.cpp/main()
75 >        RAMBaseMac = 0;
76 >        ROMBaseMac = Host2MacAddr(ROMBaseHost);
77   #else
78          // Initialize UAE memory banks
79          RAMBaseMac = 0;
# Line 88 | Line 96 | bool Init680x0(void)
96   #endif
97  
98          init_m68k();
99 < #ifdef USE_COMPILER
100 <        compiler_init();
99 > #if USE_JIT
100 >        UseJIT = compiler_use_jit();
101 >        if (UseJIT)
102 >            compiler_init();
103   #endif
104          return true;
105   }
# Line 101 | Line 111 | bool Init680x0(void)
111  
112   void Exit680x0(void)
113   {
114 + #if USE_JIT
115 +    if (UseJIT)
116 +        compiler_exit();
117 + #endif
118          exit_m68k();
119   }
120  
121  
122   /*
123 + *  Initialize memory mapping of frame buffer (called upon video mode change)
124 + */
125 +
126 + void InitFrameBufferMapping(void)
127 + {
128 + #if !REAL_ADDRESSING && !DIRECT_ADDRESSING
129 +        memory_init();
130 + #endif
131 + }
132 +
133 + /*
134   *  Reset and start 680x0 emulation (doesn't return)
135   */
136  
137   void Start680x0(void)
138   {
139          m68k_reset();
140 <        m68k_go(true);
140 > #if USE_JIT
141 >    if (UseJIT)
142 >        m68k_compile_execute();
143 >    else
144 > #endif
145 >        m68k_execute();
146   }
147  
148  
# Line 122 | Line 152 | void Start680x0(void)
152  
153   void TriggerInterrupt(void)
154   {
155 <        regs.spcflags |= SPCFLAG_INT;
155 >        SPCFLAGS_SET( SPCFLAG_INT );
156   }
157  
158   void TriggerNMI(void)
# Line 168 | Line 198 | void Execute68kTrap(uint16 trap, struct
198          // Execute trap
199          m68k_setpc(m68k_areg(regs, 7));
200          fill_prefetch_0();
201 <        quit_program = 0;
202 <        m68k_go(true);
201 >        quit_program = false;
202 >        m68k_execute();
203  
204          // Clean up stack
205          m68k_areg(regs, 7) += 4;
# Line 183 | Line 213 | void Execute68kTrap(uint16 trap, struct
213                  r->d[i] = m68k_dreg(regs, i);
214          for (i=0; i<7; i++)
215                  r->a[i] = m68k_areg(regs, i);
216 <        quit_program = 0;
216 >        quit_program = false;
217   }
218  
219  
# Line 215 | Line 245 | void Execute68k(uint32 addr, struct M68k
245          // Execute routine
246          m68k_setpc(addr);
247          fill_prefetch_0();
248 <        quit_program = 0;
249 <        m68k_go(true);
248 >        quit_program = false;
249 >        m68k_execute();
250  
251          // Clean up stack
252          m68k_areg(regs, 7) += 2;
# Line 230 | Line 260 | void Execute68k(uint32 addr, struct M68k
260                  r->d[i] = m68k_dreg(regs, i);
261          for (i=0; i<7; i++)
262                  r->a[i] = m68k_areg(regs, i);
263 <        quit_program = 0;
263 >        quit_program = false;
264   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines