question: How are games 'ported' to different platforms like PC, Xbox or PS?
comment: Most of a game's code and assets are the same between platforms. The main things that have to be different are the bits that interact with the hardware or OS. Take graphics for example. On PC and Xbox you use the DirectX API to give instructions to the GPU. But PlayStation has its own API for that. So if you need to convert an Xbox game to PlayStation, you have to rewrite that code. Typically the code for a game is organised so the platform specific stuff is separated from the non-specific stuff. That way it's easier to work on a game for multiple platforms at once.
passages: Section::::Disciplines.:Porting programmer.
  
  Porting a game from one platform to another has always been an important activity for game developers. Some programmers specialize in this activity, converting code from one operating system to work on another. Sometimes, the programmer is responsible for making the application work not for just one operating system, but on a variety of devices, such as mobile phones. Often, however, "porting" can involve re-writing the entire game from scratch as proprietary languages, tools or hardware make converting source code a fruitless endeavour.
   The use of different toolsets to perform different builds may not be sufficient to achieve a variety of working executables for different platforms. In this case, the software engineer must "port" it, i.e. amend the code to be suitable to a new computer architecture or operating system. For example, a program such as Firefox, which already runs on Windows on the x86 family, can be modified and re-built to run on Linux on the x86 (and potentially other architectures) as well. The multiple versions of the code may be stored as separate codebases, or merged into one codebase by conditional compilation (see above). Note that, while
   The GNU autotools packages (i.e. autoconf, automake, and libtool) use the notion of a "build platform", a "host platform", and a "target platform". The "build platform" is where the compiler is actually compiled. In most cases, build should be left undefined (it will default from host). The "host platform" is where the output artifacts from the compiler will be executed. The "target platform" is used when cross compiling cross compilers, it represents what type of object code the package itself will produce; otherwise the "target platform" setting is irrelevant. For example, consider cross-compiling a video game that will run on a Dreamcast. The machine where the game is compiled is the "build platform" while the Dreamcast is the "host platform".
   Which APIs and libraries one chooses depends largely on the target platform. For example, libraries for PlayStation 2 development may not be available for Microsoft Windows and vice versa. However, there are game frameworks available that allow or ease cross-platform development, so programmers can program a game in a single language and have the game run on several platforms, such as the Wii, PlayStation 3, Xbox 360, PSP and Microsoft Windows.
  
  Section::::Tools.:APIs and libraries.:Graphic APIs.
   Porting is also the term used when a video game designed to run on one platform, be it an arcade, video game console, or personal computer, is converted to run on a different platform. Earlier video game "ports" were often not true ports, but rather reworked versions of the games. However, many 21st century video games are developed using software (often in C++) that can output code for one or more consoles as well as for a PC without the need for actual porting (instead relying on the common porting of individual component libraries).
   The mid-1980s and the mid-1990s saw a flurry of conversions of popular arcade games to home computers such as the ZX Spectrum, Commodore 64, Amstrad CPC, Commodore Amiga and Atari ST. These games were mostly developed and published by groups who were not involved with the original developers, but who had bought the rights to create reproductions of these games. Console versions of these arcade games, however, were often produced by the original developers of the arcade title.
  
  Section::::Types of conversions.
  
  Section::::Types of conversions.:Direct conversions.
   Section::::Background.
  
  Video games are frequently developed as cross-platform software products, using standard software libraries, game engines, and scripting languages that isolate platform-specific details from the specific elements for the game itself. Such tools enable games to be released simultaneously for many platforms.
   Since browser games run isolated from hardware in a web browser, they can run on many different operating systems without having to be ported to each platform.
  
  Section::::History.
   Section::::Methods.:Source code ports.
  
  Occasionally, as was the case with some of the engines/game cores in ScummVM, the original developers have helped the projects by supplying the original source code (those can be then called source ports). This is the best case, optimal for accuracy and minimizing the effort. An example is "Beneath a Steel Sky".
  
  Section::::Alternatives.
   Fan translations of video game console games are usually accomplished by modifying a single binary ROM image of the game. Fan translations of PC games, on the other hand, can involve translation of many binary files throughout the game's directory which are packaged and distributed as fan patch. In dealing with translations of console games, a console emulator is generally utilized to play the final product, although unofficial hardware, hardware mods or software mods can be used to run the translated ROM image on its native hardware.
  
  Section::::Purpose.
   A third approach to platform independence is emulating one of the supported target's APIs (usually, the Microsoft Windows API) to target other GUIs. With one of these products, one would program using the emulated API and the code would be (to the extent to which the product provides portability) portable to other GUIs.
  
  Section::::Features.
  
  PIGUI packages are pretty similar in their basic functionality; they each provide subroutines or objects that allow the user to build windows, buttons (regular as well as radio buttons and check boxes), menus, and the like. Some areas of differentiation are:
   BULLET::::- The Xbox Software Development Kit (SDK) (with libraries) is required to compile video games and applications for the Xbox. Also required to compile (and program in) is Microsoft Visual Studio .NET.
  
  Section::::Xbox embedded operating system.
  
  BULLET::::- The Xbox does not have an operating system per se, instead it only has a simple BIOS.
  
  BULLET::::- Everything else must go into the main executable and its (XDK and own-made) libraries.
  
  BULLET::::- Only a single thread (executable program) can run at a time on the Xbox.
   Video game conversion
  
  In video gaming parlance, a conversion is the production of a game on one computer or console that was originally written for another system. Over the years, video game conversion has taken form in a number of different ways, both in their style and the method in which they were converted.
  
  Section::::History.
   In recent times popularity of online console games has grown, and online capable video game consoles and online services such as Xbox Live for the Xbox have developed. Developers can maintain their software through downloadable patches. These changes would not have been possible in the past without the widespread availability of the Internet.
  
  PC development is different. Game developers try to account for majority of configurations and hardware. However, the number of possible configurations of hardware and software inevitably leads to discovery of game-breaking circumstances that the programmers and testers didn't account for.
   Unlike binary executable files, the same script can be used on all computers that have software to interpret the script. This is because the script is generally stored in plain text in a text file. There may be some issues, however, such as the type of new line character that sits between the lines. Generally, however, little or no work has to be done to make a script written for one system, run on another.
  
  Some quite popular cross-platform scripting or interpreted languages are:
   Cross-platform software
  
  In computing, cross-platform software (also multi-platform software or platform-independent software) is computer software that is implemented on multiple computing platforms. Cross-platform software may be divided into two types; one requires individual building or compilation for each platform that it supports, and the other one can be directly run on any platform without special preparation, e.g., software written in an interpreted language or pre-compiled portable bytecode for which the interpreters or run-time packages are common or standard components of all platforms.
   Traditionally in modern computing, application software has been distributed to end-users as binary file, especially executable files. Executables only support the operating system and computer architecture that they were built for—which means that making a single cross-platform executable would be something of a massive task, and is generally replaced by offering a selection of executables for the platforms supported.
   Section::::Methods.:Alternative operating systems.
  
  Beyond gaming, a modded Xbox can be used as a media center with XBMC4Xbox.
  
  There are also distributions of Linux developed specifically for the Xbox, including those based on Gentoo, Debian, Damn Small Linux and .
  
  List of alternative operating systems:
  
  BULLET::::- Xbox Linux is a project that ported Linux to the Xbox.
  
  BULLET::::- FreeBSD and NetBSD have also been ported to Xbox.
  
  BULLET::::- Windows CE
  
  BULLET::::- ReactOS
   Software developers often claim that the software they write is "portable", meaning that little effort is needed to adapt it to a new environment. The amount of effort actually needed depends on several factors, including the extent to which the original environment (the "source platform") differs from the new environment (the "target platform"), the experience of the original authors in knowing which programming language constructs and third party library calls are unlikely to be portable, and the amount of effort invested by the original authors in only using portable constructs (platform specific constructs often provide a cheaper solution).
  
  Section::::History.
   The Windows port was based on the Sega 32X version, and was made using Kinesoft's Exodus game technology, which was later used to make the Windows port of "Earthworm Jim: Special Edition". It includes 256-colour art, in-game CD music and effects by SOUNDELUX Media Labs. SoftKey version includes America Online free trial software for Windows 3.1/95, Internet Explorer 3.02, Cyber Patrol demo for Windows 3.1/95.
   Section::::Xbox development environment.
  
  The Xbox BIOS is based on Win32, but does not have all of the resources or capabilities of the Windows NT operating system, (for example: neither DirectShow, registry, or DLL are natively supported on the Xbox). Because of the constraints on the hardware and environment of the Xbox, all software development for the Xbox (and all video game consoles systems in general) are focused on reserving the limited resources that exist, the main limitation of which is the amount of available RAM.
  
  Section::::Xbox development environment.:Compiling games and applications for the Xbox.
   Games written in TADS are compiled to a platform-independent format that can be played on any computer for which a suitable virtual machine (VM) exists. Such virtual machines exist for several platforms, and in this respect, TADS closely follows the example of the original Infocom Z-machine, as well as modern languages such as Java and C#.
   Section::::Development tools.:Free Pascal and Lazarus.
  
  Free Pascal introduced the Windows CE port in Version 2.2.0, targeting ARM and x86 architectures. Later, the Windows CE header files were translated for use with Lazarus, a rapid application development (RAD) software package based on Free Pascal. Windows CE apps are designed and coded in the Lazarus integrated development environment (IDE) and compiled with an appropriate cross compiler.
  
  Section::::Development tools.:Platform Builder.
   BULLET::::- Bootstrapping to a new platform. When developing software for a new platform, or the emulator of a future platform, one uses a cross compiler to compile necessary tools such as the operating system and a native compiler.
  
  BULLET::::- Compiling native code for emulators for older now-obsolete platforms like the Commodore 64 or Apple II by enthusiasts who use cross compilers that run on a current platform (such as Aztec C's MS-DOS 6502 cross compilers running under Windows XP).
   Indie Games were created and added to the Xbox Live service by a four-step process:
  
  BULLET::::- Create – Games are written in C# or Visual Basic .NET using the XNA Game Studio framework, allowing the developers to debug and test their game internally before release. The final code is compiled into a single binary package.
  