Perl Spectrum Emulator
dna
created: 2005-12-22 00:12:02

I haven't slept for a very long time, and usually when I find myself at this state I give Google and Wikipedia a hell of a lot of strange words to entertain myself.

Today I Googled for "emulator written in perl", hit "I'm feeling lucky", and was then redirected to nothing less than a Sinclair ZX Spectrum emulator written in Perl... And it works.

I'm sitting with the biggest "WTF?!" expression on my face, 'cause A. I didn't think it was possible and B. I've NEVER heard of the program here at PerlMonks.

What's going on here? Am I very slow or something? Am I asleep and dreaming this?

(here is the link: http://sourceforge.net/projects/perl-spectrum/ )

P.S. Sorry if I posted this the wrong place. Didn't know where else.

Re: Perl Spectrum Emulator
created: 2005-12-22 00:46:12

I don't see why it wouldn't be possible. I might wonder why it was done, but surely this is not beyond the abilities of Perl.

Re: Perl Spectrum Emulator
created: 2005-12-22 01:40:14
It doesn't sound so surprising to me.

I've written a MIX (Knuth's imaginary computer) emulator in pure Perl, including a compiler for the MIXAL language, and it works pretty well. Of course, MIX has no graphics whatsoever (only a text terminal).

Re^2: Perl Spectrum Emulator
created: 2005-12-22 05:14:40

A MIX emulator in perl? That sounds great, Wow!

Re: Perl Spectrum Emulator
dna
created: 2005-12-22 01:52:11

I never imagined it would have potential for emulating computers. Maybe I AM a bit slow.

Re: Perl Spectrum Emulator
created: 2005-12-22 02:34:45
I've NEVER heard of the program here at PerlMonks

Not everything that happens in the Perl world gets mentioned at PerlMonks. Lots of details get thrashed out in various perl.org mailing lists. All sorts of informal discussions occur in use.perl user journals. If you rely soley on PerlMonks, you won't be getting the full picture.

For me, I heard about this brilliant hack at YAPC::Europe in Belfast, with a talk given by one of the authors. The talk met with riotous applause. Not only for the niftiness factor. The talk was quite interesting in terms of what they had to jump through in terms of getting a reason refresh rate.

• another intruder with the mooring in the heart of the Perl

Re^2: Perl Spectrum Emulator
dna
created: 2005-12-22 03:39:02

(This is kind of off-topic... But I still haven't slept yet)

        Not everything that happens in the Perl world gets mentioned at PerlMonks.

I know that, but I'm not as much into the Perl-scene as I used to (or rather should) be. These days I only use Perl for ultra simple tasks that sane people would use shell-scripts for.

PerlMonks.org is the only Perl-related site I visit on a monthly basis, simply because most of the stuff that's written here is super cool :)

Re: Perl ZX Spectrum Emulator
created: 2005-12-22 14:53:45

I used to think that emulators were deep voodoo. Then I tried making one (Game Boy, which is a modified z80 processor). Turns out the hardest part is getting sound to work. If you just want to get the instruction set to work, you just need a big array to represent the memory, map the data into the right spots (cartidge data gets put into a given location in memory, etc.), then start doing each opcode, which basically ammounts to doing some simple operation (add two numbers together and store the result in register ax, etc.). All the data you need for this is available to the public with a few moments of quality time with Google.

Everyone should try making an emulator sometime. The Game Boy is a simple platform, so it's a good place to start. It'll give you an idea of how CPUs work, and its probably not as hard as you think.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

perlmonks.org content © perlmonks.org and ambrus, dna, grinder, hardburn, spiritway, spurperl

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03