From 6530e1ac009ef3ecc110b0ccfc739e453ab3c673 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Tue, 23 Apr 2024 20:23:03 +0300 Subject: [PATCH] Implement ENDOOM on DJGPP --- doomgeneric/i_endoom.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doomgeneric/i_endoom.c b/doomgeneric/i_endoom.c index 98b8c87..6de261b 100644 --- a/doomgeneric/i_endoom.c +++ b/doomgeneric/i_endoom.c @@ -26,6 +26,12 @@ #include "txt_main.h" #endif + +#ifdef __DJGPP__ +#include +#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 }