flat assembler
Message board for the users of flat assembler.

flat assembler > Examples and Tutorials > micro3d

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



Joined: 06 Jan 2011
Posts: 352
Location: ukraina


Description:
Download
Filename: macgub.txt
Filesize: 3.82 KB
Downloaded: 173 Time(s)



Last edited by idle on 06 Sep 2018, 14:37; edited 42 times in total
Post 11 May 2014, 08:49
View user's profile Send private message Send e-mail Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1250
Location: Underwater
Such a sweet cube deserves at least a positive comment. Thanks for the source code idle.
Post 24 May 2014, 06:20
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
Hi.
It seems scripting basis complete.
It demonstrates general (fasm) idea (i'd like some were present in fasm), not yet connected to anything.
Changed files:
script.inc
test\test script.exe
test\test script.asm
test\.txt
test\dbug.txt

Thanx.
Post 07 Oct 2014, 10:03
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
hi
previous post deleted due to incompatibility changes

rb, threads sync - bugs fixed
if, hints, label naming (equ-s not used) - improved
call, ret, while, bitmaps, drawing - experimental
sse - not sure if needed, none hence

todo 3d understanding:
macgub: http://board.flatassembler.net/topic.php?t=15011
tthsqe: http://board.flatassembler.net/topic.php?t=14015

todo DrawAsCleverLines when shaded not drawn
todo DrawAsPoligons smth like walls, colored closed buildings
todo point_in_camera? new(quicker) formula, btw new modular drawing negated the problem


Code:
incomp code - deleted
    


Image


Last edited by idle on 07 Jul 2015, 18:53; edited 1 time in total
Post 26 Oct 2014, 03:15
View user's profile Send private message Send e-mail Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1115
Location: Russian Federation
Чётко. Thanks for sharing.
Post 26 Oct 2014, 03:43
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
Info, gui, script improvements.
Drawing left same :(due to life stalls):

Image
Post 07 Nov 2014, 22:40
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
include once so-so works Smile
new float-integer unification interface - 11 numeric datatypes supported
info updated
Post 18 Nov 2014, 16:22
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
Code:
Hi the board!
Happy to post an update, hope the last regarding syntax.
I persistently fly about drawing model - incomplete nor included.
P.S.  l_inc: tnx for the rb-info from previous topics, do not be boring my silence
P.S. matrix: in that case i use mspaint Smile           , do not be boring my silence
P.S.     TG: fasm editor of 1.71.27 package does not save READ-ONLY files and says NO WARNING.

Changes to meet fasm, not sure of the prios:
- % became mod
- added boolean ~
- added bitwise not,and,or,xor
- added shl shr
- added 0xHEX,$HEX,0HEXh,BINb,'str',"str"
- added strings
- clean integers detected and encoded exactly
  compare to 1/3 when you start to mul|div and get 0.(3)
  it where i do not understand frac: magic
- corrected rb and forwarding

Changes other, info,examples included:
- added boolean isin
- added bitc,bitr,bits,bitt
- removed chop, left int (who cares)
- 2 constants had wrong prio
- improved compare instructions
- updated load of ui (wasm.ru)
- updated store of ui a bit
- vital FLOAT->INT validated
  mem/var stores validated
  gizmo operators validate nothing as there is no time to check "whether smbd is shooting himself"
- mem stores excluded from pre-runtime
- added GetTickCount,memcpy,printfA,MessageBoxA
  *fasm pretty fast* <--- proof & sounds cool
- if,while made error string always 0
- lost myself in bits,bytes - fi file declared wrong io size
- maybe smth else ...

See you!
    
Post 04 Jan 2015, 11:25
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
Code:
Hi.
Glad to see you again.
There'd been several improvements in syntax.


- use var=  to set var both pre- and in- runtime
- use var== to set var in runtime only

- moded MessageBoxA,GetTickCount

- added InputBoxA,get_float,cdA,ReadFileA,GetFileSizeA
- added dangerous SetEndOfFileA,WriteFileA
- added constants dataseg,szFullNameBuf
- added ub - ui08 synonym
- added fustp_eax,fustp_ebxeax <- not used yet
- added more examples
    


eg
Code:
;read file1 text
ioResult==ReadFileA(buffer file1 offset count)

;end text with null
ub[buffer+ioResult]=0

;cypher text
call cypher
goto cypher.
cypher:
c==ioResult
while c
  ub[buffer+c-1]=ub[buffer+c-1] xor 'x'
  c==c-1
end while
ret
.:

;store cyphered text to file2
ioResult==WriteFileA(buffer file2 offset ioResult)

;uncypher back and display
call cypher
MessageBoxA(buffer file1 0)








offset=0
count=65'535

buffer: rb count

file1: ub '../tst/file access, cypher.txt',0  &&  .:
file2: ub '../tst/cypher-ed.txt',0  &&  .:
    


eg
Code:
szBuffer=512
buffer: rb szBuffer
intro: ub 'what is your age ?..',0 && .:
memcpy buffer intro (intro.-intro)
InputBoxA buffer szBuffer
age==get_float buffer



MinTeenAge==13
MaxTeenAge==19
if age isin 0 (MinTeenAge-1)
  pause 'Hello boy/girl!'
elsif age isin MinTeenAge MaxTeenAge
  pause 'Hello teen!'
else
  pause 'Hello mr/s!'
endif
    
Post 14 Jun 2015, 08:26
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
hi
there'd been couple of improvements
details inside
see links from post #1
Post 07 Jul 2015, 19:10
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
hi
this version shipped with fedit control
does any one know why WM_KEYUP not caught?
... nor accelerators (deleted entries currently) can?
... nor fedit catches menu hot keys, including enter
Post 12 Jul 2015, 16:22
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
Good day!
I've just completed integration of fedit, hot keys and align.
No further improvements expected until "real 3d" implemented.
Post 19 Jul 2015, 09:55
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
Hi the board!
I've prepared a bunch of opengl essentials to this project and could not stay... see post #1 for the links.
There is no opengl connected yet and i'd call this release preliminary one, my envision of what it should be.
Good luck!
Post 04 Jan 2016, 23:38
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
hi

i forgot to fix one of hard-coded displacements and = acted abnormally

by default calculations done left-to-right (what i thought about :?)

added extended slash \ comment

paused/stopped ogl activity with this project, i think native is much better imho
i hope some day macgub's ideas will get scripted :)

maybe smth else ...

download link always same
Post 25 Feb 2016, 15:16
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
corrected \, added posboss, cmpsz Razz
Code:
;incompatible code deleted
    


Last edited by idle on 29 Mar 2016, 12:28; edited 1 time in total
Post 28 Feb 2016, 18:34
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
hi, see post #1 for the changes
Post 29 Mar 2016, 12:27
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
hi guys, could you please help me with macgub.txt attached at post #1
there are many people im inspired with, sorry whenever not mentioned
tnx
Post 14 Aug 2016, 19:51
View user's profile Send private message Send e-mail Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 208
Location: Poland
Quote:
.2a: ;can we avoid that ?
.dx12 == .dx12 shl 8
.dx13 == .dx13 shl 8
.dx23 == .dx23 shl 8

Shl and sar instructions are caused by fixed point arthmetics. It was faster than floats in former times. Nowdays we have SSE and AVX. But I dont know if it are faster. I took effory in optimization, but I dont know it was sucessful. Modern CPUs are so fast and runs smooth all the code without fear. Wink
Post 16 Aug 2016, 07:00
View user's profile Send private message Visit poster's website Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
Code:
 
hi, here is one more update 
see also 'inc\fonts\bmp32 fonts creator\' lazarus projects
source, examples included
;2016.08.27: added bmp32.pqFlipY gizmo ; added bmp32.pqFont.WidthGet, bmp32.pqFont.HeightGet, bmp32.pqFont.SetColor, bmp32.pqFont.TextOut gizmo 
;2016.08.23: added bmp32.pqCopy gizmo 
;2016.08.22: moded GetTickCount into a "constant" gizmo, see also: time. gizmos ; added ClockArrowSinCos math operator 
;2016.08.20: added time.[year|month|DayOfWeek|day|hour|minute|second|millisecond] "constants" gizmo ; moded (esp tnx to Christian Ghisler - author of Total Commander) GetFileSizeA gizmo so that info of locked files like c:\pagefile.sys can be read
    
Post 27 Aug 2016, 16:31
View user's profile Send private message Send e-mail Reply with quote
idle



Joined: 06 Jan 2011
Posts: 352
Location: ukraina
hi, i slightly improved fonts, here is an example
Smth is wrong with my android text editor, in case the copy_pasta example does not work i beg your pardon.
Code:
 
;reserve space for bmp template and write it 
bmpTime: rb bmp32.szStruc + width*height*4 && bmp32 bmpTime width height 

;11x22 bitmap font 
bmpFont: rb bmp32.szStruc + 11*256 *22 *4 
 .file: ub '../inc\fonts\font11x22X256.win1251.bmp',0 
 ReadFileA(bmpFont .file 0 ($-bmpFont)) 
 bmp32.pqFlipY(bmpFont) 


 ;formating, see later 
 format: ub '%u',0 
 buffer: rb 128 
align 4 
 argptr: rb 4 

 ;bitmap center and Hour,Minute,Second arrows 
 centerX==width/2 
 centerY==height/2 
 if centerX<centerY 
 radius==centerX 
 else 
 radius==centerY 
 end if 
 radiusS==radius 
 radiusM==radius *75/100 
 radiusH==radius *50/100 
loop: 

 bmp32.flush bmpTime 0x00'00'1e 

 ;second arrow 
 x==radiusS*ClockArrowSinCos('cos' time.second) +centerX 
 y==radiusS*ClockArrowSinCos('sin' time.second) +centerY 
 bmp32.pqLineTo 0x00'00'ff bmpTime centerX centerY x y 

 ui32[argptr]=time.second && printfA(buffer 128 format argptr) 
 bmp32.pqFont.TextOut(bmpTime x y bmpFont 0x'00'00'ff buffer 2) 

 ;minute arrow 
 x==radiusM*ClockArrowSinCos('cos' time.minute) +centerX 
 y==radiusM*ClockArrowSinCos('sin' time.minute) +centerY 
 bmp32.pqLineTo 0x00'ff'00 bmpTime centerX centerY x y 
 bmp32.pqLineTo 0x00'ee'00 bmpTime (centerX+1) (centerY+1) x y 

 ui32[argptr]=time.minute && printfA(buffer 128 format argptr) 
 bmp32.pqFont.TextOut(bmpTime x y bmpFont 0x00'ff'00 buffer 2) 

 ;hour arrow 
 x==radiusH*ClockArrowSinCos('cos' (time.hour mod 12 * 5)) +centerX 
 y==radiusH*ClockArrowSinCos('sin' (time.hour mod 12 * 5)) +centerY 
 bmp32.pqLineTo 0x'ee'00'00 bmpTime (centerX-2) (centerY-2) x y 
 bmp32.pqLineTo 0x'ff'00'00 bmpTime centerX centerY x y 
 bmp32.pqLineTo 0x'ee'00'00 bmpTime (centerX+2) (centerY+2) x y 

 ui32[argptr]=time.hour && printfA(buffer 128 format argptr) 
 bmp32.pqFont.TextOut(bmpTime x y bmpFont 0x'ff'00'00 buffer 2) 

 bmp32.screen bmpTime 
 sleep 1000 
 goto loop
    
Post 28 Aug 2016, 11:05
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< 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-2018, Tomasz Grysztar.

Powered by rwasa.