os_dependent.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * OS Dependent functions - The peTI-NESulator Project
  3. * os_dependent.h
  4. *
  5. * Created by Manoël Trapier on 08/05/08.
  6. * Copyright (c) 2002-2019 986-Studio.
  7. *
  8. */
  9. #ifndef OS_DEPENDENT_H
  10. #define OS_DEPENDENT_H
  11. #include <stdint.h>
  12. #include "text.h"
  13. /* File related functions */
  14. /* Graphics related functions */
  15. int graphics_init();
  16. int graphics_drawpixel(long x, long y, long color);
  17. int graphics_blit(long x, long y, long w, long h);
  18. int graphics_drawline(uint32_t x, uint32_t y, uint32_t x1, uint32_t y1, uint32_t colour);
  19. int graphics_drawRect(uint32_t x0, uint32_t y0, uint32_t w, uint32_t h, uint32_t colour);
  20. int graphics_drawFillrect(int x0, int y0, int w, int h, uint32_t colour);
  21. int graphics_getScreenSize(int *w, int *h);
  22. void vsync(void);
  23. typedef struct Palette_t
  24. {
  25. uint8_t r, g, b, a;
  26. } Palette;
  27. int getKeyStatus(int key);
  28. /* Sound related functions */
  29. /* IO functions */
  30. void *LoadFilePtr(char *filename);
  31. /* Console functions */
  32. typedef enum ConsoleLevel_t
  33. {
  34. Console_Error = 0,
  35. Console_Warning,
  36. Console_Alert,
  37. Console_Default,
  38. Console_Verbose,
  39. Console_Debug,
  40. } ConsoleLevel;
  41. int console_init(ConsoleLevel DefaultLevel);
  42. int console_printf(const ConsoleLevel level, const char *format, ...);
  43. int console_printf_d(const char *format, ...);
  44. #define KEY_ENTER (257)
  45. #define KEY_LEFT (263)
  46. #define KEY_RIGHT (262)
  47. #define KEY_UP (265)
  48. #define KEY_DOWN (264)
  49. //#define KEY_ENTER 13
  50. #endif /* OS_DEPENDENT_H */