Here comes the new debug code...

there's good chance that I just broke the cocoa and
windows frontends, sorry about that.
This commit is contained in:
yabause 2008-11-21 22:36:40 +00:00
parent 9575c907a7
commit ffc9f0284f
11 changed files with 184 additions and 312 deletions

View File

@ -50,6 +50,7 @@
#include "debug.h" #include "debug.h"
#include "render3D.h" #include "render3D.h"
#include "GPU_osd.h" #include "GPU_osd.h"
#include "debug.h"
ARM9_struct ARM9Mem; ARM9_struct ARM9Mem;

View File

@ -25,6 +25,7 @@
#include "mem.h" #include "mem.h"
#include <string.h> //mem funcs #include <string.h> //mem funcs
#include <stdarg.h> //va_start, etc #include <stdarg.h> //va_start, etc
#include "debug.h"
#include "softrender.h" #include "softrender.h"

View File

@ -25,7 +25,7 @@
#define __GPU_OSD_ #define __GPU_OSD_
#include <stdlib.h> #include <stdlib.h>
#include "debug.h" #include "types.h"
#define OSD_MAX_LINES 10 #define OSD_MAX_LINES 10

View File

@ -90,7 +90,7 @@ void mmu_log_debug(u32 adr, u8 proc, const char *fmt, ...)
_vsnprintf(msg,511,fmt,list); _vsnprintf(msg,511,fmt,list);
va_end(list); va_end(list);
printlog("MMU ARM%s 0x%08X: %s\n",proc==ARMCPU_ARM9?"9":"7",adr, msg); LOG("MMU ARM%s 0x%08X: %s\n",proc==ARMCPU_ARM9?"9":"7",adr, msg);
} }
} }
#else #else
@ -234,7 +234,6 @@ void MMU_Init(void) {
int i; int i;
LOG("MMU init\n"); LOG("MMU init\n");
//printlog("MMU init\n");
memset(&MMU, 0, sizeof(MMU_struct)); memset(&MMU, 0, sizeof(MMU_struct));
@ -747,7 +746,6 @@ u8 FASTCALL _MMU_read8(u32 adr)
if(proc==ARMCPU_ARM9 && adr<0x02000000) if(proc==ARMCPU_ARM9 && adr<0x02000000)
{ {
//printlog("MMU ITCM (08) Read %08X: %08X\n", adr, T1ReadByte(ARM9Mem.ARM9_ITCM, adr&0x7FFF));
return T1ReadByte(ARM9Mem.ARM9_ITCM, adr&0x7FFF); return T1ReadByte(ARM9Mem.ARM9_ITCM, adr&0x7FFF);
} }
@ -786,7 +784,6 @@ u16 FASTCALL _MMU_read16(u32 adr)
#endif #endif
if(proc==ARMCPU_ARM9 && adr<0x02000000) if(proc==ARMCPU_ARM9 && adr<0x02000000)
{ {
//printlog("MMU ITCM (16) Read %08X: %08X\n", adr, T1ReadWord(ARM9Mem.ARM9_ITCM, adr&0x7FFF));
return T1ReadWord(ARM9Mem.ARM9_ITCM, adr&0x7FFF); return T1ReadWord(ARM9Mem.ARM9_ITCM, adr&0x7FFF);
} }
@ -813,8 +810,7 @@ u16 FASTCALL _MMU_read16(u32 adr)
return (gfx3d_GetNumVertex()&8191); return (gfx3d_GetNumVertex()&8191);
case REG_IPCFIFORECV : /* TODO (clear): ??? */ case REG_IPCFIFORECV : /* TODO (clear): ??? */
printlog("MMU read16: IPCFIFORECV\n"); LOG("MMU read16: IPCFIFORECV\n");
//printlog("Stopped IPCFIFORECV\n");
execute = FALSE; execute = FALSE;
return 1; return 1;
@ -827,10 +823,8 @@ u16 FASTCALL _MMU_read16(u32 adr)
return (u16)(MMU.reg_IE[proc]>>16); return (u16)(MMU.reg_IE[proc]>>16);
case REG_IF : case REG_IF :
//printlog("MMU read16 (low): REG_IF\n");
return (u16)MMU.reg_IF[proc]; return (u16)MMU.reg_IF[proc];
case REG_IF + 2 : case REG_IF + 2 :
//printlog("MMU read16 (high): REG_IF\n");
return (u16)(MMU.reg_IF[proc]>>16); return (u16)(MMU.reg_IF[proc]>>16);
case REG_TM0CNTL : case REG_TM0CNTL :
@ -868,7 +862,6 @@ u32 FASTCALL _MMU_read32(u32 adr)
if(proc==ARMCPU_ARM9 && adr<0x02000000) if(proc==ARMCPU_ARM9 && adr<0x02000000)
{ {
//printlog("MMU ITCM (32) Read %08X: %08X\n", adr, T1ReadLong(ARM9Mem.ARM9_ITCM, adr&0x7FFF));
return T1ReadLong(ARM9Mem.ARM9_ITCM, adr&0x7FFF); return T1ReadLong(ARM9Mem.ARM9_ITCM, adr&0x7FFF);
} }
@ -939,12 +932,10 @@ u32 FASTCALL _MMU_read32(u32 adr)
case REG_IE : case REG_IE :
return MMU.reg_IE[proc]; return MMU.reg_IE[proc];
case REG_IF : case REG_IF :
//printlog("MMU read32: REG_IF\n");
return MMU.reg_IF[proc]; return MMU.reg_IF[proc];
case REG_IPCFIFORECV : case REG_IPCFIFORECV :
{ {
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184); u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
//printlog("MMU read32: REG_IPCFIFORECV (%X)\n", cnt_l);
if (!(cnt_l & 0x8000)) return 0; // FIFO disabled if (!(cnt_l & 0x8000)) return 0; // FIFO disabled
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184); u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184);
u32 val = FIFOget(&MMU.fifos[proc]); u32 val = FIFOget(&MMU.fifos[proc]);
@ -1031,7 +1022,6 @@ void FASTCALL _MMU_write8(u32 adr, u8 val)
#endif #endif
if(proc==ARMCPU_ARM9 && adr<0x02000000) if(proc==ARMCPU_ARM9 && adr<0x02000000)
{ {
//printlog("MMU ITCM (08) Write %08X: %08X\n", adr, val);
T1WriteByte(ARM9Mem.ARM9_ITCM, adr&0x7FFF, val); T1WriteByte(ARM9Mem.ARM9_ITCM, adr&0x7FFF, val);
return ; return ;
} }
@ -1428,7 +1418,6 @@ void FASTCALL _MMU_write16(u32 adr, u16 val)
#endif #endif
if(proc==ARMCPU_ARM9 && adr<0x02000000) if(proc==ARMCPU_ARM9 && adr<0x02000000)
{ {
//printlog("MMU ITCM (16) Write %08X: %08X\n", adr, val);
T1WriteWord(ARM9Mem.ARM9_ITCM, adr&0x7FFF, val); T1WriteWord(ARM9Mem.ARM9_ITCM, adr&0x7FFF, val);
return ; return ;
} }
@ -1852,11 +1841,9 @@ void FASTCALL _MMU_write16(u32 adr, u16 val)
case REG_IF : case REG_IF :
//execute = FALSE; //execute = FALSE;
//printlog("MMU write16 (low): REG_IF (%X)\n", val);
MMU.reg_IF[proc] &= (~((u32)val)); MMU.reg_IF[proc] &= (~((u32)val));
return; return;
case REG_IF + 2 : case REG_IF + 2 :
//printlog("MMU write16 (high): REG_IF (%X)\n", val);
//execute = FALSE; //execute = FALSE;
MMU.reg_IF[proc] &= (~(((u32)val)<<16)); MMU.reg_IF[proc] &= (~(((u32)val)<<16));
return; return;
@ -1877,8 +1864,6 @@ void FASTCALL _MMU_write16(u32 adr, u16 val)
u32 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184) ; u32 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184) ;
u32 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184) ; u32 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184) ;
//printlog("MMU write16 (%s): REG_IPCFIFOCNT 0x(%08X)\n", proc?"ARM9":"ARM7",REG_IPCFIFOCNT);
//printlog(" --- val=%X\n",val);
if ((val & 0x8000) && !(cnt_l & 0x8000)) if ((val & 0x8000) && !(cnt_l & 0x8000))
{ {
@ -2102,7 +2087,6 @@ void FASTCALL _MMU_write32(u32 adr, u32 val)
#endif #endif
if(proc==ARMCPU_ARM9 && adr<0x02000000) if(proc==ARMCPU_ARM9 && adr<0x02000000)
{ {
//printlog("MMU ITCM (32) Write %08X: %08X\n", adr, val);
T1WriteLong(ARM9Mem.ARM9_ITCM, adr&0x7FFF, val); T1WriteLong(ARM9Mem.ARM9_ITCM, adr&0x7FFF, val);
return ; return ;
} }
@ -2543,7 +2527,6 @@ void FASTCALL _MMU_write32(u32 adr, u32 val)
case 0x04000600: // Geometry Engine Status Register (R and R/W) case 0x04000600: // Geometry Engine Status Register (R and R/W)
{ {
//printlog("MMU write32: Geometry Engine Status Register (R and R/W)\n");
MMU.fifos[proc].irq = (val>>30) & 0x03; MMU.fifos[proc].irq = (val>>30) & 0x03;
return; return;
} }
@ -2687,7 +2670,6 @@ void FASTCALL _MMU_write32(u32 adr, u32 val)
return; return;
case REG_IF : case REG_IF :
//printlog("MMU write32: REG_IF (%X)\n", val);
MMU.reg_IF[proc] &= (~val); MMU.reg_IF[proc] &= (~val);
return; return;
@ -2884,7 +2866,7 @@ void FASTCALL _MMU_write32(u32 adr, u32 val)
case REG_IPCSYNC : case REG_IPCSYNC :
{ {
//execute=FALSE; //execute=FALSE;
printlog("MMU write 32 IPCSYNC\n"); LOG("MMU write 32 IPCSYNC\n");
u32 remote = (proc+1)&1; u32 remote = (proc+1)&1;
u32 IPCSYNC_remote = T1ReadLong(MMU.MMU_MEM[remote][0x40], 0x180); u32 IPCSYNC_remote = T1ReadLong(MMU.MMU_MEM[remote][0x40], 0x180);
T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x180, (val&0xFFF0)|((IPCSYNC_remote>>8)&0xF)); T1WriteLong(MMU.MMU_MEM[proc][0x40], 0x180, (val&0xFFF0)|((IPCSYNC_remote>>8)&0xF));
@ -2915,7 +2897,7 @@ void FASTCALL _MMU_write32(u32 adr, u32 val)
} }
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, val & 0xBFF4); T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, val & 0xBFF4);
#else #else
printlog("MMU write32: REG_IPCFIFOCNT\n"); LOG("MMU write32: REG_IPCFIFOCNT\n");
#endif #endif
//execute = FALSE; //execute = FALSE;
return; return;
@ -2925,7 +2907,6 @@ void FASTCALL _MMU_write32(u32 adr, u32 val)
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184); u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
if (!(cnt_l & 0x8000)) return; //FIFO disabled if (!(cnt_l & 0x8000)) return; //FIFO disabled
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184); u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184);
//printlog("MMU write32 (%s): REG_IPCFIFOSEND (%X-%X) val=%X\n", proc?"ARM9":"ARM7",cnt_l,cnt_r,val);
//FIFOadd(MMU.fifos+(proc^1), val); //FIFOadd(MMU.fifos+(proc^1), val);
FIFOadd(&MMU.fifos[proc^1], val); FIFOadd(&MMU.fifos[proc^1], val);
cnt_l = (cnt_l & 0xFFFC) | (MMU.fifos[proc^1].full?0x0002:0); cnt_l = (cnt_l & 0xFFFC) | (MMU.fifos[proc^1].full?0x0002:0);
@ -3122,7 +3103,7 @@ void FASTCALL _MMU_write32(u32 adr, u32 val)
//Transfer starts at next frame. //Transfer starts at next frame.
//Main Memory Display/Capture is supported for Display Engine A only. //Main Memory Display/Capture is supported for Display Engine A only.
printlog("MMU write32: REG_DISPA_DISPMMEMFIFO\n"); LOG("MMU write32: REG_DISPA_DISPMMEMFIFO\n");
#endif #endif
break; break;
} }

View File

@ -618,9 +618,6 @@ int main(int argc, char ** argv) {
} }
#endif #endif
#ifdef DEBUG
LogStart();
#endif
#ifdef GDB_STUB #ifdef GDB_STUB
NDS_Init( arm9_memio, &arm9_ctrl_iface, NDS_Init( arm9_memio, &arm9_ctrl_iface,
arm7_memio, &arm7_ctrl_iface); arm7_memio, &arm7_ctrl_iface);
@ -847,9 +844,5 @@ int main(int argc, char ** argv) {
} }
#endif #endif
#ifdef DEBUG
LogStop();
#endif
return 0; return 0;
} }

View File

@ -1,159 +1,96 @@
/* Copyright 2005 Guillaume Duhamel /* Copyright (C) 2008 Guillaume Duhamel
This file is part of DeSmuME. This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "debug.h" #include "debug.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdio.h>
#include <string.h>
std::vector<Logger *> Logger::channels;
//////////////////////////////////////////////////////////////////////////////
static void defaultCallback(const Logger& logger, const char * message) {
Debug * DebugInit(const char * n, DebugOutType t, char * s) { logger.getOutput() << message;
Debug * d; }
if ((d = (Debug *) malloc(sizeof(Debug))) == NULL) Logger::Logger() {
return NULL; out = &std::cout;
callback = defaultCallback;
d->output_type = t; flags = 0;
}
if ((d->name = strdup(n)) == NULL)
{ void Logger::vprintf(const char * format, va_list l, const char * file, unsigned int line) {
free(d); char buffer[1024];
return NULL; char * cur = buffer;
}
if (flags & Logger::FILE) cur += sprintf(cur, "%s:", file);
switch(t) { if (flags & Logger::LINE) cur += sprintf(cur, "%d:", line);
case DEBUG_STREAM: if (flags) cur += sprintf(cur, " ");
d->output.stream = fopen(s, "w");
break; ::vsnprintf(cur, 1024, format, l);
case DEBUG_STRING: callback(*this, buffer);
d->output.string = s; }
break;
case DEBUG_STDOUT: void Logger::setOutput(std::ostream * out) {
d->output.stream = stdout; this->out = out;
break; }
case DEBUG_STDERR:
d->output.stream = stderr; void Logger::setCallback(void (*callback)(const Logger& logger, const char * message)) {
break; this->callback = callback;
} }
return d; void Logger::setFlag(unsigned int flag) {
} this->flags = flag;
}
//////////////////////////////////////////////////////////////////////////////
void Logger::fixSize(unsigned int channel) {
void DebugDeInit(Debug * d) { while(channel >= channels.size()) {
if (d == NULL) channels.push_back(new Logger());
return; }
}
switch(d->output_type) {
case DEBUG_STREAM: std::ostream& Logger::getOutput() const {
if (d->output.stream) return *out;
fclose(d->output.stream); }
break;
case DEBUG_STRING: void Logger::log(unsigned int channel, const char * file, unsigned int line, const char * format, ...) {
case DEBUG_STDOUT: fixSize(channel);
case DEBUG_STDERR:
break; va_list l;
} va_start(l, format);
if (d->name) channels[channel]->vprintf(format, l, file, line);
free(d->name); va_end(l);
free(d); }
}
void Logger::log(unsigned int channel, const char * file, unsigned int line, std::ostream& os) {
////////////////////////////////////////////////////////////////////////////// fixSize(channel);
void DebugChangeOutput(Debug * d, DebugOutType t, char * s) { channels[channel]->setOutput(&os);
if (t != d->output_type) { }
if (d->output_type == DEBUG_STREAM)
{ void Logger::log(unsigned int channel, const char * file, unsigned int line, unsigned int flag) {
if (d->output.stream) fixSize(channel);
fclose(d->output.stream);
} channels[channel]->setFlag(flag);
d->output_type = t; }
}
switch(t) { void Logger::log(unsigned int channel, const char * file, unsigned int line, void (*callback)(const Logger& logger, const char * message)) {
case DEBUG_STREAM: fixSize(channel);
d->output.stream = fopen(s, "w");
break; channels[channel]->setCallback(callback);
case DEBUG_STRING: }
d->output.string = s;
break;
case DEBUG_STDOUT:
d->output.stream = stdout;
break;
case DEBUG_STDERR:
d->output.stream = stderr;
break;
}
}
//////////////////////////////////////////////////////////////////////////////
void DebugPrintf(Debug * d, const char * file, u32 line, const char * format, ...) {
va_list l;
if (d == NULL)
return;
va_start(l, format);
switch(d->output_type) {
case DEBUG_STDOUT:
case DEBUG_STDERR:
case DEBUG_STREAM:
if (d->output.stream == NULL)
break;
fprintf(d->output.stream, "%s (%s:%ld): ", d->name, file, line);
vfprintf(d->output.stream, format, l);
break;
case DEBUG_STRING:
{
int i;
if (d->output.string == NULL)
break;
i = sprintf(d->output.string, "%s (%s:%ld): ", d->name, file, line);
vsprintf(d->output.string + i, format, l);
}
break;
}
va_end(l);
}
//////////////////////////////////////////////////////////////////////////////
Debug * MainLog;
//////////////////////////////////////////////////////////////////////////////
void LogStart(void) {
MainLog = DebugInit("main", DEBUG_STDERR, NULL);
// MainLog = DebugInit("main", DEBUG_STREAM, "stdout.txt");
}
//////////////////////////////////////////////////////////////////////////////
void LogStop(void) {
DebugDeInit(MainLog);
}
//////////////////////////////////////////////////////////////////////////////

View File

@ -1,103 +1,79 @@
/* Copyright 2005-2006 Guillaume Duhamel /* Copyright (C) 2008 Guillaume Duhamel
This file is part of DeSmuME. This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef DEBUG_H #ifndef LOGGER_H
#define DEBUG_H #define LOGGER_H
#include "types.h" #include <vector>
#include <stdio.h> #include <iostream>
#ifdef _WIN32 class Logger {
#include "windows/console.h" protected:
#endif void (*callback)(const Logger& logger, const char * format);
std::ostream * out;
#if defined(BETA_VERSION) && defined(WIN32) unsigned int flags;
void OpenConsole();
void CloseConsole(); static std::vector<Logger *> channels;
void printlog(const char *fmt, ...);
#else static void fixSize(unsigned int channel);
#define OpenConsole() public:
#define CloseConsole() Logger();
#define printlog(...)
#endif void vprintf(const char * format, va_list l, const char * filename, unsigned int line);
void setOutput(std::ostream * out);
typedef enum { DEBUG_STRING, DEBUG_STREAM , DEBUG_STDOUT, DEBUG_STDERR } DebugOutType; void setCallback(void (*callback)(const Logger& logger, const char * message));
void setFlag(unsigned int flag);
typedef struct {
DebugOutType output_type; std::ostream& getOutput() const;
union {
FILE * stream; static const int LINE = 1;
char * string; static const int FILE = 2;
} output;
char * name; static void log(unsigned int channel, const char * file, unsigned int line, const char * format, ...);
} Debug; static void log(unsigned int channel, const char * file, unsigned int line, std::ostream& os);
static void log(unsigned int channel, const char * file, unsigned int line, unsigned int flag);
Debug * DebugInit(const char *, DebugOutType, char *); static void log(unsigned int channel, const char * file, unsigned int line, void (*callback)(const Logger& logger, const char * message));
void DebugDeInit(Debug *); };
void DebugChangeOutput(Debug *, DebugOutType, char *); #ifdef DEBUG
void DebugPrintf(Debug *, const char *, u32, const char *, ...); #define LOGC(channel, ...) Logger::log(channel, __FILE__, __LINE__, __VA_ARGS__)
#define LOG(...) LOGC(0, __VA_ARGS__)
extern Debug * MainLog;
#define GPULOG(...) LOGC(1, __VA_ARGS__)
void LogStart(void); #define DIVLOG(...) LOGC(2, __VA_ARGS__)
void LogStop(void); #define SQRTLOG(...) LOGC(3, __VA_ARGS__)
#define DMALOG(...) LOGC(3, __VA_ARGS__)
#ifdef DEBUG
#define LOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #else
#else
#if defined(WIN32) && defined(BETA_VERSION) && defined(OLD_LOG) #define LOGC(...)
#define LOG(...) printlog(__VA_ARGS__) #define LOG(...)
#else
#define LOG(...) #define GPULOG(...)
#endif #define DIVLOG(...)
#endif #define SQRTLOG(...)
#define DMALOG(...)
#ifdef GPUDEBUG
#define GPULOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #endif
#else
#define GPULOG(...) #define INFOC(channel, ...) Logger::log(channel, __FILE__, __LINE__, __VA_ARGS__)
#endif #define INFO(...) INFOC(10, __VA_ARGS__)
#ifdef DIVDEBUG #endif
#define DIVLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else
#define DIVLOG(...)
#endif
#ifdef SQRTDEBUG
#define SQRTLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else
#define SQRTLOG(...)
#endif
#ifdef CARDDEBUG
#define CARDLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else
#define CARDLOG(...)
#endif
#ifdef DMADEBUG
#define DMALOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else
#define DMALOG(...)
#endif
#endif

View File

@ -394,10 +394,6 @@ common_gtk_glade_main( struct configured_features *my_config) {
//g_thread_init(NULL); //g_thread_init(NULL);
register_gl_fun(my_gl_Begin,my_gl_End); register_gl_fun(my_gl_Begin,my_gl_End);
#endif #endif
#ifdef DEBUG
LogStart();
#endif
init_keyvals(); init_keyvals();
#ifdef GDB_STUB #ifdef GDB_STUB
@ -555,9 +551,6 @@ common_gtk_glade_main( struct configured_features *my_config) {
SDL_DestroySemaphore( glade_fps_limiter_semaphore); SDL_DestroySemaphore( glade_fps_limiter_semaphore);
} }
#ifdef DEBUG
LogStop();
#endif
/* Unload joystick */ /* Unload joystick */
uninit_joy(); uninit_joy();

View File

@ -1460,10 +1460,6 @@ common_gtk_main( struct configured_features *my_config)
bad_glob_cflash_disk_image_file = my_config->cflash_disk_image_file; bad_glob_cflash_disk_image_file = my_config->cflash_disk_image_file;
#ifdef DEBUG
LogStart();
#endif
#ifdef GDB_STUB #ifdef GDB_STUB
if ( my_config->arm9_gdb_port != 0) { if ( my_config->arm9_gdb_port != 0) {
arm9_gdb_stub = createStub_gdb( my_config->arm9_gdb_port, arm9_gdb_stub = createStub_gdb( my_config->arm9_gdb_port,
@ -1926,9 +1922,6 @@ common_gtk_main( struct configured_features *my_config)
SDL_DestroySemaphore( fps_limiter_semaphore); SDL_DestroySemaphore( fps_limiter_semaphore);
} }
#ifdef DEBUG
LogStop();
#endif
/* Unload joystick */ /* Unload joystick */
uninit_joy(); uninit_joy();

View File

@ -102,7 +102,7 @@ void mc_reset_com(memory_chip_t *mc)
{ {
u32 addr, size; u32 addr, size;
printlog("autodetectsize = %d\n",mc->autodetectsize); LOG("autodetectsize = %d\n",mc->autodetectsize);
if (mc->autodetectsize == (32768+2)) if (mc->autodetectsize == (32768+2))
{ {

View File

@ -1223,9 +1223,6 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
hAccel = LoadAccelerators(hAppInst, MAKEINTRESOURCE(IDR_MAIN_ACCEL)); hAccel = LoadAccelerators(hAppInst, MAKEINTRESOURCE(IDR_MAIN_ACCEL));
#ifdef DEBUG
LogStart();
#endif
mainMenu = LoadMenu(hThisInstance, "MENU_PRINCIPAL"); //Load Menu, and store handle mainMenu = LoadMenu(hThisInstance, "MENU_PRINCIPAL"); //Load Menu, and store handle
if (!MainWindow->setMenu(mainMenu)) if (!MainWindow->setMenu(mainMenu))
{ {