NESCarts.h 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Cart manager - The peTI-NESulator Project
  3. * NESCart.h
  4. *
  5. * Created by Manoël Trapier.
  6. * Copyright (c) 2002-2019 986-Studio.
  7. */
  8. #ifndef NESCARTS_H
  9. #define NESCARTS_H
  10. #include <stdint.h>
  11. #include <types.h>
  12. #define iNES_MIRROR 0x01
  13. #define iNES_BATTERY 0x02
  14. #define iNES_TRAINER 0x04
  15. #define iNES_4SCREEN 0x08
  16. typedef struct NesCart_
  17. {
  18. uint32_t PROMSize, /* Size of PROM */
  19. VROMSize; /* Size of VROM */
  20. char MapperID; /* Mapper Type */
  21. uint8_t Flags;
  22. char *FileName;
  23. uint8_t *File; /* Pointer on the file in memory */
  24. uint8_t *PROMBanks; /* Pointer on the first PROM */
  25. uint8_t *VROMBanks; /* Pointer on the first VROM */
  26. } NesCart;
  27. void DumpCartProperties(FILE *out, NesCart *cart);
  28. int LoadCart(const char *filename, NesCart *cart);
  29. #endif