hanse_killer escribió:
lo de (programar) no es proramar en si..son krear unas librerias partiendo de una base ya establecida
Que no tienes ni idea de lo que hablas :)
Si hubieras continuado con un.............
#include "debug.h"
#include "proto.h"
#include "acid.c"
#include "sintab.c"
/* Computed to match the allocated 16M at the chosen resolution */
#define NUM_BUFFERS 10
static unsigned int xa1 = 0x3c94c952;
static unsigned int xa2 = 0xb905ba35;
static unsigned int xa3 = 0x960daaab;
static unsigned int xa4 = 0xa7d6c2a2;
static unsigned int ya1 = 0xbdc6c9ee;
static unsigned int ya2 = 0xc41195ce;
static unsigned int ya3 = 0x94e84a1c;
static unsigned int ya4 = 0xdc42fdd7;
static int fine_x, scrollpos;
static const char scrolltext[] = "ejmplo de lo que no hay que copiar";
static void draw_frame()
{
int x, y;
x = sintab[xa1 >> 16] + sintab[xa2 >> 16] +
sintab[xa3 >> 16] + sintab[xa4 >> 16];
y = sintab[ya1 >> 16] + sintab[ya2 >> 16] +
sintab[ya3 >> 16] + sintab[ya4 >> 16];
x = (x*(av_width-acid.width))>>18;
y = (y*(av_height-acid.height))>>18;
fb_draw_bob_rgba(x, y, (const unsigned int *)acid.pixel_data,
acid.width, acid.height);
xa1 += 13490424;
xa2 += 8187533;
xa3 -= 441411;
xa4 -= 42438;
ya1 += 15833232;
ya2 -= 5609977;
ya3 += 629892;
ya4 -= 16414;
for(x = av_width/8-2; x>=0; --x)
draw_glyph_8x8(x*8+fine_x, av_height-100,
font8x8+(x+scrollpos > 0 &&
x+scrollpos < sizeof(scrolltext)?
scrolltext[x+scrollpos] : ' ')*8,
0xffffff, 0x0000ff);
if(--fine_x < 0) {
fine_x += 8;
scrollpos++;
}
}
static void demo()
{
unsigned long t, t0, offset;
void *fb_addr0;
int f;
int i;
fb_clear(0x00ee00);
fb_addr0 = fb_addr;
t0 = read_tb();
f = 0;
scrollpos = -(av_width/8);
fine_x = 0;
while(scrollpos < (int)sizeof(scrolltext)) {
/* Choose new buffer */
if(++f >= NUM_BUFFERS)
f = 0;
offset = f * av_width * av_height * 4;
/* Draw frame */
fb_addr = fb_addr0 + offset;
draw_frame();
/* Flip and delay */
fb_flip(offset);
t0 += tb_hz / av_fps;
t = read_tb();
if(((long)(t0-t)) > 0)
tbsleep(t0-t);
}
}
void main()
{
time_init();
av_init();
fb_init();
/* Take us back to GameOS after reboot */
set_boot_flag(0);
demo();
fb_term();
mmu_term();
reboot();
}
void exception_handler(unsigned long vector, unsigned long saved_pc,
unsigned long saved_msr)
{
DBG("EXCEPTION VECTOR %lx at %lx (MSR=%lx)\n",
vector, saved_pc, saved_msr);
#ifdef DEBUG
sleep(60);
#endif
lv1_panic(0);
}
Aun me hubiera callado
pero vamos ... que.... como decian en los anuncios de antaño
Sigue probando