Author Topic: MasmBasic  (Read 350502 times)

Spamm3r

  • Regular Member
  • *
  • Posts: 2
Re: MasmBasic
« Reply #375 on: April 17, 2017, 05:46:16 AM »
Any chance to get more sharp titles (I mean, file, edit etc) Beacuse on 1920x1080 they are not sharp...

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11575
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #376 on: April 17, 2017, 06:21:14 AM »
Sharp titles: If you hold Shift when opening a file e.g. from the recent files list, and confirm "screenshot mode", do they look better? There is a problem with the Gdi+ font that I use to work around Aero...

LordAdef

  • Member
  • ****
  • Posts: 669
Re: MasmBasic
« Reply #377 on: April 17, 2017, 04:40:21 PM »
Any chance of you giving us this powerful colour enhancement?

Real MenTM select the text, hit Ctrl G and type col=ff8000h :P

and how do the Real Men set the bk colour?

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11575
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #378 on: April 17, 2017, 07:03:14 PM »
and how do the Real Men set the bk colour?

Ha :t

You are getting ambitious here :icon_mrgreen:

1. Make a copy of
\Masm32\MasmBasic\Res\RichMasm.ini and place it in
\Masm32\MasmBasic\Res\UserDef\RichMasm.ini

2. Edit the lines under udc=nn, i.e. lines 18 to 25
3. Restart the editor.

That's for the document background. In case you want different backgrounds for individual sentences:
1. Try that in Micros**t Word (and tell me if that is possible :bgrin:)
2. Paste the result in RichMasm.

As mentioned in the 124 bugs thread, I need to add a warning that mat=0 destroys the work. If I find the time, I may add a Ctrl G bgc=bbggrrH function, too.

Attached a beta for you, Alex 8)

LordAdef

  • Member
  • ****
  • Posts: 669
Re: MasmBasic
« Reply #379 on: April 18, 2017, 03:24:31 AM »
Thanks JJ, I will try that.



Quote
You are getting ambitious here :icon_mrgreen:

Nice one!  ::)


I use the Office trick often, it works.

Do you have plans to implement that infamous colour tab as we talked about in the other thread? That would be a great for a future upgrade version.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11575
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #380 on: April 18, 2017, 03:39:48 AM »
Do you have plans to implement that infamous colour tab

No, but I have a little project for you ;)

LordAdef

  • Member
  • ****
  • Posts: 669
Re: MasmBasic
« Reply #381 on: April 22, 2017, 06:40:50 PM »
Hi JJ,

I just checked the beta you sent it. The UserDef worked! Thanks
But the Beta didn`t build my project.

When you say a "Beta for you", is it something related to the colour things we were talking about it? I didn´t see the difference.

ps (And I´m still using an old version of RM... I´ve got to update it but it was running so nicely I didn´t stop to do it)

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11575
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #382 on: April 22, 2017, 10:43:59 PM »
But the Beta didn`t build my project.

What happened? Details please 8)

Quote
When you say a "Beta for you", is it something related to the colour things we were talking about it? I didn´t see the difference.

Hey, that was ages ago :P I can't remember what was "beta" at that moment. Anyway, current version is online and works like a charm.

LordAdef

  • Member
  • ****
  • Posts: 669
Re: MasmBasic
« Reply #383 on: April 23, 2017, 06:30:43 PM »
Quote
What happened? Details please

Never mind, I´ve downloaded the latest version and everything is sweet!!

I got it=> you got the code for "bgc=" in there, right? That´s niice.

I know we are doing BGR, but would it be possible in the future to invert it to RGB? A lot more convenient when using color pickers that returns you the Hex values, and they usually do it in RGB. It´s only a Copy/Paste.

I like this online one, check it out, quite convenient: https://www.webpagefx.com/web-design/color-picker/a1d490


jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11575
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #384 on: April 23, 2017, 08:41:27 PM »
Hmmmm... what about bgc=? and col=? instead of an online colour picker?

Of course, this requires major changes in the RichMasm source ::)

  void Val(esi)
  ...
  .if edx==-127           ; user typed col=? or bgc=?
      void RgbCol(?)      ; let the colour picker do it
  .endif

LordAdef

  • Member
  • ****
  • Posts: 669
Re: MasmBasic
« Reply #385 on: April 23, 2017, 10:09:14 PM »
that would be fantastic!

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11575
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #386 on: April 24, 2017, 08:28:07 AM »
Update 24 April features a new option for the RgbCol macro:
Quote
RgbCol, CgaCol, SysCol
      mov eax, RgbCol(ebx, 0, 0)            ; any mix of reg32, vars and immediates is allowed
      mov bl, 127            ; only bl will be used
      invoke SetTextColor, hDC, RgbCol(ebx, 0, 0)      ; Red Green Blue for Gdi32 functions
      invoke SetTextColor, hDC, SysCol(ebx)            ; use the system palette
      invoke SetTextColor, hDC, RgbCol(?)            ; use the colour picker
      mov hPG, rv(GdipCreatePen1, RgbCol(alpha, red, green, blue), FP4(3.0), UnitWorld, addr pPen)
Rem      - Gdi functions want RGB values, i.e. three parameters
      - in contrast, GdiPlus expects ARGB, i.e. four parameters; the first one, alpha, defines
        transparency ranging from 0=fully transparent to 255=opaque
      - CgaCol(index) may be used with console colours; see ConsoleColor for identifiers
      - SysCol(index) returns a GetSystemPaletteEntries colour for use in Gui applications

See Reply #393 above for an application in RichMasm - greetings to Alex :biggrin:

(the void avoids a mov eax, eax)

LordAdef

  • Member
  • ****
  • Posts: 669
Re: MasmBasic
« Reply #387 on: April 24, 2017, 10:05:12 PM »
===== THIS IS SO NICE JJ!!!! Thanks a lot ======


ps: edit to add: I mean this is reeeeally nice! Now I see RichMasm "flying clolours"  :greenclp: :eusa_clap: :eusa_dance:

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 11575
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #388 on: April 24, 2017, 10:18:43 PM »
Don't overdo it, Alex. Rich text is certainly better than poor text, but with a lot of experience, I limit the use of colour nowadays to MB keywords, push/pop pairs (easier to see if the stack is balanced), and a few very specific tricky code consequences. Btw you can see this "default use" when selecting a block of text and hitting F4 aka "comment" twice.

Another example - red for @Backwards, blue for @Forward jumps (I prefer .Repeat ... .Exit .if ... .Until, though):

            xchg eax, ebx
  @@:
  dec edx
            jl @F
            stosb                  ; insert new empty elements
            jmp @B
  @@:  xchg eax, edi
            pop ebx

This helps to grasp how the loop works. It is much more important to have this visual aid when the loop spans over 20 or 50 lines, of course.

Christmas tree looks nice at first sight, but it doesn't help to focus attention on the really important parts. Which applies, btw, also to the VS or Scintilla style automatic highlighting.

LordAdef

  • Member
  • ****
  • Posts: 669
Re: MasmBasic
« Reply #389 on: April 24, 2017, 10:28:42 PM »
Quote
Don't overdo it, Alex. Rich text is certainly better than poor text, but with a lot of experience, I limit the use of colour nowadays to MB keywords, push/pop pairs (easier to see if the stack is balanced), and a few very specific tricky code consequences.

Oh, don´t worry. In fact I never did it. But it´s invaluable for temporary modifications. I usually colour when trying things out. Later, when things look right, I bring them back to default.

I´m posting my game there at my thread, you will see it´s being used carefully.