Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
673B

  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. #include "libz80/z80.h"
  4. typedef byte (*IORD) ();
  5. typedef void (*IOWR) (byte data);
  6. typedef struct {
  7. Z80Context cpu;
  8. byte mem[0x10000];
  9. // Set to non-zero to specify where ROM ends. Any memory write attempt
  10. // below ramstart will trigger a warning.
  11. ushort ramstart;
  12. // The minimum value reached by SP at any point during execution.
  13. ushort minsp;
  14. // Array of 0x100 function pointers to IO read and write routines. Leave to
  15. // NULL when IO port is unhandled.
  16. IORD iord[0x100];
  17. IOWR iowr[0x100];
  18. } Machine;
  19. Machine* emul_init();
  20. bool emul_step();
  21. void emul_loop();
  22. void emul_printdebug();