The EMU68_init() function initializes the 68k emulator. The maxmem parameter is the size of the 68K memory. The function checks if its value is valid. It must be a power of 2 in the range [2^17..2^24], 128Kb to 16 Mb.
- In normal mode (EMU68DEBUG not defined), the buffer must be 3 bytes larger than maxmem to prevent an overflow error that is not checked when accessing last bytes of memory as a long.
In debug mode (EMU68DEBUG defined) the buffer must be twice the maxmem value for the memory access control flags.
This function runs an emulation loop until stack address becomes higher than its value at start. After what, the interruption are tested and executed for this pass, with an execution time given in parameter whatever the time passed in the execution loop. This function is very specific to SC68 implementation.