/////////////////////////////////////////////////////////////////////////////////
// XLib: Harder Better Faster Stronger //
/////////////////////////////////////////////////////////////////////////////////
// Fonction: XGSpriteT16x.. /////////////////////////////////////////////////////
void XGSpriteT16X8(register int X asm("d0"),register int X asm("d1"), register void *GMSprite asm("a0"));
void XGSpriteT16X16(register int X asm("d0"),register int X asm("d1"), register void *GMSprite asm("a0"));
void XGSpriteT16X24(register int X asm("d0"),register int X asm("d1"), register void *GMSprite asm("a0"));
void XGSpriteT16X32(register int X asm("d0"),register int X asm("d1"), register void *GMSprite asm("a0"));
asm("
XGSpriteT16X8:
move.w %d3,-(%a7)
move.w #0,%d3
bra.s XLIB_SpriteT16
XGSpriteT16X24:
move.w %d3,-(%a7)
move.w #2,%d3
bra.s XLIB_SpriteT16
XGSpriteT16X32:
move.w %d3,-(%a7)
move.w #3,%d3
bra.s XLIB_SpriteT16
XGSpriteT16X16:
move.w %d3,-(%a7)
moveq #1,%d3
XLIB_SpriteT16:
move.l CGplan,%a1
add.w #32,%d0
add.w #32,%d1
add.w %d1,%d1
move.w %d0,%d2
lsr.w #4,%d0
add.w %d0,%d0
and.w #15,%d2
add.w 0(%a1,%d1.w),%d0
add.w %d0,%a1
tst.w %d2
beq SpriteT16_16X
cmp.w #7,%d2
ble SpriteT16_none22b
moveq #16,%d1
sub.w %d2,%d1
SpriteT16_none2:
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d2
move.w (%a0)+,%d0
lsl.l %d1,%d0
move.w (%a0)+,%d2
lsl.l %d1,%d2
not.l %d0
not.l %d2
and.l %d2,(%a1)
and.l %d0,6080(%a1)
not.l %d0
not.l %d2
or.l %d0,(%a1)
or.l %d2,6080(%a1)
add.w #38,%a1
dbra %d3,SpriteT16_none2
move.w (%a7)+,%d3
rts
SpriteT16_16X:
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
move.l (%a0)+,%d0
not.l %d0
and.w %d0,6080(%a1)
swap %d0
and.w %d0,(%a1)
not.l %d0
or.w %d0,(%a1)
swap %d0
or.w %d0,6080(%a1)
add.w #38,%a1
dbra %d3,SpriteT16_16X
move.w (%a7)+,%d3
rts
SpriteT16_none22b:
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
moveq #0,%d0
moveq #0,%d1
move.w (%a0)+,%d0
move.w (%a0)+,%d1
swap %d0
swap %d1
lsr.l %d2,%d0
lsr.l %d2,%d1
not.l %d0
not.l %d1
and.l %d1,(%a1)
and.l %d0,6080(%a1)
not.l %d1
not.l %d0
or.l %d0,(%a1)
or.l %d1,6080(%a1)
add.w #38,%a1
dbra %d3,SpriteT16_none22b
move.w (%a7)+,%d3
rts
");
#define USE_TI89
#define USE_TI92P
#include "genlib.h"
/////////////////////////////////////////////////////////////////////////////////
// Xlib
#include "_X_Lib.h"
#include "_X_Plane.h"
#include "a.h"
#include "_X_Lib_MACRO.h"
/////////////////////////////////////////////////////////////////////////////////
#define xd 0
#define xf 200
#define yd 0
#define yf 100
unsigned short spritedata[] =
{0xaaaa,0x5555,0xaaaa,0x5555,0xaaaa,0x5555,0xaaaa,0x5555,
0xaaaa,0x5555,0xaaaa,0x5555,0xaaaa,0x5555,0xaaaa,0x5555};
BGS bgs16 = {16, 2};
SPRITE_16 spr16[1] =
{{
{0xffff,0xffff},
{0xcccd,0xffff},
{0xb333,0xffff},
{0xb333,0xffff},
{0xcccd,0xffff},
{0xcccd,0xffff},
{0xb333,0xffff},
{0xb333,0xffff},
{0xcccd,0xffff},
{0xcccd,0xffff},
{0xb333,0xffff},
{0xb333,0xffff},
{0xcccd,0xffff},
{0xcccd,0xffff},
{0xb333,0xffff},
{0xffff,0xffff}}};
BGS bgs32 = {32, 2};
BGS bgs64 = {64, 4};
SCR_RECT full = {{0,0,239,127}};
BITMAP bmp = {32,32};
POINT P1 = {10,10}, P2 = {150,20}, P3 = {30,90};
void _main(void)
{
PUSH_DSCREEN(DSCREEN *Scr); // DScreen + Adress of the DScreen
short x, y;
volatile short z;
unsigned long count ;
z = 0;
//Init GENLIB
gl_init();
gl_set_dscreen_function(Scr);
gl_set_dscreen_int(Scr);
gl_cls();
gl_set_spr_xy(0, 0);
gl_set_spr_tile(spr16);
// Init XGLib
// Hard patch so that XGLib uses the allocated DSCREEN
// Instead of XGOn()
tigcc0=(void *) LIGHT_SCREEN(Scr);
tigcc1=(void *) DARK_SCREEN(Scr);
XGPlanc(XNewGPlan());
/////////////////////////////////////////////////////////////////////////////////
// Sprite16 Bench //
/////////////////////////////////////////////////////////////////////////////////
gl_cls();
count = 0;
gl_timer = 0;
for (y=yd;y<yf;y++)
for (x=xd;x<xf;x++)
{
count++;
XGSpriteT16x16(x,y, spritedata);
}
glaux_text(0,0,C_BLACK,T_LARGE,"XT16: %ld Spr/s", 90*count/gl_timer);
gl_wait_a_key();
gl_cls();
count = 0;
gl_timer = 0;
for (y=yd;y<yf;y++)
for (x=xd;x<xf;x++)
{
count++;
gl_put_sprite_16(x,y,z);
}
glaux_text(0,0,C_BLACK,T_LARGE,"GT16: %ld Spr/s", 90*count/gl_timer);
gl_wait_a_key();
// Fin //
PortRestore();
gl_quit();
}
TiMad a écrit :
1. Ma routine n'as pas besoin de gere le cliping (GPLan)
2. C'est du maskage qui doit donner le meme resultat que la transparence.
3. Si elle est bugué, j'aimerai bien savoir ou, car squale92 n'a pas trouver le bug.
4. correction de coordonnées, rien a voir avec une telle routine.
5. Je teste sur ti92+ HW2. etc...
TiMad a écrit :
tu affiches souvent des coordonnées en -33;y? bein faudrai ptetre apprendre a programmer... (NB: je repond betement a des accusation bete, car tu sais tres bien que cette situation ne se presente jamais...)
TiMad a écrit :
La routine marche parfaitement:
Blanc= transaprence Gris claire/foncé, noir sont afficher sans probleme... quelque soit la couleur de fond!
TiMad
a écrit : tu affiches souvent des coordonnées en -33;y? bein faudrai ptetre apprendre a programmer... (NB: je repond betement a des accusation bete, car tu sais tres bien que cette situation ne se presente jamais...)
TiMad
a écrit : Heu simple question? est ce que tu sais ce que j'ai programmer en dehors des TI68k?? je ne pense pas..
alors bon retourne chopper des sources pour te les approprier