1 /* Project 16 Source Code‾
2 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
4 * This file is part of Project 16.
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.
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.
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.
23 #include "src/bakapi.h"
29 main(int argc, char *argv[])
31 global_game_variables_t gamevars;
34 word key,d,xpos,ypos,xdir,ydir;
36 // main variables values
37 d=4; // switch variable
38 key=2; // default screensaver number
43 bakapee.xx = rand()&0%SCREEN_WIDTH;
44 bakapee.yy = rand()&0%SCREEN_HEIGHT;
51 /* setup camera and screen‾ */
52 screen = modexDefaultPage();
53 screen.width += (TILEWH*2);
54 screen.height += (TILEWH*2);
57 //modexPalUpdate(bmp.palette); //____
58 //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
66 { // conditions of screen saver
67 ding(&screen, &bakapee, key);
71 setVGAmodeX(&gamevars, 0);
73 printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.¥n", getch()); // prompt the user
75 //if(key==3){xx=yy=0;} // crazy screen saver wwww
77 setVGAmodeX(&gamevars, 1);
81 setVGAmodeX(&gamevars, 1);
83 { // conditions of screen saver
86 ding(&screen, &bakapee, key);
88 //end of screen savers
89 /*for(int x = 0; x < screen.width; ++x)
91 modexputPixel(&page, x, 0, 15);
92 mxPutPixel(x, SCREEN_HEIGHT-1, 15);
94 for (int y = 0; y < VH; ++y)
97 mxPutPixel(SCREEN_WIDTH-1, y, 15);
99 for (int x = 0; x < VW; ++x)
101 mxPutPixel(x, 0, 15);
102 mxPutPixel(x, VH-1, 15);
104 for (int y = 240; y < VH; ++y)
106 mxPutPixel(0, y, 15);
107 mxPutPixel(VW-1, y, 15);
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
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‾
123 mxBitBlt(0, BS, SCREEN_WIDTH, TILEWH*BUFFMX, xpos, ypos+(TILEWH*12)); //copy background
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++){
136 //if(ypos==1 || (ypos==(BH-SCREEN_HEIGHT-1)))delay(500);
137 //if((xpos>(VW-SCREEN_WIDTH-1)) || (xpos<1))delay(500);
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);
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
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);
151 if(ch==0x71)break; // 'q'
152 if(ch==0x1b)break; // 'ESC'
154 setVGAmodeX(&gamevars, 0);
156 printf("bakapi ver. 1.04.13.04¥nis made by sparky4(≧ω≦) feel free to use it ^^¥nLicence: GPL v3¥n");