nes_conf.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * MIT License
  3. *
  4. * Copyright (c) 2022 Dozingfiretruck
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in all
  14. * copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  22. * SOFTWARE.
  23. */
  24. #ifndef _NES_CONF_
  25. #define _NES_CONF_
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #define NES_FRAME_SKIP 2
  30. #define NES_USE_SRAM 0
  31. #define NES_COLOR_DEPTH 16
  32. #define NES_COLOR_SWAP 1
  33. #define NES_RAM_LACK 1
  34. #define NES_USE_FS 1
  35. #ifndef NES_USE_FS
  36. #define NES_USE_FS 0
  37. #endif
  38. #ifndef NES_FRAME_SKIP
  39. #define NES_FRAME_SKIP 0
  40. #endif
  41. #ifndef NES_RAM_LACK
  42. #define NES_RAM_LACK 0
  43. #endif
  44. #if (NES_RAM_LACK == 1)
  45. #define NES_DRAW_SIZE (NES_WIDTH * NES_HEIGHT / 2)
  46. #else
  47. #define NES_DRAW_SIZE (NES_WIDTH * NES_HEIGHT)
  48. #endif
  49. #ifndef NES_COLOR_SWAP
  50. #define NES_COLOR_SWAP 0
  51. #endif
  52. /* Color depth:
  53. * - 16: RGB565
  54. * - 32: ARGB8888
  55. */
  56. #ifndef NES_COLOR_DEPTH
  57. #define NES_COLOR_DEPTH 32
  58. #endif
  59. #if (NES_COLOR_DEPTH == 32)
  60. #define nes_color_t uint32_t
  61. #elif (NES_COLOR_DEPTH == 16)
  62. #define nes_color_t uint16_t
  63. #else
  64. #error "no supprt color depth"
  65. #endif
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif// _NES_CONF_