X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fpcxtest.c;h=4053e51a5f0c06c8ad8845108a2cd0beb5f88e90;hb=077782026074116470d9637507d988ffcc29ef58;hp=ea1d296c6f06221f0c76723cf00cccec74471caf;hpb=f8aa708d074bbb922c6bdc481f9909c2ffd6274a;p=16.git
diff --git a/src/pcxtest.c b/src/pcxtest.c
index ea1d296c..4053e51a 100644
--- a/src/pcxtest.c
+++ b/src/pcxtest.c
@@ -1,3 +1,25 @@
+/* Project 16 Source Code~
+ * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
+ *
+ * This file is part of Project 16.
+ *
+ * Project 16 is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Project 16 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see , or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
#include
#include
#include
@@ -7,26 +29,6 @@
word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
-void
-oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) {
- byte plane;
- word px, py;
- word offset;
-
- /* TODO Make this fast. It's SLOOOOOOW */
- for(plane=0; plane < 4; plane++) {
- modexSelectPlane(PLANE(plane+x));
- for(px = plane; px < bmp->width; px+=4) {
- offset=px;
- for(py=0; pyheight; py++) {
- if(!sprite || bmp->data[offset])
- page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];
- offset+=bmp->width;
- }
- }
- }
-}
-
/*
void
DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite)
@@ -67,17 +69,17 @@ void main() {
// bmp = bitmapLoadPcx("data/chikyuu.pcx");
bmp = bitmapLoadPcx("data/koishi^^.pcx");
// bmp = bitmapLoadPcx("16/PCX_LIB/chikyuu.pcx");
-//0000 p = planar_buf_from_bitmap(&bmp);
+ p = planar_buf_from_bitmap(&bmp);
modexEnter();
/* fix up the palette and everything */
-//++++ modexPalUpdate(&bmp, 0, 0, 0);
+ modexPalUpdate1(bmp.palette);
/* clear and draw one sprite and one bitmap */
modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);
/* non sprite comparison */
- /*0000start = *clockw;
+ start = *clockw;
for(i=0; i<100 ;i++) {
oldDrawBmp(VGA, 20, 20, &bmp, 0);
}
@@ -107,7 +109,7 @@ void main() {
for(i=0; i<100 ;i++) {
//0000 modexDrawSprite(&page, 20, 20, &bmp);
modexDrawSprite(&page, 0, 0, &bmp);
- }*/
+ }
//_fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2));
modexDrawBmp(&page, 0, 0, &bmp);
while(!kbhit())
@@ -119,12 +121,12 @@ void main() {
printf("\n%d\n", sizeof(p->plane));
printf("%d\n", sizeof(bmp));
- /*for(i=0; i<(320*240); i++)
+ for(i=0; i<(320*240); i++)
{
fprintf(stdout, "%d", bmp.data[i]);
if(i%320==0) fprintf(stdout, "\n");
- }*/
-//0000 printf("CPU to VGA: %f\n", t1);
-//0000 printf("VGA to VGA: %f\n", t2);
+ }
+ printf("CPU to VGA: %f\n", t1);
+ printf("VGA to VGA: %f\n", t2);
return;
}