manager.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Mappers manager & facilities - The TI-NESulator Project
  3. * mappers.h
  4. *
  5. * Created by Manoel TRAPIER.
  6. * Copyright (c) 2003-2008 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. #include <ppu/ppu.h>
  26. #include <memory/manager.h>
  27. #include <os_dependent.h>
  28. extern NesCart *Cart;
  29. /* Available functions for mappers */
  30. #define GETLAST08KBANK(c) ((c->PROMSize>>13)-1)
  31. #define GETLAST16KBANK(c) ((c->PROMSize>>14)-1)
  32. #define GETLAST32KBANK(c) ((c->PROMSize>>15)-1)
  33. void set_vrom_bank_1k(unsigned short addr,int slot);
  34. void set_vrom_bank_2k(unsigned short addr,int slot);
  35. void set_vrom_bank_4k(unsigned short addr,int slot);
  36. void set_vrom_bank_8k(unsigned short addr, int slot);
  37. void set_prom_bank_8k(unsigned short addr,int slot);
  38. void set_prom_bank_16k(unsigned short addr,int slot);
  39. void set_prom_bank_32k(unsigned short addr,int slot);
  40. #else /* __TINES_MAPPERS__ */
  41. /* Available functions outside of mappers */
  42. void mapper_list ();
  43. int mapper_init (NesCart *cart);
  44. extern int (*mapper_irqloop) (int cyclodone);
  45. extern void (*mapper_dump) (FILE *fp);
  46. #endif /* __TINES_MAPPERS__ */
  47. void map_sram(); /* Map SRAM */
  48. void unmap_sram(); /* Unmap SRAM */
  49. #endif