News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Recent posts

#41
The Campus / Re: Help, creating a Malloc fu...
Last post by RHL - May 23, 2012, 05:27:10 AM
guys I made this code, and wanted to ask if I could say if this is correct:  :bg

also, my question is... if is correct how to I use the CreateHeap function, I want to mean, I use just once to create two memallocs... is right?  :bg

include masm32rt.inc

CreatemyHeap proto
mymalloc proto :DWORD, :DWORD
myfree proto :DWORD, :DWORD

.data
hmyHeap dd 0
mtest db "test, testtttt dj a test ",0

hMylp1 dd 0
hMylp2 dd 0
.code
main:


call CreatemyHeap

;I need to 300h bytes
push 300h
push hmyHeap
call mymalloc
mov hMylp1,eax
invoke RtlMoveMemory,eax,addr mtest,10

push 200h
push hmyHeap
call mymalloc
mov hMylp2,eax

invoke RtlMoveMemory,eax,addr mtest+10,10


; free memory 1
push hMylp1
push hmyHeap
call myfree

; free memory 2
push hMylp2
push hmyHeap
call myfree


CreatemyHeap proc
invoke HeapCreate,NULL,1000h,1000h ; 1000h bytes, I think it's suficient lol
mov hmyHeap,eax
ret
CreatemyHeap endp

mymalloc proc hmyheap:DWORD, Memsize:DWORD
invoke HeapAlloc,hmyheap,HEAP_ZERO_MEMORY,Memsize
ret
mymalloc endp

myfree proc hMem:DWORD, hAlloc:DWORD
invoke HeapFree,hMem,NULL,hAlloc
invoke HeapDestroy,hMem
ret
myfree endp
end main
#42
The Campus / Re: BitBlt Motion
Last post by dedndave - May 23, 2012, 04:46:09 AM
this loop will kill you   :P
      .while var1 < 768 ;<<  Bitmap width
         invoke BitBlt,memDCBack,0,0,767,576,memDC,1,0,SRCCOPY     ;take from pixel 1 to width
         invoke BitBlt,memDCBack,767,0,1,576,memDC,767,0,SRCCOPY  ;take pixel 1 to  last column
         invoke BitBlt,hDC,10,10,768,576,memDCBack,var1,0,SRCCOPY    ;draw the image

        inc var1
      .endw

i would think you can do it with 3 BitBlt's and no loop - if the "split" offset is 0, only 2
all you have to have as a variable is the x-offset of the "split" - which could change with a timer or something
#43
The Campus / BitBlt Motion
Last post by masitecno - May 23, 2012, 03:22:15 AM
Hi everybody.

I'm trying to scroll an image like a cilinder, i had an idea using bitblt but i think something was wrong in the implementation:


Paint_Proc proc hWin:DWORD, hDC:DWORD, movit:DWORD
    LOCAL hOld :DWORD
    LOCAL hNew :DWORD
    LOCAL memDC:DWORD
    LOCAL memDCBack:DWORD
    invoke CreateCompatibleDC,hDC
    mov memDC, eax                   
    invoke SelectObject,memDC,hBmp
    mov hOld, eax                         
    invoke CreateCompatibleDC,hDC   
    mov memDCBack, eax
    invoke SelectObject,memDC,hBmp
    mov hNew, eax
    .if movit == 0
      invoke BitBlt,hDC,10,10,768,576,memDC,0,0,SRCCOPY
    .else
    mov var3, 0
    .while var3 < 2     ;<< set the number of times image is looped
      mov var1, 0
      .while var1 < 768 ;<<  Bitmap width
         invoke BitBlt,memDCBack,0,0,767,576,memDC,1,0,SRCCOPY     ;take from pixel 1 to width
         invoke BitBlt,memDCBack,767,0,1,576,memDC,767,0,SRCCOPY  ;take pixel 1 to  last column
         invoke BitBlt,hDC,10,10,768,576,memDCBack,var1,0,SRCCOPY    ;draw the image

        inc var1
      .endw

    inc var3
    .endw
    .endif
    invoke SelectObject,hDC,hOld
    invoke DeleteDC,memDC
    invoke SelectObject,hDC,hNew
    invoke DeleteDC,memDCBack
    return 0
Paint_Proc endp

(The original code was taken from a masm32 example)

I think bitblt can copy from the second column to the end of the bitmap, then copy the first column to the last column then paint that in the window but.
It just doesnt work.

I would appreciate some help. Thanks.
#44
The Campus / Re: Help, creating a Malloc fu...
Last post by RHL - May 23, 2012, 12:13:06 AM
Vortex: mmm that sound interesant... but I was able to do it :D
thanks a lot guys  :bg

#45
The Colosseum / Re: Windows 8 Metro, duh!!
Last post by lingo - May 22, 2012, 11:07:00 PM
Latest Windows 8 build reveals minimalistic desktop UI...

For more info click here.
#46
The Campus / Re: Alloc Question
Last post by Antariy - May 22, 2012, 10:23:26 PM
Quote from: jj2007 on May 20, 2012, 01:09:48 AM
MB is good because I had many friendly helpers here. For example, the GetFiles macro was very actively discussed in the lowest possible stack address thread.

:eek :green2

:U
#47
The Soap Box / Re: New Forum
Last post by dedndave - May 22, 2012, 07:21:48 PM
i just archived and deleted all my messages Hutch
that might help a little   :P

i still have several threads i want to archive   :U

my wish-list...

everything by Erol
everything by Edgar
everything by Jochen
everything by Alex
everything by drizz
everything by qWord

...and a half-dozen other members - lol
#48
The Soap Box / Re: New Forum
Last post by baltoro - May 22, 2012, 07:13:51 PM
OK. :eek
...Good thing its a secret,...
...Otherwise, I'd be there making endless annoying comments,...

Quote from: HUTCH...Post in the new forum, this one may not be around much longer,...
#49
The Soap Box / Re: New Forum
Last post by dedndave - May 22, 2012, 05:35:48 PM
oh - we weren't going to tell YOU where the new forum was   :bdg
#50
16 bit DOS Programming / Re: Unable to transfer to new ...
Last post by dedndave - May 22, 2012, 05:32:24 PM
use '4' for horses