2 * The library testing routines follows below.
\r
15 /* This is the way to calculate the number of pages available. */
\r
16 pages = 65536L/(widthBytes*height); // apparently this takes the A000 address
\r
17 // if(height==240) pages++;
\r
19 // printf("%d¥n", pages);
\r
21 for (p = 0; p <= pages; ++p)
\r
25 /* On each page draw a single colored border, and dump the palette
\r
26 onto a small square about the middle of the page. */
\r
29 for (x = 0; x <= width; ++x)
\r
31 // putPixel_X(x, 0, p+1);
\r
32 mxPutPixel(x, 0, p+1);
\r
33 if(p!=pages) mxPutPixel(x, height-1, p+1);
\r
34 else if(height==240) mxPutPixel(x, 99-1, p+1);
\r
37 for (y = 0; y <= height; ++y)
\r
39 mxPutPixel(0, y, p+1);
\r
40 if(p!=pages) mxPutPixel(width-1, y, p+1);
\r
41 else if(height==240) mxPutPixel(width-1, y, p+1);
\r
44 for (x = 0; x < TILEWH; ++x)
\r
45 for (y = 0; y < TILEWH; ++y)
\r
46 mxPutPixel(x+(p+2)*16, y+(p+2)*TILEWH, x + y*TILEWH);
\r
51 /* Each pages will now contain a different image. Let the user cycle
\r
52 through all the pages by pressing a key. */
\r
53 for (p = 0; p < pages; ++p)
\r
62 * Library test (program) entry point.
\r
67 int key,d,xpos,ypos,xdir,ydir;
\r
70 d=1; // switch variable
\r
71 key=4; // default screensaver number
\r
76 // puts("First, have a look at the 320x200 mode. I will draw some rubbish");
\r
77 // puts("on all of the four pages, then let you cycle through them by");
\r
78 // puts("hitting a key on each page.");
\r
79 // puts("Press a key when ready...");
\r
84 // puts("Then, check out Mode X, 320x240 with 3 (and a half) pages.");
\r
85 // puts("Press a key when ready...");
\r
92 /*while(d!=0){ // on!
\r
93 if(!kbhit()){ // conditions of screen saver
\r
97 // user imput switch
\r
98 printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 5 to quit.¥n", getch()); // prompt the user
\r
100 //if(key==3){xx=yy=0;} // crazy screen saver wwww
\r
105 while(!kbhit()){ // conditions of screen saver
\r
108 //end of screen savers
\r
110 for (int x = 0; x < width; ++x)
\r
112 mxPutPixel(x, 0, 15);
\r
113 mxPutPixel(x, height-1, 15);
\r
115 for (int y = 0; y < height; ++y)
\r
117 mxPutPixel(0, y, 15);
\r
118 mxPutPixel(width-1, y, 15);
\r
126 //for(int i=0;i<TILEWH;i++){
\r
132 if( (xpos>239) || (xpos<1))xdir=-xdir;
\r
133 if( (ypos>179) || (ypos<1))ydir=-ydir; // { Hit a boundry, change
\r
138 printf("wwww¥n%dx%d¥n", width,height);
\r
139 printf("[%d]¥n", mxGetVersion());
\r
140 puts("where to next? It's your move! wwww");
\r
141 printf("bakapi ver. 1.04.09.04¥nis made by sparky4(≧ω≦) feel free to use it ^^¥nLicence: GPL v2¥n");
\r