This is ZSNES Debugger v0.01, it doesn't do much but it's a start

This commit is contained in:
pagefault
2005-02-04 01:46:49 +00:00
parent 47484beb63
commit b1a3724fda
2 changed files with 23 additions and 5 deletions

View File

@@ -285,8 +285,8 @@ NEWSYM OSExit
call exit call exit
jmp DosExit jmp DosExit
SECTION .bss SECTION .data
NEWSYM TempHandle, resd 1 NEWSYM TempHandle, dd 0
SECTION .text SECTION .text
NEWSYM Open_File NEWSYM Open_File

View File

@@ -92,10 +92,8 @@ _asm popad
#endif #endif
DWORD WindowWidth = 256; DWORD WindowWidth = 256;
DWORD WindowHeight = 224; DWORD WindowHeight = 224;
DWORD FullScreen=0; DWORD FullScreen=0;
DWORD Moving=0; DWORD Moving=0;
DWORD SoundBufferSize=1024*18; DWORD SoundBufferSize=1024*18;
@@ -111,6 +109,7 @@ DWORD FirstActivate = 1;
#define DWORD unsigned long #define DWORD unsigned long
HWND hMainWindow; HWND hMainWindow;
HANDLE debugWindow = 0;
extern "C" extern "C"
{ {
@@ -203,6 +202,7 @@ extern "C" {
int SemaphoreMax = 5; int SemaphoreMax = 5;
void InitSemaphore(); void InitSemaphore();
void ShutdownSemaphore(); void ShutdownSemaphore();
void InitDebugger();
} }
static char dinput8_dll[] = {"dinput8.dll\0"}; static char dinput8_dll[] = {"dinput8.dll\0"};
@@ -438,6 +438,7 @@ extern signed short int MainWindowY;
extern int CurKeyPos; extern int CurKeyPos;
extern int CurKeyReadPos; extern int CurKeyReadPos;
extern int KeyBuffer[16]; extern int KeyBuffer[16];
extern BYTE debugger;
} }
extern "C" void CheckPriority() extern "C" void CheckPriority()
@@ -532,6 +533,11 @@ void ExitFunction()
asm_call(SaveSramData); asm_call(SaveSramData);
asm_call(GUISaveVars); asm_call(GUISaveVars);
} }
// We need to clean up the debug window if it's running
if (debugWindow) FreeConsole();
IsActivated = 0; IsActivated = 0;
ReleaseDirectInput(); ReleaseDirectInput();
ReleaseDirectSound(); ReleaseDirectSound();
@@ -2067,6 +2073,9 @@ void initwinvideo(void)
InitInput(); InitInput();
InitSound(); InitSound();
TestJoy(); TestJoy();
if (debugger) InitDebugger(); // Start debugger
} }
if (FirstVid == 1) if (FirstVid == 1)
@@ -3039,7 +3048,7 @@ void SetMouseY(int Y)
void FrameSemaphore() void FrameSemaphore()
{ {
if (T60HZEnabled == 1) if (T60HZEnabled)
{ {
double delay; double delay;
QueryPerformanceCounter((LARGE_INTEGER*)&end); QueryPerformanceCounter((LARGE_INTEGER*)&end);
@@ -3058,5 +3067,14 @@ void ZsnesPage()
MouseY = 0; MouseY = 0;
} }
// This function creates the debug console
void InitDebugger()
{
if(AllocConsole())
{
debugWindow = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsole(debugWindow, "Welcome to the ZSNES Debugger v0.01\n", sizeof("Welcome to the ZSNES Debugger v0.01\n"), NULL, NULL);
}
} }
}