flat assembler
Message board for the users of flat assembler.

Index > IDE Development > user_colors rd 40h ?

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Jul 2010, 11:29
Code:
FASMW.ASM
-----------
...
user_colors rd 40h
...
    
hello Tomasz,
Just a quick question ...
what is the use of "user_colors" .

editor_colors and tmp_colors ... ok
but user_color ???
this buffer is used in writing but never seems to be used in reading.

thank you for your reply.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Jul 2010, 11:29
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 12 Jul 2010, 13:39
The ChooseColor API allows user to define his own 16 custom colors, and this place is used to store them at runtime (so that colors you define are preserved between calls to ChooseColor in one session).
Post 12 Jul 2010, 13:39
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Jul 2010, 15:29

thank you for your reply Tomasz.

chooseColor API ... 16 custom colors
ok, understood !
and i understand now this below.

Code:
      ;mov    [cc.lpCustColors],user_colors
       ;invoke ChooseColor,cc
...
.....
      mov     esi,editor_colors
   mov     edi,user_colors
     mov     ecx,8
       rep     movsd
    

but why this ...
Why save the colors in the middle of this buffer

Code:
    mov     esi,editor_colors
   mov     edi,user_colors+20h ;<--- +20h ?
 mov     ecx,8
       rep     movsd
    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Jul 2010, 15:29
View user's profile Send private message Send e-mail Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 12 Jul 2010, 16:56
Thread moved to IDE Development.
Post 12 Jul 2010, 16:56
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 12 Jul 2010, 18:30
From what i gather, (default colors during startup)..

user_colors as follows

first four:
COLOR_WINDOWTEXT
COLOR_WINDOW
COLOR_HIGHLIGHTTEXT
COLOR_HIGHLIGHT

second four: -> asm_syntax_colors

Custom colors = 16 spots
So there are two copies of user_colors to fill cc dialog with.

Please correct me if i am wrong...


Description:
Filesize: 4.28 KB
Viewed: 12179 Time(s)

cc.JPG



_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 12 Jul 2010, 18:30
View user's profile Send private message Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 12 Jul 2010, 18:42
Tomasz, hi, it looks Ouadji is working for line highlight.
For the future ease i'd ask you putting your tips if any.
So it'll come under some flow of your design.
Post 12 Jul 2010, 18:42
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Jul 2010, 18:52

very good idea!
but in this case, the buffer "user_colors" is too large.
user_colors rd 40h ... why ?
rd 10h (or rb 40h) would be enough!



"it looks Ouadji is working for line highlight"
... it's done. With wink 5.5, active line is highlighted

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Jul 2010, 18:52
View user's profile Send private message Send e-mail Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 12 Jul 2010, 22:46
sizeof COLORREF = 4 bytes
Post 12 Jul 2010, 22:46
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 12 Jul 2010, 23:03
4 bytes * (8*2) = 40h bytes = rd 10h

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 12 Jul 2010, 23:03
View user's profile Send private message Send e-mail Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 12 Jul 2010, 23:55
Oh yes, i missed that part (thought it was rb)
I only see the need for 64 bytes in the code.
Either we are missing something or it is typo.
Maybe Tomasz will clarify if he is listening...
Post 12 Jul 2010, 23:55
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 13 Jul 2010, 06:14

a typo, i think so.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 13 Jul 2010, 06:14
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 13 Jul 2010, 10:30
Definitely a typo.
Post 13 Jul 2010, 10:30
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:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.