xboxscene.org forums

Author Topic: Xfx Framework  (Read 514 times)

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« on: September 29, 2012, 04:58:00 PM »

static const class instances are not initialized on startup like they should.
This due to the xbe's not containing .ctors and .dtors sections and lack of handling of those sections in
CODE
WinMainCRTStartup()

Now it would be trivial to add the required code, but without the required sections...

Now this I don't understand; OpenXDK seems to use the standard linker script for compiles,
so why aren't the .ctors and .dtors sections added when using C++ code?

In order to properly support C++, these sections need to be added, and properly manipulated in the
CODE
WinMainCRTStartup()
function in openxdk.c
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« Reply #1 on: April 25, 2010, 06:09:00 PM »

I'm currently working on an XNA clone for the XBOX, designed on top of OpenXDK.

I've finished most of the Mathematical classes (Vector2 et al), the Input namespace works (only GamePad has been tested as of now, but Mouse and Keyboard should work as well.)
The highest priority is to get the Graphics System working, but I'm still not sure whether I should use SDLx, or pbKit to implement it.

Want to try it out for yourself?
Download the compiled libraries here.

Also, I suggest downloading the demo app.
It's not very sophisticated, but it contains a rudimentary game loop, and it shows how to use the XFX Input system.

Any suggestions for improvements are welcome, and I will try my best to implement them as soon as possible.
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Xfx Framework
« Reply #2 on: May 16, 2010, 01:10:00 AM »

After playing a bit with open gl es 2.0 on iPhone and Zune HD, I really believe there might be a way to simulate a few compatible calls on xbox1. If I have time I will try to create these calls above pbkit (the hardest part being some shaders translations. also I can't exclude shader model 1.1 being too weak for such an attempt... so it can fail. but if it works there will be plenty of homebrew sources using open gl es 2.0 that could be ported easily then. at least it should be possible to create xb1 compatible shader doing what does the open gl es 1.1 fixed-function pipeline).
Logged

Hyper_Eye

  • Recovered User
  • Sr. Member
  • *
  • Posts: 366
Xfx Framework
« Reply #3 on: May 16, 2010, 11:17:00 PM »

If you get any sort of opengl layer going there are a few things I am interested in doing myself. I have only written a few sample applications for openxdk but I am interested in using it for some more serious development. Keep up the good work.
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« Reply #4 on: May 17, 2010, 06:39:00 AM »

QUOTE(openxdkman @ May 16 2010, 08:10 AM) View Post

After playing a bit with open gl es 2.0 on iPhone and Zune HD, I really believe there might be a way to simulate a few compatible calls on xbox1. If I have time I will try to create these calls above pbkit (the hardest part being some shaders translations. also I can't exclude shader model 1.1 being too weak for such an attempt... so it can fail. but if it works there will be plenty of homebrew sources using open gl es 2.0 that could be ported easily then. at least it should be possible to create xb1 compatible shader doing what does the open gl es 1.1 fixed-function pipeline).
Building the XFX Graphics on top of OpenGL sounds appealing, especially since Linux supports OpenGL...
See where I'm going?

On a side note, what library should I get to implement OpenGL? MESA3D seems the most likely candidate, but I want your opinion just to be sure.
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« Reply #5 on: May 17, 2010, 04:14:00 PM »

I took a look at OpenGL ES 2.0, but I'm missing glBegin() and glEnd() in the funtion list.
Now, from what I've seen in code samples, those are being handled by EGL, or a similar library, which also helps managing the game window.
For the XBOX, however, that's not necessary.
So I was wondering what I should do 'cause glBegin and glEnd would be the perfect places to insert pb_begin and pb_end respectively.

Should I go ahead and add glBegin and glEnd, or should I try to mimick the EGL functions that do those calls?
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« Reply #6 on: May 18, 2010, 04:59:00 AM »

I want as little code changes as possible between, say, the IPhone, Pandora, and the XBOX when porting,
so I guess I'll take a look at some IPhone and Pandora code samples to see if there are similarities.

The hardest thing to do will be shaders and texture management.
Main problem with the shader functions will be the compilation of GLSL to microcode.
Texture management? I dunno. I come from XNA, so the entire thing is handled for you instead of doing it yourself. This will take some time.

Once GLES works on the XBOX, I'm going to try to build a SpriteBatch class on top of it, and work from there.
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« Reply #7 on: May 24, 2010, 06:29:00 PM »

The Nouveau project is an incredible source for push buffer coding hints.
Most of their code fits right in, and because of that, I already have around one third of the GL ES 2.0 functions coded.

I still need to test them, though, and I still don't know whether I should also create a custom subset of EGL, but I'm getting there.

libGLESv2 is coming to the XBOX.
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« Reply #8 on: November 14, 2010, 03:10:00 PM »

Alright, after roughly six months of silence, here's an update.
No change to the files at SourceForge yet, but al lot has changed.
Of what little code that I had completed, most has been rewritten.
I now manage the code with Visual Studio 2005 (still compiling with Cygwin, though), which makes everything so much easier.
The directory structure has been completely revamped, together with a lot of other, smaller changes.
The only thing left to do before I can (finally) post the SOURCE code of XFX, is to clean up the directories and remove all unneeded bloat.
After that, I think I'll open up a couple of developer spots on my 1 man team, so XFX can really evolve into something useful.

One of the most important changes is 'type-safe' enums.
Previously, you wrote XFX code like:
CODE
GamePadState gamePadState = GamePad::GetState(One);
    
//Allow the game to exit
if(gamePadState.Buttons.Back == Pressed)
    done=1;

While it works, there's a downside, since enums violate the scope principle of C++: the namespaces become polluted with constant definitions that easily lead to naming conflicts.
So what I did was wrap all enums in structs like the PlayerIndex enum, for example:
CODE
struct PlayerIndex
{
    enum type
    {
        One,
        Two,
        Three,
        Four
    };
};

typedef PlayerIndex::type PlayerIndex_t;

Not very elegant, but it works. Now, let's take the above XFX example and modify it to reflect the changes:
CODE
GamePadState gamePadState = GamePad::GetState(PlayerIndex::One);
    
//Allow the game to exit
if(gamePadState.Buttons.Back == ButtonState::Pressed)
    done=1;

Not only does it look more like XNA, it also prevents namespace pollution.

Well, that's it for now. I'll update again when I've uploaded the source code and updated precompiled libs to SourceForge.net
Logged

Hyper_Eye

  • Recovered User
  • Sr. Member
  • *
  • Posts: 366
Xfx Framework
« Reply #9 on: November 18, 2010, 07:36:00 PM »

I'm glad to hear there is progress!
Logged

Clockface

  • Archived User
  • Full Member
  • *
  • Posts: 242
Xfx Framework
« Reply #10 on: December 02, 2010, 04:06:00 PM »

There has to be one clueless newbie in every topic to ask the obvious, so it might as well be me  sad.gif

What exactly is this? What can it do, and what might we expect to see from it?

Will it let other games be ported to the XBox?

Thanks for any answers.
Logged

freakdave

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 284
Xfx Framework
« Reply #11 on: October 28, 2011, 10:44:00 AM »

Are you still working on it ?
How about giving us a short status update ?

Thanks and keep up the good work !
Logged

halofreak1990

  • Archived User
  • Newbie
  • *
  • Posts: 46
Xfx Framework
« Reply #12 on: November 05, 2011, 12:09:00 PM »

It's been a while since I last posted any update on XFX, so here I am.

There is still a lot that needs to be done on the graphics part of XFX, mainly handling textures and getting some sort of visual output other than OpenXDK's debugprint.

I've been commenting out several hundreds of lines of code in the libraries that verified the correctness of arguments passed to functions, and threw exceptions if the arguments didn't match expected values. The downside of trying to throw exceptions in OpenXDK is that there is zero library support, and test builds of OpenXDK apps linking to my libraries are riddled with unresolved references, linking to _abort and various pthread functions. Commenting these check out gets rid of the errors and let me actually test the XFX codebase.

Thread::Sleep is verified to work, and I copied the code used by it into the XSleep function, making it thread-safe. I'll be spending the next few days testing some other code in libmscorlib and get it into a working state.
libXFX will be next on the list. I'll be re-testing what I've written so far, and see if I can improve things while I'm at it.


I'd also like to request some outside help; maintaining these libraries on my own is a lot of work, and I'd really like some insights in dealing with texture (memory) management in relation to pbKit, so I can put the SpriteBatch class to use.
Logged

hcf

  • Archived User
  • Full Member
  • *
  • Posts: 115
Xfx Framework
« Reply #13 on: January 16, 2012, 05:01:00 AM »

QUOTE(K3thunder @ Jan 12 2012, 11:48 PM) View Post

A couple questions.

Any update?
Do you need help with this project?
 If so, let me know I'll see what i can do as I look forward to seeing an opengl homebrew xna kit being that the potential for such an application as this would revolutionize not just my work but thousands of other developers out there.
I've been watching you.


I subscribe K3thunder words. It would be awesome, and it would open the door to many new ports and developments for the Xbox  smile.gif
Logged

ABuNeNe

  • Archived User
  • Newbie
  • *
  • Posts: 12
Xfx Framework
« Reply #14 on: February 05, 2012, 08:46:00 AM »

I'm a Java developer professional and know shell scripting. I've just resurrected my old Xbox and connected to my 32" LCD TV. Let me know if I can be any help.
Logged