protected void updateNameTable(int suggestedPage) {
        int tilePix[] = null;
        int ySteps = currentPixelArrayWidth * PPUConstants.CHR_HEIGHT; // number of pixels to skip an entire level of horizontal tiles
        int tileOffset = 0;
        int pixOffset = 0;
        int tilePixOffset = 0;
        int ty = 0;
        int tx = 0;
        boolean megaTable = false;
        if (getTilesHigh() > PPUConstants.NAME_TABLE_HEIGHT || getTilesWide() > PPUConstants.NAME_TABLE_WIDTH) {
            megaTable = true;
        }
        int pg = suggestedPage;
        
        int tilesHigh = getTilesHigh();
        int tilesWide = getTilesWide();
        
        for (ty = 0; ty < tilesHigh; ty++) {
            for (tx = 0; tx < tilesWide; tx++) {
                pixOffset = (ty * ySteps) + (tx * PPUConstants.CHR_WIDTH);
                if (megaTable) {
                    pg = determinePage(tx, ty);
                    tileOffset = determineIndex(tx, ty);
                }

                CHRTile tile = modelRef.nameTableTiles[pg][tileOffset]; // broken
                if (tile == null) {
                    tilePix = new int[PPUConstants.CHR_HEIGHT * PPUConstants.CHR_WIDTH];
                } else {
                    tilePix = tile.getPix();
                }
                // draw the tile
                if (!megaTable) {
                    tileOffset++;
                }
                tilePixOffset = 0;
                for (int i = 0; i < PPUConstants.CHR_HEIGHT; i++) {
                    for (int q = 0; q < PPUConstants.CHR_WIDTH; q++) {
                        bgPix[pixOffset + q] = tilePix[tilePixOffset];
                        tilePixOffset++;
                    }
                    pixOffset += currentPixelArrayWidth;
                }
            }
        }
        updateNameTableSelection(pg);
    }