diff --git a/FuncStats.xlsx b/FuncStats.xlsx new file mode 100644 index 0000000..fcff112 Binary files /dev/null and b/FuncStats.xlsx differ diff --git a/SpaceCadetPinball/Sound.cpp b/SpaceCadetPinball/Sound.cpp index 13dfcfe..115418e 100644 --- a/SpaceCadetPinball/Sound.cpp +++ b/SpaceCadetPinball/Sound.cpp @@ -4,3 +4,7 @@ void Sound::Enable(int a1, int a2, int a3) { } + +void Sound::nullsub_1(int a1, int a2, int a3) +{ +} diff --git a/SpaceCadetPinball/Sound.h b/SpaceCadetPinball/Sound.h index 48e5d77..a7f123f 100644 --- a/SpaceCadetPinball/Sound.h +++ b/SpaceCadetPinball/Sound.h @@ -1,6 +1,7 @@ #pragma once class Sound -{public: +{ +public: static void Enable(int a1, int a2, int a3); + static void nullsub_1(int a1, int a2, int a3); }; - diff --git a/SpaceCadetPinball/SpaceCadetPinball.vcxproj b/SpaceCadetPinball/SpaceCadetPinball.vcxproj index e6b0724..c05b169 100644 --- a/SpaceCadetPinball/SpaceCadetPinball.vcxproj +++ b/SpaceCadetPinball/SpaceCadetPinball.vcxproj @@ -155,6 +155,7 @@ + @@ -203,6 +204,7 @@ + diff --git a/SpaceCadetPinball/SpaceCadetPinball.vcxproj.filters b/SpaceCadetPinball/SpaceCadetPinball.vcxproj.filters index 26cc806..7b6d392 100644 --- a/SpaceCadetPinball/SpaceCadetPinball.vcxproj.filters +++ b/SpaceCadetPinball/SpaceCadetPinball.vcxproj.filters @@ -159,6 +159,9 @@ Header Files + + Header Files + @@ -296,6 +299,9 @@ Source Files + + Source Files + diff --git a/SpaceCadetPinball/TTextBox.cpp b/SpaceCadetPinball/TTextBox.cpp index 14b2a3d..4f9984b 100644 --- a/SpaceCadetPinball/TTextBox.cpp +++ b/SpaceCadetPinball/TTextBox.cpp @@ -1,2 +1,8 @@ #include "pch.h" #include "TTextBox.h" + + +int TTextBox::Message(int a2, float a3) +{ + return 0; +} \ No newline at end of file diff --git a/SpaceCadetPinball/TTextBox.h b/SpaceCadetPinball/TTextBox.h index 978814c..2a66046 100644 --- a/SpaceCadetPinball/TTextBox.h +++ b/SpaceCadetPinball/TTextBox.h @@ -1,11 +1,13 @@ #pragma once #include "TPinballComponent.h" + class TTextBox : - public TPinballComponent + public TPinballComponent { public: TTextBox(TPinballTable* table, int groupIndex) : TPinballComponent(table, groupIndex, false) { } -}; + int Message(int a2, float a3) override; +}; diff --git a/SpaceCadetPinball/fullscrn.cpp b/SpaceCadetPinball/fullscrn.cpp index 8eeeeb3..d3d4498 100644 --- a/SpaceCadetPinball/fullscrn.cpp +++ b/SpaceCadetPinball/fullscrn.cpp @@ -157,3 +157,8 @@ void fullscrn::GetWindowCenter() if (MenuEnabled) yDest -= GetSystemMetrics(15); } + +void fullscrn::force_redraw() +{ + BYTE1(fullscrn_flag1) |= 0x80u; +} \ No newline at end of file diff --git a/SpaceCadetPinball/fullscrn.h b/SpaceCadetPinball/fullscrn.h index c245397..cad24c7 100644 --- a/SpaceCadetPinball/fullscrn.h +++ b/SpaceCadetPinball/fullscrn.h @@ -17,6 +17,7 @@ public: static int trick; static int set_screen_mode(int isFullscreen); + static void force_redraw(); private : static int MenuEnabled; static HMENU MenuHandle; diff --git a/SpaceCadetPinball/gdrv.cpp b/SpaceCadetPinball/gdrv.cpp new file mode 100644 index 0000000..846ea09 --- /dev/null +++ b/SpaceCadetPinball/gdrv.cpp @@ -0,0 +1,6 @@ +#include "pch.h" +#include "gdrv.h" + +void gdrv::get_focus() +{ +} diff --git a/SpaceCadetPinball/gdrv.h b/SpaceCadetPinball/gdrv.h new file mode 100644 index 0000000..70a44dc --- /dev/null +++ b/SpaceCadetPinball/gdrv.h @@ -0,0 +1,7 @@ +#pragma once +class gdrv +{ +public: + static void get_focus(); +}; + diff --git a/SpaceCadetPinball/pb.cpp b/SpaceCadetPinball/pb.cpp index 0973f0e..298b92e 100644 --- a/SpaceCadetPinball/pb.cpp +++ b/SpaceCadetPinball/pb.cpp @@ -17,3 +17,8 @@ void pb::firsttime_setup() render::update(); render::blit = 1; } + +void pb::paint() +{ + render::paint(); +} \ No newline at end of file diff --git a/SpaceCadetPinball/pb.h b/SpaceCadetPinball/pb.h index 50b599c..d1d044b 100644 --- a/SpaceCadetPinball/pb.h +++ b/SpaceCadetPinball/pb.h @@ -6,6 +6,7 @@ class pb public: static void reset_table(); static void firsttime_setup(); + static void paint(); private: static TPinballTable* MainTable; }; diff --git a/SpaceCadetPinball/render.cpp b/SpaceCadetPinball/render.cpp index 228cdc5..71beaa0 100644 --- a/SpaceCadetPinball/render.cpp +++ b/SpaceCadetPinball/render.cpp @@ -6,3 +6,11 @@ int render::blit = 0; void render::update() { } + + +void render::paint() +{ + /*render_paint_balls(); + gdrv_blat((int)&vscreen, xDest, yDest); + render_unpaint_balls();*/ +} \ No newline at end of file diff --git a/SpaceCadetPinball/render.h b/SpaceCadetPinball/render.h index 13ff8a5..8555168 100644 --- a/SpaceCadetPinball/render.h +++ b/SpaceCadetPinball/render.h @@ -4,5 +4,6 @@ class render public: static int blit; static void update(); + static void paint(); }; diff --git a/SpaceCadetPinball/score.cpp b/SpaceCadetPinball/score.cpp index 25ec533..5fbbbe3 100644 --- a/SpaceCadetPinball/score.cpp +++ b/SpaceCadetPinball/score.cpp @@ -5,6 +5,11 @@ #include "partman.h" +int score::init() +{ + return 1; +} + scoreStruct* score::create(LPCSTR fieldName, int renderBgBmp) { scoreStruct* score = (scoreStruct*)memory::allocate(sizeof(scoreStruct)); diff --git a/SpaceCadetPinball/score.h b/SpaceCadetPinball/score.h index 10ed909..0bbc71c 100644 --- a/SpaceCadetPinball/score.h +++ b/SpaceCadetPinball/score.h @@ -1,6 +1,6 @@ #pragma once -struct scoreStruct +struct scoreStruct { int Unknown1; int Unknown2; @@ -24,7 +24,7 @@ struct scoreStruct class score { public: + static int init(); static scoreStruct* create(LPCSTR fieldName, int renderBgBmp); static scoreStruct* dup(scoreStruct* score, int scoreIndex); }; - diff --git a/SpaceCadetPinball/winmain.cpp b/SpaceCadetPinball/winmain.cpp index 3eb2231..f83ecef 100644 --- a/SpaceCadetPinball/winmain.cpp +++ b/SpaceCadetPinball/winmain.cpp @@ -7,16 +7,16 @@ #include "options.h" #include "pb.h" -int iFrostUniqueMsg, return_value = 0, bQuit = 0; - -int check_expiration_date() -{ - return 0; -} +int winmain::iFrostUniqueMsg, winmain::return_value = 0, winmain::bQuit = 0; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { - memory::init(winmain_memalloc_failure); + return winmain::WinMain(hInstance, hPrevInstance, lpCmdLine, nShowCmd); +} + +int winmain::WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) +{ + memory::init(memalloc_failure); ++memory::critical_allocation; auto optionsRegPath = pinball::get_rc_string(165, 0); options::path_init(optionsRegPath); @@ -97,7 +97,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (check_expiration_date()) return 0; - INITCOMMONCONTROLSEX picce{}; + INITCOMMONCONTROLSEX picce; picce.dwSize = 8; picce.dwICC = 5885; InitCommonControlsEx(&picce); @@ -157,7 +157,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine MSG wndMessage{}; while (timeGetTime() >= startTime && timeGetTime() - startTime < 2000) PeekMessageA(&wndMessage, pinball::hwnd_frame, 0, 0, 1u); - + while (true) { if (!ProcessWindowMessages() || bQuit) @@ -168,12 +168,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine return return_value; } -LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK winmain::message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { return DefWindowProcA(hWnd, Msg, wParam, lParam); } -int ProcessWindowMessages() +int winmain::ProcessWindowMessages() { MSG Msg{}; // [esp+8h] [ebp-1Ch] @@ -202,7 +202,7 @@ int ProcessWindowMessages() return 1; } -void winmain_memalloc_failure() +void winmain::memalloc_failure() { /*midi_music_stop(); Sound_Close(); @@ -212,3 +212,36 @@ void winmain_memalloc_failure() MessageBoxA(nullptr, text, caption, 0x2030u); _exit(1); } + +int winmain::check_expiration_date() +{ + return 0; +} + + +HDC winmain::_BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint) +{ + HDC context = BeginPaint(hWnd, lpPaint); + if (hWnd && GetLayout(context) & 1) + SetLayout(context, 0); + return context; +} + +HDC winmain::_GetDC(HWND hWnd) +{ + HDC context = GetDC(hWnd); + if (hWnd && GetLayout(context) & 1) + SetLayout(context, 0); + return context; +} + +int winmain::a_dialog(HINSTANCE hInstance, HWND hWnd) +{ + char appName[100]; + char szOtherStuff[100]; + + lstrcpyA(appName, pinball::get_rc_string(38, 0)); + lstrcpyA(szOtherStuff, pinball::get_rc_string(102, 0)); + auto icon = LoadIconA(hInstance, "ICON_1"); + return ShellAboutA(hWnd, appName, szOtherStuff, icon); +} diff --git a/SpaceCadetPinball/winmain.h b/SpaceCadetPinball/winmain.h index 12bf82f..d0e4115 100644 --- a/SpaceCadetPinball/winmain.h +++ b/SpaceCadetPinball/winmain.h @@ -1,6 +1,17 @@ #pragma once -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd); -static void winmain_memalloc_failure(); -static LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -int ProcessWindowMessages(); +class winmain +{ +public: + static int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd); + static LRESULT CALLBACK message_handler(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + static void memalloc_failure(); + static int ProcessWindowMessages(); + static int check_expiration_date(); + static HDC _GetDC(HWND hWnd); + static int a_dialog(HINSTANCE hInstance, HWND hWnd); +private: + static int iFrostUniqueMsg, return_value , bQuit; + + static HDC _BeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint); +};