Example #1
0
        internal static Cpu.Status NEGF(Script vm)
        {
            var   srx = new SRX(vm, is_jump: false);
            float f0  = Float32.FromInt(vm.cpu.registers[srx.dst]);

            vm.cpu.registers[srx.dst] = Float32.ToInt(-f0);
            return(Cpu.Status.OK);
        }
Example #2
0
        internal static Cpu.Status SUBF(Script vm)
        {
            var   lrx = new LRX(vm);
            float f0  = Float32.FromInt(vm.cpu.registers[lrx.dst]);
            float f1  = Float32.FromInt(vm.cpu.registers[lrx.src]);

            vm.cpu.registers[lrx.dst] = Float32.ToInt(f0 - f1);
            return(Cpu.Status.OK);
        }
Example #3
0
        internal static Cpu.Status CVTFW(Script vm)
        {
            var   srx   = new SRX(vm, is_jump: false);
            float value = Float32.FromInt(vm.cpu.registers[srx.dst]);

            // Floor float value to convert to int
            vm.cpu.registers[srx.dst] = (int)value;
            return(Cpu.Status.OK);
        }
Example #4
0
        internal static Cpu.Status CGEF(Script vm)
        {
            var   lrx = new LRX(vm);
            float f0  = Float32.FromInt(vm.cpu.registers[lrx.dst]);
            float f1  = Float32.FromInt(vm.cpu.registers[lrx.src]);

            vm.cpu.registers[Registers.EAX] = f0 >= f1 ? 1 : 0;
            return(Cpu.Status.OK);
        }