I’m back!

New computer is assembled and seems to be running perfectly. It even seems a bit quieter than the previous one, but I haven’t had the GPU actually do real work yet, so maybe that’ll change things. 🙂

Hopefully, I can make up for the lost time once I’m done with my last exam on Wednesday.

Unexpected downtime…

As luck would have it, the CPU fan on my desktop machine has stopped working properly. That’s not good, because that’s the machine I do most of my development on.

I still have my laptop, and I should be able to get some work done here. Unfortunately, it’s not as comfortable to work with as my desktop, and that means there’s a good chance it’ll harm my productivity and have an impact on the schedule.

I was planning to replace most of the parts anyway, so I’m currently considering if I should do that now, or if I should wait and just buy a new fan now. It’s not that a new fan is expensive, but if I’ll be replacing the CPU in a month or two anyway, then it might make more sense to just get it done now.

I’ll figure out what to do over these next few days – if I replace everything, then it’ll probably be about 2 weeks before I get it back up and running, or if I just replace the fan, it should be ready some time during the upcoming week.

Right now, I’m going to focus on my next exam on Tuesday, and at the same time, I’ll try to figure out what I’m going to do about this as well. After that, I can get back to work on the code flow analysis.

Initial code flow

 

Finally, I’ve been able to start work on the code flow graph.

So far, very little is prepared, but I can now make the most basic graph, with each instruction as its own vertex (click for full-size image):
Grouped code flow graph for samnmax/script-33.dmp

Additionally, jumps are also handled (click for full-size image):
Initial code flow graph for samnmax/room-17-209.dmp

The next step is to combine some of these instructions into groups of instructions, to reduce the number of vertices in the graph.

Grouping completed!

Well, that didn’t take long.

Vertices in the code flow graph are now grouped according to these rules:

  • Only consecutive instructions may be grouped.
  • If there is a jump, it must be the last instruction in the group.
  • If there is a jump to an instruction, that instruction must be the first instruction in the group.
  • Once the stack becomes balanced, the group ends with the instruction that balanced the stack.

Here are the scripts from the last post, but now with grouping:

Grouped code flow graph for samnmax/script-33.dmpGrouped code flow graph for samnmax/room-17-209.dmp
And finally, as an example of a really big graph:

Grouped code flow graph for samnmax/room-9-202.dmp
This concludes the third milestone. The next step is to analyze the graph to detect loops and conditionals.

First disassembler done!

The SCUMM disassembler is now complete, completing the second milestone.

As mentioned in my previous post, the next step is to write documentation on this, and then it’s on to the code flow graph.

One week in…

That concludes the first week of the project.

I finished the first milestone a few days ahead of schedule, and got started on the next one, the SCUMMv6 disassembler. Since the opcode documentation on the ScummVM wiki isn’t really complete, that requires me to jump back and forth between files and make sure I properly understand the code, so it doesn’t go as quickly as it probably could – however, I should still have plenty of time to finish the disassembler by the milestone deadline, June 8.

Once the disassembler’s done, I’ll write some documentation on creating a disassembler, while I’m still focused on that part of the decompiler.