Shop OBEX P1 Docs P2 Docs Learn Events
Emulation power — Parallax Forums

Emulation power

mekrackermekracker Posts: 1
edited 2007-07-06 15:46 in Propeller 1
·· I'm new to this chip and i was wondering could 1 or 2 chips emulate the older consoles, like nes, snes, genesis, ect? i'm trying to make a cheap uneversol consol for my kids so i don't have to let them kill more of my old games.

······ Any info would be great thanks.

Comments

  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-07-06 04:57
    IIRC, at least two people were working on a Commodore 64 emulators. Haven't heard any news from them on the forums in a while but things seemed to be going well last we heard.

    I can only imagine that writing an emulator would be hard work. If your goal is to write one you will certainly have fun doing it and will learn a lot. But it will take you longer than you expect and it isn't reasonable to expect to write emulators for every system all at once - just one would be a major project. If you are hoping to use emulators others have written, it might be a long wait.

    OTOH, if your goal is simply to provide a game system for your kids, you are much better off getting a cheap mid-range PC and running the game emulators on that instead. I've seen people put PC's into arcade machines to make a PC emulator system that has an arcade look to it. While the Propeller is certainly technically capable of emulating at least an NES, and probably a Super Nintendo or Genesis, the issue is software. There is already PC software that emulates all these systems. Software for the Propeller to do this may never be written, or it may take many years to be written.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-06 06:23
    From what i gather, the "Gen II" prop will probably be the chip to do all that, the current version is certainly capable of running as an emulator, but you'd just about have to reverse-engineer the platform and game (the quickest way), i agree with dennis though, for a greenhorn (like me) to tackle an NES EMU, it's almost monumental and would take quite some time i suspect.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-07-06 15:23
    An emulator is a big long term project, but they are fun to do. It's very exciting the first time you get some graphics from the game appear on screen.

    The nice thing is that it's the sort of project that you can just dip into when you have the odd hour. Here's a plan of action:

    1) Set up a buffer equal to the size of the emulated system's memory map. (Not so easy for the Prop's 32K RAM. You might have to fragment it, or make use of upper EEPROM or a 512K Ram board.)

    2) Write 6 subroutines to read/write byte/word/long to/from that buffer. Eventually these subroutines will catch special cases where you are writing/reading memory mapped hardware registers and do the appropriate thing. But for now they just read/write to the buffer and display an error if trying to read outside of ROM/RAM or write outside of ROM.

    3) Write code to load ROM images into that buffer. For the Prop it might be easiest just to include the game ROM image as a FILE include in the SPIN code.

    4) Write a loop which has a "program counter" and reads opcodes from the buffer. Have it display an error displaying the number when it reaches an opcode it doesn't know. Initially this is all cases.

    5) Get the simplest (smallest) target system ROM you can find. If there's a development system available, write something that's of the level of a "Hello World!" program.

    6) Run the embryonic emulator on that ROM. When it gives an error because it doesn't understand an opcode, then add code to emulate that opcode. When you get an error because it has writes/reads outside of the already known areas, work out what function is performed by that read/write and emulate it.

    7) Repeat 6 until the "Hello World! level ROM is fully emulated.

    8) Find a slightly more complex ROM to emulate and repeat from 6.

    The main challenge for the prop is memory space. It'd be hard to emulate another processor in the 496 instructions of a cog. I guess the way to do it would be to page in and out a small block of code for the less commonly used opcodes. On the other hand the strength of the Prop would be to use other cogs to simulate console hardware such as hardware sprites and sound generators.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-06 15:46
    You can also use multiple cogs with one cog acting as the main interpreter for the emulator. This could decode the instructions and execute the simple ones. For complex ones, it would copy the necessary information to variables in hub memory, then wait for another cog to pick up the data and execute it. The floating point interpreter works this way (from the Object Exchange). One cog does the basic floating point operations while another cog has the routines for the transcendental functions (and some other complex operations).
Sign In or Register to comment.