Menu

#27 Can I still compile it for DOS?

None
open
None
5
2023-08-27
2021-01-20
some
No

Is it possible to get or at least compile Doom Legacy binaries for DOS? If so, is there a detailed guide where?

Discussion

  • Wesley Johnson

    Wesley Johnson - 2021-01-20
    • assigned_to: Wesley Johnson
    • Group: -->
     
  • Wesley Johnson

    Wesley Johnson - 2021-01-20

    All the documentation for compiling is published in the docs, which is in the common download.
    No one has compiled the DOS port in ages. How they did it is probably obsolete.
    I do not know who it was working on it, it anyone. It may simply be the interface that was inherited from the original code, which was DOS.
    Please see current discussion at DoomWorld.

     
  • Steven Newbury

    Steven Newbury - 2023-08-24

    I've been giving this a go over the last couple of days with a very up to date DJGPP cross-toolchain: GCC13, DJGPP from the actively maintained for on github. Allegro4 and libsocket from the last DJGPP packages. There were a lot of build errors. I worked through each one, fairly confident about most of them, but a few I managed to make compile, but didn't expect to work.

    Anyway, unsurprisingly it didn't work. The console wasn't initialised, so I'll need to check if the DOS code for that is still there! Instead startup messages were printed in green text. After loading the wads the screen went black and the VM (dosemu2) became unresponsive.

    I need to check whether my allegro build is actually working, so I'm going to test that next.

    Should I attach my WIP patch? There are probably errors easily spotted by someone more familiar with the codebase.

     
  • Steven Newbury

    Steven Newbury - 2023-08-24

    Below is my WIP patch. It contains local changes to help me with cross-compiling in addition to the needed changes to make DOS build.

    CD music needs to be reworked for the DJGPP version of libbcd. It's on my TODO list. I've disabled it until then.

    Joystick support has also changed in the DJGPP version of Allegro compared to what was expected in the existing code, the API seems to been replaced at some point. I'll probably take a look at it if I can get the game to run. I have disabled building the DOS joystick support for now.

    I have renamed the files to lower-case, since I'm building on Linux and it was causing problems with case insensitivity expectations in the DOS support code. As a consequence, in order to apply this patch the files need to be renamed first. I wanted to make sure the diffs were obvious against the original files instead of showing up as new files.

    diff -iurNx '*.o' trunk/make_options_dos ../../doomlegacy-svn/legacy_one/trunk/make_options_dos
    --- trunk/make_options_dos  2023-08-24 12:15:57.707795024 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/make_options_dos  2023-08-22 17:14:58.128362016 +0100
    @@ -13,7 +13,7 @@
     #   but is not available for DOS.
     #  WIN_NATIVE: Native windows (direct draw)
     #  DOS_NATIVE: DOS native draw interface
    -SMIF=DOS_NATIVE
    +SMIF=DJGPPDOS_NATIVE
    
     # SDL_Mixer library is a separate library from SDL
     # HAVE_MIXER=1
    diff -iurNx '*.o' trunk/src/..depdjgppdos.dep ../../doomlegacy-svn/legacy_one/trunk/src/..depdjgppdos.dep
    --- trunk/src/..depdjgppdos.dep 2023-08-22 23:51:07.938350781 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/..depdjgppdos.dep 2023-08-23 17:05:51.202763373 +0100
    @@ -1,10 +1,10 @@
     ..objs filesrch.o: djgppdos/filesrch.c d_netfil.h doomdef.h doomtype.h w_wad.h \
      r_defs.h m_fixed.h d_think.h p_mobj.h doomdata.h info.h tables.h \
      screen.h command.h i_video.h m_misc.h
    -..objs i_cdmus.o: djgppdos/i_cdmus.c doomincl.h doomdef.h doomtype.h \
    - djgppdos/bcd.h i_sound.h sounds.h command.h command.h i_system.h \
    - d_ticcmd.h m_fixed.h d_event.h s_sound.h p_mobj.h doomdata.h info.h \
    - d_think.h tables.h r_defs.h screen.h i_video.h
    +..objs i_cdmus.o: djgppdos/i_cdmus.c doomincl.h doomdef.h doomtype.h i_sound.h \
    + sounds.h command.h command.h i_system.h d_ticcmd.h m_fixed.h d_event.h \
    + s_sound.h p_mobj.h doomdata.h info.h d_think.h tables.h r_defs.h \
    + screen.h i_video.h
     ..objs i_main.o: djgppdos/i_main.c doomincl.h doomdef.h doomtype.h m_argv.h \
      d_main.h d_event.h w_wad.h r_defs.h m_fixed.h d_think.h p_mobj.h \
      doomdata.h info.h tables.h screen.h command.h i_video.h i_system.h \
    diff -iurNx '*.o' trunk/src/..depmain_r.dep ../../doomlegacy-svn/legacy_one/trunk/src/..depmain_r.dep
    --- trunk/src/..depmain_r.dep   2023-08-22 23:51:07.281670208 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/..depmain_r.dep   2023-08-23 17:05:50.529415787 +0100
    @@ -22,7 +22,7 @@
      command.h r_local.h screen.h i_video.h m_bbox.h r_main.h r_data.h \
      r_defs.h r_state.h r_bsp.h r_segs.h r_plane.h r_sky.h r_things.h \
      sounds.h r_draw.h st_stuff.h d_event.h v_video.h w_wad.h z_zone.h \
    - console.h r_draw8.c r_draw16.c r_draw24.c r_draw32.c
    + console.h r_draw8.c r_draw16.c
     ..objs r_main.o: r_main.c doomincl.h doomdef.h doomtype.h g_game.h doomstat.h \
      doomdata.h d_player.h d_items.h p_pspr.h m_fixed.h tables.h info.h \
      d_think.h p_mobj.h d_ticcmd.h b_bot.h b_search.h b_node.h d_clisrv.h \
    diff -iurNx '*.o' trunk/src/djgppdos/filesrch.c ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/filesrch.c
    --- trunk/src/djgppdos/filesrch.c   2023-08-22 19:21:42.509384017 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/filesrch.c   2023-08-23 12:53:09.955214435 +0100
    @@ -29,6 +29,8 @@
         filestatus_e retval = FS_NOTFOUND;
         DIR ** dirhandle_stack;  // (malloc)
         DIR * dirhandle;
    +    struct dirent *dent;
    +    struct stat fstat;
         int * index_stack;  // each directory in the searchpath  (malloc)
         int depth=0;
         int cur_index, remspace;  // searchpath
    diff -iurNx '*.o' trunk/src/djgppdos/i_net.c ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_net.c
    --- trunk/src/djgppdos/i_net.c  2023-08-22 19:21:42.512717422 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_net.c  2023-08-23 12:46:21.519903537 +0100
    @@ -75,6 +75,7 @@
     } command_t;
    
     static int doomatic;
    +static int nodenum;
    
     // Antique interfaces
     boolean External_Driver_Get(void);
    @@ -141,7 +142,7 @@
             COM_BufAddText("connect any\n");
    
         // ipx + time + 4 (padding)
    -    packetheaderlength=30+4+4;
    +    net_packetheader_length=30+4+4;
    
         // 13-5-99 : added to pass legacy version to doomatic
         if( doomatic )
    @@ -186,17 +187,17 @@
     {
         __dpmi_regs r;
    
    -    if((!doomatic) && (doomcom->remotenode==BROADCASTADDR))
    +    if((!doomatic) && (doomcom->remotenode==BROADCAST_NODE))
         {
             int i;
    -        for(i=1;i<doomcom->numnodes;i++)
    +        for(i=1;i<doomcom->num_player_netnodes;i++)
             {
                 doomcom->remotenode=i;
                 doomcom->command=CMD_SEND;
                 __dpmi_int(doomcom->intnum,&r);
             }
    
    -        doomcom->remotenode=BROADCASTADDR;
    +        doomcom->remotenode=BROADCAST_NODE;
         }
         else
         {
    diff -iurNx '*.o' trunk/src/djgppdos/i_sound.c ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_sound.c
    --- trunk/src/djgppdos/i_sound.c    2023-08-24 12:15:57.671127580 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_sound.c    2023-08-23 11:45:44.262922537 +0100
    @@ -82,6 +82,7 @@
    
     static void  init_music(void);
     static void  shutdown_music(void);
    +extern  byte  sound_started;
    
     //
     // this function converts raw 11khz, 8-bit data to a SAMPLE* that allegro uses
    @@ -193,7 +194,7 @@
     // Pitching (that is, increased speed of playback)
     //  is set, but currently not used by mixing.
     //
    -int I_StartSound ( int           id,
    +int I_StartSound ( sfxid_t       id,
                        int           vol,
                        int           sep,
                        int           pitch,
    @@ -372,7 +373,7 @@
     //
    
     MIDI* currsong;   //im assuming only 1 song will be played at once
    -static int      islooping=0;
    +static byte     islooping=0;
     static int      musicdies=-1;
     int             music_started=0;
     char*           musicbuffer;
    @@ -472,7 +473,7 @@
         music_started=false;
     }
    
    -void I_PlaySong(int handle, int looping)
    +void I_PlaySong(int handle, byte looping)
     {
         if(nomusic)
             return;
    diff -iurNx '*.o' trunk/src/djgppdos/i_system.c ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_system.c
    --- trunk/src/djgppdos/i_system.c   2023-08-24 12:15:57.674460984 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_system.c   2023-08-23 16:59:34.724795425 +0100
    @@ -189,7 +189,7 @@
     {
         return ticcount;
     }
    -
    +#if 0
     byte joystick_detected=false;
     JoyType_t   Joystick;
    
    @@ -266,7 +266,7 @@
             }
         }
     }
    -
    +#endif
    
    
    
    @@ -285,9 +285,8 @@
         // dont flush the message!
     }
    
    -
     //added 31-12-97 : display error messy after shutdowngfx
    -void I_Error (char *error, ...)
    +void I_Error (const char *error, ...)
     {
         va_list     argptr;
    
    @@ -506,7 +505,7 @@
         if( mouse2_started )
             I_ShutdownMouse2();
    
    -    if(!cv_usemouse2.value)
    +    if(!cv_usemouse[1].value)
             return;
    
         handlermouse2x=handlermouse2y=handlermouse2buttons=0;
    @@ -561,12 +560,12 @@
    
         outportb(mouse2port+4,0x0b);   // restart mouse
         i=I_GetTime()+TICRATE;
    -    found=cv_usemouse2.value==2;
    +    found=cv_usemouse[1].value==2;
         while (I_GetTime()<i || !found)
            if(combytes[0]!='M')
               found=true;
    
    -    if(found || cv_usemouse2.value==2)
    +    if(found || cv_usemouse[1].value==2)
         {
             CONS_Printf("Microsoft compatible Secondary Mouse detected\n");
    
    @@ -591,7 +590,7 @@
         __dpmi_regs r;
    
         // mouse detection may be skipped by setting usemouse false
    -    if(cv_usemouse.value == 0)
    +    if(cv_usemouse[0].value == 0)
         {
             mouse_detected=false;
             I_ShutdownMouse2();
    @@ -605,7 +604,7 @@
         __dpmi_int(0x33,&r);
    
         //added:03-01-98:
    -    if( r.x.ax == 0 && cv_usemouse.value != 2)
    +    if( r.x.ax == 0 && cv_usemouse[0].value != 2)
         {
             mouse_detected=false;
             CONS_Printf("\2I_StartupMouse: mouse not present.\n");
    @@ -717,6 +716,7 @@
             }
    
         }
    +#if 0
         //joystick
         if (joystick_detected)
         {
    @@ -772,6 +772,7 @@
    
             D_PostEvent(&event);
         }
    +#endif
     }
    
     //
    @@ -887,8 +888,8 @@
    
                 if(ch==70)  // crtl-break
                 {
    -                asm ("movb $0x79, %%al
    -                     call ___djgpp_hw_exception"
    +                asm ("movb $0x79, %%al\n"
    +                     "call ___djgpp_hw_exception"
                          : : :"%eax","%ebx","%ecx","%edx","%esi","%edi","memory");
                 }
    
    @@ -1129,8 +1130,9 @@
        keyboard_started = false;
        sound_started = false;
        timer_started = false;
    +#if 0
        cdaudio_started = false;
    -
    +#endif
        // check for OS type and version here ?
    
    
    @@ -1154,8 +1156,10 @@
    
         I_StartupSystem();
    
    +#if 0
         // Initialize the joystick subsystem.
         I_InitJoystick();
    +#endif
    
         // d_main will next call I_StartupGraphics
     }
    @@ -1187,17 +1191,17 @@
    
     }
    
    -void I_GetDiskFreeSpace(INT64 *freespace)
    +uint64_t I_GetDiskFreeSpace(void)
     {
         struct diskfree_t df;
         if(_dos_getdiskfree(0,&df))
         {
    -        *freespace = (unsigned long)df.avail_clusters *
    +        return (uint64_t) df.avail_clusters *
                          (unsigned long)df.bytes_per_sector *
                          (unsigned long)df.sectors_per_cluster;
         }
         else
    -        *freespace = INT_MAX;
    +        return (uint64_t) LONG_MAX;
     }
    
     char *I_GetUserName(void)
    diff -iurNx '*.o' trunk/src/djgppdos/i_video.c ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_video.c
    --- trunk/src/djgppdos/i_video.c    2023-08-24 12:15:57.671127580 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/i_video.c    2023-08-22 19:21:42.522717633 +0100
    @@ -35,6 +35,7 @@
     #include "doomincl.h"
       // stdlib, strings, stdio, defines
    
    +
     #include <stdlib.h>
     #include <unistd.h>
     #include <stdarg.h>
    @@ -42,21 +43,26 @@
     #include <sys/types.h>
     //#include <sys/socket.h>
    
    +
     #include <netinet/in.h>
     //#include <errnos.h>
     #include <signal.h>
    
    +
     #include <go32.h>
     #include <pc.h>
     #include <dpmi.h>
     #include <dos.h>
     #include <sys/nearptr.h>
    
    +#include "vid_vesa.h"
     #include "i_system.h"
     #include "v_video.h"
     #include "m_argv.h"
    -#include "vid_vesa.h"
     #include "i_video.h"
    +
    +#include <allegro/gfx.h>
    +
       // cv_fullscreen etc..
    
    
    @@ -64,12 +70,10 @@
     // This has the modelist in Vid_vesa.
     static byte  mode_bitpp;  // bitpp of modelist
    
    -#if 0
     // unused
     //dosstuff -newly added
     static unsigned long dascreen;
     static int gfx_use_vesa1;
    -#endif
    
     #define SCREENDEPTH   1     // bytes per pixel, do NOT change.
    
    @@ -281,7 +285,7 @@
            __dpmi_int(0x10,&r);
    
            // Boris: my s3 don't do a cls because "win95" :<
    -       clrscr();
    +       //clrscr();
         }
         else  // no vesa put the normal video mode
         {
    @@ -447,9 +451,9 @@
     }
    
    
    -#if 0
     // See VID_Query_Modelist in Vid_vesa.c
    
    +#if 0
     //   request_drawmode : vid_drawmode_e
     //   request_fullscreen : true if want fullscreen modes
     //   request_bitpp : bits per pixel
    @@ -486,7 +490,7 @@
    
         return ( num_full_vidmodes > 0 );
     }
    -
    +#endif
    
     // for debuging
     void IO_Color( byte color, byte r, byte g, byte b )
    diff -iurNx '*.o' trunk/src/djgppdos/vid_vesa.c ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/vid_vesa.c
    --- trunk/src/djgppdos/vid_vesa.c   2023-08-24 12:15:57.671127580 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/vid_vesa.c   2023-08-23 00:01:26.491448579 +0100
    @@ -52,13 +52,14 @@
    
     #include "console.h"
     #include "command.h"            //added:21-03-98: vid_xxx commands
    +#include "v_video.h"
     #include "i_video.h"
    
    
     // PROTOS
     static vmode_t *VID_GetModePtr (modenum_t modenum);
    -int  VID_VesaGetModeInfo (int modenum, byte gmi_req_bitpp);
    -void VID_VesaGetExtraModes (void);
    +static int  VID_VesaGetModeInfo (int modenum, byte gmi_req_bitpp);
    +void VID_VesaGetExtraModes ( byte xm_req_bitpp );
     int  VID_VesaInitMode (viddef_t *lvid, vmode_t *currentmode_p);
    
     void VID_Command_NumModes_f (void);
    @@ -83,10 +84,10 @@
    
     //this is the only supported non-vesa mode : standard 320x200x256c.
     #define NUMVGAVIDMODES  1
    -int VGA_InitMode (viddef_t *lvid, vmode_t *currentmode_p);
    +static int VGA_InitMode (viddef_t *lvid, vmode_t *currentmode_p);
     static vmode_t      vgavidmodes[NUMVGAVIDMODES] = {
       { // 0 mode, HIDDEN
    -    & specialmodes[1],
    +    & vgavidmodes[1],
         "Initial",
         INITIAL_WINDOW_WIDTH, INITIAL_WINDOW_HEIGHT,
         INITIAL_WINDOW_WIDTH, 1,     // rowbytes, bytes per pixel
    @@ -189,11 +190,11 @@
     {
         // do not include Mode 0 (INITIAL) in count
         all_vidmodes = &vgavidmodes[0];
    -    num_all_vidmodes = NUMVGAMODES-1;
    +    num_all_vidmodes = NUMVGAVIDMODES-1;
         num_full_vidmodes = 0;
     }
    
    -static void append_full_vidmodes( vmode_t newmodes, int nummodes )
    +static void append_full_vidmodes( vmode_t * newmodes, int nummodes )
     {
         full_vidmodes = newmodes;
         vgavidmodes[NUMVGAVIDMODES-1].next = newmodes;
    @@ -243,7 +244,7 @@
         // INITIAL_WINDOW mode 0 is not included
         if(modetype == MODE_fullscreen)
         {   // fullscreen  2..
    -        mrange.first = NUMVGAMODES;
    +        mrange.first = NUMVGAVIDMODES;
             mrange.last = mrange.first + num_full_vidmodes;
         }
         else
    @@ -255,7 +256,7 @@
    
    
     //added:21-03-98: return info on video mode
    -char *VID_ModeInfo (int modenum, char **ppheader)
    +char *VID_ModeInfo (modenum_t modenum, char **ppheader)
     {
         static char *badmodestr = "Bad video mode number\n";
         vmode_t     *pv;
    @@ -285,29 +286,27 @@
         int mi = 1;
         int tdist = INT_MAX;
         int bestdist;
    -    vmode_t * best;
         vmode_t * pv = all_vidmodes;
    
         if( modetype == MODE_fullscreen )
         {
             if( num_full_vidmodes == 0 )  goto done;
    -        mi += NUMSPECIALMODES;  // fullscreen modes start after
    +        mi += NUMVGAVIDMODES;  // fullscreen modes start after
             pv = full_vidmodes;
         }
         for ( ; pv!=NULL; pv=pv->next )
         {
    -        tdist = abs(pv->width - rw) + abs(pv->height - rh);
    +        tdist = abs(pv->width - w) + abs(pv->height - h);
             // find closest dist
             if( bestdist > tdist )
             {
                 bestdist = tdist;
    -            best = i;
                 if( tdist == 0 )  break;   // found exact match
             }
             mi++;
         }
         modenum.index = mi;
    -    modenum.modetype = rmodetype;
    +    modenum.modetype = modetype;
    
     done:
         return modenum;
    @@ -320,10 +319,10 @@
     // only called once
     void VID_Init (void)
     {
    -    COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f);
    -    COM_AddCommand ("vid_modeinfo", VID_Command_ModeInfo_f);
    -    COM_AddCommand ("vid_modelist", VID_Command_ModeList_f);
    -    COM_AddCommand ("vid_mode", VID_Command_Mode_f);
    +    COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f, CC_info);
    +    COM_AddCommand ("vid_modeinfo", VID_Command_ModeInfo_f, CC_info);
    +    COM_AddCommand ("vid_modelist", VID_Command_ModeList_f, CC_info);
    +    COM_AddCommand ("vid_mode", VID_Command_Mode_f, CC_config);
     }
    
     // Get Fullscreen, VESA modes, append to VGA window modes
    @@ -369,7 +368,7 @@
         if ( modenum.modetype == MODE_fullscreen )
         {
             pv = full_vidmodes;
    -        mi = modenum.index - NUMSPECIALMODES;  // 2..
    +        mi = modenum.index - NUMVGAVIDMODES;  // 2..
         }
         if (!pv || mi < 0 )  goto fail;
    
    @@ -461,7 +460,7 @@
         vid.bytepp = currentmode_p->bytesperpixel;
         vid.bitpp = (vid.bytepp==1)? 8:15;
    
    -    stat = (*pcurrentmode->setmode_func) (&vid, pcurrentmode);
    +    stat = (*currentmode_p->setmode_func) (&vid, currentmode_p);
           // sets vid.direct, vid.buffer, vid.display, vid.ybytes, vid.screen_size, vid.screen1
         if (stat < 0)
         {
    @@ -485,7 +484,7 @@
             vid.height = oldvid.height;
             vid.bytepp = oldvid.bytepp;
             vid.bitpp = oldvid.bitpp;
    -        (*pcurrentmode->setmode_func) (&vid, pcurrentmode);
    +        (*currentmode_p->setmode_func) (&vid, currentmode_p);
             return FAIL_create;
         }
    
    @@ -654,9 +653,8 @@
     // append modes to modelist
     void VID_VesaGetExtraModes ( byte select_bitpp )
     {
    -    int             i;
    +    int             i, nummodes;
         unsigned long   addr;
    -    int             nummodes;
         __dpmi_meminfo  phys_mem_info;
         unsigned long   mode_ptr;
         __dpmi_regs     regs;
    @@ -987,14 +985,14 @@
     void VID_Command_ModeInfo_f (void)
     {
         vmode_t     *pv;
    -    int         modenum;
    +    modenum_t         modenum;
    
         if (COM_Argc()!=2)
             modenum = vid.modenum;          // describe the current mode
         else
    -        modenum = atoi (COM_Argv(1));   //    .. the given mode number
    +        modenum.index = atoi (COM_Argv(1));   //    .. the given mode number
    
    -    if (modenum >= VID_NumModes())
    +    if (modenum.index >= VID_NumModes())
         {
             CONS_Printf ("No such video mode\n");
             return;
    @@ -1021,6 +1019,7 @@
     void VID_Command_ModeList_f (void)
     {
         int         i, nummodes;
    +    modenum_t  mn;
         char        *pinfo, *pheader;
         vmode_t     *pv;
         boolean     na;
    @@ -1030,8 +1029,9 @@
         nummodes = VID_NumModes ();
         for (i=0 ; i<nummodes ; i++)
         {
    -        pv = VID_GetModePtr (i);
    -        pinfo = VID_ModeInfo (i, &pheader);
    +        mn.index = i;
    +        pv = VID_GetModePtr (mn);
    +        pinfo = VID_ModeInfo (mn, &pheader);
    
             if (i==0 || pv->bytesperpixel==1)
                 CONS_Printf ("%d: %s\n", i, pinfo);
    @@ -1046,7 +1046,7 @@
     //
     void VID_Command_Mode_f (void)
     {
    -    int         modenum;
    +    modenum_t modenum;
    
         if (COM_Argc()!=2)
         {
    @@ -1054,11 +1054,11 @@
             return;
         }
    
    -    modenum = atoi(COM_Argv(1));
    +    modenum.index = atoi(COM_Argv(1));
    
    -    if (modenum >= VID_NumModes())
    +    if (modenum.index >= VID_NumModes())
             CONS_Printf ("No such video mode\n");
         else
             // request vid mode change
    -        setmodeneeded = modenum+1;
    +        setmodeneeded = modenum;
     }
    diff -iurNx '*.o' trunk/src/djgppdos/vid_vesa.h ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/vid_vesa.h
    --- trunk/src/djgppdos/vid_vesa.h   2023-08-24 12:15:57.674460984 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/djgppdos/vid_vesa.h   2023-08-22 20:08:11.545108078 +0100
    @@ -127,6 +127,8 @@
     // add the VESA modes to the list
     int VID_GetModes ( byte request_drawmode, byte select_bitpp );
     // setup a video mode, this is to be called from the menu
    -int  VID_SetMode (int modenum);
    +int  VID_SetMode (modenum_t modenum);
    +
    +extern int num_full_vidmodes;
    
     #endif
    diff -iurNx '*.o' trunk/src/d_net.c ../../doomlegacy-svn/legacy_one/trunk/src/d_net.c
    --- trunk/src/d_net.c   2023-08-22 17:13:25.816407338 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/d_net.c   2023-08-23 15:38:24.321715034 +0100
    @@ -1579,7 +1579,8 @@
     #endif
    
     #ifdef DOSNET_SUPPORT
    -    doomcom->numplayers = num_player_slot;
    +// removed in rev1507
    +//    doomcom->numplayers = num_player_slot;
     #endif
    
         // Include any pending return_ack, player nodes only.
    diff -iurNx '*.o' trunk/src/doomtype.h ../../doomlegacy-svn/legacy_one/trunk/src/doomtype.h
    --- trunk/src/doomtype.h    2023-08-24 12:15:57.697794811 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/doomtype.h    2023-08-23 13:27:34.628911937 +0100
    @@ -180,9 +180,11 @@
     #define min(x,y) ( ((x)<(y)) ? (x) : (y) )
     #define max(x,y) ( ((x)>(y)) ? (x) : (y) )
    
    +#if !defined(__DJGPP__)
     int strupr(char *n);
     int strlwr(char *n);
     #endif
    +#endif
    
     #ifndef O_BINARY
     #define O_BINARY 0 // stupid windows text files
    diff -iurNx '*.o' trunk/src/g_game.c ../../doomlegacy-svn/legacy_one/trunk/src/g_game.c
    --- trunk/src/g_game.c  2023-08-22 17:12:58.839169491 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/g_game.c  2023-08-23 16:49:26.641925742 +0100
    @@ -1192,6 +1192,7 @@
           mouse2x = mouse2y = 0;
         }
    
    +#ifndef SMIF_PC_DOS
         // Finally the joysticks.
         for (i=0; i < num_joybindings; i++)
         {
    @@ -1224,7 +1225,7 @@
               break;
           }
         }
    -
    +#endif
    
         // Do not go faster than max. speed
         if (forward > MAXPLMOVE)
    diff -iurNx '*.o' trunk/src/g_input.c ../../doomlegacy-svn/legacy_one/trunk/src/g_input.c
    --- trunk/src/g_input.c 2023-08-22 17:13:25.819740742 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/g_input.c 2023-08-23 16:52:27.939096127 +0100
    @@ -782,6 +782,7 @@
     //! Magically converts a console command to a joystick axis binding. Also releases bindings.
     void Command_BindJoyaxis_f()
     {
    +#ifndef SMIF_PC_DOS
       joybinding_t j;
       unsigned int i;
       COM_args_t  carg;
    @@ -901,4 +902,8 @@
         else
           CONS_Printf("Maximum number of joystick bindings reached.\n");
       }
    +#else
    +  CONS_Printf("Joystick support disabled at build time.\n");
    +  return;
    +#endif
     }
    diff -iurNx '*.o' trunk/src/g_input.h ../../doomlegacy-svn/legacy_one/trunk/src/g_input.h
    --- trunk/src/g_input.h 2023-08-22 17:13:09.792734744 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/g_input.h 2023-08-23 13:31:16.883615833 +0100
    @@ -145,7 +145,7 @@
     # ifdef OS2
     #  define MOUSE2_DOS
     # endif
    -# ifdef DOS
    +# ifdef DJGPP
     #  define MOUSE2_DOS
     # endif
     # endif
    diff -iurNx '*.o' trunk/src/hardware/hw_cache.c ../../doomlegacy-svn/legacy_one/trunk/src/hardware/hw_cache.c
    --- trunk/src/hardware/hw_cache.c   2023-08-24 12:15:57.654460561 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/hardware/hw_cache.c   2023-08-22 18:05:32.719285910 +0100
    @@ -1386,7 +1386,7 @@
             {
                 srcindex = (posx+FRACUNIT/2)>>16; // rounded to int
                 switch (pic->mode) { // source bpp
    -                case PALETTE :
    +                case PALETTE_INDEX :
                         texel = src[srcindex];
                         switch( dest_bytepp ) { // destination bpp
                             case 1 :
    @@ -1469,7 +1469,7 @@
             grpatch->leftoffset = 0;
             grpatch->topoffset = 0;
    
    -        grpatch->mipmap.GR_format = ( pic->mode == PALETTE )?
    +        grpatch->mipmap.GR_format = ( pic->mode == PALETTE_INDEX )?
                 textureformat // can be set by driver
                 : picmode2GR[ pic->mode ];
    
    diff -iurNx '*.o' trunk/src/hu_stuff.c ../../doomlegacy-svn/legacy_one/trunk/src/hu_stuff.c
    --- trunk/src/hu_stuff.c    2023-08-22 17:13:25.883075417 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/hu_stuff.c    2023-08-23 16:40:47.687608986 +0100
    @@ -155,6 +155,10 @@
     #endif
     #endif
    
    +#ifdef SMIF_PC_DOS
    +byte shiftdown = 0;
    +byte altdown = 0;
    +#endif
    
     // -------
     // protos.
    @@ -503,6 +507,19 @@
     //
     boolean HU_Responder (event_t *ev)
     {
    +#ifdef SMIF_PC_DOS
    +    if (ev->data1 == KEY_LSHIFT || ev->data1 == KEY_RSHIFT)
    +    {
    +        shiftdown = (ev->type == ev_keydown);
    +        return false;
    +    }
    +    else if (ev->data1 == KEY_LALT || ev->data1 == KEY_RALT)
    +    {
    +        altdown = (ev->type == ev_keydown);
    +        return false;
    +    }
    +#endif
    +
       if (ev->type != ev_keydown)
         return false;
    
    diff -iurNx '*.o' trunk/src/hu_stuff.h ../../doomlegacy-svn/legacy_one/trunk/src/hu_stuff.h
    --- trunk/src/hu_stuff.h    2023-08-22 17:13:25.823074146 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/hu_stuff.h    2023-08-23 16:40:46.144242987 +0100
    @@ -122,4 +122,5 @@
     int  HU_Modify_FSPic(int handle, lumpnum_t lumpnum, int xpos, int ypos);
    
     int  HU_FS_Display(int handle, boolean enable_draw);
    +
     #endif
    diff -iurNx '*.o' trunk/src/i_joy.h ../../doomlegacy-svn/legacy_one/trunk/src/i_joy.h
    --- trunk/src/i_joy.h   2023-08-22 17:13:25.856408185 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/i_joy.h   2023-08-23 16:47:41.853041239 +0100
    @@ -59,8 +59,10 @@
     extern joybinding_t joybindings[MAX_JOYBINDINGS];
    
     void I_InitJoystick();
    +#ifndef SMIF_PC_DOS
     // Axes is plual of Axis
     int I_JoystickNumAxes(int joynum);
     int I_JoystickGetAxis(int joynum, int axisnum);
    +#endif 
    
     #endif // I_JOY_H
    diff -iurNx '*.o' trunk/src/i_net.h ../../doomlegacy-svn/legacy_one/trunk/src/i_net.h
    --- trunk/src/i_net.h   2023-08-22 17:13:25.826407551 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/i_net.h   2023-08-23 12:38:50.977034768 +0100
    @@ -98,7 +98,7 @@
         uint16_t            unused_deathmatch;
         // Flag: -1 = new game, 0-5 = load savegame
         int16_t             unused_savegame;
    -    int16_t             unused_episode;        // 1-3
    +    int16_t             episode;        // 1-3
         int16_t             unused_map;            // 1-9
         int16_t             unused_skill;          // 1-5
    
    @@ -115,7 +115,7 @@
         // 1 = left, 0 = center, -1 = right
         int16_t             unused_angleoffset;
         // 1 = drone
    -    uint16_t            unused_drone;
    +    uint16_t            drone;
     #endif
    
         // The packet data to be sent.
    diff -iurNx '*.o' trunk/src/Makefile ../../doomlegacy-svn/legacy_one/trunk/src/Makefile
    --- trunk/src/Makefile  2023-08-24 12:15:57.677794388 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/Makefile  2023-08-23 17:00:53.049786454 +0100
    @@ -1183,14 +1183,14 @@
     #  DEP_HARD:=1
    
     #use the x86 asm code
    -  #USEASM=1
    +  USEASM=1
    
     # options
       OPTS:=-DSMIF_PC_DOS
       OPTINC+=-g $(SRCINC)
    
     #  DEBUGLIBS:=
    -  LIBS:=-lalleg -lsocket
    +  LIBS:=-lalleg -lsocket -lm
       ifdef CDMUS
          LIBS+=-lbcd
       endif
    @@ -1309,7 +1309,7 @@
     endif
     endif
    
    -CFLAGS+=-ffast-math -fno-strict-aliasing
    +CFLAGS+=-march=pentium -fgnu89-inline -ffast-math -fno-strict-aliasing
     # WIN98 linking needs LCFLAGS without -D flags and does not need includes
     LCFLAGS:=$(CFLAGS)
     CFLAGS+=$(OPTS) $(OPTINC)
    @@ -1471,16 +1471,16 @@
        @echo Linking...
     ifdef DOSFILE
     # MinGW on WIN98: linking cannot handle $(OPTS), use $(LCFLAGS) instead of $(CFLAGS)
    -   $(CC) $(LCFLAGS) $(LDFLAGS) -o $(BIN)/$(EXENAME) \
    +   $(CC) -I. $(LCFLAGS) $(LDFLAGS) -o $(BIN)/$(EXENAME) \
        $(MAINOBJ) $(OBJS) \
        $(LIBS)
     else
     # Linux/BSD
     ifdef CC_EXE_LAST
    -   $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(MAINOBJ) \
    +   $(CC) -I. $(CFLAGS) $(LDFLAGS) $(OBJS) $(MAINOBJ) \
        $(LIBS) -o $(BIN)/$(EXENAME)
     else
    -   $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN)/$(EXENAME) \
    +   $(CC) -I. $(CFLAGS) $(LDFLAGS) -o $(BIN)/$(EXENAME) \
        $(MAINOBJ) $(OBJS) \
        $(LIBS)
     endif
    @@ -1501,13 +1501,13 @@
     # common obj rules
    
     $(O)/%.o: $(SD)%.c
    -   $(CC) $(CFLAGS) $(SND_DEVS) -c $< -o $@
    +   $(CC) -I. $(CFLAGS) $(SND_DEVS) -c $< -o $@
    
     $(O)/%.o: $(SD)$(INTERFACE)/%.c
    -   $(CC) $(CFLAGS) $(SND_DEVS) -c $< -o $@
    +   $(CC) -I. $(CFLAGS) $(SND_DEVS) -c $< -o $@
    
     $(O)/%.o: $(SD)hardware/%.c
    -   $(CC) $(CFLAGS) -c $< -o $@
    +   $(CC) -I. $(CFLAGS) -c $< -o $@
    
     ifeq ($(SMIF), OS2_NATIVE)
     # OS2 rules
    @@ -1520,12 +1520,12 @@
     # SDL
     # OpenGL rules
     $(O)/r_opengl.o: $(SD)hardware/r_opengl/r_opengl.c $(SD)hardware/r_opengl/r_opengl.h
    -   $(CC) $(CFLAGS) -c $< -o $@
    +   $(CC) -I. $(CFLAGS) -c $< -o $@
    
     ifdef MAC
     # Mac must have Objective-C main for SDL
     $(O)/SDLmain.o : $(SD)sdl/SDLmain.m
    -   $(CC) -x objective-c $(CFLAGS) $(FRAMEWORK) -c $< -o $@
    +   $(CC) -x objective-c -I. $(CFLAGS) $(FRAMEWORK) -c $< -o $@
     endif
    
     else
    @@ -1533,12 +1533,12 @@
     # OpenGL rules
     # LINUX_X11, FREEBSD_X11 at least
     $(O)/r_opengl.o: $(SD)hardware/r_opengl/r_opengl.c $(SD)hardware/r_opengl/r_opengl.h
    -   $(CC) $(CFLAGS) -shared -nostartfiles -c $< -o $@
    +   $(CC) -I. $(CFLAGS) -shared -nostartfiles -c $< -o $@
     endif
    
    
     $(O)/ogl_x11.o:  $(SD)hardware/r_opengl/ogl_x11.c $(SD)hardware/r_opengl/r_opengl.h
    -   $(CC) $(CFLAGS) -shared -nostartfiles -I/usr/X11R6/include -c $< -o $@ 
    +   $(CC) -I. $(CFLAGS) -shared -nostartfiles -I/usr/X11R6/include -c $< -o $@ 
    
    
     ifdef USEASM
    @@ -1669,14 +1669,14 @@
       ifeq ($(CC_SELECT), MINGW)
        @echo "Making MINGW dependencies $(@F)"
        ifdef HAVE_DOSCOMMAND
    -   $(CC) $(CFLAGS) -MM $^ > $(DD_WIN)\$(@F)
    +   $(CC) -I. $(CFLAGS) -MM $^ > $(DD_WIN)\$(@F)
        else
    -   $(CC) $(CFLAGS) -MM $^ > $(DD)/$(@F)
    +   $(CC) -I. $(CFLAGS) -MM $^ > $(DD)/$(@F)
        endif
        $(FIXDEP)  $(O)/  $(DD_WIN)\$(@F)
       else
        @echo "Making WIN dependencies $(@F)"
    -   $(CC) $(CFLAGS) -MM $^ > $(DD_WIN)\$(@F)
    +   $(CC) -I. $(CFLAGS) -MM $^ > $(DD_WIN)\$(@F)
        $(FIXDEP)  $(O_WIN)\  $(DD_WIN)\$(@F)
       endif
    
    @@ -1685,7 +1685,7 @@
    
     %.dep :
        @echo "Making dependencies $(@F)"
    -   $(CC) $(CFLAGS) $(SND_DEVS) -MM $^ > $(DD)/$(@F)
    +   $(CC) -I. $(CFLAGS) $(SND_DEVS) -MM $^ > $(DD)/$(@F)
        sed -e "s!^[a-zA-Z0-9_]*\.o:!\$$\(O)/&!" $(DD)/$(@F) > $(DD)/sed.dep
        mv $(DD)/sed.dep $(DD)/$(@F)
    
    @@ -1707,7 +1707,9 @@
     include $(DD)/main_m.dep
     include $(DD)/main_r.dep
     include $(DD)/main_t.dep
    +ifdef DEP_HARD
     include $(DD)/hard1.dep
    +endif
     ifdef INTERFACE
      include $(DD)/$(INTERFACE).dep
     endif
    diff -iurNx '*.o' trunk/src/r_data.c ../../doomlegacy-svn/legacy_one/trunk/src/r_data.c
    --- trunk/src/r_data.c  2023-08-24 12:15:57.664460773 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/r_data.c  2023-08-22 18:05:44.589537239 +0100
    @@ -603,7 +603,7 @@
                 RGBA_t p;
                 switch( picmode )
                 {
    -             case PALETTE:
    +             case PALETTE_INDEX:
                    p = pLocalPalette[w[0]];
                    p.s.alpha = 0;
                    break;
    diff -iurNx '*.o' trunk/src/r_defs.h ../../doomlegacy-svn/legacy_one/trunk/src/r_defs.h
    --- trunk/src/r_defs.h  2023-08-24 12:15:57.691128004 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/r_defs.h  2023-08-22 18:03:19.483131305 +0100
    @@ -997,7 +997,7 @@
     //=========
     // This is the Doom PIC format (not the Pictor PIC format).
     typedef enum {
    -    PALETTE         = 0,  // 1 byte is the index in the doom palette (as usual)
    +    PALETTE_INDEX   = 0,  // 1 byte is the index in the doom palette (as usual)
         INTENSITY       = 1,  // 1 byte intensity
         INTENSITY_ALPHA = 2,  // 2 byte : alpha then intensity
         RGB24           = 3,  // 24 bit rgb
    diff -iurNx '*.o' trunk/src/screen.c ../../doomlegacy-svn/legacy_one/trunk/src/screen.c
    --- trunk/src/screen.c  2023-08-24 12:15:57.694461408 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/screen.c  2023-08-22 17:26:08.782563124 +0100
    @@ -68,8 +68,9 @@
     #include "hu_stuff.h"
     #include "z_zone.h"
     //#include "d_main.h"
    +#ifndef __DJGPP__
     #include "hardware/hw_main.h"
    -
    +#endif
    
    
    
    diff -iurNx '*.o' trunk/src/tables.c ../../doomlegacy-svn/legacy_one/trunk/src/tables.c
    --- trunk/src/tables.c  2023-08-22 17:13:25.849741378 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/tables.c  2023-08-23 15:03:51.131169596 +0100
    @@ -122,7 +122,7 @@
     // fixed_t              finetangent[FINEANGLES/2];
    
    
    -const int finetangent[4096] =
    +const fixed_t finetangent[4096] =
     {
         -170910304,-56965752,-34178904,-24413316,-18988036,-15535599,-13145455,-11392683,
         -10052327,-8994149,-8137527,-7429880,-6835455,-6329090,-5892567,-5512368,
    @@ -639,7 +639,7 @@
     };
    
    
    -const int finesine[10240] =
    +const fixed_t finesine[10240] =
     {
         25,75,125,175,226,276,326,376,
         427,477,527,578,628,678,728,779,
    diff -iurNx '*.o' trunk/src/v_video.c ../../doomlegacy-svn/legacy_one/trunk/src/v_video.c
    --- trunk/src/v_video.c 2023-08-22 17:13:25.883075417 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/v_video.c 2023-08-23 13:10:29.190542610 +0100
    @@ -281,6 +281,7 @@
     static
     byte drawmode_to_bpp[] = {0,8,15,16,24,32, 99,99,99,99,99,99,99};
    
    +#ifndef SMIF_PC_DOS
     // indexed by vid_drawmode_e
     static
     byte drawmode_to_rendermode[] = {
    @@ -297,6 +298,7 @@
        render_glide,  // Glide
        render_d3d,    // D3D
     };
    +#endif
    
     #if 0
     // Indexed by rendermode_e
    @@ -3414,10 +3416,10 @@
    
             return;
         }
    -#endif
    
         // Software draw only.
         EN_HWR_flashpalette = 0;  // software and default
    +#endif
    
         if( vid.display == NULL )
         {
    diff -iurNx '*.o' trunk/src/w_wad.c ../../doomlegacy-svn/legacy_one/trunk/src/w_wad.c
    --- trunk/src/w_wad.c   2023-08-24 12:15:57.684461196 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/src/w_wad.c   2023-08-23 15:09:37.971843745 +0100
    @@ -1174,9 +1174,9 @@
     // Called from many draw functions
     void* W_CachePatchNum ( lumpnum_t lumpnum, int ztag )
     {
    +#ifdef HWRENDER
         MipPatch_t*   grPatch;
    
    -#ifdef HWRENDER
         if( ! HWR_patchstore ) {
             return W_CachePatchNum_Endian ( lumpnum, ztag );
         }
    @@ -1207,7 +1207,7 @@
         return (void*)grPatch;
     #else
         // Software renderer only, simplified
    -    return W_CachePatchNum_Endian( lump, ztag );
    +    return W_CachePatchNum_Endian( lumpnum, ztag );
     #endif
     }
    
    @@ -1321,7 +1321,7 @@
             // set pic info from caller parameters, (which are literals)
             pic->width = width;
             pic->height = height;
    -        pic->mode = PALETTE;
    +        pic->mode = PALETTE_INDEX;
         }
         else
         {
    diff -iurNx '*.o' trunk/tools/Makefile ../../doomlegacy-svn/legacy_one/trunk/tools/Makefile
    --- trunk/tools/Makefile    2023-08-24 12:15:57.707795024 +0100
    +++ ../../doomlegacy-svn/legacy_one/trunk/tools/Makefile    2023-08-22 17:16:32.457026082 +0100
    @@ -75,45 +75,45 @@
    
     dircomp2 : $(BIN)/dircomp2$(EXE)
     $(BIN)/dircomp2$(EXE):  dircomp2.c
    -   $(CC) $(CFLAGS) -s dircomp2.c -o $(BIN)/dircomp2$(EXE)
    +   $(HOSTCC) $(HOSTCFLAGS) -s dircomp2.c -o $(BIN)/dircomp2$(EXE)
    
     asm:
    -   $(CC) $(CFLAGS) -g dircomp2.c -o $(BIN)tmp$(EXE)
    +   $(HOSTCC) $(HOSTCFLAGS) -g dircomp2.c -o $(BIN)tmp$(EXE)
        objdump  -dS $(BIN)tmp$(EXE) --debugging --no-show-raw-insn > $(BIN)/dircomp2.s
        $(RM) $(BIN)tmp$(EXE)
    
    
     h2d : $(BIN)/h2d$(EXE)
     $(BIN)/h2d$(EXE):   h2d.c
    -   $(CC) $(CFLAGS) -s h2d.c -o $(BIN)/h2d$(EXE)
    +   $(HOSTCC) $(HOSTCFLAGS) -s h2d.c -o $(BIN)/h2d$(EXE)
    
     dckconv : $(BIN)/dckconv$(EXE)
     $(BIN)/dckconv$(EXE):    dckconv.c
    -   $(CC) $(CFLAGS) -s dckconv.c -o $(BIN)/dckconv$(EXE)
    +   $(HOSTCC) $(HOSTCFLAGS) -s dckconv.c -o $(BIN)/dckconv$(EXE)
    
     dckconv2 : $(BIN)/dckconv2$(EXE)
     $(BIN)/dckconv2$(EXE):   dckconv2.c
    -   $(CC) $(CFLAGS) -s dckconv2.c -o $(BIN)/dckconv2$(EXE)
    +   $(HOSTCC) $(HOSTCFLAGS) -s dckconv2.c -o $(BIN)/dckconv2$(EXE)
    
     dckcomp : $(BIN)/dckcomp$(EXE)
     $(BIN)/dckcomp$(EXE):    dckcomp.c
    -   $(CC) $(CFLAGS) -s dckcomp.c -o $(BIN)/dckcomp$(EXE)
    +   $(HOSTCC) $(HOSTCFLAGS) -s dckcomp.c -o $(BIN)/dckcomp$(EXE)
    
     convert : $(BIN)/convert$(EXE)
     $(BIN)/convert$(EXE):    convert.c
    -   $(CC) $(CFLAGS) -s convert.c -o $(BIN)/convert$(EXE)
    +   $(HOSTCC) $(HOSTCFLAGS) -s convert.c -o $(BIN)/convert$(EXE)
    
     fixdep : $(BIN)/fixdep$(EXE)
     $(BIN)/fixdep$(EXE):    $(O)/fixdep.o
    -   $(CC) $(LDFLAGS) $^ -o $(BIN)/fixdep$(EXE)
    +   $(HOSTCC) $(HOSTLDFLAGS) $^ -o $(BIN)/fixdep$(EXE)
    
     $(O)/%.o : %.c
    -   $(CC) $(CFLAGS) -c $< -o $@
    +   $(HOSTCC) $(HOSTCFLAGS) -c $< -o $@
    
     $(O)/%.o : %.cc
    -   $(CXX) $(CXXFLAGS) -c $< -o $@
    +   $(HOSTCXX) $(HOSTCXXFLAGS) -c $< -o $@
    
     wadtool : $(BIN)/wadtool$(EXE)
     $(BIN)/wadtool$(EXE): $(O)/wadtool.o
        @echo Linking...
    -   $(CXX) $(LDFLAGS) $^ -o $@
    +   $(HOSTCXX) $(HOSTLDFLAGS) $^ -o $@
    
     
  • Wesley Johnson

    Wesley Johnson - 2023-08-26

    Thank you for the work. I see many things that I changed in the base code, and see that I missed updating the DJGPP port a number of times.

    Changes to the makefile are not going to go smoothly.
    Is that HOSTCC variable supported on DJGPP, gcc, vc, and all the other compilers, for the last 10 years. I have not seen it before.

    That you need to introduce "-I ." is suspicious, as I thought that it was already covered in one of the other compile flags. It certainly compiles under gcc and DJGPP on my systems.

    Some of these will have to be conditional on the version of DJGPP, as the older versions may still be needed for other systems.

    On something this large and hitting on so many issues, I will be making appropriate patches by hand, and on some issues after investigating what has gone wrong and if something else needs fixing instead.

    Also, there is also WATCOM as a possible compiler.
    I don't think it is limited to just DJGPP anymore.

     

    Last edit: Wesley Johnson 2023-08-26
  • Wesley Johnson

    Wesley Johnson - 2023-08-27

    Attached are my planned patches to the code base.
    They will be applied to SVN soon, unless you or I find an error in them.
    You should use these as soon as possible.

     

    Last edit: Wesley Johnson 2023-08-27

Log in to post a comment.