RYGAR (./239) :tu as oublié de mettre la boucle principale avec cette commande:
Ultime tentative avec ton code vince et non ça marche pas MAIS ! si je rajoute un "int i;" ça marche !!
Merci à vous deux les gars. Je reviens vers vous d'ici 4-5 jours avec tout un tas de questions histoires de comprendre vraiment le fonctionnement du truc.
Philippe apparemment tu n'utilise pas la même méthode que vince et j'aimerais pouvoir comprendre aussi comment tu fais donc si tu pouvais m'expliquer dans mon code deux poste plus haut pourquoi cela n'as pas marché je suis preneur.
Merci encore à vous deux et à dans qque jours
while(1)Et après compteur = 99; tu met les lignes suivantes:
SCBDATA(SCBc0) = c0; 
SCBDATA(SCBc1) = c1; 
SCBDATA(SCBc2) = c2; 
SCBDATA(SCBc3) = c3; 
SCBDATA(SCBc4) = c4; 
SCBDATA(SCBc5) = c5; 
SCBDATA(SCBc6) = c6; 
SCBDATA(SCBc7) = c7; 
SCBDATA(SCBc8) = c8; 
SCBDATA(SCBc9) = c9; 
  
  
char compteur; 
SCBX(SCB_UNITES) = 81;  
SCBY(SCB_UNITES) = 50;  
SCBX(SCB_DIZAINES) = 74; 
SCBY(SCB_DIZAINES) = 50;   alors que c'est inutile.
Pour décrementer, utilise une autre variable, comme:
au début:
char tempa; après char main() :
compteur = 99;
tempa = 8;dans la boucle principale :
tempa-=1;
if (tempa==0)
	{
	tempa=8;
	compteur-=1
	if (compteur==0)		compteur=99;
	}et si tu as oublié de mettre un sprite pour le fond, met donc un DrawFBox(0,0,160,102,0);
au début de la boucle principale :
while(1)
{ 
Vsync();
SwapBuffers();
DrawFBox(0,0,160,102,0);code complet:
// jp 17/12/2012
#include <stdlib.h>  
#include <lynx.h>  
#include <lynxlib.h>  
#include "inc\c0.pal"  
 
#define JOY_RIGHT		0x10  
#define JOY_LEFT		0x20  
#define JOY_DOWN		0x40  
#define JOY_UP			0x80  
#define BUTTON_OPTION1	0x08  
#define BUTTON_OPTION2	0x04  
#define BUTTON_INNER	0x02  
#define BUTTON_OUTER	0x01  
#define BUTTON_PAUSE	0x01  
  
 
char SCREEN[8160]       at (MEMTOP-16320);  
char RENDER[8160]       at (MEMTOP-8160); 
// ------------------------------------
char tempa, compteur;
int i, unite, dizaine;
// clip du sprite chiffres: 0123456789
extern uchar c0[];   
extern uchar c1[];   
extern uchar c2[];   
extern uchar c3[];   
extern uchar c4[];   
extern uchar c5[];   
extern uchar c6[];   
extern uchar c7[];   
extern uchar c8[];   
extern uchar c9[];  
uchar *chtab[10] = {c0, c1, c2, c3, c4, c5, c6, c7, c8,c9};
uchar SCB_UNITES[]; // déclaration d'un nouveau controleur de sprite
uchar SCB_DIZAINES[]; // déclaration d'un nouveau controleur de sprite	  
#asm
_SCB_UNITES 
			dc.b $c7,$10,$20
	        dc.w 0,0
	        dc.w 0,0,$100,$100
	        dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef
_SCB_DIZAINES 
			dc.b $c7,$10,$20
	        dc.w 0,0
	        dc.w 0,0,$100,$100
	        dc.b $01,$23,$45,$67,$89,$ab,$cd,$ef
#endasm
// ------------------------------------
void Vsync()   
{  
#asm  
vretrace:  
	lda $fd0a  
	bne vretrace  
#endasm  
}
  
char main()  
{  
InitIRQ();  
CLI;  
SetBuffers(SCREEN, RENDER ,0);  
SetRGB(c0_pal); 
 
SCBX(SCB_UNITES) = 81;  
SCBY(SCB_UNITES) = 50;  
SCBX(SCB_DIZAINES) = 74; 
SCBY(SCB_DIZAINES) = 50;
SCBNEXT(SCB_UNITES) = SCB_DIZAINES; // chainage de sprite
compteur = 99;
tempa = 8;
// ********************* Boucle principale *********************
while(1)
	{ 
	Vsync();
	SwapBuffers();
	DrawFBox(0,0,160,102,0);
	tempa-=1;
	if (tempa==0)
		{
		tempa=8;
		compteur-=1;
		if (compteur==0)		compteur=99;
		}
	unite = compteur % 10;
	dizaine = compteur / 10 % 10;
	SCBDATA(SCB_UNITES) = chtab[unite%10];
	SCBDATA(SCB_DIZAINES) = chtab[dizaine%10];
	DrawSprite(SCB_UNITES); // un seul drawsprite jean-philippe
	}
// ********************* Fin de la Boucle principale *********************
}
 

 
 
