]> git.0x19.co - doomgeneric-snom360/commitdiff
Reduce stack usage
authorMaxime Vincent <maxime.vince@gmail.com>
Tue, 17 May 2016 08:20:28 +0000 (10:20 +0200)
committerMaxime Vincent <maxime.vince@gmail.com>
Tue, 17 May 2016 08:20:28 +0000 (10:20 +0200)
frosted-doom/Makefile
frosted-doom/doomdef.h
frosted-doom/g_game.c
frosted-doom/r_things.c
frosted-doom/stubs.c

index 4f87d5629565a648a7b367e9dfc2cf28d6826372..690f54e192705a7d601fe5a5f4fed99fdf5c1ca4 100644 (file)
@@ -7,6 +7,11 @@
 CROSS_COMPILE = arm-frosted-eabi-
 CC=  $(CROSS_COMPILE)gcc  # gcc or g++
 
+ifeq ($V,'1')
+       V=''
+else
+       V=@
+endif
 
 CFLAGS+=-mthumb -mlittle-endian -mthumb-interwork -ffunction-sections -fdata-sections -mcpu=cortex-m3
 CFLAGS+=-DCORE_M3 -D__frosted__
@@ -36,7 +41,7 @@ OBJS=                         \
                $(O)/dstrings.o         \
                $(O)/i_system.o         \
                $(O)/i_sound_dummy.o          \
-               $(O)/i_video_dummy.o          \
+               $(O)/i_video_fbdev.o          \
                $(O)/i_net.o                    \
                $(O)/tables.o                   \
                $(O)/f_finale.o         \
@@ -100,14 +105,16 @@ clean:
        rm -f frosted/*
 
 $(O)/fdoom:    $(OBJS) $(O)/i_main.o
-       $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(O)/i_main.o \
+       @echo [Linking $@]
+       $V$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(O)/i_main.o \
        -o $(O)/fdoom $(LIBS) -Wl,-Map,fdoom.map
 
 $(O):
        mkdir -p $(O)
 
 $(O)/%.o:      %.c $(O)
-       $(CC) $(CFLAGS) -c $< -o $@
+       @echo [Compiling $<]
+       $V$(CC) $(CFLAGS) -c $< -o $@
 
 #############################################################
 #
index 18504776000af8dd8d5cf14f8ea80c285c6fdd9c..a5a4ffa4cc9722194600579ec030902ebea634c3 100644 (file)
@@ -96,6 +96,7 @@ typedef enum
 // It will not work dynamically, see visplanes.
 //
 #define        BASE_WIDTH              320
+//#define      BASE_WIDTH              480
 
 // It is educational but futile to change this
 //  scaling e.g. to 2. Drawing of status bar,
@@ -103,13 +104,16 @@ typedef enum
 //  by the graphics.
 #define        SCREEN_MUL              1
 #define        INV_ASPECT_RATIO        0.625 // 0.75, ideally
+//#define      INV_ASPECT_RATIO        0.567// 0.75, ideally
 
 // Defines suck. C sucks.
 // C++ might sucks for OOP, but it sure is a better C.
 // So there.
 #define SCREENWIDTH  320
+//#define SCREENWIDTH  480
 //SCREEN_MUL*BASE_WIDTH //320
 #define SCREENHEIGHT 200
+//#define SCREENHEIGHT 272
 //(int)(SCREEN_MUL*BASE_WIDTH*INV_ASPECT_RATIO) //200
 
 
index 30ac33c244c7b86477038497511b9556289987fa..1da23538de1a715d0d7891bdb1717ee80f41f4b5 100644 (file)
@@ -1588,9 +1588,9 @@ void G_DoPlayDemo (void)
     demobuffer = demo_p = W_CacheLumpName (defdemoname, PU_STATIC); 
     if ( *demo_p++ != VERSION)
     {
-      fprintf( stderr, "Demo is from a different game version!\n");
-      gameaction = ga_nothing;
-      return;
+      fprintf( stderr, "Demo is from a different game version! - Trying anyway...\n");
+      //gameaction = ga_nothing;
+      //return;
     }
     
     skill = *demo_p++; 
index c201fff190515d889d3d40817a3f19e66f232a43..b91016f8af3d14b1087810eb0a0d72ac0c9eb595 100644 (file)
@@ -839,11 +839,12 @@ void R_SortVisSprites (void)
 //
 // R_DrawSprite
 //
+//
+short          clipbot[SCREENWIDTH];
+short          cliptop[SCREENWIDTH];
 void R_DrawSprite (vissprite_t* spr)
 {
     drawseg_t*         ds;
-    short              clipbot[SCREENWIDTH];
-    short              cliptop[SCREENWIDTH];
     int                        x;
     int                        r1;
     int                        r2;
index 77a53583ecda3f4c18e77582002ae99dd8bd2be1..fc4152c68b07ae32b434d3f13545d2651700c197 100644 (file)
@@ -6,7 +6,7 @@
 //XXX FIXME
 in_addr_t inet_addr(const char *cp)
 {
-    return NULL;
+    return (in_addr_t)NULL;
 }
 
 // XXX FIXME