Permalink
Browse files

Remove more dead code.

Enable linker GC.



git-svn-id: svn+ssh://jay/var/svn/wolf/trunk@104 32837ae5-38f0-4cfd-8401-3ff76d8497c4
  • Loading branch information...
1 parent 2499556 commit b2129e09ecc431fbe701f8965f302b43586f1f67 paul committed Aug 12, 2007
Showing with 33 additions and 13 deletions.
  1. +2 −2 Makefile
  2. +2 −0 build_grstarts.c
  3. +8 −0 build_pictable.c
  4. +15 −5 id_ca.c
  5. +2 −0 luminary-crt0.S
  6. +2 −0 luminary.ld
  7. +2 −6 wl_main.c
View
@@ -2,7 +2,7 @@ PROGS=ewolf3d
ifeq ($(PROGS),ewolf3d)
CC = arm-unknown-eabi-gcc
-CFLAGS = -g -Wall -fno-common -DLUMINARY -mthumb -march=armv7-m -Os
+CFLAGS = -g -Wall -fno-common -DLUMINARY -mthumb -march=armv7-m -Os -ffunction-sections -fdata-sections
else
CC = gcc -m32
CFLAGS = -g -Wall
@@ -69,7 +69,7 @@ sdlwolf3d: $(DOBJS)
$(CC) -o sdlwolf3d $(DOBJS) $(DLDLIBS)
ewolf3d: $(EOBJS) luminary-crt0.o
- $(CC) $(CFLAGS) -o ewolf3d $(EOBJS) $(ELDLIBS)
+ $(CC) $(CFLAGS) -o ewolf3d -Wl,--gc-sections $(EOBJS) $(ELDLIBS)
tables.o: tables.c
View
@@ -12,12 +12,14 @@ int main()
printf("#include \"wl_def.h\"\n");
+ printf("#ifndef EMBEDDED\n");
printf("const uint32_t grstarts[NUMCHUNKS + 1] = {\n");
for (i = 0; i < NUMCHUNKS + 1; i++)
{
printf("0x%x,\n", (d[i*3+0]<<0)|(d[i*3+1]<<8)|(d[i*3+2]<<16));
}
printf("};\n");
+ printf("#endif\n");
return 0;
}
View
@@ -1,5 +1,6 @@
#include "wl_def.h"
+#ifndef EMBEDDED
#include "huffman.h"
void CAL_HuffExpand(const byte *source, byte *dest, long length,
@@ -32,9 +33,11 @@ void CAL_HuffExpand(const byte *source, byte *dest, long length,
}
} while (dest != endoff);
}
+#endif
int main()
{
+#ifndef EMBEDDED
byte *source;
byte *p;
int start;
@@ -57,8 +60,11 @@ int main()
p = malloc(size);
CAL_HuffExpand(source, p, size, grhuffman);
+#endif
printf("#include \"wl_def.h\"\n");
+#ifndef EMBEDDED
+ printf("#ifndef EMBEDDED\n");
printf("const pictabletype pictable[NUMPICS] = {\n", NUMPICS);
if (size / 4 < NUMPICS)
printf("#error NUMPICS > %d\n", size / 4);
@@ -68,5 +74,7 @@ int main()
p += 4;
}
printf("};\n");
+ printf("#endif\n");
+#endif
return 0;
}
View
20 id_ca.c
@@ -8,8 +8,10 @@ typedef struct
boolean flag1:1;
} huffnode;
#else
+#ifndef EMBEDDED
#include "huffman.h"
#endif
+#endif
/*
=============================================================================
@@ -29,18 +31,20 @@ ms0 mapseg0[MAPSIZE * MAPSIZE];
#ifdef ENABLE_AUDIO
static byte *audiosegs[NUMSNDCHUNKS];
#endif
+#ifndef EMBEDDED
static pool_id grsegs[NUMCHUNKS];
+#endif
#define gfilename "vgagraph." GAMEEXT
#ifndef ENABLE_PRECOMPILE
-#define gdictname "vgadict."
-#define mheadname "maphead."
-#define gheadname "vgahead."
+#define gdictname "vgadict." GAMEEXT
+#define mheadname "maphead." GAMEEXT
+#define gheadname "vgahead." GAMEEXT
#endif
#define gmapsname "gamemaps." GAMEEXT
#ifndef ENABLE_AUTIO
-#define aheadname "audiohed."
-#define afilename "audiot."
+#define aheadname "audiohed." GAMEEXT
+#define afilename "audiot." GAMEEXT
#endif
#define pfilename "vswap." GAMEEXT
@@ -164,6 +168,7 @@ boolean CA_LoadFile(const char *filename, memptr *ptr)
============================================================================
*/
+#ifndef EMBEDDED
/*
======================
=
@@ -204,6 +209,7 @@ void CAL_HuffExpand(const byte *source, byte *dest, long length,
}
} while (dest != endoff);
}
+#endif
/*
======================
@@ -585,6 +591,7 @@ void CA_LoadAllSounds()
/* ======================================================================== */
+#ifndef EMBEDDED
/*
======================
=
@@ -673,6 +680,7 @@ memptr CA_GetChunk(myint chunk)
//MM_FreePtr((memptr)&source);
return dest;
}
+#endif
void CA_UnCacheGrChunk(myint chunk)
{
@@ -947,9 +955,11 @@ memptr PM_GetPage(myint pagenum)
Quit("PM_GetPage: Invalid page request");
#ifdef EMBEDDED
+#if 0
if (RomChunks[pagenum]) {
return (memptr)RomChunks[pagenum];
}
+#endif
#endif
if (PageAddr[pagenum]) {
addr = MM_PoolPtr(PageAddr[pagenum]);
View
@@ -35,6 +35,8 @@ isr_handler:
b .
.section ".isr", "a", %progbits
+.global __isr_vectors
+__isr_vectors:
/* System vectors. */
.word _stack
.word _start
View
@@ -7,6 +7,8 @@ ENTRY(_start)
SEARCH_DIR(.)
__DYNAMIC = 0;
+EXTERN(__isr_vectors)
+
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 256k
View
@@ -374,9 +374,9 @@ myint ReadConfig()
return 0;
}
+#ifndef EMBEDDED
myint SaveTheGame(const char *fn, const char *tag, myint dx, myint dy)
{
-#ifndef EMBEDDED
objtype *ob;
myint fd, i, x, y;
int32_t cs;
@@ -544,11 +544,9 @@ myint SaveTheGame(const char *fn, const char *tag, myint dx, myint dy)
return -1;
}
-#endif
return 0;
}
-#ifndef EMBEDDED
myint ReadSaveTag(const char *fn, const char *tag)
{
char buf[8];
@@ -596,11 +594,9 @@ myint ReadSaveTag(const char *fn, const char *tag)
return -1;
}
-#endif
myint LoadTheGame(const char *fn, myint dx, myint dy)
{
-#ifndef EMBEDDED
char buf[8];
myint fd, i, x, y, id;
int32_t v;
@@ -830,9 +826,9 @@ myint LoadTheGame(const char *fn, myint dx, myint dy)
IN_Ack();
NewGame(1, 0);
-#endif
return -1;
}
+#endif
/* ======================================================================== */

0 comments on commit b2129e0

Please sign in to comment.