You should probably still only be using the 340 version of the driver.
You will need to remove the -modeset settings in the /etc/rc.conf, and the newer 470 driver package. pkg delete
Then install the 340 driver package.
You will also need to clean up the /etc/rc.conf file to only attempt to only load the nvidia driver, not the newer nvidia-modeset driver.
A restart should bring things back to normal. There are a couple other threads on this topic with older nvidia graphics in the forums.
Per the FreeBSD Handbook with specific regard for versions 304 and 340 of the driver:
Then add the module to /etc/rc.conf
file, executing the following command:
The nvidia
driver must be used if the packages x11/nvidia-driver-304 or x11/nvidia-driver-340 have been installed.
# sysrc kld_list+=nvidia