+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+/*\r
+ * 16 library\r
+ */\r
+\r
+#include "src/lib/16_lib.h"\r
+\r
+//===========================================================================\r
+\r
+/*\r
+==========================\r
+=\r
+= Quit\r
+=\r
+==========================\r
+*/\r
+\r
+void Quit (char *error)\r
+{\r
+ unsigned finscreen;\r
+ memptr screen;\r
+ union REGS in, out;\r
+\r
+ //ClearMemory ();\r
+ if (!*error)\r
+ {\r
+ //WriteConfig ();\r
+ }\r
+ else\r
+ {\r
+ //CA_CacheGrChunk (ERRORSCREEN);\r
+ //screen = grsegs[ERRORSCREEN];\r
+ }\r
+\r
+ //ShutdownId ();\r
+ IN_Shutdown();\r
+ //modexLeave();\r
+ in.h.ah = 0x00;\r
+ in.h.al = 0x3;\r
+ int86(0x10, &in, &out);\r
+\r
+ if (error && *error)\r
+ {\r
+ movedata ((unsigned)screen,7,0xb800,0,7*160);\r
+ //gotoxy (10,4);\r
+ puts(error);\r
+ //gotoxy (1,8);\r
+ exit(1);\r
+ }\r
+ else\r
+ if (!error || !(*error))\r
+ {\r
+ //clrscr();\r
+ //#ifndef JAPAN\r
+ movedata ((unsigned)screen,7,0xb800,0,4000);\r
+ //gotoxy(1,24);\r
+ //#endif\r
+//asm mov bh,0\r
+//asm mov dh,23 // row\r
+//asm mov dl,0 // collumn\r
+//asm mov ah,2\r
+//asm int 0x10\r
+ }\r
+\r
+ exit(0);\r
+}\r
+\r
+//===========================================================================\r