Author Topic: Another rotating cube!  (Read 688 times)

BugCatcher

  • Regular Member
  • *
  • Posts: 31
Another rotating cube!
« 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).


caballero

  • Member
  • ****
  • Posts: 782
    • Abre Ojos Ensamblador
Re: Another rotating cube!
« Reply #1 on: April 23, 2017, 05:04:06 AM »
Ops, I don't have d3dx9_43.dll, thanks anyway :t
En un lugar de la Mancha de cuyo nombre no quiero acordarme

jj2007

  • Member
  • *****
  • Posts: 7750
  • Assembler is fun ;-)
    • MasmBasic
Re: Another rotating cube!
« Reply #2 on: April 23, 2017, 05:04:41 AM »
Hope 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 :(

Siekmanski

  • Member
  • *****
  • Posts: 1145
Re: Another rotating cube!
« Reply #3 on: April 23, 2017, 12:20:09 PM »
Runs fine here too.  8)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4927
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Another rotating cube!
« Reply #4 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
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

guga

  • Member
  • ****
  • Posts: 826
  • Assembly is a state of art.
    • RosAsm
Re: Another rotating cube!
« Reply #5 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 ?)
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

BugCatcher

  • Regular Member
  • *
  • Posts: 31
Re: Another rotating cube!
« Reply #6 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.

HSE

  • Member
  • ****
  • Posts: 552
  • <AMD>< 7-32>
Re: Another rotating cube!
« Reply #7 on: April 24, 2017, 08:33:06 AM »
Same as Guga in 7 (32)

BlameTroi

  • Regular Member
  • *
  • Posts: 11
  • Blame me, everyone does
Re: Another rotating cube!
« Reply #8 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):

Code: [Select]
;    // 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:

Code: [Select]
; txb need mmx support
    .686
    .model flat,stdcall
    option casemap :none
    .xmm
"God made the integers, all else is the work of man." -- Leopold Kronecker.

Siekmanski

  • Member
  • *****
  • Posts: 1145
Re: Another rotating cube!
« Reply #9 on: April 24, 2017, 11:05:22 AM »
Hi BlameTroi,

try this:

   fld      vp.Width_
   fdiv     vp.Height
   fstp     fpAspectRatio

LordAdef

  • Member
  • ***
  • Posts: 264
Re: Another rotating cube!
« Reply #10 on: April 25, 2017, 11:21:17 PM »
Running smooth here!

Win 7 64, i7 16gb

Raistlin

  • Member
  • ***
  • Posts: 258
Re: Another rotating cube!
« Reply #11 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