Slashdot Mirror


Porting Games From Binary

CowboyRobot writes "My favorite Slashdot links are those that inspire me to embark on meaningless and time-consuming quests. This is one of them. Two Canadian game developers at Digital Eclipse have a thorough explanation of how to port a game using nothing but the binary stream coming out of the cartridge. They use the TRS-80 and Phantasy Star III as examples."

178 comments

  1. Emulation by DigiShaman · · Score: 0, Redundant

    It's called ROM dumps and Emulation. Nuff said.

    --
    Life is not for the lazy.
    1. Re:Emulation by segmond · · Score: 5, Informative

      RTFA, It is not Emulation, it is Translation. With Emulation you need an Emulator program on the target machine. With translation, the rom is converted to an executable that can be executed independent of any program on the target machine.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    2. Re:Emulation by Anonymous Coward · · Score: 0

      So you're saying it's the ROM image with an emulator wrapped into an executable?

  2. secrets galore.. by grub · · Score: 3, Funny

    01110100011010000110010100100000011001110110111
    1 0110000101110100011100110110010101100011011110
    00 001000000110011101110101011110010010000001101
    001 01110011001000000110110101111001001000000110
    0100 0110000101100100001011000010000001101000011
    00101 001000000110101101100101011001010111000001
    110011 00100000011011010111100100100000011010000
    1100001 0110111001100100011100110010000001110111
    01100001 011100100110110100100000011010010110111
    000100000 01110111011010010110111001110100011001
    0101110010 00101110

    01100001011100100110010101101110011101 000010000
    001111001011011110111010100100000011001 11011011
    0001100001011001000010000001111001011011 1101110
    10100100000011101000110111101101111011010 110010
    000001110100011010000110010100100000011101 00011
    0100101101101011001010010000001110100011011 1100
    10000001100100011001010110001101101111011001 000
    110010100100000011101000110100001101001011100 11
    00111111001000000011101000101001
    --
    Trolling is a art,
    1. Re:secrets galore.. by aug24 · · Score: 1

      You missed the dot out of goatse.cx ;-)

      --
      You're only jealous cos the little penguins are talking to me.
    2. Re:secrets galore.. by Anonymous Coward · · Score: 0

      01001000011011010110110101101101011011010110110100 10111000101110001011100111010001101000011010010111 00110010000001100001011011000110110000100000011100 11011001010110010101101101011100110010000001100001 00100000011000100110100101110100001000000111001101 10000101100100001000000110000101101110011001000010 00000110110001101001011001100110010101101100011001 01011100110111001100100000011101000110111100100000 01101101011001010010000100100001001000000110110001 10111101101100

    3. Re:secrets galore.. by RobertB-DC · · Score: 2, Informative

      That was an interesting post... you just overquoted the parent. In binary. Actually, that *is* an interesting twist!

      This binary converter may be useful for those not "in" on the joke.

      --
      Stressed? Me? Of course not. Stress is what a rubber band feels before it breaks, silly.
  3. All my games are so old... by SmirkingRevenge · · Score: 5, Funny

    They're in unary, you insensitive clod!

    1. Re:All my games are so old... by Wolfrider · · Score: 1

      "One, is the loneliest number that you ever knew..." == Three Dog Night

      http://www.threedognight.com/lyrics/One.html

      --
      .
      == WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
  4. Why Phantasy Star III? by Anonymous Coward · · Score: 0, Funny

    It was the worst of the series.

    1. Re:Why Phantasy Star III? by inteller · · Score: 2, Informative

      i think the point is maybe if they port it they can modify it and make it better? At any rate PS III reminds me of the precursor to PSO.

    2. Re:Why Phantasy Star III? by Anonymous Coward · · Score: 0

      There was enough wrong with PSII they could fix. Heck, if that were the point, why not take a game that's almost good but just has minor problems, and do it with that.

      I think the point is PSIII sucks.

    3. Re:Why Phantasy Star III? by Vaevictis666 · · Score: 3, Informative

      Because it's one they actually did. Phantasy Star 1, 2, and 3 got ported over to the GBA as a Phantasy Star Collection.

    4. Re:Why Phantasy Star III? by Anonymous Coward · · Score: 1, Interesting

      This should be modded WAY up. People are really missing the point of this article. It's not useless, they actually got paid to do this!

      Those games run fabulously and flawlessly on the GBA. They really do look and act like the originals.

  5. Re:You should talk to the guys at MAME by Trigun · · Score: 0, Redundant

    whoops, they're talking about removing the emulation layer. Mod me down, -1 dumbass.

  6. other uses by Tactical+Skyrider · · Score: 0

    there goes that whole thing nintendo's trying to do in china...

    --
    In Soviet Redmond, software programs you!
  7. When Bad means Good by WebfishUK · · Score: 5, Insightful



    It's this kind of pointless endeavour that gives geeks a bad name.

    It's this kind of pointless endeavour that makes me happy to be a geek.

    Some people climb mountains, other disassemble 8085 binary code.

    --
    -- "Can't sleep, clowns will eat me!"
    1. Re:When Bad means Good by Suidae · · Score: 1

      Acutally, if you'd read the article, at the end it says:

      In this case, we had access to relatively accurate source code

      Sounds like the only disassembly they had to deal with was in the few bits that were different in the shipped version.

    2. Re:When Bad means Good by dknj · · Score: 4, Informative

      Then check out digger. Originally written in 1984 by a now defunct game company, this guy disassembled the game and rewrote it. I can't find any differences in the game play (I played it all the time as a kid on my 8088 *memories*). The person who rewrote the game tried to find the original writers of the game but came up with nothing.

      He motivated me to rewrite another one of my old favorite games, Pango... though I haven't got very far

      -dk

    3. Re:When Bad means Good by Suidae · · Score: 1

      pango.. is that the one where you run around kicking hexagonal blocks around to squish bees and form rows?

    4. Re:When Bad means Good by dknj · · Score: 1

      yes :-)

      -dk

    5. Re:When Bad means Good by Chromal · · Score: 1

      Er.. Why is writing an emulator a pointless geek endeavour? This claim suggests you either don't fully understand what emulation is and does, or you don't think that preserving human culture is important. After all, why should we waste our time collecting books in libraries, artifacts and cultural works in museums, and plants in arboretums? Why do we waste our time learning from our prior experiences in schools and universities? Why do we attempt to preserve the knowledge of ancient music, instruments, and how to perform same?

      Emulation taps into the same set of goals as all these activities: making human creation accumulative rather than transitory. It's about grasping for a kind of immortality. Sheesh. And you presume to call them geeks.

    6. Re:When Bad means Good by WebfishUK · · Score: 1

      ermmm.. it was a joke. Lighten up.

      --
      -- "Can't sleep, clowns will eat me!"
    7. Re:When Bad means Good by Chromal · · Score: 1

      LOL. Apparently I mis-read the second line. Wow, open mouth, insert foot.

    8. Re:When Bad means Good by Anonymous Coward · · Score: 0

      Check out the Bruce Lee (C64) remake also. .. perfect.

      www.remakes.org also for links to other ones, though most of them are duff.

    9. Re:When Bad means Good by Jmstuckman · · Score: 1

      Pango... heehee, I used to play the DOS version on my 286 with CGA. Good game!

    10. Re:When Bad means Good by Suidae · · Score: 1

      Thanks, I'd forgotten all about this great game.

  8. Fatal by Anonymous Coward · · Score: 0
    Fatal error: Call to undefined function: message_die() in db/db.php on line 88

    oops

    1. Re:Fatal by nick-less · · Score: 1

      Fatal error: Call to undefined function: message_die() in db/db.php on line 88

      looks like the server never died before ... until today...

    2. Re:Fatal by tds67 · · Score: 1
      Fatal error: Call to undefined function: message_die() in db/db.php on line 88

      The message I got was:

      Slashdot geek error: Call to overworked function: website_die() in db/db.php on line 88

      I'm not sure what this is in binary.

  9. link to the printer-friendly version by mblase · · Score: 5, Informative

    printer-friendly, one page, no ads.

    1. Re:link to the printer-friendly version by Anonymous Coward · · Score: 0

      Since the site is now Slashdotted, here is the first page (minus figure 1 graphic):

      No Source Code? No Problem!

      ACM Queue vol. 1, no. 6 - September 2003
      by Peter Phillips and George Phillips, Digital Eclipse
      printer-friendly format

      sections in this article
      1: Bridging the Gap
      2: Emulation Carries a Cost
      3: Translating Binary into Source Code
      4: Target Translation Languages
      5: Looking to the Future of Binary Translations
      6: The TRS-80: A Simple Emulator
      7: Phantasy Star III

      What if you have to port a program, but all you have is a binary?
      Bridging the Gap

      Typical software development involves one of two processes: the creation of new software to fit particular requirements or the modification (maintenance) of old software to fix problems or fit new requirements. These transformations happen at the source-code level. But what if the problem is not the maintenance of old software but the need to create a functional duplicate of the original? And what if the source code is no longer available?

      This exact problem arises when trying to reproduce the original play of old arcade games on modern devices. The game play is so well known that anything short of the original is unacceptable. Often the source code is available, but it may be incomplete and may not cover all of the patches that were added to later production models. In addition, it is too expensive to provide copies of the original hardware.

      Providing faithful emulations of video games (and old home computers) is our primary experience with this process. But the same techniques can be applied to other areas. Aging hardware and software can be replaced by new hardware with a completely compatible program.
      BRIDGING THE GAP

      The general problem can be expressed as "bridging the semantic gap." You must create a program that precisely maps the meaning of the original program onto a host system. Primarily this means an interpreter of some kind for the target processor's instruction set, but one must also deal with I/O (input/output) devices. Such an interpreter is known as an emulator. (See "The TRS-80: A Simple Emulator" on page 54 of this article.) If the program is automatically converted to a different language, it is called a translation.

      Why are we tackling the problem at such a low level? Mainly to achieve the highest fidelity possible to the original. Emulation is about mapping semantics. The semantics of hardware are usually well documented either by circuit diagrams or chip-specification documents. Internal layers inside software are usually designed to much looser standards, so it is unlikely that specification documents--if they exist--completely describe the behavior. In fact, the software itself is the most authoritative description available. It is true that chip specifications are not always complete or accurate, but chips are reused and over time the deviations become widely known.

      The semantic gap between the target and host systems is not purely an abstraction. It can be quantified as follows: G = number of host instructions to emulate one target instruction. Given G and some idea of the relative speeds of the host and target system, you can quickly decide if emulation is feasible. The problem here is that the value of G is a function of an actual emulator. A rule of thumb is that G is at least 10, but practically speaking, 10 is lower-bound for systems that are quite similar. Although time is usually the overriding concern, there is an analogue for a semantic gap in terms of storage space.

      Figure 1

      Emulation and translation start with the same inputs (the ROM data and the hardware documentation) and produce the same result: a copy of the original running on a PC. The difference comes in how the ROM data is handled. For the emulator, it is simply a parameter to the program. For the translated version, the ROM is converted and compiled into the executable.

      The semantic space gap is the ratio of the size of the host p

  10. Is that porting? by Kjella · · Score: 0, Redundant

    Sounds a lot more like emulating to me. Run the binary stream on a virtual machine that works like the old device...

    Kjella

    --
    Live today, because you never know what tomorrow brings
    1. Re:Is that porting? by Anonymous Coward · · Score: 0

      Thus proving you didn't even read the article.

    2. Re:Is that porting? by kalidasa · · Score: 2, Informative

      It is emulating, as they themselves say:

      Providing faithful emulations of video games (and old home computers) is our primary experience with this process. But the same techniques can be applied to other areas. Aging hardware and software can be replaced by new hardware with a completely compatible program.

    3. Re:Is that porting? by Gibble · · Score: 1

      Why would people mod this informative?

      The article clearly shows that it does not run on a virtual machine.

      The binary is converted to asm. Then the asm is converted to C with C assembly calls, then compiled into an EXE to be run at any time without a virtual machine.

      --
      Gibble: Descriptive of an emotional state in which one's mind is scrabbling for some purchase on reality
    4. Re:Is that porting? by Anonymous Coward · · Score: 0

      Please be kind. There is no article to read, the article having been slashdotted into oblivion.

    5. Re:Is that porting? by Anonymous Coward · · Score: 0

      See this version then
      http://www.acmqueue.com/modules.php?name=Con tent&p a=printer_friendly&pid=68

    6. Re:Is that porting? by Anonymous Coward · · Score: 0

      Clearly you haven't read the article either.

    7. Re:Is that porting? by fehlschlag · · Score: 1

      I think the problem in understanding if it is emulation or not is definition.

      My usual understanding of emulation is an executional one, i.e. the old app runs within a simulated environment. However, the devleopers here are using macros to emulate the older hardware. This is an overload of the term "emulate". They are emulating at a source level, whereas the final compiled program is not an emulation by my original understanding.

  11. Badly researched? by FyRE666 · · Score: 5, Insightful

    Unless I'm missing something, this novel idea is complete garbage. Yes, sure you can disassemble the machine code, produce some C code from that and then recompile for a new target CPU but it's not going to work for the vast majority of applications.

    The reason: hardware.

    Even your average 80's arcade machine relies upon custom hardware for virtually everything. The main program spends most of its time simply adjusting registers to control sprites etc, and reading from hardware to detect collisions and so on. This new code you've generated for a new CPU will still expect the same supporting hardware...

    1. Re:Badly researched? by Zan+Zu+from+Eridu · · Score: 3, Insightful

      If you rebuild an executable for system X from a binary dump for system Y, you don't just disassemble it, but you put in macro's for all of the opcodes for system Y. These macro's are the glue that emulate parts of Y's hardware on system X.

      It's comparable to the difference between an interpreted language and a compiled language. An emulator is a virtual machine that interprets opcodes for machine Y and translates them to instructions for machine X on the fly; this solution compiles the tanslations into an executable for machine X once.

    2. Re:Badly researched? by RevAaron · · Score: 1

      Yes, sure you can disassemble the machine code, produce some C code from that and then recompile for a new target CPU but it's not going to work for the vast majority of applications.

      Decompiling to C must have changed quite a bit since I last tried it, around 10 years ago. If not, it seems like you'd run into nothing *but* problems with platform-specificity.

      That is, the only C decompilers I've tried did in fact take a binary and output C- however, the C was just a bunch of inline assembly statements and the like. A cruel joke for a younger nerd wondering how the programs he used worked. :P I suppose you could still call functions out of it perhaps, but it wasn't that useful beyond that, not from the standpoint of understanding- at least no more than just looking at it through a disassembler.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    3. Re:Badly researched? by Thing+1 · · Score: 1
      tanslations

      These are op-codes that, when rearranged, make pretty pictures?

      --
      I feel fantastic, and I'm still alive.
    4. Re:Badly researched? by ivan256 · · Score: 4, Insightful

      If you rebuild an executable for system X from a binary dump for system Y, you don't just disassemble it, but you put in macro's for all of the opcodes for system Y. These macro's are the glue that emulate parts of Y's hardware on system X.

      That's a dubious claim at best. A rom image is likely to contain device driver calls that set register bits that have no equivalent on other hardware. In order to produce a single device operation, a series of opcodes is likely to be required that is guaranteed not to appear in the same order on all software for the platform, and may not even have an analog on the new platform. That means at the very least you have tailor your macros for every image, if not for sections of an image. In the worst (and most likely) case, procedures and algorithims comprised of hundreds of opcodes and used to manipulate hardware on the original system would be completely invalid on the target, and would have to be implemented completely differently. That's the same thing as porting the software, but with some extra steps added.

      Their example in the article is perfect to illustrate this. After they converted the FM synth codes to sampled PCM data, do you really think the sound code from the original ROM came even remotely close to working? I call bullshit.

      Furthermore, there is no evidence in the article that this project was actually attempted, much less completed. Even if it was, I would bet significant sums of money that their tools wouldn't work to translate other games from Genesis to Gameboy without as much work as went into the tools in the first place. If their techniques ever were to work, it's likely that it would only be while translating between two extremely similar systems. Did anybody with a clue at the ACM read this article before posting it?

    5. Re:Badly researched? by Anonymous Coward · · Score: 0

      > Unless I'm missing something, this novel idea is complete garbage.

      Well, go to your nearest EB and buy the Phantasy Star Collection. It's not garbage. Not only did they do it, but they got paid to do it.

    6. Re:Badly researched? by Lodragandraoidh · · Score: 1

      A computer can be thought of as a series of 'boxes within a box'. By that, I mean from the Von Neuman machine running the assembly language instructions, all the way up to the operating system and applications running on it are all just virualizations - emulators of something more complex sitting on top of something simple.

      At the lowest level is the microcode program that is hardcoded into the cpu itself. So, the 'CPU' instructions, as we think of them in an assembly program binary, are really virtualized by the microcode.

      Given that, the idea of disassembling a binary and recompiling it in a more open higher level language is not 'complete garbage'. With an understanding of the hardware that the binary was writen for, the opcodes and registers not avialable can be emulated with ease (or if not easily, at least completely given enough time). You would write a disassembler/recompiler that takes this into account, and creates the right compiler instructions to emulate what the assembly instructions were trying to accomplish via modern graphics libraries that are hardware independent (openGL anyone?). At that point you would be able to distribute the application and compile it across multiple platforms.

      While not easy, it is certainly interesting and useful (once you build the initial disassembler, all binaries for that architecture will be able to be disassembled by it - assuming you have a complete instruction set list). Definitely not 'garbage'.

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
    7. Re:Badly researched? by veritron · · Score: 1

      Uhh, speaking as someone who owns the said version of Phantasy Star III on the Gameboy Advance, I think you're a little off-base. Remember, all custom chips have reliable inputs and outputs, so if you're switching a program over to a system lacking a specific custom chip, it's not very hard to find something with equivalent functionality on the current system or to just hack through it with software. There really isn't a line drawn in the sand between translation and emulation - I'd say that translation's essentially an emulator optimized specifically to play one game correctly, to hell with the rest. Like Final Fantasy Chronicals - hell, FFC has a real, working Japanese ROM of Chrono Trigger on the CD that works perfectly in emu. I'd say it was attempted, and completed rather successfully to boot - although the sound quality was noticably degraded... I imagine that code was probably ripped out and redone. But the game plays just fine if you're "in" to that kind of thing.

    8. Re:Badly researched? by ivan256 · · Score: 1

      Uhh, speaking as someone who owns the said version of Phantasy Star III on the Gameboy Advance

      I didn't know that owning a video game cartridge implied any knowledge of how it was created. You have no idea if the methods described in this article were used in the creation of the GBA version of the game. I'm willing to bet that if these methods were used, they were only used on a limited number of code sections, labor intesive, and not directly reusable.

      it's not very hard to find something with equivalent functionality on the current system

      Equivalent functionality doesn't neciscarily have equivalent interfaces. Different interfaces require different code. Different code isn't a translation in the sense this article describes.

      or to just hack through it with software.

      Again, you're now writing new code instead of translating. The difference is the automation.

      I'd say that translation's essentially an emulator optimized specifically to play one game correctly, to hell with the rest.

      Hmm, change all the definitions to fit your point. I'll have to try that debate tactic in the future.

    9. Re:Badly researched? by prash_n_rao · · Score: 1

      it is still just a turing machine... one set of inputs+known state=one output only

      Am I missing something? The software will still give it the same appearance, right?

      --
      This is not my sig.
    10. Re:Badly researched? by Anonymous Coward · · Score: 0

      Digital Eclipse has been doing translation and emulation for years(Midway's Arcade Classics, circa 1996 for instance). I think they know what they are talking about. The Phantasy Star III example would work. The innards of the Sega Genesis are well documented, so instructions sent via the CPU to the audio/gfx hardware would be recognised by their translator software and converted into proper code for said chips(or translated into proper code for the GBA's equivilent of those chips). The problem arose because there was no easy way to convert the Genesis's FM hardware into a format compatable with the GBA's audio without resorting to realtime emulation, which, with the GBA's slow cpu would have been problematic, so they used samples instead.

      It's similar to some of the 'recompiled' MSX games into DOS exe's that showed up in the mid 90's(at least I think it was some old MSX games, memory is a bit fuzzy)

    11. Re:Badly researched? by JDWTopGuy · · Score: 1

      Another interesting thing to take into account is that back then there was probably more hand-optimized code (as opposed to compiler-optimized). I don't know how this would affect things, but I imagine it would. Probably hand-optimized code would be less predictable.

      As a side note, I love one-line loops. :-D

      --
      Ron Paul 2012
    12. Re:Badly researched? by Anonymous Coward · · Score: 2, Informative
      The article is a load of rot. Externalising everything outside the basic flow control program and saying "here be I/O" is an utterly useless approach. Most games machines run as several programs on custom _processors_, tied together as a full system.

      Remember, all custom chips have reliable inputs and outputs


      Are you kidding? We're not talking about LEGO toys like the IBM PC or Tandy. Machines like the C64 and Amiga have autonomous, cycle-exact digital/analog hybrid custom chips which all have control over each other and can perturb or feed each other.

      I have anti-debugging code on the Amiga that starts a blit (block image transfer -- copy with automatic shifting and minterm logic) to perturb some code while it's executing. While the blit takes place, the high-precision timer in the CIA-B chip triggers a level 6 68000 interrupt which changes the parameters of the blit as the blit is in progress. The exact memory locations changed by the blit are affected acutely by the number of cycles the 68000 spends on each instruction. Even the slightest inaccuracy in emulated (or real) execution time will corrupt the blit's effect.

      This cannot be transliterated as a single stream of C code. It relies on cycle matching of discrete systems working in parallel. It can only be executed through a state machine that would effectively emulate the full function of all these devices.

      More importantly, this is not what needs to be done. In copying full systems (and not just programs with very simple I/O that can easily be replicated), human ingenuity is necessary. One large system simply can't do the same as another entirely different system without heavy hardware or software changes. In many cases, when a downward step in hardware is made, functional equivalence is impossible. It's like saying "display a 256 colour image on a 4 colour display". All you can do is make a 4 colour image that looks like the 256 colour image.

      As seen in so many arcade game ports to the Amiga/Atari/PC home systems, a home computer can't hold 16Mb game ROMs, everything needs to fit on a 800-1400Kb disk. Imagine converting a 1990 arcade game to the home systems. An Amiga circa 1990 has custom blit hardware (so it can have quite large sprites/bobs) and free raster effects, but only 32 colours. The graphics must be redrawn, the 256 colour originals can't be used directly. A PC circa 1990 has 256 colours, but no sampled sound output and has to use a slow CPU for blitting. An Atari has neither 256 colours nor custom hardware.

      In many cases (for example, the Gameboy Advance conversion of popular PSX/PS2/N64/GC games), a completely different game is used instead, only keeping the basic concepts of gameplay and the characters and storyline.

    13. Re:Badly researched? by Max+Webster · · Score: 1

      Once I understood your logic, MAME suddenly stopped working!

    14. Re:Badly researched? by inertia187 · · Score: 1

      Sounds an aweful lot like emulation to me. I mean, otherwise, ther's an aweful lot of opcode being releated over and over (hence the macros), that the result might be many many times bigger than the original.

      More Bad Research

      --
      A programmer is a machine for converting coffee into code.
    15. Re:Badly researched? by ivan256 · · Score: 1

      Perhaps you should explain my logic to me then, because clearly I don't understand myself the way you do. How does anything I said have anything at all to do with an emulator?

    16. Re:Badly researched? by Max+Webster · · Score: 1
      A rom image is likely to contain device driver calls that set register bits that have no equivalent on other hardware.

      If there's no equivalent at all on the other hardware, of course direct translation falls down. But so would emulation. So would porting. Kind of a moot point. I didn't see that the article was saying otherwise. They were up front about shortcomings with, for example, self-modifying code.

      My point was that in cases where emulation was possible, then translation would be too. If an emulator could parse the next opcode and issue a sequence of calls like

      store value to address
      check if this is special memory-mapped register
      if so, call appropriate graphics/sound/etc. routine

      then a translator could produce #defines or whatever to do the same set of steps, saving the parsing overhead. So if MAME on a PC can emulate the sounds, sprites, etc. of an old arcade game with a Z80 chip, presumably translation would be possible too.

    17. Re:Badly researched? by ivan256 · · Score: 1

      If there's no equivalent at all on the other hardware, of course direct translation falls down. But so would emulation.

      This is where you're wrong. It's entirely possible for an operation to be necissary on the target platform that is unnecissary on the source platform. No amount of translation will get you around that. I also continue to stand by my PCM/FM sound argument. If the code does something completely different, that's hardly translation.

    18. Re:Badly researched? by Hognoxious · · Score: 1
      Unless I'm missing something
      Yup. I think you are.
      Even your average 80's arcade machine relies upon custom hardware for virtually everything. [...] This new code you've generated for a new CPU will still expect the same supporting hardware...
      You emulate the custom hardware with software. Which is not a problem with modern processor running something originally made for a Z80 or whatever; it's sitting around waiting most of the time anyway.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    19. Re:Badly researched? by drinkypoo · · Score: 1

      It's not completely different. It's just done in software instead of hardware. Or more to the point, different portions of it are done in software, since actual audio output is still done by the hardware; composition of the audio data is done by software in the translated case.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  12. Suboptimal resource use by AllUsernamesAreGone · · Score: 4, Interesting

    One problem that I don't see addressed in the article is the different approaches games use today compared with those on old hardware. For example, on machines where the disparity between CPU and memory speed was not as great as it is today, it was common practice to precalculate many maths-intensive operations into lookup tables (usually in the form of sin tables, cos tables and so on). On a modern processor this level of precalculation can result in slower execution than just working out the maths on the fly, so most games do minimal precalculation of things like maths functions. While it's often the case that speed is not really an issue with old game ports, it would be interesting to see how they would approach the problem of porting and ensuring that the resulting game makes optimal use of the target machine.

    1. Re:Suboptimal resource use by Anonymous Coward · · Score: 0
      So what? Both memory and processor will probably be running around one hundred times more quickly anyway. Is decompiling ancient video games not geeky enough already without insisting on an *optimal solution*?

    2. Re:Suboptimal resource use by jandrese · · Score: 1

      On the other hand, when the original machine was based on a Z-80, and you're translating it to run on an AthlonXP 3000, perhaps speed won't be an issue? I'd be more worried about clever programmers actually using some of the unintended (undocumented) side effects in the hardware.

      --

      I read the internet for the articles.
    3. Re:Suboptimal resource use by Sandor+at+the+Zoo · · Score: 1
      On a modern processor this level of precalculation can result in slower execution than just working out the maths on the fly

      I doubt that. Precalculating a table of cosine values isn't going to take an appreciable amount of time on modern hardware, and you can be sure that lookups are going to be much faster than calling any actual math routine, even on modern hardware.

      Also, think about this: if the tables are built into the application, and if you replaced the lookups with calls to actual cosine routines, you run the risk of getting more bits of precision, or possibly even different answers within the precision of the tables. That could alter the gameplay or have other odd effects.

      Most of the low-level game hacking I have experience with was on the TRS-80, in which there were no high-level math calls, so if you wanted cosine tables, you generated them with a calculator and wrote them into the application.

      Oddly enough, many of the lessons I learned back then programming assembly language have served me well doing C++. In tight loops that matter performance-wise, never use multiplication or division (or mod) if you can get away with addition. Don't use multiple pointer dereferences in loops -- cache pointers. Don't put assignments in loops that can be done outside. Etc.

    4. Re:Suboptimal resource use by iocat · · Score: 1

      When trying to emulate a classic game, the goal is to emulate everything -- even the bugs, even the inefficient ways it may have done things. So, there may not be an attempt made to optimize the game for modern hardware at all. Just duplicate the inefficient functions of the original to ensure that the final product is as close to the original as possible.

      --

      Dude, I think I can see my house from here.

    5. Re:Suboptimal resource use by AllUsernamesAreGone · · Score: 1

      You're overlooking a big bottleneck: memory access. If you precalculate your tables, they have to go into main memory, some time later you use part of a table so in needs to get into cache. If the table is big enough, the prefetch didn't get enough of it or your program does a lot of other work, you'll be constantly fetching in and out of main memory. This takes massive amounts of time compared to actually working it out on the fly unless you can be 100% certain your tables will be in cache all the time (which most of the time you can't).

    6. Re:Suboptimal resource use by AuMatar · · Score: 1

      Three flaws with this theory.

      1)Old machines had MUCH less memeory than we do now. So they had lookup tables, but those lookup tables were not huge. Rarely more than 1-300 entries.

      2)Old machines had much slower memory buses. Even emulating a pentium 1, they had 66 MHz buses. Nowdays, 300 MHZ buses are common. This extra speed makes up for any loss due to cache coherency problems.

      3)Cache coherency problems only occur on loaded systems. Frequently, that won't be the case.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    7. Re:Suboptimal resource use by _avs_007 · · Score: 1

      Yeah, when we port PONG over, we need to make sure it takes full advantage of SSE, SSE2, and MMX, otherwise game play would be horrible :)

  13. It can be useful sometimes by Anonymous Coward · · Score: 5, Interesting

    In our lab we sometimes have to reverse-engineer components for which we no longer have documentation. It would be very simple to export the data of a video game cartridge by accessing its ROM module with a binary card reader. The trickier part is to get the offset right so that any fluctuations will be evened out on the oscilator. One could then re-compile the imported code into a new platform similar to what the folks at MAME do.

    What we've done is imported "Yars' Revenge" from the Atari 2600 did some elevation emulation, ported the code, and re-compiled to make it work on the Intellivision. We may be selling that cartridge commercially as there is a great need for 8-bit cartridges.

    Which is nice.

    1. Re:It can be useful sometimes by Anonymous Coward · · Score: 0

      What fucking idiot modded this dreck as "Interesting" ?

      See some buzzwords you don't understand so it must be "Interesting" ?

    2. Re:It can be useful sometimes by LucVdB · · Score: 1

      Elevation emulation might work - if you're lucky. In my experience a process called 'shaving the ROM' leads to more consistent results, especially vis-a-vis surface mounted components. Look it up on Google.

      Or not.

    3. Re:It can be useful sometimes by whereiswaldo · · Score: 1

      Anything like these?

      games 1

      games 2

    4. Re:It can be useful sometimes by Anonymous Coward · · Score: 0


      Almost forgot this one...

      games 3

    5. Re:It can be useful sometimes by Anonymous Coward · · Score: 0

      Forget "Yar's Revenge". Bring me "Custer's Revenge"!

      8-bit porn: that's where the money is at.

  14. RTA: They're -translating- not -emulating- by *weasel · · Score: 5, Informative

    They're talking about -altering- the source code of an application so that it will run on new hardware.

    Not running the existing code through a software emulator on new hardware.

    They are aiming to (for example) map the display instructions from Pacman on the Atari 2600, to x86 windows API display instructions.

    They will also have to translate all game logic more times than not (to valid x86 logic instructions), and may have to alter the stored data in the event of differences in endian-notation.

    The resulting translation will not suffer from the overhead emulators create.

    Interestingly, I see this very feature as becoming one of their largest problems. pre-pentium-speed game programmers tended to rely on the clock speed of their original target hardware to set the update rate for the game. Trying to play frogger on even a 486 would be an impossible blur.

    Timing control will be their biggest hurdle.

    --
    // "Can't clowns and pirates just -try- to get along?"
    1. Re:RTA: They're -translating- not -emulating- by Anonymous Coward · · Score: 0

      Some people may not realize this, but even old computers like the C64 sometimes required delay routines to keep games playing at a reasonable speed.

    2. Re:RTA: They're -translating- not -emulating- by Anonymous Coward · · Score: 1, Informative
      Some emulators translate. Here's one.

      The only thing they're doing differently is they save the translated code instead of just caching it in memory.

    3. Re:RTA: They're -translating- not -emulating- by Anonymous Coward · · Score: 0

      Yeah, but translating machinecode from one cpu to another is only syntax and thus _trivial_ compared to the translation of IO-register/graphics-chips including all side-effects.

    4. Re:RTA: They're -translating- not -emulating- by frostgiant · · Score: 1

      I don't think it would be that big of a hurdle.

      They do know factors such as ROM speed (wait states), CPU speed, clock cycles per instruction, etc.

      Furthermore, most games time based on interrupts (video or a timer int) rather than just counting from 1 to 1 million or what have you.

  15. Hm.. by Anonymous Coward · · Score: 1, Funny

    What? Someone found yet another way to make a copy of 'Rygar'?

    Damnable geeks.

  16. Sweeet... by TopShelf · · Score: 2, Interesting

    Can't wait to play true classics on my Pentium 4...

    --
    Stop by my site where I write about ERP systems & more
    1. Re:Sweeet... by Conspiracy_Of_Doves · · Score: 1

      MAN does that bring back C64 memories.

      You should have seen the grin on my face the instant I rolled over the link and saw the filename in the status bar.

      Let Baldur's Gate, Neverwinter Nights, Morrowind, and all the rest KNEEL and COWER before the ONE TRUE RPG!

    2. Re:Sweeet... by Vindicator9000 · · Score: 1
      TRS-80? I want Megabug! Was anyone else addicted to that? Polaris was cool too.


      Seriously, though, I first started programming on one of those, with BASIC, and a tape drive when I was 6 years old. I would be awesome if I could play the games from it again on my Athlon.

    3. Re:Sweeet... by angst_ridden_hipster · · Score: 1

      But.. you can!

      Check out:

      Ira Klang's TRS-80 Central:
      http://www.trs-80.com/

      TRS-80 Emulators:
      http://www.vavasour.ca/jeff/trs80.html
      http://discover-net.net/~dmkeil/

      TRS-80 Software:
      http://home.planet.nl/~srahman/trs80_so ft.htm

      (I was a TRS-80 user from way back as well... published games under the Pacific Software name back in the early 80s.)

      --
      Eloi, Eloi, lema sabachtani?
      www.fogbound.net
  17. Article text by Anonymous Coward · · Score: 4, Informative

    Server is spewing intermitant database errors so:

    What if you have to port a program, but all you have is a binary?
    Bridging the Gap
    Typical software development involves one of two processes: the creation of new software to fit particular requirements or the modification (maintenance) of old software to fix problems or fit new requirements. These transformations happen at the source-code level. But what if the problem is not the maintenance of old software but the need to create a functional duplicate of the original? And what if the source code is no longer available?

    This exact problem arises when trying to reproduce the original play of old arcade games on modern devices. The game play is so well known that anything short of the original is unacceptable. Often the source code is available, but it may be incomplete and may not cover all of the patches that were added to later production models. In addition, it is too expensive to provide copies of the original hardware.

    Providing faithful emulations of video games (and old home computers) is our primary experience with this process. But the same techniques can be applied to other areas. Aging hardware and software can be replaced by new hardware with a completely compatible program.

    BRIDGING THE GAP
    The general problem can be expressed as "bridging the semantic gap." You must create a program that precisely maps the meaning of the original program onto a host system. Primarily this means an interpreter of some kind for the target processor's instruction set, but one must also deal with I/O (input/output) devices. Such an interpreter is known as an emulator. (See "The TRS-80: A Simple Emulator" on page 54 of this article.) If the program is automatically converted to a different language, it is called a translation.

    Why are we tackling the problem at such a low level? Mainly to achieve the highest fidelity possible to the original. Emulation is about mapping semantics. The semantics of hardware are usually well documented either by circuit diagrams or chip-specification documents. Internal layers inside software are usually designed to much looser standards, so it is unlikely that specification documents--if they exist--completely describe the behavior. In fact, the software itself is the most authoritative description available. It is true that chip specifications are not always complete or accurate, but chips are reused and over time the deviations become widely known.

    The semantic gap between the target and host systems is not purely an abstraction. It can be quantified as follows: G = number of host instructions to emulate one target instruction. Given G and some idea of the relative speeds of the host and target system, you can quickly decide if emulation is feasible. The problem here is that the value of G is a function of an actual emulator. A rule of thumb is that G is at least 10, but practically speaking, 10 is lower-bound for systems that are quite similar. Although time is usually the overriding concern, there is an analogue for a semantic gap in terms of storage space.

    Figure 1

    Emulation and translation start with the same inputs (the ROM data and the hardware documentation) and produce the same result: a copy of the original running on a PC. The difference comes in how the ROM data is handled. For the emulator, it is simply a parameter to the program. For the translated version, the ROM is converted and compiled into the executable.

    The semantic space gap is the ratio of the size of the host program to the size of the target program. For an emulator, the host program size is broken into two pieces: the host's representation of the target program and the emulator code and associated tables. Unless the host and target are radically different, there is little to be gained by significant changes to the representation of storage. Thus, if the emulator code is ignored, the semantic space gap is typically exactly one.

    Intuitively, the value of G really depends on how differe

  18. Inspiring Slashdot links by Anonymous Coward · · Score: 1, Funny

    inspire me to embark on meaningless and time-consuming quests

    This is as close to having a girlfriend as the average Slashdotter can get.

  19. Gain v Pain.. by adeyadey · · Score: 5, Insightful

    This methos is of genuine value for cases of applications where the source has been lost and needs alteration - for just running invaders/pacman/etc an emulator is just as good - since you have to slow things down to run at 100% original speed. The best emulators really o absolutely emulate every facet of the original CPU & hardware - the VICE C64/PET/VIC emulator runs on a 1mhz interupt, that, as I understand it, emulates all the states of the 6502 processor exactly. If you convert bin->asm->c you would still need to put hold-states in the C code to make it step at exactly that speed, cycle for cycle. Where this method would be better than MAME/VICE style emulation is when you need to patch the code- to upgrade it, fix bugs etc. This applies more to non-game type code where old (and failing) hardware/software needs to be migrated to new hardware, maybe with minor code changes.. And if you are not tied to executing at a set pace, then bin->asm->c is a really cool thing to have.

    --
    "You lied to me! There is a Swansea!"
  20. Fatal error: Call to undefined function... by Sowbug · · Score: 2, Funny

    Wow, those guys ARE good. They even ported their company web server to a TRS-80.

    But some areas of the code still need work:

    int fork() { return 1; }

  21. wow by Anonymous Coward · · Score: 0

    Fatal error: Call to undefined function: message_die() in db/db.php on line 88

    they sure summed it up in a few words
    if only i knew how i could apply this to actually porting a game...

  22. Let's see... by Wolfier · · Score: 4, Insightful

    Emulation:
    *Each assembly instruction interpreted by an interpreter
    *Compile once to run N applications

    "Translation":
    *Each assembly instruction translated to a C macro
    *Compile N times to run N applications

    Looks like emulation wins. If an emulator has JIT then "translation" losses its only speed advantage too.

    1. Re:Let's see... by Anonymous Coward · · Score: 0

      did you RTFA?

      Translating Binary into Source Code
      If the differences are particularly large or if the speed difference between the host and target is not large enough, a pure emulator will not be feasible--at least not one that runs in realtime. Possibly the final product requires some modification, such as graphics scaling, to match the host's display. A translation of the target program into source code will be faster than an emulated version and more amenable to modification. Since the translation is automated, unlike a port, the translated version will be as faithful to the original as the emulated version.

      While more difficult than writing an emulator, translating the target code is not remarkably difficult when dealing with a set of programs known in advance. Each program may be analyzed to produce a complete set of code paths. The code translator is effectively a reflective version of the emulator. Instead of performing the machine instructions, it outputs the code to execute the instruction.

    2. Re:Let's see... by Anonymous Coward · · Score: 0

      did you RTFA?

      Did you read the location URL in your browser when you wrote this?

      s l a s h d o t

      Of course he didn't. Neither did the mods. Hence the reason HE is at +5 while YOU are at 0.

  23. Idea depreciated: DUMB by Creepy+Crawler · · Score: 4, Interesting

    For console video games, why in the hell would you translate the language? All the consoles had funky hardware that games used one time or another.

    For 1, the NES uses mappers to display games. On emulators, many mappers are not supported. NES game producers also put hard-coded timings in games. So if your recompiled game isnt the exact same multiplier of clock frequencies, many will exhibit starnge behavior or just lock up.

    Next, the SNES had pretty much basic AppleII GS hardware with the exception of the 32 channel sound card. It had a sound cpu which could hold 64k code along with samples. A problem that the makers of ZSnes had was determining the random noise generators formula. On the older games like Chrono Trigger, the wind would sound like square waves going up and down. That sounds fun, compiling a game when you find out that the hardware emulation controls wernt right.

    Jump to PS2. Who would have thought that a comuter like that would be available to the public? One that has little GFX ram but a huge bus. Not to mention a full FS to "compile". What pitfalls occur in the 3D hardware?

    Emulation is still better as it offers a replacable shim to modify and add features. You can also use other emulators.

    --
    1. Re:Idea depreciated: DUMB by Fancia · · Score: 1

      The SPC-700 does 8 channels, not 32.

      --

      Bít, zabít, jen proto, ze su liska!
    2. Re:Idea depreciated: DUMB by Creepy+Crawler · · Score: 1

      I know. The default AppleII gs hardware is a SNES with a 32 channel sound board. The SNES was a Sony SPC700 chip that handled only 8 channels and 64k ram.

      Sorry for the confusion.

      --
    3. Re:Idea depreciated: DUMB by Fancia · · Score: 1

      Ah, my mistake, sorry... I wasn't familiar with the AppleII gs' hardware and thought you referred to the SNES.

      --

      Bít, zabít, jen proto, ze su liska!
    4. Re:Idea depreciated: DUMB by Anonymous Coward · · Score: 1, Informative

      This Link dispells the myth about the SNES using AppleIIgs hardware. Kujo2K

    5. Re:Idea depreciated: DUMB by yerricde · · Score: 2, Interesting

      The Apple IIGS and Super NES had the same CPU (65c816), but that's it; their I/O architectures were NOTHING like each other. Apple IIGS and Super NES video weren't even close, and neither were their sound chips. The IIGS had a memory-mapped dumb frame buffer; the Super NES's video was tile-based, somewhere between that of the Sega Genesis and that of the Game Boy Advance, and VRAM was accessed through a couple I/O ports.

      --
      Will I retire or break 10K?
    6. Re:Idea depreciated: DUMB by Anonymous Coward · · Score: 0

      The SPC-700 in the SNES has 32KB of RAM, not 64KB.

      Half of it's address space is unused..

  24. Digger by Fellgus · · Score: 4, Interesting
    The classic Digger game with CGA graphics for the PC (ran on the 8086) went through this process by this guy: http://www.digger.org/

    Amazing feat. It's completely rewritten in C to gain exactly the same functionality as the original code, with only the binary / dissassembled machine code to work with.

    --

    -larsch

    1. Re:Digger by fruey · · Score: 1

      Class! I had this once, I was an addict, and good at about the first five levels. Then I lost interest, but now I can play it again!

      --
      Conversion Rate Optimisation French / English consultant
  25. yay! glad to see I'm not the only geek doing this by Anonymous Coward · · Score: 2, Interesting

    Well, I'm not porting to a different platform, but I am converting old bootable 360k floppy disk games into games that can still be run on modern computers.

    I've finished the Epyx game JUMPMAN
    http://www.classicgaming.com/jmanproject

    and I'm currently working on Beyond Castle Wolfenstein

    This is a very time consuming hobby, but for me it's a matter of preservation than anything. I don't want to have to dig out the PCjr from my closet everytime I want to play these oldies.

    -jeff!

  26. Too much self modifying code, the guy is a fool by Anonymous Coward · · Score: 2, Interesting

    Too much self modifying code, the guy is a fool.

    He does not talk about dynamic recompilers (that use page management dirty-bits to track self mofifying code)

    He does not talk about self modifyingh code

    he does not talk about timing loops and differences in different opcodes

    He does not talk about lot of things.

    I suspect he is not the one to talk about this stuff.

    Tom Dowdy (old email dowdy@apple.com) knows all about DR he wrote a paper on it.

    So did the guys who wrote a DR for recoding Mac 68K on an Intel at full speed, the Executor guys.

    Its incredibly hard work and takes half a millikon dollars to do one correctly that can handle self modifying code.

    The guys from Connectix (now Microsfot) did it with having the x86 intel run on a PowerPC.

    DR (Dynamic Recompilation) technologies do not make source code.... because that itself would take tens of millions of dollars to engineer and at least a few huge teams of experts, and even then would not be possible to automate.

    That guy is a fool, but I do agree that stuff NOT written in assembler (compiled stull written mostly after 1999) couple be transcoded into files because C++ and C on moder architectures rarely has self modifying structures.

    1. Re:Too much self modifying code, the guy is a fool by Anonymous Coward · · Score: 0

      What you say makes sense to anyone who already knows what you're talking about. Otherwise, I doubt anyone will give your comments any credence, given the way you've expressed your opinion (ie: spelling mistakes and poorly structured ideas). ;-)

    2. Re:Too much self modifying code, the guy is a fool by eatdave13 · · Score: 1

      Well, other than the fact that the person talking about this has actually managed to pull it off with Phantasy Star II and III...

      --
      "Verbing weirds language." -- Calvin
  27. These are a few of my favorite links... by nanojath · · Score: 4, Funny
    "My favorite Slashdot links are those that..."


    My favorite Slashdot links are those that go down within about 12.5 seconds of showing up on the front page. I know I must be missing something really great!

    --

    It Is the Nature of Information to Transgress Artificial Boundaries

  28. one word by Apreche · · Score: 0, Troll

    EMULATOR

    --
    The GeekNights podcast is going strong. Listen!
  29. RAM advantage by yerricde · · Score: 1

    JIT translation is RAM-hungry. "Translation" has a RAM advantage as well, which is useful on handheld devices with little RAM.

    --
    Will I retire or break 10K?
    1. Re:RAM advantage by Anonymous Coward · · Score: 0

      Also, if you've ever seen the ZSNES or Snes9x messageboards, you'll see the other downside of emulation: Many users are idiots. I don't know how many posts I saw on those boards from people who downloaded ZSNES but it "didint have teh ga3ms in it!?"

      This way, the ROM sites just compile their ROMs into standalone emulators, leaving the users a lot less room for stupidity (but it also means you have to redownload your entire ROM collection when ZSNES fixes that annoying soft-patching bug).

  30. Project Odin by paugq · · Score: 5, Interesting

    The guys at OS/2 Netlabs have been doing this for years now. It'ts called Project Odin They run Win32 apps on top of OS/2 with no emulation: they "translate" binaries on-the-fly. They even run Win32 drivers on OS/2!!

    1. Re:Project Odin by AndyS · · Score: 1

      Looks like all they do is reorganise the PE files when they load them, and have an implementation of the Win32 API (ala wine).

      I don't think they're actually translating calls to Windows functions to OS/2 functions - that would be neat (and very very hard, due to side effects)

    2. Re:Project Odin by forgotmypassword · · Score: 1

      They provide the Win32 API for OS/2, the code is still i386. So this is a completely different animal. WINE and CygWin fall into the same boat.

  31. There lies the hard part by Orion+Blastar · · Score: 1
    you will have to rewrite the parts that directly access the hardware into something that C++ or one of the supporting C++ libraries can use. Usually the data can be preserved or converted into something the supported libraries can work with. This is hard because it can be 60% to 90% of the code.

    Either that or you create macros or a virtual machine to handle the hardware access.

    Now a remake can be hard to do, one example is Telengard for Windows which is based on the old C64 classic game by Avalon Hill. The original sound and graphics are there, but the code had to be rewritten. The sound and graphics are in a new format that the supported libraries that are used can access. As any C64 developer can tell you, the C64 BASIC used a lot of peek and pokes to memory, and Machine Language accessed the chips and memory directly. What he had to do was rewrite the code so it acted and played like the original. Some things he didn't get right, but he did what he could to fix them. Telengard for Windows is not emulated, but it is a native Windows executable.

    --
    Remember, Slashdot does not have a -1 disagree moderation, and no, troll, flamebait, and overrated are not substitutes.
    1. Re:There lies the hard part by Anonymous Coward · · Score: 0

      that is what we call a CLONE. this, however, is a port

  32. These guys are hardly experts by Salamander · · Score: 4, Interesting

    I've had to suffer through these guys' port of Joust on shockwave.com (in fact I have the high score for the month currently) and it has several inexcusable flaws. The most annoying is that it doesn't always respond to keypress events properly - rather critical functionality for a game. It doesn't actually seem to drop the events, which would be bad enough, but it ignores them for as much as half a second at a time and then spits a whole bunch out together. If your game wasn't screwed up when it seemed to ignore the event, it's damn sure going to be screwed up when they all get played back in a burst along with the other keys you hit to recover from the original failure. I know Windows is not a real-time system, and I've worked on real real-time systems (microsecond response times) so I do know the difference, but there's no excuse for a delay this long on an unloaded modern system. Other games don't seem to be afflicted by the same problems. The problem is not in Windows; it's in Digital Eclipse's emulation of the hardware on which the game originally ran (even if the code is translated the non-CPU hardware still has to be emulated).

    There was also a time when the game's speed calibration was totally broken. I'd play on my 600MHz laptop and it would be just about right, but when I went to my 1.5GHz desktop guess what happened. Yeah, everything in the game was moving about 2.5x as fast and the game was unplayable. This only persisted for a week or two, but it's still not something that should happen in a version that's released to the public. These technical failures, combined with their apparent acquiescence to Shockwave's desire to add deliberate player-killing features to their translation (the very laws of physics in the game change after you get a good score, and I've looked at the original ROM code so I know exactly how they're doing it) have left me with the impression that Digital Eclipse is both incompetent and unethical.

    --
    Slashdot - News for Herds. Stuff that Splatters.
    1. Re:These guys are hardly experts by Lehk228 · · Score: 1

      That problem of storing up an assload of commands and unleashing them all at once is also present on my DVR (sort of like TiVo) it is very annoying to try to fas foreward through a set of commecials and end up getting sent all over the recording because the machine decides to take random amounts of time to execute commands from the command queue, it should be simple to make the box have a *small* queue (2-3 commands) and an overflow command either being dropped or triggering a queue flush in order to allow the user to regain control sooner when the control system craps out.

      --
      Snowden and Manning are heroes.
    2. Re:These guys are hardly experts by Anonymous Coward · · Score: 1, Informative
      "I've had to suffer through these guys' port of Joust on shockwave.com (in fact I have the high score for the month currently) and it has several inexcusable flaws. The most annoying is that"...

      ... some mook sitting in a chair propping up a can of mountain dew with his belly thinks that dissing the free (as in beer), well intended, open-hearted work of someone else (did you really *suffer* through the joust port? poor baby) earns him some cool. please.

      yeah yeah, you've got a grasp, but so what?

      pounding on someone's efforts ("inexcusable" coding on a port of a 20 year old arcade game, that you can then sit and poke at, all day, for free, and even get the hi-score on) and then sneering down your nose at them is a perfect illustration of why so much of the public-at-large views geek culture as filled with twats.

      it's also a demonstration of why they're right.

    3. Re:These guys are hardly experts by Salamander · · Score: 2, Insightful

      Programs that simply don't work right, that don't meet quality standards we'd apply to every other product category, is a perfect illustration of why the public at large views geek culture - that includes you, we're on Slashdot - as a bunch of overpaid lazy clods.

      Mindless flames that make unwarranted assumptions (such as "propping up a can of mountain dew") are a perfect illustration of why the public at large and even the geek community views Slashdot - and particularly the anti-community of aptly named anonymous cowards like you - as filled with twats.

      In the latter case, at least, they are right. You're in no position to criticize others' behavior.

      --
      Slashdot - News for Herds. Stuff that Splatters.
    4. Re:These guys are hardly experts by zooblethorpe · · Score: 1

      You're right in that what they're doing sounds kinda crufty and dodgy (crodgy and dufty?), but I've had very similar keyboard issues with shockwave itself, for completely different applications. Anytime I run a shockwave instance, my CPU usage hits the ceiling, and I suspect the keyboard events get sidetracked somewhere in all that wonderful Exploder noise. Kaboom.

      --
      "What in the name of Fats Waller is that?"
      "A four-foot prune."
  33. TRS-80 games by Zog+The+Undeniable · · Score: 3, Interesting
    Can someone please do "Cuthbert Goes Walkabout"? I played it on a Dragon 32, but most Dragon games were originally written for the TRS-80.

    Odd TRS story: the bicycle manufacturer GT made a mountain bike called an RTS-1 (Rear Tuned Suspension). It shouls have been the more logical TRS-1 (Tuned Rear Suspension), but the Tandy trademark apparently stopped them using the initials TRS. This was about 10 years after the TRS had gone out of production!

    --
    When I am king, you will be first against the wall.
    1. Re:TRS-80 games by IIRCAFAIKIANAL · · Score: 1

      Tandy made mountain bikes?

      I ask, because I was under the impression trademarks only apply in a certain industry (ie/ I've seen a furniture store called McDonalds). Correct me if I am wrong...

      --
      Robots are everywhere, and they eat old people's medicine for fuel.
    2. Re:TRS-80 games by Anonymous Coward · · Score: 0

      Tandy made mountain bikes?

      I ask, because I was under the impression trademarks only apply in a certain industry (ie/ I've seen a furniture store called McDonalds). Correct me if I am wrong...

      That, and I believe RTS stands for Rocker-Tuned Suspension...

      Tuned Rocker Suspension is probably in the LA-Z-BOY skunkworks program, not GT's...

      -ac

  34. Re: not as DUMB as you might think by Psykechan · · Score: 2, Interesting

    These people are the ones who translated Phantasy Star games to the GBA.

    The GBA does not have the power to emulate the Mega Drive (Genesis) even with a JIT compiler. Hence, a different method would be needed. Either simulation, recompilation, or translation. Translation was the best option given what they had to work with.

    Emulation is wonderful and all but it certanly doesn't work in all situations.

    FYI, I believe that PS1 was emulated and PS2,3 were translated in Phantasy Star Collection. They're not saying to use this as a replacement, they're just telling you how they did it. I'm letting you know why.

  35. Re: not as DUMB as you might think by Creepy+Crawler · · Score: 1

    >>FYI, I believe that PS1 was emulated and PS2,3 were translated in Phantasy Star Collection.

    Ambigous. Do you mean that the PS1 code was emulated in the PS2? If so, you're wrong. There's 2 main CPU's in the PS2. One is for PS1 and a bios-like chip to interface to the main CPU to make the PS2 rom calls. They also use this shim to add anti-aliasing.

    --
  36. Re:yay! glad to see I'm not the only geek doing th by annielaurie · · Score: 1

    I have a question--actually a serious question. I visited, and the screen looks a little bit like "Miner 2049er" starring Bounty Bob.

    Maybe I'm just suffering from old-timer's disease?

    --
    DUCT TAPE: The Election Supervisors' Secret Weapon
  37. Re: not as DUMB as you might think by Anonymous Coward · · Score: 0

    PS is Phantasy Star you moron.

  38. an ML/OS compiler? by LWATCDR · · Score: 2, Interesting

    Why not a compiler that takes machine code and compiles it to a new machine code? Such systems have been made. The Java JIT compilers take java bytecode and compile it to native machine code. The translator on the Transmeta chip takes AI-32 and comiles it. Why not one that takes say an MS-DOS program and converts it to Linux? You would have to map every interupt and dos call but it could be done. Selfmodifying code would be a big no no or a huge challenge for the compiler. All in all it could be interesting.

    --
    See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    1. Re:an ML/OS compiler? by frostgiant · · Score: 1

      You still have a lot of things to overcome, but it would not be impossible. You would know about code entry points, but what happens when you do something like: mov 5, r1 shl 2, r1 cmp r4, r5 be r1

      You would need some sort of emulation going through the whole thing. There could be lots of tricky situations where you are not sure of where branches are going to go.

      You could have a software emulator and someone play through the whole game, I suppose, but there is no guarantee you would get all of the branch locations.

    2. Re:an ML/OS compiler? by LWATCDR · · Score: 1

      I was not thinking of games specificaly. THe idea of treating the ML as a language and compiling it kind of interests me. I have heard that IBM did something like that for the AS/400. They created a "perfect machine code" that gets "translated" when you install or is it when you run the program. That is how they could move from a CISC CPU in the Model38 to a Power Risc cpu in the AS/400. I would think that a modern PC now has the power to do the same thing. Might it not be possible to create a perfect ML for Linux and have it translate into a native version during the install? Yes I know that source tarballs could do much the same thing but not always. It is a real problem for compilers. I might get an ObjCamal compiler to compile under PPC LInux but that compiler will still only create ia32 binary files.
      Just an idea.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
  39. Geesh - this is hard? by snStarter · · Score: 1

    I mean wow guys, you just run the C compiler backwards and it will disassemble the object code into C.

    And it tells you "Paul is Dead" at the same time.

    These kids now adays...

  40. Re: not as DUMB as you might think by iocat · · Score: 1

    Uh, PS was referring to Phantasy Star, not PlayStation, as your reply seems to indicate. He was saying that Phantasy Star 1 was emulated, and Phantasy Star 2 and 3 were translated.

    --

    Dude, I think I can see my house from here.

  41. Re:Secret Contra Code!!!! by miyako · · Score: 1

    no idea why i'm replying to this but...
    that is actually the Konami code, it works in pretty much every konami game out there, just enter it at their logo.

    --
    Famous Last Words: "hmm...wikipedia says it's edible"
  42. This was for the Game Boy Advance... by Sunnan · · Score: 1

    ...you insensitive clods! (To all those that's been saying "emulation is better".)

    IMHO, It was smarter to do it this way than try to emulate the genesis on a GBA. The latter might be possible one day, with enough hacking breakthroughs, but this is no less generalizable. They have a perl-based translator which they can improve, much like an emulator often need to be improved the more games it is to support.

  43. apo'strophe's by Anonymous Coward · · Score: 0

    The apo'strophe: a punctuation mark used on 'slashdot to 'signal that an "'s" character i's ju'st ahead.

  44. Re Creepy Crawler: DUMB by babyrat · · Score: 1

    For console video games, why in the hell would you translate the language?

    For posting a reply, why in hell wouldn't you read the F*&^ing article?

    The article talks about the EXACT reason they chose tranlsation vs emulation. They are translating to the Gameboy and in their words:

    The CPUs are so close in performance that direct emulation can immediately be ruled out. The larger cartridge size means we can accommodate some code expansion caused by translation.

    Previously in the article they mentioned:
    A translation of the target program into source code will be faster than an emulated version and more amenable to modification.

    And sure enough the Gameboy and Genesis had different display resolutions that had to be accounted for.

    Why was the parent mod'd up???

  45. Re:Secret Contra Code!!!! by gauauu · · Score: 1

    Yeah, every single one, like Castlevania 1, 2, 3, Base Wars, Metal Gear, Snake's Revenge, Bayou Billy, Batman returns, Blades of Steel, Bucky O' hare, Double Dribble, Goonies 2, Jackal, Lone Ranger, Rush'n Attack, Super C, TMNT 3, Top Gun, Track and Field, Track and field 2

    I'll stop my sarcasm there. It worked on 2 games: Life force, and Contra. Gradius 3 had a modified version of the code.

    A far cry from "pretty much every konami game out there"

  46. This is why you keep original source by frostgiant · · Score: 1

    If they had the original assembley source files, think how easy this would be. Code sections already separated from their data sections. All you would need to do is know HOW the hardware worked and translate the assembler files. Yes, there would need to be a few changes, like resolution differences, possible shortage of buttons, etc.

    1. Re:This is why you keep original source by Anonymous Coward · · Score: 0

      The whole point of this article is that they DON'T have the original source, so this article wouldn't have been written in that case.

  47. Re:yay! glad to see I'm not the only geek doing th by Anonymous Coward · · Score: 0

    It's Jumpman, but they are kinda similar.

    Miner 2049er

  48. Am I missing something? by RobertB-DC · · Score: 1

    What we've done is imported "Yars' Revenge" from the Atari 2600 did some elevation emulation, ported the code, and re-compiled to make it work on the Intellivision. We may be selling that cartridge commercially as there is a great need for 8-bit cartridges.

    Pardon me, but I think one of two things have happened here.

    1) The esteemed moderation pool (of which I have occasionally found my self a member) missed a clearly +1, Funny post (great need for 8-bit Intellivision carts?) and modded it as Insightful/Interesting. I scored one like that, once, before the more clueful moderators clicked my link.

    2) I have just shown myself to be woefully ignorant, despite having a TRS-80 (with LNW Expansion Interface, heavy as lead) of my own stashed away in the closet.

    Both choices, at the moment, appear equally likely.

    --
    Stressed? Me? Of course not. Stress is what a rubber band feels before it breaks, silly.
    1. Re:Am I missing something? by bytesplit · · Score: 0

      It's called "Windows geeks in the 9th grade have read some computer terms at www.whatis.com and are coming here to test their new vocabulary before heading off to apply for their first job bagging groceries, from which they will spend their paychecks hosting their internet access so they can log onto IRC and www.advogato.org and say they "have been out of the loop for awhile as I test out my new sorting algorithm at end of the Express Lane at Grocery Store Foo".

      --
      real geeks hate soap operas.
  49. ZZT!!!! by CrAlt · · Score: 1

    Would be badass to beable to run ZZT on MacOS X or any unix for that matter...its all text...how hard could it be?

    --
    I have to return some videotapes...
  50. There are problems by hsa · · Score: 1

    Don't just think your ROMs will just disassemble and compile.

    Disassembling ROMs

    Disassembling ROMs seems straightforward enough - I mean, if the binary code is there, it can be mapped to assembly code, right? Wrong.

    In the early 90s, exe-packers and stuff that compressess the run-time code was used. At least in PC. What this means, is that you get perfectly clear assembly routine of decompression algorithm, and rest is garbage. You just have to decompress it yourself. Manually.

    And there's is this thing called self-modifying code, which some assembly coders use. Changing the instruction while program is running is something that only emulators can do.

    Getting the c-file to compile

    Well, what I would like to say here, that you still need to make the macros and routines to emulate the hardware, eg. map the memory area to screen,play the fm sound and stuff - You would still have to create run-time emulation.

  51. gross by andalay · · Score: 1

    OMG

    that was the grossest thing i have ever seen once i decoded your message.

    please please give a warning next time

    those of us with 1024x768 had no warning

    please

    be nice

  52. Death to the evil Sno Beez by sbszine · · Score: 1

    You can get it as a MAME ROM, if that's any help : )

    Brilliant game, BTW.

    --

    Vino, gyno, and techno -Bruce Sterling

  53. This article is unreadable by Zathras11 · · Score: 0, Offtopic

    The font used on the page is TINY and I'm
    sorry, but if I have to mess around with
    changing fonts just to read something, screw
    it! It sounded interesting though...

    1. Re:This article is unreadable by Zathras11 · · Score: 1

      Very fair! I try to read the article, only
      to be greeted with the smallest font ever
      created, and some jackass moderates me down
      because I mention it! Okay, fine. I will
      eventually get to moderate again. The last
      time I let it slide and didn't use the points.
      Next time, I'm going to use them, FOR SURE!
      Off Topic my ass! I've had it with this crap!

  54. MOD PARENT UP by ivan256 · · Score: 1

    This guy spent way too much time on this post for it to have a zero score. Besides, he agrees with me, and he's right. :)

  55. Other links by jim3e8 · · Score: 1

    This article was interesting but short on technical detail. Here are some other links on static recompilation:

    http://www.gtoal.com/sbt/
    http://groups.yahoo.com/group/staticrecompilers/

    It is unclear to me how they deal with more complex situations such as self-modifying code or code that jumps into the middle of an instruction.

  56. for hardware support by ShadowRage · · Score: 1

    you might have to hack the game.. these people arent saying "disassemble it, compile it and it works!"
    it'll just give you the source code, then to get it working on your computer, you must edit the code, use sdl or gl for graphics display, and you might have to take some parts from your favorite opensource emulator and use that for hardware support (look at sonic cd for PC, it has a shitload of DLL's emulating common genesis routines)
    so in the end, it's basically emulation, but, an emulator that is hardwired to play a game without all the frills, etc.
    or, if you're really hardcore, you can edit the code even more so it'll work with the system's hardware (eg, alsa, oss, windows' sound, etc)
    and use sadl or gl for the video, and reconfigure it to use the keyboard for buttons
    so then it's more like semi-emulation.
    not to mention converting the cpu instructions.