Slashdot Mirror


Minecraft Mod Adds Emulated 6502 Processor

New submitter Direwolf20 writes "The Red Power 2 mod for Minecraft has recently been updated, and it adds a fully emulated 6502 processor that can be programmed in assembly, but comes with a Forth interpreter. From the article: 'Eloraam calls it the 65EL02, because "it supports all the 6502, 65C02, and part of the 65C816 instruction set" as well as "a set of completely new instructions and two addressing modes. Since the 65EL02 is an 8-bit CPU, Eloraam didn't have as many options for programming environments as we have on today's 64-bit computers. While it's possible to program the 65EL02 in assembly language, for general use she chose to implement a Forth interpreter. Further technical information about RedPower Control's 65EL02 is available on Eloraam's blog RP Control Internals, and on the RedPower wiki's page for Red Power Control.' (Fair disclosure: The video linked in the article is mine.)"

22 of 96 comments (clear)

  1. Re:That's great and all but... by X0563511 · · Score: 2, Informative

    No. But you'd know that if you had bothered to look up what a 6502 was.

    --
    For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
  2. Clock Rate? by Narcocide · · Score: 3, Interesting

    So what type of Mhz can you get out of this thing? Is it feasible on modern hardware for it to run at a clock rate equal to or higher than say, the stock speed of a Commodore 64? And what about I/O interfaces like audio, video and joysticks? How far can this really be taken?

    1. Re:Clock Rate? by BeerCat · · Score: 2

      Since the C-64 (and PET, Apple ][ and others) had 6502 running at 1MHz, then that shouldn't be too hard to do, even allowing for the emulation running inside a game environment

      --
      "She's furniture with a pulse"
    2. Re:Clock Rate? by 0123456 · · Score: 2

      I remember playing games on a Sinclair Spectrum emulator running in a PC emulator on a Sun laptop which probably had a 40MHz CPU, so a 1MHz 6502 on a 3GHz x86 should be trivial even with a ton of overheads in a game.

    3. Re:Clock Rate? by Pseudonym · · Score: 3, Interesting

      I've toyed with building the 6502 in redstone logic. If you know anything about the internals of the 6502, it actually lends itself to emulation better than, say, the Z80, since it doesn't use microcode and has a data path which is simply laid-out geometrically. Plus, there are quirks in the 6502's design which mean that the delay in getting a slow clock signal around the device wouldn't be a problem in practice.

      The complication is that the 6502 has two logical internal busses (the data bus and the secondary bus) which are connected by a set of bypass MOSFETs which are bidirectional: they can pass data in either direction. That's okay when you're realising the 6502 in analogue electronics (which is what transistors are, after all), but it makes it difficult in digital electronics. At the very least, you'd need to separate the one control signal into two (one for each direction). It's a bit of a mess.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  3. At what point does 'improvement' become a downside by fuzzyfuzzyfungus · · Score: 5, Insightful

    My impression of the metagame that is Minecraft is that doing things the hard and/or rube-goldberg way is part of the charm. There is some reason why people are trying to build ALUs in crap redstone logic rather than just alt-tabbing to the logic circuit simulator of their choice(or a VM, or an emulator of some popular retro architecture).

    Given that, at what point do mods that improve minecraft's program-ability go too far and turn it from a perverse simulation game of enormous popularity into a really dreadful IDE?

  4. Apropos... by fuzzyfuzzyfungus · · Score: 4, Interesting

    Since we are talking about implementing 6502s in questionably efficient ways, it seems like a good time to plug http://visual6502.org/. Efficient? No. Logic-accurate emulation of a 6502 implemented in javascript based entirely on photographs of a decapped 6502 die? Fuck Yeah.

  5. Up or down? by History's+Coming+To · · Score: 3, Interesting
    There's an interesting school of thought which says that advanced forms of life will eventually create countless virtual worlds for fun or research, and asks the question "what are the odds that we're in an 'original' reality?". (See Nick Bostrom, Oxford University, he's a philosopher rather than a computational scientist or theoretical cosmologist, but they all seem to be nudging each other these days.

    With that in mind, I found the following quote from the creator of this processor amusing:

    Infinite loops are fine. RP Control is carefully designed so that you won't screw up your world even if you crash the virtual computer. It's actually not especially hard to crash the virtual computer, since the whole OS is loaded into its RAM and you can easily write to that RAM. Still, since the computer is fully virtualized, it won't hurt your world or even cause a slowdown.

    --
    Please consider this account deleted, I just can't be bothered with the spam anymore.
  6. Re:At what point does 'improvement' become a downs by toygeek · · Score: 4, Informative

    It got my son interested in programming. Not this mod, but another. He actually programmed a pong game on his own over the course of a week using lua in a minecraft mod that has a computer that runs lua.

  7. Re:At what point does 'improvement' become a downs by History's+Coming+To · · Score: 4, Interesting

    I think a large part of it is the "because I can" factor. People often have some weird sideline projects on the go - I've hunted for the first three books in pi (by ISBN) and written a directed evolution program which is building a picture of Charles Darwin from random ellipses. Other people built computers in a game running on a computer just for the hell of it. No, it's never going to be the best 6502 emulator, the point is it's the best emulator written in Minecraft. Which is cool, obviously.

    I'm looking forward to seeing what happens with 0x10^c, Notch's new game, which has an inbuilt and fully emulated 16 bit for each player. I wouldn't be at all surprised to see a new ultra-low-power OS come out of it.

    --
    Please consider this account deleted, I just can't be bothered with the spam anymore.
  8. Do an ATmega328 next... by WrecklessSandwich · · Score: 3, Interesting

    ...because the only logical conclusion from there is Minecraftduino.

  9. Re:So what's the fuss? by History's+Coming+To · · Score: 3, Informative

    See this video of Conway's Game of Life, in Minecraft, using only native bricks in a very old version of the game. Everything from abacuses to basic calculators and full processor simulations have been done, so this may well just be all of that "landscape" wrapped into a more manageable few bricks and a GUI stuck on it.

    --
    Please consider this account deleted, I just can't be bothered with the spam anymore.
  10. What's inside? by mark-t · · Score: 3, Interesting

    What's the emulated hardware organization like? The 6502 didn't actually have designated input or output instructions, so as I recall, a programmer had to read or write to specific memory locations that were hardware mapped to various devices, especially peripheral devices.

    Discounting the memory mapped IO locations, how much RAM does the emulated system have to play with? What sort of firmware is loaded into the emulated ROM?

  11. Re:At what point does 'improvement' become a downs by Charliemopps · · Score: 4, Interesting

    Because the environment "feels" real. You can run around and see the circuit pathways and actually visually understand how the processor works... as apposed to having some abstract flowchart or diagram.

  12. Re:That's great and all but... by Dogtanian · · Score: 2

    No. But you'd know that if you had bothered to look up what a 6502 was [wikipedia.org].

    Except that this is Doom we're talking about, and despite its x86-centric origins, it's been ported to just about every damn platform in existence. So there's probably a version out there for a 6502-based machine, along with others for the Intel 4004, the the Colossus and for a half-broken abacus some guy found on a skip.

    Though in the case of the abacus, you do need floating-point beads apparently.

    --
    "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
  13. Re:DOES ANYONE CARE ABOUT SOME 2-BIT PROCESSOR ?? by thereitis · · Score: 3, Funny

    sys 64738
    comment rebooted

  14. Re:I'm in for 2! by suomynonAyletamitlU · · Score: 4, Insightful

    Yes, programmers shouldn't program in their off time, just like artists shouldn't draw and singers shouldn't sing. Which, unfortunately, a lot of people believe.

    "What are you doing?" parents and peers always say. "You're wasting your life." And they keep doing it because they want to.

    I say screw people like you, and more power to people like them.

  15. Reference implementation by tepples · · Score: 3, Informative

    Because the model that a JavaScript- or Python- based emulator uses can be implemented just as easily in other languages. The goal is to have a reference implementation against which other implementations' accuracy can be checked.

  16. Re:At what point does 'improvement' become a downs by toygeek · · Score: 2

    Since the only mod I know of that uses LUA and has programming, it very likely _is_ the same mod. RedPower2. This is just the newest version with a bigger "computer"

    Its not RedPower2.

    http://computercraft.info/

    He also runs a minecraft server on our VPS.

  17. Yo daWG.... by biodata · · Score: 2

    We heard you like computers so we put a computer in your computer

    --
    Korma: Good
  18. Re:That's great and all but... by Jappus · · Score: 3, Interesting

    I doubt the 6502 has the horsepower for it...

    You do know that you can run an Emulator with arbitrary speed? It is not the instruction set or register layout or memory model that is restricting performance. It's the hardware itself that puts a limit on that.

    Heck, even if you use real hardware, you could produce a >1GHz 6502 CPU, if you wanted to do it. It will be identical to the 6502 in everything but the clock speed and some minor hardware layout alterations to cope with these speeds (even small bends in the wires start to act as an antenna at these speeds).

    And if you use a software emulator (which this Minecraft Mod is for all intents and purposes), you can run it as fast as your host platform allows. This is why you can run a Nintendo Emulator at >200x the real speed of the original hardware.

  19. Re:At what point does 'improvement' become a downs by simoncoles · · Score: 4, Interesting

    My son is the same, he's 11 and wanting to create Minecraft Mods has caused him to:
      - Learn Java (he had a few brief experiences with Processing but now he's reading the Nutshell books)
      - Decompile Minecraft
      - Find and follow instructions on how to do all this (Web and YouTube it seems)
      - Write his own mods

    He's currently at the stage where he's letting his brother have his mods, and we're starting to talk to him about the implications of distribution (support, licensing etc.).

    I'm doing very little except providing the right tools at the right time (IntelliJ has been excellent for navigating the code base).

    Very impressed with Minecraft and how much he's been motivated to learn. I had tried to teach him some programming before but never really got anywhere, now he's so deep into aspects of Java that I can't really help him... and I've not had to utter a single word of encouragement or assistance.

    Minecraft feels like it is the BBC Model B of his generation.

    --
    Work blog: http://elnblog.com Personal blog: http://simoncoles.org