1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
\r
4 * This file is part of Project 16.
\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
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
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
28 #include "src/lib/16_head.h"
\r
29 #include "src/lib/16_ca.h"
\r
30 #include "src/lib/16_mm.h"
\r
31 #include "src/lib/16_hc.h"
\r
32 //#include "src/lib/modex16.h"
\r
38 //file load or read definition
\r
43 main(int argc, char *argv[])
\r
45 mminfo_t mm; mminfotype mmi;
\r
48 void __based(sega)* bigbuffer;
\r
57 //static page_t screen;
\r
59 printf("&main()= %Fp\n", *argv[0]);
\r
60 printf("bigbuffer= %Fp\n", bigbuffer);
\r
61 printf("&bigbuffer= %Fp\n", &bigbuffer);
\r
62 printf("bigbuffer= %04x\n", bigbuffer);
\r
63 printf("&bigbuffer= %04x\n", &bigbuffer);
\r
66 bakapee = malloc(64);
\r
71 if(argv[1]) bakapee = argv[1];
\r
72 else bakapee = "data/koishi~.pcx";
\r
77 /* setup camera and screen~ */
\r
79 //screen = modexDefaultPage();
\r
80 /*screen.width += (16*2);
\r
81 screen.height += (16*2);*/
\r
83 printf("main()=%Fp start MM\n", *argv[0]);
\r
84 MM_Startup(&mm, &mmi);
\r
86 //PM_UnlockMainMem();
\r
89 printf("&main()= %Fp\n", *argv[0]);
\r
90 printf("bigbuffer= %Fp\n", bigbuffer);
\r
91 printf("&bigbuffer= %Fp\n", &bigbuffer);
\r
92 printf("bigbuffer= %04x\n", bigbuffer);
\r
93 printf("&bigbuffer= %04x\n", &bigbuffer);
\r
96 // bakapeehandle = open(bakapee,O_RDONLY | O_BINARY, S_IREAD);
\r
97 // printf("size of big buffer~=%u\n", _bmsize(segu, bigbuffer));
\r
98 // if(CA_FarRead(bakapeehandle,(void far *)&bigbuffer,sizeof(bigbuffer),&mm))
\r
101 if(CA_ReadFile(bakapee, &bigbuffer, &mm))
\r
104 if(CA_LoadFile(bakapee, &bigbuffer, &mm, &mmi))
\r
109 // close(bakapeehandle);
\r
110 //hmm functions in cache system use the buffered stuff
\r
112 printf("size of big buffer~=%u\n", _bmsize(sega, bigbuffer));
\r
115 printf("dark purple = purgable\n");
\r
116 printf("medium blue = non purgable\n");
\r
117 printf("red = locked\n");
\r
119 //++++modexEnter();
\r
120 //++++modexShowPage(&screen);
\r
121 MM_ShowMemory(/*&screen, */&mm);
\r
124 //++++modexLeave();
\r
125 MM_Report(&mm, &mmi);
\r
126 printf(" stop!\n");
\r
128 MM_FreePtr(&bigbuffer, &mm);
\r
133 printf(" done!\n");
\r
136 if(baka) printf("\nyay!\n");
\r
137 else printf("\npoo!\n");
\r
139 printf("bigbuffer= %Fp\n", bigbuffer);
\r
140 printf("&bigbuffer= %Fp\n", &bigbuffer);
\r
141 printf("bigbuffer= %04x\n", bigbuffer);
\r
142 printf("&bigbuffer= %04x\n", &bigbuffer);
\r
144 printf("Total free: %lu\n", (dword)(GetFreeSize()));
\r
145 printf("Total near free: %lu\n", (dword)(GetNearFreeSize()));
\r
146 printf("Total far free: %lu\n", (dword)(GetFarFreeSize()));
\r
152 //printf("core left: %lu\n", (dword)_coreleft());
\r
153 //printf("far core left: %lu\n", (dword)_farcoreleft());
\r
154 //printf("based core left: %lu\n", (dword)_basedcoreleft());
\r
155 //printf("huge core left: %lu\n", (dword)_hugecoreleft());
\r