Skip to content

Commit 042fe18

Browse files
committed
Fix strobing.
1 parent b764871 commit 042fe18

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Source-port of [doomgeneric](https://github.com/ozkl/doomgeneric). Does not have sound.
88

9-
You will need a WAD file (game data). If you don't own the game, the shareware version is freely available (e.g. [here](http://www.doomworld.com/3ddownloads/ports/shareware_doom_iwad.zip)).
9+
You will need a WAD file (game data). If you don't own the game, the shareware version is freely available.
1010

1111
## Build
1212

@@ -49,21 +49,11 @@ Keybinds can be remapped in ```.default.cfg```
4949

5050
### Display
5151

52-
Most terminals aren't designed for massive throughput, so the game cannot be played at full 320x200 resolution and the display should be scaled to minimize the strobing effect.
52+
Most terminals aren't designed for massive throughput, so the game cannot be played at full 320x200 resolution at high frames per second.
5353

5454
Pass the command-line argument ```-scaling n``` to determine the level of scaling. Smaller numbers denote a larger display.
5555

56-
Below you can find a table of recommended scales, based on subjective observations.
57-
58-
|Terminal |No Strobing|Some Strobing|
59-
|--------------|-----------|-------------|
60-
|Alacritty |3 |2 |
61-
|Yakuake |4 |2 |
62-
|Konsole |4 |3 |
63-
|Xfce4-terminal|5 |3 |
64-
|Windows CMD |- |4 (severe) |
65-
66-
By default, a scale of 4 is used.
56+
A scale of 4 is used by default, and should work flawlessly on all terminals. Most terminals (excluding Windows CMD) should manage with scales up to and including 2.
6757

6858
### Input
6959
The following terminal input options are not mandatory but may improve input handling.

src/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,24 @@ else
1111
VB=@
1212
endif
1313

14+
# subdirectory for objects
15+
OBJDIR=build
16+
BINDIR=../doom_ascii
17+
1418
ifeq ($(MAKECMDGOALS),windows)
1519
CC=i686-w64-mingw32-gcc-win32
20+
OUTPUT=$(BINDIR)/doom_ascii.exe
1621
else
1722
CC=gcc
1823
CFLAGS+=-DNORMALUNIX -DLINUX
24+
OUTPUT=$(BINDIR)/doom_ascii
1925
endif
2026

2127
CFLAGS+=-Os -g
2228
LDFLAGS+=-Wl,--gc-sections
2329
CFLAGS+=-Wall -D_DEFAULT_SOURCE #-DSNDSERV -DUSEASM
2430
LIBS+=-lm
2531

26-
# subdirectory for objects
27-
OBJDIR=build
28-
BINDIR=../doom_ascii
29-
OUTPUT=$(BINDIR)/doom_ascii
3032

3133
SRC_DOOM = i_main.o dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_ascii.o
3234
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))

src/doomgeneric_ascii.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ void DG_DrawFrame()
160160
*buf++ = '0';
161161
*buf = 'm';
162162

163-
/* clear screen and set bold text*/
164-
fputs("\033[1;1H\033[2J\033[1m", stdout);
163+
/* move cursor to top left corner and set bold text*/
164+
fputs("\033[;H\033[1m", stdout);
165165

166166
/* flush output buffer */
167167
CALL_STDOUT(fputs(output_buffer, stdout), "DG_DrawFrame: fputs error %d");

0 commit comments

Comments
 (0)