Porting FAQ

This is a forum for discussing the feasibility of getting emulators, games, or other applications that have had their source released ported to the Dreamcast. Please read the Porting FAQ before starting a topic in this forum!
Post Reply
Dr Zoidberg
The Filth
The Filth
Posts: 1181
Joined: Wed Oct 17, 2001 7:44 pm
Has liked: 0
Been liked: 0

Porting FAQ

Post by Dr Zoidberg » Thu Mar 07, 2002 8:21 am

Schnapple's Porting FAQ

1. If the SOURCE CODE for "X" is unavailable, then porting it is impossible. Source code is the code of the program that the author(s) wrote in order to make the program you're referring to. In some cases the source code for something is available, in most cases it's not. A project like Nester, the NES emulator, is open source so the source code is available, which is why there is a port of it called NesterDC. id Software releases the source code for their games when the game is old enough, so that's why there are DC ports of Doom, Quake and Wolfenstein 3-D available.

Myth #1: If something was written for Windows then it will automatically run on the DC, because the DC runs Windows.

False. One of the things that existed for DC developers was a port of Windows CE, a scaled down version of Windows for other platforms. The idea was that developers could develop for Win32 with DirectX and port their titles to the Dreamcast with a minimum of headache. In return for this, Sega put a WindowsCE logo on the Dreamcast. However, the port of WindowsCE is held on the GD-ROM of the product, it's not part of the Dreamcast itself. In addition, a Win32/DirectX program must be specifically compiled for the DC version of Windows CE in order to work this way. It's true that it is possible to get a pirated version of the Windows CE SDK for the Dreamcast, but the general consesnus is that anything developed for the Dreamcast in this way by anyone who is an unlicensed developer is illegal.

Myth #2: A program written for Windows CE (i,e, a PocketPC program) will automatically run on the DC because the DC runs CE.

False. In addition to having to be compiled for Windows CE, a program has to be compiled for the specific chip, and a PDA runs a different chip than the DC. Not to mention realistic concerns like input, display, etc.

Myth #3: The source code for Quake 3, No One Lives Forever, Deus Ex, etc. has been released, so someone should port it

False. There is "game source" and then there is the "engine source". In the case of Quake, the game source was released in 1996, the engine source was released in 1999 or so. Quake 3's game source was released in 1999, the engine source will probably be released in the next few years.

2. Even if the source code has been released, real world concerns may make porting it impossible. If it was written in something proprietatry, like Visual Basic or Delphi, forget it. If it was written in assembly, it's not portable since assembly isn't portable (so forget about ZSNES). Also, the Dreamcast just isn't fast enough in some cases - DreamSNES is a direct port of SNES9X, which is written in C. Portions of it are being rewritten in assembly, since C isn't fast enough. Finally, realize that the DC has 16MB of RAM, so any ROM images must fit in the space left over by the emulator program. ROM images contain programs designed to think in terms of instant availaility of resources, not in terms of load times from CD's, so a small ROM image will work fine but forget about Metal Slug 3.

3. Please don't request/demand "X" to be ported. The developers on this forum do this in their spare time as a favor. Demanding something to be ported or saying someone is stupid for not being able to get something to work or work fast enough is just a good way to get banned.

Dreamcast Porting FAQ

q1 What is "porting"?
q2 How do I make a port?
q3 Will someone port <x>?

q4 What's so hard about writing an emulator?
q5 What systems can be emulated on the Dreamcast?
q6 What is an instruction set?
q7 What is assembly language?
q8 Why is it so hard to emulate an instruction set?
q9 This system has the same processor as <x>. It should be simple to implement, why hasn't someone?
q10 Why is sound so hard to emulate?

q11 What does static recompilation mean?
q12 What does dynamic recompilation mean?

Dreamcast Technical details
q13 What kind of processor is in the Dreamcast?
q14 How much RAM?

q15 What systems have been emulated so far?
q16 Can the Nintendo 64 be emulated (on the DC?)
q17 But what if you "stream" the ROMs off CD?
q18 Ok, what about breaking the ROMs into chunks that fit in the RAM?
q19 How about a cartridge adapter?
q20 How about the Sony Playstation?
q21 If Bleem! enhances games, why don't all the other emulators?

Frequently requests
q22 What about NeoGeo?
q23 NeoGeo CD?
q24 Gameboy Advance?
q25 TurboGrafx 16?
q26 Playstation 2? GameCube? Xbox?
q27 What about (insert system here?)
q28 What games have been ported?
q29 Anything else ported?
q30 Microsoft released the source for Windows CE 3.0...?

DirtySanchez's Porting FAQ


Q1 What is "porting"?
Porting is the process of making a program run on a different platform than it was originally intended. This is done by modifying the source of the program.

Q2 How do I make a port?
First, you need an in depth knowledge of programming. Newbies need not apply. You then need at least some familiarity with the system it runs on and the system you want to run it on (read: the Dreamcast.) Finally, and most importantly, you *NEED* source code. Read the definition of porting again (Q1) if you don't get this. Please note, this means that there is no hope of something being ported without the source code. If you don't have the source code, don't try.

Q3 Will someone port <x>?
A3. Ah, the Dreaded Porting Request. You think it would be awesome to do <x> on your Dreamcast. Guess what, you're probably right. However, if you can't do it yourself, you need to know the following... First off, please realize that the people who port software for the Dreamcast do so for several reasons. However, they do *not* get paid to port software. If they decide to make a port, it is because they wish to, *not* because someone wants (read: expects) it. Make sure that if you ask about a port, that you provide at least the following:

1) Source Code - Read What is "porting"? again....
2) As much reference material as you can find - Web sites, text files, original binaries, etc. You may not be able to code, but you can at least provide as much information as you can.
3) Willingness to beta test - This means real testing. Does <x> work in this case? What if you press this combination? Does my VMU survive? You must also provide solid, realistic feedback. For example, "This new version is much improved! I really like the way you implemented <x>. However, the control scheme seems a little off, especially when I press this key. Perhaps adding an option to change will make this a little more friendly. Once again, thanks for the work so far!" Note this is in stark comparison to "Why doesn't it run at full speed yet?" This leads us to #4...
4) Be supportive! - If someone is actually porting something, help as much as you can. This means providing info (ie, #2) or testing (#3). It does not mean more feature requests. If nothing else, write documentation on how to use the software, how to burn it, etc.
5) Realistic Expectations - Do *NOT* expect full feature full speed (or worse enhanced speed enhanced features) overnight, if ever. Programmers are talented, but no programmer ever knows everything needed to complete a significant project.
6) Source Code - If you can't provide anything else, once again, you must at least provide source code.


Q4 What's so hard about writing an emulator?
If you're asking this question, you obviously don't know anything about emulation. Emulation is the process of making one system behave like another. This is true of N64 running on computer, SMS on DC, x86 on PowerPC, etc, etc. There are so many underlying aspects that you have to fully understand both the emulated and emulating system. If you don't, there's very little hope. More technical issues are listed below.

Q5 What systems can be emulated on the Dreamcast?
A5. Short answer, any system can be emulated to some extent given enough time and resources. Long answer, a system can be emulated, but that does not mean full speed, full power, etc. For example, if a system has more buttons on its controller than the DC, you can't fully emulate all the buttons!... The more power a system has, the more difficult it will be to port. This does not mean that all old systems are simple to port. Actually, in no case is it simple to port an emulator. If you haven't done it, don't comment on the ease of doing it.

Q6 What is an instruction set?
The "language" of a processor, the way you tell a processor what to do.

Q7 What is assembly language?
A human readable form of the instruction set. It's typically the fastest interface to a processor, but it is almost totally unportable (it's often easier to rewrite as opposed to port.)

Q8 Why is it so hard to emulate an instruction set?
Processors are built differently, and thus have different features. Regardless of the user's interpretation of the power of a processor, they all have different advantages/disadvantages that must be taken into account. Very (very) rarely will the instruction set of one processor coincide nicely to that of another. Think of this as translating Spanish to English. It can work in most cases, but there will always be certain phrases (instructions) that don't quite translate.

Q9 This system has the same processor as <x>. It should be simple to implement, why hasn't someone?
Ok, go back and read about how to make a porting request. If you're still asking this question, try again. Now that you are asking "Is it easier to port a system that uses the same processor?", the answer is, it depends. It's easier as the instruction set is (usually) the same, systems are way more than the CPU.

Q10 Why is sound so hard to emulate?
Once again, this tends to be the feature set/method of operation of the sound chip. The Dreamcast uses a rather peculiar setup that developers have yet to fully master. Give it time.


Q11 What does static recompilation mean?
Essentially, translate to host platform before execution. It's more complex than this, but recompilation (static or dynamic is several FAQs in itself)...

Q12 What does dynamic recompilation mean?
Again, essentially translate instructions as you're running. Each method has advantages/disadvantages that must be taken into account.

Dreamcast Technical details

Q13 What kind of processor is in the Dreamcast?
A Hitachi SH4 running at 200MHz. There is also an ARM7 chip in the sound core.

Q14 How much RAM?
16MB standard, 8MB Video, and 2MB sound.


Q15 What systems have been emulated so far?
Nintendo Entertainment System, Super Nintendo Entertainment System, Nintendo Gameboy, Sega Master System, Sega Game Gear, Sega Genesis, Atari 2600 (early stages), Colecovision, Commodore 64 (early stages), Phoenix Arcade, MSX, NeoGeo Pocket, Spectrum, Sony Playstation (Bleem! rocks...) and even MAME. This does not mean that all these ports are full speed, full featured, etc when compared to their computer counterparts. This does not lessen the accomplishment! There are two commercial emulators, Bleem! and the Sega Smash Pack.

Q16 Can the Nintendo 64 be emulated (on the DC?)
Short answer, no. Long answer, with special addon hardware and a lot of time/skill/luck, perhaps. The biggest issue is most of the roms are too large to fit in the Dreamcast's memory. There's also only a 2-1 ratio of the DC-N64 processor speed. This makes emulation pretty difficult.

Q17 But what if you "stream" the ROMs off CD?
Nice idea, but it's been thought of before. The problem with it is the massive difference in speed between CD-ROM and Cartridge systems. N64 cartridges have an access time of about 500ns (500 x 10^-9 seconds). CD-ROM systems are around 100-200ms (100 x 10^-3 seconds.) Cartridges are 1,000,000 times faster! The problem with streaming the ROM is it would be insanely difficult to figure out exactly what code/data piece would be needed next, and get it into RAM when the game wanted it. It's a nice idea, but unless you come up with code that verifies it, it's a pretty much dead end.

Q18 Ok, what about breaking the ROMs into chunks that fit in the RAM?
Again, been there... People typically come up with this idea when they see the sizes of the N64 ROM files. The files are broken up to allow quicker/more efficient downloads. Note, they must be put back together before the ROM is run! Again, if you make this work, terrific! If not, don't tell everyone this is the solution and wonder why the world is not beating a path to your door?

Q19 How about a cartridge adapter?
This looks to be the most likely way. The guys at Bleem! have mentioned this as a possible option.

Q20 How about the Sony Playstation?
There is work on the PS1, time will tell. Meanwhile, pick up a copy (or three) of Bleem! for enhanced versions of Playstation games on the Dreamcast.

Q21 If Bleem! enhances games, why don't all the other emulators?
Short answer, you're stupid, go away. Long answer, Bleem! is a commerical product written by some very talented people. Their accomplishments are to be appreciated (read: buy a copy... or three). However, you cannot expect emu authors to enhance something as well as implement it. Again, be appreciative for what you get for free.

Frequently requests

Q22 What about NeoGeo?
Similar in form to N64, most ROM files won't fit in the DC's memory. Same options apply.

Q23 NeoGeo CD?
Recently a NGCD emulator for the PC was released, which provides some hope. However, same porting rules apply...

Q24 Gameboy Advance?
Maybe... not much info yet. Rom sizes will eventually be problematic.

Q25 TurboGrafx 16?
A25. There have been reports of ports, but nothing released thus far.

Q26 Playstation 2? GameCube? Xbox?
Get some help. Don't get your hopes up... These are new, undocumented systems, if anything happens, it will not likely be on the DC...

Q27 What about (insert system here?)
You can never tell, but make sure to follow the advice in Will someone port <x>? before saying anything.

Q28 What games have been ported?
Doom is the big one, but several others are in the works...

Q29 Anything else ported?
Acutally, Linux and NetBSD....

Q30 Microsoft released the source for Windows CE 3.0...?
Stop right there... this horse has been beat to death several times over. There currently is not a use for this. If you find one, great. If not, don't spam the boards with possible uses.
Post Reply