Skip to content

Commit 6aa0bdf

Browse files
author
Ilu
committed
added screen mode autodetection
1 parent 9c3a6b1 commit 6aa0bdf

4 files changed

Lines changed: 203 additions & 92 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"format-jasper.h": "c",
2929
"format-stb.h": "c",
3030
"main.h": "c",
31-
"stb_image.h": "c"
31+
"stb_image.h": "c",
32+
"aintdos.h": "c",
33+
"aintern.h": "c"
3234
}
3335
}

Makefile

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ LDFLAGS = -s \
5555

5656
# output
5757
EXE = dosview.exe
58+
UPXEXE = upxview.exe
5859
RELZIP = dosview-X.Y.zip
5960

6061
# dirs/files
@@ -71,6 +72,13 @@ STRIP=$(CROSS_PLATFORM)strip
7172
RANLIB=$(CROSS_PLATFORM)ranlib
7273
export
7374

75+
MKDIRPRG=mkdir
76+
UPXPRG=upx
77+
ZIPPRG=zip
78+
SHPRG=bash
79+
RMPRG=rm
80+
FINDPRG=find
81+
7482
MPARA=-j8
7583

7684
PARTS= \
@@ -89,7 +97,7 @@ dosview: $(EXE)
8997

9098
liballegro: $(LIB_ALLEGRO)
9199
$(LIB_ALLEGRO):
92-
cd $(ALLEGRO) && bash ./xmake.sh lib
100+
cd $(ALLEGRO) && $(SHPRG) ./xmake.sh lib
93101

94102
libz: $(LIB_Z)
95103
$(LIB_Z):
@@ -117,7 +125,7 @@ $(LIB_TIFF):
117125

118126
libjasper: $(LIB_JASPER)
119127
$(LIB_JASPER):
120-
(cd $(JASPER) && bash ./cmake-djgpp.sh)
128+
(cd $(JASPER) && $(SHPRG) ./cmake-djgpp.sh)
121129

122130
$(EXE): init liballegro libz alpng algif libwebp libjpeg libtiff libjasper $(PARTS)
123131
$(CC) $(LDFLAGS) -o $@ $(PARTS) $(LIBS)
@@ -129,19 +137,19 @@ $(BUILDDIR)/loadpng/%.o: $(LOADPNG)/%.c Makefile
129137
$(CC) $(CFLAGS) -c $< -o $@
130138

131139
zip: all
132-
rm -f $(RELZIP)
133-
upx -9 -oupxview.exe $(EXE)
134-
zip -9 -r $(RELZIP) $(EXE) upxview.exe CWSDPMI.EXE LICENSE *.md
140+
$(RMPRG) -f $(RELZIP) $(UPXEXE)
141+
$(UPXPRG) -9 -o$(UPXEXE) $(EXE)
142+
$(ZIPPRG) -9 $(RELZIP) $(EXE) $(UPXEXE) CWSDPMI.EXE LICENSE *.md
135143

136144
init: configure_tiff
137-
mkdir -p $(BUILDDIR) $(BUILDDIR)/loadpng
145+
$(MKDIRPRG) -p $(BUILDDIR) $(BUILDDIR)/loadpng
138146

139147
clean:
140-
rm -rf $(BUILDDIR)/
141-
rm -f $(EXE) $(ZIP) upxview.exe UPXVIEW.EXE
148+
$(RMPRG) -rf $(BUILDDIR)/
149+
$(RMPRG) -f $(EXE) $(RELZIP) upxview.exe UPXVIEW.EXE
142150

143151
distclean: clean zclean alclean webpclean jpegclean distclean_tiff jasperclean alpngclean algifclean
144-
rm -f OUT.* LOW.*
152+
$(RMPRG) -f OUT.* LOW.*
145153

146154
zclean:
147155
$(MAKE) -C $(ZLIB) -f Makefile.dojs clean
@@ -150,7 +158,7 @@ jpegclean:
150158
$(MAKE) -C $(JPEG) -f makefile.dj clean
151159

152160
alclean:
153-
cd $(ALLEGRO) && bash ./xmake.sh clean
161+
cd $(ALLEGRO) && $(SHPRG) ./xmake.sh clean
154162

155163
webpclean:
156164
$(MAKE) -C $(WEBP) -f makefile.djgpp clean
@@ -165,14 +173,14 @@ algifclean:
165173
$(MAKE) -C $(ALGIF) -f Makefile.dj clean
166174

167175
jasperclean:
168-
rm -rf $(JASPER)/djgpp
176+
$(RMPRG) -rf $(JASPER)/djgpp
169177

170178
fixnewlines:
171-
find . -iname "*.sh" -exec dos2unix -v \{\} \;
179+
$(FINDPRG) . -iname "*.sh" -exec dos2unix -v \{\} \;
172180

173181
configure_tiff: $(TIFF)/Makefile
174182
$(TIFF)/Makefile:
175-
(cd $(TIFF) && HOST=$(CROSS) CFLAGS="$(CFLAGS)" LDFLAGS="" LIBS="" bash ./djgpp-config.sh)
183+
(cd $(TIFF) && HOST=$(CROSS) CFLAGS="$(CFLAGS)" LDFLAGS="" LIBS="" $(SHPRG) ./djgpp-config.sh)
176184

177185
distclean_tiff:
178186
-(cd $(TIFF) && make distclean)

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ This is a quick hack for an image viewer/converter for MS-DOS
33

44
People on [DOS ain't dead](https://www.bttr-software.de/forum/forum_entry.php?id=20792) asked if it would be possible to create such a program for MS-DOS supporting modern image formats. As I had quite a lot of the necessary code already available from [DOjS](https://github.com/SuperIlu/DOjS) I decided to give it a try.
55

6-
`DosView` uses Allegro to display the images, it should support all VESA modes that are implemented by it.
7-
It tries 32bpp first and 24bpp is 32bpp is not available. The default screen format is 640x480, see below for other options.
6+
`DosView` uses Allegro to display the images, it should support all available VESA modes.
7+
The default screen format is 640x480 with most number of bpp, see below for other options.
88

99
Please note: Although `DosView` should work from a i386 upwards, this programm can eat huge amounts of RAM (>64MiB) if you feed it large images and/or screen sizes.
1010

@@ -91,6 +91,10 @@ Please see the attached [LICENSE](LICENSE) file for the license of all involved
9191
* image conversion always needs a working display mode (Allegros fault)
9292

9393
# Changelog
94+
### 1.5 / November 26th, 2023
95+
* Fixed Allegro VESA driver
96+
* Added screen mode autodetection
97+
9498
### 1.4 / November 24th, 2023
9599
* new screen resolutions and change in command line
96100
* (hopefully) fixed bug in image zooming when image was not 4:3 and a multiple of the resolution

0 commit comments

Comments
 (0)