/* * Copyright (C) 2012 Brendan Robert (BLuRry) brendan.robert@gmail.com. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ package jace.hardware; import jace.config.ConfigurableField; import jace.config.Name; import jace.core.Card; import jace.core.Computer; import jace.core.RAMEvent; import jace.core.RAMEvent.TYPE; import jace.core.Utility; import jace.state.Stateful; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.Optional; import java.util.logging.Level; import java.util.logging.Logger; import javafx.scene.control.Label; /** * This card strives to be a clone of the Applied Engineering RamFactor card * http://www.downloads.reactivemicro.com/Public/Apple%20II%20Items/Hardware/RAMFactor/RAMFactor%20v1.5.pdf * * @author Brendan Robert (BLuRry) brendan.robert@gmail.com */ @Stateful @Name("RamFactor") public class CardRamFactor extends Card { int ADDR1 = 0; int ADDR2 = 1; int ADDR3 = 2; int DATA = 3; int BANK_SELECT = 0x0f; @ConfigurableField(category = "memory", name = "Ram size", description = "Size of card ram in KB", shortName = "size", defaultValue = "8192") public int RAM_SIZE = 8192; int actualSize = RAM_SIZE * 1024; // Important: pointer of current ram read/write for slinky access @Stateful int addressPointer = 0x0ffffff; @Stateful int firmwareBank = 0; @ConfigurableField(category = "performance", name = "Speed Boost", description = "Boost emulator speed when RAM in use", shortName = "boostSpeed", defaultValue = "false") public boolean speedBoost = false; @Override public String getDeviceName() { return "RamFactor"; } Optional