manager.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Mappers manager & facilities - The peTI-NESulator Project
  3. * mappers.h
  4. *
  5. * Created by Manoel TRAPIER.
  6. * Copyright (c) 2003-2008 986Corp. All rights reserved.
  7. *
  8. */
  9. #ifndef MAPPERS_H
  10. #define MAPPERS_H
  11. #include <types.h>
  12. #include <stdio.h>
  13. #include <NESCarts.h>
  14. typedef int (*MapperInit) (NesCart * cart);
  15. typedef int (*MapperWriteHook) (register uint16_t Addr,
  16. register uint8_t Value);
  17. typedef int (*MapperIRQ) (int cycledone);
  18. typedef void (*MapperDump) (FILE *fp);
  19. #ifdef __TINES_MAPPERS__
  20. #include <ppu/ppu.h>
  21. #include <memory/manager.h>
  22. #include <os_dependent.h>
  23. extern NesCart *Cart;
  24. /* Available functions for mappers */
  25. #define GETLAST08KBANK(c) ((c->PROMSize>>13)-1)
  26. #define GETLAST16KBANK(c) ((c->PROMSize>>14)-1)
  27. #define GETLAST32KBANK(c) ((c->PROMSize>>15)-1)
  28. void set_vrom_bank_1k(uint16_t addr,int slot);
  29. void set_vrom_bank_2k(uint16_t addr,int slot);
  30. void set_vrom_bank_4k(uint16_t addr,int slot);
  31. void set_vrom_bank_8k(uint16_t addr, int slot);
  32. void set_prom_bank_8k(uint16_t addr,int slot);
  33. void set_prom_bank_16k(uint16_t addr,int slot);
  34. void set_prom_bank_32k(uint16_t addr,int slot);
  35. #else /* __TINES_MAPPERS__ */
  36. /* Available functions outside of mappers */
  37. void mapper_list();
  38. int mapper_init(NesCart *cart);
  39. extern MapperIRQ mapper_irqloop;
  40. extern MapperDump mapper_dump;
  41. extern MapperWriteHook mapper_hook;
  42. #endif /* __TINES_MAPPERS__ */
  43. void map_sram(); /* Map SRAM */
  44. void unmap_sram(); /* Unmap SRAM */
  45. #endif