iremh3001.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * IREMH3001 Mapper - The TI-NESulator Project
  3. * iremh3001.h
  4. *
  5. * Created by Manoel TRAPIER.
  6. * Copyright (c) 2003-2007 986Corp. All rights reserved.
  7. *
  8. * $LastChangedDate: 2007-04-16 01:55:35 +0200 (lun, 16 avr 2007) $
  9. * $Author: godzil $
  10. * $HeadURL: file:///media/HD6G/SVNROOT/trunk/TI-NESulator/src/iremh3001.h $
  11. * $Revision: 39 $
  12. *
  13. */
  14. unsigned short iremh3001_prom_slot[3];
  15. unsigned short iremh3001_vrom_slot[8];
  16. int iremh3001_InitMapper(NesCart * cart)
  17. {
  18. set_prom_bank_16k(0x8000, 0);
  19. set_prom_bank_16k(0xC000, GETLAST16KBANK(cart));
  20. iremh3001_prom_slot[0] = 0;
  21. iremh3001_prom_slot[1] = 1;
  22. iremh3001_prom_slot[2] = GETLAST16KBANK(cart);
  23. set_vrom_bank_8k(0x0000,4);
  24. iremh3001_vrom_slot[0] = 0;
  25. iremh3001_vrom_slot[1] = 0;
  26. iremh3001_vrom_slot[2] = 0;
  27. iremh3001_vrom_slot[3] = 0;
  28. iremh3001_vrom_slot[4] = 0;
  29. iremh3001_vrom_slot[5] = 0;
  30. iremh3001_vrom_slot[6] = 0;
  31. iremh3001_vrom_slot[7] = 0;
  32. return 0;
  33. }
  34. int iremh3001_MapperWriteHook(register word Addr, register byte Value)
  35. {
  36. switch(Addr)
  37. {
  38. case 0x8000: /* Set 8k PROM @ 8000 */
  39. printf("iremh3001: %X: change PROM to %d[%X]\n", Addr, Value, Value);
  40. set_prom_bank_8k(0x8000, Value);
  41. iremh3001_prom_slot[0] = Value;
  42. break;
  43. case 0x9003: /* Mirroring ??? */
  44. printf("iremh3001: Mirroring[0x%X:%d] ?\n", Value, Value);
  45. break;
  46. case 0x9005: /* IRQ ??? */
  47. printf("iremh3001: IRQ[0x%X:%d] ?\n", Value, Value);
  48. break;
  49. case 0x9006: /* IRQ ??? */
  50. printf("iremh3001: IRQ[0x%X:%d] ?\n", Value, Value);
  51. break;
  52. case 0xA000: /* Set 8k PROM @ A000 */
  53. printf("iremh3001: %X: change PROM to %d[%X]\n", Addr, Value, Value);
  54. set_prom_bank_8k(0xA000, Value);
  55. iremh3001_prom_slot[1] = Value;
  56. break;
  57. case 0xB000: /* Set 1k VROM @ 0000 */
  58. case 0xB001: /* Set 1k VROM @ 0400 */
  59. case 0xB002: /* Set 1k VROM @ 0800 */
  60. case 0xB003: /* Set 1k VROM @ 0C00 */
  61. case 0xB004: /* Set 1k VROM @ 1000 */
  62. case 0xB005: /* Set 1k VROM @ 1400 */
  63. case 0xB006: /* Set 1k VROM @ 1800 */
  64. case 0xB007: /* Set 1k VROM @ 1C00 */
  65. printf("iremh3001: %X: change VROM to %d[%X]\n", (Addr&0x0F)<<10, Value, Value);
  66. set_vrom_bank_1k((Addr&0xF)<<10, Value);
  67. iremh3001_vrom_slot[Addr&0x0F] = Value;
  68. break;
  69. case 0xC000: /* Set 8k PROM @ C000 */
  70. printf("iremh3001: %X: change PROM to %d[%X]\n", Addr, Value, Value);
  71. set_prom_bank_8k(0xC000, Value);
  72. iremh3001_prom_slot[2] = Value;
  73. break;
  74. default:
  75. printf("@:%X -- V:%X", Addr, Value);
  76. return 0;
  77. }
  78. return 1;
  79. }
  80. void iremh3001_MapperDump(FILE *fp)
  81. {
  82. fprintf(fp,"iremh3001: prom: $8000:%d $A000:%d $C000:%d\n",
  83. iremh3001_prom_slot[0],
  84. iremh3001_prom_slot[1],
  85. iremh3001_prom_slot[2]);
  86. fprintf(fp,"iremh3001: vrom: $0000:%d $0400:%d $0800:%d $0C00:%d\n" \
  87. " $1000:%d $1400:%d $1800:%d $1C00:%d\n",
  88. iremh3001_vrom_slot[0],
  89. iremh3001_vrom_slot[1],
  90. iremh3001_vrom_slot[2],
  91. iremh3001_vrom_slot[3],
  92. iremh3001_vrom_slot[4],
  93. iremh3001_vrom_slot[5],
  94. iremh3001_vrom_slot[6],
  95. iremh3001_prom_slot[7]);
  96. }
  97. int iremh3001_MapperIRQ(int cycledone)
  98. {
  99. return 0;
  100. }