]> 4ch.mooo.com Git - 16.git/blob - src/lib/16_lib.c
quit works with input system now
[16.git] / src / lib / 16_lib.c
1 /* Project 16 Source Code~\r
2  * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
3  *\r
4  * This file is part of Project 16.\r
5  *\r
6  * Project 16 is free software; you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation; either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * Project 16 is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
19  * Fifth Floor, Boston, MA 02110-1301 USA.\r
20  *\r
21  */\r
22 /*\r
23  * 16 library\r
24  */\r
25 \r
26 #include "src/lib/16_lib.h"\r
27 \r
28 //===========================================================================\r
29 \r
30 /*\r
31 ==========================\r
32 =\r
33 = Quit\r
34 =\r
35 ==========================\r
36 */\r
37 \r
38 void Quit (char *error)\r
39 {\r
40         unsigned        finscreen;\r
41         memptr  screen;\r
42         union REGS in, out;\r
43 \r
44         //ClearMemory ();\r
45         if (!*error)\r
46         {\r
47          //WriteConfig ();\r
48         }\r
49         else\r
50         {\r
51          //CA_CacheGrChunk (ERRORSCREEN);\r
52          //screen = grsegs[ERRORSCREEN];\r
53         }\r
54 \r
55         //ShutdownId ();\r
56         IN_Shutdown();\r
57         //modexLeave();\r
58         in.h.ah = 0x00;\r
59         in.h.al = 0x3;\r
60         int86(0x10, &in, &out);\r
61 \r
62         if (error && *error)\r
63         {\r
64           movedata ((unsigned)screen,7,0xb800,0,7*160);\r
65           //gotoxy (10,4);\r
66           puts(error);\r
67           //gotoxy (1,8);\r
68           exit(1);\r
69         }\r
70         else\r
71         if (!error || !(*error))\r
72         {\r
73                 //clrscr();\r
74                 //#ifndef JAPAN\r
75                 movedata ((unsigned)screen,7,0xb800,0,4000);\r
76                 //gotoxy(1,24);\r
77                 //#endif\r
78 //asm   mov     bh,0\r
79 //asm   mov     dh,23   // row\r
80 //asm   mov     dl,0    // collumn\r
81 //asm   mov ah,2\r
82 //asm   int     0x10\r
83         }\r
84 \r
85         exit(0);\r
86 }\r
87 \r
88 //===========================================================================\r