xboxscene.org forums

Pages: 1 [2]

Author Topic: Very Simple Guide To Xbox App/emulator Porting  (Read 150 times)

alg5

  • Archived User
  • Full Member
  • *
  • Posts: 162
Very Simple Guide To Xbox App/emulator Porting
« Reply #15 on: June 25, 2006, 03:22:00 PM »

QUOTE(manlol @ Jun 24 2006, 11:59 AM) View Post

1. I'm not able to get a copy of VS2003, will MS Visual C++ 6.0 Standard Edition suffice?


yes cou can.
i personnaly use it with the xbox SDK 4627.

you will need some addons for visual: the processor pack & the sp5 for vc++6 . one of the addon will refuse to install on standard edition. you need to extract the addon unsing winzip, then select install by right clicking on one inf file. then copy the created directory created to the directory where vc++6 is install
Logged

nes6502

  • Archived User
  • Hero Member
  • *
  • Posts: 1158
Very Simple Guide To Xbox App/emulator Porting
« Reply #16 on: June 26, 2006, 11:22:00 AM »

More porting tips:

Many programs are written in a language (like C, C++, Assembly) and use a library to draw the graphics (like SDL, OpenGL, DirectDraw, Allegro, Direct3D)

As long as the application is written in either C or C++ it should work.

99% of the "porting" of any application or game to the Xbox is this:

Find the code that draws the screen, plays sounds, and reads the input.
Then replace this code with Xbox compatable code.

For example, if the game had a RenderScreen() method that made all the calls to OpenGL, you could look for all the calls to "RenderScreen()" and replace it with your drawScreen() method. your drawScreen method would take the same screen data that RenderScreen used, but instead make Direct3D calls to draw the screen.

This applies to sound and input (replace the keybaord code with Xbox controller code).

If an application is using SDL as the library to draw the graphics, then that's one entire category you don't have to touch because lantus has provided the SDLx (SDL Xbox version). You would then only focus on the other categories.

This is my suggestion on how to proceed:
1) I STRONGLY reccomend the first step be compile it (and run it) on windows.
2) Then comment out all the input and sound code.
3) If it uses SDL, ou can link to the SDLx libraries so you shouldn't have to change anything regarding the graphics.
4) Create the new Xbox application, link to the SDLx libraries, and compile it. This will generate the xbe.

So in theory, you should be able to compile and run an SDL application on the Xbox without changing or writing one line of code (just commenting out any code that gives a compile error like Windows Code, DirectInput code, ect..).

5) After it is running on the Xbox, start looking at replacing the keyboard code with Xbox controller code.
6) When input is working, make any changes that need to be made to get the sound working
7) That's it.

You do not have to be a coding master, but you should have a basic understanding of programming in C. For example, you need to know how all of this works:

variables (local, global)
loops (for, while)
data types (int, float, char)
arrays
functions (passing parameters, returning values, pass by reference)
pointers
structs
switch statements
if/else statements
how to write and read a text file (fopen, fprintf, fclose)
How to set a pixel color on a texture using Direct3D

Don't even begin the port until you understand all of these concepts. I reccomend learning them in the context of C (and porting apps written in C). That will make things a lot easier. There are lots of C tutorials on the net that cover all of these concepts.
Logged

cricri_pingouin

  • Archived User
  • Full Member
  • *
  • Posts: 103
Very Simple Guide To Xbox App/emulator Porting
« Reply #17 on: July 20, 2007, 05:22:00 AM »

QUOTE
If an application is using SDL as the library to draw the graphics, then that's one entire category you don't have to touch because lantus has provided the SDLx (SDL Xbox version). You would then only focus on the other categories.
(...)
3) If it uses SDL, ou can link to the SDLx libraries so you shouldn't have to change anything regarding the graphics.
4) Create the new Xbox application, link to the SDLx libraries, and compile it. This will generate the xbe.

So in theory, you should be able to compile and run an SDL application on the Xbox without changing or writing one line of code (just commenting out any code that gives a compile error like Windows Code, DirectInput code, ect..).


I have a couple of questions regarding SDLx.
1 ) what video modes are XBox compatible? 640x480 32bits only? What if I have a 320x200 application?
2 ) what about controller related functions syntax? I don't know how to test for the different buttons on the different controllers blink.gif

TIA!

*EDIT* BTW, I think this thread would fit better in the "Development" forum, just my $0.02.
Logged

devouringone3

  • Archived User
  • Newbie
  • *
  • Posts: 8
Very Simple Guide To Xbox App/emulator Porting
« Reply #18 on: February 12, 2009, 10:07:00 AM »

Nice thread, I pretty much know nothing about coding... but hey, it is a good opportunity to start.

I want to port one or many Touhou Project games... anyone knows if it'll be a big task?

It is a game that looks like stepmania, windowed 640x480, 16bits/32bits colors... simple keyboard-only controls in menu and in game. The game weight about nothing... but yeah, thanks your "guide" is good for hope and motivation.
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Very Simple Guide To Xbox App/emulator Porting
« Reply #19 on: February 12, 2009, 06:14:00 PM »

1) Is the source code for this particular game available? Can't do much without it.

2) You do know Stepmania has already been ported to the X-Box, right?
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Very Simple Guide To Xbox App/emulator Porting
« Reply #20 on: February 13, 2009, 05:38:00 AM »

QUOTE(devouringone3 @ Feb 13 2009, 04:43 PM) View Post
But hey, the game is essentially a zip file containing a .exe a .cfg and 3 .dat.

Wasn't the sourcecode only a "plus"?

For users, yes, the sourcecode could be considered just a "plus".

But for coders/porters, the source is EVERYTHING.

See, when you write a program, you write what's called the "source". The source is text, pretty close to standard english, that tells the program what to do. Pretty much anyone can read source code and get a vague idea as to what it's supposed to do (especially if it's well written source, in which case it'll contain plenty of "real" english comments explaining all the complex bits).

Once you've produced your source, you compile it. For a PC, this converts the source to code the computer can run - an EXE file. This is pretty much unreadable to everyone except experienced coders (and even they have to take some time to translate it). Try opening up an EXE in Wordpad or something, you'll see what I mean.

So how do you re-write an EXE to work on the X-Box? Well... you don't. The amount of work involved is massive. Instead, you simply get a compiler for the X-Box, and tweak the source a little bit and bam, you're done.

(The X-Box uses XBE files instead of EXE files).

Without the source, you've got no hope of convincing anyone to attempt a port for you. And given that I just had to explain the above to you, I'd also guess you haven't a hope of doing it yourself.  unsure.gif
Logged

Red_Breast

  • Archived User
  • Newbie
  • *
  • Posts: 49
Very Simple Guide To Xbox App/emulator Porting
« Reply #21 on: February 17, 2009, 02:37:00 PM »

Getting hold of XDK then.
I seem to remember that the one on Xbins is an open-source version of the XDK.
Is that correct?
If so I take it getting hold of the XDK is one of those things I need to search for myself.
Is that correct?
I'd really like an updated ScummVM. Cacharius' last build was Xmas 2007. Quite a lot of games have been added since then.
Logged

Pulsemasta

  • Archived User
  • Hero Member
  • *
  • Posts: 510
Very Simple Guide To Xbox App/emulator Porting
« Reply #22 on: January 09, 2010, 02:20:00 AM »

I couldn't find the Genadrive source code on Xbins, or elsewhere. Is it still open source?
Logged
Pages: 1 [2]