flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > micro3d

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
hi the board!
gui is approx 1/2 rewritten
all axels seem working, threads synced, and finally - completed so it's the time to add 3d some day (i've got so many ideas to visualize..)
i still need help with macgub.txt
Post 25 Sep 2016, 20:05
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
i finally understood how hash works and managed to copy-paste & comment it out
so try loading '.. /tst/hash.fnv1a.txt'
Post 04 Oct 2016, 18:43
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
hi, i've frozen my android phone hence i'm scarce on net traffic at the moment, some stuff not included, see an old link from post #1, which is not updated damnit

i found some time to improve gui a bit
there are several tips/fixes in ".asm" and "fedit.ash" for TG, marked with ;; or TG or so

ok:
-drag -n- drop, TG, can fedit post drop message to its parent?
-command line
-search -n- replace, TG, F3 activity should be rewised in fedit

sorry, 3d not ready
ps, the tutorial macgub offered gets rank 3/10th as it imlies some knowledge with no mention of what exactly



fletcher dunn, ian parberry - 3d math primer for graphics and game development, 2nd ed - 2011


Last edited by idle on 17 Feb 2019, 21:31; edited 3 times in total
Post 03 Apr 2017, 22:22
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
macgub, i mean 3DICA's - 3d basics tutorial
Post 03 Apr 2017, 22:35
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
hi the board
- does any one know why locals, named .dst,.src,.cnt get replaced with edi,esi,ecx?
- also ESC in search dialog does not close it
- added file path/name/ext routines
tnx in advance

Code:
;2017.04.11, TG: fix locals naming bug

memcopy: ;dst,src,cnt
        push    ebp
        mov     ebp,esp
.cnt! label dword at ebp+4*4
.src! label dword at ebp+3*4
.dst! label dword at ebp+2*4
        pushf
        cld
        push    eax ecx edi esi
        mov     esi,[.src!]
        mov     edi,[.dst!]
        mov     ecx,[.cnt!]
        mov     al,cl
        and     al,11b
        shr     ecx,10b
        rep     movsd
        mov     cl,al
        rep     movsb
        pop     esi edi ecx eax
        popf
        pop     ebp
        ret     3*4

    
Post 12 Apr 2017, 15:27
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
hi, next features added

- include statement support
it is once by default but slight fix possible to follow fasm
experimental as tokenization leaves most complicated proc for me

- each token got .file_ondisk field
include tokens got .include and .include_nest_level (stored but not used currently)

- Interface .get_full_pathname_lower_padzero, .set_cur_dir; find_include_by_string, shift_in_buffer
include logics needs that

- GetFullPathNameA, ShiftInBuffer gizmo

- get_float gizmo renamed into GetFloat to keep the style

- added tokens.ExprBufRealSizeOf field -> minimal tokens.szExprToken should be 16 (finally seen smart in OllyDbg by default Smile
scripting speed gain up to 1/3rd
and that seems the limit caused by fpu-cpu mixture

- load/save/error behaviour corrected

- maybe smth else



p.s.: u can alway recompile the gui using one of predifined languages or defining yours, e.g.:
%LNG% equ 'ENU' ;etc
%LNG% equ 'EST' ;etc
Post 01 May 2017, 07:06
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
Sniff and appreciate that gem: http://ultimate3d.org/?Categorie=Home&Style=Classic
Time to mail the author.

Works, style and vision of fasm forum members esp pabloreda, macgub, tthsqe will always fly by me.

Finally found [myself heh].
Time to study.

Your links, offers are wellcome!
Post 04 Mar 2021, 20:11
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 994
Roman
Quote:

.cnt! label dword at ebp+4*4

Nice trick !
Very interesting , how fasm use label in this case, like as EQU !
I dont know this !

I try this and get error !
Code:
.cnt! label dword at ebp+4*4
ldfff:
     mov     ecx,[.cnt!]
    
Post 05 Mar 2021, 12:07
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
Cause .cnt seems to be a sub-label and ldiff closes its local visibility
Thus full name should be used in your case
Or precede ldiff with a dot: .ldiff
Post 05 Mar 2021, 12:26
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 370
Location: Ukraine
idle
While moving forward/
ABdist routine was added and it took me 2hours to find as rapid and non bloated solution as possible.
I wonder how would HLL do that.
And that's why, in its origin, we need more and more giga-ram, and asm-dev lives on bare enthusiasm and no money!
Code:
;2021.03.07

;0|Bz -> st5
;  By -> st4
;  Bx -> st3
;0|Az -> st2
;  Ay -> st1
;  Ax -> st0
;
;  st0<- ../txt/Pythagoras distance.txt

ABdist: fsubrp  st3,st0
        fsubrp  st3,st0
        fsubrp  st3,st0

        fmul    st0,st0
        fincstp
        fmul    st0,st0
        fincstp
        fmul    st0,st0
        fdecstp
        fdecstp

        faddp
        faddp
        fsqrt

        ret
    

During next verification...
Code:
;returns 2d (0z) or 3d distance between two dots


f04_2d:
.A: f04 -1,+1
.B: f04 +1,-1
f04 ABdist f04[ (.A+0) (.A+4) ] 0 \
           f04[ (.B+0) (.B+4) ] 0
.a=f04[$-4]
.aCheck=sqrt( (f04[.A+0]-f04[.B+0])^2 + (f04[.A+4]-f04[.B+4])^2 )


f08_3d:
.A: f08 -1,+1,-1
.B: f08 +1,-1,+1
f08 ABdist f08[(.A+0)(.A+8)(.A+16)] \
           f08[(.B+0)(.B+8)(.B+16)]
.b=f08[$-8]
.bCheck=sqrt( (f08[.A+0]-f08[.B+0])^2 + (f08[.A+8]-f08[.B+8])^2 + (f08[.A+16]-f08[.B+16])^2 )


f10_3d:
f10 ABdist (-1)(+1)(-1) (+1)(-1)(+1)
.c=f10[$-10]
.cCheck=sqrt( ((-1)-(+1))^2 + ((+1)-(-1))^2 + ((-1)-(+1))^2 )
align 4
    

... pow had to be revised, i am not sure of with those signs (reminding our last talk ubout universe understanding, i donot know if (-2)^1.9 should be < 0 and (-2)^2.1 should be > 0).
pow:
Code:
.pow:   cmp     ebx,1
        jne     .return_error
        cmp     ebx,eax
        jne     .return_error
        ;x^y = 2^?
        ;? = log(2;x^y) = log(2;x)*y = fyl2x
        ;? = int. + .frac ---> 2^? = 2^int. * 2^.frac = f2xm1 +1, fscale
        ;detect resulting sign as fyl2x fails on -x
        fld     tbyte[ecx+tokens.szExprToken]
        FLD     ST0
        FISTTP  QWORD[ESP-8]
        TEST    BYTE[ESP-8],0000'0001b ;odd(y) ?
        ;
        fld     tbyte[edi]
        fabs
        fyl2x
        fld     st0
        frndint
        fxch
        fsub    st0,st1
        f2xm1
        fld1
        faddp
        fscale
        fstp    st1
        ;
        JZ      .return_single         ;even - result positive
        TEST    BYTE[EDI+9],1000'0000b ;-x?
        JZ      .return_single         ;+x   - result positive
        FCHS                           ;-x^odd(y) - result negative
        ;
        jmp     .return_single
    

pow sign test
Code:
m2p0=(-2)^0
m2p1=(-2)^1
m2p2=(-2)^2
m2p3=(-2)^3
m2p4=(-2)^4

p2p0=(+2)^0
p2p1=(+2)^1
p2p2=(+2)^2
p2p3=(+2)^3
p2p4=(+2)^4

m2p1.9=(-2)^1.9
m2p2.1=(-2)^2.1
    
Post 07 Mar 2021, 03:06
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 897
Location: Belarus
DimonSoft
I always wondered where, except, maybe, for debugging purposes, would fincstp and fdecstp be useful. Thanks for the example.
Post 07 Mar 2021, 06:59
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.