Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
strdos.c
Go to the documentation of this file.
1/**
2 * @file
3 * @ingroup data
4 * @brief 16-bit DOS C string and memory shims, and the event manager's set-up
5 * entries.
6 *
7 * Address range 435410-4355ef. The shims are all __stdcall with short-width
8 * arguments, each forwarding to one CRT routine.
9 */
10#include "wc1.h"
11
12/* Linker commons defined here; LINK orders them by identifier hash. */
13signed char cScreenViewMode; /* 0x0059a9f2 */
15int anSortedObjects[SPACE_OBJECT_COUNT]; /* 0x0059aa00 */
17void *pPktDecompInput; /* 0x0059ab04 */
18unsigned short wCurrentInputModifiers; /* 0x0059ab08 */
20void (*pCurrentEventManagerPump)(void); /* 0x0059ab2c */
21int nPacketDecompressResult; /* 0x0059ab30 */
22short bCurrentRunningFromHardDiskFlag; /* 0x0059ab34 */
23
24/* Function start: 0x435410 */
25unsigned int __stdcall DosFarPtrToNear(void *v)
26{
27 return (unsigned int)v;
28}
29
30/* Function start: 0x435420 */
31void *__stdcall DosNearPtrToFar(unsigned int v)
32{
33 return (void *)v;
34}
35
36/* Function start: 0x435430 */
37char *__stdcall DosStrrchr(char *s, short c)
38{
39 return strrchr(s, (int)c);
40}
41
42/* Function start: 0x435450 */
43char *__stdcall DosStrchr(const char *s, short c)
44{
45 return strchr(s, (int)c);
46}
47
48/* Function start: 0x435470 */
49char *__stdcall DosStrcpy(char *dst, const char *src)
50{
51 return strcpy(dst, src);
52}
53
54/* Function start: 0x4354A0 */
55char *__stdcall CopyFarString(char *destination, const char *source)
56{
57 return strcpy(destination, source);
58}
59
60/* Function start: 0x4354D0 */
61short __stdcall DosStrlen(const char *s)
62{
63 return (short)strlen(s);
64}
65
66/* Function start: 0x4354F0 */
67void __stdcall DosMemcpy(void *dst, const void *src, size_t n)
68{
69 memmove(dst, src, n);
70}
71
72/* Function start: 0x435510 */
73void __stdcall DosMemset(void *destination, unsigned int count, short value)
74{
75 memset(destination, value, (unsigned short)count);
76}
77
78/* Function start: 0x435550 */
79unsigned short GetEventManagerStatus(void)
80{
81 return 0;
82}
83
84/* Function start: 0x435560 */
85void __stdcall RegisterEventManagerShutdown(void (*fn)(void))
86{
87}
88
89/* Function start: 0x435570 */
90short __stdcall InitializeEventManager(short period,
91 unsigned short (*initialize)(void),
92 void *configuration)
93{
95 if (initialize != 0)
96 initialize();
97 return 1;
98}
99
100/* Function start: 0x435590 */
102{
104}
105
106/* Function start: 0x4355A0 */
107unsigned short __stdcall ConfigureEventManagerPointer(
108 struct Shape *shape, short frame)
109{
110 return 0;
111}
112
113/* Function start: 0x4355B0 */
114/* Empty in the Win32 build; the hidden kill-board code at 0x4404B0 calls it. */
118
119/* Function start: 0x4355C0 */
120void __stdcall EventManagerHook(void (*callback)(void))
121{
122 (void)callback;
123}
124
125/* Function start: 0x4355D0 */
126void __stdcall SetEventManagerPump(void (*pump)(void))
127{
129}
130
131/* Function start: 0x4355E0 */
132/* Empty, and nothing in the shipped executable calls it, so its purpose
133 * cannot be recovered; it closes the event-manager control entries. */
135{
136}
void(__cdecl *pIxFree)(void *)
unsigned short wCurrentInputModifiers
Definition strdos.c:18
const ScreenViewportGeometry * pScreenViewGeometry
Definition strdos.c:14
int anSortedObjects[SPACE_OBJECT_COUNT]
Definition strdos.c:15
MouseCursorState stMouseCursorState
Definition strdos.c:19
short nPacketDecompressInputPositionValue
Definition strdos.c:16
short bCurrentRunningFromHardDiskFlag
Definition strdos.c:22
short nEventManagerActive
Definition eventmgr.c:24
void(*) pCurrentEventManagerPump(void)
Definition strdos.c:20
signed char cScreenViewMode
Definition strdos.c:13
int nPacketDecompressResult
Definition strdos.c:21
void * pPktDecompInput
Definition strdos.c:17
void ReleaseEventManagerPointerHook(void)
Definition strdos.c:115
Umbrella header for the game core.
void *__stdcall DosNearPtrToFar(unsigned int v)
Definition strdos.c:31
char *__stdcall DosStrrchr(char *s, short c)
Definition strdos.c:37
char *__stdcall DosStrchr(const char *s, short c)
Definition strdos.c:43
char *__stdcall CopyFarString(char *destination, const char *source)
Definition strdos.c:55
unsigned int __stdcall DosFarPtrToNear(void *v)
Definition strdos.c:25
unsigned short GetEventManagerStatus(void)
Definition strdos.c:79
void __stdcall DosMemcpy(void *dst, const void *src, unsigned short n)
short __stdcall InitializeEventManager(short period, unsigned short(*initialize)(void), void *configuration)
Definition strdos.c:90
void __stdcall SetEventManagerPump(void(*pump)(void))
Definition strdos.c:126
char *__stdcall DosStrcpy(char *dst, const char *src)
Definition strdos.c:49
void EventManagerControlHook(void)
Definition strdos.c:134
void __stdcall DosMemset(void *destination, unsigned int count, short value)
Definition strdos.c:73
void __stdcall RegisterEventManagerShutdown(void(*fn)(void))
Definition strdos.c:85
void __stdcall EventManagerHook(void(*callback)(void))
Definition strdos.c:120
short __stdcall DosStrlen(const char *s)
Definition strdos.c:61
unsigned short __stdcall ConfigureEventManagerPointer(struct Shape *shape, short frame)
Definition strdos.c:107
void ShutdownEventManager(void)
Definition strdos.c:101
#define SPACE_OBJECT_COUNT
Definition wcdata.h:1004