OSDN Git Service

polished 16_vrs.h and put into make file AND! updated copyright to add yakui lover...
[proj16/16.git] / src / emsdump.c
1 /* Project 16 Source Code~
2  * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
3  *
4  * This file is part of Project 16.
5  *
6  * Project 16 is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Project 16 is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,
19  * Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  */
22
23 #include<stdio.h>
24 #include <conio.h>
25 //#include <limits.h>
26
27 #include "src/lib/exmm/memory.h"
28
29 int main(int argc, char *argv[])
30 {
31         unsigned long i=0;
32         char near w;
33         char huge *p =(char huge *)(GetEMMSeg0()*0x10000);//0xD0000000;
34         //char far *q =(char far *)0x53332225;
35         printf("1p=%p   %ul\n", p, GetEMMSeg0());
36         //while(!kbhit()){              printf("%p\n", ((GetEMMSeg0()*0x10000)+0x0fffffff));    }
37         //while(!kbhit()){              printf("%p\n", ((GetEMMSeg0()*0x10000)+0xffff));        }
38         if(argv[1])     {               printf("switch on!\n");         while(!kbhit()){}       }
39         while(p<=(char huge *)((GetEMMSeg0()*0x10000)+0xffff)/*i<262144UL*/ && !kbhit())
40         {
41                 if(argv[1]!=NULL) (*p) = i; else
42                 //else printf("%p=      %x%     %ul\n", p, *p, i);
43                 if((i%8)==0) printf("%p= %c %c %c %c %c %c %c %c\n", p,
44 *p, *(p+1), *(p+2), *(p+3), *(p+4), *(p+5), *(p+6), *(p+7));
45 //              (*p)++;
46 //              printf("                                %p\n", ((GetEMMSeg0()*0x10000)+0x0fffffff));
47                 i++;
48                 p++;
49         }
50         w=104;
51         //printf("*q=%d\n",*q);
52         //printf(" q=%p\n", q);
53         printf(" p=%p\n", p);
54         printf(" w=%d\n", w);
55         printf(" w=%p\n", w);
56         printf("GetEMMSeg0()=%p\n", GetEMMSeg0()*0x10000);
57         return 0;
58 }