30 unsigned int length,
const void *data)
33 if (_lseek(fd, offset, SEEK_SET) == -1) {
38 if (_write(fd, data, length) == -1) {
51 fd = (
unsigned short)_open(path, 0x8101, 0x180);
52 if ((
unsigned int)fd == (
unsigned int)-1) {
62 unsigned int length,
void *data)
65 if (_lseek(fd, offset, SEEK_SET) == -1) {
70 if (_read(fd, data, length) == -1) {
84 position = _lseek(fd, offset, origin & 0xffff);
104 if (c >=
'A' && c <=
'z') {
110 width = (short)(width + bounds.
right + 1);
111 width = (short)(width + ((
int)scale * 2 >> 8));
112 }
else if (c ==
' ') {
113 width = (short)(width + ((
int)scale * 6 >> 8));
114 }
else if (c ==
'\n') {
123 short baselineY,
short scale)
131 y = (short)(baselineY - ((
int)scale * 16 >> 9));
138 if (c >=
'A' && c <=
'z') {
147 x = (short)(x + bounds.
right + 1);
148 x = (short)(x + ((
int)scale * 2 >> 8));
149 }
else if (c ==
' ') {
150 x = (short)(x + ((
int)scale * 6 >> 8));
151 }
else if (c ==
'\n') {
170 if (c >=
'A' && c <=
'z') {
175 }
else if (c ==
'.') {
179 }
else if (c ==
',') {
183 }
else if (c ==
' ') {
185 }
else if (c ==
'\n') {
194 struct Shape *shape,
short frame);
207 while ((c = *scan++) != 0) {
211 lines = (short)(lines * 16);
212 y = (short)((128 - lines) / 2);
214 x = (short)((320 - x) >> 1);
216 while ((c = *scan++) != 0) {
217 if (c >=
'A' && c <=
'z') {
222 }
else if (c ==
' ') {
224 }
else if (c ==
'.') {
229 }
else if (c ==
',') {
234 }
else if (c ==
'\n') {
237 x = (short)((320 - x) >> 1);
248 const short *command;
311 parts[0] = (
unsigned char)(ticks % 60);
313 parts[1] = (
unsigned char)(ticks % 60);
315 parts[2] = (
unsigned char)(ticks % 60);
317 parts[3] = (
unsigned char)(ticks % 24);
333 unsigned int version;
336 CreateFileA(
"\\\\.\\MONODEBG.VXD", 0, 0, 0, CREATE_ALWAYS,
337 FILE_FLAG_DELETE_ON_CLOSE, 0);
342 &version,
sizeof(version), 0, 0)) {
346 if (version != 0x20004) {
386 va_start(arguments, fmt);
397 (
void *)text, 0xfa0, 0, 0, 0, 0)) {
398 exit_squadron(
"MonoDebug::print failed (buffer possibly on stack?!)");
407 QueryPerformanceCounter(p);
413 char *text = context->
text;
const short * apCannedSequenceList[12]
short asCannedCommands[16]
FixedVector aShipVelocity[SPACE_OBJECT_COUNT]
Viewport stSpaceBufferViewport
int bHostPrimaryMouseButton
char szSoundDebugMsg[512]
int bHostSecondaryMouseButton
enum SpecialManeuver aeSpecialManeuvers[12]
struct Shape * pIntroFont
static HANDLE hMonoDebugDriver
void SendMonoDebugCommand3(void)
static char szWriteDataError[0x40]
static int bMonoDebugAvailable
static char szDataCreateError[0x40]
static unsigned char abUnusedMonoBuffer[0x50]
static char szDataFileReadError[0x40]
static char szSeekDataError[0x40]
Umbrella header for the game core.
void SoundDebugPrintf(const char *fmt,...)
short GetTransformedShapeBounds(Viewport *viewport, short x, short y, struct Shape *shape, short frame, short angle, short scale, short flip, ShortRect *bounds)
int advance_canned_sequence(short obj)
int __stdcall SeekDataFile(unsigned short fd, int offset, unsigned int origin)
long Vector_magnitude(const FixedVector *vector)
void DrawSpriteScaled(Viewport *viewport, short x, short y, struct Shape *shape, short frame, short angle, short scale, short flip)
short __stdcall GetShapeFrameExtent(short x, short y, struct Shape *shape, short frame, short extent)
void MonoDebug_print(const char *text)
void DrawSpriteDefault(Viewport *viewport, short x, short y, struct Shape *shape, short frame)
int __stdcall ReadDataFileAtOffset(unsigned short fd, int offset, unsigned int length, void *data)
void MonoDebug_remove(void)
void __stdcall CloseDataFile(unsigned short fd)
int fire_fixed_projectile_weapon(short obj)
void ReadPerformanceCounter(LARGE_INTEGER *p)
int explode(short attacker, short victim)
void MonoDebug_install(void)
int print_subtitle(Viewport *viewport, short colour, const char *text)
unsigned int update_canned_sequence(short obj)
void __stdcall SplitGameClockTicks(unsigned char *parts)
short __stdcall CreateDataFile(const char *path)
void exit_squadron(const char *msg)
int DrawCenteredScaledIntroText(const char *text, short centreX, short baselineY, short scale)
int MeasureScaledIntroTextWidth(const char *text, short scale)
unsigned int GetGameClockTicks(void)
short __stdcall WriteDataFileAtOffset(unsigned short fd, int offset, unsigned int length, const void *data)
short GetLineLength(const char *text)
char *__stdcall ResetStringBuilder(TextContext *context)
@ SPECIAL_MANEUVER_AFTERBURNER