Recent Posts

Pages: 1 ... 8 9 [10]
91
MasmBasic & the RichMasm IDE / Re: my 100% Assembly game development
« Last post by Siekmanski on February 19, 2018, 08:50:19 AM »
esi points to the raw bitmap data, just check every pixel in the bitmap data ( add esi,4 for the next pixel ) and adjust the ALPHA channel of the color that needs to be transparent.
92
MasmBasic & the RichMasm IDE / Re: my 100% Assembly game development
« Last post by LordAdef on February 19, 2018, 08:43:20 AM »
Cheers my friends, this will surely save a lot of time and size.

Marinus, sorry for the stupid question.. I actuallu looked at the msdn to save the question, but I always get mad at msdn :icon_redface:

What is esi pointing to?
93
The Campus / Re: Division and the relationship with registers
« Last post by LordAdef on February 19, 2018, 08:23:35 AM »
Hey, why not do the divisions with dword instead. I would do something like this:
ps: Maybe the gurus around have a better idea, but this looks straight forward to me :biggrin:
http://www.ray.masmcode.com/
look here on loads of information, check BCD link
check his fpu tutorial, which already has instructions for packed BCD conversion
http://www.ray.masmcode.com/tutorial/fpuchap6.htm
packed means its get stored, like dw 56, gets stored in each byte $56 hexadecimal, in nibbles
check his fixed Point math also

But.. this is not what he wants DayDreamer. He doesn´t need fpu, he wants to isolate the digits of a bigger number. This is exactly what my snipet does, and if he wanted to work with word size, aw27 gave a nice algo too
94
MasmBasic & the RichMasm IDE / Re: my 100% Assembly game development
« Last post by Siekmanski on February 19, 2018, 07:59:41 AM »
Try to adjust the ALPHA color component for 1 color.

Code: [Select]
    mov     ColorKey,0FFFFFF00h             ; make yellow transparent, if 0 then no transparency
;    mov     ColorKey,0FF000000h            ; make black transparent, if 0 then no transparency

    mov     eax,dword ptr [esi]             ; get pixel data ARGB
   
    cmp     ColorKey,0                      ; Check if we need to set a certain color of this bipmap to transparent.
    jz      NoColorKey
    or      eax,0FF000000h
    cmp     ColorKey,eax
    jne     NoColorKey
    xor     eax,eax
NoColorKey:
    mov     dword ptr [esi],eax              ; save the pixel color data ARGB
95
The Workshop / slow loading program
« Last post by jimg on February 19, 2018, 06:39:12 AM »
I have a program I've used for a decade that suddenly started taking over 3 seconds to load.  Previously it loaded nearly instantaneously.
I use is a lot, so it was really bugging me.  After a couple of hours of sticking in test points, I found the area that was now causing the problem.
I'm assuming it's some recent update to windows defender that was the real culprit.

The code in question just does some setup for two richedit controls.

The original code looked like this.

Code: [Select]
mov hFont,eax
m2m tmp,hEText1
SetupRichEdit:
mov cf.cbSize,0
    inv SendMessage, tmp, EM_GETCHARFORMAT, 0, addr cf
    mov cf.crBackColor, 189 shl 16 or 220 shl 8 or 235 ;rgb(235,220,189)
mov cf.cbSize,sizeof cf
    mov cf.dwMask,CFM_COLOR or CFM_BACKCOLOR
    inv SendMessage, tmp, EM_SETCHARFORMAT, SCF_ALL, addr cf
    .if hFont!=0
inv SendMessage,tmp,WM_SETFONT,hFont,TRUE
.endif
    inv  SendMessage,tmp,EM_SETTEXTMODE,TM_PLAINTEXT,0
    ; subclass the rich edit controls so we can get the tab key
    inv SetWindowLong,tmp,GWL_WNDPROC,EditWndProc
mov OldEditWnd,eax ; save old routine

mov eax,tmp
.if eax==hEText1
m2m tmp,hEText2
jmp SetupRichEdit ; do other box also
.endif

Not very sophisticated or tricky, just loop through with each handle.

By unrolling the loop thusly:

Code: [Select]
mov hFont,eax
mov cf.cbSize,0
    inv SendMessage, hEText1, EM_GETCHARFORMAT, 0, addr cf
    mov cf.crBackColor, 189 shl 16 or 220 shl 8 or 235 ;rgb(235,220,189)
mov cf.cbSize,sizeof cf
    mov cf.dwMask,CFM_COLOR or CFM_BACKCOLOR
    inv SendMessage, hEText1, EM_SETCHARFORMAT, SCF_ALL, addr cf
    .if hFont!=0
inv SendMessage,hEText1,WM_SETFONT,hFont,TRUE
.endif
    inv  SendMessage,hEText1,EM_SETTEXTMODE,TM_PLAINTEXT,0
    ; subclass the rich edit controls so we can get the tab key
    inv SetWindowLong,hEText1,GWL_WNDPROC,EditWndProc
mov OldEditWnd1,eax ; save old routine


mov cf.cbSize,0
    inv SendMessage, hEText2, EM_GETCHARFORMAT, 0, addr cf
    mov cf.crBackColor, 189 shl 16 or 220 shl 8 or 235 ;rgb(235,220,189)
mov cf.cbSize,sizeof cf
    mov cf.dwMask,CFM_COLOR or CFM_BACKCOLOR
    inv SendMessage, hEText2, EM_SETCHARFORMAT, SCF_ALL, addr cf
    .if hFont!=0
inv SendMessage,hEText2,WM_SETFONT,hFont,TRUE
.endif
    inv  SendMessage,hEText2,EM_SETTEXTMODE,TM_PLAINTEXT,0
    ; subclass the rich edit controls so we can get the tab key
    inv SetWindowLong,hEText2,GWL_WNDPROC,EditWndProc
mov OldEditWnd1,eax ; save old routine

The load time was back to near instantaneous.

Odd.
96
MasmBasic & the RichMasm IDE / Re: my 100% Assembly game development
« Last post by HSE on February 19, 2018, 04:53:44 AM »
Now I am going to need two imgs for each stuff, and "AND" the two to create the transparency.

I think that using a rarely used color for transparency you can make the mask on the fly. Just change every images's color diferent to transparency to 1.
97
The Campus / Re: joke
« Last post by daydreamer on February 18, 2018, 11:24:54 PM »
:biggrin:

Now consistent with my previous assertion, if your taste in Editor's does not fit into the Blonde - Brunette distinction, walk on the wild side, live dangerously, try out a redhead. Its like a kid playing with matches, its risky but fun.  :P
like a hexeditor?
actually there are a completely graphical interface for make shaders for nonprogrammers in older poser its all kind of channels,transparency,bumpmap, etc and you can produce Everything from photorealistic human skin to Clouds,metals like copper and its dropdown menu for mathematical functions combined with you connect several of these channels and math function with lines, with help of drag and drop
also other 3d programs have graphical material editor for shaders, some just shows what it generates without showing math Formulas that generate it
98
The Campus / Re: Division and the relationship with registers
« Last post by daydreamer on February 18, 2018, 10:54:13 PM »
Hey, why not do the divisions with dword instead. I would do something like this:
ps: Maybe the gurus around have a better idea, but this looks straight forward to me :biggrin:
http://www.ray.masmcode.com/
look here on loads of information, check BCD link
check his fpu tutorial, which already has instructions for packed BCD conversion
http://www.ray.masmcode.com/tutorial/fpuchap6.htm
packed means its get stored, like dw 56, gets stored in each byte $56 hexadecimal, in nibbles
check his fixed Point math also
99
The Campus / Re: joke
« Last post by aw27 on February 18, 2018, 10:45:02 PM »
Nope JJ, you have a tendency to always miss the target.
It is not only VS, it is followed in Eclipse, Delphi, Keil ARM and all IDEs I can recall.
In addition, the great VS engine is used in other compilers like the Atmel AVR Studio, which I used recently to make some AVR asm programming.
100
The Campus / Re: joke
« Last post by jj2007 on February 18, 2018, 10:27:11 PM »
Quote
Real bookmarks, not toy bookmarks
These are not bookmarks, you can call them Task List shortcuts as Visual Studio does.

Nonsense. RichMasm bookmarks are like browser bookmarks: Select a text in your code, e.g. "Cleanup MACRO", hit Ctrl D (as in most browsers), and voilà, Cleanup MACRO appears in the rightmost column. From then on, wherever you are in your code, when clicking once on Cleanup MACRO you jump immediately there (as in most browsers). And RichMasm will definitely not try to mimic Visual Crap 8)

Quote
It is practically impossible to teach good programming to students that have had a prior exposure to Visual Crap: as potential programmers they are mentally mutilated beyond hope of regeneration.
Pages: 1 ... 8 9 [10]