Author Topic: NeHe Tutorial in masm64  (Read 24517 times)

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: NeHe Tutorial in masm64
« Reply #150 on: July 18, 2021, 07:01:33 PM »
How to translate ?
Put them in correct c syntax and headinc will help you:
Code: [Select]
typedef  signed int FT_Int;
typedef signed long FT_Long ;
typedef int * FT_String ;
typedef int * FT_Bitmap_Size;
typedef int * FT_CharMap;
typedef  signed long FT_Pos;
typedef  int FT_Generic;      //???????????? by defaut
//---------------------------------------

typedef struct  FT_BBox_
  {
    FT_Pos  xMin, yMin;
    FT_Pos  xMax, yMax;

  } FT_BBox;
//---------------------------------------------------
typedef unsigned short FT_UShort;
signed short FT_Short  ;
//-------------------------------------------------------
typedef struct  FT_Bitmap_
  {
    unsigned int    rows;
    unsigned int    width;
    int             pitch;
    unsigned char*  buffer;
    unsigned short  num_grays;
    unsigned char   pixel_mode;
    unsigned char   palette_mode;
    void*           palette;

  } FT_Bitmap;
//----------------------------------------------------
typedef struct  FT_BitmapGlyphRec_
  {
    FT_GlyphRec  root;
    FT_Int       left;
    FT_Int       top;
    FT_Bitmap    bitmap;

  } FT_BitmapGlyphRec;
//-------------------------------------------------------
typedef struct  FT_GlyphRec_
  {
    FT_Library             library;
    const FT_Glyph_Class*  clazz;
    FT_Glyph_Format        format;
    FT_Vector              advance;

  } FT_GlyphRec;
//---------------------------------------------------
typedef struct FT_LibraryRec_   *FT_Library;
//-----------------------------------------------------
typedef struct  FT_Vector_
  {
    FT_Pos  x;
    FT_Pos  y;

  } FT_Vector;
------------------------------------------------
typedef struct FT_FaceRec_
{
    FT_Long           num_faces;
    FT_Long           face_index;

    FT_Long           face_flags;
    FT_Long           style_flags;

    FT_Long           num_glyphs;

    FT_String*        family_name;
    FT_String*        style_name;

    FT_Int            num_fixed_sizes;
    FT_Bitmap_Size*   available_sizes;

    FT_Int            num_charmaps;
    FT_CharMap*       charmaps;

    FT_Generic        generic;

    /*# The following member variables (down to `underline_thickness`) */
    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */
    /*# for bitmap fonts.                                              */
    FT_BBox           bbox;

    FT_UShort         units_per_EM;
    FT_Short          ascender;
    FT_Short          descender;
    FT_Short          height;

    FT_Short          max_advance_width;
    FT_Short          max_advance_height;

    FT_Short          underline_position;
    FT_Short          underline_thickness;

    FT_GlyphSlot      glyph;
    FT_Size           size;
    FT_CharMap        charmap;

    /*@private begin */

    FT_Driver         driver;
    FT_Memory         memory;
    FT_Stream         stream;

    FT_ListRec        sizes_list;

    FT_Generic        autohint;   /* face-specific auto-hinter data */
    void*             extensions; /* unused                         */

    FT_Face_Internal  internal;

    /*@private end */

  } FT_FaceRec,*  FT_Face;

Fa is a musical note to play with CL

Mikl__

  • Member
  • *****
  • Posts: 1136
Re: NeHe Tutorial in masm64
« Reply #151 on: July 18, 2021, 10:14:09 PM »
Bonjour, TouEnMasm!
thank you for headinc.exe! What is XMASM ? qword? dword?
typedef struct  FT_Bitmap_|
  {|FT_Bitmap   STRUCT DEFALIGNMASM
    unsigned int    rows;|   rows DWORD ?
    unsigned int    width;|   awidth DWORD ?
    int             pitch;|   pitch DWORD ?
    unsigned char*  buffer;|   buffer XMASM ?;<----?
    unsigned short  num_grays;|   num_grays WORD ?
    unsigned char   pixel_mode;|   pixel_mode BYTE ?
    unsigned char   palette_mode;|     palette_mode BYTE ?
    void*           palette;|    palette XMASM ?;<----?
  } FT_Bitmap;|FT_Bitmap      ENDS








LiaoMi

  • Member
  • ****
  • Posts: 943
Re: NeHe Tutorial in masm64
« Reply #152 on: July 18, 2021, 10:41:13 PM »
Bonjour, TouEnMasm!
thank you for headinc.exe! What is XMASM ? qword? dword?
typedef struct  FT_Bitmap_|
  {|FT_Bitmap   STRUCT DEFALIGNMASM
    unsigned int    rows;|   rows DWORD ?
    unsigned int    width;|   awidth DWORD ?
    int             pitch;|   pitch DWORD ?
    unsigned char*  buffer;|   buffer XMASM ?;<----?
    unsigned short  num_grays;|   num_grays WORD ?
    unsigned char   pixel_mode;|   pixel_mode BYTE ?
    unsigned char   palette_mode;|     palette_mode BYTE ?
    void*           palette;|    palette XMASM ?;<----?
  } FT_Bitmap;|FT_Bitmap      ENDS


Hi Mikl,

You should take into account that before converting, you need to collect all the variable definitions in one file, after that you need to take into account the structure of the header files, the order of defining variables, only in this case you can get the correct result. An alternative method is to add all types to the converter configuration, but I would not do that, since this will create confusion.

XMASM = PTR

Mikl__

  • Member
  • *****
  • Posts: 1136
Re: NeHe Tutorial in masm64
« Reply #153 on: July 19, 2021, 12:02:08 AM »
Thank you LiaoMi!

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: NeHe Tutorial in masm64
« Reply #154 on: July 21, 2021, 12:14:08 AM »

I try to re-compile your source with:
Microsoft (R) Macro Assembler (x64) Version 14.29.30038.1
I couldn't say it is successfull.
With the MASM64 package a lot of of problems with include.
I have downloaded your includes  and ML64 say that DQ is not allowed in structures and more !.
Could help me a little?
Fa is a musical note to play with CL

Mikl__

  • Member
  • *****
  • Posts: 1136
Re: NeHe Tutorial in masm64
« Reply #155 on: July 21, 2021, 07:55:44 AM »
Bonjour, Yves!
Oui, je vais t'aider...
Is Lession#1 worked?
« Last Edit: July 22, 2021, 11:25:14 AM by Mikl__ »

Mikl__

  • Member
  • *****
  • Posts: 1136
Re: NeHe Tutorial in masm64
« Reply #156 on: July 24, 2021, 06:33:54 PM »
TouEnMasm, où es tu?

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: NeHe Tutorial in masm64
« Reply #157 on: July 24, 2021, 09:09:41 PM »
Hello,
I will test it as soon as possible.
Thanks
Fa is a musical note to play with CL

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: NeHe Tutorial in masm64
« Reply #158 on: July 25, 2021, 01:06:32 AM »
Sorry,After added hWin in data and further little corrections,I get
Code: [Select]
ML64.exe  tut_40-01.asm
C:\Users\luce\Downloads\01
Microsoft (R) Macro Assembler (x64) Version 14.29.30038.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: tut_40-01.asm

C:\install64\include64\gdi32.inc(1485) : error A2163:non-benign structure redefinition: incorrect initializers : POLYTEXT
tut_40-01.asm(17) : error A2005:symbol redefinition : MSG
tut_40-01.asm(51) : error A2070:invalid instruction operands
tut_40-01.asm(57) : error A2012:PROC, MACRO, or macro repeat directive must precede LOCAL
tut_40-01.asm(58) : error A2012:PROC, MACRO, or macro repeat directive must precede LOCAL
tut_40-01.asm(59) : error A2012:PROC, MACRO, or macro repeat directive must precede LOCAL
tut_40-01.asm(60) : error A2012:PROC, MACRO, or macro repeat directive must precede LOCAL
tut_40-01.asm(61) : error A2012:PROC, MACRO, or macro repeat directive must precede LOCAL
tut_40-01.asm(96) : error A2001:immediate operand not allowed
tut_40-01.asm(144) : error A2008:syntax error : endp
tut_40-01.asm(146) : error A2008:syntax error : dq
tut_40-01.asm(148) : error A2006:undefined symbol : PIXELFORMATDESCRIPTOR
tut_40-01.asm(148) : error A2175:invalid qualified type
tut_40-01.asm(79) : error A2006:undefined symbol : wglMakeCurrent
 invoke(30): Macro Called From
  tut_40-01.asm(79): Main Line Code
tut_40-01.asm(80) : error A2006:undefined symbol : wglDeleteContext
 invoke(30): Macro Called From
  tut_40-01.asm(80): Main Line Code
tut_40-01.asm(105) : error A2006:undefined symbol : wglCreateContext
 invoke(30): Macro Called From
  tut_40-01.asm(105): Main Line Code
tut_40-01.asm(108) : error A2006:undefined symbol : wglMakeCurrent
 invoke(46): Macro Called From
  tut_40-01.asm(108): Main Line Code
tut_40-01.asm(115) : error A2006:undefined symbol : w
tut_40-01.asm(117) : error A2006:undefined symbol : h
tut_40-01.asm(118) : error A2006:undefined symbol : glViewport
 invoke(30): Macro Called From
  tut_40-01.asm(118): Main Line Code
tut_40-01.asm(119) : error A2006:undefined symbol : GL_PROJECTION
 movReg64Arg(11): Macro Called From
  invoke(14): Macro Called From
   tut_40-01.asm(119): Main Line Code
tut_40-01.asm(119) : error A2006:undefined symbol : glMatrixMode
 invoke(30): Macro Called From
  tut_40-01.asm(119): Main Line Code
tut_40-01.asm(120) : error A2006:undefined symbol : glLoadIdentity
 invoke(56): Macro Called From
  tut_40-01.asm(120): Main Line Code
tut_40-01.asm(124) : error A2006:undefined symbol : w
tut_40-01.asm(125) : error A2006:undefined symbol : h
tut_40-01.asm(128) : error A2006:undefined symbol : gluPerspective
 invoke(56): Macro Called From
  tut_40-01.asm(128): Main Line Code
tut_40-01.asm(130) : error A2006:undefined symbol : GL_MODELVIEW
 movReg64Arg(11): Macro Called From
  invoke(14): Macro Called From
   tut_40-01.asm(130): Main Line Code
tut_40-01.asm(130) : error A2006:undefined symbol : glMatrixMode
 invoke(30): Macro Called From
  tut_40-01.asm(130): Main Line Code
tut_40-01.asm(131) : error A2006:undefined symbol : glLoadIdentity
 invoke(56): Macro Called From
  tut_40-01.asm(131): Main Line Code
tut_40-01.asm(134) : error A2006:undefined symbol : ps
tut_40-01.asm(138) : error A2006:undefined symbol : glFlush
 invoke(56): Macro Called From
  tut_40-01.asm(138): Main Line Code
tut_40-01.asm(140) : error A2006:undefined symbol : ps
tut_40-01.asm(56) : error A2206:missing operator in expression
tut_40-01.asm(56) : error A2006:undefined symbol : uMsg
tut_40-01.asm(56) : error A2096:segment, group, or segment register expected
tut_40-01.asm(149) : error A2006:undefined symbol : PIXELFORMATDESCRIPTOR
tut_40-01.asm(151) : error A2006:undefined symbol : PFD_SUPPORT_OPENGL
tut_40-01.asm(152) : error A2006:undefined symbol : PFD_TYPE_RGBA
tut_40-01.asm(170) : error A2006:undefined symbol : PFD_MAIN_PLANE

Fa is a musical note to play with CL

Mikl__

  • Member
  • *****
  • Posts: 1136
Re: NeHe Tutorial in masm64
« Reply #159 on: July 25, 2021, 08:17:32 AM »
Bonjour, TouEnMasm!
https://disk.yandex.ru/client/disk/TouEnMasm
Quote
Microsoft (R) Macro Assembler (x64) Version 14.29.30038.1
I saw you have installed Visual Studio 2022
Will share with me ml64.exe and link.exe? It is possible there is a means of solving a problem or dealing with a difficult situation in these programs...
« Last Edit: July 25, 2021, 12:05:16 PM by Mikl__ »

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: NeHe Tutorial in masm64
« Reply #160 on: July 25, 2021, 05:11:25 PM »
Thanks for link but I think I will search another way .
For example the masm nehe in 32 bits for masm ,must be faster.

Fa is a musical note to play with CL

Mikl__

  • Member
  • *****
  • Posts: 1136
Re: NeHe Tutorial in masm64
« Reply #161 on: July 26, 2021, 08:51:13 PM »
Quote
Microsoft (R) Macro Assembler (x64) Version 14.30.30401.0
Microsoft (R) Incremental Linker Version 14.30.30401.0
I installed Visual Studio 2022 and rebuilt the NeHe tutorials, replacing the ml64.exe and link.exe with newer versions did not result in errors
« Last Edit: July 27, 2021, 12:39:14 AM by Mikl__ »

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: NeHe Tutorial in masm64
« Reply #162 on: July 27, 2021, 07:13:13 PM »

The question seem to be what is the compiler and include files that you are using.
The include files must not be too much big to put here.
Fa is a musical note to play with CL

Mikl__

  • Member
  • *****
  • Posts: 1136
Re: NeHe Tutorial in masm64
« Reply #163 on: July 27, 2021, 09:51:08 PM »
Bonjour, Yves!
I posted all the include- and lib-files wich I created. Each include- and lib-file has small size. I posted the link https://disk.yandex.ru/client/disk/TouEnMasm, you will try compiling and linking

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: NeHe Tutorial in masm64
« Reply #164 on: July 27, 2021, 11:45:35 PM »
Answered corretly:
****** Name
****** password
****** Not a bot    (words with many russian names and a few european)
****** recall  the memory phrase

Must be a site who is never satisfy until he have your mobile phone number,your credit card and more.

Fa is a musical note to play with CL