1 /* display.c for GP2X (CPU/LCD/RAM-Tuner Version 2.0)
2 Copyright (C) 2006 god_at_hell
3 original CPU-Overclocker (c) by Hermes/PS2Reality
6 This program 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 2 of the License, or
9 (at your option) any later version.
11 This program 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 should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #include "gp2xminilib.h"
33 //unsigned TEXTBACK=0x900000; // text-background-color
35 extern unsigned char msx[]; // define la fuente externa usada para dibujar letras y numeros
37 void ClearScreen(unsigned val) // se usa para 'borrar' la pantalla virtual con un color
43 col=gp2x_video_color15(c[0],c[1],c[2],0);
44 for(n=0;n<320*240;n++)
50 void DrawBox(unsigned val)
56 col=gp2x_video_color15(c[0],c[1],c[2],0);
58 for(n=320*27+2;n<320*28-1;n++)
61 gp2x_screen15[n+320*209]=col;
64 for(n=320*29+4;n<320*30-3;n++)
67 gp2x_screen15[n+320*169]=col;
68 gp2x_screen15[n+320*205]=col;
71 for(n=320*28;n<320*237;n=n+320)
73 gp2x_screen15[n+2]=col;
74 gp2x_screen15[n-2]=col;
77 for(n=320*30;n<320*235;n=n+320)
79 gp2x_screen15[n+4]=col;
80 gp2x_screen15[n-4]=col;
83 for(n=320*30;n<320*199;n=n+320)
85 gp2x_screen15[n-120]=col;
88 for(n=320*55-120;n<320*55-4;n++)
95 void v_putchar( unsigned x, unsigned y, unsigned color, unsigned textback, unsigned char ch) // rutina usada para dibujar caracteres (coordenadas de 8x8)
100 unsigned short col,col2;
101 if(x>=WIDTH || y>=HEIGHT) return;
103 col=gp2x_video_color15(c[0],c[1],c[2],0);
105 col2=gp2x_video_color15(c[0],c[1],c[2],0);
107 font = &msx[ (int)ch * 8];
108 for (i=0; i < 8; i++, font++)
110 for (j=0; j < 8; j++)
112 if ((*font & (128 >> j)))
114 gp2x_screen15[v+(((x<<3)+j))]=col;
116 else gp2x_screen15[v+(((x<<3)+j))]=col2;
122 // display array of chars
124 void v_putcad(int x,int y,unsigned color,unsigned textback,char *cad) // dibuja una cadena de texto
126 while(cad[0]!=0) {v_putchar(x,y,color,textback,cad[0]);cad++;x++;}
130 void gp2x_sound_frame(void *unused, unsigned char *stream, int samples)
135 for(n=0;n<(samples);n++)