예제 #1
0
 public void Init(U8 bank, RAM remainder)
 {
     Bank      = bank;
     ModuleMem = remainder;
     Ram       = remainder?.Ram ?? NES.ram;
     Zp        = remainder?.Zp ?? NES.zp;
 }
예제 #2
0
 public Condition Equals(U8 v)
 {
     if (v != 0 || Flags.Zero.LastReg != this)
     {
         CPU6502.CPX(v);
     }
     return(Condition.EqualsZero);
 }
예제 #3
0
 public Condition NotEquals(U8 v)
 {
     if (v != 0 || Flags.Zero.LastReg != this)
     {
         CMP(v);
     }
     return(Condition.NotEqualsZero);
 }
예제 #4
0
        //private int _writeIndex = 0;

        public Bank(U8 id, int size, U16 origin, bool isFixed = false)
        {
            Id     = id;
            Origin = origin;
            Fixed  = isFixed;
            Rom    = new byte[size != 0 ? size : 65536];
            Size   = size;
            for (var i = 0; i < size; i++)
            {
                Rom[i] = 0xFF;
            }
        }
예제 #5
0
 public RegisterA Xor(U8 v) => A.Set(this).Xor(v);
예제 #6
0
 public RegisterA And(U8 v) => A.Set(this).And(v);
예제 #7
0
 public RegisterA Or(U8 v) => A.Set(this).Or(v);
예제 #8
0
 public RegisterA STA(U8 o) => STA((IOperand)o);
예제 #9
0
 public RegisterA Subtract(U8 v) => A.Set(this).Subtract(v);
예제 #10
0
 public Condition GreaterThan(U8 v) => A.Set(this).GreaterThan(v);
예제 #11
0
 public Condition LessThan(U8 v) => A.Set(this).LessThan(v);
예제 #12
0
 public RegisterX Set(U8 v) => Set((IOperand)v);
예제 #13
0
 public RegisterA ADC(U8 o) => ADC((IOperand)o);
예제 #14
0
 public Condition LessThan(U8 v) => LessThan((IOperand)v);
예제 #15
0
 //public Condition LessThanOrEqualTo(U8 v) => LessThanOrEqualTo((IOperand)v);
 public Condition LessThanOrEqualTo(U8 v) => LessThanOrEqualTo((IOperand)v);
예제 #16
0
 public Condition GreaterThanOrEqualTo(U8 v)
 {
     CMP(v);
     return(Condition.IsGreaterThanOrEqualTo);
 }
예제 #17
0
 public Condition GreaterThan(U8 v)
 {
     Temp[0].Set(A);
     A.Set(v).CMP(Temp[0]);
     return(Condition.IsGreaterThan);
 }
예제 #18
0
 public RegisterA BIT(U8 o) => BIT((IOperand)o);
예제 #19
0
 public Condition Equals(U8 v) => A.Set(this).Equals(v);
예제 #20
0
 public VByte Set(U8 u8) => Set((IOperand)u8);
예제 #21
0
 public Condition NotEquals(U8 v) => A.Set(this).NotEquals(v);
예제 #22
0
 public static void SetPointer(U8 v)
 {
     //TODO: if x is preserved, throw an exception
     X.Set(v);
     CPU6502.TXS();
 }
예제 #23
0
 public Condition GreaterThanOrEqualTo(U8 v) => A.Set(this).GreaterThanOrEqualTo(v);
예제 #24
0
 public RegisterA Xor(U8 o) => Xor((IOperand)o);
예제 #25
0
 public Condition LessThanOrEqualTo(U8 v) => A.Set(this).LessThanOrEqualTo(v);
예제 #26
0
 public RegisterA SBC(U8 o) => SBC((IOperand)o);
예제 #27
0
        //TODO: maybe only allow VByte indexing if struct.length is a power of two? or just do the damn multiply

        /*
         *      TODO:
         *
         *      Indexing won't be useful with AOS. Instead, maybe there should be some iteration helpers:
         *
         *      //Iterate(numTimes, bodyFunc)
         *      aosInstance.Iterate(5, sObj => {
         *              sObj.X.Set(5);
         *      });
         *      //Iterate(numTimes, initFunc, incrementFunc, bodyFunc)
         *      aosInstance.Iterate(5, Y.Set(5), () => Y.Increment(), sObj => {
         *              sObj.X.Set(5);
         *      });
         *
         *      Standalone Iterator class?
         *
         */

        //struct gets copied and not referenced, so Indexes don't hang around
        public StructType this[U8 offset] => _makeCopy(_structs[offset], null);
예제 #28
0
 public static ShiftRight        ShiftRight(this IResolvable <Address> addr, U8 bits) => new ShiftRight(addr, bits);
예제 #29
0
 public virtual Address Set(U8 v)
 {
     A.Set(v).STA(this); return(this);
 }
예제 #30
0
 public ShiftRight(IResolvable <Address> addr, U8 shiftAmt)
 {
     _addr     = addr;
     _shiftAmt = shiftAmt;
 }