In the constructor, set up any variables and data structures you need for the machine. Don't create components or do anything to the screen display, however, since these might vary in derived classes.
You also need to take as parameters to the constructor any input devices you need, such as keyboard and joystick.
This method is invoked by components, typically the CPU and video device in order to read the RAM, ROM and memory-mapped input of the Machine.
You are passed a pointer to the calling Component, which may need to use in order to determine the result (in multi-CPU systems, for example).
In future, this function may need to be overloaded to cope with larger address spaces and data sizes.
Like readMem(), but writes the given value to the given address.
This method is much like readMem(), except it is used to read input from hardware devices.
Again, different versions may be needed in the future.
Like writeMem(), but writes the given value to the given port.
This method is the main emulation loop for the Machine.
Typically, the method first invokes the Machine's readROMs() and createComponents() methods, and calls setupScreen() in the VideoDevice. In the main loop, then cpu(s) is run for a number of cycles, then update() is called in the joystick, video and audio devices along with any other regular operations (eg. interrupts or reading the keyboard).
The emulate() loop must also call the checkInterface() method of the Epp object, and return if it gets a non-zero result.
For a further description, see the section "Anatomy of a Machine class".
This function may be invoked by the Epp front end, and should cause the emulated machine to do a hard reboot. Typically, this may only involve resetting the CPU(s), but more might be required.
This is a utility function which will read a binary file into the area pointed to by dest. The size parameter indicates the expected size of the file. An error will be logged if there is a problem reading the file.
This method should read any required ROM and sample files.
This method should create the Component objects used by the Machine, via the new operator. The method is invoked by emulate().
This method should delete the Component objects used by the Machine, via the delete operator. The method is invoked by emulate().
Pointer to the front end object. This is used to call the checkInterface() method, and may in future provide access to users' dip switch settings.
Pointer to the ScreenOutput object. Usually, the Machine need not use this directly, but it will need it to create VideoDevice objects.
Pointer to the AudioOutput object. This may be used directly be the Machine, or may be used to create audio Components.