Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
port Shell_ExitSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Oct 2, 2023
1 parent f52b36f commit a28865b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 22 deletions.
28 changes: 14 additions & 14 deletions docs/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/progress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ typedef struct CREATURE_INFO {
0044D5B0 00000019 -R bool __cdecl HWR_VertexBufferFull(void);
0044D5E0 00000022 -R bool __cdecl HWR_Init(void);
0044D610 0000005C -R BOOL __cdecl S_InitialiseSystem(void);
0044D670 00000011 -R void __cdecl ShutdownGame(void);
0044D670 00000011 * void __cdecl GameBuf_Shutdown(void);
0044D690 00000021 -R void __cdecl init_game_malloc(void);
0044D6C0 0000006C -R void *__cdecl game_malloc(DWORD allocSize, DWORD bufIndex);
0044D740 00000034 -R void __cdecl game_free(DWORD freeSize);
Expand All @@ -1830,12 +1830,12 @@ typedef struct CREATURE_INFO {
0044E520 000001D6 -R int32_t __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int32_t nShowCmd);
0044E6F0 00000001 x sub_44E6F0
0044E700 00000064 -R int32_t __cdecl Init(bool skipCDInit);
0044E770 00000055 -R void __cdecl WinCleanup(void);
0044E770 00000055 * void __cdecl Shell_Cleanup(void);
0044E7A0 0000007C -R int32_t __cdecl WinGameStart(void);
0044E820 00000039 -R void __cdecl WinGameFinish(void);
0044E820 00000039 * void __cdecl Shell_Shutdown(void);
0044E860 00000017 -R sub_44E860
0044E880 00000010 -R sub_44E880
0044E890 0000003C -R void __cdecl S_ExitSystem(LPCTSTR message);
0044E890 0000003C + void __cdecl Shell_ExitSystem(LPCTSTR message);
0044E8E0 0000010F -R void __cdecl ScreenShotPCX(void);
0044E9F0 000000AE -R DWORD __cdecl CompPCX(BYTE *bitmap, DWORD width, DWORD height, RGB888 *palette, BYTE **pcxData);
0044EAA0 000000D2 -R DWORD __cdecl EncodeLinePCX(BYTE *src, DWORD width, BYTE *dst);
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ dll_sources = [
'src/filesystem.c',
'src/game/math.c',
'src/game/matrix.c',
'src/game/shell.c',
'src/inject_exec.c',
'src/inject_util.c',
'src/log.c',
Expand Down
13 changes: 13 additions & 0 deletions src/game/shell.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "game/shell.h"

#include "global/funcs.h"
#include "global/vars.h"

void __cdecl Shell_ExitSystem(const char *message)
{
GameBuf_Shutdown();
strcpy(g_ErrorMessage, message);
Shell_Shutdown();
Shell_Cleanup();
exit(1);
}
3 changes: 3 additions & 0 deletions src/game/shell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

void __cdecl Shell_ExitSystem(const char *message);
7 changes: 3 additions & 4 deletions src/global/funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@
#define HWR_VertexBufferFull ((bool __cdecl (*)(void))0x0044D5B0)
#define HWR_Init ((bool __cdecl (*)(void))0x0044D5E0)
#define S_InitialiseSystem ((BOOL __cdecl (*)(void))0x0044D610)
#define ShutdownGame ((void __cdecl (*)(void))0x0044D670)
#define GameBuf_Shutdown ((void __cdecl (*)(void))0x0044D670)
#define init_game_malloc ((void __cdecl (*)(void))0x0044D690)
#define game_malloc ((void *__cdecl (*)(DWORD allocSize, DWORD bufIndex))0x0044D6C0)
#define game_free ((void __cdecl (*)(DWORD freeSize))0x0044D740)
Expand All @@ -983,10 +983,9 @@
#define RenderErrorBox ((int32_t __cdecl (*)(int32_t errorCode))0x0044E4E0)
#define WinMain ((int32_t __stdcall (*)(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int32_t nShowCmd))0x0044E520)
#define Init ((int32_t __cdecl (*)(bool skipCDInit))0x0044E700)
#define WinCleanup ((void __cdecl (*)(void))0x0044E770)
#define Shell_Cleanup ((void __cdecl (*)(void))0x0044E770)
#define WinGameStart ((int32_t __cdecl (*)(void))0x0044E7A0)
#define WinGameFinish ((void __cdecl (*)(void))0x0044E820)
#define S_ExitSystem ((void __cdecl (*)(LPCTSTR message))0x0044E890)
#define Shell_Shutdown ((void __cdecl (*)(void))0x0044E820)
#define ScreenShotPCX ((void __cdecl (*)(void))0x0044E8E0)
#define CompPCX ((DWORD __cdecl (*)(BYTE *bitmap, DWORD width, DWORD height, RGB888 *palette, BYTE **pcxData))0x0044E9F0)
#define EncodeLinePCX ((DWORD __cdecl (*)(BYTE *src, DWORD width, BYTE *dst))0x0044EAA0)
Expand Down

0 comments on commit a28865b

Please sign in to comment.