/// <summary> /// Changes the in-game auto-drive function state. /// </summary> /// <remarks> /// Requires any kind of directional input in-game in order to apply the change. /// </remarks> public static void ChangeAutoDrive(bool enableAutoDrive) { if (enableAutoDrive) { GenericMemory.Write <byte>(PlayerAddrs.NON_STATIC_AUTODRIVE, 1); } else { GenericMemory.Write <byte>(PlayerAddrs.NON_STATIC_AUTODRIVE, 0); } }
/// <summary> /// Changes car collision state. /// </summary> public static void ChangeCarCollision(bool enableCarCollision) { if (enableCarCollision) { GenericMemory.Write <byte>(PlayerAddrs.NON_STATIC_CAR_COLLISION, 0x74); } else { GenericMemory.Write <byte>(PlayerAddrs.NON_STATIC_CAR_COLLISION, 0xEB); } }
/// <summary> /// Changes wall collision state. /// </summary> public static void ChangeWallCollision(bool enableWallCollision) { if (enableWallCollision) { GenericMemory.Write <byte>(PlayerAddrs.NON_STATIC_WALL_COLLISION, 0x84); } else { GenericMemory.Write <byte>(PlayerAddrs.NON_STATIC_WALL_COLLISION, 0x38); } }
static CPU() { RegisterFile = new GenericMemory(16); DataMemory = new GenericMemory(16); PC = new ProgramCounter(); Instructions = new InstructionMemory(); IsReady = false; _clockCycle = 0; _isStalled = false; InstructionQueue = new Queue<Instruction>(); AwaitingRegisters = new HashSet<int>(); ForwardedRegisters = new Dictionary<int, int>(); }
static CPU() { RegisterFile = new GenericMemory(16); DataMemory = new GenericMemory(16); PC = new ProgramCounter(); Instructions = new InstructionMemory(); IsReady = false; _clockCycle = 0; _isStalled = false; InstructionQueue = new Queue <Instruction>(); AwaitingRegisters = new HashSet <int>(); ForwardedRegisters = new Dictionary <int, int>(); }
/// <summary> /// Changes powerup cooldown init-state. /// </summary> public static void ChangePowerupCooldown(bool enablePowerupCooldown, bool refreshCurrentCooldowns = false) { if (refreshCurrentCooldowns) { RechargeAllPowerups(); } if (enablePowerupCooldown) { GenericMemory.WriteByteArray(PlayerAddrs.NON_STATIC_POWERUP_COOLDOWN, new byte[] { 0x80, 0x7D, 0xFB, 0x0 }, true); } else { GenericMemory.WriteByteArray(PlayerAddrs.NON_STATIC_POWERUP_COOLDOWN, new byte[] { 0x3A, 0xC0, 0x90, 0x90 }, true); } }
public CPU() { _registerFile = new GenericMemory(16); _dataMemory = new GenericMemory(16); _pc = new ProgramCounter(); _instructions = new InstructionMemory(); _stack = new ProcedureStack(); IsReady = false; ClockCycle = 0; _instructionExecution = 0; _isStalled = false; _instructionQueue = new Queue<Instruction>(); _awaitingRegisters = new HashSet<int>(); _forwardedRegisters = new Dictionary<int, int>(); ExecutionRecords = new List<ExecutionRecordList>(); Predictor = new BTB(); _registerFile.Write(0, 0); Instance = this; }