1

en fait je cherche un code en asm pouvant directement etre inclu dans tigcc, et qui soit optimiser pour tracer une ligne vertical
avec donc 3 paramètres : x (abcisse) , y (ordonné), et h (hauteur ou longueur de la ligne)

drawline c vraiment merdik en rapidité, et extgraph ca ne me suffit pa non plus (trop lent)

jy conné rien en asm smile

merci !

2

Voici ce que j'aurais fait en ASM
;=========== Line VRT ====================
;Affiche une ligne verticale happy
;d0 = y1 , d1 = x ,d2 = y2 ,a0 = screen d3 = type_pixel 0=clr / 1=set / 2=chg (inverse)
_vrt:
move.l 4(a7),d0
move.l 8(a7),d1
move.l 12(a7),d2
move.l 16(a7),a0
cmp.w d0,d2
bhi vrt_2
exg.l d0,d2
vrt_2:
sub.w d0,d2
move.w d2,-(a7)
move.w d0,d2
lsl.w #5,d2
add.w d0,d0
sub.w d0,d2
add.w d2,a0
move.w d1,d2
lsr.w #3,d1 ;x/8
add.w d1,a0
and.w #7,d2 ;reste de la division par 8
moveq.w #7,d1
sub.w d2,d1 ;decalage
move.w (a7)+,d2
loop_vrt:
tst.b d3
bne vrt_pxl_on
loop_vrt_pxl_clr:
bclr.b d1,(a0)
lea.l 30(a0),a0
dbf.w d2,loop_vrt_pxl_clr
rts
;*-*-*-*-*-*-**--*-*-*-*
vrt_pxl_on:
cmp.b #1,d3
bne vrt_pxl_chg
loop_vrt_pxl_on:
bset.b d1,(a0)
lea.l 30(a0),a0
dbf.w d2,loop_vrt_pxl_on
rts
;*-*-*-*-*-*-*-*-*-*-*-*-
vrt_pxl_chg:
bchg.b d1,(a0)
dbf.w d2,vrt_pxl_chg
rts
;==================================================


zzz
BURNING FIRE !
SiTe eN PrEpArAtIoN

3

void DrawVert(short x asm("d0"), short y asm("d1), short len asm("d3"), void
*screen asm("a0"));
// C'est len+1 la vrai hauteur
DrawVert: xdef DrawVert
	add.w d1,d1
        move.w d1,d2 
        lsl.w #4,d2 
        sub.w d1,d2
	
	moveq #7,d1
	and.w d0,d1
	move.b table(Pc,d1.w),d1
	
        lsr.w #3,d0 ;x/8 
        add.w d2,d0
	add.w d0,a0 

	moveq #30,d0
loop	or.b d1,(a0) 
        adda.l d0,a0 
        dbf d3,loop
        rts 
table  dc.b 	$80,$40,$20,$10,$08,$04,$02,$01

Tigcc v0.94 / fichier asm a68k.

4

T'as oublié un " après d1 tongue

5

que cette routine est lente...
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

6

bordel de merde t'as plus rapide que ça ??? eek
allez vas y montre ce que tu as,parceque perso je ne te crois pas,t'utilises quel algo toi ?
PpHd >> Vive les tableaux grin
BURNING FIRE !
SiTe eN PrEpArAtIoN

7

C'est vrai qu'on peut derouler. Mais j'ai la flemme de le faire.

8

pour la routine, il faudra utiliser Xlib...
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

9

erf c clair PpHd, en déroulant tu gagnes combien de cycles TiMad?
BURNING FIRE !
SiTe eN PrEpArAtIoN

10

bah déroule la toi même et compte...
In many respects the Yoshi is like a beautiful woman. A man can come so enamoured that he bestows on her all his time, his energy and his fortune.
- Fred whipple, 1960

*** Ne sous-estimez pas la puissance de la Marmotte ***
© Marmotte Team : LaMarmotte, sBibi, Vark & Sabrina

11

j'ai pas de table de cycles j'ai la flemme d'en chercher !
BURNING FIRE !
SiTe eN PrEpArAtIoN

12

mdr
In many respects the Yoshi is like a beautiful woman. A man can come so enamoured that he bestows on her all his time, his energy and his fortune.
- Fred whipple, 1960

*** Ne sous-estimez pas la puissance de la Marmotte ***
© Marmotte Team : LaMarmotte, sBibi, Vark & Sabrina

13

pourquoi tu rigoles ?
je suis sérieux la programmation 68k me saoule maintenant donc c p-e pour ça que je n'ai ni envi de chercher ni envi de le faire non plus !

P H P powaaaaaaaa !!!!!
BURNING FIRE !
SiTe eN PrEpArAtIoN

14

et tu fais quoi de beau en php? grin
In many respects the Yoshi is like a beautiful woman. A man can come so enamoured that he bestows on her all his time, his energy and his fortune.
- Fred whipple, 1960

*** Ne sous-estimez pas la puissance de la Marmotte ***
© Marmotte Team : LaMarmotte, sBibi, Vark & Sabrina

15

rien de beau j'apprends !
BURNING FIRE !
SiTe eN PrEpArAtIoN

16

ben c deja ca smile mais PHP .. c du C ...

17

ouarf !
BURNING FIRE !
SiTe eN PrEpArAtIoN

18

ben dis pas le contraire .. c du C en plus simple ...

19

ouep en vraiment plus simple alors et en plus jolie je trouve le C (code source)c degueu a voir je trouve !
pire que le Java beurkkkk sick

Php top
BURNING FIRE !
SiTe eN PrEpArAtIoN

20

void DrawVert(short x asm("d0"), short y asm("d1), short len asm("d3"), void
*screen asm("a0"));
// C'est len+1 la vrai hauteur
DrawVert: xdef DrawVert
	add.w d1,d1
        move.w d1,d2 
        lsl.w #4,d2 
        sub.w d1,d2
	
	moveq #7,d1
	and.w d0,d1
	move.b table(Pc,d1.w),d1
	
        lsr.w #3,d0 ;x/8 
        add.w d2,d0
	add.w d0,a0 

	moveq #30,d0
loop	or.b d1,(a0) 
        adda.l d0,a0 
        dbf d3,loop
        rts 
table  dc.b 	$80,$40,$20,$10,$08,$04,$02,$01


il suffit de faire qqc comme cela:
void DrawVert(short x asm("d0"), short y asm("d1), short len asm("d3"), void
*screen asm("a0"));
// C'est len+1 la vrai hauteur
DrawVert: xdef DrawVert
 add.w d1,d1
 move.w d1,d2 
 lsl.w #4,d2 
 sub.w d1,d2
 moveq #7,d1
 and.w d0,d1
 move.b table(Pc,d1.w),d1
 lsr.w #3,d0 ;x/8 
 add.w d2,d0
 add.w d0,a0 
 move.w d3,d1
 lsr.w  #3,d3
loop:	
 or.b d1,(a0) 
 or.b d1,30(a0) 
 or.b d1,60(a0) 
 or.b d1,90(a0) 
 or.b d1,120(a0) 
 or.b d1,150(a0) 
 or.b d1,180(a0) 
 or.b d1,210(a0) 
 add.w #240,a0 
 dbf d3,loop 
 and.w #7,d1
 tst.w d1
 beq.s fin
loop2:
 or.b d1,(a0) 
 adda.l d0,a0 
 dbf d1,loop2 
fin:
 rts 
table  dc.b 	$80,$40,$20,$10,$08,$04,$02,$01


Juste a titre d'exemple smile
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

21

Ca buggue tongue

22

ah tiens grin
ça ressemble a mon algo en x86 pour les lignes horizontales ouioui


;=====================================================
;=    HLINE Input :: al=col, bx=x1, dx=x2, cx=y      =
;=====================================================
draw_hline:
       cmp bx,dx
       jle .skipit
       xchg bx,dx
.skipit:
       sub dx,bx
       shl cx,6
       mov di,cx
       add cx,cx
       add cx,cx
       add di,cx
       add di,bx
       push word 0a000h
       pop es
       mov ah,al ;extends color to a Word
       mov bx,ax
       rol eax,16 ;swap eax
       mov ax,bx
       mov si,dx
       add si,di
       inc si
       shr dx,2
.loop:
       mov [es:di],eax
       add di,4
       dec dx
       jnz .loop
.loop2:
       mov [es:di],al
       inc di
       cmp si,di
       jnz .loop2
       ret


et en virant la dernière boucle:

.skipit:
       sub dx,bx
       shl cx,6
       mov di,cx
       add cx,cx
       add cx,cx
       add di,cx
       add di,bx
       push word 0a000h
       pop es
       mov ah,al ;extends color to a Word
       mov bx,ax
       rol eax,16 ;swap eax
       mov ax,bx
       mov bx,dx
       add bx,di
       inc bx
       shr dx,2
.loop:
       mov [es:di],eax
       add di,4
       dec dx
       jnz .loop
       sub bx,di
       mov cx,4
       sub cx,bx
       shl cx,3
       shr eax,cl
       mov [es:di],eax
       ret

c le mêm principe smile
normalement ça marche, si ça marche pas c qu'il y a un bug alacon...
In many respects the Yoshi is like a beautiful woman. A man can come so enamoured that he bestows on her all his time, his energy and his fortune.
- Fred whipple, 1960

*** Ne sous-estimez pas la puissance de la Marmotte ***
© Marmotte Team : LaMarmotte, sBibi, Vark & Sabrina

23

euh, juste un truc, pkoi tu mets un "adda.l d0,a0" dans la dernière boucle? ça serait pas plutôt "adda.l #30,a0 " ? ou "lea 30(a0),a0" ?

et ça c mon algo de lignes verts en asm x86:

;=====================================================
;=     VLINE Input :: al=col, bx=y1, dx=y2, cx=x     =
;=====================================================
draw_vline:
       cmp bx,dx
       jle .skipit
       xchg bx,dx
.skipit:
       sub dx,bx
       shl bx,6
       mov di,bx
       add bx,bx
       add bx,bx
       add di,bx
       add di,cx
       push word 0a000h
       pop es
       inc dx
       mov cx,dx
       shr dx,2
.loop:
       mov [es:di],al
       mov [es:di+320],al
       mov [es:di+640],al
       mov [es:di+960],al
       add di,1280
       dec dx
       jnz .loop
       and cx,3
.loop2:
       mov [es:di],al
       add di,320
       dec cx
       jnz .loop2
       ret
In many respects the Yoshi is like a beautiful woman. A man can come so enamoured that he bestows on her all his time, his energy and his fortune.
- Fred whipple, 1960

*** Ne sous-estimez pas la puissance de la Marmotte ***
© Marmotte Team : LaMarmotte, sBibi, Vark & Sabrina

24

Ouai ca bugsmile
bon de toute manere c'est vite fait de le corriger..
sinon pour le adda.. c'est une erreur de ma part... j'ai fait du copier coller.. ce que je deteste mais bon...
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!

25

bah c clur... ct ptet pr ça que ça buggait...
enfin l'idée est là koi...
même principe que les lignes horz tongue
In many respects the Yoshi is like a beautiful woman. A man can come so enamoured that he bestows on her all his time, his energy and his fortune.
- Fred whipple, 1960

*** Ne sous-estimez pas la puissance de la Marmotte ***
© Marmotte Team : LaMarmotte, sBibi, Vark & Sabrina

26

DE toute maniere, on va pas tout faire a leur place... il faut laisser un peut de boullot sinon c'est pas drole et on progresse passmile
XLib v1.00 Powerrrrrrrrrrrrrrrrrrrr!