X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fmemory.c;h=88d43f0efed9ff58f3d6a6894091ab5f5ad075de;hb=be7867d8756f15956447d3275382a77a71922feb;hp=2fff489b6cec31b7cca905a4706d4009de35e19d;hpb=f3a57b2d6c6a32dc09a6efd4fbef31eb876263b2;p=picodrive.git diff --git a/pico/memory.c b/pico/memory.c index 2fff489..88d43f0 100644 --- a/pico/memory.c +++ b/pico/memory.c @@ -1,11 +1,11 @@ -// This is part of Pico Library - -// (c) Copyright 2004 Dave, All rights reserved. -// (c) Copyright 2006-2009 notaz, All rights reserved. -// Free for non-commercial use. - -// For commercial use, separate licencing terms must be obtained. - +/* + * memory handling + * (c) Copyright Dave, 2004 + * (C) notaz, 2006-2010 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ #include "pico_int.h" #include "memory.h" @@ -23,6 +23,11 @@ uptr m68k_write16_map[0x1000000 >> M68K_MEM_SHIFT]; static void xmap_set(uptr *map, int shift, int start_addr, int end_addr, const void *func_or_mh, int is_func) { +#ifdef __clang__ + // workaround bug (segfault) in + // Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn) + volatile +#endif uptr addr = (uptr)func_or_mh; int mask = (1 << shift) - 1; int i; @@ -110,6 +115,11 @@ static void m68k_unmapped_write16(u32 a, u32 d) void m68k_map_unmap(int start_addr, int end_addr) { +#ifdef __clang__ + // workaround bug (segfault) in + // Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn) + volatile +#endif uptr addr; int shift = M68K_MEM_SHIFT; int i; @@ -166,7 +176,7 @@ void log_io(unsigned int addr, int bits, int rw); #if defined(EMU_C68K) void cyclone_crashed(u32 pc, struct Cyclone *context) { - elprintf(EL_STATUS|EL_ANOMALY, "%c68k crash detected @ %06x\n", + elprintf(EL_STATUS|EL_ANOMALY, "%c68k crash detected @ %06x", context == &PicoCpuCM68k ? 'm' : 's', pc); context->membase = (u32)Pico.rom; context->pc = (u32)Pico.rom + Pico.romsize; @@ -726,13 +736,13 @@ PICO_INTERNAL void PicoMemSetup(void) int i; // by default, point everything to first 64k of ROM for (i = 0; i < M68K_FETCHBANK1; i++) - PicoCpuFM68k.Fetch[i] = (unsigned int)Pico.rom - (i<<(24-FAMEC_FETCHBITS)); + PicoCpuFM68k.Fetch[i] = (unsigned long)Pico.rom - (i<<(24-FAMEC_FETCHBITS)); // now real ROM for (i = 0; i < M68K_FETCHBANK1 && (i<<(24-FAMEC_FETCHBITS)) < Pico.romsize; i++) - PicoCpuFM68k.Fetch[i] = (unsigned int)Pico.rom; + PicoCpuFM68k.Fetch[i] = (unsigned long)Pico.rom; // .. and RAM for (i = M68K_FETCHBANK1*14/16; i < M68K_FETCHBANK1; i++) - PicoCpuFM68k.Fetch[i] = (unsigned int)Pico.ram - (i<<(24-FAMEC_FETCHBITS)); + PicoCpuFM68k.Fetch[i] = (unsigned long)Pico.ram - (i<<(24-FAMEC_FETCHBITS)); } #endif #ifdef EMU_M68K