Mirror of CollapseOS
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

28 lignes
653B

  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #define TMS_VRAM_SIZE 0x4000
  5. // Offset of the name table
  6. #define TMS_NTABLE_OFFSET 0x3800
  7. typedef struct {
  8. uint8_t vram[TMS_VRAM_SIZE];
  9. uint8_t regs[0x10];
  10. uint8_t cmdlsb;
  11. bool has_cmdlsb;
  12. uint16_t curaddr;
  13. uint8_t databuf;
  14. uint16_t width; // in pixels
  15. uint16_t height; // in pixels
  16. } TMS9918;
  17. void tms_init(TMS9918 *tms);
  18. uint8_t tms_cmd_rd(TMS9918 *tms);
  19. void tms_cmd_wr(TMS9918 *tms, uint8_t val);
  20. uint8_t tms_data_rd(TMS9918 *tms);
  21. void tms_data_wr(TMS9918 *tms, uint8_t val);
  22. // result is a RGB value
  23. uint8_t tms_pixel(TMS9918 *tms, uint16_t x, uint16_t y);