The MASM Forum

General => The Laboratory => Topic started by: BugCatcher on April 23, 2017, 04:40:46 AM

Title: Another rotating cube!
Post by: BugCatcher on April 23, 2017, 04:40:46 AM
Since I've never posted any code before, here's some. Its a translation of a file Directx11\Tutorial5 from the Directx sdk 2010.
I built it with Radasm 3.0.0.9.c. Windows 10 home ed. Its hard coded to directx version 11_0 and uses shader version 4.
Hope it works for ya'all.

                                 Thks to Siekmanski with dx help.
                                  Thks to Chris Hobbs and the DiamondCrew(circa 1998) from the Gamedev net site,
                                 for his Testris assembly program in DirectDraw(still there).

Title: Re: Another rotating cube!
Post by: avcaballero on April 23, 2017, 05:04:06 AM
Ops, I don't have d3dx9_43.dll, thanks anyway :t
Title: Re: Another rotating cube!
Post by: jj2007 on April 23, 2017, 05:04:41 AM
Quote from: BugCatcher on April 23, 2017, 04:40:46 AMHope it works for ya'all.

The exe works fine, well done :t

Bulding it the standard Masm way did not succeed, though. I guess RadAsm uses some special tricks :(
Title: Re: Another rotating cube!
Post by: Siekmanski on April 23, 2017, 12:20:09 PM
Runs fine here too.  8)
Title: Re: Another rotating cube!
Post by: hutch-- on April 23, 2017, 07:57:18 PM
Works fine on my win 10 64.

You could probably update this line to reflect 2017.  :biggrin:

AboutMsg         db 'MASM32 RadASM Dialog as main',13,10,'Copyright © MASM32 2001',0
Title: Re: Another rotating cube!
Post by: guga on April 24, 2017, 05:03:43 AM
Not working on XP :( Don´t have the dll . I downloaded a copy of it and tried to use, but it lacks an import (i presume it is for usage exclusively on Windows Vista or later ?)
Title: Re: Another rotating cube!
Post by: BugCatcher on April 24, 2017, 05:12:17 AM
If I remember right, the last dx I had on my windows xp machine was directx 9. Don't think xp runs directx 11, or shader version 4.
Title: Re: Another rotating cube!
Post by: HSE on April 24, 2017, 08:33:06 AM
Same as Guga in 7 (32)
Title: Re: Another rotating cube!
Post by: BlameTroi on April 24, 2017, 08:35:10 AM
The exe also runs fine for me on Windows 10. I wanted to assemble and poke around but I get errors on the MMX instructions. I get A2085 errors here, for instance (line 397 in the original source):


;    // Initialize the projection matrix
; g_Projection = XMMatrixPerspectiveFovLH( XM_PIDIV2, width / (FLOAT)height, 0.01f, 100.0f );
    cvtsi2ss    xmm0,vp.Width_
    cvtsi2ss    xmm1,vp.Height
    divss       xmm0,xmm1
    movss       fpAspectRatio,xmm0
    invoke      D3DXMatrixPerspectiveFovLH,addr g_Proj,FLT4(0.78539816339744


Searching didn't yield anything that worked for me. I added the following at the head of the source, no change in behavior:


; txb need mmx support
    .686
    .model flat,stdcall
    option casemap :none
    .xmm
Title: Re: Another rotating cube!
Post by: Siekmanski on April 24, 2017, 11:05:22 AM
Hi BlameTroi,

try this:

   fld      vp.Width_
   fdiv     vp.Height
   fstp     fpAspectRatio
Title: Re: Another rotating cube!
Post by: LordAdef on April 25, 2017, 11:21:17 PM
Running smooth here!

Win 7 64, i7 16gb
Title: Re: Another rotating cube!
Post by: Raistlin on April 26, 2017, 03:15:18 PM
This type of stuff reminds me so much of the SWAG pascal graphics distro.
http://swag.delphidabbler.com/

Some real kewl old school demo stuff using int 13  :t

Anyhow yes - work fine here aswell. re: spinning cube