Talk:INES Mapper 018: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
m (Created page with '- My notes bring "Jaleco SS8806" for this mapper. --~~~~')
 
No edit summary
 
Line 1: Line 1:
- My notes bring "Jaleco SS8806" for this mapper.
- My notes bring "Jaleco SS8806" for this mapper.
--[[User:Zepper|Zepper]] 04:41, 27 December 2010 (UTC)
--[[User:Zepper|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;
            }
        }
    }
[[User:Cluster|Cluster]] ([[User talk:Cluster|talk]]) 08:39, 14 September 2020 (MDT)

Latest revision as of 14:39, 14 September 2020

- 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)