Semi OT: MS Pacman recompiler test program

From: Neil Bradley <nb_at_synthcom.com>
Date: Wed Aug 18 2004 - 03:44:29 EDT

I thought, since we're all geeks here, that this might be of interest.

Inspired by Graham Toal's CCPU recompiler, I've written a recompiler that
currently recompiles Z80->C. It's a generic framework, however, and I've
already got a 6502 disassembler with a 6809 one being coded as I type
this.

As a proof of concept, I've plugged it in to a Ms Pacman platform
extension (no sound). IT currently is running @ 50 FPS because SDL
(graphics library) timer isn't granular enough to produce 60FPS. I'll have
to use a Windows or perhaps Posix timer to get something closer to the
original.

System tested - Pentium 4, 2.4Ghz, 512K cache, 512MB of RAM, Radeon 9800
Pro w/128MB, Windows XP SP 2

Pure emulation runs the game at around 7K FPS with no graphics. My
assembly language core runs it around 14K FPS. Unoptimized recompilation
of the C file given below is about 12KFPS. Optimized through the C
compiler (MSVC), I'm getting 24KFPS on this machine.

Anyway, here is the executable if anyone is interested. Press '3' to coin
up, '1' to start 1 player, '2' to start 2 players, and the arrows to move.
And escape to exit. I would be very interested in your results of trying
it on various machines with the "-nogfx" command line option. That'll give
raw results. Windows binary below:

http://www.synthcom.com/~nb/mspacmanExe.zip

And the recompiled source code for MS Pacman is here (look for
mspacman_exec()).

http://www.synthcom.com/~nb/mspacmanRecomp.zip

And a disassembly of the source binary produced by the recompiler:

http://www.synthcom.com/~nb/mspacmanDisasm.zip

At this point I've done nothing but timing coalescing in terms of
optimization. I haven't yet gone through and done unnecessary flag
removal, nor any other "heavy" optimizations. They're on the "todo" list,
but it's far enough along that I thought you all might be interested in
checking it out. All of the optimization thus far is done in the core, so
anyone writing a back end for the

As soon as I bundle up Orion (the recompiler), I'll post a URL for the
latest version.

-->Neil

-------------------------------------------------------------------------------
Neil Bradley "Your mistletoe is no match for my T.O.W. missile!"
Synthcom Systems, Inc. - Santabot - Futurama
ICQ #29402898
---------------------------------------------------------------------------
** Unsubscribe, subscribe, or view the archives at http://www.vectorlist.org
** Please direct other questions, comments, or problems to chris@westnet.com
Received on Wed Aug 18 03:44:35 2004

This archive was generated by hypermail 2.1.8 : Mon Aug 23 2004 - 14:50:00 EDT