An emulator, assembler, and disassembler for the Sega Game Gear
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.
 
 
 
 
 

33 lines
637 B

  1. /* Copyright (C) 2014-2017 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #pragma once
  4. #include <stdbool.h>
  5. #include <stdint.h>
  6. #include "mmu.h"
  7. #include "psg.h"
  8. #include "vdp.h"
  9. /* Structs */
  10. typedef struct {
  11. MMU *mmu;
  12. VDP *vdp;
  13. PSG *psg;
  14. uint8_t ports[6];
  15. uint8_t buttons;
  16. bool start;
  17. } IO;
  18. /* Functions */
  19. void io_init(IO*, MMU*, VDP*, PSG*);
  20. void io_power(IO*);
  21. bool io_check_irq(IO*);
  22. void io_set_button(IO*, uint8_t, bool);
  23. void io_set_start(IO*, bool);
  24. uint8_t io_port_read(IO*, uint8_t);
  25. void io_port_write(IO*, uint8_t, uint8_t);