News:

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

Converting DIB project: MASM to GoASM

Started by GODRiC, January 19, 2010, 04:55:34 PM

Previous topic - Next topic

GODRiC

Hey guys,

I'd like to start using GoASM, so I've tried to convert some of my older DIB projects from MASM to GoASM.
However some problems occurred..

So to check if its even possible to work with DIB in GoASM, I simply tried to convert a normal DIB project,
without any effects and such.

But I still can't get it to work.
I don't know what I'm doing wrong, so I hope you guys can help me out.

I've included the original MASM project and the converted (non-working) GoASM project here:
http://rapidshare.com/files/337809012/dib.zip.html
or you can get it here:
http://4freeload.net/download.php?id=51805F266

(Unfortunately the masm32 forum only supports file attachments up to 256 KB, so I've uploaded
it to rapidshare.com and 4freeload.net. I hope thats okay.)

Thanks in advance,
GODRiC

donkey

#1
Hi GODRiC,

<sorry this was wrong headed, should have read the manual>

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

GODRiC

Hey donkey,

thanks for your fast reply.

The uploaded code fully works in MASM.
It seems the error is in the CreateDibSection API.
When debugging the MASM code it returns a buffer, but it doesn't
do this with the GoASM code buffer.. it returns 0.

donkey

Hi, if the buffer returns as 0 then its usually a problem with the BITMAPINFO structure, there is one glaring one...

mov D[canvas.bmiHeader.biSize],sizeof canvas.bmiHeader

should be

mov D[canvas.bmiHeader.biSize],sizeof BITMAPINFOHEADER

canvas.bmiHeader will resolve to 4 using GoAsm, this is because it checks the offset of the bmiHeader member (0) and the distance to the next label which is biWidth. I've never liked this behaviour but its not an issue as long as you use the actual structure names and not the labels you assign.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

GODRiC

MANY thanks, donkey.

Fully works now.

Maybe this was the problem when I tried to convert my other projects too.
I'll re-check them now/tomorrow and see if this works with them too.
Will come back if I experience any other probs.

Thanks again, donkey.