Class N2A03

java.lang.Object
  |
  +--NMOS6502
        |
        +--N2A03
Direct Known Subclasses:
NintendoEntertainmentSystem

public abstract class N2A03
extends NMOS6502

The N2A03 class emulates the NMOS 6502 microprocessor produced by Ricoh and used in the NES.
The 2a03 is a 6502 CPU that does not support the decimal mode of the ADC and SBC instructions.
This code is GPL. Copyright (c) 2000 Brice Fines.

  • This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
  • This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
  • You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  • Version:
    0.2005 06/06/00
    Author:
    Jarod CANAL
    See Also:
    "The Gnu Public License."

    Field Summary
    private  double N2A03_DEFAULTCLOCK
              Default clock.
     
    Fields inherited from class NMOS6502
    accumulator, after_cli, CLEAR_LINE, effectiveAddress, F_B, F_C, F_D, F_I, F_N, F_T, F_V, F_Z, iCount, irq_callback, irq_state, M6502_INT_IRQ, M6502_INT_NMI, M6502_INT_NONE, M6502_IRQ_VEC, M6502_NMI_VEC, M6502_RST_VEC, M6502_SET_OVERFLOW, nmi_state, pending_irq, previousProgramCounter, processorStatus, programCounter, so_state, stackPointer, tmp, xIndexRegister, yIndexRegister, zeroPageAddress
     
    Constructor Summary
    N2A03()
              Constructor
     
    Method Summary
    protected  void ADC()
              Add with carry.
    protected  void n2a03_irq()
              N2A03 IRQ.
    protected  void SBC()
              Subtract with carry.
     
    Methods inherited from class NMOS6502
    AND, ASL, BCC, BCS, BEQ, BIT, BMI, BNE, BPL, BRA, BRK, BVC, BVS, changePC16, CLC, CLD, CLI, CLV, CMP, CPX, CPY, debugRegisters, DEC, DEX, DEY, EA_ABS, EA_ABX, EA_ABY, EA_IDX, EA_IDY, EA_IND, EA_ZPG, EA_ZPX, EA_ZPY, EOR, execute, ILL, INC, INX, INY, JMP, JSR, LDA, LDX, LDY, LSR, m6502_set_irq_callback, NOP, opcode0x02, opcode0x03, opcode0x04, opcode0x07, opcode0x0B, opcode0x0C, opcode0x0F, opcode0x12, opcode0x13, opcode0x14, opcode0x17, opcode0x1A, opcode0x1B, opcode0x1C, opcode0x1F, opcode0x22, opcode0x23, opcode0x27, opcode0x2B, opcode0x2F, opcode0x32, opcode0x33, opcode0x34, opcode0x37, opcode0x3A, opcode0x3B, opcode0x3C, opcode0x3F, opcode0x42, opcode0x43, opcode0x44, opcode0x47, opcode0x4B, opcode0x4F, opcode0x52, opcode0x53, opcode0x54, opcode0x57, opcode0x5A, opcode0x5B, opcode0x5C, opcode0x5F, opcode0x62, opcode0x63, opcode0x64, opcode0x67, opcode0x6B, opcode0x6F, opcode0x72, opcode0x73, opcode0x74, opcode0x77, opcode0x7A, opcode0x7B, opcode0x7C, opcode0x7F, opcode0x80, opcode0x82, opcode0x83, opcode0x87, opcode0x89, opcode0x8B, opcode0x8F, opcode0x92, opcode0x93, opcode0x97, opcode0x9B, opcode0x9C, opcode0x9E, opcode0x9F, opcode0xA3, opcode0xA7, opcode0xAB, opcode0xAF, opcode0xB2, opcode0xB3, opcode0xB7, opcode0xBB, opcode0xBF, opcode0xC2, opcode0xC3, opcode0xC7, opcode0xCB, opcode0xCF, opcode0xD2, opcode0xD3, opcode0xD4, opcode0xD7, opcode0xDA, opcode0xDB, opcode0xDC, opcode0xDF, opcode0xE2, opcode0xE3, opcode0xE7, opcode0xEB, opcode0xEF, opcode0xF2, opcode0xF3, opcode0xF4, opcode0xF7, opcode0xFA, opcode0xFB, opcode0xFC, opcode0xFF, ORA, PHA, PHP, PLA, PLP, PULL, PUSH, RD_ABS, RD_ABX, RD_ABY, RD_ACC, RD_IDX, RD_IDY, RD_IMM, RD_ZPG, RD_ZPX, RD_ZPY, RDMEM, readOpcode, readOpcodeArgument, reset, ROL, ROR, RTI, RTS, SEC, SED, SEI, set_irq_line, set_nmi_line, setNZ, STA, STX, STY, switchOpcode, take_irq, TAX, TAY, TSX, TXA, TXS, TYA, WB_ACC, WB_EA, WR_ABS, WR_ABX, WR_ABY, WR_IDX, WR_IDY, WR_ZPG, WR_ZPX, WR_ZPY, WRMEM
     
    Methods inherited from class java.lang.Object
    , clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
     

    Field Detail

    N2A03_DEFAULTCLOCK

    private final double N2A03_DEFAULTCLOCK
    Default clock.
    (21477272.724 / 12).
    Constructor Detail

    N2A03

    public N2A03()
    Constructor
    Method Detail

    ADC

    protected final void ADC()
    Add with carry.
    Overrides:
    ADC in class NMOS6502

    SBC

    protected final void SBC()
    Subtract with carry.
    Overrides:
    SBC in class NMOS6502

    n2a03_irq

    protected final void n2a03_irq()
    N2A03 IRQ.
    The N2A03 is integrally tied to its PSG (they're on the same die). Bit 7 of address $4011 (the PSG's DPCM control register), when set, causes an IRQ to be generated. This function allows the IRQ to be called from the PSG core when such an occasion arises.