Je vais tenter de faire une version HTML d'un jeu Mac que j'avais créé en 1999...
2 participants
Page 1 sur 1
Je vais tenter de faire une version HTML d'un jeu Mac que j'avais créé en 1999...
Bonjour,
Je ne me suis pas encore présenté en bonne et due forme, je me fais très discret, c'est pour ça.
Ce matin j'ai récupéré sur disquettes un jeu que j'avais fait en 1999, lorsque j'avais 17 ans. Je peux dire que c'est pas encore gagné. Voici un bout de code:
S'il-vous-plaît ne me critiquez pas sur ça, j'avais 17 ans quand je l'ai écrit…
Alors, voilà, les sprites sont compilés, et je n'arrive pas à recompiler le jeu. C'est pour ça que je vais en faire une version HTML/js …
Je vais vous tenir au courant de ma progression, si progresion il y a. @+
Je ne me suis pas encore présenté en bonne et due forme, je me fais très discret, c'est pour ça.
Ce matin j'ai récupéré sur disquettes un jeu que j'avais fait en 1999, lorsque j'avais 17 ans. Je peux dire que c'est pas encore gagné. Voici un bout de code:
- Code:
#define kEndShapeToken 0x00
#define kLineStartToken 0x01
#define kDrawPixelsToken 0x02
#define kSkipPixelsToken 0x03
extern unsigned char *bardst;
extern unsigned long barrow;
extern unsigned char *barwin;
extern unsigned long *windest;
extern unsigned long winrow;
extern unsigned long sourcerow;
extern unsigned char *destination;
extern unsigned long drow, drow2, drow3;
extern Rect bound, bound2;
void DrawSprite(Handle sprite, short h, short v) {
asm 68030 {
MOVEM.L D0-D7/A0-A4,-(A7)
movea.l destination, A1
movea.w v, A2
move.l A2, D0
move.l drow, D4
mulu.l D4, D0
movea.l D0, A2
adda.l A1, A2
adda.w h, A2
move.l sprite, A0
move.l (A0), A0
addq.l #8, A0
@run: move.l (A0)+, D3
bfextu D3{0:8}, D0
bfclr D3{0:8}
cmpi.w #kDrawPixelsToken, D0
bne.s @swsk
move.l D3, D2
@drd: cmpi.w #16, D2
blt.s @drl
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
sub.w #16, D2
bra.s @drd
@drl: cmpi.w #4, D2
blt.s @drw
move.l (A0)+, (A1)+
subq.w #4, D2
bra.s @drl
@drw: btst.l #1, D2
beq.s @drc
move.w (A0)+, (A1)+
@drc: btst.l #0, D2
beq.s @bak
move.b (A0)+, (A1)+
@bak: bfclr D3{0:30}
cmpi.w #0, D3
beq.s @run
move.w #4, D2
sub.w D3, D2
adda.w D2, A0
bra.s @run
@swsk: cmpi.w #kSkipPixelsToken, D0
bne.s @swls
adda.l D3, A1
bra.s @run
@swls: cmpi.w #kLineStartToken, D0
bne.s @end
movea.l A2, A1
adda.l D4, A2
bra.s @run
@end: MOVEM.L (A7)+,D0-D7/A0-A4
}
}
void DrawSpriteC(Handle sprite, short h, short v) {
register char *sprt;
short gog;
sprt = *sprite;
{
unsigned long opcode;
unsigned long data;
unsigned char run = 1;
unsigned char *dst, *starter;
register unsigned long *lsrc, *ldst;
register unsigned long counter;
sprt+=8;
dst = destination;
dst += (v*drow);
dst += h;
starter = dst;
/*if( (v&0xFFFE) < v) {
gog = 1;
} else {
gog = 0;
}*/
while(run) {
opcode = (*((unsigned long*)sprt))>>24;
data = (*((unsigned long*)sprt))&0x00FFFFFF;
sprt+=sizeof(unsigned long);
switch(opcode) {
case kDrawPixelsToken:
counter = data;
//if(gog == 1) {
lsrc = (unsigned long*)sprt;
ldst = (unsigned long*)dst;
while(counter>=16) {
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
counter-=16;
}
while(counter>=sizeof(unsigned long)) {
*ldst++ = *lsrc++;
counter-=sizeof(unsigned long);
}
sprt = (char*)lsrc;
dst = (unsigned char*)ldst;
if(counter>=sizeof(unsigned short)) {
*((unsigned short*)dst) = *((unsigned short*)sprt);
dst+=sizeof(unsigned short);
sprt+=sizeof(unsigned short);
counter-=sizeof(unsigned short);
}
if(counter>=sizeof(unsigned char)) {
*((unsigned char*)dst) = *((unsigned char*)sprt);
dst+=sizeof(unsigned char);
sprt+=sizeof(unsigned char);
counter-=sizeof(unsigned char);
}
/*}else{
sprt += counter;
dst += counter;
}*/
sprt+=((data&3L)==0)?0:(4-(data&3L));
break;
case kSkipPixelsToken:
dst+=data;
break;
case kLineStartToken:
dst = starter;
starter+=drow;
/*if(gog == 1) {
gog = 0;
} else {
gog = 1;
}*/
break;
case kEndShapeToken:
run = 0;
break;
}
}
}
}
void kuDrawSprite(Handle sprite, Handle recp, short h, short v) {
asm 68030 {
MOVEM.L D0-D7/A0-A4,-(A7)
movea.l destination, A1
movea.w v, A2
move.l A2, D0
move.l drow, D4
mulu.l D4, D0
movea.l D0, A2
adda.l A1, A2
adda.w h, A2
move.l sprite, A0
move.l (A0), A0
addq.l #8, A0
move.l recp, A3
move.l (A3), A3
addq.l #8, A3
move.l A3, D5
@run: move.l (A0)+, D3
bfextu D3{0:8}, D0
bfclr D3{0:8}
cmpi.w #kDrawPixelsToken, D0
bne.s @swsk
move.l D3, D2
adda.l D3, A0
@drd: cmpi.w #16, D2
blt.s @drl
move.l (A3)+, (A1)+
move.l (A3)+, (A1)+
move.l (A3)+, (A1)+
move.l (A3)+, (A1)+
sub.w #16, D2
bra.s @drd
@drl: cmpi.w #4, D2
blt.s @drw
move.l (A3)+, (A1)+
subq.w #4, D2
bra.s @drl
@drw: btst.l #1, D2
beq.s @drc
move.w (A3)+, (A1)+
@drc: btst.l #0, D2
beq.s @bak
move.b (A3)+, (A1)+
@bak: bfclr D3{0:30}
cmpi.w #0, D3
beq.s @run
move.w #4, D2
sub.w D3, D2
adda.w D2, A0
bra.s @run
@swsk: cmpi.w #kSkipPixelsToken, D0
bne.s @swls
adda.l D3, A1
adda.l D3, A3
bra.s @run
@swls: cmpi.w #kLineStartToken, D0
bne.s @end
movea.l A2, A1
adda.l D4, A2
movea.l D5, A3
add.l #32, D5
bra.s @run
@end: MOVEM.L (A7)+,D0-D7/A0-A4
}
}
void clpkuDrawSprite(Handle sprite, Handle srcspr, short h, short v, short hl, short hr, short vt, short vb) {
char *sprt;
short gogv, gogh;
unsigned long opcode;
unsigned long data;
unsigned char run = 1;
unsigned char *dst, *starter;
unsigned char *src, *srcstarter;
register unsigned long *lsrc, *ldst;
register unsigned long counter;
src = (unsigned char*)*srcspr;
src+=8;
srcstarter = src;
gogv = -1;
sprt = *sprite;
sprt+=8;
dst = destination;
dst += (v*drow);
dst += h;
starter = dst;
while(run) {
opcode = (*((unsigned long*)sprt))>>24;
data = (*((unsigned long*)sprt))&0x00FFFFFF;
sprt+=sizeof(unsigned long);
switch(opcode) {
case kDrawPixelsToken:
counter = data;
sprt += data;
if((gogv >= vt) && (gogv < (32-vb))) {
while(counter>=sizeof(unsigned char)) {
gogh++;
if( (gogh>=hl) && (gogh<(32-hr))) {
*dst++ = *src++;
} else {
dst++;
src++;
}
counter-=sizeof(unsigned char);
}
} else {
dst += counter;
src += counter;
gogh += counter;
}
sprt+=((data&3L)==0)?0:(4-(data&3L));
break;
case kSkipPixelsToken:
dst+=data;
src+=data;
gogh+=data;
break;
case kLineStartToken:
dst = starter;
starter+=drow;
src = srcstarter;
srcstarter+=32;
gogh = -1;
gogv++;
break;
case kEndShapeToken:
run = 0;
break;
}
}
}
void kDrawSprite(Handle sprite, short h, short v) {
asm 68020 {
MOVEM.L D7/A2-A4,-(A7)
movea.l destination, A1
movea.w v, A2
move.l A2, D0
mulu.l drow, D0
add.l A1, D0
movea.l D0, A1
adda.w h, A1
move.l sprite, A0
move.l (A0), A0
addq.l #8, A0
move.l drow3, D1
lsl.l #2, D1
movea.l D1, A2
moveq.l #15, D1
@l: move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
adda.l A2, A1
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
adda.l A2, A1
dbeq D1, @l
MOVEM.L (A7)+,D7/A2-A4
}
}
void clpkDrawSprite(Handle sprite, short h, short v, short hl, short hr, short vt, short vb) {
/*asm 68030 {
MOVEM.L D0-D7/A0-A4,-(A7)
move.l sprite, A0
move.l (A0), A0
addq.l #8, A0
move.l destination, D3
move.l drow, D5
clr.l D4
move.w v, D4
add.w vt, D4
mulu.l D5, D4
add.l D3, D4
add.w h, D4
movea.l D4, A1
MOVEM.L (A7)+,D7/A2-A4
}*/
register char *sprt;
sprt = *sprite;
{
register unsigned char *dst;
unsigned short x, y;
unsigned short xl, xr;
unsigned short xm, ym;
sprt+=8;
dst = destination;
dst += (v*drow);
dst += h;
dst += (vt*drow);
sprt += (vt*32);
ym = (32-vb)-vt;
xm = (32-hr)-hl;
for(y = 0; y < ym; y++) {
dst += hl;
sprt += hl;
xl = xm;
if((xl & 1) != 0) {
*dst++ = *sprt++;
xl--;
}
if((xl & 2) != 0) {
asm 68030 {
move.w (sprt)+, (dst)+
}
xl-=2;
}
while(xl >= 16) {
asm 68030 {
move.l (sprt)+, (dst)+
move.l (sprt)+, (dst)+
move.l (sprt)+, (dst)+
move.l (sprt)+, (dst)+
}
xl -= 16;
}
while(xl >= 4) {
asm 68030 {
move.l (sprt)+, (dst)+
}
xl -= 4;
}
if((xl & 2) != 0) {
asm 68030 {
move.w (sprt)+, (dst)+
}
}
if((xl & 1) != 0) {
*dst++ = *sprt++;
}
/*for(x = 0; x < xl; x++) {
*dst++ = *sprt++;
}*/
dst += hr;
sprt += hr;
dst += drow;
dst -= 32;
}
}
}
void clpkDrawSpriteC(Handle sprite, short h, short v, short hl, short hr, short vt, short vb) {
char *sprt;
sprt = *sprite;
{
unsigned char *dst;
unsigned short x, y;
sprt+=8;
dst = destination;
dst += (v*drow);
dst += h;
dst += (vt*drow);
sprt += (vt*32);
for(y = vt; y < (32-vb); y++) {
dst += hl;
sprt += hl;
for(x = hl; x < (32-hr); x++) {
*dst++ = *sprt++;
}
dst += hr;
sprt += hr;
dst += drow;
dst -= 32;
}
}
}
void clpDrawSprite(Handle sprite, short h, short v, short hl, short hr, short vt, short vb) {
register char *sprt;
short gogv, gogh, gogb;
sprt = *sprite;
{
unsigned long opcode;
unsigned long data;
unsigned char run = 1;
unsigned char *dst, *starter;
register unsigned long counter;
sprt+=8;
dst = destination;
dst += (v*drow);
dst += h;
starter = dst;
gogv = 0;
hr = 32-hr;
vb = 32-vb;
while(run) {
opcode = (*((unsigned long*)sprt))>>24;
data = (*((unsigned long*)sprt))&0x00FFFFFF;
sprt+=sizeof(unsigned long);
switch(opcode) {
case kDrawPixelsToken:
counter = data;
if(gogh<hl) {
gogb = hl-gogh;
if(counter<gogb) {
gogb = counter;
}
if(gogb>0) {
counter -= gogb;
gogh += gogb;
dst += gogb;
sprt += gogb;
}
}
gogb = 0;
gogh+=counter;
if(gogh>=hr) {
gogb = gogh-hr;
if(gogb > counter) {
gogb = counter;
}
counter -= gogb;
}
while(counter>=sizeof(unsigned char)) {
*dst++ = *sprt++;
counter--;
}
if(gogb > 0) {
dst += gogb;
sprt += gogb;
}
sprt+=((data&3L)==0)?0:(4-(data&3L));
break;
case kSkipPixelsToken:
dst+=data;
gogh+=data;
break;
case kLineStartToken:
dst = starter;
starter+=drow;
if(gogv < vt) {
sprt += data;
} else if(gogv >= vb) {
return;
}
gogv++;
gogh = 0;
break;
case kEndShapeToken:
run = 0;
break;
}
}
}
}
void kDrawSpriteC(Handle sprite, short h, short v) {
char *sprt;
sprt = *sprite;
{
unsigned char *dst;
register unsigned long *ldst, *lsrc;
unsigned short yCounter, xCounter;
sprt+=8;
dst = destination;
dst += (v*drow);
dst += h;
ldst = (unsigned long*)dst;
lsrc = (unsigned long*)sprt;
/*if( (v&0xFFFE) < v) {
ldst += drow3;
ldst += 8;
lsrc += 8;
}*/
for(yCounter = 0; yCounter < 16; yCounter++) {
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
ldst += drow3;
/*ldst += drow3;
ldst += 8;
lsrc += 8;*/
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
*ldst++ = *lsrc++;
ldst += drow3;
/*ldst += drow3;
ldst += 8;
lsrc += 8;*/
}
}
}
void WinCopy() {
asm 68020 {
MOVEM.L D0-D7/A0-A4, -(A7)
movea.l destination, A0
movea.l windest, A1
move.l sourcerow, D2
lsl.l #2, D2
move.l winrow, D3
lsl.l #2, D3
move.l #127, D0
@ts2: moveq.l #3, D1
@ts: move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
dbf D1, @ts
adda.l D2, A0
adda.l D3, A1
dbf D0, @ts2
MOVEM.L (A7)+,D0-D7/A0-A4
}
}
void WinCopy2() {
asm 68020 {
move.l bardst, A0
move.l barwin, A1
move.l barrow, D2
sub.l #256, D2
move.l winrow, D1
lsl.l #2, D1
moveq.l #17, D0
@rn: move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
move.l (A0)+, (A1)+
adda.l D2, A0
adda.l D1, A1
dbf D0, @rn
}
}
S'il-vous-plaît ne me critiquez pas sur ça, j'avais 17 ans quand je l'ai écrit…
Alors, voilà, les sprites sont compilés, et je n'arrive pas à recompiler le jeu. C'est pour ça que je vais en faire une version HTML/js …
Je vais vous tenir au courant de ma progression, si progresion il y a. @+
la_caille- Messages : 9
Date d'inscription : 18/12/2018
Re: Je vais tenter de faire une version HTML d'un jeu Mac que j'avais créé en 1999...
asm 68030...
N'oublie pas qu'un brosseur et le html c'est plutôt une imprimante, ce n'est pas la même logique qu'un écran.
Amuse toi bien et tiens moi au courant, c'est marrant ton truc, j'ai bien envie de voir à quoi tu aboutis.
N'oublie pas qu'un brosseur et le html c'est plutôt une imprimante, ce n'est pas la même logique qu'un écran.
Amuse toi bien et tiens moi au courant, c'est marrant ton truc, j'ai bien envie de voir à quoi tu aboutis.
Sujets similaires
» Les Dimanches soirs : Rencontres hebdo et perpétuelles ZC : ça continue au Thirsty Mad Cat !
» Bonjour Bonjour
» je vais faire bref !!!!!
» Présentation, je vais essayer de faire court...
» Je vais remettre à aujourd'hui ce que je pourrais faire demain
» Bonjour Bonjour
» je vais faire bref !!!!!
» Présentation, je vais essayer de faire court...
» Je vais remettre à aujourd'hui ce que je pourrais faire demain
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum