iremh3001.c 3.3 KB

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