Showing posts with label refactoring. Show all posts
Showing posts with label refactoring. Show all posts

Friday, 6 November 2009

Breakout

I am really enjoying getting back into the code. I've decided to bring all of the individual operation classes into the CPU class and make them inner classes. Lots of reasons for this but to me it just seems to be more logical for the individual instruction methods to access the internals of the CPU directly rather than through some static reference and public methods. This also means I'm removing tons of classes that helped with the previous abstraction and have adopted some simpler ways of decoding opcodes etc.

What this will lead to I hope is a much smaller and cleaner code base with no unnecessary coupling and a nice clean interface. With a bit of luck the performance might be better too, but I'm not really worried about that at the moment.
I am now thinking of creating a new project for the 68k CPU and hosting it on google code or github with a monitor/debugger/disassembler (and perhaps an assembler too) but separate from the Miggy project.

Once this is done I'll then return to Miggy and build it using this CPU core.
Thoughts anyone ?

Saturday, 17 January 2009

Progress or Procrastination

I've just commited a huge update into the code repository.  Still little display code progress but an awful lot of refactoring has gone on.

I've extracted the interfaces, enumerations and exceptions out into an "api" package and changed the system model loader to load all of the main classes dynamically based on a configuration file. The aim is to enable different implementations of key components if or where necessary.  For example this would enable different rendering engines/technologies to be used to handle the display or special cases for components that need tweaking for particular applications.

I've also added a rudimentary console so that the machine can be controlled from the command line interactively.   This will be fleshed out as I progress.  The graphical debugger is still there although not accessible at the moment, so eventually a user can choose between command line operation or a graphical front end (or a bit of both).

My main focus next will be trying to get something displayed.  This must be the second or third time I've said that, but I found the refactoring had to come first to make way for modular display code.

I'd also like to create a sub project for the disassembler.  The original release in the code Google Code Site is well out of date now and was based on the state of the emulator project at the time.  So I have no way of building this separately, and I'd like to update it at some point.