ProgCom.CPUem.handleHardware C# (CSharp) Method

handleHardware() private method

private handleHardware ( int cyclesElapsed ) : void
cyclesElapsed int
return void
        private void handleHardware(int cyclesElapsed)
        {
            //handle the floating point stacks
            fsbc[0] -= cyclesElapsed;
            if (fsbc[0] < 0)
                fsbc[0] = 0;
            fsbc[1] -= cyclesElapsed;
            if (fsbc[1] < 0)
                fsbc[1] = 0;

            //check all hardware
            foreach (IPCHardware hw in hardware) {
                try {
                    hw.tick(cyclesElapsed);
                }
                catch (Exception e) {
                    errorMessages.AddLast(e.Message + " in " + hw.GetType());
                    hasErrors = true;
                    try {
                        hw.disconnect();
                    } catch { };//we don't need to care about fuckups here, probably
                    hardware.Remove(hw);//make sure to unmap the hardware from memory
                    //move the above into a separate function
                }
            }
        }