From ef0942a90cbe1850f682854fcd1a332fef279e83 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 7 Mar 2003 18:22:13 +0000 Subject: [PATCH] *** empty log message *** --- Include/Win32/Cxbx/WndAbout.h | 9 +- Include/Win32/Cxbx/WndMain.h | 2 +- Include/Win32/CxbxKrnl/EmuX.h | 18 +- Source/Win32/Cxbx/EmuExe.cpp | 6 +- Source/Win32/Cxbx/WndAbout.cpp | 79 +++----- Source/Win32/Cxbx/WndMain.cpp | 281 +++++++++++++------------- Source/Win32/CxbxKrnl/EmuX.cpp | 6 +- Source/Win32/CxbxKrnl/EmuXD3D.cpp | 5 +- Source/Win32/CxbxKrnl/EmuXKrnl.cpp | 6 +- Source/Win32/CxbxKrnl/EmuXLDT.cpp | 6 +- Source/Win32/CxbxKrnl/EmuXapi.cpp | 6 +- Source/Win32/CxbxKrnl/EmuXxapi.cpp | 3 +- Source/Win32/CxbxKrnl/KernelThunk.cpp | 19 +- 13 files changed, 212 insertions(+), 234 deletions(-) diff --git a/Include/Win32/Cxbx/WndAbout.h b/Include/Win32/Cxbx/WndAbout.h index df4515a92..e6f6b088d 100644 --- a/Include/Win32/Cxbx/WndAbout.h +++ b/Include/Win32/Cxbx/WndAbout.h @@ -50,11 +50,10 @@ class WndAbout : public Wnd private: - HFONT m_hFont; - - HDC m_back_dc; - HBITMAP m_orig_bmp; - HBITMAP m_back_bmp; + HDC m_BackDC; + HBITMAP m_OrigBmp; + HBITMAP m_BackBmp; + HFONT m_hFont; }; #endif \ No newline at end of file diff --git a/Include/Win32/Cxbx/WndMain.h b/Include/Win32/Cxbx/WndMain.h index 2d0e9af53..bb68cdd36 100644 --- a/Include/Win32/Cxbx/WndMain.h +++ b/Include/Win32/Cxbx/WndMain.h @@ -68,7 +68,7 @@ class WndMain : public Wnd void LoadLogo(); // refresh the logo in the main window - void UpdateDebugConsoles(); // Allocate / Deallocate debug consoles as per configuration + void UpdateDebugConsoles(); // allocate / deallocate debug consoles as per configuration HDC m_back_dc; HDC m_logo_dc; diff --git a/Include/Win32/CxbxKrnl/EmuX.h b/Include/Win32/CxbxKrnl/EmuX.h index 39ca433f2..e0297b382 100644 --- a/Include/Win32/CxbxKrnl/EmuX.h +++ b/Include/Win32/CxbxKrnl/EmuX.h @@ -34,18 +34,18 @@ #ifndef EMUX_H #define EMUX_H -// ****************************************************************** -// * namespace used to avoid collisions with ntdll and win32 -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace xboxkrnl { #include #include "EmuXxapi.h" }; -// ****************************************************************** -// * namespace used to avoid collisions with ntdll and win32 -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace win32 { #undef FIELD_OFFSET // prevent macro redefinition warnings @@ -54,9 +54,9 @@ namespace win32 #include }; -// ****************************************************************** -// * namespace used to avoid collisions with ntdll and win32 -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace xboxkrnl { #include "EmuXD3D.h" diff --git a/Source/Win32/Cxbx/EmuExe.cpp b/Source/Win32/Cxbx/EmuExe.cpp index 327d9bed1..4d3efa868 100644 --- a/Source/Win32/Cxbx/EmuExe.cpp +++ b/Source/Win32/Cxbx/EmuExe.cpp @@ -39,9 +39,9 @@ #include "EmuX.h" using namespace win32; -// ****************************************************************** -// * namespace used to avoid collisions with ntdll and xboxkrnl -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace win32 { #include diff --git a/Source/Win32/Cxbx/WndAbout.cpp b/Source/Win32/Cxbx/WndAbout.cpp index e02a14de9..f7188fdfd 100644 --- a/Source/Win32/Cxbx/WndAbout.cpp +++ b/Source/Win32/Cxbx/WndAbout.cpp @@ -36,9 +36,9 @@ #include "ResCxbx.h" -// ****************************************************************** -// * constructor -// ****************************************************************** +// ****************************************************************** +// * constructor +// ****************************************************************** WndAbout::WndAbout(HINSTANCE x_hInstance, HWND x_parent) : Wnd(x_hInstance) { m_classname = "WndAbout"; @@ -47,7 +47,9 @@ WndAbout::WndAbout(HINSTANCE x_hInstance, HWND x_parent) : Wnd(x_hInstance) m_w = 285; m_h = 180; - // center to parent + // ****************************************************************** + // * center to parent + // ****************************************************************** { RECT rect; @@ -85,13 +87,13 @@ LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l int nHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72); - m_hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, FF_ROMAN, "verdana"); + m_hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, FF_ROMAN, "Verdana"); - m_back_bmp = (HBITMAP)LoadImage(m_hInstance, MAKEINTRESOURCE(IDB_ABOUT), IMAGE_BITMAP, 0, 0, 0); + m_BackBmp = (HBITMAP)LoadImage(m_hInstance, MAKEINTRESOURCE(IDB_ABOUT), IMAGE_BITMAP, 0, 0, 0); - m_back_dc = CreateCompatibleDC(hDC); + m_BackDC = CreateCompatibleDC(hDC); - m_orig_bmp = (HBITMAP)SelectObject(m_back_dc, m_back_bmp); + m_OrigBmp = (HBITMAP)SelectObject(m_BackDC, m_BackBmp); ReleaseDC(hwnd, hDC); } @@ -105,50 +107,33 @@ LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l HDC hDC = GetDC(hwnd); - // draw text + // ****************************************************************** + // * draw window + // ****************************************************************** { - HGDIOBJ tmpObj = SelectObject(hDC, m_hFont); + HGDIOBJ OrgObj = SelectObject(hDC, m_hFont); - // draw top version bar and bottom url bar + // ****************************************************************** + // * draw bottom URL bar + // ****************************************************************** { SetBkColor(hDC, GetSysColor(COLOR_HIGHLIGHT)); SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); - // bottom url bar - { - char buffer[] = " Contact the Author : Caustik@Caustik.com"; + char buffer[] = " Contact the author : caustik@caustik.com"; - RECT rect = {0, 134, 280, 148}; - ExtTextOut(hDC, 0, 134, ETO_OPAQUE, &rect, buffer, strlen(buffer), 0); - } + RECT rect = {0, 134, 280, 148}; + + ExtTextOut(hDC, 0, 134, ETO_OPAQUE, &rect, buffer, strlen(buffer), 0); } - // draw bitmap - BitBlt(hDC, 2, 4, 275, 125, m_back_dc, 0, 0, SRCCOPY); + // ****************************************************************** + // * draw bitmap + // ****************************************************************** + BitBlt(hDC, 2, 4, 275, 125, m_BackDC, 0, 0, SRCCOPY); - /* - // draw credits - { - SetBkColor(hDC, RGB(0,0,0)); - - SetTextColor(hDC, RGB(0xFF,0xFF,0xFF)); - - char bufferA[] = " Cxbx Version " CXBX_VERSION; - char bufferB[] = " Cxbx is an open source, free, legal program."; - char bufferC[] = " If you wish to contribute in any way, please"; - - RECT rectA = {0, 5, 200, 19}; - ExtTextOut(hDC, 0, 4, ETO_OPAQUE, &rectA, bufferA, strlen(bufferA), 0); - - RECT rectB = {0, 20, 200, 34}; - ExtTextOut(hDC, 0, 20, ETO_OPAQUE, &rectB, bufferB, strlen(bufferB), 0); - - RECT rectC = {0, 35, 200, 49}; - ExtTextOut(hDC, 0, 35, ETO_OPAQUE, &rectC, bufferC, strlen(bufferC), 0); - }*/ - - SelectObject(hDC, tmpObj); + SelectObject(hDC, OrgObj); } if(hDC != NULL) @@ -159,24 +144,18 @@ LRESULT CALLBACK WndAbout::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l break; case WM_LBUTTONUP: - { SendMessage(hwnd, WM_CLOSE, 0, 0); - } - break; + break; case WM_CLOSE: - { EnableWindow(m_parent, TRUE); DestroyWindow(hwnd); - } - break; + break; case WM_DESTROY: - { DeleteObject(m_hFont); PostQuitMessage(0); - } - break; + break; default: return DefWindowProc(hwnd, uMsg, wParam, lParam); diff --git a/Source/Win32/Cxbx/WndMain.cpp b/Source/Win32/Cxbx/WndMain.cpp index 277267022..696c5712d 100644 --- a/Source/Win32/Cxbx/WndMain.cpp +++ b/Source/Win32/Cxbx/WndMain.cpp @@ -37,7 +37,8 @@ #include "WndAbout.h" #include "ResCxbx.h" -#include +#include +#include // ****************************************************************** // * constructor @@ -61,18 +62,12 @@ WndMain::WndMain(HINSTANCE x_hInstance) : Wnd(x_hInstance), m_bCreated(false), m m_x = rect.left + (rect.right - rect.left)/2 - m_w/2; m_y = rect.top + (rect.bottom - rect.top)/2 - m_h/2; } - - m_ExeFilename = new char[260]; - m_ExeFilename[0] = '\0'; - - m_XbeFilename = new char[260]; - m_XbeFilename[0] = '\0'; - - m_CxbxDebugFilename = new char[260]; - m_CxbxDebugFilename[0] = '\0'; - - m_KrnlDebugFilename = new char[260]; - m_KrnlDebugFilename[0] = '\0'; + + m_ExeFilename = (char*)calloc(1, 260); + m_XbeFilename = (char*)calloc(1, 260); + + m_CxbxDebugFilename = (char*)calloc(1, 260); + m_KrnlDebugFilename = (char*)calloc(1, 260); // ****************************************************************** // * Load configuration from registry @@ -107,9 +102,9 @@ WndMain::WndMain(HINSTANCE x_hInstance) : Wnd(x_hInstance), m_bCreated(false), m // ****************************************************************** WndMain::~WndMain() { - // ****************************************************************** - // * Save configuration to registry - // ****************************************************************** + // ****************************************************************** + // * Save configuration to registry + // ****************************************************************** { DWORD dwDisposition, dwType, dwSize; HKEY hKey; @@ -151,28 +146,34 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { case WM_CREATE: { - // resize so that client area = 321x201 - { - RECT cRect = {0}; - RECT wRect = {0}; + // ****************************************************************** + // * resize window so that client area == 321x201 + // ****************************************************************** + { + RECT cRect; + RECT wRect; GetClientRect(hwnd, &cRect); GetWindowRect(hwnd, &wRect); - uint32 difW = (wRect.right - wRect.left) - (cRect.right); - uint32 difH = (wRect.bottom - wRect.top) - (cRect.bottom); + uint32 difW = (wRect.right - wRect.left) - (cRect.right); + uint32 difH = (wRect.bottom - wRect.top) - (cRect.bottom); MoveWindow(hwnd, wRect.left, wRect.top, difW + 321, difH + 221, TRUE); } - // initialize menu + // ****************************************************************** + // * initialize menu + // ****************************************************************** { HMENU hMenu = LoadMenu(m_hInstance, MAKEINTRESOURCE(IDR_MAINMENU)); SetMenu(hwnd, hMenu); } - // initialize back buffer + // ****************************************************************** + // * initialize back buffer + // ****************************************************************** { HDC hDC = GetDC(hwnd); @@ -195,12 +196,12 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP case WM_PAINT: { - static bool menuInit = false; + static bool s_bInitMenu = true; - if(menuInit == false) + if(!s_bInitMenu) { UpdateDebugConsoles(); - menuInit = true; + s_bInitMenu = false; } PAINTSTRUCT ps; @@ -209,48 +210,38 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP HDC hDC = GetDC(hwnd); - // draw xbox image - { - uint32 offy = 0; - - if(m_xbe == 0) - offy = 10; - - BitBlt(hDC, 0, offy, 320, 160, m_back_dc, 0, 0, SRCCOPY); - } - - // draw logo bitmap - { - BitBlt(hDC, 220, 168, 100, 17, m_logo_dc, 0, 0, SRCCOPY); - } - - // draw status bar - { - int nHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72); - - HFONT hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, FF_ROMAN, "verdana"); - - HGDIOBJ tmpObj = SelectObject(hDC, hFont); - - SetBkColor(hDC, GetSysColor(COLOR_HIGHLIGHT)); - - SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); - - char buffer[255]; - - if(m_xbe != 0 && m_xbe->GetError() == 0) - sprintf(buffer, "%s Loaded!", m_xbe->m_szAsciiTitle); - else - sprintf(buffer, "%s", "Disclaimer: CXBX has no affiliation with Microsoft"); - - RECT rect = {0, 187, 321, 201}; - - ExtTextOut(hDC, 5, 187, ETO_OPAQUE, &rect, buffer, strlen(buffer), 0); - - SelectObject(hDC, tmpObj); - - DeleteObject(hFont); - } + // ****************************************************************** + // * draw splash/logo/status + // ****************************************************************** + { + BitBlt(hDC, 0, (m_xbe == 0) ? 0 : 10, 320, 160, m_back_dc, 0, 0, SRCCOPY); + BitBlt(hDC, 220, 168, 100, 17, m_logo_dc, 0, 0, SRCCOPY); + + int nHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72); + + HFONT hFont = CreateFont(nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, FF_ROMAN, "Verdana"); + + HGDIOBJ tmpObj = SelectObject(hDC, hFont); + + SetBkColor(hDC, GetSysColor(COLOR_HIGHLIGHT)); + + SetTextColor(hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); + + char buffer[255]; + + if(m_xbe != 0 && m_xbe->GetError() == 0) + sprintf(buffer, "%s Loaded!", m_xbe->m_szAsciiTitle); + else + sprintf(buffer, "%s", "Disclaimer: CXBX has no affiliation with Microsoft"); + + RECT rect = {0, 187, 321, 201}; + + ExtTextOut(hDC, 5, 187, ETO_OPAQUE, &rect, buffer, strlen(buffer), 0); + + SelectObject(hDC, tmpObj); + + DeleteObject(hFont); + } if(hDC != NULL) ReleaseDC(hwnd, hDC); @@ -286,10 +277,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP break; case ID_FILE_CLOSE_XBE: - { CloseXbe(); - } - break; + break; case ID_FILE_SAVEXBEFILE: { @@ -301,10 +290,8 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP break; case ID_FILE_SAVEXBEFILEAS: - { SaveXbeAs(); - } - break; + break; case ID_FILE_IMPORTFROMEXE: { @@ -329,18 +316,18 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP { m_XbeFilename[0] = '\0'; - Exe *tmp = new Exe(ofn.lpstrFile); + Exe *i_exe = new Exe(ofn.lpstrFile); - if(tmp->GetError() != 0) + if(i_exe->GetError() != 0) { - MessageBox(m_hwnd, tmp->GetError(), "Cxbx", MB_ICONSTOP | MB_OK); + MessageBox(m_hwnd, i_exe->GetError(), "Cxbx", MB_ICONSTOP | MB_OK); - delete tmp; + delete i_exe; break; } - m_xbe = new Xbe(tmp, "Untitled", true); + m_xbe = new Xbe(i_exe, "Untitled", true); if(m_xbe->GetError() != 0) { @@ -386,21 +373,19 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP ofn.Flags = OFN_PATHMUSTEXIST; if(GetSaveFileName(&ofn) == TRUE) - { - // check if file exists - { - FILE *tmp = fopen(ofn.lpstrFile, "r"); + { + // ****************************************************************** + // * ask permission to overwrite if file exists + // ****************************************************************** + if(_access(ofn.lpstrFile, 0) != -1) + { + if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) + return TRUE; + } - if(tmp != 0) - { - fclose(tmp); - - if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) - return TRUE; - } - } - - // export logo bitmap + // ****************************************************************** + // * export logo bitmap + // ****************************************************************** { uint08 i_gray[100*17]; @@ -408,9 +393,11 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP if(m_xbe->GetError() == 0) { - FILE *logo = fopen(ofn.lpstrFile, "wb"); + FILE *LogoBitmap = fopen(ofn.lpstrFile, "wb"); - // write bitmap header + // ****************************************************************** + // * write bitmap header + // ****************************************************************** { BITMAPFILEHEADER bmfh; @@ -420,10 +407,12 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP bmfh.bfReserved2 = 0; bmfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFO) - sizeof(RGBQUAD); - fwrite(&bmfh, sizeof(bmfh), 1, logo); + fwrite(&bmfh, sizeof(bmfh), 1, LogoBitmap); } - // write bitmap info + // ****************************************************************** + // * write bitmap info + // ****************************************************************** { BITMAPINFO bmi; @@ -439,10 +428,12 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP bmi.bmiHeader.biClrUsed = 0; bmi.bmiHeader.biClrImportant = 0; - fwrite(&bmi, sizeof(bmi) - 4, 1, logo); + fwrite(&bmi, sizeof(bmi) - 4, 1, LogoBitmap); } - // write bitmap data + // ****************************************************************** + // * write bitmap data + // ****************************************************************** { RGBTRIPLE bmp_data[100*17]; @@ -453,17 +444,19 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP bmp_data[v].rgbtBlue = i_gray[v]; } - fwrite(bmp_data, 100*17*sizeof(RGBTRIPLE), 1, logo); + fwrite(bmp_data, 100*17*sizeof(RGBTRIPLE), 1, LogoBitmap); } - // padd the extra 2 bytes + // ****************************************************************** + // * write bitmap padding + // ****************************************************************** { uint16 pad = 0; - fwrite(&pad, 2, 1, logo); + fwrite(&pad, 2, 1, LogoBitmap); } - fclose(logo); + fclose(LogoBitmap); } if(m_xbe->GetError() != 0) @@ -682,20 +675,18 @@ LRESULT CALLBACK WndMain::WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP if(GetSaveFileName(&ofn) == TRUE) { - // check if file exists - { - FILE *tmp = fopen(ofn.lpstrFile, "r"); - - if(tmp != 0) - { - fclose(tmp); - - if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) - return TRUE; - } - } - - // convert file + // ****************************************************************** + // * ask permission to overwrite if file exists + // ****************************************************************** + if(_access(ofn.lpstrFile, 0) != -1) + { + if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) + return TRUE; + } + + // ****************************************************************** + // * dump xbe information + // ****************************************************************** { m_xbe->DumpInformation(ofn.lpstrFile); @@ -1154,21 +1145,21 @@ bool WndMain::ConvertToExe(const char *x_filename, bool x_bVerifyIfExists) strcpy(filename, x_filename); } - // check if file exists - if(x_bVerifyIfExists) - { - FILE *chkExists = fopen(filename, "r"); - - if(chkExists != 0) - { - fclose(chkExists); - - if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) - return false; - } + // ****************************************************************** + // * ask permission to overwrite if file exists + // ****************************************************************** + if(x_bVerifyIfExists) + { + if(_access(filename, 0) != -1) + { + if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) + return false; + } } - - // convert file + + // ****************************************************************** + // * convert file + // ****************************************************************** { EmuExe i_EmuExe(m_xbe, m_KrnlDebug, m_KrnlDebugFilename); @@ -1225,20 +1216,18 @@ void WndMain::SaveXbeAs() // ****************************************************************** void WndMain::SaveXbe(const char *x_filename) { - // check if file exists - { - FILE *tmp = fopen(x_filename, "r"); - - if(tmp != 0) - { - fclose(tmp); - - if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) - return; - } - } - - // save xbe file + // ****************************************************************** + // * ask permission to overwrite if file exists + // ****************************************************************** + if(_access(x_filename, 0) != -1) + { + if(MessageBox(m_hwnd, "Overwrite existing file?", "Cxbx", MB_ICONQUESTION | MB_YESNO) != IDYES) + return; + } + + // ****************************************************************** + // * export xbe file + // ****************************************************************** { m_xbe->Export(x_filename); diff --git a/Source/Win32/CxbxKrnl/EmuX.cpp b/Source/Win32/CxbxKrnl/EmuX.cpp index 6847a6d13..82c60654b 100644 --- a/Source/Win32/CxbxKrnl/EmuX.cpp +++ b/Source/Win32/CxbxKrnl/EmuX.cpp @@ -37,9 +37,9 @@ #include "Cxbx.h" #include "EmuX.h" -// ****************************************************************** -// * ntdll wrapped in namespace to avoid collisions -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace xntdll { #include "xntdll.h" diff --git a/Source/Win32/CxbxKrnl/EmuXD3D.cpp b/Source/Win32/CxbxKrnl/EmuXD3D.cpp index 5afe56e34..94d2977da 100644 --- a/Source/Win32/CxbxKrnl/EmuXD3D.cpp +++ b/Source/Win32/CxbxKrnl/EmuXD3D.cpp @@ -30,11 +30,14 @@ // * // * All rights reserved // * -// ****************************************************************** +// ****************************************************************** #define CXBXKRNL_INTERNAL #include "Cxbx.h" #include "EmuX.h" +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace win32 { #include diff --git a/Source/Win32/CxbxKrnl/EmuXKrnl.cpp b/Source/Win32/CxbxKrnl/EmuXKrnl.cpp index 98ca590de..3f1695860 100644 --- a/Source/Win32/CxbxKrnl/EmuXKrnl.cpp +++ b/Source/Win32/CxbxKrnl/EmuXKrnl.cpp @@ -37,9 +37,9 @@ #include "Cxbx.h" #include "EmuX.h" -// ****************************************************************** -// * ntdll wrapped in namespace to avoid collisions -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace xntdll { #include "xntdll.h" diff --git a/Source/Win32/CxbxKrnl/EmuXLDT.cpp b/Source/Win32/CxbxKrnl/EmuXLDT.cpp index 1f78b22ee..73fe96da6 100644 --- a/Source/Win32/CxbxKrnl/EmuXLDT.cpp +++ b/Source/Win32/CxbxKrnl/EmuXLDT.cpp @@ -34,9 +34,9 @@ #include "Cxbx.h" #include "EmuX.h" -// ****************************************************************** -// * ntdll wrapped in namespace to avoid collisions -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace xntdll { #include "xntdll.h" diff --git a/Source/Win32/CxbxKrnl/EmuXapi.cpp b/Source/Win32/CxbxKrnl/EmuXapi.cpp index 0c0f6541b..c28362d30 100644 --- a/Source/Win32/CxbxKrnl/EmuXapi.cpp +++ b/Source/Win32/CxbxKrnl/EmuXapi.cpp @@ -36,9 +36,9 @@ #include -// ****************************************************************** -// * win32 wrapped in namespace to avoid collisions -// ****************************************************************** +// ****************************************************************** +// * prevent name collisions +// ****************************************************************** namespace win32 { #undef FIELD_OFFSET // prevent macro redefinition warnings diff --git a/Source/Win32/CxbxKrnl/EmuXxapi.cpp b/Source/Win32/CxbxKrnl/EmuXxapi.cpp index 1e81ca9a8..f687cc323 100644 --- a/Source/Win32/CxbxKrnl/EmuXxapi.cpp +++ b/Source/Win32/CxbxKrnl/EmuXxapi.cpp @@ -182,7 +182,8 @@ VOID WINAPI xboxkrnl::EmuXapiInitProcess() } #endif - // TODO: Process initialization (if necessary) + // TODO: Process initialization (if necessary) + // TODO: Somehow initialize floating point EmuXSwapFS(); // XBox FS diff --git a/Source/Win32/CxbxKrnl/KernelThunk.cpp b/Source/Win32/CxbxKrnl/KernelThunk.cpp index ec81663ea..18b73907b 100644 --- a/Source/Win32/CxbxKrnl/KernelThunk.cpp +++ b/Source/Win32/CxbxKrnl/KernelThunk.cpp @@ -37,17 +37,24 @@ #define _XBOXKRNL_LOCAL_ #include "EmuX.h" -// ****************************************************************** +// ****************************************************************** // * NOTE: -// ****************************************************************** -// * i typically enable "#define PANIC(numb) numb" whenever i want -// * to find out what kernel export is trying to be called but is -// * not implemented yet (no prototype exists). otherwise, enable -// * "#define PANIC(numb) cxbx_panic" +// ****************************************************************** +// * +// * Enable "#define PANIC(numb) numb" if you wish to find out what +// * kernel export the application is attempting to call. The app +// * will crash at the thunk number (i.e. PsCreateSystemThread:0xFF) +// * +// * For general use, you should probably just enable the other +// * option "#define PANIC(numb) cxbx_panic" +// * // ****************************************************************** //#define PANIC(numb) EmuXPanic #define PANIC(numb) numb +// ****************************************************************** +// * KernelThunkTable +// ****************************************************************** CXBXKRNL_API uint32 KernelThunkTable[367] = { (uint32)PANIC(0x0000), // 0x0000 (0)