]> 4ch.mooo.com Git - 16.git/blob - src/bakapi.c
wwww major changes in the repo and i did some house keeping in the repo ^^ and i...
[16.git] / src / bakapi.c
1 /* Project 16 Source Code‾
2  * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
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 publiSCREEN_HEIGHTed 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 SCREEN_HEIGHTould 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 "src/bakapi.h"
24
25 /*
26  * BAKAPEE!
27  */
28 void
29 main(int argc, char *argv[])
30 {
31         global_game_variables_t gamevars;
32         bakapee_t bakapee;
33         page_t screen;
34         word key,d,xpos,ypos,xdir,ydir;
35         int ch=0x0;
36         // main variables values
37         d=4; // switch variable
38         key=2; // default screensaver number
39         xpos=TILEWH*2;
40         ypos=TILEWH*2;
41         xdir=1;
42         ydir=1;
43         bakapee.xx = rand()&0%SCREEN_WIDTH;
44         bakapee.yy = rand()&0%SCREEN_HEIGHT;
45         bakapee.gq = LGQ;
46         bakapee.sx=0;
47         bakapee.sy=0;
48         bakapee.bakax=0;
49         bakapee.bakay=0;
50
51         /* setup camera and screen‾ */
52         screen = modexDefaultPage();
53         screen.width += (TILEWH*2);
54         screen.height += (TILEWH*2);
55         textInit();
56
57         //modexPalUpdate(bmp.palette); //____
58         //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
59         //getch(); //____
60
61 // screen savers
62 #ifdef BOINK
63         while(d!=0)     // on!
64         {
65                 if(!kbhit())
66                 { // conditions of screen saver
67                         ding(&screen, &bakapee, key);
68                 }
69                 else
70                 {
71                         setVGAmodeX(&gamevars, 0);
72                         // user imput switch
73                         printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.¥n", getch());  // prompt the user
74                         scanf("%d", &key);
75                         //if(key==3){xx=yy=0;} // crazy screen saver wwww
76                         if(key==0) d=0;
77                         setVGAmodeX(&gamevars, 1);
78                 }
79         }
80 #else
81         setVGAmodeX(&gamevars, 1);
82         while(1)
83         { // conditions of screen saver
84                 while(!kbhit())
85                 {
86                         ding(&screen, &bakapee, key);
87                 }
88                 //end of screen savers
89                 /*for(int x = 0; x < screen.width; ++x)
90                 {
91                         modexputPixel(&page, x, 0, 15);
92                         mxPutPixel(x, SCREEN_HEIGHT-1, 15);
93                         }
94                 for (int y = 0; y < VH; ++y)
95                         {
96                                 mxPutPixel(0, y, 15);
97                                 mxPutPixel(SCREEN_WIDTH-1, y, 15);
98                         }
99                 for (int x = 0; x < VW; ++x)
100                         {
101                                 mxPutPixel(x, 0, 15);
102                                 mxPutPixel(x, VH-1, 15);
103                         }
104                 for (int y = 240; y < VH; ++y)
105                         {
106                                 mxPutPixel(0, y, 15);
107                                 mxPutPixel(VW-1, y, 15);
108                         }*/
109                 pdump(&screen);
110                 getch();
111                 //text box
112                 /*++++mxBitBlt(xpos, ypos+(TILEWH*12), SCREEN_WIDTH, TILEWH*BUFFMX, 0, BS); //copy background
113                 mxFillBox(xpos, ypos+(TILEWH*12), SCREEN_WIDTH, TILEWH*BUFFMX, 0, OP_SET); // background for text box
114                 //+(QUADWH*6)
115                 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-48, "========================================");
116                 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-40, "|    |Chikyuu:$line1");
117                 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-32, "|    |$line2");
118                 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-24, "|    |$line3");
119                 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-16, "|    |$line4");
120                 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-8,  "========================================");
121                 mxFillBox(xpos+QUADWH, ypos+QUADWH+(TILEWH*12), TILEWH*2, TILEWH*2, 9, OP_SET); //portriat‾
122                 getch();
123                 mxBitBlt(0, BS, SCREEN_WIDTH, TILEWH*BUFFMX, xpos, ypos+(TILEWH*12)); //copy background
124                 getch();++++*/
125                 while(!kbhit())
126                 {
127                         //for(int i=0;i<TILEWH;i++){
128                                 ding(&screen, &bakapee, key);
129                                 modexPanPage(&screen, xpos, ypos);
130 //++++mxFillBox(384, 304, 384, 304, 10, OP_SET);
131 //mxBitBlt(xpos, ypos, SCREEN_WIDTH, SCREEN_HEIGHT, 32, (SCREEN_HEIGHT+64+32));
132 //++++mxBitBlt(TILEWH*2, TILEWH*2, SCREEN_WIDTH, SCREEN_HEIGHT, 32, (SCREEN_HEIGHT+64+32));
133                                 //for(word o = 0; o<TILEWH; o++){
134                                         xpos+=xdir;
135                                         ypos+=ydir;
136                                         //if(ypos==1 || (ypos==(BH-SCREEN_HEIGHT-1)))delay(500);
137                                         //if((xpos>(VW-SCREEN_WIDTH-1)) || (xpos<1))delay(500);
138                                         //mxWaitRetrace();
139 //mxBitBlt(32, (SCREEN_HEIGHT+32), SCREEN_WIDTH, SCREEN_HEIGHT, xpos, ypos);
140 //++++mxBitBlt(TILEWH*2, (SCREEN_HEIGHT+64+32), SCREEN_WIDTH, SCREEN_HEIGHT, TILEWH*2, TILEWH*2);
141 //xpos=ypos=TILEWH*2;
142                                         //????modexPanPage(&screen, 32, 32);
143                                 //}
144                                 if( (xpos>(VW-SCREEN_WIDTH-1))  || (xpos<1)){xdir=-xdir;}
145                                 if( (ypos>(BH-SCREEN_HEIGHT-1)) || (ypos<1)){ydir=-ydir;} // { Hit a boundry, change
146                         //}//    direction!
147 //mxBitBlt(32, (SCREEN_HEIGHT+64+32), SCREEN_WIDTH, SCREEN_HEIGHT, xpos, ypos);
148 //mxBitBlt(TILEWH*2, (SCREEN_HEIGHT+64+32), SCREEN_WIDTH, SCREEN_HEIGHT, TILEWH*2, TILEWH*2);
149                 }
150         ch=getch();
151         if(ch==0x71)break; // 'q'
152         if(ch==0x1b)break; // 'ESC'
153         }
154         setVGAmodeX(&gamevars, 0);
155 #endif
156         printf("bakapi ver. 1.04.13.04¥nis made by sparky4(≧ω≦) feel free to use it ^^¥nLicence: GPL v3¥n");
157 }
158 //pee!