main.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. MSP430 Emulator
  3. Copyright (C) 2020 Rudolf Geosits (rgeosits@live.esu.edu)
  4. "MSP430 Emulator" is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. "MSP430 Emulator" is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #pragma once
  16. #include <stdio.h>
  17. #include <time.h>
  18. #include <stdlib.h>
  19. #include <fcntl.h>
  20. #include <string.h>
  21. #include <stdint.h>
  22. #include <signal.h>
  23. #include <sys/wait.h>
  24. #include <errno.h>
  25. #include <stdbool.h>
  26. #include <pthread.h>
  27. #include <libwebsockets.h>
  28. #include <readline/readline.h>
  29. #include <readline/history.h>
  30. typedef struct Emulator Emulator;
  31. typedef struct Cpu Cpu;
  32. typedef struct Port_1 Port_1;
  33. typedef struct Usci Usci;
  34. typedef struct Bcm Bcm;
  35. typedef struct Timer_a Timer_a;
  36. typedef struct Status_reg Status_reg;
  37. typedef struct Debugger Debugger;
  38. typedef struct Server Server;
  39. typedef struct Packet Packet;
  40. #include "devices/peripherals/bcm.h"
  41. #include "devices/peripherals/timer_a.h"
  42. #include "devices/peripherals/port1.h"
  43. #include "devices/peripherals/usci.h"
  44. #include "devices/cpu/registers.h"
  45. #include "devices/utilities.h"
  46. #include "devices/memory/memspace.h"
  47. #include "debugger/websockets/emu_server.h"
  48. #include "devices/cpu/decoder.h"
  49. #include "debugger/debugger.h"
  50. #include "debugger/register_display.h"
  51. #include "debugger/disassembler.h"
  52. struct Emulator
  53. {
  54. Cpu *cpu;
  55. Debugger *debugger;
  56. };