Comment style tweaks in the last three files

This commit is contained in:
Clownacy 2019-11-13 22:57:34 +00:00
parent d8d789a780
commit 82454c3a62
3 changed files with 90 additions and 90 deletions

View file

@ -33,12 +33,12 @@
#include "Stage.h" #include "Stage.h"
#include "Tags.h" #include "Tags.h"
#define IS_COMMAND(c1, c2, c3) (gTS.data[gTS.p_read + 1] == (c1) && gTS.data[gTS.p_read + 2] == (c2) && gTS.data[gTS.p_read + 3] == (c3))
#define TSC_BUFFER_SIZE 0x5000 #define TSC_BUFFER_SIZE 0x5000
#define TEXT_LEFT (WINDOW_WIDTH / 2 - 108) #define TEXT_LEFT (WINDOW_WIDTH / 2 - 108)
#define IS_COMMAND(c1, c2, c3) (gTS.data[gTS.p_read + 1] == (c1) && gTS.data[gTS.p_read + 2] == (c2) && gTS.data[gTS.p_read + 3] == (c3))
TEXT_SCRIPT gTS; TEXT_SCRIPT gTS;
int gNumberTextScript[4]; int gNumberTextScript[4];
@ -50,25 +50,25 @@ RECT gRect_line = {0, 0, 216, 16};
static unsigned long nod_color; static unsigned long nod_color;
#endif #endif
//Initialize and end tsc // Initialize and end tsc
BOOL InitTextScript2() BOOL InitTextScript2()
{ {
#ifdef FIX_BUGS #ifdef FIX_BUGS
nod_color = GetCortBoxColor(RGB(0xFF, 0xFF, 0xFE)); nod_color = GetCortBoxColor(RGB(0xFF, 0xFF, 0xFE));
#endif #endif
//Clear flags // Clear flags
gTS.mode = 0; gTS.mode = 0;
g_GameFlags &= ~0x04; g_GameFlags &= ~0x04;
//Create line surfaces // Create line surfaces
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
MakeSurface_Generic(gRect_line.right, gRect_line.bottom, (SurfaceID)(i + SURFACE_ID_TEXT_LINE1), FALSE); MakeSurface_Generic(gRect_line.right, gRect_line.bottom, (SurfaceID)(i + SURFACE_ID_TEXT_LINE1), FALSE);
//Clear text // Clear text
memset(text, 0, sizeof(text)); memset(text, 0, sizeof(text));
//Allocate script buffer // Allocate script buffer
gTS.data = (char*)malloc(TSC_BUFFER_SIZE); gTS.data = (char*)malloc(TSC_BUFFER_SIZE);
if (gTS.data == NULL) if (gTS.data == NULL)
@ -79,16 +79,16 @@ BOOL InitTextScript2()
void EndTextScript() void EndTextScript()
{ {
//Free TSC buffer // Free TSC buffer
free(gTS.data); free(gTS.data);
//Release buffers // Release buffers
ReleaseSurface(SURFACE_ID_TEXT_BOX); ReleaseSurface(SURFACE_ID_TEXT_BOX);
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
ReleaseSurface((SurfaceID)(i + SURFACE_ID_TEXT_LINE1)); ReleaseSurface((SurfaceID)(i + SURFACE_ID_TEXT_LINE1));
} }
//Decrypt .tsc // Decrypt .tsc
void EncryptionBinaryData2(unsigned char *pData, int size) void EncryptionBinaryData2(unsigned char *pData, int size)
{ {
int val1; int val1;
@ -111,10 +111,10 @@ void EncryptionBinaryData2(unsigned char *pData, int size)
} }
} }
//Load generic .tsc // Load generic .tsc
BOOL LoadTextScript2(const char *name) BOOL LoadTextScript2(const char *name)
{ {
//Get path // Get path
char path[260]; char path[260];
sprintf(path, "%s\\%s", gDataPath, name); sprintf(path, "%s\\%s", gDataPath, name);
@ -122,28 +122,28 @@ BOOL LoadTextScript2(const char *name)
if (gTS.size == -1) if (gTS.size == -1)
return FALSE; return FALSE;
//Open file // Open file
FILE *fp = fopen(path, "rb"); FILE *fp = fopen(path, "rb");
if (fp == NULL) if (fp == NULL)
return FALSE; return FALSE;
//Read data // Read data
fread(gTS.data, 1, gTS.size, fp); fread(gTS.data, 1, gTS.size, fp);
gTS.data[gTS.size] = 0; gTS.data[gTS.size] = 0;
fclose(fp); fclose(fp);
//Set path // Set path
strcpy(gTS.path, name); strcpy(gTS.path, name);
//Decrypt data // Decrypt data
EncryptionBinaryData2((unsigned char*)gTS.data, gTS.size); EncryptionBinaryData2((unsigned char*)gTS.data, gTS.size);
return TRUE; return TRUE;
} }
//Load stage .tsc // Load stage .tsc
BOOL LoadTextScript_Stage(const char *name) BOOL LoadTextScript_Stage(const char *name)
{ {
//Open Head.tsc // Open Head.tsc
char path[MAX_PATH]; char path[MAX_PATH];
sprintf(path, "%s\\%s", gDataPath, "Head.tsc"); sprintf(path, "%s\\%s", gDataPath, "Head.tsc");
@ -155,13 +155,13 @@ BOOL LoadTextScript_Stage(const char *name)
if (fp == NULL) if (fp == NULL)
return FALSE; return FALSE;
//Read Head.tsc // Read Head.tsc
fread(gTS.data, 1, head_size, fp); fread(gTS.data, 1, head_size, fp);
EncryptionBinaryData2((unsigned char*)gTS.data, head_size); EncryptionBinaryData2((unsigned char*)gTS.data, head_size);
gTS.data[head_size] = 0; gTS.data[head_size] = 0;
fclose(fp); fclose(fp);
//Open stage's .tsc // Open stage's .tsc
sprintf(path, "%s\\%s", gDataPath, name); sprintf(path, "%s\\%s", gDataPath, name);
long body_size = GetFileSizeLong(path); long body_size = GetFileSizeLong(path);
@ -172,25 +172,25 @@ BOOL LoadTextScript_Stage(const char *name)
if (fp == NULL) if (fp == NULL)
return FALSE; return FALSE;
//Read stage's tsc // Read stage's tsc
fread(&gTS.data[head_size], 1, body_size, fp); fread(&gTS.data[head_size], 1, body_size, fp);
EncryptionBinaryData2((unsigned char*)&gTS.data[head_size], body_size); EncryptionBinaryData2((unsigned char*)&gTS.data[head_size], body_size);
gTS.data[head_size + body_size] = 0; gTS.data[head_size + body_size] = 0;
fclose(fp); fclose(fp);
//Set parameters // Set parameters
gTS.size = head_size + body_size; gTS.size = head_size + body_size;
strcpy(gTS.path, name); strcpy(gTS.path, name);
return TRUE; return TRUE;
} }
//Get current path // Get current path
void GetTextScriptPath(char *path) void GetTextScriptPath(char *path)
{ {
strcpy(path, gTS.path); strcpy(path, gTS.path);
} }
//Get 4 digit number from TSC data // Get 4 digit number from TSC data
int GetTextScriptNo(int a) int GetTextScriptNo(int a)
{ {
int b = 0; int b = 0;
@ -201,10 +201,10 @@ int GetTextScriptNo(int a)
return b; return b;
} }
//Start TSC event // Start TSC event
BOOL StartTextScript(int no) BOOL StartTextScript(int no)
{ {
//Reset state // Reset state
gTS.mode = 1; gTS.mode = 1;
g_GameFlags |= 5; g_GameFlags |= 5;
gTS.line = 0; gTS.line = 0;
@ -224,7 +224,7 @@ BOOL StartTextScript(int no)
gTS.rcText.bottom = gTS.rcText.top + 48; gTS.rcText.bottom = gTS.rcText.top + 48;
/* This is present in the Linux port, but not the Windows version (1.0.0.6, at least) /* This is present in the Linux port, but not the Windows version (1.0.0.6, at least)
//Clear text lines // Clear text lines
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
gTS.ypos_line[i] = 16 * i; gTS.ypos_line[i] = 16 * i;
@ -232,18 +232,18 @@ BOOL StartTextScript(int no)
memset(text[i], 0, sizeof(text[0])); memset(text[i], 0, sizeof(text[0]));
}*/ }*/
//Find where event starts // Find where event starts
gTS.p_read = 0; gTS.p_read = 0;
while (1) while (1)
{ {
//Check if we are still in the proper range // Check if we are still in the proper range
if (gTS.data[gTS.p_read] == '\0') if (gTS.data[gTS.p_read] == '\0')
return FALSE; return FALSE;
//Check if we are at an event // Check if we are at an event
if (gTS.data[gTS.p_read] == '#') if (gTS.data[gTS.p_read] == '#')
{ {
//Check if this is our event // Check if this is our event
int event_no = GetTextScriptNo(++gTS.p_read); int event_no = GetTextScriptNo(++gTS.p_read);
if (no == event_no) if (no == event_no)
@ -255,7 +255,7 @@ BOOL StartTextScript(int no)
++gTS.p_read; ++gTS.p_read;
} }
//Advance until new-line // Advance until new-line
while (gTS.data[gTS.p_read] != '\n') while (gTS.data[gTS.p_read] != '\n')
++gTS.p_read; ++gTS.p_read;
++gTS.p_read; ++gTS.p_read;
@ -265,7 +265,7 @@ BOOL StartTextScript(int no)
BOOL JumpTextScript(int no) BOOL JumpTextScript(int no)
{ {
//Set state // Set state
gTS.mode = 1; gTS.mode = 1;
g_GameFlags |= 4u; g_GameFlags |= 4u;
gTS.line = 0; gTS.line = 0;
@ -273,7 +273,7 @@ BOOL JumpTextScript(int no)
gTS.wait = 4; gTS.wait = 4;
gTS.wait_beam = 0; gTS.wait_beam = 0;
//Clear text lines // Clear text lines
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
gTS.ypos_line[i] = 16 * i; gTS.ypos_line[i] = 16 * i;
@ -281,18 +281,18 @@ BOOL JumpTextScript(int no)
memset(text[i], 0, sizeof(text[0])); memset(text[i], 0, sizeof(text[0]));
} }
//Find where event starts // Find where event starts
gTS.p_read = 0; gTS.p_read = 0;
while(1) while(1)
{ {
//Check if we are still in the proper range // Check if we are still in the proper range
if (gTS.data[gTS.p_read] == '\0') if (gTS.data[gTS.p_read] == '\0')
return FALSE; return FALSE;
//Check if we are at an event // Check if we are at an event
if (gTS.data[gTS.p_read] == '#') if (gTS.data[gTS.p_read] == '#')
{ {
//Check if this is our event // Check if this is our event
int event_no = GetTextScriptNo(++gTS.p_read); int event_no = GetTextScriptNo(++gTS.p_read);
if (no == event_no) if (no == event_no)
@ -304,7 +304,7 @@ BOOL JumpTextScript(int no)
++gTS.p_read; ++gTS.p_read;
} }
//Advance until new-line // Advance until new-line
while (gTS.data[gTS.p_read] != '\n') while (gTS.data[gTS.p_read] != '\n')
++gTS.p_read; ++gTS.p_read;
++gTS.p_read; ++gTS.p_read;
@ -312,17 +312,17 @@ BOOL JumpTextScript(int no)
return TRUE; return TRUE;
} }
//End event // End event
void StopTextScript() void StopTextScript()
{ {
//End TSC and reset flags // End TSC and reset flags
gTS.mode = 0; gTS.mode = 0;
g_GameFlags &= ~4; g_GameFlags &= ~4;
g_GameFlags |= 3; g_GameFlags |= 3;
gTS.flags = 0; gTS.flags = 0;
} }
//Prepare a new line // Prepare a new line
void CheckNewLine() void CheckNewLine()
{ {
if (gTS.ypos_line[gTS.line % 4] == 48) if (gTS.ypos_line[gTS.line % 4] == 48)
@ -334,7 +334,7 @@ void CheckNewLine()
} }
} }
//Type a number into the text buffer // Type a number into the text buffer
void SetNumberTextScript(int index) void SetNumberTextScript(int index)
{ {
int a; int a;
@ -344,19 +344,19 @@ void SetNumberTextScript(int index)
int offset; int offset;
char str[5]; char str[5];
//Get digit table // Get digit table
int table[3]; int table[3];
table[0] = 1000; table[0] = 1000;
table[1] = 100; table[1] = 100;
table[2] = 10; table[2] = 10;
//Get number to print // Get number to print
a = gNumberTextScript[index]; a = gNumberTextScript[index];
bZero = FALSE; bZero = FALSE;
offset = 0; offset = 0;
//Trim leading zeroes // Trim leading zeroes
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
if (a / table[i] || bZero != FALSE) if (a / table[i] || bZero != FALSE)
@ -369,19 +369,19 @@ void SetNumberTextScript(int index)
} }
} }
//Set last digit of string, and add null terminator // Set last digit of string, and add null terminator
str[offset] = (char)a + '0'; str[offset] = (char)a + '0';
str[offset + 1] = 0; str[offset + 1] = 0;
//Append number to line // Append number to line
PutText2(6 * gTS.p_write, 0, str, RGB(0xFF, 0xFF, 0xFE), (SurfaceID)(gTS.line % 4 + SURFACE_ID_TEXT_LINE1)); PutText2(6 * gTS.p_write, 0, str, RGB(0xFF, 0xFF, 0xFE), (SurfaceID)(gTS.line % 4 + SURFACE_ID_TEXT_LINE1));
strcat(text[gTS.line % 4], str); strcat(text[gTS.line % 4], str);
//Play sound and reset blinking cursor // Play sound and reset blinking cursor
PlaySoundObject(2, 1); PlaySoundObject(2, 1);
gTS.wait_beam = 0; gTS.wait_beam = 0;
//Check if should move to next line (prevent a memory overflow, come on guys, this isn't a leftover of pixel trying to make text wrapping) // Check if should move to next line (prevent a memory overflow, come on guys, this isn't a leftover of pixel trying to make text wrapping)
gTS.p_write += (unsigned int)strlen(str); gTS.p_write += (unsigned int)strlen(str);
if (gTS.p_write >= 35) if (gTS.p_write >= 35)
@ -392,7 +392,7 @@ void SetNumberTextScript(int index)
} }
} }
//Clear text lines // Clear text lines
void ClearTextLine() void ClearTextLine()
{ {
gTS.line = 0; gTS.line = 0;
@ -407,7 +407,7 @@ void ClearTextLine()
} }
} }
//Draw textbox and whatever else // Draw textbox and whatever else
void PutTextScript() void PutTextScript()
{ {
RECT rcFace; RECT rcFace;
@ -428,7 +428,7 @@ void PutTextScript()
if ((gTS.flags & 1) == 0) if ((gTS.flags & 1) == 0)
return; return;
//Set textbox position // Set textbox position
if (gTS.flags & 0x20) if (gTS.flags & 0x20)
{ {
gTS.rcText.top = 32; gTS.rcText.top = 32;
@ -440,7 +440,7 @@ void PutTextScript()
gTS.rcText.bottom = gTS.rcText.top + 48; gTS.rcText.bottom = gTS.rcText.top + 48;
} }
//Draw textbox // Draw textbox
if (gTS.flags & 2) if (gTS.flags & 2)
{ {
RECT rcFrame1 = {0, 0, 244, 8}; RECT rcFrame1 = {0, 0, 244, 8};
@ -453,7 +453,7 @@ void PutTextScript()
PutBitmap3(&grcFull, WINDOW_WIDTH / 2 - 122, 8 * i + gTS.rcText.top - 10, &rcFrame3, SURFACE_ID_TEXT_BOX); PutBitmap3(&grcFull, WINDOW_WIDTH / 2 - 122, 8 * i + gTS.rcText.top - 10, &rcFrame3, SURFACE_ID_TEXT_BOX);
} }
//Draw face picture // Draw face picture
rcFace.left = 48 * (gTS.face % 6); rcFace.left = 48 * (gTS.face % 6);
rcFace.top = 48 * (gTS.face / 6); rcFace.top = 48 * (gTS.face / 6);
rcFace.right = rcFace.left + 48; rcFace.right = rcFace.left + 48;
@ -471,7 +471,7 @@ void PutTextScript()
PutBitmap3(&gTS.rcText, gTS.face_x / 0x200, gTS.rcText.top - 3, &rcFace, SURFACE_ID_FACE); PutBitmap3(&gTS.rcText, gTS.face_x / 0x200, gTS.rcText.top - 3, &rcFace, SURFACE_ID_FACE);
#endif #endif
//Draw text // Draw text
if (gTS.face) if (gTS.face)
text_offset = 56; text_offset = 56;
else else
@ -480,7 +480,7 @@ void PutTextScript()
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
PutBitmap3(&gTS.rcText, text_offset + TEXT_LEFT, gTS.offsetY + gTS.ypos_line[i] + gTS.rcText.top, &gRect_line, (SurfaceID)(i + SURFACE_ID_TEXT_LINE1)); PutBitmap3(&gTS.rcText, text_offset + TEXT_LEFT, gTS.offsetY + gTS.ypos_line[i] + gTS.rcText.top, &gRect_line, (SurfaceID)(i + SURFACE_ID_TEXT_LINE1));
//Draw NOD cursor // Draw NOD cursor
if ((gTS.wait_beam++ % 20 > 12) && gTS.mode == 2) if ((gTS.wait_beam++ % 20 > 12) && gTS.mode == 2)
{ {
rect.left = TEXT_LEFT + 6 * gTS.p_write + text_offset; rect.left = TEXT_LEFT + 6 * gTS.p_write + text_offset;
@ -494,7 +494,7 @@ void PutTextScript()
// the way Pixel would do it (he only calls GetCortBoxColor // the way Pixel would do it (he only calls GetCortBoxColor
// once, during init functions, so our fix does it that way // once, during init functions, so our fix does it that way
// instead). // instead).
//CortBox(&rect, GetCortBoxColor(RGB(0xFF, 0xFF, 0xFE)); // CortBox(&rect, GetCortBoxColor(RGB(0xFF, 0xFF, 0xFE));
#else #else
// This accidentally uses a BGR value directly, without // This accidentally uses a BGR value directly, without
// running it though GetCortBoxColor first // running it though GetCortBoxColor first
@ -502,7 +502,7 @@ void PutTextScript()
#endif #endif
} }
//Draw GIT // Draw GIT
SET_RECT(rcItemBox1, 0, 0, 72, 16) SET_RECT(rcItemBox1, 0, 0, 72, 16)
SET_RECT(rcItemBox2, 0, 8, 72, 24) SET_RECT(rcItemBox2, 0, 8, 72, 24)
SET_RECT(rcItemBox3, 240, 0, 244, 8) SET_RECT(rcItemBox3, 240, 0, 244, 8)
@ -539,7 +539,7 @@ void PutTextScript()
} }
} }
//Draw Yes / No selection // Draw Yes / No selection
SET_RECT(rect_yesno, 152, 48, 244, 80) SET_RECT(rect_yesno, 152, 48, 244, 80)
SET_RECT(rect_cur, 112, 88, 128, 104) SET_RECT(rect_cur, 112, 88, 128, 104)
@ -556,7 +556,7 @@ void PutTextScript()
} }
} }
//Parse TSC // Parse TSC
int TextScriptProc() int TextScriptProc()
{ {
BOOL bExit; BOOL bExit;
@ -569,8 +569,8 @@ int TextScriptProc()
switch (gTS.mode) switch (gTS.mode)
{ {
case 1: //PARSE case 1: // PARSE
//Type out (faster if ok or cancel are held) // Type out (faster if ok or cancel are held)
++gTS.wait; ++gTS.wait;
if (!(g_GameFlags & 2) && (gKeyCancel | gKeyOk) & gKey) if (!(g_GameFlags & 2) && (gKeyCancel | gKeyOk) & gKey)
@ -581,7 +581,7 @@ int TextScriptProc()
gTS.wait = 0; gTS.wait = 0;
//Parsing time // Parsing time
bExit = FALSE; bExit = FALSE;
while (bExit == FALSE) while (bExit == FALSE)
@ -1261,7 +1261,7 @@ int TextScriptProc()
{ {
if (gTS.data[gTS.p_read] == '\r') if (gTS.data[gTS.p_read] == '\r')
{ {
//Go to new-line // Go to new-line
gTS.p_read += 2; gTS.p_read += 2;
gTS.p_write = 0; gTS.p_write = 0;
@ -1273,26 +1273,26 @@ int TextScriptProc()
} }
else if (gTS.flags & 0x10) else if (gTS.flags & 0x10)
{ {
//SAT/CAT/TUR printing // SAT/CAT/TUR printing
x = gTS.p_read; x = gTS.p_read;
//Break if reaches command, or new-line // Break if reaches command, or new-line
while (gTS.data[x] != '<' && gTS.data[x] != '\r') while (gTS.data[x] != '<' && gTS.data[x] != '\r')
{ {
//Skip if SHIFT-JIS // Skip if SHIFT-JIS
if (gTS.data[x] & 0x80) if (gTS.data[x] & 0x80)
++x; ++x;
++x; ++x;
} }
//Get text to copy // Get text to copy
y = x - gTS.p_read; y = x - gTS.p_read;
memcpy(str, &gTS.data[gTS.p_read], y); memcpy(str, &gTS.data[gTS.p_read], y);
str[y] = 0; str[y] = 0;
gTS.p_write = x; gTS.p_write = x;
//Print text // Print text
PutText2(0, 0, str, RGB(0xFF, 0xFF, 0xFE), (SurfaceID)(gTS.line % 4 + SURFACE_ID_TEXT_LINE1)); PutText2(0, 0, str, RGB(0xFF, 0xFF, 0xFE), (SurfaceID)(gTS.line % 4 + SURFACE_ID_TEXT_LINE1));
#ifdef FIX_BUGS #ifdef FIX_BUGS
strcpy(text[gTS.line % 4], str); strcpy(text[gTS.line % 4], str);
@ -1300,7 +1300,7 @@ int TextScriptProc()
sprintf(text[gTS.line % 4], str); // No point to using an sprintf here, and it makes Clang mad sprintf(text[gTS.line % 4], str); // No point to using an sprintf here, and it makes Clang mad
#endif #endif
//Check if should move to next line (prevent a memory overflow, come on guys, this isn't a leftover of pixel trying to make text wrapping) // Check if should move to next line (prevent a memory overflow, come on guys, this isn't a leftover of pixel trying to make text wrapping)
gTS.p_read += y; gTS.p_read += y;
if (gTS.p_write >= 35) if (gTS.p_write >= 35)
@ -1310,7 +1310,7 @@ int TextScriptProc()
} }
else else
{ {
//Get text to print // Get text to print
c[0] = gTS.data[gTS.p_read]; c[0] = gTS.data[gTS.p_read];
if (c[0] & 0x80) if (c[0] & 0x80)
@ -1323,7 +1323,7 @@ int TextScriptProc()
c[1] = '\0'; c[1] = '\0';
} }
//Print text // Print text
if (c[0] == '=') if (c[0] == '=')
{ {
Surface2Surface(6 * gTS.p_write, 2, &rcSymbol, (SurfaceID)(gTS.line % 4 + SURFACE_ID_TEXT_LINE1), SURFACE_ID_TEXT_BOX); Surface2Surface(6 * gTS.p_write, 2, &rcSymbol, (SurfaceID)(gTS.line % 4 + SURFACE_ID_TEXT_LINE1), SURFACE_ID_TEXT_BOX);
@ -1337,7 +1337,7 @@ int TextScriptProc()
PlaySoundObject(2, 1); PlaySoundObject(2, 1);
gTS.wait_beam = 0; gTS.wait_beam = 0;
//Offset read and write positions // Offset read and write positions
if (c[0] & 0x80) if (c[0] & 0x80)
{ {
gTS.p_read += 2; gTS.p_read += 2;
@ -1363,12 +1363,12 @@ int TextScriptProc()
} }
break; break;
case 2: //NOD case 2: // NOD
if ((gKeyCancel | gKeyOk) & gKeyTrg) if ((gKeyCancel | gKeyOk) & gKeyTrg)
gTS.mode = 1; gTS.mode = 1;
break; break;
case 3: //NEW LINE case 3: // NEW LINE
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
gTS.ypos_line[i] -= 4; gTS.ypos_line[i] -= 4;
@ -1381,7 +1381,7 @@ int TextScriptProc()
} }
break; break;
case 4: //WAI case 4: // WAI
if (gTS.wait_next == 9999) if (gTS.wait_next == 9999)
break; break;
@ -1395,28 +1395,28 @@ int TextScriptProc()
gTS.wait_beam = 0; gTS.wait_beam = 0;
break; break;
case 5: //FAI/FAO case 5: // FAI/FAO
if (GetFadeActive()) if (GetFadeActive())
break; break;
gTS.mode = 1; gTS.mode = 1;
gTS.wait_beam = 0; gTS.wait_beam = 0;
break; break;
case 7: //WAS case 7: // WAS
if ((gMC.flag & 8) == 0) if ((gMC.flag & 8) == 0)
break; break;
gTS.mode = 1; gTS.mode = 1;
gTS.wait_beam = 0; gTS.wait_beam = 0;
break; break;
case 6: //YNJ case 6: // YNJ
if (gTS.wait < 16) if (gTS.wait < 16)
{ {
gTS.wait++; gTS.wait++;
} }
else else
{ {
//Select option // Select option
if (gKeyTrg & gKeyOk) if (gKeyTrg & gKeyOk)
{ {
PlaySoundObject(18, 1); PlaySoundObject(18, 1);
@ -1431,13 +1431,13 @@ int TextScriptProc()
gTS.wait_beam = 0; gTS.wait_beam = 0;
} }
} }
//Yes // Yes
else if (gKeyTrg & gKeyLeft) else if (gKeyTrg & gKeyLeft)
{ {
gTS.select = 0; gTS.select = 0;
PlaySoundObject(1, 1); PlaySoundObject(1, 1);
} }
//No // No
else if (gKeyTrg & gKeyRight) else if (gKeyTrg & gKeyRight)
{ {
gTS.select = 1; gTS.select = 1;

View file

@ -11,13 +11,13 @@ void InitTriangleTable(void)
float a; float a;
float b; float b;
//Sine // Sine
for (i = 0; i < 0x100; ++i) for (i = 0; i < 0x100; ++i)
{ {
gSin[i] = (int)(sin(i * 6.2831998 / 256.0) * 512.0); gSin[i] = (int)(sin(i * 6.2831998 / 256.0) * 512.0);
} }
//Tangent // Tangent
for (i = 0; i < 0x21; ++i) for (i = 0; i < 0x21; ++i)
{ {
a = (float)(i * 6.2831855f / 256.0f); a = (float)(i * 6.2831855f / 256.0f);

View file

@ -59,7 +59,7 @@ void SetValueView(int *px, int *py, int value)
value = gVV[index].value; value = gVV[index].value;
} }
//Get if negative or not // Get if negative or not
if (value < 0) if (value < 0)
{ {
value *= -1; value *= -1;
@ -70,7 +70,7 @@ void SetValueView(int *px, int *py, int value)
minus = FALSE; minus = FALSE;
} }
//Get width // Get width
v = value; v = value;
if (value > 999) if (value > 999)
@ -82,7 +82,7 @@ void SetValueView(int *px, int *py, int value)
else else
width = 16; width = 16;
//Set properties // Set properties
gVV[index].flag = TRUE; gVV[index].flag = TRUE;
gVV[index].px = px; gVV[index].px = px;
gVV[index].py = py; gVV[index].py = py;
@ -114,7 +114,7 @@ void SetValueView(int *px, int *py, int value)
{72, 64, 80, 72}, {72, 64, 80, 72},
}; };
//Get digits // Get digits
dig[0] = 1; dig[0] = 1;
dig[1] = 10; dig[1] = 10;
dig[2] = 100; dig[2] = 100;
@ -136,7 +136,7 @@ void SetValueView(int *px, int *py, int value)
RECT rcPlus = {32, 48, 40, 56}; RECT rcPlus = {32, 48, 40, 56};
RECT rcMinus = {40, 48, 48, 56}; RECT rcMinus = {40, 48, 48, 56};
//Draw value // Draw value
CortBox2(&gVV[index].rect, 0x000000, SURFACE_ID_VALUE_VIEW); CortBox2(&gVV[index].rect, 0x000000, SURFACE_ID_VALUE_VIEW);
if (minus) if (minus)