From ea12009c5dd07e7496f67c40cfe415b41f5850e8 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 2 Apr 2013 00:45:33 +0300 Subject: frontend: attempt basic ios logging --- frontend/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/main.c b/frontend/main.c index 09f6a1c..2cf5ee0 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -402,7 +402,14 @@ int emu_core_preinit(void) // it may be redefined by -cfg on the command line strcpy(cfgfile_basename, "pcsx.cfg"); +#ifdef IOS + emuLog = fopen("/User/Documents/pcsxr.log", "w"); + if (emuLog == NULL) + emuLog = fopen("pcsxr.log", "w"); + if (emuLog == NULL) +#endif emuLog = stdout; + SetIsoFile(NULL); memset(&Config, 0, sizeof(Config)); -- cgit v1.2.3 From 0069615fdda3a28da547a191bef990256620ff69 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 2 Apr 2013 01:29:57 +0300 Subject: avoid MAP_FIXED, log mappings MAP_FIXED overrides existing mappings, we don't want that --- libpcsxcore/new_dynarec/emu_if.c | 7 +++++++ libpcsxcore/psxmem.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libpcsxcore/new_dynarec/emu_if.c b/libpcsxcore/new_dynarec/emu_if.c index 324071d..cb95cb1 100644 --- a/libpcsxcore/new_dynarec/emu_if.c +++ b/libpcsxcore/new_dynarec/emu_if.c @@ -260,6 +260,7 @@ static int ari64_init() { extern void (*psxCP2[64])(); extern void psxNULL(); + extern u_char *out; size_t i; new_dynarec_init(); @@ -289,6 +290,10 @@ static int ari64_init() zeromem_ptr = zero_mem; scratch_buf_ptr = scratch_buf; + SysPrintf("Mapped (RAM/scrp/ROM/LUTs/TC):\n"); + SysPrintf("%08x/%08x/%08x/%08x/%08x\n", + psxM, psxH, psxR, mem_rtab, out); + return 0; } @@ -388,6 +393,8 @@ int new_dynarec_hacks; void *psxH_ptr; void *zeromem_ptr; u8 zero_mem[0x1000]; +u_char *out; +void *mem_rtab; void *scratch_buf_ptr; void new_dynarec_init() { (void)ari64_execute; } void new_dyna_start() {} diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 62bbe26..4da0cf4 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -52,8 +52,9 @@ retry: goto out; } - if (is_fixed) - flags |= MAP_FIXED; + /* avoid MAP_FIXED, it overrides existing mappings.. */ + /* if (is_fixed) + flags |= MAP_FIXED; */ req = (void *)addr; ret = mmap(req, size, PROT_READ | PROT_WRITE, flags, -1, 0); @@ -65,6 +66,11 @@ out: SysMessage("psxMap: warning: wanted to map @%08x, got %p\n", addr, ret); + if (is_fixed) { + psxUnmap(ret, size, tag); + return NULL; + } + if (ret != NULL && ((addr ^ (long)ret) & 0x00ffffff) && !tried_to_align) { -- cgit v1.2.3