C64 visual debugger [ICU64]

nkarytia

RetroAdept
Joined
26 Μάρ 2007
Μηνύματα
932
Αντιδράσεις
16
Εν αναμονή του ICU64 visual debugger για τους C64/128.

Ο ICU64 visual debugger είναι εκπληκτικός, κάνει visualizations της πρόσβασης στη μνήμη και των memory-mapped devices όπως το video και το sound chip. Δείτε στο βιντεάκι πως δουλεύει:


απλά εκπληκτικό!
 
Τελευταία επεξεργασία από έναν συντονιστή:
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

Απο την συνεντευξη του Mathfigure στο 37ο τευχος του Commodore Free Magazine

http://www.commodorefree.com/issues.html (@Wally)
 
Τελευταία επεξεργασία από έναν συντονιστή:
Νεα εκδοση ICU64

ΙCU64 for Frodo Redpill v0.1.5 - Released

Eventually, after 3 years, a new version of ICU64 is ready for download. Several bugs and issues have fixed, additional functionality and features have added. Note however, that this version is not the one that I was working on the last years (i.e. v0.2). This is only an update of the initial release, where I have paste as much code as I could from v0.2 without corrupting the functionality. My goal is to make the raster view equally significant with the memory (matrix) view, so the development is being continued...
>>>>http://icu64.blogspot.gr/2012/09/icu64-for-frodo-redpill-v0.html
 
Φοβερό πρόγραμμα και να σκεφτείτε ότι...

...δεν είχα πάρει χαμπάρι αυτό το θέμα, μέχρι τώρα!

Πολύ εύστοχο το μουσικό χαλί του 1ου βίντεο, το προγραμματάκι είναι έτσι κι αλλιώς, πραγματική "The Matrix" φάση!
 
ICU64 for VICE 2.3 v0.1.2 - Released


An update of the ICU64 for the VICE emulator is available for download (you also need the VICE 2.3 emulator). There are no new features, only better functionality. My goal is to inject the REDPILL into the VICE, so more features could be supported in the future. I'm working on it...

(see the included readme file for instructions)

Note for programmers:

This time I modified the VICE source code to fix the bank issues of the memmap feature (the mod is here).
>>>>> http://icu64.blogspot.gr/2012/10/icu64-for-vice-23-v012-released.html

Bonus

 
Τελευταία επεξεργασία από έναν συντονιστή:

Μετα απο πολυ καιρο εχουμε κατι καινουριο απο τον Mathfigure

icon_arrow.gif
ICU64 for Frodo Redpill v0.1.6 - Released
 
Τελευταία επεξεργασία από έναν συντονιστή:
Τελευταία επεξεργασία από έναν συντονιστή:
VICE 3.0

ΒΤW το τελευταιο επισημο port στο RetroPie εχει βασανισει πολλους αδαεις χρηστες.
 
-I'm rewriting redpill from scratch at github.com/mathfigure.
 
- My aim is to support multiple emulators this time.
 
- An initial version of frodo-redpill is already up, vice-redpill will be next , and even more will follow.
 
-The platform is mainly linux and/or windows.
 
-And to be honest, i don't know how it will evolve (as plugin or something else).
>>> https://github.com/mathfigure

Υ.Γ. ενώ περιμένουμε την νέα έκδοση του πλέον αντίπαλου δέους του ,του C64 Debugger v0.60

που θα είναι διαθέσιμο στο Silesia 8 demo party (2017/06/23)
 
ICU64 / Frodo Redpill v0.1.7 -New features 

In ICU64:
- bug fixes
- block selection in memory view
- static code analyzer tool
- sync mode option
- 'peek & poke' via .NET interface

In Frodo Redpill:
- bug fixes
- drag'n'drop .d64, .t64, .prg, and .fss
- SID Voice 3 mute works
- REU support increased up to 16MB
- ROM files embedded to the .exe file
- multiple instances unlocked

Sync Mode
In sync mode, Frodo Redpill and ICU64 operate alternative in absolute synchronization at rate of 50Hz each. They run like sharing a single thread on your CPU (which needs more GHz in this mode, not more cores). Most of the time you should use the asynchronous mode (since it is lighter), but the sync mode is a lot more visually pleasing, as far as you can turn your monitor at 50Hz (otherwise not worth to enable this mode!). So the steps are:
- Turn your monitor at 50Hz (nVidia drivers have user settings for that)
- Press ALT+F5 in ICU64 to switch to sync mode (watch the indication on the main title)
- Enjoy the absolute smooth motion and perfect sync on both programs.

Multiple Instances (experimental)
Multiple instances combined with memory sharing is the long name of parallelism. And this feature is all about parallelism. You can now run multiple instances of Frodo Redpill that share some of their parts. And even if the control of sharing is minimal yet, is enough to start dealing with the problems and the benefits of parallelism.
So, try to start a second instance of Frodo Redpill and you will see three options: 
The first option is to press 'Cancel' and quit, to avoid any change to the state of the first instance (choose this if accidentally you started a new instance).
The second option is to press 'No' and you will have a minimal sharing between two (or more) C64s. Then you can start, for example, different games in parallel and watch them fighting for their colors.
The third option is 'Yes' and is mainly for 6502 programmers, as the first thing will happen is to crash both C64s (not the external apps, only the internal virtual machines). To start without crash is a challenge; first you must realize the problem and then you'll have to write some code (ask me for help if you want). After you find a way, you may start exploit the benefits of multiple CPUs on C64 writing custom programs.
A host CPU with multiple cores is beneficial with this feature (the GHz not matter), as there is no limit to the number of instances you can start in parallel (but watch out the complexity).
Note that this feature is experimental; done by minimal modifications in the emulator side only. ICU64 is ignorant of the secondary instances (those having an asterisk '*' on their title). So you'll not helped much. Though you can watch all memory accesses from all instances, in some views (like the raster view) all these events interfere and get messy.
Note also that if you close or crash the primary instance, then any new instance will be secondary. And the only way to receive a primary instance again, is to close them all, and start new ones.

Code Painter
The 'Code Painter' in the misc tools of ICU64, is a static code analyzer. It works on a snapshot of the RAM that takes when first opens.The disassembly of the code starts from a user specific address, and it follows the flow of execution until to reach a loop, an error, or the command 'BRK'. As a basic rule it never disassembles the same address twice.
Theoretically, if you specify the entry point of a program, it should disassembly the whole code. But the CPU of the C64 has 3 threads: RESET (the main thread), IRQ (all the interrupts), and NMI (the RESTORE key). Also, because the analyzer is 'static', it can't deal with dynamic changes in places like:
- IRQ vector ($fffe..$ffff)
- NMI vector ($fffa..$fffb)
- memory banking ($00..$01) (bank switching) 
- destination address of the 'jmp $(xxxx)' instruction
- a return address on the stack
- the code itself (in case of self-modifying code)
Neither supports the undocumented instructions of 6502. Indeed, there are many restrictions. A dynamic code analyzer that will bypass any restriction, will be one of the main features in the future. For now, though 'static' is still useful.
As an example, check the game 'Barbarian'. Its code occupies a single continuous region in memory and is completely static. The only 'dynamic' part is the destination address of a 'jmp $(xxxx)' instruction, and all its destinations (10 in total) located in a array of pointers (that's easy to find). So, if you disassembly the main thread (hint: barbarian stays resident after reset), and also the IRQ, the NMI, and the 10 destinations of the 'jmp$()' instruction, then you will get a nicely structured form of the whole code!
Also, even if the Code Painter can't read any ROM, you can copy the ROM into the RAM and disassembly there the KERNAL and the BASIC.

(More info pending...)

Known issues
issue: In some rare cases, Frodo Redpill crash very often by just clicking or dragging few times the window title.
cause: The bug is related to the sound system.
fix: option 1: Change the DirectSound option in Preferences > WIN32.
option 2: If the above fail, restart the Windows.
option 3: If all fail, disable the SID Emulation in Preferences > Standard.
issue: The primary instance of Frodo Redpill does not initialize the RAM during startup, as it should.
cause: A silly bug.
fix: Use a hex editor to patch the 'frodorp.exe' file:
file offset: 29D2F
old values: B0 CE 44 00 75
new values: B1 CE 44 00 74
D/load  >>> ICU64 / Frodo Redpill v0.1.7

Προέλευση >>>  http://icu64.blogspot.com/2018/11/icu64-frodo-redpill-v017-released.html
 
Πίσω
Μπλουζα