CFLAGS += -DNDEBUG
endif
endif
+ifeq ($(LOG_UNHANDLED), 1)
+CFLAGS += -DLOG_UNHANDLED
+endif
ifndef NO_AUTODEPS
AUTODEPFLAGS += -MMD -MP
endif
#define _GNU_SOURCE 1 // strcasestr
#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
+#include <time.h>
+#include <math.h>
#include <assert.h>
#ifdef __MACH__
#include <unistd.h>
// 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;
-
log_wrong_cpu();
SetIsoFile(NULL);
ReleasePlugins();
StopDebugger();
-
- if (emuLog != NULL && emuLog != stdout && emuLog != stderr) {
- fclose(emuLog);
- emuLog = NULL;
- }
}
#ifndef HAVE_LIBRETRO
va_list list;
va_start(list, fmt);
- vfprintf(emuLog, fmt, list);
+ vfprintf(stdout, fmt, list);
va_end(list);
- fflush(emuLog);
+ //fflush(stdout);
}
#else
#include "cdriso.h"
#include "ppf.h"
+#include <assert.h>
#include <errno.h>
#include <zlib.h>
#ifdef HAVE_CHD
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA
*/
+#include <stdio.h>
+#include <assert.h>
#include "psxcommon.h"
#include "r3000a.h"
#include "psxmem.h"
//#define CDRCMD_DEBUG
-#if defined (PSXCPU_LOG) || defined(PSXDMA_LOG) || defined(CDR_LOG) || defined(PSXHW_LOG) || \
- defined(PSXBIOS_LOG) || defined(PSXMEM_LOG) || defined(GTE_LOG) || defined(PAD_LOG)
-#define EMU_LOG __Log
-#endif
-
#ifdef __cplusplus
}
#endif
*/
#include <stddef.h>
+#include <stdio.h>
+#include <ctype.h>
#include <errno.h>
#include <assert.h>
#include "misc.h"
goto fail_io;
section_address = SWAPu32(section_address);
section_size = SWAPu32(section_size);
-#ifdef EMU_LOG
- EMU_LOG("Loading %08X bytes from %08X to %08X\n", section_size, ftell(tmpFile), section_address);
-#endif
+ //printf("Loading %08X bytes from %08X to %08X\n", section_size, ftell(tmpFile), section_address);
mem = PSXM(section_address);
if (mem != INVALID_PTR) {
fread_to_ram(mem, section_size, 1, tmpFile);
*/
#include <stdio.h>
+#include <assert.h>
#include "emu_if.h"
#include "pcsxmem.h"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include <stdio.h>
#include <stdlib.h>
#include <stdint.h> //include for uint64_t
#include <assert.h>
if (block->is_dirty)
continue;
if (memcmp(block->source, block->copy, block->len)) {
- printf("bad block %08x-%08x %016llx %016llx @%08x\n",
+ SysPrintf("bad block %08x-%08x %016llx %016llx @%08x\n",
block->start, block->start + block->len,
*(long long *)block->source, *(long long *)block->copy, psxRegs.pc);
fflush(stdout);
* Plugin library callback/access functions.
*/
+#include <stdio.h>
+#include <time.h>
#include "plugins.h"
#include "cdriso.h"
#include "cdrom-async.h"
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA
*/
+#include <stdio.h>
+#include <ctype.h>
#include "psxcommon.h"
#include "ppf.h"
#include "misc.h"
// TODO: implement all system calls, count the exact CPU cycles of system calls.
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
#include "psxbios.h"
#include "psxhw.h"
#include "gpu.h"
#include "psxinterpreter.h"
#include "psxevents.h"
#include "cdrom.h"
-#include <stdarg.h>
#include <zlib.h>
#ifndef PSXBIOS_LOG
#include "ppf.h"
PcsxConfig Config;
-boolean NetOpened = FALSE;
-
-int Log = 0;
-FILE *emuLog = NULL;
int EmuInit() {
return psxInit();
pl_frame_limit();
}
}
-
-void __Log(char *fmt, ...) {
- va_list list;
-#ifdef LOG_STDOUT
- char tmp[1024];
-#endif
-
- va_start(list, fmt);
-#ifndef LOG_STDOUT
- vfprintf(emuLog, fmt, list);
-#else
- vsprintf(tmp, fmt, list);
- SysPrintf(tmp);
-#endif
- va_end(list);
-}
#endif
// System includes
-#include <stdio.h>
+//#include <stdio.h>
#include <string.h>
-#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
-#include <math.h>
-#include <time.h>
-#include <ctype.h>
#ifndef __SWITCH__
#include <sys/types.h>
#endif
-#include <assert.h>
// Define types
typedef int8_t s8;
#endif
-extern FILE *emuLog;
-extern int Log;
-
-void __Log(char *fmt, ...);
-
// lots of timing depends on this and makes or breaks compatibility,
// don't change unless you're going to retest hundreds of games
#define CYCLE_MULT_DEFAULT 175
// TODO: Implement caches & cycle penalty.
+#include <stdio.h>
#include "psxmem.h"
#include "psxmem_map.h"
#include "r3000a.h"
psxCpu = &psxInt;
#endif
- Log = 0;
-
if (psxMemInit() == -1) return -1;
return psxCpu->Init();
}
if (Config.HLE || introBypassed)
psxBiosSetupBootState();
-
-#ifdef EMU_LOG
- EMU_LOG("*BIOS END*\n");
-#endif
- Log = 0;
}
void psxShutdown() {
* SIO functions.
*/
+#include <stdio.h>
#include "misc.h"
#include "psxcounters.h"
#include "psxevents.h"
void SysClose(); // Close mem and plugins
// log if the game does something we don't handle (well)
-//#define log_unhandled printf
+#ifdef LOG_UNHANDLED
+#include <stdio.h>
+#define log_unhandled printf
+#else
#define log_unhandled(...)
+#endif
#ifdef __cplusplus
}
// generic defines\r
/////////////////////////////////////////////////////////\r
\r
-//#define log_unhandled printf\r
+#ifdef LOG_UNHANDLED\r
+#define log_unhandled printf\r
+#else\r
#define log_unhandled(...)\r
+#endif\r
\r
#ifdef __GNUC__\r
#define noinline __attribute__((noinline))\r