1

Voila.. bon avant de poster ici, j'ai tout essaye sur ma 89, 92plus (HW2²) apres reset etc... et rien n'apparait a l'ecran alors que sous vti tout semble marcher!

voila le code si qqn souhaite m'aider:
// C Source File
// Created 16/07/01; 13:47:46

#define OPTIMIZE_ROM_CALLS    // Use ROM Call Optimization

#define SAVE_SCREEN           // Save/Restore LCD Contents

#include <tigcclib.h>         // Include All Header Files


short _ti89;                  // Produce .89Z File

unsigned char *LCD;
unsigned char *plan0;
unsigned char *plan1;
unsigned char *plan0b;
unsigned char *plan1b;	
INT_HANDLER save_int_1 = NULL;  
static   int 	couleur;
volatile	 int x;
static	 int point;
static	int brique;
static	 int largeur;
static int pos;
static 	int score;
static char mode[6]={1,2,3,3,2,1};
INT_HANDLER save_int_1;

void Horiz(short y,short x2,short x3,short z)						//ligne de 0 a 100
{
	int	i,j=0;
	short plus=0b11111111,plus2=0b11111111;
	plan0 = GetPlane(0);
	plan1 = GetPlane(1);
	i=(y<<5) - (y<<1);
  plan0 += i;
  plan1 += i;
  
	i=(x2/8);
	while (i--)
		{
			if (z==1 || z==3 )
			 {
			*plan0 = (char) (0b11111111);
			 plan0 += 1;	
			 }
			if (z==2 || z==3)  
			 {
			*plan1 = (char) (0b11111111);
			 plan1 += 1;	
			 }
			 j++;
		}
	i=x2-((x2>>3)<<3);	
	if (i) {
	plus <<= (8-i);
	if (z==1 || z==3) *plan0 = (char) (plus);	
	if (z==2 || z==3) *plan1 = (char) (plus);	
	}

	x3 += (i-8);
	i = (x3>>3) + 1;
	plan0 += i;
	plan1 += i;
	j	+= i;
	i=x3-((x3>>3)<<3);	
	plus2 >>= i;
	if (z==1 || z==3) *plan0 = (char) (plus2);	
	if (z==2 || z==3) *plan1 = (char) (plus2);	
	i=(14-j);
	while (i--)
	{
		if (z==1 || z==3)
		{
		plan0	+= 1;
		*plan0 = (char) (0b11111111);	
		}
		if (z==2 || z==3)
		{
		plan1	+= 1;
		*plan1 = (char) (0b11111111);	
		}


	}
}

void ScrollUp(unsigned short* buffer,unsigned short lines) {
    register short* dest = buffer;
    register short* src  = dest + 15;
    register short  tmplines  = lines;
    tmplines-=2;
    asm volatile (
       "0:
        move.l (%0)+,(%1)+;move.l (%0)+,(%1)+;move.l (%0)+,(%1)+
        move.l (%0)+,(%1)+;lea 14(%0),%0;lea 14(%1),%1
        dbra %2,0b
        clr.l (%1)+;clr.l (%1)+;clr.l (%1)+;clr.l (%1)+
        clr.l (%1)+;clr.l (%1)+;clr.l (%1)+;clr.w (%1)+"
        : "=a" (src), "=a" (dest), "=d" (tmplines)
        : "0"  (src),  "1" (dest), "2"  (tmplines));

}


void Synchronise(void)
{
					ScrollUp(GetPlane(0),110);
					ScrollUp(GetPlane(1),110);

					Horiz(99,x,largeur,mode[couleur]);
					if (couleur++==6) couleur=0;
					point++;
					brique++;
}

void evolution(short level)
{
	int l;
	l=x+largeur;
	if (level) {
	if(random(2))
	{
	if (l<108)	x++;
	}
	else
	{
	if (x>10)	x--;
	}
	}

	if (level==1) {
	switch(random(4)){
	case 0:
	if (l<108) x+=4;
	break;
	case 1:
	if (l<108) x+=2;
	break;
	case 2:
	if (x>10) x-=4;
	break;
	case 3:
	if (x>10) x-=2;
	break;
	}
	}

	if (level==2)
	{
	switch(random(6)) {
	case 0:
	if (l<108) {
	x+=4;
	pos=1;	
	}
	break;
	case 1:
	if (l<108){
	x+=2;
	pos=1;	
	} 
	break;
	case 2:
	if (x>10){
	x-=4;
	pos=0;	
	} 
	break;
	case 3:
	if (x>10) {	
	x-=2;
	pos=0;
	}
	break;


	case 4:
	if (x>10 && pos==1) x-=4;
	if (l<108 && pos==0) x+=4;
	break; 
	case 5:
	if (x>10 && pos==1) x-=2;
	if (l<108 && pos==0) x+=2;
	break; 
		}
	}

	
	brique=0;
}

void StartJeu()
{
	int i=100,quitte=1;
	score=0;
	largeur= 70;
	x=19;
	point=0;
	brique=4;
	randomize();
	while (i--)
	{
			Horiz(i-1,x,largeur,mode[i%7]);
	}
	couleur=2;
	OSVRegisterTimer(1,1,Synchronise);

///////////////////////////////////////////////////////////////////////////////:
	while (quitte)
	{

	if (brique==8 && score<100)
	{
	brique=4;
	evolution(0);		
		
	}
	if (brique==4 && score<1000)
	{
	brique=4;
	evolution(1);		
	}
	if (score==1000 && x>10) {
	pos=1;	
	}
	else {
	pos=0;	
	}

	if (brique==8 && score>1000)
	{
		brique=4;
		evolution(2);
	}


	if (point==100 && largeur>10)
	{
	 score+=point;
	 point=0;
   largeur--;
	}
	
	printf_xy(130,1,"%d",score);
	
	if(_rowread(0x23F)&0x1)	quitte=0;
	}

	OSVFreeTimer(1);
}

/////////////////////////////////////////////////////////////////////////////:

void _main(void)
{
	clrscr();
	GrayOn();

	save_int_1=GetIntVec(AUTO_INT_1);
	SetIntVec(AUTO_INT_1,DUMMY_HANDLER);
	StartJeu();
	SetIntVec(AUTO_INT_1,save_int_1);
	

	GrayOff(); 
 

}



Bon ce n'est pas tres bien programme, mais ca fait pas trop lontemp que je prog en C (un peu comme oxmanwink huhu)

Si qqn peut me dire ce qui foire...
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

2

Bisard.. ce programme fonctionne sous toutes les HW1!!!
Mais que ce passe t'il!
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

3

Essaye en premier de rediriger également l'auto-interruption n°5.
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

4

tu veux que je redirige l'autoint1 pour remplacer le timer?
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

5

Non. Pas pour remplacer le timer. D'ailleurs, je viens de trouver une grosse erreur: il faut rediriger les interruptions A_V_A_N_T d'activer les niveaux de gris!

Remplace ton _main par:
void _main(void)
{
INT_HANDLER save_int_1, save_int_5;
	clrscr();
	save_int_1=GetIntVec(AUTO_INT_1);
	SetIntVec(AUTO_INT_1,DUMMY_HANDLER);
	save_int_5=GetIntVec(AUTO_INT_5);
	SetIntVec(AUTO_INT_5,DUMMY_HANDLER);
	GrayOn();
	StartJeu();
	GrayOff(); 
	SetIntVec(AUTO_INT_5,save_int_5);
	SetIntVec(AUTO_INT_1,save_int_1);
}


Vire aussi la déclaration globale de save_int_1 (La variable ne sert que dans _main!) et (à moins que tu ne connaisses le sens particulier de static pour les variables globales) vire tous les qualifiants static pour les variables globales: une variable globale est toujours statique au sens habituel. Pour les variables globales, static = privé = invisible dans les autres fichiers source de ton projet.
[edit]Edité par Kevin Kofler le 18-07-2001 à 00:58:33[/edit]
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

6

héhé tongue
"I read the game.dll assembly more easily than you read the joke on the back of your box of Cocoa Pebbles, and have spent the past 2 1/2 years navigating it." ©

7

Et apres, ca se permet de critiquer les kernels...

8

PpHd> erf si tu lisais un peu.. ca fait pas plus de 1 semaine que je prog en C...
Ca veut pas dire que je sais pas programme en ASM ptit malin va!
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

9

Merci bcp Kevin.. ca marche maintenantwink
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!