mirror of https://github.com/PCSX2/pcsx2.git
Fix for plugin console logging via stdout/stderr, which stopped working when we switched to the shared msvcrt dlls.
mVU: Quick fix to zero out some memory/pointers; fixes assertion failures when running debug mode builds. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1452 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
ba5823b144
commit
fba2e4519d
|
@ -21,9 +21,13 @@
|
||||||
#include "System.h"
|
#include "System.h"
|
||||||
#include "DebugTools/Debug.h"
|
#include "DebugTools/Debug.h"
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
namespace Console
|
namespace Console
|
||||||
{
|
{
|
||||||
static HANDLE hConsole = NULL;
|
static HANDLE hConsole = NULL;
|
||||||
|
static int hCrt;
|
||||||
|
|
||||||
static const int tbl_color_codes[] =
|
static const int tbl_color_codes[] =
|
||||||
{
|
{
|
||||||
|
@ -50,24 +54,34 @@ namespace Console
|
||||||
SMALL_RECT srect;
|
SMALL_RECT srect;
|
||||||
|
|
||||||
if( hConsole ) return;
|
if( hConsole ) return;
|
||||||
|
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
SetConsoleTitle(_("Ps2 Output"));
|
SetConsoleTitle(_("Ps2 Output"));
|
||||||
|
|
||||||
|
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|
||||||
|
hCrt = _open_osfhandle( (intptr_t)hConsole, _O_TEXT );
|
||||||
|
FILE* hfp = _fdopen( hCrt, "w" );
|
||||||
|
*stdout = *hfp;
|
||||||
|
*stderr = *hfp;
|
||||||
|
setvbuf( stdout, NULL, _IONBF, 0 );
|
||||||
|
setvbuf( stderr, NULL, _IONBF, 0 );
|
||||||
|
|
||||||
csize.X = 100;
|
csize.X = 100;
|
||||||
csize.Y = 2048;
|
csize.Y = 2048;
|
||||||
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), csize);
|
SetConsoleScreenBufferSize(hConsole, csize);
|
||||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbiInfo);
|
GetConsoleScreenBufferInfo(hConsole, &csbiInfo);
|
||||||
|
|
||||||
srect = csbiInfo.srWindow;
|
srect = csbiInfo.srWindow;
|
||||||
srect.Right = srect.Left + 99;
|
srect.Right = srect.Left + 99;
|
||||||
srect.Bottom = srect.Top + 64;
|
srect.Bottom = srect.Top + 64;
|
||||||
SetConsoleWindowInfo(GetStdHandle(STD_OUTPUT_HANDLE), TRUE, &srect);
|
SetConsoleWindowInfo(hConsole, TRUE, &srect);
|
||||||
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close()
|
void Close()
|
||||||
{
|
{
|
||||||
if( hConsole == NULL ) return;
|
if( hConsole == NULL ) return;
|
||||||
|
_close( hCrt );
|
||||||
FreeConsole();
|
FreeConsole();
|
||||||
hConsole = NULL;
|
hConsole = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,8 @@ microVUt(void) mVUreset(mV) {
|
||||||
mVU->prog.max = mMaxProg - 1;
|
mVU->prog.max = mMaxProg - 1;
|
||||||
mVU->prog.prog = (microProgram*)_aligned_malloc(sizeof(microProgram)*(mVU->prog.max+1), 64);
|
mVU->prog.prog = (microProgram*)_aligned_malloc(sizeof(microProgram)*(mVU->prog.max+1), 64);
|
||||||
|
|
||||||
|
memset( mVU->prog.prog, 0, sizeof(microProgram)*(mVU->prog.max+1) );
|
||||||
|
|
||||||
// Setup Dynarec Cache Limits for Each Program
|
// Setup Dynarec Cache Limits for Each Program
|
||||||
u8* z = (mVU->cache + 0x1000); // Dispatcher Code is in first page of cache
|
u8* z = (mVU->cache + 0x1000); // Dispatcher Code is in first page of cache
|
||||||
for (int i = 0; i <= mVU->prog.max; i++) {
|
for (int i = 0; i <= mVU->prog.max; i++) {
|
||||||
|
|
Loading…
Reference in New Issue