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

array sizes in GPU #16

Open
saku-koodari opened this issue Aug 28, 2016 · 1 comment
Open

array sizes in GPU #16

saku-koodari opened this issue Aug 28, 2016 · 1 comment

Comments

@saku-koodari
Copy link
Owner

Code snippet GPU's constructor:

        public GPU()
        {
            _logWriter = new LogWriter(typeof(GPU));

            // NOTE: if you use 3D array instead of jagged one, you could do this:
            // _tilemap = new byte[0x200, 0x8, 0x8];
            _tilemap = new byte[0x200][][];
            for (var i = 0; i < 0x200; i++)
            {
                _tilemap[i] = new byte[0x8][];
                for (var j = 0; j < 0x8; j++)
                {
                    _tilemap[i][j] = new byte[0x8];
                }
            }

            _vram = new int[0x2000]; //8192
            _oam = new byte[SCREEN_WIDTH];
            _reg = new int[1];
            throw new NotImplementedException("// TODO: find out what is the size of the _reg");
            _scanrow = new byte[SCREEN_WIDTH];
            _palette = new Palette(COLORS_IN_PALETTE);
            _objectData = new ObjectData[40];
            // TODO: you also might remove every hardcoded values from here.
            throw new NotImplementedException("// TODO: find out where ObjectData's size (40) comes from.");
            _screen = new Screen(SCREEN_WIDTH, SCREEN_HEIGHT, COLORS_IN_PALETTE); // TODO: maybe you can use this instead of constants?
        }
@saku-koodari
Copy link
Owner Author

Some specs from http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf

  • Max # of sprites: 40
  • Max # sprites/line: 10
  • Max sprite size: 8x16
  • Min sprite size: 8x8

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

No branches or pull requests

1 participant