It is illegal to download or distribute copyrighted commercial games without permission. However, it is 100% legal to download homebrew and freeware games that are open source. These games are developed for free non-commercial use.