Talk:INES Mapper 018

From NESdev Wiki
Jump to navigationJump to search

- My notes bring "Jaleco SS8806" for this mapper. --Zepper 04:41, 27 December 2010 (UTC)

- Counter counts down actually. There is hardware tested verilog code for it:

   always @ (negedge m2)
   begin    
       if (mapper18_irq_control[0])
       begin
           reg carry;
           {carry, mapper18_irq_value[3:0]} = {1'b0, mapper18_irq_value[3:0]} - 1'b1;
           if (!mapper18_irq_control[3])
              {carry, mapper18_irq_value[7:4]} = {1'b0, mapper18_irq_value[7:4]} - carry;
           if (!mapper18_irq_control[3] && !mapper18_irq_control[2])
              {carry, mapper18_irq_value[11:8]} = {1'b0, mapper18_irq_value[11:8]} - carry;
           if (!mapper18_irq_control[3] && !mapper18_irq_control[2] && !mapper18_irq_control[1])
              {carry, mapper18_irq_value[15:12]} = {1'b0, mapper18_irq_value[15:12]} - carry;
           mapper18_irq_out = mapper18_irq_out | carry;
       end
   end

Also fceux source code:

   static void M18IRQHook(int a) {
       if (IRQa && IRQCount) {
           IRQCount -= a;
           if (IRQCount <= 0) {
               X6502_IRQBegin(FCEU_IQEXT);
               IRQCount = 0;
               IRQa = 0;
           }
       }
   }

Cluster (talk) 08:39, 14 September 2020 (MDT)