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.
 
 
 
 
 

31 lines
600 B

  1. /* Copyright (C) 2014-2016 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 "psg.h"
  7. #include "vdp.h"
  8. /* Structs */
  9. typedef struct {
  10. VDP *vdp;
  11. PSG *psg;
  12. uint8_t ports[6];
  13. uint8_t buttons;
  14. bool start;
  15. } IO;
  16. /* Functions */
  17. void io_init(IO*, VDP*, PSG*);
  18. void io_power(IO*);
  19. bool io_check_irq(IO*);
  20. void io_set_button(IO*, uint8_t, bool);
  21. void io_set_start(IO*, bool);
  22. uint8_t io_port_read(IO*, uint8_t);
  23. void io_port_write(IO*, uint8_t, uint8_t);