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 published 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"
28 global_game_variables_t gvar;
29 static bakapee_t bakapee;
30 word key,d,xpos,ypos,xdir,ydir;
34 main(int argc, char *argvar[])
36 // main variables values
37 d=4; // switch variable
38 key=2; // default screensaver number
49 bakapee.xx = rand()&0%gvar.video.page[0].width;
50 bakapee.yy = rand()&0%gvar.video.page[0].height;
58 /* setup camera and screen~ */
59 gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);
60 gvar.video.page[0].width += (TILEWH*2);
61 gvar.video.page[0].height += (TILEWH*2);
64 //modexPalUpdate(bmp.palette); //____
65 //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
68 modexShowPage(&gvar.video.page[0]);
75 { // conditions of screen saver
76 ding(&gvar.video.page[0], &bakapee, key);
87 fprintf(stderr, "xx=%d yy=%d\n", bakapee.xx, bakapee.yy);
88 printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n", getch()); // prompt the user
89 // printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n"); // prompt the user
92 //if(key==3){xx=yy=0;} // crazy screen saver wwww
93 if(key==0){ d=0; }else{
94 gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);
95 gvar.video.page[0].width += (TILEWH*2);
96 gvar.video.page[0].height += (TILEWH*2);
102 modexShowPage(&gvar.video.page[0]);
108 { // conditions of screen saver
111 ding(&gvar.video.page[0], &bakapee, key);
113 //end of screen savers
114 /*for(int x = 0; x < gvar.video.page[0].width; ++x)
116 modexputPixel(&page, x, 0, 15);
117 mxPutPixel(x, gvar.video.page[0].height-1, 15);
119 for (int y = 0; y < VH; ++y)
121 mxPutPixel(0, y, 15);
122 mxPutPixel(gvar.video.page[0].width-1, y, 15);
124 for (int x = 0; x < VW; ++x)
126 mxPutPixel(x, 0, 15);
127 mxPutPixel(x, VH-1, 15);
129 for (int y = 240; y < VH; ++y)
131 mxPutPixel(0, y, 15);
132 mxPutPixel(VW-1, y, 15);
134 pdump(&gvar.video.page[0]);
137 /*++++mxBitBlt(xpos, ypos+(TILEWH*12), gvar.video.page[0].width, TILEWH*BUFFMX, 0, BS); //copy background
138 mxFillBox(xpos, ypos+(TILEWH*12), gvar.video.page[0].width, TILEWH*BUFFMX, 0, OP_SET); // background for text box
140 mxOutText(xpos+1, ypos+gvar.video.page[0].height-48, "========================================");
141 mxOutText(xpos+1, ypos+gvar.video.page[0].height-40, "| |Chikyuu:$line1");
142 mxOutText(xpos+1, ypos+gvar.video.page[0].height-32, "| |$line2");
143 mxOutText(xpos+1, ypos+gvar.video.page[0].height-24, "| |$line3");
144 mxOutText(xpos+1, ypos+gvar.video.page[0].height-16, "| |$line4");
145 mxOutText(xpos+1, ypos+gvar.video.page[0].height-8, "========================================");
146 mxFillBox(xpos+QUADWH, ypos+QUADWH+(TILEWH*12), TILEWH*2, TILEWH*2, 9, OP_SET); //portriat~
148 mxBitBlt(0, BS, gvar.video.page[0].width, TILEWH*BUFFMX, xpos, ypos+(TILEWH*12)); //copy background
152 //for(int i=0;i<TILEWH;i++){
153 ding(&gvar.video.page[0], &bakapee, key);
154 modexPanPage(&gvar.video.page[0], xpos, ypos);
155 //++++mxFillBox(384, 304, 384, 304, 10, OP_SET);
156 //mxBitBlt(xpos, ypos, gvar.video.page[0].width, gvar.video.page[0].height, 32, (gvar.video.page[0].height+64+32));
157 //++++mxBitBlt(TILEWH*2, TILEWH*2, gvar.video.page[0].width, gvar.video.page[0].height, 32, (gvar.video.page[0].height+64+32));
158 //for(word o = 0; o<TILEWH; o++){
161 //if(ypos==1 || (ypos==(BH-gvar.video.page[0].height-1)))delay(500);
162 //if((xpos>(VW-gvar.video.page[0].width-1)) || (xpos<1))delay(500);
164 //mxBitBlt(32, (gvar.video.page[0].height+32), gvar.video.page[0].width, gvar.video.page[0].height, xpos, ypos);
165 //++++mxBitBlt(TILEWH*2, (gvar.video.page[0].height+64+32), gvar.video.page[0].width, gvar.video.page[0].height, TILEWH*2, TILEWH*2);
166 //xpos=ypos=TILEWH*2;
167 //????modexPanPage(&gvar.video.page[0], 32, 32);
169 if( (xpos>(VW-gvar.video.page[0].width-1)) || (xpos<1)){xdir=-xdir;}
170 if( (ypos>(BH-gvar.video.page[0].height-1)) || (ypos<1)){ydir=-ydir;} // { Hit a boundry, change
172 //mxBitBlt(32, (gvar.video.page[0].height+64+32), gvar.video.page[0].width, gvar.video.page[0].height, xpos, ypos);
173 //mxBitBlt(TILEWH*2, (gvar.video.page[0].height+64+32), gvar.video.page[0].width, gvar.video.page[0].height, TILEWH*2, TILEWH*2);
176 if(ch==0x71)break; // 'q'
177 if(ch==0x1b)break; // 'ESC'
179 // VGAmodeX(0, &gvar);
181 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");