[Build] [Pipeline] Compile with optimization flags

The ones we use in `Research/` and for the Anniversary Edition. Better
code generation at the cost of having to explicitly declare `main` as
`__cdecl` so that the linker can find it.

Part of P0002, funded by GhostPhanom.
This commit is contained in:
nmlgc 2024-05-12 03:43:39 +02:00
parent c95d7c5aa8
commit 10db923251
5 changed files with 11 additions and 7 deletions

View File

@ -31,6 +31,10 @@
CFLAGS = -ls -I. -Lbin\ -O -b- -3 -Z -d
AFLAGS = /m /ml
# Additional generally good compilation flags. Should be used for all code that
# does not need to match the original binaries.
CFLAGS_OPTIMIZED = $(CFLAGS) -G -k- -p -x-
# Currently, it only makes sense to enable extended dictionary processing for
# binaries that don't link the original binary release of MASTERS.LIB, which
# doesn't come with them.
@ -57,7 +61,7 @@ th05:: $(TH05:\=bin\th05\)
tlink /t /3 $**
bin\Pipeline\grzview.com: Pipeline\grzview.cpp th01\formats\grz.cpp platform\x86real\pc98\palette.cpp
$(CC) $(CFLAGS) -mt -lt -DGAME=1 -nbin\Pipeline\ @&&|
$(CC) $(CFLAGS_OPTIMIZED) -mt -lt -DGAME=1 -nbin\Pipeline\ @&&|
$**
| masters.lib
@ -196,10 +200,10 @@ Research:
tlink -t $**, $@
bin\Pipeline\zungen.com: Pipeline\zungen.c
$(CC) $(CFLAGS) -mt -lt -IPipeline\ -nbin\Pipeline\ -eZUNGEN.COM $**
$(CC) $(CFLAGS_OPTIMIZED) -mt -lt -IPipeline\ -nbin\Pipeline\ -eZUNGEN.COM $**
bin\Pipeline\comcstm.com: Pipeline\comcstm.c
$(CC) $(CFLAGS) -mt -lt -IPipeline\ -nbin\Pipeline\ -eCOMCSTM.com $**
$(CC) $(CFLAGS_OPTIMIZED) -mt -lt -IPipeline\ -nbin\Pipeline\ -eCOMCSTM.com $**
ZUNCOM_PREREQ = bin\Pipeline\zungen.com bin\Pipeline\zun_stub.bin

View File

@ -149,7 +149,7 @@ static enum bmp2arr_error parse_argv(struct rec98_bmp2arr_task *tsk,int argc,cha
return bmp2arr_error_set(tsk, SUCCESS);
}
int main(int argc,char **argv) {
int __cdecl main(int argc,char **argv) {
struct rec98_bmp2arr_task tsk;
if (rec98_bmp2arr_task_init(&tsk))

View File

@ -5,7 +5,7 @@
#include "./common.h"
static const char copyright[] = "comcstm (c)O.Morikawa 1996";
#define HEADER_SIZE (3+2+2+2+4+sizeof(copyright)-1)
int main(int argc, char **argv) {
int __cdecl main(int argc, char **argv) {
FILE *fo;
long sz_usage, sz_program;
int tmp;

View File

@ -43,7 +43,7 @@ const Palette4 boss8_grz_pal = {
0x9, 0x9, 0x9,
};
int main(int argc, const char **argv)
int __cdecl main(int argc, const char **argv)
{
if((get_machine() & PC9801) == 0) {
printf("This program must be run on a PC-98.\n");

View File

@ -30,7 +30,7 @@ static const char moveup[] = {
0x50, /* PUSH AX */
0xC3, /* RETN */
};
int main(int argc, char** argv) {
int __cdecl main(int argc, char** argv) {
static char path[MAXPATH+1];
static char names[8*MAX_COUNT];
static int entries[MAX_COUNT+1];