Interview with “Mathfigure”Creator of the Commodore 64 hacking tool ICU64
Q. Please introduce yourself to our readers.
Hello, I'm Mathfigure, the creator of the Commodore 64 hacking tool ICU64. I am a Physicist from
Greece, and was born in 1976.
Q. How did you first start with computers and what are your earliest memories?
As far as I remember myself my favourite "toy" was the hammer (the absolute disassembly tool). I always want to see inside the devices, to see how they work; but soon this interest proved too expensive (even later, when I discover the screwdriver!) So I changed my hobby and started to become an athlete.
I first heard about computers in 1986. I asked my big brother what it (a computer) is; and he told me about a machine that looks like TV but also has a typewriter attached, via which you could give commands for what you wanted to see on the screen. I was fascinated by this idea: a machine that I could order! So in January 1988, after begging our parents daily for about 18 months (I think this is a record!), the first computer arrived at my home: a Commodore 128D. Since then I stuck with computers.
I started to play with commands for graphics and thus I slowly started to program. I familiarized myself with the Cartesian Coordinates and some other aspects of Analytic Geometry before I learnt anything about Algebra and Geometry. In parallel there was also a Commodore 64, embedded to the C128, capable to running thousands of games! And I always wanted to beat a game within two ways: to finish it and to hack it. I have made innumerable resets between the C64 mode and the C128 mode trying to hack some games with the embedded debugger of the C128. Briefly, the C128 gave me a scientific view of the computer that led me finally to university, but the C64 was the machine that I always wanted to hack and that led me to the ICU64 project.
Q. For the people who haven't see it or heard of it can you tell our readers about ICU64 for FRODO, what are the main functions you can do with the software?
The project tries to manipulate the C64 as a whole (hardware and software) using the full power of the PC. The ICU64 is aimed to be a comprehensive tool for the most demanding user of the C64:the hacker. Its aim is to provide real-time visualizations for every internal component of the C64, as well as other combined visualizations that would make clearer the operation of the hardware and the intention of its software.
To achieve this, the software runs in conjunction with a modified version of the C64 emulator FRODO that I call Frodo Redpill. The Frodo Redpill provides access from outside to almost every bit and every event that exists and occurs inside the C64 virtual machine. Currently, the main feature of the ICU64 is a handy view of the address space as a bitmap which shows the contents of the memory and every access that is performed by the CPU and the VIC-II. When a byte is accessed, a corresponding pixel is colorized: red if written, green if read and blue if executed (as you can imagine combinations occur fast and often). You can zoom out to see the whole memory and easily distinguish data and code, or zoom in down to the details where you can see the values of the individual bytes as hexadecimal numbers, or zoom further to see the addresses of the bytes and the machine language mnemonics, or even further to see the address of the code which accessed last that particular byte. Also, you can edit the values of the bytes at any time. All these functions are in real-time while the C64 is running any software you like. This "memory view" is highly dynamic and interactive, so it may sound complex, but is really easy and intuitive to use.
Q. So you can see every memory access colour coded in the emulator of the Commodore 64 and change the bytes manually, what other features does the software have?
There is a "graphics view" where the contents of the RAM are decoded in 4 main ways that the video chip (VIC-II) supports: sprites, bitmaps, charsets and text screens. This view is also editable. For example, you can draw on the screen and change the stage of a game on the fly, giving an immediate way for cheats. Other features are: the "display window" that emulates the C64 display and shows the VIC state for each raster line; a simple visualization of the SID state; a CPU instruction logger which tracks the executed instructions only once, so you can locate event handlers; and a "raster view" which is cycle-exact and visualizes the activity of the VIC. At any time, there is also the possibility to pause the virtual machine and trace it step-by-step, where the "step" may be: a frame, a raster line, a cycle, or a CPU instruction. Most of these features have lame implementation or they have only few functions but they will improve with time.
Q. How long did this software take to program?
Well, I don't count the hours. Usually I work on the project for a couple of weeks then test it for some days with several games and demos, and then I work again after several months. In the middle time I work on other projects (unrelated to C64). My first attempt to start the project was in 2000 but it was hopeless. In Nov 2006, and after working for 10 days, I had a stable version for the VICE and the CCS64 emulators, with the memory view (only the RAM), the graphics view (only the sprites), and the display window. The RAM view was a 256x256 gray scale bitmap and there was a red highlight for every byte when its value changed. No zoom and no memory accesses, nevertheless it was amazing, so I spend a lot of time watching many games and demos under this view. Realizing the potential, I start to prepare the Frodo version. Next year, several features were added (only for Frodo), and in Dec 2007 the program took form, in May 2009, it was shown to the public as a preview. During the summer some features were removed (as they were though too lame) and some others were added, before the first public release on Sep 2009.
Q. Do you have any other features you would like to add?
Many, and really I don't know what to add first:
visualization of the CPU, VIC-II, SID, CIA1 and CIA2;
unification of the memory view and the graphics view in a handy matrix editor;
breakpoints;
labels;
auto memory map;
several different color schemes of the memory;
customizable display;
more featured "raster view";
more flexible instruction logger;
snapshot manager;
parallel executions on the same emulator;
parallel synchronization of multiple emulators.
Be aware that some of these are just ideas, others are closer to implementation, and toward time other ideas may appear. Off course all these need a lot of time and with my rate so far I don't know how long will they take.
Q. So who would best utilize this software and who did you think about when designing the software?
Initially it was created for personal use only, but after the public demo and its acceptance, I decided to spread it as far as possible. The target user is the C64 hacker and my effort is to make his life easier. And since the hacker is the user who wants the most, everybody else should be pleased too (i.e. developers, self-learners, gamers). I would be happy if this tool could be utilized as a "gamer-to-hacker converter" since a gamer sees only the tip of the iceberg when playing a game and ignores how the game works (the big part). On the other hand, this software is not for engineers as it visualizes only the logical operation of the computer.
Q. Do you have a Blog or Twitter page people can follow?
I have a blog (
http://icu64.blogspot.com ) where I post anything new that is related to the project (not much so far) the blog contains links to download the files needed to run the software. I'm also on YouTube (
http://www.youtube.com/mathfigure ) where I have upload some previews of the software in action.
Q. How is the software beta tested for errors?
I test the software myself looking for major bugs. Minor bugs may be fixed even after the release. If the same bug remains from one release to another, then it should be reported from the users, because probably I haven't noticed it.
Q. What software did you use to produce the software?
I use the C# of Microsoft Visual Studio where ICU64 is written and the C++ where Frodo Redpill is written. Also, I use the Wolfram Mathematica to test new features, or to do more advanced operations, during reverse engineering of a game, for example.
Q. What do you need to run the software and is the software publicly available?
The software it is free available from my blog. The requirements are: a PC that runs Windows XP or better, equipment with a mouse that has a handy wheel for easy pan & zoom. In the case of Windows XP, the Microsoft .NET Framework 2.0 or better must also be installed. There are two version of ICU64: the Frodo version which needs the Frodo v4.1 emulator, and the VICE version (with limited features) which needs the WinVICE v2.1 emulator.
Q. Why implement this for Frodo first rather than any other emulator
Building a prototype you want to concentrate more on what to do and not on how to do it. So you want anything around your project to be helpful and not a barrier. It was between Frodo and VICE. Frodo has elegant source code, and comes with an excellent article about the VIC-II from the creator of Frodo, Christian Bauer. Between the article and the emulator one could see a one-on-one map of "what" and "how". Thus the VIC article serves as a very good documentation for the source code making it even easier to understand. Though the VICE emulator was superior, its source code wasn't easy to read and sooner or later would stop my project. Actually I started to work with VICE but soon return to Frodo.
Q. If our readers have suggestions to add extra features would you be open to their ideas?
Any idea is welcome (preferably ideas about unifications, generalizations, or extensions).
Q. Would you release the source code as freeware or similar?
I would like to, but first I must get it well formed and perfected because currently the code is a mess.
Q. Do you have any other Commodore related projects you would be prepared to tell our readers about?
ICU64 is meant to be an all-in-one project, at least for me and anything I develop around C64. I can't imagine a tool for the C64 that couldn't embed with ICU64. One of the major goals of this project is to give to the user the full control over the machine which means, by definition, that he shouldn't need any other tool (off course it's still far from this).
Q. For a system considered DEAD, why do you think there is so much interest in the Commodore 64 and for that matter "RETRO" computing in general?
Nostalgia is the major reason why most users use a retro system periodically. Yet, the hackers have another reason as well: they are trying to get the maximum from the minimum (a hacker's principle). The C64 demo scene is full of creative hackers who still squeeze the C64 trying to extract the whole potential of this machine, and surprising they still continue to impress us. The best demo I have seen (Edge of Disgrace) is released in 2008! So, the C64 is actually LIVE. And there are a lot of people that try with their way to keep it like this (the fate of C64 is on the hands of its users).
On the other hand, compare the C64 with the PC. Which is more "pretty"? The components of the C64 are chosen carefully to provide the maximum potential with the minimum cost. Have you opened a PC to see how much unnecessary complexity and redundancy exists there? So, the MODERN machine is "ugly" and this is another reason why the hobbyists who want to study a computer as a machine would prefer a "pretty" RETRO one. Note also that the emulation combines the RETRO with the MODERN, and my project moves toward this direction.
Q. Do you think emulation will ever become so perfect we don't need to keep preserving the "REAL" machines anymore?
Absolutely! It is known that a computer can simulate the operation of another computer. The fact that the current emulators have some weakness is due to the lack of detailed specifications and the need to be hosted on powerful and flexible real machines. Besides, a "real machine" is an implementation of a design which describes an "ideal machine". And a "virtual machine" is just another implementation of the same design. Which implementation could be closer to the "ideal"? On the other hand, if it so important for someone to touch the thing, I believe that in few years it will be possible to "print" the parts and assemble a real C64, at home!
Q. Do you have any comments you would like to add?
I want to thank all the guys who with their comments helped me to stay concentrated on the program during the last summer, so it can now be made available to all. I hope that the program will serve as a good gym for the mind for anyone trying to figure out how computer software actually works. Also, I hope that this project will inspire more developers to create similar tools, since there is a big unexploited potential here.
Q. Thanks for working on such a great piece of software.
I'm happy that you like it.
Q. For anyone curious or in need of a demo look at these