#include #include "common.h" static HWND logwin=0; static char *logtext[64]; static int logcount=0; static void RedoText(void) { char textbuf[65536]; int x; textbuf[0]=0; if(logcount>=64) { x=logcount&63; for(;;) { strcat(textbuf,logtext[x]); x=(x+1)&63; if(x==(logcount&63)) break; } } else for(x=0;x=64) free(logtext[logcount&63]); x=0; t=text; while(*t) { if(*t=='\n') x++; t++; } if(!(logtext[logcount&63]=malloc(strlen(text)+1+x+newline*2))) return; t=logtext[logcount&63]; while(*text) { if(*text=='\n') { *t='\r'; t++; } *t=*text; t++; text++; } if(newline) { *t='\r'; t++; *t='\n'; t++; } *t=0; logcount++; if(logwin) RedoText(); } void FCEUD_Message(char *text) { AddLogText(text,0); }