/* snap.c: part of the 4bpp software. Dumps graphics buffer to screen/file. Copyright (C) 2002 Agustin Ferrin Pozuelo gato.vze.com This program 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 2 of the License, or (at your option) any later version. This program 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "graficos.h" #include int main(int argc, char **argv) { int tam; char *puntero; /* FILE *ficheropgm; printf("Abriendo %s...\n",argv[1]); if((ficheropgm=fopen(argv[1],"w"))==NULL){ printf("Error abriendo %s\n",argv[1]); return 1; } fprintf(ficheropgm,"P2\n#Creado por snap.c (AFP)\n320\n240\n15\n"); printf("Tipo :P2 (RAW GRAY SCALE)\n"); */ printf("P2\n#Creado por snap.c (AFP)\n%d\n%d\n15\n",Pantalla_Actual.ancho_virtual,Pantalla_Actual.alto_virtual); puntero=Pantalla_Actual.comienzo_memoria; tam=Pantalla_Actual.ancho_bytes*Pantalla_Actual.alto_virtual; while(tam--){ printf("%d %d \n",((*puntero)&0xF0)/16,((*puntero)&0x0F)); puntero++; } /* fprintf(ficheropgm,"P5\n#Creado por snap.c (AFP)\n320\n240\n15\n"); printf("Tipo :P5 (RAW GRAY SCALE)\n"); puntero=(char *) LSSA; tam=LXMAX*(LYMAX+1)/(8/LCD_BPP); while(tam--){ fputc(((*puntero)&0xF0)/16,ficheropgm); fputc(((*puntero++)&0x0F),ficheropgm); } fclose(ficheropgm); */ return 0; }