This addin is a Chip 8 Emulator.
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.

Machine.h 461B

12345678910111213141516171819202122232425262728
  1. #ifndef _MACHINE_H_
  2. #define _MACHINE_H_
  3. #define SCREEN_WIDTH 64
  4. #define SCREEN_HEIGHT 32
  5. typedef unsigned char byte;
  6. typedef unsigned short word;
  7. typedef struct Machine_State Machine_State;
  8. struct Machine_State{
  9. byte Memory[4096];
  10. byte V[16];
  11. word Stack[16];
  12. byte DT;
  13. byte ST;
  14. word I;
  15. word PC;
  16. word SP;
  17. };
  18. void Machine_Init(Machine_State* state);
  19. void Machine_Update(Machine_State* state);
  20. int isKeyPressed(int key);
  21. int getKeyPressed();
  22. #endif