Rev 18 | 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 | |||
| 20 | pmbaty | 10 | #include "brender/br_types.h" |
| 1 | pmbaty | 11 | #include "dr_types.h" |
| 12 | |||
| 13 | #include "harness/compiler.h" |
||
| 14 | |||
| 15 | #include <math.h> |
||
| 16 | #include <stdio.h> |
||
| 17 | #include <stdlib.h> |
||
| 18 | #include <string.h> |
||
| 19 | |||
| 20 | extern int gASCII_table[128]; |
||
| 21 | extern tU32 gKeyboard_bits[8]; |
||
| 22 | extern int gASCII_shift_table[128]; |
||
| 23 | extern tGraf_spec gGraf_specs[2]; |
||
| 24 | extern char gNetwork_profile_fname[256]; |
||
| 25 | extern tS32 gJoystick_min1y; |
||
| 26 | extern tS32 gJoystick_min2y; |
||
| 27 | extern tS32 gJoystick_min2x; |
||
| 28 | extern tS32 gRaw_joystick2y; |
||
| 29 | extern tS32 gRaw_joystick2x; |
||
| 30 | extern tS32 gRaw_joystick1y; |
||
| 31 | extern tS32 gRaw_joystick1x; |
||
| 32 | extern tS32 gJoystick_range2y; |
||
| 33 | extern tS32 gJoystick_range2x; |
||
| 34 | extern tS32 gJoystick_range1y; |
||
| 35 | extern tS32 gJoystick_range1x; |
||
| 36 | extern int gNo_voodoo; |
||
| 37 | extern int gSwitched_resolution; |
||
| 38 | extern int gReplay_override; |
||
| 39 | extern br_pixelmap* gReal_back_screen; |
||
| 40 | extern tS32 gJoystick_min1x; |
||
| 41 | extern br_pixelmap* gTemp_screen; |
||
| 42 | extern int gDOSGfx_initialized; |
||
| 43 | extern tU32 gUpper_loop_limit; |
||
| 44 | extern int gExtra_mem; |
||
| 45 | extern int gReal_back_screen_locked; |
||
| 46 | extern void (*gPrev_keyboard_handler)(void); |
||
| 47 | |||
| 48 | // DOS |
||
| 49 | // extern tU8 gScan_code[123][2]; |
||
| 50 | // Windows |
||
| 51 | extern tU32 gScan_code[123]; |
||
| 52 | |||
| 53 | extern char* _unittest_last_fatal_error; |
||
| 54 | |||
| 55 | // void KeyboardHandler(void); |
||
| 56 | |||
| 57 | // int KeyDown(tU8 pScan_code); |
||
| 58 | |||
| 59 | // void KeyTranslation(tU8 pKey_index, tU8 pScan_code_1, tU8 pScan_code_2); |
||
| 60 | |||
| 61 | // void KeyBegin(void); |
||
| 62 | |||
| 63 | // void KeyEnd(void); |
||
| 64 | |||
| 65 | // int KeyDown22(int pKey_index); |
||
| 66 | |||
| 67 | void PDSetKeyArray(int* pKeys, int pMark); |
||
| 68 | |||
| 69 | int PDGetASCIIFromKey(int pKey); |
||
| 70 | |||
| 71 | HARNESS_NORETURN void PDFatalError(char* pThe_str); |
||
| 72 | |||
| 73 | void PDNonFatalError(char* pThe_str); |
||
| 74 | |||
| 75 | void PDInitialiseSystem(void); |
||
| 76 | |||
| 77 | HARNESS_NORETURN void PDShutdownSystem(void); |
||
| 78 | |||
| 79 | void PDSaveOriginalPalette(void); |
||
| 80 | |||
| 81 | void PDRevertPalette(void); |
||
| 82 | |||
| 83 | int PDInitScreenVars(int pArgc, char** pArgv); |
||
| 84 | |||
| 85 | void PDInitScreen(void); |
||
| 86 | |||
| 87 | void PDLockRealBackScreen(void); |
||
| 88 | |||
| 89 | void PDUnlockRealBackScreen(void); |
||
| 90 | |||
| 91 | void PDAllocateScreenAndBack(void); |
||
| 92 | |||
| 93 | // void Copy8BitTo16BitPixelmap(br_pixelmap* pDst, br_pixelmap* pSrc, br_pixelmap* pPalette); |
||
| 94 | |||
| 95 | // void Double8BitTo16BitPixelmap(br_pixelmap* pDst, br_pixelmap* pSrc, br_pixelmap* pPalette, tU16 pOff, tU16 pSrc_width, tU16 pSrc_height); |
||
| 96 | |||
| 97 | br_pixelmap* PDInterfacePixelmap(void); |
||
| 98 | |||
| 99 | // void SwapBackScreen(void); |
||
| 100 | |||
| 101 | // void ReallyCopyBackScreen(int pRendering_area_only, int pClear_top_and_bottom); |
||
| 102 | |||
| 103 | // void CopyBackScreen(int pRendering_area_only); |
||
| 104 | |||
| 105 | void PDScreenBufferSwap(int pRendering_area_only); |
||
| 106 | |||
| 107 | 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); |
||
| 108 | |||
| 109 | 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); |
||
| 110 | |||
| 111 | 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); |
||
| 112 | |||
| 113 | void PDInstallErrorHandlers(void); |
||
| 114 | |||
| 115 | void PDSetFileVariables(void); |
||
| 116 | |||
| 117 | void PDBuildAppPath(char* pThe_path); |
||
| 118 | |||
| 119 | void PDForEveryFile(char* pThe_path, void (*pAction_routine)(char*)); |
||
| 120 | |||
| 121 | void PDSetPalette(br_pixelmap* pThe_palette); |
||
| 122 | |||
| 123 | void PDSetPaletteEntries(br_pixelmap* pPalette, int pFirst_colour, int pCount); |
||
| 124 | |||
| 125 | void PDSwitchToRealResolution(void); |
||
| 126 | |||
| 127 | void PDSwitchToLoresMode(void); |
||
| 128 | |||
| 129 | void PDMouseButtons(int* pButton_1, int* pButton_2); |
||
| 130 | |||
| 131 | void PDGetMousePosition(int* pX_coord, int* pY_coord); |
||
| 132 | |||
| 133 | int PDGetTotalTime(void); |
||
| 134 | |||
| 135 | int PDServiceSystem(tU32 pTime_since_last_call); |
||
| 136 | |||
| 137 | // tU32 LargestBlockAvail(void); |
||
| 138 | |||
| 139 | void* PDGrabLargestMammaryWeCanPlayWith(tU32 pMaximum_required, tU32* pAmount_allocated); |
||
| 140 | |||
| 141 | void PDAllocateActionReplayBuffer(char** pBuffer, tU32* pBuffer_size); |
||
| 142 | |||
| 143 | void PDDisposeActionReplayBuffer(char* pBuffer); |
||
| 144 | |||
| 145 | // void Usage(char* pProgpath); |
||
| 146 | |||
| 147 | // int OurGetChar(void); |
||
| 148 | |||
| 149 | int PDGetGorePassword(void); |
||
| 150 | |||
| 151 | void PDDisplayGoreworthiness(int pGory); |
||
| 152 | |||
| 153 | void PDEnterDebugger(char* pStr); |
||
| 154 | |||
| 155 | // Added function |
||
| 156 | br_material* PDMissingMaterial(char* name); |
||
| 157 | |||
| 158 | // Added function |
||
| 159 | br_pixelmap* PDMissingTable(char* name); |
||
| 160 | |||
| 161 | // Added function |
||
| 162 | br_model* PDMissingModel(char* name); |
||
| 163 | |||
| 164 | // Added function |
||
| 165 | br_pixelmap* PDMissingMap(char* name); |
||
| 166 | |||
| 167 | void PDEndItAllAndReRunTheBastard(void); |
||
| 168 | |||
| 169 | // int matherr(struct exception_* err); |
||
| 170 | |||
| 171 | // int LoopLimitTooLow(tU32 limit); |
||
| 172 | |||
| 173 | // tS32 UpperLoopLimit(void); |
||
| 174 | |||
| 175 | // int InitJoysticks(void); |
||
| 176 | |||
| 177 | // tU32 ReadJoystickAxis(int pBit); |
||
| 178 | |||
| 179 | void PDReadJoySticks(void); |
||
| 180 | |||
| 181 | tS32 PDGetJoy1X(void); |
||
| 182 | |||
| 183 | tS32 PDGetJoy1Y(void); |
||
| 184 | |||
| 185 | tS32 PDGetJoy2X(void); |
||
| 186 | |||
| 187 | tS32 PDGetJoy2Y(void); |
||
| 188 | |||
| 189 | int PDGetJoy1Button1(void); |
||
| 190 | |||
| 191 | int PDGetJoy1Button2(void); |
||
| 192 | |||
| 193 | int PDGetJoy1Button3(void); |
||
| 194 | |||
| 195 | int PDGetJoy1Button4(void); |
||
| 196 | |||
| 197 | int PDGetJoy2Button1(void); |
||
| 198 | |||
| 199 | int PDGetJoy2Button2(void); |
||
| 200 | |||
| 201 | int PDGetJoy2Button3(void); |
||
| 202 | |||
| 203 | int PDGetJoy2Button4(void); |
||
| 204 | |||
| 205 | int PDFileUnlock(char* pThe_path); |
||
| 206 | |||
| 207 | // void CriticalISR(INTPACK pRegs); |
||
| 208 | |||
| 209 | int PDCheckDriveExists2(char* pThe_path, char* pFile_name, tU32 pMin_size); |
||
| 210 | |||
| 211 | int PDDoWeLeadAnAustereExistance(void); |
||
| 212 | |||
| 213 | #endif |