Esempio n. 1
0
        public static void DebugGetNametable(int nametableIndex, out byte[] frameData, out byte[] tileData, out byte[] attributeData)
        {
            frameData     = new byte[256 * 240 * 4];
            tileData      = new byte[32 * 30];
            attributeData = new byte[32 * 30];

            GCHandle hFrameData     = GCHandle.Alloc(frameData, GCHandleType.Pinned);
            GCHandle hTileData      = GCHandle.Alloc(tileData, GCHandleType.Pinned);
            GCHandle hAttributeData = GCHandle.Alloc(attributeData, GCHandleType.Pinned);

            try {
                InteropEmu.DebugGetNametableWrapper((UInt32)nametableIndex, hFrameData.AddrOfPinnedObject(), hTileData.AddrOfPinnedObject(), hAttributeData.AddrOfPinnedObject());
            } finally {
                hFrameData.Free();
                hTileData.Free();
                hAttributeData.Free();
            }
        }