Where, at the effective date of adoption or amendment of this Code, a lawful preexisting building, structure, or use, is made no longer permissible under the terms of this chapter as enacted or amended, such building, structure, or use shall be deemed to be a legal nonconforming building, structure, or use and shall comply with all provisions of this Code from that date forward. Except as otherwise set forth herein, any unlawful use of land or buildings existing at the time of adoption or amendment of this Code shall remain illegal and unlawful subject to all of the provisions and penalties of this chapter.