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

Comparing BasiliskII/src/uae_cpu/memory.cpp (file contents):
Revision 1.8 by gbeauche, 2005-06-05T07:32:23Z vs.
Revision 1.9 by gbeauche, 2007-06-13T15:57:45Z

# Line 71 | Line 71 | static uae_u32 REGPARAM2 dummy_bget (uae
71   static void REGPARAM2 dummy_lput (uaecptr, uae_u32) REGPARAM;
72   static void REGPARAM2 dummy_wput (uaecptr, uae_u32) REGPARAM;
73   static void REGPARAM2 dummy_bput (uaecptr, uae_u32) REGPARAM;
74 static int REGPARAM2 dummy_check (uaecptr addr, uae_u32 size) REGPARAM;
74  
75   uae_u32 REGPARAM2 dummy_lget (uaecptr addr)
76   {
# Line 113 | Line 112 | void REGPARAM2 dummy_bput (uaecptr addr,
112          write_log ("Illegal bput at %08lx\n", addr);
113   }
114  
116 int REGPARAM2 dummy_check (uaecptr addr, uae_u32 size)
117 {
118    if (illegal_mem)
119        write_log ("Illegal check at %08lx\n", addr);
120
121    return 0;
122 }
123
115   /* Mac RAM (32 bit addressing) */
116  
117   static uae_u32 REGPARAM2 ram_lget(uaecptr) REGPARAM;
# Line 129 | Line 120 | static uae_u32 REGPARAM2 ram_bget(uaecpt
120   static void REGPARAM2 ram_lput(uaecptr, uae_u32) REGPARAM;
121   static void REGPARAM2 ram_wput(uaecptr, uae_u32) REGPARAM;
122   static void REGPARAM2 ram_bput(uaecptr, uae_u32) REGPARAM;
132 static int REGPARAM2 ram_check(uaecptr addr, uae_u32 size) REGPARAM;
123   static uae_u8 *REGPARAM2 ram_xlate(uaecptr addr) REGPARAM;
124  
125   static uintptr RAMBaseDiff;     // RAMBaseHost - RAMBaseMac
# Line 172 | Line 162 | void REGPARAM2 ram_bput(uaecptr addr, ua
162          *(uae_u8 *)(RAMBaseDiff + addr) = b;
163   }
164  
175 int REGPARAM2 ram_check(uaecptr addr, uae_u32 size)
176 {
177    return (addr - RAMBaseMac + size) < RAMSize;
178 }
179
165   uae_u8 *REGPARAM2 ram_xlate(uaecptr addr)
166   {
167      return (uae_u8 *)(RAMBaseDiff + addr);
# Line 190 | Line 175 | static uae_u32 REGPARAM2 ram24_bget(uaec
175   static void REGPARAM2 ram24_lput(uaecptr, uae_u32) REGPARAM;
176   static void REGPARAM2 ram24_wput(uaecptr, uae_u32) REGPARAM;
177   static void REGPARAM2 ram24_bput(uaecptr, uae_u32) REGPARAM;
193 static int REGPARAM2 ram24_check(uaecptr addr, uae_u32 size) REGPARAM;
178   static uae_u8 *REGPARAM2 ram24_xlate(uaecptr addr) REGPARAM;
179  
180   uae_u32 REGPARAM2 ram24_lget(uaecptr addr)
# Line 231 | Line 215 | void REGPARAM2 ram24_bput(uaecptr addr,
215          *(uae_u8 *)(RAMBaseDiff + (addr & 0xffffff)) = b;
216   }
217  
234 int REGPARAM2 ram24_check(uaecptr addr, uae_u32 size)
235 {
236    return ((addr & 0xffffff) - RAMBaseMac + size) < RAMSize;
237 }
238
218   uae_u8 *REGPARAM2 ram24_xlate(uaecptr addr)
219   {
220      return (uae_u8 *)(RAMBaseDiff + (addr & 0xffffff));
# Line 249 | Line 228 | static uae_u32 REGPARAM2 rom_bget(uaecpt
228   static void REGPARAM2 rom_lput(uaecptr, uae_u32) REGPARAM;
229   static void REGPARAM2 rom_wput(uaecptr, uae_u32) REGPARAM;
230   static void REGPARAM2 rom_bput(uaecptr, uae_u32) REGPARAM;
252 static int REGPARAM2 rom_check(uaecptr addr, uae_u32 size) REGPARAM;
231   static uae_u8 *REGPARAM2 rom_xlate(uaecptr addr) REGPARAM;
232  
233   static uintptr ROMBaseDiff;     // ROMBaseHost - ROMBaseMac
# Line 291 | Line 269 | void REGPARAM2 rom_bput(uaecptr addr, ua
269          write_log ("Illegal ROM bput at %08lx\n", addr);
270   }
271  
294 int REGPARAM2 rom_check(uaecptr addr, uae_u32 size)
295 {
296    return (addr - ROMBaseMac + size) < ROMSize;
297 }
298
272   uae_u8 *REGPARAM2 rom_xlate(uaecptr addr)
273   {
274      return (uae_u8 *)(ROMBaseDiff + addr);
# Line 306 | Line 279 | uae_u8 *REGPARAM2 rom_xlate(uaecptr addr
279   static uae_u32 REGPARAM2 rom24_lget(uaecptr) REGPARAM;
280   static uae_u32 REGPARAM2 rom24_wget(uaecptr) REGPARAM;
281   static uae_u32 REGPARAM2 rom24_bget(uaecptr) REGPARAM;
309 static int REGPARAM2 rom24_check(uaecptr addr, uae_u32 size) REGPARAM;
282   static uae_u8 *REGPARAM2 rom24_xlate(uaecptr addr) REGPARAM;
283  
284   uae_u32 REGPARAM2 rom24_lget(uaecptr addr)
# Line 328 | Line 300 | uae_u32 REGPARAM2 rom24_bget(uaecptr add
300      return (uae_u32)*(uae_u8 *)(ROMBaseDiff + (addr & 0xffffff));
301   }
302  
331 int REGPARAM2 rom24_check(uaecptr addr, uae_u32 size)
332 {
333    return ((addr & 0xffffff) - ROMBaseMac + size) < ROMSize;
334 }
335
303   uae_u8 *REGPARAM2 rom24_xlate(uaecptr addr)
304   {
305      return (uae_u8 *)(ROMBaseDiff + (addr & 0xffffff));
# Line 360 | Line 327 | static void REGPARAM2 frame_host_565_wpu
327   static uae_u32 REGPARAM2 frame_host_888_lget(uaecptr) REGPARAM;
328   static void REGPARAM2 frame_host_888_lput(uaecptr, uae_u32) REGPARAM;
329  
363 static int REGPARAM2 frame_check(uaecptr addr, uae_u32 size) REGPARAM;
330   static uae_u8 *REGPARAM2 frame_xlate(uaecptr addr) REGPARAM;
331  
332   static uintptr FrameBaseDiff;   // MacFrameBaseHost - MacFrameBaseMac
# Line 478 | Line 444 | void REGPARAM2 frame_host_888_lput(uaecp
444      *m = l;
445   }
446  
481 int REGPARAM2 frame_check(uaecptr addr, uae_u32 size)
482 {
483    return (addr - MacFrameBaseMac + size) < MacFrameSize;
484 }
485
447   uae_u8 *REGPARAM2 frame_xlate(uaecptr addr)
448   {
449      return (uae_u8 *)(FrameBaseDiff + addr);
# Line 490 | Line 451 | uae_u8 *REGPARAM2 frame_xlate(uaecptr ad
451  
452   /* Default memory access functions */
453  
493 int REGPARAM2 default_check (uaecptr a, uae_u32 b)
494 {
495    return 0;
496 }
497
454   uae_u8 *REGPARAM2 default_xlate (uaecptr a)
455   {
456      write_log("Your Mac program just did something terribly stupid\n");
# Line 506 | Line 462 | uae_u8 *REGPARAM2 default_xlate (uaecptr
462   addrbank dummy_bank = {
463      dummy_lget, dummy_wget, dummy_bget,
464      dummy_lput, dummy_wput, dummy_bput,
465 <    default_xlate, dummy_check
465 >    default_xlate
466   };
467  
468   addrbank ram_bank = {
469      ram_lget, ram_wget, ram_bget,
470      ram_lput, ram_wput, ram_bput,
471 <    ram_xlate, ram_check
471 >    ram_xlate
472   };
473  
474   addrbank ram24_bank = {
475      ram24_lget, ram24_wget, ram24_bget,
476      ram24_lput, ram24_wput, ram24_bput,
477 <    ram24_xlate, ram24_check
477 >    ram24_xlate
478   };
479  
480   addrbank rom_bank = {
481      rom_lget, rom_wget, rom_bget,
482      rom_lput, rom_wput, rom_bput,
483 <    rom_xlate, rom_check
483 >    rom_xlate
484   };
485  
486   addrbank rom24_bank = {
487      rom24_lget, rom24_wget, rom24_bget,
488      rom_lput, rom_wput, rom_bput,
489 <    rom24_xlate, rom24_check
489 >    rom24_xlate
490   };
491  
492   addrbank frame_direct_bank = {
493      frame_direct_lget, frame_direct_wget, frame_direct_bget,
494      frame_direct_lput, frame_direct_wput, frame_direct_bput,
495 <    frame_xlate, frame_check
495 >    frame_xlate
496   };
497  
498   addrbank frame_host_555_bank = {
499      frame_host_555_lget, frame_host_555_wget, frame_direct_bget,
500      frame_host_555_lput, frame_host_555_wput, frame_direct_bput,
501 <    frame_xlate, frame_check
501 >    frame_xlate
502   };
503  
504   addrbank frame_host_565_bank = {
505      frame_host_565_lget, frame_host_565_wget, frame_direct_bget,
506      frame_host_565_lput, frame_host_565_wput, frame_direct_bput,
507 <    frame_xlate, frame_check
507 >    frame_xlate
508   };
509  
510   addrbank frame_host_888_bank = {
511      frame_host_888_lget, frame_direct_wget, frame_direct_bget,
512      frame_host_888_lput, frame_direct_wput, frame_direct_bput,
513 <    frame_xlate, frame_check
513 >    frame_xlate
514   };
515  
516   void memory_init(void)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines