Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Flags #41

Open
saku-koodari opened this issue Sep 6, 2016 · 0 comments
Open

Rename Flags #41

saku-koodari opened this issue Sep 6, 2016 · 0 comments

Comments

@saku-koodari
Copy link
Owner

saku-koodari commented Sep 6, 2016

Class Flag:

    public class Flag
    {
        public const byte Z = 0x80;

        public const byte N = 0x40;

        public const byte H = 0x20;

        public const byte C = 0x10;
    }

Class CPU (simplified):

    {
        private bool _isCpuRunning = false;

        // store registers Accessors values to these bytes.
        private byte _a, _b, _c, _d, _e, _f, _h, _l;
        private int _sp, _pc;

        public byte A { get; set; } // 8-bit register A. Value between 0x8000 - 0x0100.
        public byte F { get; set; } // 8-bit Flag register F. Value between 0x0080 - 0x0000
        public int AF { get; set; } // 16-bit register AF. Combined register A with register F.

        public byte B { get; set; } // 8-bit register B. Value betweem 0x8000 - 0x0100.
        public byte C { get; set; } // 8-bit register C. Value between 0x0080 - 0x0000.
        public int BC { get; set; } // 16-bit register BC. Combined register B with register C.

        public byte D { get; set; } // 8-bit register D. Value between 0x8000 - 0x0100.
        public byte E { get; set; } // 8-bit register E. Value between 0x0080 - 0x0000.
        public int DE { get; set; } // 16-bit register DE. Combined register D with register E.

        public byte H { get; set; } // 8-bit register H. Value between 0x8000 - 0x0100.
        public byte L { get; set; } // 8-bit register L. Value between 0x0080 - 0x0000.
        public int HL { get; set; } // 16-bit register HL. Combined register H with register L.

        public int SP { get; set; } // 16-bit Stack Pointer register
        public int PC { get; set; } // 16-bit Program Counter. Initialize value 0x100.

        // Rest of the class

As you can see, C and His both at Flag and CPU. Therefore VS gives warning:

Warning CS0108 'LR35902.C' hides inherited member 'Flag.C'. Use the new keyword if hiding was intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant