Next: , Previous: Platform APIs, Up: Top


13 Native Mode

Native mode lets you run FreeWPC directly on your host build machine. It is a form of emulation, like PinMAME, except the emulator is "built-in" to the game program itself. It works on both Linux and Cygwin systems.

There are two major differences in a simulation build. First, certain low-level OS and CPU specific features must be replaced by new components that work under your native operating system environment. In particular, 6809 assembly language functions are not used at all in this mode. We use either portable C versions of these functions, or comparable functions that are provided by the host OS.

Second, I/O reads and writes do not directly control real hardware, but are instead emulated internally by the program itself. All I/O is initiated by the platform APIs and uses the readb and writeb functions to address the hardware. In native mode, these functions define a separation between the "program" and the "simulation".

Native mode is most useful for debugging and testing the higher layers of FreeWPC, which aren't as hardware or timing dependent. This is only possible because the majority of the code is written in C.

To compile in native mode, just add NATIVE=y to your .config. Instead of a ROM, you'll get an executable that can be run directly.