iremh3001.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * IREMH3001 Mapper - The peTI-NESulator Project
  3. * iremh3001.c
  4. *
  5. * Created by Manoël Trapier.
  6. * Copyright (c) 2002-2019 986-Studio.
  7. *
  8. */
  9. #include "iremh3001.h"
  10. uint16_t iremh3001_prom_slot[3];
  11. uint16_t iremh3001_vrom_slot[8];
  12. int iremh3001_InitMapper(NesCart *cart)
  13. {
  14. set_prom_bank_16k(0x8000, 0);
  15. set_prom_bank_16k(0xC000, GETLAST16KBANK(cart));
  16. iremh3001_prom_slot[0] = 0;
  17. iremh3001_prom_slot[1] = 1;
  18. iremh3001_prom_slot[2] = GETLAST16KBANK(cart);
  19. set_vrom_bank_8k(0x0000, 4);
  20. iremh3001_vrom_slot[0] = 0;
  21. iremh3001_vrom_slot[1] = 0;
  22. iremh3001_vrom_slot[2] = 0;
  23. iremh3001_vrom_slot[3] = 0;
  24. iremh3001_vrom_slot[4] = 0;
  25. iremh3001_vrom_slot[5] = 0;
  26. iremh3001_vrom_slot[6] = 0;
  27. iremh3001_vrom_slot[7] = 0;
  28. return 0;
  29. }
  30. int iremh3001_MapperWriteHook(register uint8_t Addr, register uint8_t Value)
  31. {
  32. #if 0
  33. switch(Addr)
  34. {
  35. case 0x8000: /* Set 8k PROM @ 8000 */
  36. console_printf(Console_Default, "iremh3001: %X: change PROM to %d[%X]\n", Addr, Value, Value);
  37. set_prom_bank_8k(0x8000, Value);
  38. iremh3001_prom_slot[0] = Value;
  39. break;
  40. case 0x9003: /* Mirroring ??? */
  41. console_printf(Console_Default, "iremh3001: Mirroring[0x%X:%d] ?\n", Value, Value);
  42. break;
  43. case 0x9005: /* IRQ ??? */
  44. console_printf(Console_Default, "iremh3001: IRQ[0x%X:%d] ?\n", Value, Value);
  45. break;
  46. case 0x9006: /* IRQ ??? */
  47. console_printf(Console_Default, "iremh3001: IRQ[0x%X:%d] ?\n", Value, Value);
  48. break;
  49. case 0xA000: /* Set 8k PROM @ A000 */
  50. console_printf(Console_Default, "iremh3001: %X: change PROM to %d[%X]\n", Addr, Value, Value);
  51. set_prom_bank_8k(0xA000, Value);
  52. iremh3001_prom_slot[1] = Value;
  53. break;
  54. case 0xB000: /* Set 1k VROM @ 0000 */
  55. case 0xB001: /* Set 1k VROM @ 0400 */
  56. case 0xB002: /* Set 1k VROM @ 0800 */
  57. case 0xB003: /* Set 1k VROM @ 0C00 */
  58. case 0xB004: /* Set 1k VROM @ 1000 */
  59. case 0xB005: /* Set 1k VROM @ 1400 */
  60. case 0xB006: /* Set 1k VROM @ 1800 */
  61. case 0xB007: /* Set 1k VROM @ 1C00 */
  62. console_printf(Console_Default, "iremh3001: %X: change VROM to %d[%X]\n", (Addr&0x0F)<<10, Value, Value);
  63. set_vrom_bank_1k((Addr&0xF)<<10, Value);
  64. iremh3001_vrom_slot[Addr&0x0F] = Value;
  65. break;
  66. case 0xC000: /* Set 8k PROM @ C000 */
  67. console_printf(Console_Default, "iremh3001: %X: change PROM to %d[%X]\n", Addr, Value, Value);
  68. set_prom_bank_8k(0xC000, Value);
  69. iremh3001_prom_slot[2] = Value;
  70. break;
  71. default:
  72. console_printf(Console_Default, "@:%X -- V:%X", Addr, Value);
  73. return 0;
  74. }
  75. #endif
  76. return 1;
  77. }
  78. void iremh3001_MapperDump(FILE *fp)
  79. {
  80. fprintf(fp, "iremh3001: prom: $8000:%d $A000:%d $C000:%d\n",
  81. iremh3001_prom_slot[0],
  82. iremh3001_prom_slot[1],
  83. iremh3001_prom_slot[2]);
  84. fprintf(fp, "iremh3001: vrom: $0000:%d $0400:%d $0800:%d $0C00:%d\n" \
  85. " $1000:%d $1400:%d $1800:%d $1C00:%d\n",
  86. iremh3001_vrom_slot[0],
  87. iremh3001_vrom_slot[1],
  88. iremh3001_vrom_slot[2],
  89. iremh3001_vrom_slot[3],
  90. iremh3001_vrom_slot[4],
  91. iremh3001_vrom_slot[5],
  92. iremh3001_vrom_slot[6],
  93. iremh3001_vrom_slot[7]);
  94. }
  95. int iremh3001_MapperIRQ(int cycledone)
  96. {
  97. return 0;
  98. }