trillek-team/trillek-vcomputer-module — pull request #14 by Zardoz89 (2014-04-18 10:05:03+00:00)
Title: Break points and cleaded main.cpp

The cleaning and improved main.cpp have a parameter parser with some nice parameters :

```
Usage:
./vm -r romfile [other parameters]

Parameters:
-r file or --rom file : RAW binary file for the ROM 32 KiB
-d file or --disk file : Disk file
-c val or --cpu val : Sets the CPU to use, from "tr3200" or "dcpu-16n"
-m val or --disk val : How many RAM have the computer in KiB. Must be > 128 and < 1024. Will be round to a multiple of 128
--clock val : CPU clock speed in Khz. Must be 100, 250, 500 or 1000.
-b val : Inserts a breakpoint at address val (could be hexadecimal or decimal).
-h or --help : Shows this help
```
Also, now in "step" mode, can understand a few commands :
- r : Change to running mode
- q : Quit
- s or enter : Executed an instruction.

Actually only makes optional the few lines of code in TR3200 cpu and VComputer that checks if there is a breakpoint or if has stoped the execution by a breakpoint. Ideally should make optional the definitions of breakpoint methods in VComputer, but I can do that without including Config.hpp in VComputer.hpp what will pollute preprocesor namespace...

Also, main.cpp have a annoying strange bug with break points. It stops/resume very well, switching to step mode, where you can run it in step-by-step and not doing nothing bad. The problem is that after you halted by a break point,s if you try to switch to run mode again, with 'r', looks that works, but suddenly the screen stops of being updated. I don't know why... any idea ?