manager.h 1.5 KB

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