Rev 1 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | pmbaty | 1 | #ifndef _PD_SYS_H_ |
2 | #define _PD_SYS_H_ |
||
3 | |||
4 | // Jeff: |
||
5 | // Header files are generated from information in the original symbol dump, but we don't exactly know what this used to look like or be called. |
||
6 | // Each platform build included a platform-dependant `sys` and `net` files. From the symbol dump and debug/error messages in the binaries, |
||
7 | // we know of at least `pc-dos/dossys.c`, `pc-dos/dosnet.c`, `Win95sys.c`. |
||
8 | // Functions contained within these files are prefixed with `PD` - we assume that is short for something like `Platform Dependant`. |
||
9 | |||
10 | #include "dr_types.h" |
||
11 | |||
12 | #include "harness/compiler.h" |
||
13 | |||
14 | #include <math.h> |
||
15 | #include <stdio.h> |
||
16 | #include <stdlib.h> |
||
17 | #include <string.h> |
||
18 | |||
19 | extern int gASCII_table[128]; |
||
20 | extern tU32 gKeyboard_bits[8]; |
||
21 | extern int gASCII_shift_table[128]; |
||
22 | extern tGraf_spec gGraf_specs[2]; |
||
23 | extern char gNetwork_profile_fname[256]; |
||
24 | extern tS32 gJoystick_min1y; |
||
25 | extern tS32 gJoystick_min2y; |
||
26 | extern tS32 gJoystick_min2x; |
||
27 | extern tS32 gRaw_joystick2y; |
||
28 | extern tS32 gRaw_joystick2x; |
||
29 | extern tS32 gRaw_joystick1y; |
||
30 | extern tS32 gRaw_joystick1x; |
||
31 | extern tS32 gJoystick_range2y; |
||
32 | extern tS32 gJoystick_range2x; |
||
33 | extern tS32 gJoystick_range1y; |
||
34 | extern tS32 gJoystick_range1x; |
||
35 | extern int gNo_voodoo; |
||
36 | extern int gSwitched_resolution; |
||
37 | extern int gReplay_override; |
||
38 | extern br_pixelmap* gReal_back_screen; |
||
39 | extern tS32 gJoystick_min1x; |
||
40 | extern br_pixelmap* gTemp_screen; |
||
41 | extern int gDOSGfx_initialized; |
||
42 | extern tU32 gUpper_loop_limit; |
||
43 | extern int gExtra_mem; |
||
44 | extern int gReal_back_screen_locked; |
||
45 | extern void (*gPrev_keyboard_handler)(void); |
||
46 | |||
47 | // DOS |
||
48 | // extern tU8 gScan_code[123][2]; |
||
49 | // Windows |
||
50 | extern tU32 gScan_code[123]; |
||
51 | |||
52 | extern char* _unittest_last_fatal_error; |
||
53 | |||
54 | // void KeyboardHandler(void); |
||
55 | |||
56 | // int KeyDown(tU8 pScan_code); |
||
57 | |||
58 | // void KeyTranslation(tU8 pKey_index, tU8 pScan_code_1, tU8 pScan_code_2); |
||
59 | |||
60 | // void KeyBegin(void); |
||
61 | |||
62 | // void KeyEnd(void); |
||
63 | |||
64 | // int KeyDown22(int pKey_index); |
||
65 | |||
66 | void PDSetKeyArray(int* pKeys, int pMark); |
||
67 | |||
68 | int PDGetASCIIFromKey(int pKey); |
||
69 | |||
70 | HARNESS_NORETURN void PDFatalError(char* pThe_str); |
||
71 | |||
72 | void PDNonFatalError(char* pThe_str); |
||
73 | |||
74 | void PDInitialiseSystem(void); |
||
75 | |||
76 | HARNESS_NORETURN void PDShutdownSystem(void); |
||
77 | |||
78 | void PDSaveOriginalPalette(void); |
||
79 | |||
80 | void PDRevertPalette(void); |
||
81 | |||
82 | int PDInitScreenVars(int pArgc, char** pArgv); |
||
83 | |||
84 | void PDInitScreen(void); |
||
85 | |||
86 | void PDLockRealBackScreen(void); |
||
87 | |||
88 | void PDUnlockRealBackScreen(void); |
||
89 | |||
90 | void PDAllocateScreenAndBack(void); |
||
91 | |||
92 | // void Copy8BitTo16BitPixelmap(br_pixelmap* pDst, br_pixelmap* pSrc, br_pixelmap* pPalette); |
||
93 | |||
94 | // void Double8BitTo16BitPixelmap(br_pixelmap* pDst, br_pixelmap* pSrc, br_pixelmap* pPalette, tU16 pOff, tU16 pSrc_width, tU16 pSrc_height); |
||
95 | |||
96 | br_pixelmap* PDInterfacePixelmap(void); |
||
97 | |||
98 | // void SwapBackScreen(void); |
||
99 | |||
100 | // void ReallyCopyBackScreen(int pRendering_area_only, int pClear_top_and_bottom); |
||
101 | |||
102 | // void CopyBackScreen(int pRendering_area_only); |
||
103 | |||
104 | void PDScreenBufferSwap(int pRendering_area_only); |
||
105 | |||
106 | void PDPixelmapToScreenRectangleCopy(br_pixelmap* dst, br_int_16 dx, br_int_16 dy, br_pixelmap* src, br_int_16 sx, br_int_16 sy, br_uint_16 w, br_uint_16 h); |
||
107 | |||
108 | void PDPixelmapHLineOnScreen(br_pixelmap* dst, br_int_16 x1, br_int_16 y1, br_int_16 x2, br_int_16 y2, br_uint_32 colour); |
||
109 | |||
110 | void PDPixelmapVLineOnScreen(br_pixelmap* dst, br_int_16 x1, br_int_16 y1, br_int_16 x2, br_int_16 y2, br_uint_32 colour); |
||
111 | |||
112 | void PDInstallErrorHandlers(void); |
||
113 | |||
114 | void PDSetFileVariables(void); |
||
115 | |||
116 | void PDBuildAppPath(char* pThe_path); |
||
117 | |||
118 | void PDForEveryFile(char* pThe_path, void (*pAction_routine)(char*)); |
||
119 | |||
120 | void PDSetPalette(br_pixelmap* pThe_palette); |
||
121 | |||
122 | void PDSetPaletteEntries(br_pixelmap* pPalette, int pFirst_colour, int pCount); |
||
123 | |||
124 | void PDSwitchToRealResolution(void); |
||
125 | |||
126 | void PDSwitchToLoresMode(void); |
||
127 | |||
128 | void PDMouseButtons(int* pButton_1, int* pButton_2); |
||
129 | |||
130 | void PDGetMousePosition(int* pX_coord, int* pY_coord); |
||
131 | |||
132 | int PDGetTotalTime(void); |
||
133 | |||
134 | int PDServiceSystem(tU32 pTime_since_last_call); |
||
135 | |||
136 | // tU32 LargestBlockAvail(void); |
||
137 | |||
138 | void* PDGrabLargestMammaryWeCanPlayWith(tU32 pMaximum_required, tU32* pAmount_allocated); |
||
139 | |||
140 | void PDAllocateActionReplayBuffer(char** pBuffer, tU32* pBuffer_size); |
||
141 | |||
142 | void PDDisposeActionReplayBuffer(char* pBuffer); |
||
143 | |||
144 | // void Usage(char* pProgpath); |
||
145 | |||
146 | // int OurGetChar(void); |
||
147 | |||
148 | int PDGetGorePassword(void); |
||
149 | |||
150 | void PDDisplayGoreworthiness(int pGory); |
||
151 | |||
152 | void PDEnterDebugger(char* pStr); |
||
153 | |||
154 | // Added function |
||
155 | br_material* PDMissingMaterial(char* name); |
||
156 | |||
157 | // Added function |
||
158 | br_pixelmap* PDMissingTable(char* name); |
||
159 | |||
160 | // Added function |
||
161 | br_model* PDMissingModel(char* name); |
||
162 | |||
163 | // Added function |
||
164 | br_pixelmap* PDMissingMap(char* name); |
||
165 | |||
166 | void PDEndItAllAndReRunTheBastard(void); |
||
167 | |||
168 | // int matherr(struct exception_* err); |
||
169 | |||
170 | // int LoopLimitTooLow(tU32 limit); |
||
171 | |||
172 | // tS32 UpperLoopLimit(void); |
||
173 | |||
174 | // int InitJoysticks(void); |
||
175 | |||
176 | // tU32 ReadJoystickAxis(int pBit); |
||
177 | |||
178 | void PDReadJoySticks(void); |
||
179 | |||
180 | tS32 PDGetJoy1X(void); |
||
181 | |||
182 | tS32 PDGetJoy1Y(void); |
||
183 | |||
184 | tS32 PDGetJoy2X(void); |
||
185 | |||
186 | tS32 PDGetJoy2Y(void); |
||
187 | |||
188 | int PDGetJoy1Button1(void); |
||
189 | |||
190 | int PDGetJoy1Button2(void); |
||
191 | |||
192 | int PDGetJoy1Button3(void); |
||
193 | |||
194 | int PDGetJoy1Button4(void); |
||
195 | |||
196 | int PDGetJoy2Button1(void); |
||
197 | |||
198 | int PDGetJoy2Button2(void); |
||
199 | |||
200 | int PDGetJoy2Button3(void); |
||
201 | |||
202 | int PDGetJoy2Button4(void); |
||
203 | |||
204 | int PDFileUnlock(char* pThe_path); |
||
205 | |||
206 | // void CriticalISR(INTPACK pRegs); |
||
207 | |||
208 | int PDCheckDriveExists2(char* pThe_path, char* pFile_name, tU32 pMin_size); |
||
209 | |||
210 | int PDDoWeLeadAnAustereExistance(void); |
||
211 | |||
212 | #endif |