- instructed gcc to emit only pentium1 instructions
authorJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 6 Feb 2018 21:47:34 +0000 (23:47 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 6 Feb 2018 21:47:34 +0000 (23:47 +0200)
- moved wait_vsync into an assembly macro in gfx.h

Makefile.dj
libs/imago/Makefile.dj
libs/oldmik/Makefile.dj
src/dos/gfx.c
src/dos/gfx.h

index 600403a..ed1a830 100644 (file)
@@ -16,7 +16,7 @@ dbg = -g
 
 CC = $(TOOLPREFIX)gcc
 AR = $(TOOLPREFIX)ar
-CFLAGS = -pedantic -Wall $(dbg) $(opt) $(inc)
+CFLAGS = -pedantic -Wall -march=pentium $(dbg) $(opt) $(inc)
 LDFLAGS = libs/imago/imago.a libs/oldmik/mikmod.a
 
 $(bin): $(obj) imago mikmod
index 2d1ead6..5e15016 100644 (file)
@@ -14,7 +14,7 @@ endif
 
 CC = $(TOOLPREFIX)gcc
 AR = $(TOOLPREFIX)ar
-CFLAGS = -pedantic -Wall -Wno-main -g -O3 -ffast-math -Izlib -Ilibpng -Ijpeglib
+CFLAGS = -pedantic -Wall -Wno-main -march=pentium -g -O3 -ffast-math -Izlib -Ilibpng -Ijpeglib
 
 $(alib): $(obj)
        $(AR) rcs $@ $(obj)
index 3d890f2..8162cc4 100644 (file)
@@ -15,7 +15,7 @@ endif
 
 CC = $(TOOLPREFIX)gcc
 AR = $(TOOLPREFIX)ar
-CFLAGS = $(opt) $(dbg) -Isrc
+CFLAGS = -march=pentium $(opt) $(dbg) -Isrc
 
 $(alib): $(obj)
        $(AR) rcs $@ $(obj)
index 46cec31..c2e4f8d 100644 (file)
@@ -154,43 +154,6 @@ void set_palette(int idx, int r, int g, int b)
        vbe_set_palette(idx, col, 1, pal_bits);
 }
 
-#ifdef __WATCOMC__
-void wait_vsync_asm(void);
-#pragma aux wait_vsync_asm = \
-       "mov dx, 0x3da" \
-       "l1:" \
-       "in al, dx" \
-       "and al, 0x8" \
-       "jnz l1" \
-       "l2:" \
-       "in al, dx" \
-       "and al, 0x8" \
-       "jz l2" \
-       modify[al dx];
-
-void wait_vsync(void)
-{
-       wait_vsync_asm();
-}
-#endif
-
-#ifdef __DJGPP__
-void wait_vsync(void)
-{
-       asm volatile (
-               "mov $0x3da, %%dx\n\t"
-               "0:\n\t"
-               "in %%dx, %%al\n\t"
-               "and $8, %%al\n\t"
-               "jnz 0b\n\t"
-               "0:\n\t"
-               "in %%dx, %%al\n\t"
-               "and $8, %%al\n\t"
-               "jz 0b\n\t"
-               :::"%eax","%edx");
-}
-#endif
-
 static unsigned int make_mask(int sz, int pos)
 {
        unsigned int i, mask = 0;
index b19c992..7e12554 100644 (file)
@@ -15,7 +15,35 @@ int get_color_mask(unsigned int *rmask, unsigned int *gmask, unsigned int *bmask
 
 void set_palette(int idx, int r, int g, int b);
 
+#ifdef __WATCOMC__
 void wait_vsync(void);
+#pragma aux wait_vsync = \
+       "mov dx, 0x3da" \
+       "l1:" \
+       "in al, dx" \
+       "and al, 0x8" \
+       "jnz l1" \
+       "l2:" \
+       "in al, dx" \
+       "and al, 0x8" \
+       "jz l2" \
+       modify[al dx];
+#endif
+
+#ifdef __DJGPP__
+#define wait_vsync()  asm volatile ( \
+       "mov $0x3da, %%dx\n\t" \
+       "0:\n\t" \
+       "in %%dx, %%al\n\t" \
+       "and $8, %%al\n\t" \
+       "jnz 0b\n\t" \
+       "0:\n\t" \
+       "in %%dx, %%al\n\t" \
+       "and $8, %%al\n\t" \
+       "jz 0b\n\t" \
+       :::"%eax","%edx")
+#endif
+
 
 #ifdef __cplusplus
 }