LOL
#include <lynx.h>
#include <lynxlib.h>
#define BITS4 (0xc0)
#define BITS3 (0x80)
#define BITS2 (0x40)
#define BITS1 (0x00)
#define HFLIP (0x20)
#define VFLIP (0x10)
#define SHADOW (0x07)
#define XORSHADOW (0x06)
#define NONCOLLIDABLE (0x05)
#define NORMAL (0x04)
#define BOUNDARY (0x03)
#define BOUNDARYSHADOW (0x02)
#define BKGRNDNOCOL (0x01)
#define BKGRND (0x00)
#define LITERAL (0x80)
#define RELHVST (0x30)
#define RELHVS (0x20)
#define RELHV (0x10)
#define RELPALETTE (0x00)
#define EXISTPALETTE (0x08)
#define SKIPSPRITE (0x04)
#define DUP (0x02)
#define DDOWN (0x00)
#define DLEFT (0x01)
#define DRIGHT (0x00)
#define DONTCOLLIDE (0x20)
#define SCREEN 0xa000
#define TRUE 1
#define FALSE 0
extern char vSCB[];
char vvSCB[24];
char tmp_i=0;
char pal[] = {
0x00,0x00,0x08,0x00,0x00,0x08,0x08,0x08,0x04,0x00,0x0F,0x00,0x00,0x0F,0x0F,0x0F,
0x00,0x08,0x00,0x80,0x88,0x80,0x08,0x88,0x44,0x0F,0x00,0xF0,0xFF,0xF0,0x0F,0xFF
};
#asm
_spr = $ff00-2*8160-80*15 ; Below the first screen
xref _vv
xref _v
_vSCB
dc.b $c4, $90, $20
dc.w 0, _v ; ptrNext, ptrData
dc.w 0, 0 ; x,y
dc.w $600, $600 ;size
dc.b $01, $23, $45, $67, $89, $ab, $cd, $ef
#endasm
char v[] = {
8,0x00,0x40,0x40,0x40,0x40,0x40,0x00,
8,0x00,0x04,0x88,0x88,0x84,0x40,0x40,
8,0x00,0x88,0xEE,0xEE,0xEE,0x88,0x40,
8,0x08,0xEE,0xEE,0xEE,0xEE,0xEE,0x80,
8,0x08,0xE8,0x8E,0xE8,0x8E,0xE8,0x80,
8,0x8E,0x8E,0xE8,0x8E,0xE8,0x8E,0xE8,
8,0x8E,0x83,0xE8,0x83,0xE8,0xEE,0xE8,
8,0x8E,0xE8,0x8E,0xE8,0x8E,0xEE,0xE8,
8,0x8E,0xEE,0xEE,0xEE,0xE8,0x88,0xE8,
8,0x8E,0x88,0x88,0x88,0x8F,0xF8,0xE8,
8,0x08,0xE8,0xF8,0xF8,0xFF,0x8E,0x80,
8,0x08,0xEE,0x88,0x88,0x88,0xEE,0x80,
8,0x00,0x88,0xEE,0xEE,0xEE,0x88,0x00,
8,0x00,0x00,0x88,0x88,0x88,0x00,0x00,
9,0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0x0f,0
};
char vv[] = {
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,
8,0x77,0x77,0x78,0x88,0x88,0xff,0xff,0
};
char WaitButton(){
char key;
while ( (key = joystick) == 0);
/* wait for the button to be released */
while ( joystick );
return key;
}
#define SCBPAL1(a) (*(uchar *)((a)+15))
#define SCBPAL2(a) (*(uchar *)((a)+16))
#define SCBPAL3(a) (*(uchar *)((a)+17))
#define SCBPAL4(a) (*(uchar *)((a)+18))
#define SCBPAL5(a) (*(uchar *)((a)+19))
#define SCBPAL6(a) (*(uchar *)((a)+20))
#define SCBPAL7(a) (*(uchar *)((a)+21))
#define SCBPAL8(a) (*(uchar *)((a)+22))
#define DRAW_VIDEO(a,b) (*(uchar *)((a)+(b)))
void main(){
int xpos, ypos;
int i,j;
char key;
SCBCTL0(vvSCB)=0xc4;
SCBCTL1(vvSCB)=0x90;
SCBCOLL(vvSCB)=0x20;
SCBNEXT(vvSCB)=0;
SCBDATA(vvSCB)=vv;
SCBX(vvSCB)=40;
SCBY(vvSCB)=0;
SCBHS(vvSCB)=0x600;
SCBVS(vvSCB)=0x600;
SCBPAL1(vvSCB)=0x01;
SCBPAL2(vvSCB)=0x23;
SCBPAL3(vvSCB)=0x45;
SCBPAL4(vvSCB)=0x67;
SCBPAL5(vvSCB)=0x89;
SCBPAL6(vvSCB)=0xab;
SCBPAL7(vvSCB)=0xcd;
SCBPAL8(vvSCB)=0xef;
#asm
lda #$c
sta $fff9
cli
#endasm
SetBuffers(SCREEN,(char *)0,(char *)0 );
SetRGB(pal);
SetBuffers(SCREEN,(char *)0,(char *)0 );
for (;;){
DrawFBox(0, 0, 160, 102, 0);
SCBX(vSCB)=40;
SCBY(vSCB)=0;
DrawSprite(vSCB);
(*(uchar *)(0xfd40))=0xFF;
(*(uchar *)(0xfd50))=0xF;
(*(uchar *)(0xFD20))=0xFF;
for (;;){
(*(uchar *)(0xfdA0))=0x0;
(*(uchar *)(0xfd50))=0x0;
for (j=0;j<1000;j++){
for (i=0;i<=0xFF;i=i+64) (*(uchar *)(0xFD22))=i;
for (i=0xFF;i>=0;i=i-64) (*(uchar *)(0xFD22))=i;
}
(*(uchar *)(0xfdA0))=0x08;
(*(uchar *)(0xfd50))=0x0f;
for (j=0;j<1000;j++){
for (i=0;i<=0xFF;i=i+64) (*(uchar *)(0xFD22))=i;
for (i=0xFF;i>=0;i=i-64) (*(uchar *)(0xFD22))=i;
}
(*(uchar *)(0xfdA0))=0x0f;
(*(uchar *)(0xfd50))=0xf0;
for (j=0;j<1000;j++){
for (i=0;i<=0xFF;i=i+64) (*(uchar *)(0xFD22))=i;
for (i=0xFF;i>=0;i=i-64) (*(uchar *)(0xFD22))=i;
}
}
WaitButton();
}
}
QUE FAIT CE CODE ???
(info c'est du code lynx, sans bug...)