diff --git a/README.TXT b/README.TXT index 173cccd..5e0ecaa 100644 --- a/README.TXT +++ b/README.TXT @@ -1,18 +1,11 @@ ================ -= fbDOOM = += doomgeneric = ================ -Adaptation of the original DOOM -to be easily portable to framebuffer devices with minimal depenencies. -Runs on: -* Plain desktop Linux framebuffer, -* Siglent SSA 3021X Spectrum Analyzer, -* Frosted OS - -To build (example): -* cd fbdoom -* make CROSS_COMPILE=arm-linux-gnueabihf- - +To port DOOM easly, I made some changes to source code. +Now, all you need to do is implement the functions in doomgeneric.h to port DOOM to a new system. +doomgeneric_win.c is a Windows GDI port. It is also a good example for how to port doomgeneric. +Sound is not supported for now. Original readme =============== diff --git a/fbdoom/Makefile b/doomgeneric/Makefile similarity index 100% rename from fbdoom/Makefile rename to doomgeneric/Makefile diff --git a/fbdoom/am_map.c b/doomgeneric/am_map.c similarity index 100% rename from fbdoom/am_map.c rename to doomgeneric/am_map.c diff --git a/fbdoom/am_map.h b/doomgeneric/am_map.h similarity index 100% rename from fbdoom/am_map.h rename to doomgeneric/am_map.h diff --git a/fbdoom/config.h b/doomgeneric/config.h similarity index 100% rename from fbdoom/config.h rename to doomgeneric/config.h diff --git a/fbdoom/d_englsh.h b/doomgeneric/d_englsh.h similarity index 100% rename from fbdoom/d_englsh.h rename to doomgeneric/d_englsh.h diff --git a/fbdoom/d_event.c b/doomgeneric/d_event.c similarity index 100% rename from fbdoom/d_event.c rename to doomgeneric/d_event.c diff --git a/fbdoom/d_event.h b/doomgeneric/d_event.h similarity index 100% rename from fbdoom/d_event.h rename to doomgeneric/d_event.h diff --git a/fbdoom/d_items.c b/doomgeneric/d_items.c similarity index 100% rename from fbdoom/d_items.c rename to doomgeneric/d_items.c diff --git a/fbdoom/d_items.h b/doomgeneric/d_items.h similarity index 100% rename from fbdoom/d_items.h rename to doomgeneric/d_items.h diff --git a/fbdoom/d_iwad.c b/doomgeneric/d_iwad.c similarity index 100% rename from fbdoom/d_iwad.c rename to doomgeneric/d_iwad.c diff --git a/fbdoom/d_iwad.h b/doomgeneric/d_iwad.h similarity index 100% rename from fbdoom/d_iwad.h rename to doomgeneric/d_iwad.h diff --git a/fbdoom/d_loop.c b/doomgeneric/d_loop.c similarity index 100% rename from fbdoom/d_loop.c rename to doomgeneric/d_loop.c diff --git a/fbdoom/d_loop.h b/doomgeneric/d_loop.h similarity index 100% rename from fbdoom/d_loop.h rename to doomgeneric/d_loop.h diff --git a/fbdoom/d_main.c b/doomgeneric/d_main.c similarity index 100% rename from fbdoom/d_main.c rename to doomgeneric/d_main.c diff --git a/fbdoom/d_main.h b/doomgeneric/d_main.h similarity index 100% rename from fbdoom/d_main.h rename to doomgeneric/d_main.h diff --git a/fbdoom/d_mode.c b/doomgeneric/d_mode.c similarity index 100% rename from fbdoom/d_mode.c rename to doomgeneric/d_mode.c diff --git a/fbdoom/d_mode.h b/doomgeneric/d_mode.h similarity index 100% rename from fbdoom/d_mode.h rename to doomgeneric/d_mode.h diff --git a/fbdoom/d_net.c b/doomgeneric/d_net.c similarity index 100% rename from fbdoom/d_net.c rename to doomgeneric/d_net.c diff --git a/fbdoom/d_player.h b/doomgeneric/d_player.h similarity index 100% rename from fbdoom/d_player.h rename to doomgeneric/d_player.h diff --git a/fbdoom/d_textur.h b/doomgeneric/d_textur.h similarity index 100% rename from fbdoom/d_textur.h rename to doomgeneric/d_textur.h diff --git a/fbdoom/d_think.h b/doomgeneric/d_think.h similarity index 100% rename from fbdoom/d_think.h rename to doomgeneric/d_think.h diff --git a/fbdoom/d_ticcmd.h b/doomgeneric/d_ticcmd.h similarity index 100% rename from fbdoom/d_ticcmd.h rename to doomgeneric/d_ticcmd.h diff --git a/fbdoom/deh_main.h b/doomgeneric/deh_main.h similarity index 100% rename from fbdoom/deh_main.h rename to doomgeneric/deh_main.h diff --git a/fbdoom/deh_misc.h b/doomgeneric/deh_misc.h similarity index 100% rename from fbdoom/deh_misc.h rename to doomgeneric/deh_misc.h diff --git a/fbdoom/deh_str.h b/doomgeneric/deh_str.h similarity index 100% rename from fbdoom/deh_str.h rename to doomgeneric/deh_str.h diff --git a/fbdoom/doom.h b/doomgeneric/doom.h similarity index 100% rename from fbdoom/doom.h rename to doomgeneric/doom.h diff --git a/fbdoom/doomdata.h b/doomgeneric/doomdata.h similarity index 100% rename from fbdoom/doomdata.h rename to doomgeneric/doomdata.h diff --git a/fbdoom/doomdef.c b/doomgeneric/doomdef.c similarity index 100% rename from fbdoom/doomdef.c rename to doomgeneric/doomdef.c diff --git a/fbdoom/doomdef.h b/doomgeneric/doomdef.h similarity index 100% rename from fbdoom/doomdef.h rename to doomgeneric/doomdef.h diff --git a/fbdoom/doomfeatures.h b/doomgeneric/doomfeatures.h similarity index 100% rename from fbdoom/doomfeatures.h rename to doomgeneric/doomfeatures.h diff --git a/fbdoom/doomkeys.h b/doomgeneric/doomkeys.h similarity index 100% rename from fbdoom/doomkeys.h rename to doomgeneric/doomkeys.h diff --git a/fbdoom/doomstat.c b/doomgeneric/doomstat.c similarity index 100% rename from fbdoom/doomstat.c rename to doomgeneric/doomstat.c diff --git a/fbdoom/doomstat.h b/doomgeneric/doomstat.h similarity index 100% rename from fbdoom/doomstat.h rename to doomgeneric/doomstat.h diff --git a/fbdoom/doomtype.h b/doomgeneric/doomtype.h similarity index 100% rename from fbdoom/doomtype.h rename to doomgeneric/doomtype.h diff --git a/fbdoom/dstrings.c b/doomgeneric/dstrings.c similarity index 100% rename from fbdoom/dstrings.c rename to doomgeneric/dstrings.c diff --git a/fbdoom/dstrings.h b/doomgeneric/dstrings.h similarity index 100% rename from fbdoom/dstrings.h rename to doomgeneric/dstrings.h diff --git a/fbdoom/dummy.c b/doomgeneric/dummy.c similarity index 100% rename from fbdoom/dummy.c rename to doomgeneric/dummy.c diff --git a/fbdoom/f_finale.c b/doomgeneric/f_finale.c similarity index 100% rename from fbdoom/f_finale.c rename to doomgeneric/f_finale.c diff --git a/fbdoom/f_finale.h b/doomgeneric/f_finale.h similarity index 100% rename from fbdoom/f_finale.h rename to doomgeneric/f_finale.h diff --git a/fbdoom/f_wipe.c b/doomgeneric/f_wipe.c similarity index 100% rename from fbdoom/f_wipe.c rename to doomgeneric/f_wipe.c diff --git a/fbdoom/f_wipe.h b/doomgeneric/f_wipe.h similarity index 100% rename from fbdoom/f_wipe.h rename to doomgeneric/f_wipe.h diff --git a/fbdoom/g_game.c b/doomgeneric/g_game.c similarity index 100% rename from fbdoom/g_game.c rename to doomgeneric/g_game.c diff --git a/fbdoom/g_game.h b/doomgeneric/g_game.h similarity index 100% rename from fbdoom/g_game.h rename to doomgeneric/g_game.h diff --git a/fbdoom/gusconf.c b/doomgeneric/gusconf.c similarity index 100% rename from fbdoom/gusconf.c rename to doomgeneric/gusconf.c diff --git a/fbdoom/gusconf.h b/doomgeneric/gusconf.h similarity index 100% rename from fbdoom/gusconf.h rename to doomgeneric/gusconf.h diff --git a/fbdoom/hu_lib.c b/doomgeneric/hu_lib.c similarity index 100% rename from fbdoom/hu_lib.c rename to doomgeneric/hu_lib.c diff --git a/fbdoom/hu_lib.h b/doomgeneric/hu_lib.h similarity index 100% rename from fbdoom/hu_lib.h rename to doomgeneric/hu_lib.h diff --git a/fbdoom/hu_stuff.c b/doomgeneric/hu_stuff.c similarity index 100% rename from fbdoom/hu_stuff.c rename to doomgeneric/hu_stuff.c diff --git a/fbdoom/hu_stuff.h b/doomgeneric/hu_stuff.h similarity index 100% rename from fbdoom/hu_stuff.h rename to doomgeneric/hu_stuff.h diff --git a/fbdoom/i_cdmus.c b/doomgeneric/i_cdmus.c similarity index 100% rename from fbdoom/i_cdmus.c rename to doomgeneric/i_cdmus.c diff --git a/fbdoom/i_cdmus.h b/doomgeneric/i_cdmus.h similarity index 100% rename from fbdoom/i_cdmus.h rename to doomgeneric/i_cdmus.h diff --git a/fbdoom/i_endoom.c b/doomgeneric/i_endoom.c similarity index 100% rename from fbdoom/i_endoom.c rename to doomgeneric/i_endoom.c diff --git a/fbdoom/i_endoom.h b/doomgeneric/i_endoom.h similarity index 100% rename from fbdoom/i_endoom.h rename to doomgeneric/i_endoom.h diff --git a/fbdoom/i_input_sdl.c b/doomgeneric/i_input_sdl.c similarity index 100% rename from fbdoom/i_input_sdl.c rename to doomgeneric/i_input_sdl.c diff --git a/fbdoom/i_input_tty.c b/doomgeneric/i_input_tty.c similarity index 100% rename from fbdoom/i_input_tty.c rename to doomgeneric/i_input_tty.c diff --git a/fbdoom/i_joystick.c b/doomgeneric/i_joystick.c similarity index 100% rename from fbdoom/i_joystick.c rename to doomgeneric/i_joystick.c diff --git a/fbdoom/i_joystick.h b/doomgeneric/i_joystick.h similarity index 100% rename from fbdoom/i_joystick.h rename to doomgeneric/i_joystick.h diff --git a/fbdoom/i_main.c b/doomgeneric/i_main.c similarity index 100% rename from fbdoom/i_main.c rename to doomgeneric/i_main.c diff --git a/fbdoom/i_oplmusic.c b/doomgeneric/i_oplmusic.c similarity index 100% rename from fbdoom/i_oplmusic.c rename to doomgeneric/i_oplmusic.c diff --git a/fbdoom/i_pcsound.c b/doomgeneric/i_pcsound.c similarity index 100% rename from fbdoom/i_pcsound.c rename to doomgeneric/i_pcsound.c diff --git a/fbdoom/i_scale.c b/doomgeneric/i_scale.c similarity index 100% rename from fbdoom/i_scale.c rename to doomgeneric/i_scale.c diff --git a/fbdoom/i_scale.h b/doomgeneric/i_scale.h similarity index 100% rename from fbdoom/i_scale.h rename to doomgeneric/i_scale.h diff --git a/fbdoom/i_sdlmusic.c b/doomgeneric/i_sdlmusic.c similarity index 100% rename from fbdoom/i_sdlmusic.c rename to doomgeneric/i_sdlmusic.c diff --git a/fbdoom/i_sdlsound.c b/doomgeneric/i_sdlsound.c similarity index 100% rename from fbdoom/i_sdlsound.c rename to doomgeneric/i_sdlsound.c diff --git a/fbdoom/i_sound.c b/doomgeneric/i_sound.c similarity index 100% rename from fbdoom/i_sound.c rename to doomgeneric/i_sound.c diff --git a/fbdoom/i_sound.h b/doomgeneric/i_sound.h similarity index 100% rename from fbdoom/i_sound.h rename to doomgeneric/i_sound.h diff --git a/fbdoom/i_sound_dummy.c b/doomgeneric/i_sound_dummy.c similarity index 100% rename from fbdoom/i_sound_dummy.c rename to doomgeneric/i_sound_dummy.c diff --git a/fbdoom/i_swap.h b/doomgeneric/i_swap.h similarity index 100% rename from fbdoom/i_swap.h rename to doomgeneric/i_swap.h diff --git a/fbdoom/i_system.c b/doomgeneric/i_system.c similarity index 100% rename from fbdoom/i_system.c rename to doomgeneric/i_system.c diff --git a/fbdoom/i_system.h b/doomgeneric/i_system.h similarity index 100% rename from fbdoom/i_system.h rename to doomgeneric/i_system.h diff --git a/fbdoom/i_timer.c b/doomgeneric/i_timer.c similarity index 100% rename from fbdoom/i_timer.c rename to doomgeneric/i_timer.c diff --git a/fbdoom/i_timer.h b/doomgeneric/i_timer.h similarity index 100% rename from fbdoom/i_timer.h rename to doomgeneric/i_timer.h diff --git a/fbdoom/i_video.c b/doomgeneric/i_video.c similarity index 100% rename from fbdoom/i_video.c rename to doomgeneric/i_video.c diff --git a/fbdoom/i_video.h b/doomgeneric/i_video.h similarity index 100% rename from fbdoom/i_video.h rename to doomgeneric/i_video.h diff --git a/fbdoom/i_video_fbdev.c b/doomgeneric/i_video_fbdev.c similarity index 100% rename from fbdoom/i_video_fbdev.c rename to doomgeneric/i_video_fbdev.c diff --git a/fbdoom/icon.c b/doomgeneric/icon.c similarity index 100% rename from fbdoom/icon.c rename to doomgeneric/icon.c diff --git a/fbdoom/info.c b/doomgeneric/info.c similarity index 100% rename from fbdoom/info.c rename to doomgeneric/info.c diff --git a/fbdoom/info.h b/doomgeneric/info.h similarity index 100% rename from fbdoom/info.h rename to doomgeneric/info.h diff --git a/fbdoom/m_argv.c b/doomgeneric/m_argv.c similarity index 100% rename from fbdoom/m_argv.c rename to doomgeneric/m_argv.c diff --git a/fbdoom/m_argv.h b/doomgeneric/m_argv.h similarity index 100% rename from fbdoom/m_argv.h rename to doomgeneric/m_argv.h diff --git a/fbdoom/m_bbox.c b/doomgeneric/m_bbox.c similarity index 100% rename from fbdoom/m_bbox.c rename to doomgeneric/m_bbox.c diff --git a/fbdoom/m_bbox.h b/doomgeneric/m_bbox.h similarity index 100% rename from fbdoom/m_bbox.h rename to doomgeneric/m_bbox.h diff --git a/fbdoom/m_cheat.c b/doomgeneric/m_cheat.c similarity index 100% rename from fbdoom/m_cheat.c rename to doomgeneric/m_cheat.c diff --git a/fbdoom/m_cheat.h b/doomgeneric/m_cheat.h similarity index 100% rename from fbdoom/m_cheat.h rename to doomgeneric/m_cheat.h diff --git a/fbdoom/m_config.c b/doomgeneric/m_config.c similarity index 100% rename from fbdoom/m_config.c rename to doomgeneric/m_config.c diff --git a/fbdoom/m_config.h b/doomgeneric/m_config.h similarity index 100% rename from fbdoom/m_config.h rename to doomgeneric/m_config.h diff --git a/fbdoom/m_controls.c b/doomgeneric/m_controls.c similarity index 100% rename from fbdoom/m_controls.c rename to doomgeneric/m_controls.c diff --git a/fbdoom/m_controls.h b/doomgeneric/m_controls.h similarity index 100% rename from fbdoom/m_controls.h rename to doomgeneric/m_controls.h diff --git a/fbdoom/m_fixed.c b/doomgeneric/m_fixed.c similarity index 100% rename from fbdoom/m_fixed.c rename to doomgeneric/m_fixed.c diff --git a/fbdoom/m_fixed.h b/doomgeneric/m_fixed.h similarity index 100% rename from fbdoom/m_fixed.h rename to doomgeneric/m_fixed.h diff --git a/fbdoom/m_menu.c b/doomgeneric/m_menu.c similarity index 100% rename from fbdoom/m_menu.c rename to doomgeneric/m_menu.c diff --git a/fbdoom/m_menu.h b/doomgeneric/m_menu.h similarity index 100% rename from fbdoom/m_menu.h rename to doomgeneric/m_menu.h diff --git a/fbdoom/m_misc.c b/doomgeneric/m_misc.c similarity index 100% rename from fbdoom/m_misc.c rename to doomgeneric/m_misc.c diff --git a/fbdoom/m_misc.h b/doomgeneric/m_misc.h similarity index 100% rename from fbdoom/m_misc.h rename to doomgeneric/m_misc.h diff --git a/fbdoom/m_random.c b/doomgeneric/m_random.c similarity index 100% rename from fbdoom/m_random.c rename to doomgeneric/m_random.c diff --git a/fbdoom/m_random.h b/doomgeneric/m_random.h similarity index 100% rename from fbdoom/m_random.h rename to doomgeneric/m_random.h diff --git a/fbdoom/memio.c b/doomgeneric/memio.c similarity index 100% rename from fbdoom/memio.c rename to doomgeneric/memio.c diff --git a/fbdoom/memio.h b/doomgeneric/memio.h similarity index 100% rename from fbdoom/memio.h rename to doomgeneric/memio.h diff --git a/fbdoom/net_client.h b/doomgeneric/net_client.h similarity index 100% rename from fbdoom/net_client.h rename to doomgeneric/net_client.h diff --git a/fbdoom/net_dedicated.h b/doomgeneric/net_dedicated.h similarity index 100% rename from fbdoom/net_dedicated.h rename to doomgeneric/net_dedicated.h diff --git a/fbdoom/net_defs.h b/doomgeneric/net_defs.h similarity index 100% rename from fbdoom/net_defs.h rename to doomgeneric/net_defs.h diff --git a/fbdoom/net_gui.h b/doomgeneric/net_gui.h similarity index 100% rename from fbdoom/net_gui.h rename to doomgeneric/net_gui.h diff --git a/fbdoom/net_io.h b/doomgeneric/net_io.h similarity index 100% rename from fbdoom/net_io.h rename to doomgeneric/net_io.h diff --git a/fbdoom/net_loop.h b/doomgeneric/net_loop.h similarity index 100% rename from fbdoom/net_loop.h rename to doomgeneric/net_loop.h diff --git a/fbdoom/net_packet.h b/doomgeneric/net_packet.h similarity index 100% rename from fbdoom/net_packet.h rename to doomgeneric/net_packet.h diff --git a/fbdoom/net_query.h b/doomgeneric/net_query.h similarity index 100% rename from fbdoom/net_query.h rename to doomgeneric/net_query.h diff --git a/fbdoom/net_sdl.h b/doomgeneric/net_sdl.h similarity index 100% rename from fbdoom/net_sdl.h rename to doomgeneric/net_sdl.h diff --git a/fbdoom/net_server.h b/doomgeneric/net_server.h similarity index 100% rename from fbdoom/net_server.h rename to doomgeneric/net_server.h diff --git a/fbdoom/p_ceilng.c b/doomgeneric/p_ceilng.c similarity index 100% rename from fbdoom/p_ceilng.c rename to doomgeneric/p_ceilng.c diff --git a/fbdoom/p_doors.c b/doomgeneric/p_doors.c similarity index 100% rename from fbdoom/p_doors.c rename to doomgeneric/p_doors.c diff --git a/fbdoom/p_enemy.c b/doomgeneric/p_enemy.c similarity index 100% rename from fbdoom/p_enemy.c rename to doomgeneric/p_enemy.c diff --git a/fbdoom/p_floor.c b/doomgeneric/p_floor.c similarity index 100% rename from fbdoom/p_floor.c rename to doomgeneric/p_floor.c diff --git a/fbdoom/p_inter.c b/doomgeneric/p_inter.c similarity index 100% rename from fbdoom/p_inter.c rename to doomgeneric/p_inter.c diff --git a/fbdoom/p_inter.h b/doomgeneric/p_inter.h similarity index 100% rename from fbdoom/p_inter.h rename to doomgeneric/p_inter.h diff --git a/fbdoom/p_lights.c b/doomgeneric/p_lights.c similarity index 100% rename from fbdoom/p_lights.c rename to doomgeneric/p_lights.c diff --git a/fbdoom/p_local.h b/doomgeneric/p_local.h similarity index 100% rename from fbdoom/p_local.h rename to doomgeneric/p_local.h diff --git a/fbdoom/p_map.c b/doomgeneric/p_map.c similarity index 100% rename from fbdoom/p_map.c rename to doomgeneric/p_map.c diff --git a/fbdoom/p_maputl.c b/doomgeneric/p_maputl.c similarity index 100% rename from fbdoom/p_maputl.c rename to doomgeneric/p_maputl.c diff --git a/fbdoom/p_mobj.c b/doomgeneric/p_mobj.c similarity index 100% rename from fbdoom/p_mobj.c rename to doomgeneric/p_mobj.c diff --git a/fbdoom/p_mobj.h b/doomgeneric/p_mobj.h similarity index 100% rename from fbdoom/p_mobj.h rename to doomgeneric/p_mobj.h diff --git a/fbdoom/p_plats.c b/doomgeneric/p_plats.c similarity index 100% rename from fbdoom/p_plats.c rename to doomgeneric/p_plats.c diff --git a/fbdoom/p_pspr.c b/doomgeneric/p_pspr.c similarity index 100% rename from fbdoom/p_pspr.c rename to doomgeneric/p_pspr.c diff --git a/fbdoom/p_pspr.h b/doomgeneric/p_pspr.h similarity index 100% rename from fbdoom/p_pspr.h rename to doomgeneric/p_pspr.h diff --git a/fbdoom/p_saveg.c b/doomgeneric/p_saveg.c similarity index 100% rename from fbdoom/p_saveg.c rename to doomgeneric/p_saveg.c diff --git a/fbdoom/p_saveg.h b/doomgeneric/p_saveg.h similarity index 100% rename from fbdoom/p_saveg.h rename to doomgeneric/p_saveg.h diff --git a/fbdoom/p_setup.c b/doomgeneric/p_setup.c similarity index 100% rename from fbdoom/p_setup.c rename to doomgeneric/p_setup.c diff --git a/fbdoom/p_setup.h b/doomgeneric/p_setup.h similarity index 100% rename from fbdoom/p_setup.h rename to doomgeneric/p_setup.h diff --git a/fbdoom/p_sight.c b/doomgeneric/p_sight.c similarity index 100% rename from fbdoom/p_sight.c rename to doomgeneric/p_sight.c diff --git a/fbdoom/p_spec.c b/doomgeneric/p_spec.c similarity index 100% rename from fbdoom/p_spec.c rename to doomgeneric/p_spec.c diff --git a/fbdoom/p_spec.h b/doomgeneric/p_spec.h similarity index 100% rename from fbdoom/p_spec.h rename to doomgeneric/p_spec.h diff --git a/fbdoom/p_switch.c b/doomgeneric/p_switch.c similarity index 100% rename from fbdoom/p_switch.c rename to doomgeneric/p_switch.c diff --git a/fbdoom/p_telept.c b/doomgeneric/p_telept.c similarity index 100% rename from fbdoom/p_telept.c rename to doomgeneric/p_telept.c diff --git a/fbdoom/p_tick.c b/doomgeneric/p_tick.c similarity index 100% rename from fbdoom/p_tick.c rename to doomgeneric/p_tick.c diff --git a/fbdoom/p_tick.h b/doomgeneric/p_tick.h similarity index 100% rename from fbdoom/p_tick.h rename to doomgeneric/p_tick.h diff --git a/fbdoom/p_user.c b/doomgeneric/p_user.c similarity index 100% rename from fbdoom/p_user.c rename to doomgeneric/p_user.c diff --git a/fbdoom/r_bsp.c b/doomgeneric/r_bsp.c similarity index 100% rename from fbdoom/r_bsp.c rename to doomgeneric/r_bsp.c diff --git a/fbdoom/r_bsp.h b/doomgeneric/r_bsp.h similarity index 100% rename from fbdoom/r_bsp.h rename to doomgeneric/r_bsp.h diff --git a/fbdoom/r_data.c b/doomgeneric/r_data.c similarity index 100% rename from fbdoom/r_data.c rename to doomgeneric/r_data.c diff --git a/fbdoom/r_data.h b/doomgeneric/r_data.h similarity index 100% rename from fbdoom/r_data.h rename to doomgeneric/r_data.h diff --git a/fbdoom/r_defs.h b/doomgeneric/r_defs.h similarity index 100% rename from fbdoom/r_defs.h rename to doomgeneric/r_defs.h diff --git a/fbdoom/r_draw.c b/doomgeneric/r_draw.c similarity index 100% rename from fbdoom/r_draw.c rename to doomgeneric/r_draw.c diff --git a/fbdoom/r_draw.h b/doomgeneric/r_draw.h similarity index 100% rename from fbdoom/r_draw.h rename to doomgeneric/r_draw.h diff --git a/fbdoom/r_local.h b/doomgeneric/r_local.h similarity index 100% rename from fbdoom/r_local.h rename to doomgeneric/r_local.h diff --git a/fbdoom/r_main.c b/doomgeneric/r_main.c similarity index 100% rename from fbdoom/r_main.c rename to doomgeneric/r_main.c diff --git a/fbdoom/r_main.h b/doomgeneric/r_main.h similarity index 100% rename from fbdoom/r_main.h rename to doomgeneric/r_main.h diff --git a/fbdoom/r_plane.c b/doomgeneric/r_plane.c similarity index 100% rename from fbdoom/r_plane.c rename to doomgeneric/r_plane.c diff --git a/fbdoom/r_plane.h b/doomgeneric/r_plane.h similarity index 100% rename from fbdoom/r_plane.h rename to doomgeneric/r_plane.h diff --git a/fbdoom/r_segs.c b/doomgeneric/r_segs.c similarity index 100% rename from fbdoom/r_segs.c rename to doomgeneric/r_segs.c diff --git a/fbdoom/r_segs.h b/doomgeneric/r_segs.h similarity index 100% rename from fbdoom/r_segs.h rename to doomgeneric/r_segs.h diff --git a/fbdoom/r_sky.c b/doomgeneric/r_sky.c similarity index 100% rename from fbdoom/r_sky.c rename to doomgeneric/r_sky.c diff --git a/fbdoom/r_sky.h b/doomgeneric/r_sky.h similarity index 100% rename from fbdoom/r_sky.h rename to doomgeneric/r_sky.h diff --git a/fbdoom/r_state.h b/doomgeneric/r_state.h similarity index 100% rename from fbdoom/r_state.h rename to doomgeneric/r_state.h diff --git a/fbdoom/r_things.c b/doomgeneric/r_things.c similarity index 100% rename from fbdoom/r_things.c rename to doomgeneric/r_things.c diff --git a/fbdoom/r_things.h b/doomgeneric/r_things.h similarity index 100% rename from fbdoom/r_things.h rename to doomgeneric/r_things.h diff --git a/fbdoom/s_sound.c b/doomgeneric/s_sound.c similarity index 100% rename from fbdoom/s_sound.c rename to doomgeneric/s_sound.c diff --git a/fbdoom/s_sound.h b/doomgeneric/s_sound.h similarity index 100% rename from fbdoom/s_sound.h rename to doomgeneric/s_sound.h diff --git a/fbdoom/sha1.c b/doomgeneric/sha1.c similarity index 100% rename from fbdoom/sha1.c rename to doomgeneric/sha1.c diff --git a/fbdoom/sha1.h b/doomgeneric/sha1.h similarity index 100% rename from fbdoom/sha1.h rename to doomgeneric/sha1.h diff --git a/fbdoom/sounds.c b/doomgeneric/sounds.c similarity index 100% rename from fbdoom/sounds.c rename to doomgeneric/sounds.c diff --git a/fbdoom/sounds.h b/doomgeneric/sounds.h similarity index 100% rename from fbdoom/sounds.h rename to doomgeneric/sounds.h diff --git a/fbdoom/st_lib.c b/doomgeneric/st_lib.c similarity index 100% rename from fbdoom/st_lib.c rename to doomgeneric/st_lib.c diff --git a/fbdoom/st_lib.h b/doomgeneric/st_lib.h similarity index 100% rename from fbdoom/st_lib.h rename to doomgeneric/st_lib.h diff --git a/fbdoom/st_stuff.c b/doomgeneric/st_stuff.c similarity index 100% rename from fbdoom/st_stuff.c rename to doomgeneric/st_stuff.c diff --git a/fbdoom/st_stuff.h b/doomgeneric/st_stuff.h similarity index 100% rename from fbdoom/st_stuff.h rename to doomgeneric/st_stuff.h diff --git a/fbdoom/statdump.c b/doomgeneric/statdump.c similarity index 100% rename from fbdoom/statdump.c rename to doomgeneric/statdump.c diff --git a/fbdoom/statdump.h b/doomgeneric/statdump.h similarity index 100% rename from fbdoom/statdump.h rename to doomgeneric/statdump.h diff --git a/fbdoom/stubs.c b/doomgeneric/stubs.c similarity index 100% rename from fbdoom/stubs.c rename to doomgeneric/stubs.c diff --git a/fbdoom/tables.c b/doomgeneric/tables.c similarity index 100% rename from fbdoom/tables.c rename to doomgeneric/tables.c diff --git a/fbdoom/tables.h b/doomgeneric/tables.h similarity index 100% rename from fbdoom/tables.h rename to doomgeneric/tables.h diff --git a/fbdoom/v_patch.h b/doomgeneric/v_patch.h similarity index 100% rename from fbdoom/v_patch.h rename to doomgeneric/v_patch.h diff --git a/fbdoom/v_video.c b/doomgeneric/v_video.c similarity index 100% rename from fbdoom/v_video.c rename to doomgeneric/v_video.c diff --git a/fbdoom/v_video.h b/doomgeneric/v_video.h similarity index 100% rename from fbdoom/v_video.h rename to doomgeneric/v_video.h diff --git a/fbdoom/w_checksum.c b/doomgeneric/w_checksum.c similarity index 100% rename from fbdoom/w_checksum.c rename to doomgeneric/w_checksum.c diff --git a/fbdoom/w_checksum.h b/doomgeneric/w_checksum.h similarity index 100% rename from fbdoom/w_checksum.h rename to doomgeneric/w_checksum.h diff --git a/fbdoom/w_file.c b/doomgeneric/w_file.c similarity index 100% rename from fbdoom/w_file.c rename to doomgeneric/w_file.c diff --git a/fbdoom/w_file.h b/doomgeneric/w_file.h similarity index 100% rename from fbdoom/w_file.h rename to doomgeneric/w_file.h diff --git a/fbdoom/w_file_stdc.c b/doomgeneric/w_file_stdc.c similarity index 100% rename from fbdoom/w_file_stdc.c rename to doomgeneric/w_file_stdc.c diff --git a/fbdoom/w_file_stdc_unbuffered.c b/doomgeneric/w_file_stdc_unbuffered.c similarity index 100% rename from fbdoom/w_file_stdc_unbuffered.c rename to doomgeneric/w_file_stdc_unbuffered.c diff --git a/fbdoom/w_main.c b/doomgeneric/w_main.c similarity index 100% rename from fbdoom/w_main.c rename to doomgeneric/w_main.c diff --git a/fbdoom/w_main.h b/doomgeneric/w_main.h similarity index 100% rename from fbdoom/w_main.h rename to doomgeneric/w_main.h diff --git a/fbdoom/w_merge.h b/doomgeneric/w_merge.h similarity index 100% rename from fbdoom/w_merge.h rename to doomgeneric/w_merge.h diff --git a/fbdoom/w_wad.c b/doomgeneric/w_wad.c similarity index 100% rename from fbdoom/w_wad.c rename to doomgeneric/w_wad.c diff --git a/fbdoom/w_wad.h b/doomgeneric/w_wad.h similarity index 100% rename from fbdoom/w_wad.h rename to doomgeneric/w_wad.h diff --git a/fbdoom/wi_stuff.c b/doomgeneric/wi_stuff.c similarity index 100% rename from fbdoom/wi_stuff.c rename to doomgeneric/wi_stuff.c diff --git a/fbdoom/wi_stuff.h b/doomgeneric/wi_stuff.h similarity index 100% rename from fbdoom/wi_stuff.h rename to doomgeneric/wi_stuff.h diff --git a/fbdoom/z_zone.c b/doomgeneric/z_zone.c similarity index 100% rename from fbdoom/z_zone.c rename to doomgeneric/z_zone.c diff --git a/fbdoom/z_zone.h b/doomgeneric/z_zone.h similarity index 100% rename from fbdoom/z_zone.h rename to doomgeneric/z_zone.h diff --git a/ipx/DOOMNET.C b/ipx/DOOMNET.C deleted file mode 100644 index 0f9c55b..0000000 --- a/ipx/DOOMNET.C +++ /dev/null @@ -1,73 +0,0 @@ -//#define DOOM2 - -#include -#include -#include -#include -#include -#include - -#include "doomnet.h" -//#include "ipxstr.h" -#include "ipx_frch.h" // FRENCH VERSION - -doomcom_t doomcom; -int vectorishooked; -void interrupt (*olddoomvect) (void); - - - -/* -============= -= -= LaunchDOOM -= -These fields in doomcom should be filled in before calling: - - short numnodes; // console is allways node 0 - short ticdup; // 1 = no duplication, 2-5 = dup for -slow nets - short extratics; // 1 = send a backup tic in every -packet - - short consoleplayer; // 0-3 = player number - short numplayers; // 1-4 - short angleoffset; // 1 = left, 0 = center, -1 = right - short drone; // 1 = drone -============= -*/ - -void LaunchDOOM (void) -{ - char *newargs[99]; - char adrstring[10]; - long flatadr; - -// prepare for DOOM - doomcom.id = DOOMCOM_ID; - -// hook the interrupt vector - olddoomvect = getvect (doomcom.intnum); - setvect (doomcom.intnum,(void interrupt (*)(void))MK_FP(_CS, -(int)NetISR)); - vectorishooked = 1; - -// build the argument list for DOOM, adding a -net &doomcom - memcpy (newargs, _argv, (_argc+1)*2); - newargs[_argc] = "-net"; - flatadr = (long)_DS*16 + (unsigned)&doomcom; - sprintf (adrstring,"%lu",flatadr); - newargs[_argc+1] = adrstring; - newargs[_argc+2] = NULL; - - if (!access("doom2.exe",0)) - spawnv (P_WAIT, "doom2", newargs); - else - spawnv (P_WAIT, "doom", newargs); - - #ifdef DOOM2 - printf (STR_RETURNED"\n"); - #else - printf ("Returned from DOOM\n"); - #endif -} diff --git a/ipx/DOOMNET.H b/ipx/DOOMNET.H deleted file mode 100644 index f0319d9..0000000 --- a/ipx/DOOMNET.H +++ /dev/null @@ -1,58 +0,0 @@ -// doomnet.h - -#define PEL_WRITE_ADR 0x3c8 -#define PEL_DATA 0x3c9 - -#define I_ColorBlack(r,g,b) {outp(PEL_WRITE_ADR,0);outp(PEL_DATA,r);outp(PEL_DATA,g);outp(PEL_DATA,b);}; - - - -#define MAXNETNODES 8 // max computers in a game -#define MAXPLAYERS 4 // 4 players max + drones - - -#define CMD_SEND 1 -#define CMD_GET 2 - -#define DOOMCOM_ID 0x12345678l - -typedef struct -{ - long id; - short intnum; // DOOM executes an int to send commands - -// communication between DOOM and the driver - short command; // CMD_SEND or CMD_GET - short remotenode; // dest for send, set by get (-1 = no packet) - short datalength; // bytes in doomdata to be sent / bytes read - -// info common to all nodes - short numnodes; // console is allways node 0 - short ticdup; // 1 = no duplication, 2-5 = dup for slow nets - short extratics; // 1 = send a backup tic in every packet - short deathmatch; // 1 = deathmatch - short savegame; // -1 = new game, 0-5 = load savegame - short episode; // 1-3 - short map; // 1-9 - short skill; // 1-5 - -// info specific to this node - short consoleplayer; // 0-3 = player number - short numplayers; // 1-4 - short angleoffset; // 1 = left, 0 = center, -1 = right - short drone; // 1 = drone - -// packet data to be sent - char data[512]; -} doomcom_t; - - - -extern doomcom_t doomcom; -extern void interrupt (*olddoomvect) (void); -extern int vectorishooked; - -int CheckParm (char *check); -void LaunchDOOM (void); -void interrupt NetISR (void); - diff --git a/ipx/IPXNET.C b/ipx/IPXNET.C deleted file mode 100644 index f2fa935..0000000 --- a/ipx/IPXNET.C +++ /dev/null @@ -1,294 +0,0 @@ -// ipxnet.c - -#include -#include -#include -#include -#include -#include - -#include "ipxnet.h" - -/* -========================================================================== -=== - - IPX PACKET DRIVER - -========================================================================== -=== -*/ - -packet_t packets[NUMPACKETS]; - -nodeadr_t nodeadr[MAXNETNODES+1]; // first is local, last is broadcast - -nodeadr_t remoteadr; // set by each GetPacket - -localadr_t localadr; // set at startup - -extern int socketid; - -void far (*IPX)(void); - -long localtime; // for time stamp in packets -long remotetime; - -//=========================================================================== - -int OpenSocket(short socketNumber) -{ - _DX = socketNumber; - _BX = 0; - _AL = 0; - IPX(); - if(_AL) - Error ("OpenSocket: 0x%x", _AL); - return _DX; -} - - -void CloseSocket(short socketNumber) -{ - _DX = socketNumber; - _BX = 1; - IPX(); -} - -void ListenForPacket(ECB *ecb) -{ - _SI = FP_OFF(ecb); - _ES = FP_SEG(ecb); - _BX = 4; - IPX(); - if(_AL) - Error ("ListenForPacket: 0x%x", _AL); -} - - -void GetLocalAddress (void) -{ - _SI = FP_OFF(&localadr); - _ES = FP_SEG(&localadr); - _BX = 9; - IPX(); -} - - - -/* -==================== -= -= InitNetwork -= -==================== -*/ - -void InitNetwork (void) -{ - int i,j; - -// -// get IPX function address -// - _AX = 0x7a00; - geninterrupt(0x2f); - if(_AL != 0xff) - Error ("IPX not detected\n"); - IPX = MK_FP(_ES, _DI); - - -// -// allocate a socket for sending and receiving -// - socketid = OpenSocket ( (socketid>>8) + ((socketid&255)<<8) ); - - GetLocalAddress(); - -// -// set up several receiving ECBs -// - memset (packets,0,NUMPACKETS*sizeof(packet_t)); - - for (i=1 ; i>8; - packets[0].ecb.f2Address[0] = FP_OFF(&doomcom.data); - packets[0].ecb.f2Address[1] = FP_SEG(&doomcom.data); - -// known local node at 0 - for (i=0 ; i<6 ; i++) - nodeadr[0].node[i] = localadr.node[i]; - -// broadcast node at MAXNETNODES - for (j=0 ; j<6 ; j++) - nodeadr[MAXNETNODES].node[j] = 0xff; -} - - -/* -==================== -= -= ShutdownNetwork -= -==================== -*/ - -void ShutdownNetwork (void) -{ - if (IPX) - CloseSocket (socketid); -} - - -/* -============== -= -= SendPacket -= -= A destination of MAXNETNODES is a broadcast -============== -*/ - -void SendPacket (int destination) -{ - int j; - -// set the time - packets[0].time = localtime; - -// set the address - for (j=0 ; j<6 ; j++) - packets[0].ipx.dNode[j] = -packets[0].ecb.ImmediateAddress[j] = - nodeadr[destination].node[j]; - -// set the length (ipx + time + datalength) - packets[0].ecb.fSize = sizeof(IPXPacket) + 4; - packets[0].ecb.f2Size = doomcom.datalength + 4; - -// send the packet - _SI = FP_OFF(&packets[0]); - _ES = FP_SEG(&packets[0]); - _BX = 3; - IPX(); - if(_AL) - Error("SendPacket: 0x%x", _AL); - - while(packets[0].ecb.InUseFlag != 0) - { - // IPX Relinquish Control - polled drivers MUST have this here! - _BX = 10; - IPX(); - } -} - - -unsigned short ShortSwap (unsigned short i) -{ - return ((i&255)<<8) + ((i>>8)&255); -} - -/* -============== -= -= GetPacket -= -= Returns false if no packet is waiting -= -============== -*/ - -int GetPacket (void) -{ - int packetnum; - int i, j; - long besttic; - packet_t *packet; - -// if multiple packets are waiting, return them in order by time - - besttic = MAXLONG; - packetnum = -1; - doomcom.remotenode = -1; - - for ( i = 1 ; i < NUMPACKETS ; i++) - { - if (packets[i].ecb.InUseFlag) - { - continue; - } - - if (packets[i].time < besttic) - { - besttic = packets[i].time; - packetnum = i; - } - } - - if (besttic == MAXLONG) - return 0; // no packets - - packet = &packets[packetnum]; - - if (besttic == -1 && localtime != -1) - { - ListenForPacket (&packet->ecb); - return 0; // setup broadcast from other game - } - - remotetime = besttic; - -// -// got a good packet -// - if (packet->ecb.CompletionCode) - Error ("GetPacket: ecb.ComletionCode = 0x%x",packet->ecb.CompletionCode); - -// set remoteadr to the sender of the packet - memcpy (&remoteadr, packet->ipx.sNode, sizeof(remoteadr)); - for (i=0 ; iecb); - return 0; - } - } - -// copy out the data - doomcom.datalength = ShortSwap(packet->ipx.PacketLength) - 38; - memcpy (&doomcom.data, &packet->data, doomcom.datalength); - -// repost the ECB - ListenForPacket (&packet->ecb); - - return 1; -} - diff --git a/ipx/IPXNET.H b/ipx/IPXNET.H deleted file mode 100644 index 2c5e14d..0000000 --- a/ipx/IPXNET.H +++ /dev/null @@ -1,117 +0,0 @@ -// ipxnet.h - - -typedef struct -{ - char private[512]; -} doomdata_t; - - -#include "DoomNet.h" - -//=========================================================================== - -#define NUMPACKETS 10 // max outstanding packets before loss - -// setupdata_t is used as doomdata_t during setup -typedef struct -{ - short gameid; // so multiple games can setup at once - short drone; - short nodesfound; - short nodeswanted; -} setupdata_t; - - - -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned long LONG; - -typedef struct IPXPacketStructure -{ - WORD PacketCheckSum; /* high-low */ - WORD PacketLength; /* high-low */ - BYTE PacketTransportControl; - BYTE PacketType; - - BYTE dNetwork[4]; /* high-low */ - BYTE dNode[6]; /* high-low */ - BYTE dSocket[2]; /* high-low */ - - BYTE sNetwork[4]; /* high-low */ - BYTE sNode[6]; /* high-low */ - BYTE sSocket[2]; /* high-low */ -} IPXPacket; - - -typedef struct -{ - BYTE network[4]; /* high-low */ - BYTE node[6]; /* high-low */ -} localadr_t; - -typedef struct -{ - BYTE node[6]; /* high-low */ -} nodeadr_t; - -typedef struct ECBStructure -{ - WORD Link[2]; /* offset-segment */ - WORD ESRAddress[2]; /* offset-segment */ - BYTE InUseFlag; - BYTE CompletionCode; - WORD ECBSocket; /* high-low */ - BYTE IPXWorkspace[4]; /* N/A */ - BYTE DriverWorkspace[12]; /* N/A */ - BYTE ImmediateAddress[6]; /* high-low */ - WORD FragmentCount; /* low-high */ - - WORD fAddress[2]; /* offset-segment */ - WORD fSize; /* low-high */ - - WORD f2Address[2]; /* offset-segment */ - WORD f2Size; /* low-high */ -} ECB; - - -// time is used by the communication driver to sequence packets returned -// to DOOM when more than one is waiting - -typedef struct -{ - ECB ecb; - IPXPacket ipx; - - long time; - doomdata_t data; -} packet_t; - - -extern doomcom_t doomcom; -extern int gameid; - -extern nodeadr_t nodeadr[MAXNETNODES+1]; -extern int localnodenum; - -extern long localtime; // for time stamp in packets -extern long remotetime; // timestamp of last packet gotten - -extern nodeadr_t remoteadr; - -extern int myargc; - -extern char **myargv; - -void Error (char *error, ...); - - -void InitNetwork (void); -void ShutdownNetwork (void); -void SendPacket (int destination); -int GetPacket (void); -int CheckParm (char *check); - -void PrintAddress (nodeadr_t *adr, char *str); - diff --git a/ipx/IPXSETUP.C b/ipx/IPXSETUP.C deleted file mode 100644 index c5f3099..0000000 --- a/ipx/IPXSETUP.C +++ /dev/null @@ -1,420 +0,0 @@ -// ipxsetup.c - -#define DOOM2 - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ipxnet.h" -//#include "ipxstr.h" -#include "ipx_frch.h" // FRENCH VERSION - -int gameid; -int numnetnodes; -int socketid = 0x869c; // 0x869c is the official DOOM socket -int myargc; -char **myargv; - -setupdata_t nodesetup[MAXNETNODES]; - - -/* -================= -= -= Error -= -= For abnormal program terminations -= -================= -*/ - -void Error (char *error, ...) -{ - va_list argptr; - - if (vectorishooked) - setvect (doomcom.intnum,olddoomvect); - - va_start (argptr,error); - vprintf (error,argptr); - va_end (argptr); - printf ("\n"); - ShutdownNetwork (); - exit (1); -} - - -/* -================= -= -= CheckParm -= -= Checks for the given parameter in the program's command line arguments -= -= Returns the argument number (1 to argc-1) or 0 if not present -= -================= -*/ - -int CheckParm(char *parm) - { - int i; - - for(i = 1; i < myargc; i++) - if(stricmp(parm, myargv[i]) == 0) - return i; - - return 0; - } - - -/* -============= -= -= NetISR -= -============= -*/ - -void interrupt NetISR (void) -{ - if (doomcom.command == CMD_SEND) - { - localtime++; - SendPacket (doomcom.remotenode); - } - else if (doomcom.command == CMD_GET) - { - GetPacket (); - } -} - - - -/* -=================== -= -= LookForNodes -= -= Finds all the nodes for the game and works out player numbers among -them -= -= Exits with nodesetup[0..numnodes] and nodeadr[0..numnodes] filled in -=================== -*/ - -void LookForNodes (void) -{ - int i,j,k; - int netids[MAXNETNODES]; - int netplayer[MAXNETNODES]; - struct time time; - int oldsec; - setupdata_t *setup, *dest; - char str[80]; - int total, console; - -// -// wait until we get [numnetnodes] packets, then start playing -// the playernumbers are assigned by netid -// - printf(STR_ATTEMPT, numnetnodes); - - printf (STR_LOOKING); - - oldsec = -1; - setup = (setupdata_t *)&doomcom.data; - localtime = -1; // in setup time, not game time - -// -// build local setup info -// - nodesetup[0].nodesfound = 1; - nodesetup[0].nodeswanted = numnetnodes; - doomcom.numnodes = 1; - - do - { -// -// check for aborting -// - while ( bioskey(1) ) - { - if ( (bioskey (0) & 0xff) == 27) - Error ("\n\n"STR_NETABORT); - } - -// -// listen to the network -// - while (GetPacket ()) - { - if (doomcom.remotenode == -1) - dest = &nodesetup[doomcom.numnodes]; - else - dest = &nodesetup[doomcom.remotenode]; - - if (remotetime != -1) - { // an early game packet, not a setup packet - if (doomcom.remotenode == -1) - Error (STR_UNKNOWN); - // if it allready started, it must have found all nodes - dest->nodesfound = dest->nodeswanted; - continue; - } - - // update setup ingo - memcpy (dest, setup, sizeof(*dest) ); - - if (doomcom.remotenode != -1) - continue; // allready know that node address - - // - // this is a new node - // - memcpy (&nodeadr[doomcom.numnodes], &remoteadr - , sizeof(nodeadr[doomcom.numnodes]) ); - - // - // if this node has a lower address, take all startup info - // - if ( memcmp (&remoteadr, &nodeadr[0], sizeof(&remoteadr) ) -< 0 ) - { - } - - doomcom.numnodes++; - - printf ("\n"STR_FOUND"\n"); - - if (doomcom.numnodes < numnetnodes) - printf (STR_LOOKING); - } -// -// we are done if all nodes have found all other nodes -// - for (i=0 ; i MAXPLAYERS) - Error (STR_MORETHAN,MAXPLAYERS); - if (memcmp (&nodeadr[i], &nodeadr[0], sizeof(nodeadr[0])) < 0) - console++; - } - - - if (!total) - Error (STR_NONESPEC); - - doomcom.consoleplayer = console; - doomcom.numplayers = total; - - printf (STR_CONSOLEIS"\n", console+1, total); -} - - -//======================================================== -// -// Find a Response File -// -//======================================================== -void FindResponseFile (void) -{ - int i; - #define MAXARGVS 100 - - for (i = 1;i < myargc;i++) - if (myargv[i][0] == '@') - { - FILE * handle; - int size; - int k; - int index; - int indexinfile; - char *infile; - char *file; - char *moreargs[20]; - char *firstargv; - - // READ THE RESPONSE FILE INTO MEMORY - handle = fopen (&myargv[i][1],"rb"); - if (!handle) - Error (STR_NORESP); - printf(STR_FOUNDRESP" \"%s\"!\n",strupr(&myargv[i][1])); - fseek (handle,0,SEEK_END); - size = ftell(handle); - fseek (handle,0,SEEK_SET); - file = malloc (size); - fread (file,size,1,handle); - fclose (handle); - - // KEEP ALL CMDLINE ARGS FOLLOWING @RESPONSEFILE ARG - for (index = 0,k = i+1; k < myargc; k++) - moreargs[index++] = myargv[k]; - - firstargv = myargv[0]; - myargv = malloc(sizeof(char *)*MAXARGVS); - memset(myargv,0,sizeof(char *)*MAXARGVS); - myargv[0] = firstargv; - - infile = file; - indexinfile = k = 0; - indexinfile++; // SKIP PAST ARGV[0] (KEEP IT) - do - { - myargv[indexinfile++] = infile+k; - while(k < size && - ((*(infile+k)>= ' '+1) && (*(infile+k)<='z'))) - k++; - *(infile+k) = 0; - while(k < size && - ((*(infile+k)<= ' ') || (*(infile+k)>'z'))) - k++; - } while(k < size); - - for (k = 0;k < index;k++) - myargv[indexinfile++] = moreargs[k]; - myargc = indexinfile; - - // DISPLAY ARGS -// printf("%d command-line args:\n",myargc); -// for (k=1;k parameter." -#define STR_COMMVECT "Communicating with interrupt vector 0x%x" -#define STR_USEALT "Using alternate port %i for network" -#define STR_RETURNED "Returned from DOOM II" -#define STR_ATTEMPT "Attempting to find all players for %i player net play. "\ - "Press ESC to exit.\n" diff --git a/ipx/IPX_FRCH.H b/ipx/IPX_FRCH.H deleted file mode 100644 index 6178eea..0000000 --- a/ipx/IPX_FRCH.H +++ /dev/null @@ -1,21 +0,0 @@ -#define STR_NETABORT "Synchronisation du jeu sur r‚seau annul‚e." -#define STR_UNKNOWN "Paquet de jeu inconnu durant la configuration" -#define STR_FOUND "Noeud d‚tect‚!" -#define STR_LOOKING "Recherche d'un noeud" -#define STR_MORETHAN "Plus de %i joueurs sp‚cifi‚s!" -#define STR_NONESPEC "Pas de joueurs sp‚cifi‚s pour le jeu!" -#define STR_CONSOLEIS "Console: joueur %i sur %i" -#define STR_NORESP "Ce fichier de r‚ponse n'existe pas!" -#define STR_FOUNDRESP "Fichier de r‚ponse trouv‚" -#define STR_DOOMNETDRV "GESTIONNAIRE DE RESEAU DOOM II" -#define STR_VECTSPEC "Le vecteur sp‚cifi‚ (0x%02x) ‚tait d‚j… connect‚." -#define STR_NONULL \ -"Attention: pas de vecteurs d'interruption NULL ou iret trouv‚s entre 0x60 et 0x66.\n"\ -"Vous pouvez sp‚cifier un vecteur avec le paramŠtre -vector 0x." -#define STR_COMMVECT "Communication avec le vecteur d'interruption 0x%x" -#define STR_USEALT "Utilisation du port alternatif %i pour le r‚seau" -#define STR_RETURNED "Retour de DOOM II" -#define STR_ATTEMPT \ -"Tentatative de recherche de tous les joueurs pour le jeu en riseau `%i jouers\n" \ -"Appuyez sur ECHAP pour quitter.\n" - diff --git a/ipx/README b/ipx/README deleted file mode 100644 index d96a75b..0000000 --- a/ipx/README +++ /dev/null @@ -1 +0,0 @@ -This is the source for the DOOM ipx network driver. diff --git a/sersrc/DOOMNET.C b/sersrc/DOOMNET.C deleted file mode 100644 index c027ec7..0000000 --- a/sersrc/DOOMNET.C +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "doomnet.h" - -//#include "serstr.h" -#include "ser_frch.h" // FRENCH VERSION - -#define DOOM2 - -extern int myargc; -extern char **myargv; - -doomcom_t doomcom; -int vectorishooked; -void interrupt (*olddoomvect) (void); - - - -/* -================= -= -= CheckParm -= -= Checks for the given parameter in the program's command line arguments -= -= Returns the argument number (1 to argc-1) or 0 if not present -= -================= -*/ - -int CheckParm (char *check) -{ - int i; - - for (i = 1;i= inque.head) - return -1; - c = inque.data[inque.tail&(QUESIZE-1)]; - inque.tail++; - return c; -} - - -void write_byte( int c ) -{ - outque.data[outque.head&(QUESIZE-1)] = c; - outque.head++; -} - - - -//========================================================================== - - -/* -============== -= -= isr_8250 -= -============== -*/ - -void interrupt isr_8250(void) -{ - int c; - - while (1) - { - switch( INPUT( uart + INTERRUPT_ID_REGISTER ) & 7 ) - { -// not enabled - case IIR_MODEM_STATUS_INTERRUPT : - modem_status = INPUT( uart + MODEM_STATUS_REGISTER ); - break; - -// not enabled - case IIR_LINE_STATUS_INTERRUPT : - line_status = INPUT( uart + LINE_STATUS_REGISTER ); - break; - -// -// transmit -// - case IIR_TX_HOLDING_REGISTER_INTERRUPT : -//I_ColorBlack (63,0,0); - if (outque.tail < outque.head) - { - c = outque.data[outque.tail&(QUESIZE-1)]; - outque.tail++; - OUTPUT( uart + TRANSMIT_HOLDING_REGISTER, c ); - } - break; - -// -// receive -// - case IIR_RX_DATA_READY_INTERRUPT : -//I_ColorBlack (0,63,0); - c = INPUT( uart + RECEIVE_BUFFER_REGISTER ); - inque.data[inque.head&(QUESIZE-1)] = c; - inque.head++; - break; - -// -// done -// - default : -//I_ColorBlack (0,0,0); - OUTPUT( 0x20, 0x20 ); - return; - } - } -} - - -/* -============== -= -= isr_16550 -= -============== -*/ - -void interrupt isr_16550(void) -{ - int c; - int count; - - while (1) - { - switch( INPUT( uart + INTERRUPT_ID_REGISTER ) & 7 ) - { -// not enabled - case IIR_MODEM_STATUS_INTERRUPT : - modem_status = INPUT( uart + MODEM_STATUS_REGISTER ); - break; - -// not enabled - case IIR_LINE_STATUS_INTERRUPT : - line_status = INPUT( uart + LINE_STATUS_REGISTER ); - break; - -// -// transmit -// - case IIR_TX_HOLDING_REGISTER_INTERRUPT : -//I_ColorBlack (63,0,0); - count = 16; - while (outque.tail < outque.head && count--) - { - c = outque.data[outque.tail&(QUESIZE-1)]; - outque.tail++; - OUTPUT( uart + TRANSMIT_HOLDING_REGISTER, c ); - } - break; - -// -// receive -// - case IIR_RX_DATA_READY_INTERRUPT : -//I_ColorBlack (0,63,0); - do - { - c = INPUT( uart + RECEIVE_BUFFER_REGISTER ); - inque.data[inque.head&(QUESIZE-1)] = c; - inque.head++; - } while (INPUT( uart + LINE_STATUS_REGISTER ) & LSR_DATA_READY ); - - break; - -// -// done -// - default : -//I_ColorBlack (0,0,0); - OUTPUT( 0x20, 0x20 ); - return; - } - } -} - - -/* -=============== -= -= jump_start -= -= Start up the transmition interrupts by sending the first char -=============== -*/ - -void jump_start( void ) -{ - int c; - - if (outque.tail < outque.head) - { - c = outque.data [outque.tail&(QUESIZE-1)]; - outque.tail++; - OUTPUT( uart, c ); - } -} - - diff --git a/sersrc/README.TXT b/sersrc/README.TXT deleted file mode 100644 index 94ce053..0000000 --- a/sersrc/README.TXT +++ /dev/null @@ -1 +0,0 @@ -This is the source for the DOOM serial / modem driver. diff --git a/sersrc/SERSETUP.C b/sersrc/SERSETUP.C deleted file mode 100644 index eeee006..0000000 --- a/sersrc/SERSETUP.C +++ /dev/null @@ -1,680 +0,0 @@ -// sersetup.c -#define DOOM2 -#include "sersetup.h" -//#include "serstr.h" -#include "ser_frch.h" // FRENCH VERSION -#include "DoomNet.h" - -extern que_t inque, outque; - -void jump_start( void ); -extern int uart; - -int usemodem; -char startup[256], shutdown[256], baudrate[256]; - -extern int baudbits; - -void ModemCommand (char *str); - -int myargc; -char **myargv; - -//====================================== -// -// I_Error -// -//====================================== -void I_Error(char *string) -{ - printf("%s\n",string); - exit(1); -} - -/* -================ -= -= write_buffer -= -================ -*/ - -void write_buffer( char *buffer, unsigned int count ) -{ - int i; - -// if this would overrun the buffer, throw everything else out - if (outque.head-outque.tail+count > QUESIZE) - outque.tail = outque.head; - - while (count--) - write_byte (*buffer++); - - if ( INPUT( uart + LINE_STATUS_REGISTER ) & 0x40) - jump_start(); -} - - -/* -================= -= -= Error -= -= For abnormal program terminations -= -================= -*/ - -void Error (char *error, ...) -{ - va_list argptr; - - if (usemodem) - { - printf ("\n"); - printf ("\n"STR_DROPDTR"\n"); - - OUTPUT(uart+MODEM_CONTROL_REGISTER, INPUT(uart+MODEM_CONTROL_REGISTER)&~MCR_DTR); - delay (1250); - OUTPUT( uart + MODEM_CONTROL_REGISTER, INPUT( uart + MODEM_CONTROL_REGISTER ) | MCR_DTR ); - ModemCommand("+++"); - delay (1250); - ModemCommand(shutdown); - delay (1250); - - } - - ShutdownPort (); - - if (vectorishooked) - setvect (doomcom.intnum,olddoomvect); - - if (error) - { - va_start (argptr,error); - vprintf (error,argptr); - va_end (argptr); - printf ("\n"); - exit (1); - } - - printf (STR_CLEANEXIT"\n"); - exit (0); -} - - -/* -================ -= -= ReadPacket -= -================ -*/ - -#define MAXPACKET 512 -#define FRAMECHAR 0x70 - -char packet[MAXPACKET]; -int packetlen; -int inescape; -int newpacket; - -boolean ReadPacket (void) -{ - int c; - -// if the buffer has overflowed, throw everything out - - if (inque.head-inque.tail > QUESIZE - 4) // check for buffer overflow - { - inque.tail = inque.head; - newpacket = true; - return false; - } - - if (newpacket) - { - packetlen = 0; - newpacket = 0; - } - - do - { - c = read_byte (); - if (c < 0) - return false; // haven't read a complete packet -//printf ("%c",c); - if (inescape) - { - inescape = false; - if (c!=FRAMECHAR) - { - newpacket = 1; - return true; // got a good packet - } - } - else if (c==FRAMECHAR) - { - inescape = true; - continue; // don't know yet if it is a terminator - } // or a literal FRAMECHAR - - if (packetlen >= MAXPACKET) - continue; // oversize packet - packet[packetlen] = c; - packetlen++; - } while (1); - -} - - -/* -============= -= -= WritePacket -= -============= -*/ - - - -void WritePacket (char *buffer, int len) -{ - int b; - char static localbuffer[MAXPACKET*2+2]; - - b = 0; - if (len > MAXPACKET) - return; - - while (len--) - { - if (*buffer == FRAMECHAR) - localbuffer[b++] = FRAMECHAR; // escape it for literal - localbuffer[b++] = *buffer++; - } - - localbuffer[b++] = FRAMECHAR; - localbuffer[b++] = 0; - - write_buffer (localbuffer, b); -} - - -/* -============= -= -= NetISR -= -============= -*/ - -void interrupt NetISR (void) -{ - if (doomcom.command == CMD_SEND) - { -//I_ColorBlack (0,0,63); - WritePacket ((char *)&doomcom.data, doomcom.datalength); - } - else if (doomcom.command == CMD_GET) - { -//I_ColorBlack (63,63,0); - - if (ReadPacket () && packetlen <= sizeof(doomcom.data) ) - { - doomcom.remotenode = 1; - doomcom.datalength = packetlen; - memcpy (&doomcom.data, &packet, packetlen); - } - else - doomcom.remotenode = -1; - - } -//I_ColorBlack (0,0,0); -} - - - - -/* -================= -= -= Connect -= -= Figures out who is player 0 and 1 -================= -*/ - -void Connect (void) -{ - struct time time; - int oldsec; - int localstage, remotestage; - char str[20]; - char idstr[7]; - char remoteidstr[7]; - unsigned long idnum; - int i; - -// -// wait for a good packet -// - printf (STR_ATTEMPT"\n"); - -// -// build a (hopefully) unique id string by hashing up the current milliseconds -// and the interrupt table -// - if (CheckParm ("-player1")) - idnum = 0; - else if (CheckParm ("-player2")) - idnum = 999999; - else - { - gettime (&time); - idnum = time.ti_sec*100+time.ti_hund; - for (i=0 ; i<512 ; i++) - idnum += ((unsigned far *)0)[i]; - idnum %= 1000000; - } - - idstr[0] = '0' + idnum/ 100000l; - idnum -= (idstr[0]-'0')*100000l; - idstr[1] = '0' + idnum/ 10000l; - idnum -= (idstr[1]-'0')*10000l; - idstr[2] = '0' + idnum/ 1000l; - idnum -= (idstr[2]-'0')*1000l; - idstr[3] = '0' + idnum/ 100l; - idnum -= (idstr[3]-'0')*100l; - idstr[4] = '0' + idnum/ 10l; - idnum -= (idstr[4]-'0')*10l; - idstr[5] = '0' + idnum; - idstr[6] = 0; - -// -// sit in a loop until things are worked out -// -// the packet is: ID000000_0 -// the first field is the idnum, the second is the acknowledge stage -// ack stage starts out 0, is bumped to 1 after the other computer's id -// is known, and is bumped to 2 after the other computer has raised to 1 -// - oldsec = -1; - localstage = remotestage = 0; - - do - { - while ( bioskey(1) ) - { - if ( (bioskey (0) & 0xff) == 27) - Error ("\n\n"STR_NETABORT); - } - - if (ReadPacket ()) - { - packet[packetlen] = 0; - printf ("read : %s\n",packet); - if (packetlen != 10) - continue; - if (strncmp(packet,"ID",2) ) - continue; - if (!strncmp (packet+2,idstr,6)) - Error ("\n\n"STR_DUPLICATE); - strncpy (remoteidstr,packet+2,6); - - remotestage = packet[9] - '0'; - localstage = remotestage+1; - oldsec = -1; - } - - gettime (&time); - if (time.ti_sec != oldsec) - { - oldsec = time.ti_sec; - sprintf (str,"ID%s_%i",idstr,localstage); - WritePacket (str,strlen(str)); - printf ("wrote: %s\n",str); - } - - } while (localstage < 2); - -// -// decide who is who -// - if (strcmp(remoteidstr,idstr) > 0) - doomcom.consoleplayer = 0; - else - doomcom.consoleplayer = 1; - - -// -// flush out any extras -// - while (ReadPacket ()) - ; -} - - - -/* -============== -= -= ModemCommand -= -============== -*/ - -void ModemCommand (char *str) -{ - int i,l; - - printf (STR_MODEMCMD,str); - l = strlen(str); - for (i=0 ; i=' ') - { - response[respptr] = c; - respptr++; - } - } while (1); - - } while (strncmp(response,resp,strlen(resp))); -} - - -/* -============= -= -= ReadLine -= -============= -*/ - -void ReadLine (FILE *f, char *dest) -{ - int c; - - do - { - c = fgetc (f); - if (c == EOF || c == '\r' || c == '\n') - break; - *dest++ = c; - } while (1); - *dest = 0; -} - - -/* -============= -= -= ReadModemCfg -= -============= -*/ - -void ReadModemCfg (void) -{ - int mcr; - FILE *f; - unsigned baud; - - f = fopen ("modem.cfg","r"); - if (!f) - Error (STR_CANTREAD); - ReadLine (f, startup); - ReadLine (f, shutdown); - ReadLine (f, baudrate); - fclose (f); - - baud = atol(baudrate); - if (baud) - baudbits = 115200l/baud; - - usemodem = true; -} - - -/* -============= -= -= Dial -= -============= -*/ - -void Dial (void) -{ - char cmd[80]; - int p; - - ModemCommand(startup); - ModemResponse ("OK"); - - printf ("\n"STR_DIALING"\n\n"); - p = CheckParm ("-dial"); - sprintf (cmd,"ATDT%s",myargv[p+1]); - - ModemCommand(cmd); - ModemResponse (STR_CONNECT); - doomcom.consoleplayer = 1; -} - - -/* -============= -= -= Answer -= -============= -*/ - -void Answer (void) -{ - ModemCommand(startup); - ModemResponse ("OK"); - printf ("\n"STR_WAITRING"\n\n"); - - ModemResponse (STR_RING); - ModemCommand ("ATA"); - ModemResponse (STR_CONNECT); - - doomcom.consoleplayer = 0; -} - -//======================================================== -// -// Find a Response File -// -//======================================================== -void FindResponseFile (void) -{ - int i; - #define MAXARGVS 100 - - for (i = 1;i < myargc;i++) - if (myargv[i][0] == '@') - { - FILE * handle; - int size; - int k; - int index; - int indexinfile; - char *infile; - char *file; - char *moreargs[20]; - char *firstargv; - - // READ THE RESPONSE FILE INTO MEMORY - handle = fopen (&myargv[i][1],"rb"); - if (!handle) - I_Error (STR_NORESP); - printf("Found response file \"%s\"!\n",strupr(&myargv[i][1])); - fseek (handle,0,SEEK_END); - size = ftell(handle); - fseek (handle,0,SEEK_SET); - file = malloc (size); - fread (file,size,1,handle); - fclose (handle); - - // KEEP ALL CMDLINE ARGS FOLLOWING @RESPONSEFILE ARG - for (index = 0,k = i+1; k < myargc; k++) - moreargs[index++] = myargv[k]; - - firstargv = myargv[0]; - myargv = malloc(sizeof(char *)*MAXARGVS); - memset(myargv,0,sizeof(char *)*MAXARGVS); - myargv[0] = firstargv; - - infile = file; - indexinfile = k = 0; - indexinfile++; // SKIP PAST ARGV[0] (KEEP IT) - do - { - myargv[indexinfile++] = infile+k; - while(k < size && - ((*(infile+k)>= ' '+1) && (*(infile+k)<='z'))) - k++; - *(infile+k) = 0; - while(k < size && - ((*(infile+k)<= ' ') || (*(infile+k)>'z'))) - k++; - } while(k < size); - - for (k = 0;k < index;k++) - myargv[indexinfile++] = moreargs[k]; - myargc = indexinfile; - - // DISPLAY ARGS -// printf("%d command-line args:\n",myargc); -// for (k=1;k -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#define INPUT(port) inportb(port) -#define OUTPUT(port,data) outportb(port,data) -#define CLI() disable() -#define STI() enable() - - -typedef enum {false, true} boolean; -typedef unsigned char byte; - - -#define TRANSMIT_HOLDING_REGISTER 0x00 -#define RECEIVE_BUFFER_REGISTER 0x00 -#define INTERRUPT_ENABLE_REGISTER 0x01 -#define IER_RX_DATA_READY 0x01 -#define IER_TX_HOLDING_REGISTER_EMPTY 0x02 -#define IER_LINE_STATUS 0x04 -#define IER_MODEM_STATUS 0x08 -#define INTERRUPT_ID_REGISTER 0x02 -#define IIR_MODEM_STATUS_INTERRUPT 0x00 -#define IIR_TX_HOLDING_REGISTER_INTERRUPT 0x02 -#define IIR_RX_DATA_READY_INTERRUPT 0x04 -#define IIR_LINE_STATUS_INTERRUPT 0x06 -#define FIFO_CONTROL_REGISTER 0x02 -#define FCR_FIFO_ENABLE 0x01 -#define FCR_RCVR_FIFO_RESET 0x02 -#define FCR_XMIT_FIFO_RESET 0x04 -#define FCR_RCVR_TRIGGER_LSB 0x40 -#define FCR_RCVR_TRIGGER_MSB 0x80 -#define FCR_TRIGGER_01 0x00 -#define FCR_TRIGGER_04 0x40 -#define FCR_TRIGGER_08 0x80 -#define FCR_TRIGGER_14 0xc0 -#define LINE_CONTROL_REGISTER 0x03 -#define LCR_WORD_LENGTH_MASK 0x03 -#define LCR_WORD_LENGTH_SELECT_0 0x01 -#define LCR_WORD_LENGTH_SELECT_1 0x02 -#define LCR_STOP_BITS 0x04 -#define LCR_PARITY_MASK 0x38 -#define LCR_PARITY_ENABLE 0x08 -#define LCR_EVEN_PARITY_SELECT 0x10 -#define LCR_STICK_PARITY 0x20 -#define LCR_SET_BREAK 0x40 -#define LCR_DLAB 0x80 -#define MODEM_CONTROL_REGISTER 0x04 -#define MCR_DTR 0x01 -#define MCR_RTS 0x02 -#define MCR_OUT1 0x04 -#define MCR_OUT2 0x08 -#define MCR_LOOPBACK 0x10 -#define LINE_STATUS_REGISTER 0x05 -#define LSR_DATA_READY 0x01 -#define LSR_OVERRUN_ERROR 0x02 -#define LSR_PARITY_ERROR 0x04 -#define LSR_FRAMING_ERROR 0x08 -#define LSR_BREAK_DETECT 0x10 -#define LSR_THRE 0x20 -#define MODEM_STATUS_REGISTER 0x06 -#define MSR_DELTA_CTS 0x01 -#define MSR_DELTA_DSR 0x02 -#define MSR_TERI 0x04 -#define MSR_DELTA_CD 0x08 -#define MSR_CTS 0x10 -#define MSR_DSR 0x20 -#define MSR_RI 0x40 -#define MSR_CD 0x80 -#define DIVISOR_LATCH_LOW 0x00 -#define DIVISOR_LATCH_HIGH 0x01 - - - -#define QUESIZE 2048 - -typedef struct -{ - long head, tail; // bytes are put on head and pulled from tail - unsigned char data[QUESIZE]; -} que_t; - -void InitPort (void); -void ShutdownPort (void); - -int read_byte( void ); -void write_byte( int c ); - - -void Error (char *error, ...); - -extern int argc; -extern char **argv; diff --git a/sersrc/SERSTR.H b/sersrc/SERSTR.H deleted file mode 100644 index 39ce5dc..0000000 --- a/sersrc/SERSTR.H +++ /dev/null @@ -1,21 +0,0 @@ -#define STR_DROPDTR "Dropping DTR" -#define STR_CLEANEXIT "Clean exit from SERSETUP" -#define STR_ATTEMPT "Attempting to connect across serial link, press escape to abort." -#define STR_NETABORT "Network game synchronization aborted." -#define STR_DUPLICATE "Duplicate id string, try again or check modem init string." -#define STR_MODEMCMD "Modem command : " -#define STR_MODEMRESP "Modem response: " -#define STR_RESPABORT "Modem response aborted." -#define STR_CANTREAD "Couldn't read MODEM.CFG" -#define STR_DIALING "Dialing..." -#define STR_CONNECT "CONNECT" -#define STR_WAITRING "Waiting for ring..." -#define STR_RING "RING" -#define STR_NORESP "No such response file!" -#define STR_DOOMSERIAL "DOOM II SERIAL DEVICE DRIVER v1.4" -#define STR_WARNING \ -"Warning: no NULL or iret interrupt vectors were found in the 0x60 to 0x66\n"\ -"range. You can specify a vector with the -vector 0x parameter.\n" -#define STR_COMM "Communicating with interrupt vector 0x%x" -#define STR_RETURNED "Returned from DOOM II" -#define STR_PORTSET "Setting port to %lu baud" diff --git a/sersrc/SER_FRCH.H b/sersrc/SER_FRCH.H deleted file mode 100644 index f265058..0000000 --- a/sersrc/SER_FRCH.H +++ /dev/null @@ -1,25 +0,0 @@ -#define STR_DROPDTR "Abandon de DTR" -#define STR_CLEANEXIT "Sortie normale de SERSETUP" -#define STR_ATTEMPT "Tentative de connexion en s‚rie, appuyez sur ESC pour annuler." -#define STR_NETABORT "Synchronisation de jeu sur r‚seau annul‚e." -#define STR_DUPLICATE "ChaŒne id en double. R‚essayez ou v‚rifiez la chaŒne d'initialistion du modem." -#define STR_MODEMCMD "Commande du modem: " -#define STR_MODEMRESP "R‚ponse du modem: " -#define STR_RESPABORT "R‚ponse du modem annul‚e." -#define STR_CANTREAD "Lecture de MODEM.CFG impossible" -#define STR_DIALING "Composition du num‚ro..." -#define STR_CONNECT "CONNECTION" -#define STR_WAITRING "Attente d'appel..." -#define STR_RING "APPEL" -#define STR_NORESP "Ce fichier de r‚ponse n'existe pas!" -#define STR_DOOMSERIAL "GESTIONNAIRE DE LIAISON SERIE DOOM II v1.4" -#define STR_WARNING \ -"Attention: pas de vecteurs d'interruption NULL ou iret trouv‚s entre 0x60 et 0x66.\n"\ -"Vous pouvez sp‚cifier un vecteur avec le paramŠtre -vector 0x." -#define STR_COMM "Communication avec le vecteur d'interruption 0x%x" -#define STR_RETURNED "Retour de DOOM II" -#define STR_PORTLOOK "Recherche de l'UART sur le port" -#define STR_UART8250 "UART = 8250" -#define STR_UART16550 "UART = 16550" -#define STR_CLEARPEND "Riinitilisation des interruptions en attente.\n" -#define STR_PORTSET "Réglage du port à %lu baud" diff --git a/sndserv/Makefile b/sndserv/Makefile deleted file mode 100644 index 239ad57..0000000 --- a/sndserv/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -########################################################## -# -# $Id:$ -# -# $Log:$ -# -# - -CC=gcc -CFLAGS=-O -DNORMALUNIX -DLINUX -LDFLAGS= -LIBS=-lm - -O=linux - -all: $(O)/sndserver - -clean: - rm -f *.o *~ *.flc - rm -f linux/* - -# Target -$(O)/sndserver: \ - $(O)/soundsrv.o \ - $(O)/sounds.o \ - $(O)/wadread.o \ - $(O)/linux.o - $(CC) $(CFLAGS) $(LDFLAGS) \ - $(O)/soundsrv.o \ - $(O)/sounds.o \ - $(O)/wadread.o \ - $(O)/linux.o -o $(O)/sndserver $(LIBS) - echo make complete. - -# Rule -$(O)/%.o: %.c - $(CC) $(CFLAGS) -c $< -o $@ - - diff --git a/sndserv/README.sndserv b/sndserv/README.sndserv deleted file mode 100644 index 8a607e2..0000000 --- a/sndserv/README.sndserv +++ /dev/null @@ -1,15 +0,0 @@ - -This is the soundserver as used by the original -Linuxdoom release. I separated the source from -the actual Linuxduum source. For various reasons -the separate sound process seems to give the -best results - both synchronous and timer driven -output demonstrate glitches. These might either -be timing issues, or introduced by the changes -I made to the linux sound code while merging it -back into the main tree. - -Note that neither John Carmack nor Dave Taylor -are responsible for the current sound handling. - - \ No newline at end of file diff --git a/sndserv/linux.c b/sndserv/linux.c deleted file mode 100644 index 93b067d..0000000 --- a/sndserv/linux.c +++ /dev/null @@ -1,118 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// $Id: linux.c,v 1.3 1997/01/26 07:45:01 b1 Exp $ -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This source is available for distribution and/or modification -// only under the terms of the DOOM Source Code License as -// published by id Software. All rights reserved. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License -// for more details. -// -// -// $Log: linux.c,v $ -// Revision 1.3 1997/01/26 07:45:01 b1 -// 2nd formatting run, fixed a few warnings as well. -// -// Revision 1.2 1997/01/21 19:00:01 b1 -// First formatting run: -// using Emacs cc-mode.el indentation for C++ now. -// -// Revision 1.1 1997/01/19 17:22:45 b1 -// Initial check in DOOM sources as of Jan. 10th, 1997 -// -// -// DESCRIPTION: -// UNIX, soundserver for Linux i386. -// -//----------------------------------------------------------------------------- - -static const char rcsid[] = "$Id: linux.c,v 1.3 1997/01/26 07:45:01 b1 Exp $"; - - -#include -#include -#include -#include - -#include - -#include "soundsrv.h" - -int audio_fd; - -void -myioctl -( int fd, - int command, - int* arg ) -{ - int rc; - extern int errno; - - rc = ioctl(fd, command, arg); - if (rc < 0) - { - fprintf(stderr, "ioctl(dsp,%d,arg) failed\n", command); - fprintf(stderr, "errno=%d\n", errno); - exit(-1); - } -} - -void I_InitMusic(void) -{ -} - -void -I_InitSound -( int samplerate, - int samplesize ) -{ - - int i; - - audio_fd = open("/dev/dsp", O_WRONLY); - if (audio_fd<0) - fprintf(stderr, "Could not open /dev/dsp\n"); - - - i = 11 | (2<<16); - myioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &i); - - myioctl(audio_fd, SNDCTL_DSP_RESET, 0); - i=11025; - myioctl(audio_fd, SNDCTL_DSP_SPEED, &i); - i=1; - myioctl(audio_fd, SNDCTL_DSP_STEREO, &i); - - myioctl(audio_fd, SNDCTL_DSP_GETFMTS, &i); - if (i&=AFMT_S16_LE) - myioctl(audio_fd, SNDCTL_DSP_SETFMT, &i); - else - fprintf(stderr, "Could not play signed 16 data\n"); - -} - -void -I_SubmitOutputBuffer -( void* samples, - int samplecount ) -{ - write(audio_fd, samples, samplecount*4); -} - -void I_ShutdownSound(void) -{ - - close(audio_fd); - -} - -void I_ShutdownMusic(void) -{ -} diff --git a/sndserv/sounds.c b/sndserv/sounds.c deleted file mode 100644 index 2cdea16..0000000 --- a/sndserv/sounds.c +++ /dev/null @@ -1,239 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// $Id: sounds.c,v 1.3 1997/01/29 22:40:44 b1 Exp $ -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This source is available for distribution and/or modification -// only under the terms of the DOOM Source Code License as -// published by id Software. All rights reserved. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License -// for more details. -// -// -// $Log: sounds.c,v $ -// Revision 1.3 1997/01/29 22:40:44 b1 -// Reformatting, S (sound) module files. -// -// Revision 1.2 1997/01/21 19:00:07 b1 -// First formatting run: -// using Emacs cc-mode.el indentation for C++ now. -// -// Revision 1.1 1997/01/19 17:22:50 b1 -// Initial check in DOOM sources as of Jan. 10th, 1997 -// -// -// DESCRIPTION: -// Created by Dave Taylor's sound utility. -// Kept as a sample, DOOM sounds. -// -//----------------------------------------------------------------------------- - - -static const char rcsid[] = "$Id: sounds.c,v 1.3 1997/01/29 22:40:44 b1 Exp $"; - - - -// Not exactly a good idea. -enum { false, true }; - -#include "sounds.h" - -// -// Information about all the music -// - -musicinfo_t S_music[] = -{ - { 0 }, - { "e1m1", 0 }, - { "e1m2", 0 }, - { "e1m3", 0 }, - { "e1m4", 0 }, - { "e1m5", 0 }, - { "e1m6", 0 }, - { "e1m7", 0 }, - { "e1m8", 0 }, - { "e1m9", 0 }, - { "e2m1", 0 }, - { "e2m2", 0 }, - { "e2m3", 0 }, - { "e2m4", 0 }, - { "e2m5", 0 }, - { "e2m6", 0 }, - { "e2m7", 0 }, - { "e2m8", 0 }, - { "e2m9", 0 }, - { "e3m1", 0 }, - { "e3m2", 0 }, - { "e3m3", 0 }, - { "e3m4", 0 }, - { "e3m5", 0 }, - { "e3m6", 0 }, - { "e3m7", 0 }, - { "e3m8", 0 }, - { "e3m9", 0 }, - { "inter", 0 }, - { "intro", 0 }, - { "bunny", 0 }, - { "victor", 0 }, - { "introa", 0 }, - { "runnin", 0 }, - { "stalks", 0 }, - { "countd", 0 }, - { "betwee", 0 }, - { "doom", 0 }, - { "the_da", 0 }, - { "shawn", 0 }, - { "ddtblu", 0 }, - { "in_cit", 0 }, - { "dead", 0 }, - { "stlks2", 0 }, - { "theda2", 0 }, - { "doom2", 0 }, - { "ddtbl2", 0 }, - { "runni2", 0 }, - { "dead2", 0 }, - { "stlks3", 0 }, - { "romero", 0 }, - { "shawn2", 0 }, - { "messag", 0 }, - { "count2", 0 }, - { "ddtbl3", 0 }, - { "ampie", 0 }, - { "theda3", 0 }, - { "adrian", 0 }, - { "messg2", 0 }, - { "romer2", 0 }, - { "tense", 0 }, - { "shawn3", 0 }, - { "openin", 0 }, - { "evil", 0 }, - { "ultima", 0 }, - { "read_m", 0 }, - { "dm2ttl", 0 }, - { "dm2int", 0 } -}; - - -// -// Information about all the sfx -// - -sfxinfo_t S_sfx[] = -{ - { 0 }, - { "pistol", false, 64, 0, -1, -1, 0 }, - { "shotgn", false, 64, 0, -1, -1, 0 }, - { "sgcock", false, 64, 0, -1, -1, 0 }, - { "dshtgn", false, 64, 0, -1, -1, 0 }, - { "dbopn", false, 64, 0, -1, -1, 0 }, - { "dbcls", false, 64, 0, -1, -1, 0 }, - { "dbload", false, 64, 0, -1, -1, 0 }, - { "plasma", false, 64, 0, -1, -1, 0 }, - { "bfg", false, 64, 0, -1, -1, 0 }, - { "sawup", false, 64, 0, -1, -1, 0 }, - { "sawidl", false, 118, 0, -1, -1, 0 }, - { "sawful", false, 64, 0, -1, -1, 0 }, - { "sawhit", false, 64, 0, -1, -1, 0 }, - { "rlaunc", false, 64, 0, -1, -1, 0 }, - { "rxplod", false, 70, 0, -1, -1, 0 }, - { "firsht", false, 70, 0, -1, -1, 0 }, - { "firxpl", false, 70, 0, -1, -1, 0 }, - { "pstart", false, 100, 0, -1, -1, 0 }, - { "pstop", false, 100, 0, -1, -1, 0 }, - { "doropn", false, 100, 0, -1, -1, 0 }, - { "dorcls", false, 100, 0, -1, -1, 0 }, - { "stnmov", false, 119, 0, -1, -1, 0 }, - { "swtchn", false, 78, 0, -1, -1, 0 }, - { "swtchx", false, 78, 0, -1, -1, 0 }, - { "plpain", false, 96, 0, -1, -1, 0 }, - { "dmpain", false, 96, 0, -1, -1, 0 }, - { "popain", false, 96, 0, -1, -1, 0 }, - { "vipain", false, 96, 0, -1, -1, 0 }, - { "mnpain", false, 96, 0, -1, -1, 0 }, - { "pepain", false, 96, 0, -1, -1, 0 }, - { "slop", false, 78, 0, -1, -1, 0 }, - { "itemup", true, 78, 0, -1, -1, 0 }, - { "wpnup", true, 78, 0, -1, -1, 0 }, - { "oof", false, 96, 0, -1, -1, 0 }, - { "telept", false, 32, 0, -1, -1, 0 }, - { "posit1", true, 98, 0, -1, -1, 0 }, - { "posit2", true, 98, 0, -1, -1, 0 }, - { "posit3", true, 98, 0, -1, -1, 0 }, - { "bgsit1", true, 98, 0, -1, -1, 0 }, - { "bgsit2", true, 98, 0, -1, -1, 0 }, - { "sgtsit", true, 98, 0, -1, -1, 0 }, - { "cacsit", true, 98, 0, -1, -1, 0 }, - { "brssit", true, 94, 0, -1, -1, 0 }, - { "cybsit", true, 92, 0, -1, -1, 0 }, - { "spisit", true, 90, 0, -1, -1, 0 }, - { "bspsit", true, 90, 0, -1, -1, 0 }, - { "kntsit", true, 90, 0, -1, -1, 0 }, - { "vilsit", true, 90, 0, -1, -1, 0 }, - { "mansit", true, 90, 0, -1, -1, 0 }, - { "pesit", true, 90, 0, -1, -1, 0 }, - { "sklatk", false, 70, 0, -1, -1, 0 }, - { "sgtatk", false, 70, 0, -1, -1, 0 }, - { "skepch", false, 70, 0, -1, -1, 0 }, - { "vilatk", false, 70, 0, -1, -1, 0 }, - { "claw", false, 70, 0, -1, -1, 0 }, - { "skeswg", false, 70, 0, -1, -1, 0 }, - { "pldeth", false, 32, 0, -1, -1, 0 }, - { "pdiehi", false, 32, 0, -1, -1, 0 }, - { "podth1", false, 70, 0, -1, -1, 0 }, - { "podth2", false, 70, 0, -1, -1, 0 }, - { "podth3", false, 70, 0, -1, -1, 0 }, - { "bgdth1", false, 70, 0, -1, -1, 0 }, - { "bgdth2", false, 70, 0, -1, -1, 0 }, - { "sgtdth", false, 70, 0, -1, -1, 0 }, - { "cacdth", false, 70, 0, -1, -1, 0 }, - { "skldth", false, 70, 0, -1, -1, 0 }, - { "brsdth", false, 32, 0, -1, -1, 0 }, - { "cybdth", false, 32, 0, -1, -1, 0 }, - { "spidth", false, 32, 0, -1, -1, 0 }, - { "bspdth", false, 32, 0, -1, -1, 0 }, - { "vildth", false, 32, 0, -1, -1, 0 }, - { "kntdth", false, 32, 0, -1, -1, 0 }, - { "pedth", false, 32, 0, -1, -1, 0 }, - { "skedth", false, 32, 0, -1, -1, 0 }, - { "posact", true, 120, 0, -1, -1, 0 }, - { "bgact", true, 120, 0, -1, -1, 0 }, - { "dmact", true, 120, 0, -1, -1, 0 }, - { "bspact", true, 100, 0, -1, -1, 0 }, - { "bspwlk", true, 100, 0, -1, -1, 0 }, - { "vilact", true, 100, 0, -1, -1, 0 }, - { "noway", false, 78, 0, -1, -1, 0 }, - { "barexp", false, 60, 0, -1, -1, 0 }, - { "punch", false, 64, 0, -1, -1, 0 }, - { "hoof", false, 70, 0, -1, -1, 0 }, - { "metal", false, 70, 0, -1, -1, 0 }, - { "chgun", false, 64, &S_sfx[sfx_pistol], 150, 0, 0 }, - { "tink", false, 60, 0, -1, -1, 0 }, - { "bdopn", false, 100, 0, -1, -1, 0 }, - { "bdcls", false, 100, 0, -1, -1, 0 }, - { "itmbk", false, 100, 0, -1, -1, 0 }, - { "flame", false, 32, 0, -1, -1, 0 }, - { "flamst", false, 32, 0, -1, -1, 0 }, - { "getpow", false, 60, 0, -1, -1, 0 }, - { "bospit", false, 70, 0, -1, -1, 0 }, - { "boscub", false, 70, 0, -1, -1, 0 }, - { "bossit", false, 70, 0, -1, -1, 0 }, - { "bospn", false, 70, 0, -1, -1, 0 }, - { "bosdth", false, 70, 0, -1, -1, 0 }, - { "manatk", false, 70, 0, -1, -1, 0 }, - { "mandth", false, 70, 0, -1, -1, 0 }, - { "sssit", false, 70, 0, -1, -1, 0 }, - { "ssdth", false, 70, 0, -1, -1, 0 }, - { "keenpn", false, 70, 0, -1, -1, 0 }, - { "keendt", false, 70, 0, -1, -1, 0 }, - { "skeact", false, 70, 0, -1, -1, 0 }, - { "skesit", false, 70, 0, -1, -1, 0 }, - { "skeatk", false, 70, 0, -1, -1, 0 }, - { "radio", false, 60, 0, -1, -1, 0 } -}; - diff --git a/sndserv/sounds.h b/sndserv/sounds.h deleted file mode 100644 index fd9279e..0000000 --- a/sndserv/sounds.h +++ /dev/null @@ -1,241 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// $Id: sounds.h,v 1.3 1997/01/29 22:40:44 b1 Exp $ -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This source is available for distribution and/or modification -// only under the terms of the DOOM Source Code License as -// published by id Software. All rights reserved. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License -// for more details. -// -// -// $Log: sounds.h,v $ -// Revision 1.3 1997/01/29 22:40:44 b1 -// Reformatting, S (sound) module files. -// -// Revision 1.2 1997/01/21 19:00:07 b1 -// First formatting run: -// using Emacs cc-mode.el indentation for C++ now. -// -// Revision 1.1 1997/01/19 17:22:50 b1 -// Initial check in DOOM sources as of Jan. 10th, 1997 -// -// -// DESCRIPTION: -// Created by Dave Taylor's sound utility. -// Kept as a sample, DOOM sounds. -// -//----------------------------------------------------------------------------- - -#ifndef __SOUNDSH__ -#define __SOUNDSH__ - -#include "soundst.h" - -// -// Identifiers for all music in game. -// - -typedef enum -{ - mus_None, - mus_e1m1, - mus_e1m2, - mus_e1m3, - mus_e1m4, - mus_e1m5, - mus_e1m6, - mus_e1m7, - mus_e1m8, - mus_e1m9, - mus_e2m1, - mus_e2m2, - mus_e2m3, - mus_e2m4, - mus_e2m5, - mus_e2m6, - mus_e2m7, - mus_e2m8, - mus_e2m9, - mus_e3m1, - mus_e3m2, - mus_e3m3, - mus_e3m4, - mus_e3m5, - mus_e3m6, - mus_e3m7, - mus_e3m8, - mus_e3m9, - mus_inter, - mus_intro, - mus_bunny, - mus_victor, - mus_introa, - mus_runnin, - mus_stalks, - mus_countd, - mus_betwee, - mus_doom, - mus_the_da, - mus_shawn, - mus_ddtblu, - mus_in_cit, - mus_dead, - mus_stlks2, - mus_theda2, - mus_doom2, - mus_ddtbl2, - mus_runni2, - mus_dead2, - mus_stlks3, - mus_romero, - mus_shawn2, - mus_messag, - mus_count2, - mus_ddtbl3, - mus_ampie, - mus_theda3, - mus_adrian, - mus_messg2, - mus_romer2, - mus_tense, - mus_shawn3, - mus_openin, - mus_evil, - mus_ultima, - mus_read_m, - mus_dm2ttl, - mus_dm2int, - NUMMUSIC -} musicenum_t; - - -// -// Identifiers for all sfx in game. -// - -typedef enum -{ - sfx_None, - sfx_pistol, - sfx_shotgn, - sfx_sgcock, - sfx_dshtgn, - sfx_dbopn, - sfx_dbcls, - sfx_dbload, - sfx_plasma, - sfx_bfg, - sfx_sawup, - sfx_sawidl, - sfx_sawful, - sfx_sawhit, - sfx_rlaunc, - sfx_rxplod, - sfx_firsht, - sfx_firxpl, - sfx_pstart, - sfx_pstop, - sfx_doropn, - sfx_dorcls, - sfx_stnmov, - sfx_swtchn, - sfx_swtchx, - sfx_plpain, - sfx_dmpain, - sfx_popain, - sfx_vipain, - sfx_mnpain, - sfx_pepain, - sfx_slop, - sfx_itemup, - sfx_wpnup, - sfx_oof, - sfx_telept, - sfx_posit1, - sfx_posit2, - sfx_posit3, - sfx_bgsit1, - sfx_bgsit2, - sfx_sgtsit, - sfx_cacsit, - sfx_brssit, - sfx_cybsit, - sfx_spisit, - sfx_bspsit, - sfx_kntsit, - sfx_vilsit, - sfx_mansit, - sfx_pesit, - sfx_sklatk, - sfx_sgtatk, - sfx_skepch, - sfx_vilatk, - sfx_claw, - sfx_skeswg, - sfx_pldeth, - sfx_pdiehi, - sfx_podth1, - sfx_podth2, - sfx_podth3, - sfx_bgdth1, - sfx_bgdth2, - sfx_sgtdth, - sfx_cacdth, - sfx_skldth, - sfx_brsdth, - sfx_cybdth, - sfx_spidth, - sfx_bspdth, - sfx_vildth, - sfx_kntdth, - sfx_pedth, - sfx_skedth, - sfx_posact, - sfx_bgact, - sfx_dmact, - sfx_bspact, - sfx_bspwlk, - sfx_vilact, - sfx_noway, - sfx_barexp, - sfx_punch, - sfx_hoof, - sfx_metal, - sfx_chgun, - sfx_tink, - sfx_bdopn, - sfx_bdcls, - sfx_itmbk, - sfx_flame, - sfx_flamst, - sfx_getpow, - sfx_bospit, - sfx_boscub, - sfx_bossit, - sfx_bospn, - sfx_bosdth, - sfx_manatk, - sfx_mandth, - sfx_sssit, - sfx_ssdth, - sfx_keenpn, - sfx_keendt, - sfx_skeact, - sfx_skesit, - sfx_skeatk, - sfx_radio, - NUMSFX -} sfxenum_t; - -extern musicinfo_t S_music[]; -extern sfxinfo_t S_sfx[]; - -#endif - diff --git a/sndserv/soundsrv.c b/sndserv/soundsrv.c deleted file mode 100644 index a2fe0b0..0000000 --- a/sndserv/soundsrv.c +++ /dev/null @@ -1,740 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// $Id: soundsrv.c,v 1.3 1997/01/29 22:40:44 b1 Exp $ -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This source is available for distribution and/or modification -// only under the terms of the DOOM Source Code License as -// published by id Software. All rights reserved. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License -// for more details. -// -// -// $Log: soundsrv.c,v $ -// Revision 1.3 1997/01/29 22:40:44 b1 -// Reformatting, S (sound) module files. -// -// Revision 1.2 1997/01/21 19:00:07 b1 -// First formatting run: -// using Emacs cc-mode.el indentation for C++ now. -// -// Revision 1.1 1997/01/19 17:22:50 b1 -// Initial check in DOOM sources as of Jan. 10th, 1997 -// -// -// DESCRIPTION: -// UNIX soundserver, run as a separate process, -// started by DOOM program. -// Originally conceived fopr SGI Irix, -// mostly used with Linux voxware. -// -//----------------------------------------------------------------------------- - - -static const char rcsid[] = "$Id: soundsrv.c,v 1.3 1997/01/29 22:40:44 b1 Exp $"; - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sounds.h" -#include "soundsrv.h" -#include "wadread.h" - - - -// -// Department of Redundancy Department. -// -typedef struct wadinfo_struct -{ - // should be IWAD - char identification[4]; - int numlumps; - int infotableofs; - -} wadinfo_t; - - -typedef struct filelump_struct -{ - int filepos; - int size; - char name[8]; - -} filelump_t; - - -// an internal time keeper -static int mytime = 0; - -// number of sound effects -int numsounds; - -// longest sound effect -int longsound; - -// lengths of all sound effects -int lengths[NUMSFX]; - -// mixing buffer -signed short mixbuffer[MIXBUFFERSIZE]; - -// file descriptor of sfx device -int sfxdevice; - -// file descriptor of music device -int musdevice; - -// the channel data pointers -unsigned char* channels[8]; - -// the channel step amount -unsigned int channelstep[8]; - -// 0.16 bit remainder of last step -unsigned int channelstepremainder[8]; - -// the channel data end pointers -unsigned char* channelsend[8]; - -// time that the channel started playing -int channelstart[8]; - -// the channel handles -int channelhandles[8]; - -// the channel left volume lookup -int* channelleftvol_lookup[8]; - -// the channel right volume lookup -int* channelrightvol_lookup[8]; - -// sfx id of the playing sound effect -int channelids[8]; - -int snd_verbose=1; - -int steptable[256]; - -int vol_lookup[128*256]; - -static void derror(char* msg) -{ - fprintf(stderr, "error: %s\n", msg); - exit(-1); -} - -int mix(void) -{ - - register int dl; - register int dr; - register unsigned int sample; - - signed short* leftout; - signed short* rightout; - signed short* leftend; - - int step; - - leftout = mixbuffer; - rightout = mixbuffer+1; - step = 2; - - leftend = mixbuffer + SAMPLECOUNT*step; - - // mix into the mixing buffer - while (leftout != leftend) - { - - dl = 0; - dr = 0; - - if (channels[0]) - { - sample = *channels[0]; - dl += channelleftvol_lookup[0][sample]; - dr += channelrightvol_lookup[0][sample]; - channelstepremainder[0] += channelstep[0]; - channels[0] += channelstepremainder[0] >> 16; - channelstepremainder[0] &= 65536-1; - - if (channels[0] >= channelsend[0]) - channels[0] = 0; - } - - if (channels[1]) - { - sample = *channels[1]; - dl += channelleftvol_lookup[1][sample]; - dr += channelrightvol_lookup[1][sample]; - channelstepremainder[1] += channelstep[1]; - channels[1] += channelstepremainder[1] >> 16; - channelstepremainder[1] &= 65536-1; - - if (channels[1] >= channelsend[1]) - channels[1] = 0; - } - - if (channels[2]) - { - sample = *channels[2]; - dl += channelleftvol_lookup[2][sample]; - dr += channelrightvol_lookup[2][sample]; - channelstepremainder[2] += channelstep[2]; - channels[2] += channelstepremainder[2] >> 16; - channelstepremainder[2] &= 65536-1; - - if (channels[2] >= channelsend[2]) - channels[2] = 0; - } - - if (channels[3]) - { - sample = *channels[3]; - dl += channelleftvol_lookup[3][sample]; - dr += channelrightvol_lookup[3][sample]; - channelstepremainder[3] += channelstep[3]; - channels[3] += channelstepremainder[3] >> 16; - channelstepremainder[3] &= 65536-1; - - if (channels[3] >= channelsend[3]) - channels[3] = 0; - } - - if (channels[4]) - { - sample = *channels[4]; - dl += channelleftvol_lookup[4][sample]; - dr += channelrightvol_lookup[4][sample]; - channelstepremainder[4] += channelstep[4]; - channels[4] += channelstepremainder[4] >> 16; - channelstepremainder[4] &= 65536-1; - - if (channels[4] >= channelsend[4]) - channels[4] = 0; - } - - if (channels[5]) - { - sample = *channels[5]; - dl += channelleftvol_lookup[5][sample]; - dr += channelrightvol_lookup[5][sample]; - channelstepremainder[5] += channelstep[5]; - channels[5] += channelstepremainder[5] >> 16; - channelstepremainder[5] &= 65536-1; - - if (channels[5] >= channelsend[5]) - channels[5] = 0; - } - - if (channels[6]) - { - sample = *channels[6]; - dl += channelleftvol_lookup[6][sample]; - dr += channelrightvol_lookup[6][sample]; - channelstepremainder[6] += channelstep[6]; - channels[6] += channelstepremainder[6] >> 16; - channelstepremainder[6] &= 65536-1; - - if (channels[6] >= channelsend[6]) - channels[6] = 0; - } - if (channels[7]) - { - sample = *channels[7]; - dl += channelleftvol_lookup[7][sample]; - dr += channelrightvol_lookup[7][sample]; - channelstepremainder[7] += channelstep[7]; - channels[7] += channelstepremainder[7] >> 16; - channelstepremainder[7] &= 65536-1; - - if (channels[7] >= channelsend[7]) - channels[7] = 0; - } - - // Has been char instead of short. - // if (dl > 127) *leftout = 127; - // else if (dl < -128) *leftout = -128; - // else *leftout = dl; - - // if (dr > 127) *rightout = 127; - // else if (dr < -128) *rightout = -128; - // else *rightout = dr; - - if (dl > 0x7fff) - *leftout = 0x7fff; - else if (dl < -0x8000) - *leftout = -0x8000; - else - *leftout = dl; - - if (dr > 0x7fff) - *rightout = 0x7fff; - else if (dr < -0x8000) - *rightout = -0x8000; - else - *rightout = dr; - - leftout += step; - rightout += step; - - } - return 1; -} - - - -void -grabdata -( int c, - char** v ) -{ - int i; - char* name; - char* doom1wad; - char* doomwad; - char* doomuwad; - char* doom2wad; - char* doom2fwad; - // Now where are TNT and Plutonia. Yuck. - - // char *home; - char* doomwaddir; - - doomwaddir = getenv("DOOMWADDIR"); - - if (!doomwaddir) - doomwaddir = "."; - - doom1wad = malloc(strlen(doomwaddir)+1+9+1); - sprintf(doom1wad, "%s/doom1.wad", doomwaddir); - - doom2wad = malloc(strlen(doomwaddir)+1+9+1); - sprintf(doom2wad, "%s/doom2.wad", doomwaddir); - - doom2fwad = malloc(strlen(doomwaddir)+1+10+1); - sprintf(doom2fwad, "%s/doom2f.wad", doomwaddir); - - doomuwad = malloc(strlen(doomwaddir)+1+8+1); - sprintf(doomuwad, "%s/doomu.wad", doomwaddir); - - doomwad = malloc(strlen(doomwaddir)+1+8+1); - sprintf(doomwad, "%s/doom.wad", doomwaddir); - - // home = getenv("HOME"); - // if (!home) - // derror("Please set $HOME to your home directory"); - // sprintf(basedefault, "%s/.doomrc", home); - - - for (i=1 ; idata; - lengths[i] = lengths[(S_sfx[i].link - S_sfx)/sizeof(sfxinfo_t)]; - } - // test only - // { - // int fd; - // char name[10]; - // sprintf(name, "sfx%d", i); - // fd = open(name, O_WRONLY|O_CREAT, 0644); - // write(fd, S_sfx[i].data, lengths[i]); - // close(fd); - // } - } - -} - -static struct timeval last={0,0}; -//static struct timeval now; - -static struct timezone whocares; - -void updatesounds(void) -{ - - mix(); - I_SubmitOutputBuffer(mixbuffer, SAMPLECOUNT); - -} - -int -addsfx -( int sfxid, - int volume, - int step, - int seperation ) -{ - static unsigned short handlenums = 0; - - int i; - int rc = -1; - - int oldest = mytime; - int oldestnum = 0; - int slot; - int rightvol; - int leftvol; - - // play these sound effects - // only one at a time - if ( sfxid == sfx_sawup - || sfxid == sfx_sawidl - || sfxid == sfx_sawful - || sfxid == sfx_sawhit - || sfxid == sfx_stnmov - || sfxid == sfx_pistol ) - { - for (i=0 ; i<8 ; i++) - { - if (channels[i] && channelids[i] == sfxid) - { - channels[i] = 0; - break; - } - } - } - - for (i=0 ; i<8 && channels[i] ; i++) - { - if (channelstart[i] < oldest) - { - oldestnum = i; - oldest = channelstart[i]; - } - } - - if (i == 8) - slot = oldestnum; - else - slot = i; - - channels[slot] = (unsigned char *) S_sfx[sfxid].data; - channelsend[slot] = channels[slot] + lengths[sfxid]; - - if (!handlenums) - handlenums = 100; - - channelhandles[slot] = rc = handlenums++; - channelstep[slot] = step; - channelstepremainder[slot] = 0; - channelstart[slot] = mytime; - - // (range: 1 - 256) - seperation += 1; - - // (x^2 seperation) - leftvol = - volume - (volume*seperation*seperation)/(256*256); - - seperation = seperation - 257; - - // (x^2 seperation) - rightvol = - volume - (volume*seperation*seperation)/(256*256); - - // sanity check - if (rightvol < 0 || rightvol > 127) - derror("rightvol out of bounds"); - - if (leftvol < 0 || leftvol > 127) - derror("leftvol out of bounds"); - - // get the proper lookup table piece - // for this volume level - channelleftvol_lookup[slot] = &vol_lookup[leftvol*256]; - channelrightvol_lookup[slot] = &vol_lookup[rightvol*256]; - - channelids[slot] = sfxid; - - return rc; - -} - - -void outputushort(int num) -{ - - static unsigned char buff[5] = { 0, 0, 0, 0, '\n' }; - static char* badbuff = "xxxx\n"; - - // outputs a 16-bit # in hex or "xxxx" if -1. - if (num < 0) - { - write(1, badbuff, 5); - } - else - { - buff[0] = num>>12; - buff[0] += buff[0] > 9 ? 'a'-10 : '0'; - buff[1] = (num>>8) & 0xf; - buff[1] += buff[1] > 9 ? 'a'-10 : '0'; - buff[2] = (num>>4) & 0xf; - buff[2] += buff[2] > 9 ? 'a'-10 : '0'; - buff[3] = num & 0xf; - buff[3] += buff[3] > 9 ? 'a'-10 : '0'; - write(1, buff, 5); - } -} - -void initdata(void) -{ - - int i; - int j; - - int* steptablemid = steptable + 128; - - for (i=0 ; - i 0) - { - // fprintf(stderr, "select is true\n"); - // got a command - nrc = read(0, commandbuf, 1); - - if (!nrc) - { - done = 1; - rc = 0; - } - else - { - if (snd_verbose) - fprintf(stderr, "cmd: %c", commandbuf[0]); - - switch (commandbuf[0]) - { - case 'p': - // play a new sound effect - read(0, commandbuf, 9); - - if (snd_verbose) - { - commandbuf[9]=0; - fprintf(stderr, "%s\n", commandbuf); - } - - commandbuf[0] -= - commandbuf[0]>='a' ? 'a'-10 : '0'; - commandbuf[1] -= - commandbuf[1]>='a' ? 'a'-10 : '0'; - commandbuf[2] -= - commandbuf[2]>='a' ? 'a'-10 : '0'; - commandbuf[3] -= - commandbuf[3]>='a' ? 'a'-10 : '0'; - commandbuf[4] -= - commandbuf[4]>='a' ? 'a'-10 : '0'; - commandbuf[5] -= - commandbuf[5]>='a' ? 'a'-10 : '0'; - commandbuf[6] -= - commandbuf[6]>='a' ? 'a'-10 : '0'; - commandbuf[7] -= - commandbuf[7]>='a' ? 'a'-10 : '0'; - - // p - sndnum = (commandbuf[0]<<4) + commandbuf[1]; - step = (commandbuf[2]<<4) + commandbuf[3]; - step = steptable[step]; - vol = (commandbuf[4]<<4) + commandbuf[5]; - sep = (commandbuf[6]<<4) + commandbuf[7]; - - handle = addsfx(sndnum, vol, step, sep); - // returns the handle - // outputushort(handle); - break; - - case 'q': - read(0, commandbuf, 1); - waitingtofinish = 1; rc = 0; - break; - - case 's': - { - int fd; - read(0, commandbuf, 3); - commandbuf[2] = 0; - fd = open((char*)commandbuf, O_CREAT|O_WRONLY, 0644); - commandbuf[0] -= commandbuf[0]>='a' ? 'a'-10 : '0'; - commandbuf[1] -= commandbuf[1]>='a' ? 'a'-10 : '0'; - sndnum = (commandbuf[0]<<4) + commandbuf[1]; - write(fd, S_sfx[sndnum].data, lengths[sndnum]); - close(fd); - } - break; - - default: - fprintf(stderr, "Did not recognize command\n"); - break; - } - } - } - else if (rc < 0) - { - quit(); - } - } while (rc > 0); - } - - updatesounds(); - - if (waitingtofinish) - { - for(i=0 ; i<8 && !channels[i] ; i++); - - if (i==8) - done=1; - } - - } - - quit(); - return 0; -} diff --git a/sndserv/soundsrv.h b/sndserv/soundsrv.h deleted file mode 100644 index 4dbe916..0000000 --- a/sndserv/soundsrv.h +++ /dev/null @@ -1,58 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// $Id: soundsrv.h,v 1.3 1997/01/29 22:40:44 b1 Exp $ -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This source is available for distribution and/or modification -// only under the terms of the DOOM Source Code License as -// published by id Software. All rights reserved. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License -// for more details. -// -// -// $Log: soundsrv.h,v $ -// Revision 1.3 1997/01/29 22:40:44 b1 -// Reformatting, S (sound) module files. -// -// Revision 1.2 1997/01/21 19:00:07 b1 -// First formatting run: -// using Emacs cc-mode.el indentation for C++ now. -// -// Revision 1.1 1997/01/19 17:22:50 b1 -// Initial check in DOOM sources as of Jan. 10th, 1997 -// -// -// DESCRIPTION: -// UNIX soundserver, separate process. -// -//----------------------------------------------------------------------------- - -#ifndef __SNDSERVER_H__ -#define __SNDSERVER_H__ - -#define SAMPLECOUNT 512 -#define MIXBUFFERSIZE (SAMPLECOUNT*2*2) -#define SPEED 11025 - - -void I_InitMusic(void); - -void -I_InitSound -( int samplerate, - int samplesound ); - -void -I_SubmitOutputBuffer -( void* samples, - int samplecount ); - -void I_ShutdownSound(void); -void I_ShutdownMusic(void); - -#endif diff --git a/sndserv/soundst.h b/sndserv/soundst.h deleted file mode 100644 index ed5e258..0000000 --- a/sndserv/soundst.h +++ /dev/null @@ -1,312 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// $Id: soundst.h,v 1.3 1997/01/29 22:40:45 b1 Exp $ -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This source is available for distribution and/or modification -// only under the terms of the DOOM Source Code License as -// published by id Software. All rights reserved. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License -// for more details. -// -// -// $Log: soundst.h,v $ -// Revision 1.3 1997/01/29 22:40:45 b1 -// Reformatting, S (sound) module files. -// -// Revision 1.2 1997/01/21 19:00:07 b1 -// First formatting run: -// using Emacs cc-mode.el indentation for C++ now. -// -// Revision 1.1 1997/01/19 17:22:50 b1 -// Initial check in DOOM sources as of Jan. 10th, 1997 -// -// -// DESCRIPTION: -// Sound (utility) related. Hang on. -// See gensounds.h and gensounds.c for what soundst.h is made of. -// -//----------------------------------------------------------------------------- - -#ifndef __SOUNDSTH__ -#define __SOUNDSTH__ - -#define S_MAX_VOLUME 127 - -// when to clip out sounds -// Doesn't fit the large outdoor areas. -#define S_CLIPPING_DIST (1200*0x10000) - -// when sounds should be max'd out -#define S_CLOSE_DIST (200*0x10000) - - -#define S_ATTENUATOR ((S_CLIPPING_DIST-S_CLOSE_DIST)>>FRACBITS) - -#define NORM_PITCH 128 -#define NORM_PRIORITY 64 -#define NORM_VOLUME snd_MaxVolume - -#define S_PITCH_PERTURB 1 -#define NORM_SEP 128 -#define S_STEREO_SWING (96*0x10000) - -// % attenuation from front to back -#define S_IFRACVOL 30 - -#define NA 0 -#define S_NUMCHANNELS 2 - - - - -// -// MusicInfo struct. -// -typedef struct -{ - // up to 6-character name - char* name; - - // lump number of music - int lumpnum; - - // music data - void* data; - - // music handle once registered - int handle; - -} musicinfo_t; - - - -// -// SoundFX struct. -// -typedef struct sfxinfo_struct sfxinfo_t; - -struct sfxinfo_struct -{ - // up to 6-character name - char* name; - - // Sfx singularity (only one at a time) - int singularity; - - // Sfx priority - int priority; - - // referenced sound if a link - sfxinfo_t* link; - - // pitch if a link - int pitch; - - // volume if a link - int volume; - - // sound data - void* data; - - // this is checked every second to see if sound - // can be thrown out (if 0, then decrement, if -1, - // then throw out, if > 0, then it's in use) - int usefulness; - - // lump number of sfx - int lumpnum; -}; - - - -typedef struct -{ - // sound information (if null, channel avail.) - sfxinfo_t* sfxinfo; - - // origin of sound - void* origin; - - // handle of the sound being played - int handle; - -} channel_t; - - - -enum -{ - Music, - Sfx, - SfxLink -}; - -enum -{ - PC=1, - Adlib=2, - SB=4, - Midi=8 -}; // cards available - -enum -{ - sfxThrowOut=-1, - sfxNotUsed=0 -}; - - -// -// Initialize the sound code at start of level -// -void S_Start(void); - -// -// Start sound for thing at -// using from sounds.h -// -extern void -S_StartSound -( void* origin, - int sound_id ); - - - -// Will start a sound at a given volume. -extern void -S_StartSoundAtVolume -( void* origin, - int sound_id, - int volume ); - - -// Stop sound for thing at -extern void S_StopSound(void* origin); - -// Start music using from sounds.h -extern void S_StartMusic(int music_id); - -// Start music using from sounds.h, -// and set whether looping -extern void -S_ChangeMusic -( int music_id, - int looping ); - - -// Stops the music -extern void S_StopMusic(void); - -void S_PauseSound(void); -void S_ResumeSound(void); - - -// -// Updates music & sounds -// -extern void S_UpdateSounds(void* listener); - -void S_SetMusicVolume(int volume); -void S_SetSfxVolume(int volume); - -// -// Initializes sound stuff, including volume -// -void -S_Init -( int , - int ); - - - -// -// SOUND IO -// -#define FREQ_LOW 0x40 -#define FREQ_NORM 0x80 -#define FREQ_HIGH 0xff - - -void I_SetMusicVolume(int volume); -void I_SetSfxVolume(int volume); - -// -// MUSIC I/O -// -void I_PauseSong(int handle); -void I_ResumeSong(int handle); - -// -// Called by anything that wishes to start music. -// plays a song, and when the song is done, -// starts playing it again in an endless loop. -// Horrible thing to do, considering. -void -I_PlaySong -( int handle, - int looping ); - - -// stops a song over 3 seconds. -void I_StopSong(int handle); - -// registers a song handle to song data -int I_RegisterSong(void *data); - -// see above then think backwards -void I_UnRegisterSong(int handle); - -// is the song playing? -int I_QrySongPlaying(int handle); - - -// -// SFX I/O -// -void I_SetChannels(int channels); - -int I_GetSfxLumpNum (sfxinfo_t*); - - -// Starts a sound in a particular sound channel. -int -I_StartSound -( int id, - void* data, - int vol, - int sep, - int pitch, - int priority ); - - -// Updates the volume, separation, -// and pitch of a sound channel. -void -I_UpdateSoundParams -( int handle, - int vol, - int sep, - int pitch ); - - -// Stops a sound channel. -void I_StopSound(int handle); - -// Called by S_*()'s to see if a channel is still playing. -// Returns 0 if no longer playing, 1 if playing. -int I_SoundIsPlaying(int handle); - - -// the complete set of sound effects -extern sfxinfo_t S_sfx[]; - -// the complete set of music -extern musicinfo_t S_music[]; - -#endif diff --git a/sndserv/wadread.c b/sndserv/wadread.c deleted file mode 100644 index 4fd61a5..0000000 --- a/sndserv/wadread.c +++ /dev/null @@ -1,256 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// $Id: wadread.c,v 1.3 1997/01/30 19:54:23 b1 Exp $ -// -// Copyright (C) 1993-1996 by id Software, Inc. -// -// This source is available for distribution and/or modification -// only under the terms of the DOOM Source Code License as -// published by id Software. All rights reserved. -// -// The source is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License -// for more details. -// -// -// $Log: wadread.c,v $ -// Revision 1.3 1997/01/30 19:54:23 b1 -// Final reformatting run. All the remains (ST, W, WI, Z). -// -// Revision 1.2 1997/01/21 19:00:10 b1 -// First formatting run: -// using Emacs cc-mode.el indentation for C++ now. -// -// Revision 1.1 1997/01/19 17:22:51 b1 -// Initial check in DOOM sources as of Jan. 10th, 1997 -// -// -// DESCRIPTION: -// WAD and Lump I/O, the second. -// This time for soundserver only. -// Welcome to Department of Redundancy Department. Again :-). -// -//----------------------------------------------------------------------------- - - -static const char rcsid[] = "$Id: wadread.c,v 1.3 1997/01/30 19:54:23 b1 Exp $"; - - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "soundsrv.h" -#include "wadread.h" - - -int* sfxlengths; - -typedef struct wadinfo_struct -{ - char identification[4]; - int numlumps; - int infotableofs; - -} wadinfo_t; - -typedef struct filelump_struct -{ - int filepos; - int size; - char name[8]; - -} filelump_t; - -typedef struct lumpinfo_struct -{ - int handle; - int filepos; - int size; - char name[8]; - -} lumpinfo_t; - - - -lumpinfo_t* lumpinfo; -int numlumps; - -void** lumpcache; - - -#define strcmpi strcasecmp - - -// -// Something new. -// This version of w_wad.c does handle endianess. -// -#ifndef __BIG_ENDIAN__ - -#define LONG(x) (x) -#define SHORT(x) (x) - -#else - -#define LONG(x) ((long)SwapLONG((unsigned long) (x))) -#define SHORT(x) ((short)SwapSHORT((unsigned short) (x))) - -unsigned long SwapLONG(unsigned long x) -{ - return - (x>>24) - | ((x>>8) & 0xff00) - | ((x<<8) & 0xff0000) - | (x<<24); -} - -unsigned short SwapSHORT(unsigned short x) -{ - return - (x>>8) | (x<<8); -} - -#endif - - - -// Way too many of those... -static void derror(char* msg) -{ - fprintf(stderr, "\nwadread error: %s\n", msg); - exit(-1); -} - - -void strupr (char *s) -{ - while (*s) - *s++ = toupper(*s); -} - -int filelength (int handle) -{ - struct stat fileinfo; - - if (fstat (handle,&fileinfo) == -1) - fprintf (stderr, "Error fstating\n"); - - return fileinfo.st_size; -} - - - -void openwad(char* wadname) -{ - - int wadfile; - int tableoffset; - int tablelength; - int tablefilelength; - int i; - wadinfo_t header; - filelump_t* filetable; - - // open and read the wadfile header - wadfile = open(wadname, O_RDONLY); - - if (wadfile < 0) - derror("Could not open wadfile"); - - read(wadfile, &header, sizeof header); - - if (strncmp(header.identification, "IWAD", 4)) - derror("wadfile has weirdo header"); - - numlumps = LONG(header.numlumps); - tableoffset = LONG(header.infotableofs); - tablelength = numlumps * sizeof(lumpinfo_t); - tablefilelength = numlumps * sizeof(filelump_t); - lumpinfo = (lumpinfo_t *) malloc(tablelength); - filetable = (filelump_t *) ((char*)lumpinfo + tablelength - tablefilelength); - - // get the lumpinfo table - lseek(wadfile, tableoffset, SEEK_SET); - read(wadfile, filetable, tablefilelength); - - // process the table to make the endianness right and shift it down - for (i=0 ; i