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 gvar;
32 static bakapee_t bakapee;
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;
52 /* setup camera and screen~ */
53 screen = modexDefaultPage();
54 screen.width += (TILEWH*2);
55 screen.height += (TILEWH*2);
58 //modexPalUpdate(bmp.palette); //____
59 //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
63 modexShowPage(&screen);
70 { // conditions of screen saver
71 ding(&screen, &bakapee, key);
78 printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n", getch()); // prompt the user
80 //if(key==3){xx=yy=0;} // crazy screen saver wwww
81 if(key==0){ d=0; }else{
82 screen = modexDefaultPage();
83 screen.width += (TILEWH*2);
84 screen.height += (TILEWH*2);
86 modexShowPage(&screen);
92 { // conditions of screen saver
95 ding(&screen, &bakapee, key);
97 //end of screen savers
98 /*for(int x = 0; x < screen.width; ++x)
100 modexputPixel(&page, x, 0, 15);
101 mxPutPixel(x, SCREEN_HEIGHT-1, 15);
103 for (int y = 0; y < VH; ++y)
105 mxPutPixel(0, y, 15);
106 mxPutPixel(SCREEN_WIDTH-1, y, 15);
108 for (int x = 0; x < VW; ++x)
110 mxPutPixel(x, 0, 15);
111 mxPutPixel(x, VH-1, 15);
113 for (int y = 240; y < VH; ++y)
115 mxPutPixel(0, y, 15);
116 mxPutPixel(VW-1, y, 15);
121 /*++++mxBitBlt(xpos, ypos+(TILEWH*12), SCREEN_WIDTH, TILEWH*BUFFMX, 0, BS); //copy background
122 mxFillBox(xpos, ypos+(TILEWH*12), SCREEN_WIDTH, TILEWH*BUFFMX, 0, OP_SET); // background for text box
124 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-48, "========================================");
125 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-40, "| |Chikyuu:$line1");
126 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-32, "| |$line2");
127 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-24, "| |$line3");
128 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-16, "| |$line4");
129 mxOutText(xpos+1, ypos+SCREEN_HEIGHT-8, "========================================");
130 mxFillBox(xpos+QUADWH, ypos+QUADWH+(TILEWH*12), TILEWH*2, TILEWH*2, 9, OP_SET); //portriat~
132 mxBitBlt(0, BS, SCREEN_WIDTH, TILEWH*BUFFMX, xpos, ypos+(TILEWH*12)); //copy background
136 //for(int i=0;i<TILEWH;i++){
137 ding(&screen, &bakapee, key);
138 modexPanPage(&screen, xpos, ypos);
139 //++++mxFillBox(384, 304, 384, 304, 10, OP_SET);
140 //mxBitBlt(xpos, ypos, SCREEN_WIDTH, SCREEN_HEIGHT, 32, (SCREEN_HEIGHT+64+32));
141 //++++mxBitBlt(TILEWH*2, TILEWH*2, SCREEN_WIDTH, SCREEN_HEIGHT, 32, (SCREEN_HEIGHT+64+32));
142 //for(word o = 0; o<TILEWH; o++){
145 //if(ypos==1 || (ypos==(BH-SCREEN_HEIGHT-1)))delay(500);
146 //if((xpos>(VW-SCREEN_WIDTH-1)) || (xpos<1))delay(500);
148 //mxBitBlt(32, (SCREEN_HEIGHT+32), SCREEN_WIDTH, SCREEN_HEIGHT, xpos, ypos);
149 //++++mxBitBlt(TILEWH*2, (SCREEN_HEIGHT+64+32), SCREEN_WIDTH, SCREEN_HEIGHT, TILEWH*2, TILEWH*2);
150 //xpos=ypos=TILEWH*2;
151 //????modexPanPage(&screen, 32, 32);
153 if( (xpos>(VW-SCREEN_WIDTH-1)) || (xpos<1)){xdir=-xdir;}
154 if( (ypos>(BH-SCREEN_HEIGHT-1)) || (ypos<1)){ydir=-ydir;} // { Hit a boundry, change
156 //mxBitBlt(32, (SCREEN_HEIGHT+64+32), SCREEN_WIDTH, SCREEN_HEIGHT, xpos, ypos);
157 //mxBitBlt(TILEWH*2, (SCREEN_HEIGHT+64+32), SCREEN_WIDTH, SCREEN_HEIGHT, TILEWH*2, TILEWH*2);
160 if(ch==0x71)break; // 'q'
161 if(ch==0x1b)break; // 'ESC'
163 // VGAmodeX(0, &gvar);
165 printf("bakapi ver. 1.04.13.04\nis made by sparky4
\81i
\81\86\83Ö
\81\85\81j feel free to use it ^^\nLicence: GPL v3\n");