NASM - The Netwide Assembler
Related Projects => NASMX => Topic started by: avcaballero on January 04, 2015, 03:02:35 PM
-
Hello. I'm trying to use the LOGFONT structure. I checked two ways (at the bottom of the source), both failed (commented). Any help, please?
I include my "windemos.inc" file.
Regards and a happy new year, guys.
-
Hi!
Maybe you have to define structure like this:
(windemos.inc, line 158)
NASMX_STRUC BITMAPINFOHEADER
NASMX_RESERVE biSize, int32_t, 1
NASMX_RESERVE biWidth, int32_t, 1
NASMX_RESERVE biHeight, int32_t, 1
NASMX_RESERVE biPlanes, short_t, 1
NASMX_RESERVE biBitCount, short_t, 1
NASMX_RESERVE biCompression, int32_t, 1
NASMX_RESERVE biSizeImage, int32_t, 1
NASMX_RESERVE biXPelsPerMeter, int32_t, 1
NASMX_RESERVE biYPelsPerMeter, int32_t, 1
NASMX_RESERVE biClrUsed, int32_t, 1
NASMX_RESERVE biClrImportant, int32_t, 1
NASMX_ENDSTRUC
After that, use like this:
(demo6.inc, line 310)
NASMX_ISTRUC LCDBITMAPINFO, BITMAPINFOHEADER
NASMX_AT biSize, BITMAPINFOHEADER_size ; int32_t, 1
NASMX_AT biWidth, cdXSize ; int32_t, 1
NASMX_AT biHeight, -1*cdYSize ; int32_t, 1
NASMX_AT biPlanes, 1 ; short_t, 1
NASMX_AT biBitCount, 32 ; short_t, 1
NASMX_AT biCompression, 0 ; int32_t, 1
NASMX_AT biSizeImage, 0 ; int32_t, 1
NASMX_AT biXPelsPerMeter, 0 ; int32_t, 1
NASMX_AT biYPelsPerMeter, 0 ; int32_t, 1
NASMX_AT biClrUsed, 0 ; int32_t, 1
NASMX_AT biClrImportant, 0 ; int32_t, 1
NASMX_IENDSTRUC
-
Don't understand, sorry. I want to use the LOGFONT structure, that I've already defined in windemos.Inc
Regards
-
You forgot to define with 'I'.
Wrong, NASMX_STRUC:
; NASMX_STRUC Arial_Black_10, LOGFONT
; NASMX_AT lfHeight, -13
; NASMX_AT lfWidth, 0
; NASMX_AT lfEscapement, 0
; NASMX_AT lfOrientation, 0
; NASMX_AT lfWeight, 400
; NASMX_AT lfItalic, 0
; NASMX_AT lfUnderline, 0
; NASMX_AT lfStrikeOut, 0
; NASMX_AT lfCharSet, 0
; NASMX_AT lfOutPrecision, 3
; NASMX_AT lfClipPrecision, 2
; NASMX_AT lfQuality, 1
; NASMX_AT lfPitchAndFamily, 34
; NASMX_AT lfFaceName, NASMX_TEXT("Arial Black")
; NASMX_ENDSTRUC
Right, NASMX_ISTRUC:
NASMX_ISTRUC Arial_Black_10, LOGFONT
...
... tra la la
...
NASMX_IENDSTRUC
-
As Encryptor256 points out, you need to instantiate the logical font structure in your [section .data] with NASMX_ISTRUC ( note the "I" indicating Instantiate ).
Also, while you certainly can define the structure member variable lfFaceName as an int8_t in your windemos.inc file, you may prefer to use NASMX_TCHAR instead which will enable nasm to correctly assemble the source file whether UNICODE is defined or not.
-
Ah, thank you for your time and the info :)
By the way, I did a copy paste of LOGFONT from windows.inc to windemos.inc
Regards