Class NintendoEntertainmentSystem

java.lang.Object
  |
  +--NMOS6502
        |
        +--N2A03
              |
              +--NintendoEntertainmentSystem

public final class NintendoEntertainmentSystem
extends N2A03

The NintendoEntertainmentSystem class emulates the Nintendo Entertainment System produced by Nintendo.
This class needs a lot of modifications and fixes (lots of bugs).
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
    protected  int joy_1
              Joypad 1 variable.
    protected  int joy_2
              Joypad 2 variable.
    protected  int joy_readbit1
              Joypad 1 bit variable.
    protected  int joy_readbit2
              Joypad 2 bit variable.
    protected  char[] Memory
              NES memory.
    protected  Video PPU
              NES picture processing unit.
    private  boolean reset_joy
              Joypad variable.
    protected  char[] RomImage
              Cart ROM image.
    protected  char[] VRomImage
              Cart VROM image.
     
    Fields inherited from class N2A03
    N2A03_DEFAULTCLOCK
     
    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
    NintendoEntertainmentSystem()
              Constructor.
    NintendoEntertainmentSystem(int RomPages, int VRomPages, boolean HasHorizontalMirroring)
              Constructor.
     
    Method Summary
    protected  void nes_timeslice()
               
    protected  boolean PPUPeriodic()
               
     int RDMEM(int Address)
              Read from memory.
     void WRMEM(int Address, int Value)
              Write to memory.
     
    Methods inherited from class N2A03
    ADC, n2a03_irq, SBC
     
    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, 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
     
    Methods inherited from class java.lang.Object
    , clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
     

    Field Detail

    RomImage

    protected char[] RomImage
    Cart ROM image.

    VRomImage

    protected char[] VRomImage
    Cart VROM image.

    Memory

    protected char[] Memory
    NES memory.
    0x10000 bytes of RAM.

    PPU

    protected Video PPU
    NES picture processing unit.

    joy_1

    protected int joy_1
    Joypad 1 variable.

    joy_2

    protected int joy_2
    Joypad 2 variable.

    joy_readbit1

    protected int joy_readbit1
    Joypad 1 bit variable.

    joy_readbit2

    protected int joy_readbit2
    Joypad 2 bit variable.

    reset_joy

    private boolean reset_joy
    Joypad variable.
    If $01 is written to $4016 then this value is set to true.
    Constructor Detail

    NintendoEntertainmentSystem

    public NintendoEntertainmentSystem()
    Constructor.

    NintendoEntertainmentSystem

    public NintendoEntertainmentSystem(int RomPages,
                                       int VRomPages,
                                       boolean HasHorizontalMirroring)
    Constructor.
    Parameters:
    RomPages - number of ROM pages.
    VRomPages - number of VROM pages.
    HasHorizontalMirroring - indicates if cart has horizontal or vertical mirroring.
    Method Detail

    WRMEM

    public void WRMEM(int Address,
                      int Value)
    Description copied from class: NMOS6502
    Write to memory.
    You have to provide this function.
    Overrides:
    WRMEM in class NMOS6502
    Following copied from class: NMOS6502
    Parameters:
    address - the memory address where you want to write.
    data - the value you want to write.

    RDMEM

    public int RDMEM(int Address)
    Description copied from class: NMOS6502
    Read from memory.
    You have to provide this function.
    Overrides:
    RDMEM in class NMOS6502
    Following copied from class: NMOS6502
    Parameters:
    address - is the memory address you want to read from.
    Returns:
    the unsigned byte read in memory.

    nes_timeslice

    protected void nes_timeslice()

    PPUPeriodic

    protected boolean PPUPeriodic()