]> git.0x19.co - doomgeneric-snom360/commitdiff
Implement ENDOOM on DJGPP
authorTuro Lamminen <turol@iki.fi>
Tue, 23 Apr 2024 17:23:03 +0000 (20:23 +0300)
committerTuro Lamminen <turol@iki.fi>
Tue, 23 Apr 2024 17:23:03 +0000 (20:23 +0300)
doomgeneric/i_endoom.c

index 98b8c876fcbf3197662a23114d9a8ddf4dc32879..6de261bb15ca1a9d3ff4a8bfa8f6b979576d3cf8 100644 (file)
 #include "txt_main.h"
 #endif
 
+
+#ifdef __DJGPP__
+#include <go32.h>
+#endif  // __DJGPP__
+
+
 #define ENDOOM_W 80
 #define ENDOOM_H 25
 
@@ -76,6 +82,20 @@ void I_Endoom(byte *endoom_data)
     // Shut down text mode screen
 
     TXT_Shutdown();
+
+#elif defined(__DJGPP__)
+
+    int y;
+
+    // move cursor to bottom
+    // there's a direct call for moving cursor somewhere but this is simpler to write
+    for (y = 0; y < ENDOOM_H; y++) {
+        puts("\n");
+    }
+
+    // allegro exit should have been run already and so we should be in text mode again
+    movedata(_my_ds(), (unsigned) endoom_data, _dos_ds, 0xB8000UL, ENDOOM_W * ENDOOM_H * 2);
+
 #endif
 }