]> 4ch.mooo.com Git - 16.git/blob - src/lib/16_lib.c
====PM WORKS! XMS PORTING IS NEXT! BCEXMM is broke HOLY SHIT./awoo.sh ====PM WORKS...
[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 = DebugMemory\r
34 =\r
35 ==================\r
36 */\r
37 \r
38 void DebugMemory (global_game_variables_t *gvar)\r
39 {\r
40         /*VW_FixRefreshBuffer ();\r
41         US_CenterWindow (16,7);\r
42 \r
43         US_CPrint ("Memory Usage");\r
44         US_CPrint ("------------");\r
45         US_Print ("Total     :");\r
46         US_PrintUnsigned (mminfo.mainmem/1024);\r
47         US_Print ("k\nFree      :");\r
48         US_PrintUnsigned (MM_UnusedMemory()/1024);\r
49         US_Print ("k\nWith purge:");\r
50         US_PrintUnsigned (MM_TotalFree()/1024);\r
51         US_Print ("k\n");\r
52         VW_UpdateScreen();*/\r
53         IN_Ack ();\r
54         MM_ShowMemory (gvar);\r
55 }\r
56 \r
57 /*\r
58 ==========================\r
59 =\r
60 = Quit\r
61 =\r
62 ==========================\r
63 */\r
64 \r
65 void Quit (char *error)\r
66 {\r
67         unsigned        finscreen;\r
68         memptr  screen;\r
69         union REGS in, out;\r
70 \r
71         //ClearMemory ();\r
72         if (!*error)\r
73         {\r
74          //WriteConfig ();\r
75         }\r
76         else\r
77         {\r
78          //CA_CacheGrChunk (ERRORSCREEN);\r
79          //screen = grsegs[ERRORSCREEN];\r
80         }\r
81 \r
82         //ShutdownId ();\r
83         IN_Shutdown();\r
84         //modexLeave();\r
85         in.h.ah = 0x00;\r
86         in.h.al = 0x3;\r
87         int86(0x10, &in, &out);\r
88 \r
89         if (error && *error)\r
90         {\r
91           //movedata ((unsigned)screen,7,0xb800,0,7*160);\r
92           //gotoxy (10,4);\r
93           fprintf(stderr, "%s\n", error);\r
94           //gotoxy (1,8);\r
95           exit(1);\r
96         }\r
97         else\r
98         if (!error || !(*error))\r
99         {\r
100                 //clrscr();\r
101                 //#ifndef JAPAN\r
102                 movedata ((unsigned)screen,7,0xb800,0,4000);\r
103                 //gotoxy(1,24);\r
104                 //#endif\r
105 //asm   mov     bh,0\r
106 //asm   mov     dh,23   // row\r
107 //asm   mov     dl,0    // collumn\r
108 //asm   mov ah,2\r
109 //asm   int     0x10\r
110         }\r
111 \r
112         exit(0);\r
113 }\r
114 \r
115 //===========================================================================\r